index
int64
0
0
repo_id
stringlengths
21
232
file_path
stringlengths
34
259
content
stringlengths
1
14.1M
__index_level_0__
int64
0
10k
0
kubeflow_public_repos/fate-operator/vendor/github.com/go-openapi
kubeflow_public_repos/fate-operator/vendor/github.com/go-openapi/jsonreference/reference.go
// Copyright 2013 sigu-399 ( https://github.com/sigu-399 ) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // author sigu-399 // author-github https://github.com/sigu-399 // author-mail [email protected] // // repository-name jsonreference // repository-desc An implementation of JSON Reference - Go language // // description Main and unique file. // // created 26-02-2013 package jsonreference import ( "errors" "net/url" "strings" "github.com/PuerkitoBio/purell" "github.com/go-openapi/jsonpointer" ) const ( fragmentRune = `#` ) // New creates a new reference for the given string func New(jsonReferenceString string) (Ref, error) { var r Ref err := r.parse(jsonReferenceString) return r, err } // MustCreateRef parses the ref string and panics when it's invalid. // Use the New method for a version that returns an error func MustCreateRef(ref string) Ref { r, err := New(ref) if err != nil { panic(err) } return r } // Ref represents a json reference object type Ref struct { referenceURL *url.URL referencePointer jsonpointer.Pointer HasFullURL bool HasURLPathOnly bool HasFragmentOnly bool HasFileScheme bool HasFullFilePath bool } // GetURL gets the URL for this reference func (r *Ref) GetURL() *url.URL { return r.referenceURL } // GetPointer gets the json pointer for this reference func (r *Ref) GetPointer() *jsonpointer.Pointer { return &r.referencePointer } // String returns the best version of the url for this reference func (r *Ref) String() string { if r.referenceURL != nil { return r.referenceURL.String() } if r.HasFragmentOnly { return fragmentRune + r.referencePointer.String() } return r.referencePointer.String() } // IsRoot returns true if this reference is a root document func (r *Ref) IsRoot() bool { return r.referenceURL != nil && !r.IsCanonical() && !r.HasURLPathOnly && r.referenceURL.Fragment == "" } // IsCanonical returns true when this pointer starts with http(s):// or file:// func (r *Ref) IsCanonical() bool { return (r.HasFileScheme && r.HasFullFilePath) || (!r.HasFileScheme && r.HasFullURL) } // "Constructor", parses the given string JSON reference func (r *Ref) parse(jsonReferenceString string) error { parsed, err := url.Parse(jsonReferenceString) if err != nil { return err } r.referenceURL, _ = url.Parse(purell.NormalizeURL(parsed, purell.FlagsSafe|purell.FlagRemoveDuplicateSlashes)) refURL := r.referenceURL if refURL.Scheme != "" && refURL.Host != "" { r.HasFullURL = true } else { if refURL.Path != "" { r.HasURLPathOnly = true } else if refURL.RawQuery == "" && refURL.Fragment != "" { r.HasFragmentOnly = true } } r.HasFileScheme = refURL.Scheme == "file" r.HasFullFilePath = strings.HasPrefix(refURL.Path, "/") // invalid json-pointer error means url has no json-pointer fragment. simply ignore error r.referencePointer, _ = jsonpointer.New(refURL.Fragment) return nil } // Inherits creates a new reference from a parent and a child // If the child cannot inherit from the parent, an error is returned func (r *Ref) Inherits(child Ref) (*Ref, error) { childURL := child.GetURL() parentURL := r.GetURL() if childURL == nil { return nil, errors.New("child url is nil") } if parentURL == nil { return &child, nil } ref, err := New(parentURL.ResolveReference(childURL).String()) if err != nil { return nil, err } return &ref, nil }
8,900
0
kubeflow_public_repos/fate-operator/vendor/github.com/go-openapi
kubeflow_public_repos/fate-operator/vendor/github.com/go-openapi/jsonreference/go.sum
github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-openapi/jsonpointer v0.19.2 h1:A9+F4Dc/MCNB5jibxf6rRvOvR/iFgQdyNx9eIhnGqq0= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/swag v0.19.2 h1:jvO6bCMBEilGwMfHhrd61zIID4oIFdwb76V17SM88dE= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63 h1:nTT4s92Dgz2HlrB2NaMgvlfqHH39OgMhA7z3PK7PGD4= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980 h1:dfGZHvZk057jK2MCeWus/TowKpJ8y4AmooUzdBSR9GU= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 h1:k7pJ2yAPLPgbskkFdhRCsA77k2fySZ1zf2zCjvQCiIM= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
8,901
0
kubeflow_public_repos/fate-operator/vendor/github.com/go-openapi
kubeflow_public_repos/fate-operator/vendor/github.com/go-openapi/jsonreference/.travis.yml
after_success: - bash <(curl -s https://codecov.io/bash) go: - 1.11.x - 1.12.x install: - GO111MODULE=off go get -u gotest.tools/gotestsum env: - GO111MODULE=on language: go notifications: slack: secure: OpQG/36F7DSF00HLm9WZMhyqFCYYyYTsVDObW226cWiR8PWYiNfLZiSEvIzT1Gx4dDjhigKTIqcLhG34CkL5iNXDjm9Yyo2RYhQPlK8NErNqUEXuBqn4RqYHW48VGhEhOyDd4Ei0E2FN5ZbgpvHgtpkdZ6XDi64r3Ac89isP9aPHXQTuv2Jog6b4/OKKiUTftLcTIst0p4Cp3gqOJWf1wnoj+IadWiECNVQT6zb47IYjtyw6+uV8iUjTzdKcRB6Zc6b4Dq7JAg1Zd7Jfxkql3hlKp4PNlRf9Cy7y5iA3G7MLyg3FcPX5z2kmcyPt2jOTRMBWUJ5zIQpOxizAcN8WsT3WWBL5KbuYK6k0PzujrIDLqdxGpNmjkkMfDBT9cKmZpm2FdW+oZgPFJP+oKmAo4u4KJz/vjiPTXgQlN5bmrLuRMCp+AwC5wkIohTqWZVPE2TK6ZSnMYcg/W39s+RP/9mJoyryAvPSpBOLTI+biCgaUCTOAZxNTWpMFc3tPYntc41WWkdKcooZ9JA5DwfcaVFyTGQ3YXz+HvX6G1z/gW0Q/A4dBi9mj2iE1xm7tRTT+4VQ2AXFvSEI1HJpfPgYnwAtwOD1v3Qm2EUHk9sCdtEDR4wVGEPIVn44GnwFMnGKx9JWppMPYwFu3SVDdHt+E+LOlhZUply11Aa+IVrT2KUQ= script: - gotestsum -f short-verbose -- -race -coverprofile=coverage.txt -covermode=atomic ./...
8,902
0
kubeflow_public_repos/fate-operator/vendor/github.com/go-openapi
kubeflow_public_repos/fate-operator/vendor/github.com/go-openapi/jsonpointer/CODE_OF_CONDUCT.md
# Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences * Gracefully accepting constructive criticism * Focusing on what is best for the community * Showing empathy towards other community members Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] [homepage]: http://contributor-covenant.org [version]: http://contributor-covenant.org/version/1/4/
8,903
0
kubeflow_public_repos/fate-operator/vendor/github.com/go-openapi
kubeflow_public_repos/fate-operator/vendor/github.com/go-openapi/jsonpointer/go.mod
module github.com/go-openapi/jsonpointer require ( github.com/go-openapi/swag v0.19.5 github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e // indirect github.com/stretchr/testify v1.3.0 ) go 1.13
8,904
0
kubeflow_public_repos/fate-operator/vendor/github.com/go-openapi
kubeflow_public_repos/fate-operator/vendor/github.com/go-openapi/jsonpointer/README.md
# gojsonpointer [![Build Status](https://travis-ci.org/go-openapi/jsonpointer.svg?branch=master)](https://travis-ci.org/go-openapi/jsonpointer) [![codecov](https://codecov.io/gh/go-openapi/jsonpointer/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/jsonpointer) [![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io) [![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/jsonpointer/master/LICENSE) [![GoDoc](https://godoc.org/github.com/go-openapi/jsonpointer?status.svg)](http://godoc.org/github.com/go-openapi/jsonpointer) An implementation of JSON Pointer - Go language ## Status Completed YES Tested YES ## References http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-07 ### Note The 4.Evaluation part of the previous reference, starting with 'If the currently referenced value is a JSON array, the reference token MUST contain either...' is not implemented.
8,905
0
kubeflow_public_repos/fate-operator/vendor/github.com/go-openapi
kubeflow_public_repos/fate-operator/vendor/github.com/go-openapi/jsonpointer/LICENSE
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
8,906
0
kubeflow_public_repos/fate-operator/vendor/github.com/go-openapi
kubeflow_public_repos/fate-operator/vendor/github.com/go-openapi/jsonpointer/pointer.go
// Copyright 2013 sigu-399 ( https://github.com/sigu-399 ) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // author sigu-399 // author-github https://github.com/sigu-399 // author-mail [email protected] // // repository-name jsonpointer // repository-desc An implementation of JSON Pointer - Go language // // description Main and unique file. // // created 25-02-2013 package jsonpointer import ( "errors" "fmt" "reflect" "strconv" "strings" "github.com/go-openapi/swag" ) const ( emptyPointer = `` pointerSeparator = `/` invalidStart = `JSON pointer must be empty or start with a "` + pointerSeparator ) var jsonPointableType = reflect.TypeOf(new(JSONPointable)).Elem() var jsonSetableType = reflect.TypeOf(new(JSONSetable)).Elem() // JSONPointable is an interface for structs to implement when they need to customize the // json pointer process type JSONPointable interface { JSONLookup(string) (interface{}, error) } // JSONSetable is an interface for structs to implement when they need to customize the // json pointer process type JSONSetable interface { JSONSet(string, interface{}) error } // New creates a new json pointer for the given string func New(jsonPointerString string) (Pointer, error) { var p Pointer err := p.parse(jsonPointerString) return p, err } // Pointer the json pointer reprsentation type Pointer struct { referenceTokens []string } // "Constructor", parses the given string JSON pointer func (p *Pointer) parse(jsonPointerString string) error { var err error if jsonPointerString != emptyPointer { if !strings.HasPrefix(jsonPointerString, pointerSeparator) { err = errors.New(invalidStart) } else { referenceTokens := strings.Split(jsonPointerString, pointerSeparator) for _, referenceToken := range referenceTokens[1:] { p.referenceTokens = append(p.referenceTokens, referenceToken) } } } return err } // Get uses the pointer to retrieve a value from a JSON document func (p *Pointer) Get(document interface{}) (interface{}, reflect.Kind, error) { return p.get(document, swag.DefaultJSONNameProvider) } // Set uses the pointer to set a value from a JSON document func (p *Pointer) Set(document interface{}, value interface{}) (interface{}, error) { return document, p.set(document, value, swag.DefaultJSONNameProvider) } // GetForToken gets a value for a json pointer token 1 level deep func GetForToken(document interface{}, decodedToken string) (interface{}, reflect.Kind, error) { return getSingleImpl(document, decodedToken, swag.DefaultJSONNameProvider) } // SetForToken gets a value for a json pointer token 1 level deep func SetForToken(document interface{}, decodedToken string, value interface{}) (interface{}, error) { return document, setSingleImpl(document, value, decodedToken, swag.DefaultJSONNameProvider) } func getSingleImpl(node interface{}, decodedToken string, nameProvider *swag.NameProvider) (interface{}, reflect.Kind, error) { rValue := reflect.Indirect(reflect.ValueOf(node)) kind := rValue.Kind() switch kind { case reflect.Struct: if rValue.Type().Implements(jsonPointableType) { r, err := node.(JSONPointable).JSONLookup(decodedToken) if err != nil { return nil, kind, err } return r, kind, nil } nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken) if !ok { return nil, kind, fmt.Errorf("object has no field %q", decodedToken) } fld := rValue.FieldByName(nm) return fld.Interface(), kind, nil case reflect.Map: kv := reflect.ValueOf(decodedToken) mv := rValue.MapIndex(kv) if mv.IsValid() { return mv.Interface(), kind, nil } return nil, kind, fmt.Errorf("object has no key %q", decodedToken) case reflect.Slice: tokenIndex, err := strconv.Atoi(decodedToken) if err != nil { return nil, kind, err } sLength := rValue.Len() if tokenIndex < 0 || tokenIndex >= sLength { return nil, kind, fmt.Errorf("index out of bounds array[0,%d] index '%d'", sLength-1, tokenIndex) } elem := rValue.Index(tokenIndex) return elem.Interface(), kind, nil default: return nil, kind, fmt.Errorf("invalid token reference %q", decodedToken) } } func setSingleImpl(node, data interface{}, decodedToken string, nameProvider *swag.NameProvider) error { rValue := reflect.Indirect(reflect.ValueOf(node)) switch rValue.Kind() { case reflect.Struct: if ns, ok := node.(JSONSetable); ok { // pointer impl return ns.JSONSet(decodedToken, data) } if rValue.Type().Implements(jsonSetableType) { return node.(JSONSetable).JSONSet(decodedToken, data) } nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken) if !ok { return fmt.Errorf("object has no field %q", decodedToken) } fld := rValue.FieldByName(nm) if fld.IsValid() { fld.Set(reflect.ValueOf(data)) } return nil case reflect.Map: kv := reflect.ValueOf(decodedToken) rValue.SetMapIndex(kv, reflect.ValueOf(data)) return nil case reflect.Slice: tokenIndex, err := strconv.Atoi(decodedToken) if err != nil { return err } sLength := rValue.Len() if tokenIndex < 0 || tokenIndex >= sLength { return fmt.Errorf("index out of bounds array[0,%d] index '%d'", sLength, tokenIndex) } elem := rValue.Index(tokenIndex) if !elem.CanSet() { return fmt.Errorf("can't set slice index %s to %v", decodedToken, data) } elem.Set(reflect.ValueOf(data)) return nil default: return fmt.Errorf("invalid token reference %q", decodedToken) } } func (p *Pointer) get(node interface{}, nameProvider *swag.NameProvider) (interface{}, reflect.Kind, error) { if nameProvider == nil { nameProvider = swag.DefaultJSONNameProvider } kind := reflect.Invalid // Full document when empty if len(p.referenceTokens) == 0 { return node, kind, nil } for _, token := range p.referenceTokens { decodedToken := Unescape(token) r, knd, err := getSingleImpl(node, decodedToken, nameProvider) if err != nil { return nil, knd, err } node, kind = r, knd } rValue := reflect.ValueOf(node) kind = rValue.Kind() return node, kind, nil } func (p *Pointer) set(node, data interface{}, nameProvider *swag.NameProvider) error { knd := reflect.ValueOf(node).Kind() if knd != reflect.Ptr && knd != reflect.Struct && knd != reflect.Map && knd != reflect.Slice && knd != reflect.Array { return fmt.Errorf("only structs, pointers, maps and slices are supported for setting values") } if nameProvider == nil { nameProvider = swag.DefaultJSONNameProvider } // Full document when empty if len(p.referenceTokens) == 0 { return nil } lastI := len(p.referenceTokens) - 1 for i, token := range p.referenceTokens { isLastToken := i == lastI decodedToken := Unescape(token) if isLastToken { return setSingleImpl(node, data, decodedToken, nameProvider) } rValue := reflect.Indirect(reflect.ValueOf(node)) kind := rValue.Kind() switch kind { case reflect.Struct: if rValue.Type().Implements(jsonPointableType) { r, err := node.(JSONPointable).JSONLookup(decodedToken) if err != nil { return err } fld := reflect.ValueOf(r) if fld.CanAddr() && fld.Kind() != reflect.Interface && fld.Kind() != reflect.Map && fld.Kind() != reflect.Slice && fld.Kind() != reflect.Ptr { node = fld.Addr().Interface() continue } node = r continue } nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken) if !ok { return fmt.Errorf("object has no field %q", decodedToken) } fld := rValue.FieldByName(nm) if fld.CanAddr() && fld.Kind() != reflect.Interface && fld.Kind() != reflect.Map && fld.Kind() != reflect.Slice && fld.Kind() != reflect.Ptr { node = fld.Addr().Interface() continue } node = fld.Interface() case reflect.Map: kv := reflect.ValueOf(decodedToken) mv := rValue.MapIndex(kv) if !mv.IsValid() { return fmt.Errorf("object has no key %q", decodedToken) } if mv.CanAddr() && mv.Kind() != reflect.Interface && mv.Kind() != reflect.Map && mv.Kind() != reflect.Slice && mv.Kind() != reflect.Ptr { node = mv.Addr().Interface() continue } node = mv.Interface() case reflect.Slice: tokenIndex, err := strconv.Atoi(decodedToken) if err != nil { return err } sLength := rValue.Len() if tokenIndex < 0 || tokenIndex >= sLength { return fmt.Errorf("index out of bounds array[0,%d] index '%d'", sLength, tokenIndex) } elem := rValue.Index(tokenIndex) if elem.CanAddr() && elem.Kind() != reflect.Interface && elem.Kind() != reflect.Map && elem.Kind() != reflect.Slice && elem.Kind() != reflect.Ptr { node = elem.Addr().Interface() continue } node = elem.Interface() default: return fmt.Errorf("invalid token reference %q", decodedToken) } } return nil } // DecodedTokens returns the decoded tokens func (p *Pointer) DecodedTokens() []string { result := make([]string, 0, len(p.referenceTokens)) for _, t := range p.referenceTokens { result = append(result, Unescape(t)) } return result } // IsEmpty returns true if this is an empty json pointer // this indicates that it points to the root document func (p *Pointer) IsEmpty() bool { return len(p.referenceTokens) == 0 } // Pointer to string representation function func (p *Pointer) String() string { if len(p.referenceTokens) == 0 { return emptyPointer } pointerString := pointerSeparator + strings.Join(p.referenceTokens, pointerSeparator) return pointerString } // Specific JSON pointer encoding here // ~0 => ~ // ~1 => / // ... and vice versa const ( encRefTok0 = `~0` encRefTok1 = `~1` decRefTok0 = `~` decRefTok1 = `/` ) // Unescape unescapes a json pointer reference token string to the original representation func Unescape(token string) string { step1 := strings.Replace(token, encRefTok1, decRefTok1, -1) step2 := strings.Replace(step1, encRefTok0, decRefTok0, -1) return step2 } // Escape escapes a pointer reference token string func Escape(token string) string { step1 := strings.Replace(token, decRefTok0, encRefTok0, -1) step2 := strings.Replace(step1, decRefTok1, encRefTok1, -1) return step2 }
8,907
0
kubeflow_public_repos/fate-operator/vendor/github.com/go-openapi
kubeflow_public_repos/fate-operator/vendor/github.com/go-openapi/jsonpointer/go.sum
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63 h1:nTT4s92Dgz2HlrB2NaMgvlfqHH39OgMhA7z3PK7PGD4= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
8,908
0
kubeflow_public_repos/fate-operator/vendor/github.com/go-openapi
kubeflow_public_repos/fate-operator/vendor/github.com/go-openapi/jsonpointer/.editorconfig
# top-most EditorConfig file root = true # Unix-style newlines with a newline ending every file [*] end_of_line = lf insert_final_newline = true indent_style = space indent_size = 2 trim_trailing_whitespace = true # Set default charset [*.{js,py,go,scala,rb,java,html,css,less,sass,md}] charset = utf-8 # Tab indentation (no size specified) [*.go] indent_style = tab [*.md] trim_trailing_whitespace = false # Matches the exact files either package.json or .travis.yml [{package.json,.travis.yml}] indent_style = space indent_size = 2
8,909
0
kubeflow_public_repos/fate-operator/vendor/github.com/go-openapi
kubeflow_public_repos/fate-operator/vendor/github.com/go-openapi/jsonpointer/.travis.yml
after_success: - bash <(curl -s https://codecov.io/bash) go: - 1.11.x - 1.12.x install: - GO111MODULE=off go get -u gotest.tools/gotestsum env: - GO111MODULE=on language: go notifications: slack: secure: a5VgoiwB1G/AZqzmephPZIhEB9avMlsWSlVnM1dSAtYAwdrQHGTQxAmpOxYIoSPDhWNN5bfZmjd29++UlTwLcHSR+e0kJhH6IfDlsHj/HplNCJ9tyI0zYc7XchtdKgeMxMzBKCzgwFXGSbQGydXTliDNBo0HOzmY3cou/daMFTP60K+offcjS+3LRAYb1EroSRXZqrk1nuF/xDL3792DZUdPMiFR/L/Df6y74D6/QP4sTkTDFQitz4Wy/7jbsfj8dG6qK2zivgV6/l+w4OVjFkxVpPXogDWY10vVXNVynqxfJ7to2d1I9lNCHE2ilBCkWMIPdyJF7hjF8pKW+82yP4EzRh0vu8Xn0HT5MZpQxdRY/YMxNrWaG7SxsoEaO4q5uhgdzAqLYY3TRa7MjIK+7Ur+aqOeTXn6OKwVi0CjvZ6mIU3WUKSwiwkFZMbjRAkSb5CYwMEfGFO/z964xz83qGt6WAtBXNotqCQpTIiKtDHQeLOMfksHImCg6JLhQcWBVxamVgu0G3Pdh8Y6DyPnxraXY95+QDavbjqv7TeYT9T/FNnrkXaTTK0s4iWE5H4ACU0Qvz0wUYgfQrZv0/Hp7V17+rabUwnzYySHCy9SWX/7OV9Cfh31iMp9ZIffr76xmmThtOEqs8TrTtU6BWI3rWwvA9cXQipZTVtL0oswrGw= script: - gotestsum -f short-verbose -- -race -coverprofile=coverage.txt -covermode=atomic ./...
8,910
0
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic/LICENSE
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
8,911
0
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic/OpenAPIv2/OpenAPIv2.go
// Copyright 2020 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // THIS FILE IS AUTOMATICALLY GENERATED. package openapi_v2 import ( "fmt" "github.com/googleapis/gnostic/compiler" "gopkg.in/yaml.v3" "regexp" "strings" ) // Version returns the package name (and OpenAPI version). func Version() string { return "openapi_v2" } // NewAdditionalPropertiesItem creates an object of type AdditionalPropertiesItem if possible, returning an error if not. func NewAdditionalPropertiesItem(in *yaml.Node, context *compiler.Context) (*AdditionalPropertiesItem, error) { errors := make([]error, 0) x := &AdditionalPropertiesItem{} matched := false // Schema schema = 1; { m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewSchema(m, compiler.NewContext("schema", m, context)) if matchingError == nil { x.Oneof = &AdditionalPropertiesItem_Schema{Schema: t} matched = true } else { errors = append(errors, matchingError) } } } // bool boolean = 2; boolValue, ok := compiler.BoolForScalarNode(in) if ok { x.Oneof = &AdditionalPropertiesItem_Boolean{Boolean: boolValue} matched = true } if matched { // since the oneof matched one of its possibilities, discard any matching errors errors = make([]error, 0) } else { message := fmt.Sprintf("contains an invalid AdditionalPropertiesItem") err := compiler.NewError(context, message) errors = []error{err} } return x, compiler.NewErrorGroupOrNil(errors) } // NewAny creates an object of type Any if possible, returning an error if not. func NewAny(in *yaml.Node, context *compiler.Context) (*Any, error) { errors := make([]error, 0) x := &Any{} bytes := compiler.Marshal(in) x.Yaml = string(bytes) return x, compiler.NewErrorGroupOrNil(errors) } // NewApiKeySecurity creates an object of type ApiKeySecurity if possible, returning an error if not. func NewApiKeySecurity(in *yaml.Node, context *compiler.Context) (*ApiKeySecurity, error) { errors := make([]error, 0) x := &ApiKeySecurity{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"in", "name", "type"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } allowedKeys := []string{"description", "in", "name", "type"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string type = 1; v1 := compiler.MapValueForKey(m, "type") if v1 != nil { x.Type, ok = compiler.StringForScalarNode(v1) if !ok { message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [apiKey] if ok && !compiler.StringArrayContainsValue([]string{"apiKey"}, x.Type) { message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string name = 2; v2 := compiler.MapValueForKey(m, "name") if v2 != nil { x.Name, ok = compiler.StringForScalarNode(v2) if !ok { message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // string in = 3; v3 := compiler.MapValueForKey(m, "in") if v3 != nil { x.In, ok = compiler.StringForScalarNode(v3) if !ok { message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v3)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [header query] if ok && !compiler.StringArrayContainsValue([]string{"header", "query"}, x.In) { message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v3)) errors = append(errors, compiler.NewError(context, message)) } } // string description = 4; v4 := compiler.MapValueForKey(m, "description") if v4 != nil { x.Description, ok = compiler.StringForScalarNode(v4) if !ok { message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 5; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewBasicAuthenticationSecurity creates an object of type BasicAuthenticationSecurity if possible, returning an error if not. func NewBasicAuthenticationSecurity(in *yaml.Node, context *compiler.Context) (*BasicAuthenticationSecurity, error) { errors := make([]error, 0) x := &BasicAuthenticationSecurity{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"type"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } allowedKeys := []string{"description", "type"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string type = 1; v1 := compiler.MapValueForKey(m, "type") if v1 != nil { x.Type, ok = compiler.StringForScalarNode(v1) if !ok { message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [basic] if ok && !compiler.StringArrayContainsValue([]string{"basic"}, x.Type) { message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string description = 2; v2 := compiler.MapValueForKey(m, "description") if v2 != nil { x.Description, ok = compiler.StringForScalarNode(v2) if !ok { message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 3; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewBodyParameter creates an object of type BodyParameter if possible, returning an error if not. func NewBodyParameter(in *yaml.Node, context *compiler.Context) (*BodyParameter, error) { errors := make([]error, 0) x := &BodyParameter{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"in", "name", "schema"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } allowedKeys := []string{"description", "in", "name", "required", "schema"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string description = 1; v1 := compiler.MapValueForKey(m, "description") if v1 != nil { x.Description, ok = compiler.StringForScalarNode(v1) if !ok { message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string name = 2; v2 := compiler.MapValueForKey(m, "name") if v2 != nil { x.Name, ok = compiler.StringForScalarNode(v2) if !ok { message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // string in = 3; v3 := compiler.MapValueForKey(m, "in") if v3 != nil { x.In, ok = compiler.StringForScalarNode(v3) if !ok { message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v3)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [body] if ok && !compiler.StringArrayContainsValue([]string{"body"}, x.In) { message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v3)) errors = append(errors, compiler.NewError(context, message)) } } // bool required = 4; v4 := compiler.MapValueForKey(m, "required") if v4 != nil { x.Required, ok = compiler.BoolForScalarNode(v4) if !ok { message := fmt.Sprintf("has unexpected value for required: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } } // Schema schema = 5; v5 := compiler.MapValueForKey(m, "schema") if v5 != nil { var err error x.Schema, err = NewSchema(v5, compiler.NewContext("schema", v5, context)) if err != nil { errors = append(errors, err) } } // repeated NamedAny vendor_extension = 6; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewContact creates an object of type Contact if possible, returning an error if not. func NewContact(in *yaml.Node, context *compiler.Context) (*Contact, error) { errors := make([]error, 0) x := &Contact{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"email", "name", "url"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { x.Name, ok = compiler.StringForScalarNode(v1) if !ok { message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string url = 2; v2 := compiler.MapValueForKey(m, "url") if v2 != nil { x.Url, ok = compiler.StringForScalarNode(v2) if !ok { message := fmt.Sprintf("has unexpected value for url: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // string email = 3; v3 := compiler.MapValueForKey(m, "email") if v3 != nil { x.Email, ok = compiler.StringForScalarNode(v3) if !ok { message := fmt.Sprintf("has unexpected value for email: %s", compiler.Display(v3)) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 4; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewDefault creates an object of type Default if possible, returning an error if not. func NewDefault(in *yaml.Node, context *compiler.Context) (*Default, error) { errors := make([]error, 0) x := &Default{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { // repeated NamedAny additional_properties = 1; // MAP: Any x.AdditionalProperties = make([]*NamedAny, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } } x.AdditionalProperties = append(x.AdditionalProperties, pair) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewDefinitions creates an object of type Definitions if possible, returning an error if not. func NewDefinitions(in *yaml.Node, context *compiler.Context) (*Definitions, error) { errors := make([]error, 0) x := &Definitions{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { // repeated NamedSchema additional_properties = 1; // MAP: Schema x.AdditionalProperties = make([]*NamedSchema, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] pair := &NamedSchema{} pair.Name = k var err error pair.Value, err = NewSchema(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } x.AdditionalProperties = append(x.AdditionalProperties, pair) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewDocument creates an object of type Document if possible, returning an error if not. func NewDocument(in *yaml.Node, context *compiler.Context) (*Document, error) { errors := make([]error, 0) x := &Document{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"info", "paths", "swagger"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } allowedKeys := []string{"basePath", "consumes", "definitions", "externalDocs", "host", "info", "parameters", "paths", "produces", "responses", "schemes", "security", "securityDefinitions", "swagger", "tags"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string swagger = 1; v1 := compiler.MapValueForKey(m, "swagger") if v1 != nil { x.Swagger, ok = compiler.StringForScalarNode(v1) if !ok { message := fmt.Sprintf("has unexpected value for swagger: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [2.0] if ok && !compiler.StringArrayContainsValue([]string{"2.0"}, x.Swagger) { message := fmt.Sprintf("has unexpected value for swagger: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // Info info = 2; v2 := compiler.MapValueForKey(m, "info") if v2 != nil { var err error x.Info, err = NewInfo(v2, compiler.NewContext("info", v2, context)) if err != nil { errors = append(errors, err) } } // string host = 3; v3 := compiler.MapValueForKey(m, "host") if v3 != nil { x.Host, ok = compiler.StringForScalarNode(v3) if !ok { message := fmt.Sprintf("has unexpected value for host: %s", compiler.Display(v3)) errors = append(errors, compiler.NewError(context, message)) } } // string base_path = 4; v4 := compiler.MapValueForKey(m, "basePath") if v4 != nil { x.BasePath, ok = compiler.StringForScalarNode(v4) if !ok { message := fmt.Sprintf("has unexpected value for basePath: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } } // repeated string schemes = 5; v5 := compiler.MapValueForKey(m, "schemes") if v5 != nil { v, ok := compiler.SequenceNodeForNode(v5) if ok { x.Schemes = compiler.StringArrayForSequenceNode(v) } else { message := fmt.Sprintf("has unexpected value for schemes: %s", compiler.Display(v5)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [http https ws wss] if ok && !compiler.StringArrayContainsValues([]string{"http", "https", "ws", "wss"}, x.Schemes) { message := fmt.Sprintf("has unexpected value for schemes: %s", compiler.Display(v5)) errors = append(errors, compiler.NewError(context, message)) } } // repeated string consumes = 6; v6 := compiler.MapValueForKey(m, "consumes") if v6 != nil { v, ok := compiler.SequenceNodeForNode(v6) if ok { x.Consumes = compiler.StringArrayForSequenceNode(v) } else { message := fmt.Sprintf("has unexpected value for consumes: %s", compiler.Display(v6)) errors = append(errors, compiler.NewError(context, message)) } } // repeated string produces = 7; v7 := compiler.MapValueForKey(m, "produces") if v7 != nil { v, ok := compiler.SequenceNodeForNode(v7) if ok { x.Produces = compiler.StringArrayForSequenceNode(v) } else { message := fmt.Sprintf("has unexpected value for produces: %s", compiler.Display(v7)) errors = append(errors, compiler.NewError(context, message)) } } // Paths paths = 8; v8 := compiler.MapValueForKey(m, "paths") if v8 != nil { var err error x.Paths, err = NewPaths(v8, compiler.NewContext("paths", v8, context)) if err != nil { errors = append(errors, err) } } // Definitions definitions = 9; v9 := compiler.MapValueForKey(m, "definitions") if v9 != nil { var err error x.Definitions, err = NewDefinitions(v9, compiler.NewContext("definitions", v9, context)) if err != nil { errors = append(errors, err) } } // ParameterDefinitions parameters = 10; v10 := compiler.MapValueForKey(m, "parameters") if v10 != nil { var err error x.Parameters, err = NewParameterDefinitions(v10, compiler.NewContext("parameters", v10, context)) if err != nil { errors = append(errors, err) } } // ResponseDefinitions responses = 11; v11 := compiler.MapValueForKey(m, "responses") if v11 != nil { var err error x.Responses, err = NewResponseDefinitions(v11, compiler.NewContext("responses", v11, context)) if err != nil { errors = append(errors, err) } } // repeated SecurityRequirement security = 12; v12 := compiler.MapValueForKey(m, "security") if v12 != nil { // repeated SecurityRequirement x.Security = make([]*SecurityRequirement, 0) a, ok := compiler.SequenceNodeForNode(v12) if ok { for _, item := range a.Content { y, err := NewSecurityRequirement(item, compiler.NewContext("security", item, context)) if err != nil { errors = append(errors, err) } x.Security = append(x.Security, y) } } } // SecurityDefinitions security_definitions = 13; v13 := compiler.MapValueForKey(m, "securityDefinitions") if v13 != nil { var err error x.SecurityDefinitions, err = NewSecurityDefinitions(v13, compiler.NewContext("securityDefinitions", v13, context)) if err != nil { errors = append(errors, err) } } // repeated Tag tags = 14; v14 := compiler.MapValueForKey(m, "tags") if v14 != nil { // repeated Tag x.Tags = make([]*Tag, 0) a, ok := compiler.SequenceNodeForNode(v14) if ok { for _, item := range a.Content { y, err := NewTag(item, compiler.NewContext("tags", item, context)) if err != nil { errors = append(errors, err) } x.Tags = append(x.Tags, y) } } } // ExternalDocs external_docs = 15; v15 := compiler.MapValueForKey(m, "externalDocs") if v15 != nil { var err error x.ExternalDocs, err = NewExternalDocs(v15, compiler.NewContext("externalDocs", v15, context)) if err != nil { errors = append(errors, err) } } // repeated NamedAny vendor_extension = 16; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewExamples creates an object of type Examples if possible, returning an error if not. func NewExamples(in *yaml.Node, context *compiler.Context) (*Examples, error) { errors := make([]error, 0) x := &Examples{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { // repeated NamedAny additional_properties = 1; // MAP: Any x.AdditionalProperties = make([]*NamedAny, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } } x.AdditionalProperties = append(x.AdditionalProperties, pair) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewExternalDocs creates an object of type ExternalDocs if possible, returning an error if not. func NewExternalDocs(in *yaml.Node, context *compiler.Context) (*ExternalDocs, error) { errors := make([]error, 0) x := &ExternalDocs{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"url"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } allowedKeys := []string{"description", "url"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string description = 1; v1 := compiler.MapValueForKey(m, "description") if v1 != nil { x.Description, ok = compiler.StringForScalarNode(v1) if !ok { message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string url = 2; v2 := compiler.MapValueForKey(m, "url") if v2 != nil { x.Url, ok = compiler.StringForScalarNode(v2) if !ok { message := fmt.Sprintf("has unexpected value for url: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 3; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewFileSchema creates an object of type FileSchema if possible, returning an error if not. func NewFileSchema(in *yaml.Node, context *compiler.Context) (*FileSchema, error) { errors := make([]error, 0) x := &FileSchema{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"type"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } allowedKeys := []string{"default", "description", "example", "externalDocs", "format", "readOnly", "required", "title", "type"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string format = 1; v1 := compiler.MapValueForKey(m, "format") if v1 != nil { x.Format, ok = compiler.StringForScalarNode(v1) if !ok { message := fmt.Sprintf("has unexpected value for format: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string title = 2; v2 := compiler.MapValueForKey(m, "title") if v2 != nil { x.Title, ok = compiler.StringForScalarNode(v2) if !ok { message := fmt.Sprintf("has unexpected value for title: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // string description = 3; v3 := compiler.MapValueForKey(m, "description") if v3 != nil { x.Description, ok = compiler.StringForScalarNode(v3) if !ok { message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v3)) errors = append(errors, compiler.NewError(context, message)) } } // Any default = 4; v4 := compiler.MapValueForKey(m, "default") if v4 != nil { var err error x.Default, err = NewAny(v4, compiler.NewContext("default", v4, context)) if err != nil { errors = append(errors, err) } } // repeated string required = 5; v5 := compiler.MapValueForKey(m, "required") if v5 != nil { v, ok := compiler.SequenceNodeForNode(v5) if ok { x.Required = compiler.StringArrayForSequenceNode(v) } else { message := fmt.Sprintf("has unexpected value for required: %s", compiler.Display(v5)) errors = append(errors, compiler.NewError(context, message)) } } // string type = 6; v6 := compiler.MapValueForKey(m, "type") if v6 != nil { x.Type, ok = compiler.StringForScalarNode(v6) if !ok { message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v6)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [file] if ok && !compiler.StringArrayContainsValue([]string{"file"}, x.Type) { message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v6)) errors = append(errors, compiler.NewError(context, message)) } } // bool read_only = 7; v7 := compiler.MapValueForKey(m, "readOnly") if v7 != nil { x.ReadOnly, ok = compiler.BoolForScalarNode(v7) if !ok { message := fmt.Sprintf("has unexpected value for readOnly: %s", compiler.Display(v7)) errors = append(errors, compiler.NewError(context, message)) } } // ExternalDocs external_docs = 8; v8 := compiler.MapValueForKey(m, "externalDocs") if v8 != nil { var err error x.ExternalDocs, err = NewExternalDocs(v8, compiler.NewContext("externalDocs", v8, context)) if err != nil { errors = append(errors, err) } } // Any example = 9; v9 := compiler.MapValueForKey(m, "example") if v9 != nil { var err error x.Example, err = NewAny(v9, compiler.NewContext("example", v9, context)) if err != nil { errors = append(errors, err) } } // repeated NamedAny vendor_extension = 10; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewFormDataParameterSubSchema creates an object of type FormDataParameterSubSchema if possible, returning an error if not. func NewFormDataParameterSubSchema(in *yaml.Node, context *compiler.Context) (*FormDataParameterSubSchema, error) { errors := make([]error, 0) x := &FormDataParameterSubSchema{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"allowEmptyValue", "collectionFormat", "default", "description", "enum", "exclusiveMaximum", "exclusiveMinimum", "format", "in", "items", "maxItems", "maxLength", "maximum", "minItems", "minLength", "minimum", "multipleOf", "name", "pattern", "required", "type", "uniqueItems"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // bool required = 1; v1 := compiler.MapValueForKey(m, "required") if v1 != nil { x.Required, ok = compiler.BoolForScalarNode(v1) if !ok { message := fmt.Sprintf("has unexpected value for required: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string in = 2; v2 := compiler.MapValueForKey(m, "in") if v2 != nil { x.In, ok = compiler.StringForScalarNode(v2) if !ok { message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [formData] if ok && !compiler.StringArrayContainsValue([]string{"formData"}, x.In) { message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // string description = 3; v3 := compiler.MapValueForKey(m, "description") if v3 != nil { x.Description, ok = compiler.StringForScalarNode(v3) if !ok { message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v3)) errors = append(errors, compiler.NewError(context, message)) } } // string name = 4; v4 := compiler.MapValueForKey(m, "name") if v4 != nil { x.Name, ok = compiler.StringForScalarNode(v4) if !ok { message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } } // bool allow_empty_value = 5; v5 := compiler.MapValueForKey(m, "allowEmptyValue") if v5 != nil { x.AllowEmptyValue, ok = compiler.BoolForScalarNode(v5) if !ok { message := fmt.Sprintf("has unexpected value for allowEmptyValue: %s", compiler.Display(v5)) errors = append(errors, compiler.NewError(context, message)) } } // string type = 6; v6 := compiler.MapValueForKey(m, "type") if v6 != nil { x.Type, ok = compiler.StringForScalarNode(v6) if !ok { message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v6)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [string number boolean integer array file] if ok && !compiler.StringArrayContainsValue([]string{"string", "number", "boolean", "integer", "array", "file"}, x.Type) { message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v6)) errors = append(errors, compiler.NewError(context, message)) } } // string format = 7; v7 := compiler.MapValueForKey(m, "format") if v7 != nil { x.Format, ok = compiler.StringForScalarNode(v7) if !ok { message := fmt.Sprintf("has unexpected value for format: %s", compiler.Display(v7)) errors = append(errors, compiler.NewError(context, message)) } } // PrimitivesItems items = 8; v8 := compiler.MapValueForKey(m, "items") if v8 != nil { var err error x.Items, err = NewPrimitivesItems(v8, compiler.NewContext("items", v8, context)) if err != nil { errors = append(errors, err) } } // string collection_format = 9; v9 := compiler.MapValueForKey(m, "collectionFormat") if v9 != nil { x.CollectionFormat, ok = compiler.StringForScalarNode(v9) if !ok { message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v9)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [csv ssv tsv pipes multi] if ok && !compiler.StringArrayContainsValue([]string{"csv", "ssv", "tsv", "pipes", "multi"}, x.CollectionFormat) { message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v9)) errors = append(errors, compiler.NewError(context, message)) } } // Any default = 10; v10 := compiler.MapValueForKey(m, "default") if v10 != nil { var err error x.Default, err = NewAny(v10, compiler.NewContext("default", v10, context)) if err != nil { errors = append(errors, err) } } // float maximum = 11; v11 := compiler.MapValueForKey(m, "maximum") if v11 != nil { v, ok := compiler.FloatForScalarNode(v11) if ok { x.Maximum = v } else { message := fmt.Sprintf("has unexpected value for maximum: %s", compiler.Display(v11)) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_maximum = 12; v12 := compiler.MapValueForKey(m, "exclusiveMaximum") if v12 != nil { x.ExclusiveMaximum, ok = compiler.BoolForScalarNode(v12) if !ok { message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %s", compiler.Display(v12)) errors = append(errors, compiler.NewError(context, message)) } } // float minimum = 13; v13 := compiler.MapValueForKey(m, "minimum") if v13 != nil { v, ok := compiler.FloatForScalarNode(v13) if ok { x.Minimum = v } else { message := fmt.Sprintf("has unexpected value for minimum: %s", compiler.Display(v13)) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_minimum = 14; v14 := compiler.MapValueForKey(m, "exclusiveMinimum") if v14 != nil { x.ExclusiveMinimum, ok = compiler.BoolForScalarNode(v14) if !ok { message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %s", compiler.Display(v14)) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_length = 15; v15 := compiler.MapValueForKey(m, "maxLength") if v15 != nil { t, ok := compiler.IntForScalarNode(v15) if ok { x.MaxLength = int64(t) } else { message := fmt.Sprintf("has unexpected value for maxLength: %s", compiler.Display(v15)) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_length = 16; v16 := compiler.MapValueForKey(m, "minLength") if v16 != nil { t, ok := compiler.IntForScalarNode(v16) if ok { x.MinLength = int64(t) } else { message := fmt.Sprintf("has unexpected value for minLength: %s", compiler.Display(v16)) errors = append(errors, compiler.NewError(context, message)) } } // string pattern = 17; v17 := compiler.MapValueForKey(m, "pattern") if v17 != nil { x.Pattern, ok = compiler.StringForScalarNode(v17) if !ok { message := fmt.Sprintf("has unexpected value for pattern: %s", compiler.Display(v17)) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_items = 18; v18 := compiler.MapValueForKey(m, "maxItems") if v18 != nil { t, ok := compiler.IntForScalarNode(v18) if ok { x.MaxItems = int64(t) } else { message := fmt.Sprintf("has unexpected value for maxItems: %s", compiler.Display(v18)) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_items = 19; v19 := compiler.MapValueForKey(m, "minItems") if v19 != nil { t, ok := compiler.IntForScalarNode(v19) if ok { x.MinItems = int64(t) } else { message := fmt.Sprintf("has unexpected value for minItems: %s", compiler.Display(v19)) errors = append(errors, compiler.NewError(context, message)) } } // bool unique_items = 20; v20 := compiler.MapValueForKey(m, "uniqueItems") if v20 != nil { x.UniqueItems, ok = compiler.BoolForScalarNode(v20) if !ok { message := fmt.Sprintf("has unexpected value for uniqueItems: %s", compiler.Display(v20)) errors = append(errors, compiler.NewError(context, message)) } } // repeated Any enum = 21; v21 := compiler.MapValueForKey(m, "enum") if v21 != nil { // repeated Any x.Enum = make([]*Any, 0) a, ok := compiler.SequenceNodeForNode(v21) if ok { for _, item := range a.Content { y, err := NewAny(item, compiler.NewContext("enum", item, context)) if err != nil { errors = append(errors, err) } x.Enum = append(x.Enum, y) } } } // float multiple_of = 22; v22 := compiler.MapValueForKey(m, "multipleOf") if v22 != nil { v, ok := compiler.FloatForScalarNode(v22) if ok { x.MultipleOf = v } else { message := fmt.Sprintf("has unexpected value for multipleOf: %s", compiler.Display(v22)) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 23; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewHeader creates an object of type Header if possible, returning an error if not. func NewHeader(in *yaml.Node, context *compiler.Context) (*Header, error) { errors := make([]error, 0) x := &Header{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"type"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } allowedKeys := []string{"collectionFormat", "default", "description", "enum", "exclusiveMaximum", "exclusiveMinimum", "format", "items", "maxItems", "maxLength", "maximum", "minItems", "minLength", "minimum", "multipleOf", "pattern", "type", "uniqueItems"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string type = 1; v1 := compiler.MapValueForKey(m, "type") if v1 != nil { x.Type, ok = compiler.StringForScalarNode(v1) if !ok { message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [string number integer boolean array] if ok && !compiler.StringArrayContainsValue([]string{"string", "number", "integer", "boolean", "array"}, x.Type) { message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string format = 2; v2 := compiler.MapValueForKey(m, "format") if v2 != nil { x.Format, ok = compiler.StringForScalarNode(v2) if !ok { message := fmt.Sprintf("has unexpected value for format: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // PrimitivesItems items = 3; v3 := compiler.MapValueForKey(m, "items") if v3 != nil { var err error x.Items, err = NewPrimitivesItems(v3, compiler.NewContext("items", v3, context)) if err != nil { errors = append(errors, err) } } // string collection_format = 4; v4 := compiler.MapValueForKey(m, "collectionFormat") if v4 != nil { x.CollectionFormat, ok = compiler.StringForScalarNode(v4) if !ok { message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [csv ssv tsv pipes] if ok && !compiler.StringArrayContainsValue([]string{"csv", "ssv", "tsv", "pipes"}, x.CollectionFormat) { message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } } // Any default = 5; v5 := compiler.MapValueForKey(m, "default") if v5 != nil { var err error x.Default, err = NewAny(v5, compiler.NewContext("default", v5, context)) if err != nil { errors = append(errors, err) } } // float maximum = 6; v6 := compiler.MapValueForKey(m, "maximum") if v6 != nil { v, ok := compiler.FloatForScalarNode(v6) if ok { x.Maximum = v } else { message := fmt.Sprintf("has unexpected value for maximum: %s", compiler.Display(v6)) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_maximum = 7; v7 := compiler.MapValueForKey(m, "exclusiveMaximum") if v7 != nil { x.ExclusiveMaximum, ok = compiler.BoolForScalarNode(v7) if !ok { message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %s", compiler.Display(v7)) errors = append(errors, compiler.NewError(context, message)) } } // float minimum = 8; v8 := compiler.MapValueForKey(m, "minimum") if v8 != nil { v, ok := compiler.FloatForScalarNode(v8) if ok { x.Minimum = v } else { message := fmt.Sprintf("has unexpected value for minimum: %s", compiler.Display(v8)) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_minimum = 9; v9 := compiler.MapValueForKey(m, "exclusiveMinimum") if v9 != nil { x.ExclusiveMinimum, ok = compiler.BoolForScalarNode(v9) if !ok { message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %s", compiler.Display(v9)) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_length = 10; v10 := compiler.MapValueForKey(m, "maxLength") if v10 != nil { t, ok := compiler.IntForScalarNode(v10) if ok { x.MaxLength = int64(t) } else { message := fmt.Sprintf("has unexpected value for maxLength: %s", compiler.Display(v10)) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_length = 11; v11 := compiler.MapValueForKey(m, "minLength") if v11 != nil { t, ok := compiler.IntForScalarNode(v11) if ok { x.MinLength = int64(t) } else { message := fmt.Sprintf("has unexpected value for minLength: %s", compiler.Display(v11)) errors = append(errors, compiler.NewError(context, message)) } } // string pattern = 12; v12 := compiler.MapValueForKey(m, "pattern") if v12 != nil { x.Pattern, ok = compiler.StringForScalarNode(v12) if !ok { message := fmt.Sprintf("has unexpected value for pattern: %s", compiler.Display(v12)) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_items = 13; v13 := compiler.MapValueForKey(m, "maxItems") if v13 != nil { t, ok := compiler.IntForScalarNode(v13) if ok { x.MaxItems = int64(t) } else { message := fmt.Sprintf("has unexpected value for maxItems: %s", compiler.Display(v13)) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_items = 14; v14 := compiler.MapValueForKey(m, "minItems") if v14 != nil { t, ok := compiler.IntForScalarNode(v14) if ok { x.MinItems = int64(t) } else { message := fmt.Sprintf("has unexpected value for minItems: %s", compiler.Display(v14)) errors = append(errors, compiler.NewError(context, message)) } } // bool unique_items = 15; v15 := compiler.MapValueForKey(m, "uniqueItems") if v15 != nil { x.UniqueItems, ok = compiler.BoolForScalarNode(v15) if !ok { message := fmt.Sprintf("has unexpected value for uniqueItems: %s", compiler.Display(v15)) errors = append(errors, compiler.NewError(context, message)) } } // repeated Any enum = 16; v16 := compiler.MapValueForKey(m, "enum") if v16 != nil { // repeated Any x.Enum = make([]*Any, 0) a, ok := compiler.SequenceNodeForNode(v16) if ok { for _, item := range a.Content { y, err := NewAny(item, compiler.NewContext("enum", item, context)) if err != nil { errors = append(errors, err) } x.Enum = append(x.Enum, y) } } } // float multiple_of = 17; v17 := compiler.MapValueForKey(m, "multipleOf") if v17 != nil { v, ok := compiler.FloatForScalarNode(v17) if ok { x.MultipleOf = v } else { message := fmt.Sprintf("has unexpected value for multipleOf: %s", compiler.Display(v17)) errors = append(errors, compiler.NewError(context, message)) } } // string description = 18; v18 := compiler.MapValueForKey(m, "description") if v18 != nil { x.Description, ok = compiler.StringForScalarNode(v18) if !ok { message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v18)) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 19; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewHeaderParameterSubSchema creates an object of type HeaderParameterSubSchema if possible, returning an error if not. func NewHeaderParameterSubSchema(in *yaml.Node, context *compiler.Context) (*HeaderParameterSubSchema, error) { errors := make([]error, 0) x := &HeaderParameterSubSchema{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"collectionFormat", "default", "description", "enum", "exclusiveMaximum", "exclusiveMinimum", "format", "in", "items", "maxItems", "maxLength", "maximum", "minItems", "minLength", "minimum", "multipleOf", "name", "pattern", "required", "type", "uniqueItems"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // bool required = 1; v1 := compiler.MapValueForKey(m, "required") if v1 != nil { x.Required, ok = compiler.BoolForScalarNode(v1) if !ok { message := fmt.Sprintf("has unexpected value for required: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string in = 2; v2 := compiler.MapValueForKey(m, "in") if v2 != nil { x.In, ok = compiler.StringForScalarNode(v2) if !ok { message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [header] if ok && !compiler.StringArrayContainsValue([]string{"header"}, x.In) { message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // string description = 3; v3 := compiler.MapValueForKey(m, "description") if v3 != nil { x.Description, ok = compiler.StringForScalarNode(v3) if !ok { message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v3)) errors = append(errors, compiler.NewError(context, message)) } } // string name = 4; v4 := compiler.MapValueForKey(m, "name") if v4 != nil { x.Name, ok = compiler.StringForScalarNode(v4) if !ok { message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } } // string type = 5; v5 := compiler.MapValueForKey(m, "type") if v5 != nil { x.Type, ok = compiler.StringForScalarNode(v5) if !ok { message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v5)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [string number boolean integer array] if ok && !compiler.StringArrayContainsValue([]string{"string", "number", "boolean", "integer", "array"}, x.Type) { message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v5)) errors = append(errors, compiler.NewError(context, message)) } } // string format = 6; v6 := compiler.MapValueForKey(m, "format") if v6 != nil { x.Format, ok = compiler.StringForScalarNode(v6) if !ok { message := fmt.Sprintf("has unexpected value for format: %s", compiler.Display(v6)) errors = append(errors, compiler.NewError(context, message)) } } // PrimitivesItems items = 7; v7 := compiler.MapValueForKey(m, "items") if v7 != nil { var err error x.Items, err = NewPrimitivesItems(v7, compiler.NewContext("items", v7, context)) if err != nil { errors = append(errors, err) } } // string collection_format = 8; v8 := compiler.MapValueForKey(m, "collectionFormat") if v8 != nil { x.CollectionFormat, ok = compiler.StringForScalarNode(v8) if !ok { message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v8)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [csv ssv tsv pipes] if ok && !compiler.StringArrayContainsValue([]string{"csv", "ssv", "tsv", "pipes"}, x.CollectionFormat) { message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v8)) errors = append(errors, compiler.NewError(context, message)) } } // Any default = 9; v9 := compiler.MapValueForKey(m, "default") if v9 != nil { var err error x.Default, err = NewAny(v9, compiler.NewContext("default", v9, context)) if err != nil { errors = append(errors, err) } } // float maximum = 10; v10 := compiler.MapValueForKey(m, "maximum") if v10 != nil { v, ok := compiler.FloatForScalarNode(v10) if ok { x.Maximum = v } else { message := fmt.Sprintf("has unexpected value for maximum: %s", compiler.Display(v10)) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_maximum = 11; v11 := compiler.MapValueForKey(m, "exclusiveMaximum") if v11 != nil { x.ExclusiveMaximum, ok = compiler.BoolForScalarNode(v11) if !ok { message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %s", compiler.Display(v11)) errors = append(errors, compiler.NewError(context, message)) } } // float minimum = 12; v12 := compiler.MapValueForKey(m, "minimum") if v12 != nil { v, ok := compiler.FloatForScalarNode(v12) if ok { x.Minimum = v } else { message := fmt.Sprintf("has unexpected value for minimum: %s", compiler.Display(v12)) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_minimum = 13; v13 := compiler.MapValueForKey(m, "exclusiveMinimum") if v13 != nil { x.ExclusiveMinimum, ok = compiler.BoolForScalarNode(v13) if !ok { message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %s", compiler.Display(v13)) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_length = 14; v14 := compiler.MapValueForKey(m, "maxLength") if v14 != nil { t, ok := compiler.IntForScalarNode(v14) if ok { x.MaxLength = int64(t) } else { message := fmt.Sprintf("has unexpected value for maxLength: %s", compiler.Display(v14)) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_length = 15; v15 := compiler.MapValueForKey(m, "minLength") if v15 != nil { t, ok := compiler.IntForScalarNode(v15) if ok { x.MinLength = int64(t) } else { message := fmt.Sprintf("has unexpected value for minLength: %s", compiler.Display(v15)) errors = append(errors, compiler.NewError(context, message)) } } // string pattern = 16; v16 := compiler.MapValueForKey(m, "pattern") if v16 != nil { x.Pattern, ok = compiler.StringForScalarNode(v16) if !ok { message := fmt.Sprintf("has unexpected value for pattern: %s", compiler.Display(v16)) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_items = 17; v17 := compiler.MapValueForKey(m, "maxItems") if v17 != nil { t, ok := compiler.IntForScalarNode(v17) if ok { x.MaxItems = int64(t) } else { message := fmt.Sprintf("has unexpected value for maxItems: %s", compiler.Display(v17)) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_items = 18; v18 := compiler.MapValueForKey(m, "minItems") if v18 != nil { t, ok := compiler.IntForScalarNode(v18) if ok { x.MinItems = int64(t) } else { message := fmt.Sprintf("has unexpected value for minItems: %s", compiler.Display(v18)) errors = append(errors, compiler.NewError(context, message)) } } // bool unique_items = 19; v19 := compiler.MapValueForKey(m, "uniqueItems") if v19 != nil { x.UniqueItems, ok = compiler.BoolForScalarNode(v19) if !ok { message := fmt.Sprintf("has unexpected value for uniqueItems: %s", compiler.Display(v19)) errors = append(errors, compiler.NewError(context, message)) } } // repeated Any enum = 20; v20 := compiler.MapValueForKey(m, "enum") if v20 != nil { // repeated Any x.Enum = make([]*Any, 0) a, ok := compiler.SequenceNodeForNode(v20) if ok { for _, item := range a.Content { y, err := NewAny(item, compiler.NewContext("enum", item, context)) if err != nil { errors = append(errors, err) } x.Enum = append(x.Enum, y) } } } // float multiple_of = 21; v21 := compiler.MapValueForKey(m, "multipleOf") if v21 != nil { v, ok := compiler.FloatForScalarNode(v21) if ok { x.MultipleOf = v } else { message := fmt.Sprintf("has unexpected value for multipleOf: %s", compiler.Display(v21)) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 22; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewHeaders creates an object of type Headers if possible, returning an error if not. func NewHeaders(in *yaml.Node, context *compiler.Context) (*Headers, error) { errors := make([]error, 0) x := &Headers{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { // repeated NamedHeader additional_properties = 1; // MAP: Header x.AdditionalProperties = make([]*NamedHeader, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] pair := &NamedHeader{} pair.Name = k var err error pair.Value, err = NewHeader(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } x.AdditionalProperties = append(x.AdditionalProperties, pair) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewInfo creates an object of type Info if possible, returning an error if not. func NewInfo(in *yaml.Node, context *compiler.Context) (*Info, error) { errors := make([]error, 0) x := &Info{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"title", "version"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } allowedKeys := []string{"contact", "description", "license", "termsOfService", "title", "version"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string title = 1; v1 := compiler.MapValueForKey(m, "title") if v1 != nil { x.Title, ok = compiler.StringForScalarNode(v1) if !ok { message := fmt.Sprintf("has unexpected value for title: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string version = 2; v2 := compiler.MapValueForKey(m, "version") if v2 != nil { x.Version, ok = compiler.StringForScalarNode(v2) if !ok { message := fmt.Sprintf("has unexpected value for version: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // string description = 3; v3 := compiler.MapValueForKey(m, "description") if v3 != nil { x.Description, ok = compiler.StringForScalarNode(v3) if !ok { message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v3)) errors = append(errors, compiler.NewError(context, message)) } } // string terms_of_service = 4; v4 := compiler.MapValueForKey(m, "termsOfService") if v4 != nil { x.TermsOfService, ok = compiler.StringForScalarNode(v4) if !ok { message := fmt.Sprintf("has unexpected value for termsOfService: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } } // Contact contact = 5; v5 := compiler.MapValueForKey(m, "contact") if v5 != nil { var err error x.Contact, err = NewContact(v5, compiler.NewContext("contact", v5, context)) if err != nil { errors = append(errors, err) } } // License license = 6; v6 := compiler.MapValueForKey(m, "license") if v6 != nil { var err error x.License, err = NewLicense(v6, compiler.NewContext("license", v6, context)) if err != nil { errors = append(errors, err) } } // repeated NamedAny vendor_extension = 7; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewItemsItem creates an object of type ItemsItem if possible, returning an error if not. func NewItemsItem(in *yaml.Node, context *compiler.Context) (*ItemsItem, error) { errors := make([]error, 0) x := &ItemsItem{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value for item array: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { x.Schema = make([]*Schema, 0) y, err := NewSchema(m, compiler.NewContext("<array>", m, context)) if err != nil { return nil, err } x.Schema = append(x.Schema, y) } return x, compiler.NewErrorGroupOrNil(errors) } // NewJsonReference creates an object of type JsonReference if possible, returning an error if not. func NewJsonReference(in *yaml.Node, context *compiler.Context) (*JsonReference, error) { errors := make([]error, 0) x := &JsonReference{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"$ref"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string _ref = 1; v1 := compiler.MapValueForKey(m, "$ref") if v1 != nil { x.XRef, ok = compiler.StringForScalarNode(v1) if !ok { message := fmt.Sprintf("has unexpected value for $ref: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string description = 2; v2 := compiler.MapValueForKey(m, "description") if v2 != nil { x.Description, ok = compiler.StringForScalarNode(v2) if !ok { message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewLicense creates an object of type License if possible, returning an error if not. func NewLicense(in *yaml.Node, context *compiler.Context) (*License, error) { errors := make([]error, 0) x := &License{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"name"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } allowedKeys := []string{"name", "url"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { x.Name, ok = compiler.StringForScalarNode(v1) if !ok { message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string url = 2; v2 := compiler.MapValueForKey(m, "url") if v2 != nil { x.Url, ok = compiler.StringForScalarNode(v2) if !ok { message := fmt.Sprintf("has unexpected value for url: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 3; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewNamedAny creates an object of type NamedAny if possible, returning an error if not. func NewNamedAny(in *yaml.Node, context *compiler.Context) (*NamedAny, error) { errors := make([]error, 0) x := &NamedAny{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"name", "value"} var allowedPatterns []*regexp.Regexp invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { x.Name, ok = compiler.StringForScalarNode(v1) if !ok { message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // Any value = 2; v2 := compiler.MapValueForKey(m, "value") if v2 != nil { var err error x.Value, err = NewAny(v2, compiler.NewContext("value", v2, context)) if err != nil { errors = append(errors, err) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewNamedHeader creates an object of type NamedHeader if possible, returning an error if not. func NewNamedHeader(in *yaml.Node, context *compiler.Context) (*NamedHeader, error) { errors := make([]error, 0) x := &NamedHeader{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"name", "value"} var allowedPatterns []*regexp.Regexp invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { x.Name, ok = compiler.StringForScalarNode(v1) if !ok { message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // Header value = 2; v2 := compiler.MapValueForKey(m, "value") if v2 != nil { var err error x.Value, err = NewHeader(v2, compiler.NewContext("value", v2, context)) if err != nil { errors = append(errors, err) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewNamedParameter creates an object of type NamedParameter if possible, returning an error if not. func NewNamedParameter(in *yaml.Node, context *compiler.Context) (*NamedParameter, error) { errors := make([]error, 0) x := &NamedParameter{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"name", "value"} var allowedPatterns []*regexp.Regexp invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { x.Name, ok = compiler.StringForScalarNode(v1) if !ok { message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // Parameter value = 2; v2 := compiler.MapValueForKey(m, "value") if v2 != nil { var err error x.Value, err = NewParameter(v2, compiler.NewContext("value", v2, context)) if err != nil { errors = append(errors, err) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewNamedPathItem creates an object of type NamedPathItem if possible, returning an error if not. func NewNamedPathItem(in *yaml.Node, context *compiler.Context) (*NamedPathItem, error) { errors := make([]error, 0) x := &NamedPathItem{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"name", "value"} var allowedPatterns []*regexp.Regexp invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { x.Name, ok = compiler.StringForScalarNode(v1) if !ok { message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // PathItem value = 2; v2 := compiler.MapValueForKey(m, "value") if v2 != nil { var err error x.Value, err = NewPathItem(v2, compiler.NewContext("value", v2, context)) if err != nil { errors = append(errors, err) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewNamedResponse creates an object of type NamedResponse if possible, returning an error if not. func NewNamedResponse(in *yaml.Node, context *compiler.Context) (*NamedResponse, error) { errors := make([]error, 0) x := &NamedResponse{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"name", "value"} var allowedPatterns []*regexp.Regexp invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { x.Name, ok = compiler.StringForScalarNode(v1) if !ok { message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // Response value = 2; v2 := compiler.MapValueForKey(m, "value") if v2 != nil { var err error x.Value, err = NewResponse(v2, compiler.NewContext("value", v2, context)) if err != nil { errors = append(errors, err) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewNamedResponseValue creates an object of type NamedResponseValue if possible, returning an error if not. func NewNamedResponseValue(in *yaml.Node, context *compiler.Context) (*NamedResponseValue, error) { errors := make([]error, 0) x := &NamedResponseValue{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"name", "value"} var allowedPatterns []*regexp.Regexp invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { x.Name, ok = compiler.StringForScalarNode(v1) if !ok { message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // ResponseValue value = 2; v2 := compiler.MapValueForKey(m, "value") if v2 != nil { var err error x.Value, err = NewResponseValue(v2, compiler.NewContext("value", v2, context)) if err != nil { errors = append(errors, err) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewNamedSchema creates an object of type NamedSchema if possible, returning an error if not. func NewNamedSchema(in *yaml.Node, context *compiler.Context) (*NamedSchema, error) { errors := make([]error, 0) x := &NamedSchema{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"name", "value"} var allowedPatterns []*regexp.Regexp invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { x.Name, ok = compiler.StringForScalarNode(v1) if !ok { message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // Schema value = 2; v2 := compiler.MapValueForKey(m, "value") if v2 != nil { var err error x.Value, err = NewSchema(v2, compiler.NewContext("value", v2, context)) if err != nil { errors = append(errors, err) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewNamedSecurityDefinitionsItem creates an object of type NamedSecurityDefinitionsItem if possible, returning an error if not. func NewNamedSecurityDefinitionsItem(in *yaml.Node, context *compiler.Context) (*NamedSecurityDefinitionsItem, error) { errors := make([]error, 0) x := &NamedSecurityDefinitionsItem{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"name", "value"} var allowedPatterns []*regexp.Regexp invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { x.Name, ok = compiler.StringForScalarNode(v1) if !ok { message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // SecurityDefinitionsItem value = 2; v2 := compiler.MapValueForKey(m, "value") if v2 != nil { var err error x.Value, err = NewSecurityDefinitionsItem(v2, compiler.NewContext("value", v2, context)) if err != nil { errors = append(errors, err) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewNamedString creates an object of type NamedString if possible, returning an error if not. func NewNamedString(in *yaml.Node, context *compiler.Context) (*NamedString, error) { errors := make([]error, 0) x := &NamedString{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"name", "value"} var allowedPatterns []*regexp.Regexp invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { x.Name, ok = compiler.StringForScalarNode(v1) if !ok { message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string value = 2; v2 := compiler.MapValueForKey(m, "value") if v2 != nil { x.Value, ok = compiler.StringForScalarNode(v2) if !ok { message := fmt.Sprintf("has unexpected value for value: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewNamedStringArray creates an object of type NamedStringArray if possible, returning an error if not. func NewNamedStringArray(in *yaml.Node, context *compiler.Context) (*NamedStringArray, error) { errors := make([]error, 0) x := &NamedStringArray{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"name", "value"} var allowedPatterns []*regexp.Regexp invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { x.Name, ok = compiler.StringForScalarNode(v1) if !ok { message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // StringArray value = 2; v2 := compiler.MapValueForKey(m, "value") if v2 != nil { var err error x.Value, err = NewStringArray(v2, compiler.NewContext("value", v2, context)) if err != nil { errors = append(errors, err) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewNonBodyParameter creates an object of type NonBodyParameter if possible, returning an error if not. func NewNonBodyParameter(in *yaml.Node, context *compiler.Context) (*NonBodyParameter, error) { errors := make([]error, 0) x := &NonBodyParameter{} matched := false m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"in", "name", "type"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // HeaderParameterSubSchema header_parameter_sub_schema = 1; { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewHeaderParameterSubSchema(m, compiler.NewContext("headerParameterSubSchema", m, context)) if matchingError == nil { x.Oneof = &NonBodyParameter_HeaderParameterSubSchema{HeaderParameterSubSchema: t} matched = true } else { errors = append(errors, matchingError) } } // FormDataParameterSubSchema form_data_parameter_sub_schema = 2; { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewFormDataParameterSubSchema(m, compiler.NewContext("formDataParameterSubSchema", m, context)) if matchingError == nil { x.Oneof = &NonBodyParameter_FormDataParameterSubSchema{FormDataParameterSubSchema: t} matched = true } else { errors = append(errors, matchingError) } } // QueryParameterSubSchema query_parameter_sub_schema = 3; { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewQueryParameterSubSchema(m, compiler.NewContext("queryParameterSubSchema", m, context)) if matchingError == nil { x.Oneof = &NonBodyParameter_QueryParameterSubSchema{QueryParameterSubSchema: t} matched = true } else { errors = append(errors, matchingError) } } // PathParameterSubSchema path_parameter_sub_schema = 4; { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewPathParameterSubSchema(m, compiler.NewContext("pathParameterSubSchema", m, context)) if matchingError == nil { x.Oneof = &NonBodyParameter_PathParameterSubSchema{PathParameterSubSchema: t} matched = true } else { errors = append(errors, matchingError) } } } if matched { // since the oneof matched one of its possibilities, discard any matching errors errors = make([]error, 0) } else { message := fmt.Sprintf("contains an invalid NonBodyParameter") err := compiler.NewError(context, message) errors = []error{err} } return x, compiler.NewErrorGroupOrNil(errors) } // NewOauth2AccessCodeSecurity creates an object of type Oauth2AccessCodeSecurity if possible, returning an error if not. func NewOauth2AccessCodeSecurity(in *yaml.Node, context *compiler.Context) (*Oauth2AccessCodeSecurity, error) { errors := make([]error, 0) x := &Oauth2AccessCodeSecurity{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"authorizationUrl", "flow", "tokenUrl", "type"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } allowedKeys := []string{"authorizationUrl", "description", "flow", "scopes", "tokenUrl", "type"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string type = 1; v1 := compiler.MapValueForKey(m, "type") if v1 != nil { x.Type, ok = compiler.StringForScalarNode(v1) if !ok { message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [oauth2] if ok && !compiler.StringArrayContainsValue([]string{"oauth2"}, x.Type) { message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string flow = 2; v2 := compiler.MapValueForKey(m, "flow") if v2 != nil { x.Flow, ok = compiler.StringForScalarNode(v2) if !ok { message := fmt.Sprintf("has unexpected value for flow: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [accessCode] if ok && !compiler.StringArrayContainsValue([]string{"accessCode"}, x.Flow) { message := fmt.Sprintf("has unexpected value for flow: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // Oauth2Scopes scopes = 3; v3 := compiler.MapValueForKey(m, "scopes") if v3 != nil { var err error x.Scopes, err = NewOauth2Scopes(v3, compiler.NewContext("scopes", v3, context)) if err != nil { errors = append(errors, err) } } // string authorization_url = 4; v4 := compiler.MapValueForKey(m, "authorizationUrl") if v4 != nil { x.AuthorizationUrl, ok = compiler.StringForScalarNode(v4) if !ok { message := fmt.Sprintf("has unexpected value for authorizationUrl: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } } // string token_url = 5; v5 := compiler.MapValueForKey(m, "tokenUrl") if v5 != nil { x.TokenUrl, ok = compiler.StringForScalarNode(v5) if !ok { message := fmt.Sprintf("has unexpected value for tokenUrl: %s", compiler.Display(v5)) errors = append(errors, compiler.NewError(context, message)) } } // string description = 6; v6 := compiler.MapValueForKey(m, "description") if v6 != nil { x.Description, ok = compiler.StringForScalarNode(v6) if !ok { message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v6)) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 7; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewOauth2ApplicationSecurity creates an object of type Oauth2ApplicationSecurity if possible, returning an error if not. func NewOauth2ApplicationSecurity(in *yaml.Node, context *compiler.Context) (*Oauth2ApplicationSecurity, error) { errors := make([]error, 0) x := &Oauth2ApplicationSecurity{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"flow", "tokenUrl", "type"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } allowedKeys := []string{"description", "flow", "scopes", "tokenUrl", "type"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string type = 1; v1 := compiler.MapValueForKey(m, "type") if v1 != nil { x.Type, ok = compiler.StringForScalarNode(v1) if !ok { message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [oauth2] if ok && !compiler.StringArrayContainsValue([]string{"oauth2"}, x.Type) { message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string flow = 2; v2 := compiler.MapValueForKey(m, "flow") if v2 != nil { x.Flow, ok = compiler.StringForScalarNode(v2) if !ok { message := fmt.Sprintf("has unexpected value for flow: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [application] if ok && !compiler.StringArrayContainsValue([]string{"application"}, x.Flow) { message := fmt.Sprintf("has unexpected value for flow: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // Oauth2Scopes scopes = 3; v3 := compiler.MapValueForKey(m, "scopes") if v3 != nil { var err error x.Scopes, err = NewOauth2Scopes(v3, compiler.NewContext("scopes", v3, context)) if err != nil { errors = append(errors, err) } } // string token_url = 4; v4 := compiler.MapValueForKey(m, "tokenUrl") if v4 != nil { x.TokenUrl, ok = compiler.StringForScalarNode(v4) if !ok { message := fmt.Sprintf("has unexpected value for tokenUrl: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } } // string description = 5; v5 := compiler.MapValueForKey(m, "description") if v5 != nil { x.Description, ok = compiler.StringForScalarNode(v5) if !ok { message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v5)) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 6; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewOauth2ImplicitSecurity creates an object of type Oauth2ImplicitSecurity if possible, returning an error if not. func NewOauth2ImplicitSecurity(in *yaml.Node, context *compiler.Context) (*Oauth2ImplicitSecurity, error) { errors := make([]error, 0) x := &Oauth2ImplicitSecurity{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"authorizationUrl", "flow", "type"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } allowedKeys := []string{"authorizationUrl", "description", "flow", "scopes", "type"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string type = 1; v1 := compiler.MapValueForKey(m, "type") if v1 != nil { x.Type, ok = compiler.StringForScalarNode(v1) if !ok { message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [oauth2] if ok && !compiler.StringArrayContainsValue([]string{"oauth2"}, x.Type) { message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string flow = 2; v2 := compiler.MapValueForKey(m, "flow") if v2 != nil { x.Flow, ok = compiler.StringForScalarNode(v2) if !ok { message := fmt.Sprintf("has unexpected value for flow: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [implicit] if ok && !compiler.StringArrayContainsValue([]string{"implicit"}, x.Flow) { message := fmt.Sprintf("has unexpected value for flow: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // Oauth2Scopes scopes = 3; v3 := compiler.MapValueForKey(m, "scopes") if v3 != nil { var err error x.Scopes, err = NewOauth2Scopes(v3, compiler.NewContext("scopes", v3, context)) if err != nil { errors = append(errors, err) } } // string authorization_url = 4; v4 := compiler.MapValueForKey(m, "authorizationUrl") if v4 != nil { x.AuthorizationUrl, ok = compiler.StringForScalarNode(v4) if !ok { message := fmt.Sprintf("has unexpected value for authorizationUrl: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } } // string description = 5; v5 := compiler.MapValueForKey(m, "description") if v5 != nil { x.Description, ok = compiler.StringForScalarNode(v5) if !ok { message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v5)) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 6; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewOauth2PasswordSecurity creates an object of type Oauth2PasswordSecurity if possible, returning an error if not. func NewOauth2PasswordSecurity(in *yaml.Node, context *compiler.Context) (*Oauth2PasswordSecurity, error) { errors := make([]error, 0) x := &Oauth2PasswordSecurity{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"flow", "tokenUrl", "type"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } allowedKeys := []string{"description", "flow", "scopes", "tokenUrl", "type"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string type = 1; v1 := compiler.MapValueForKey(m, "type") if v1 != nil { x.Type, ok = compiler.StringForScalarNode(v1) if !ok { message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [oauth2] if ok && !compiler.StringArrayContainsValue([]string{"oauth2"}, x.Type) { message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string flow = 2; v2 := compiler.MapValueForKey(m, "flow") if v2 != nil { x.Flow, ok = compiler.StringForScalarNode(v2) if !ok { message := fmt.Sprintf("has unexpected value for flow: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [password] if ok && !compiler.StringArrayContainsValue([]string{"password"}, x.Flow) { message := fmt.Sprintf("has unexpected value for flow: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // Oauth2Scopes scopes = 3; v3 := compiler.MapValueForKey(m, "scopes") if v3 != nil { var err error x.Scopes, err = NewOauth2Scopes(v3, compiler.NewContext("scopes", v3, context)) if err != nil { errors = append(errors, err) } } // string token_url = 4; v4 := compiler.MapValueForKey(m, "tokenUrl") if v4 != nil { x.TokenUrl, ok = compiler.StringForScalarNode(v4) if !ok { message := fmt.Sprintf("has unexpected value for tokenUrl: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } } // string description = 5; v5 := compiler.MapValueForKey(m, "description") if v5 != nil { x.Description, ok = compiler.StringForScalarNode(v5) if !ok { message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v5)) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 6; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewOauth2Scopes creates an object of type Oauth2Scopes if possible, returning an error if not. func NewOauth2Scopes(in *yaml.Node, context *compiler.Context) (*Oauth2Scopes, error) { errors := make([]error, 0) x := &Oauth2Scopes{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { // repeated NamedString additional_properties = 1; // MAP: string x.AdditionalProperties = make([]*NamedString, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] pair := &NamedString{} pair.Name = k pair.Value, _ = compiler.StringForScalarNode(v) x.AdditionalProperties = append(x.AdditionalProperties, pair) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewOperation creates an object of type Operation if possible, returning an error if not. func NewOperation(in *yaml.Node, context *compiler.Context) (*Operation, error) { errors := make([]error, 0) x := &Operation{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"responses"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } allowedKeys := []string{"consumes", "deprecated", "description", "externalDocs", "operationId", "parameters", "produces", "responses", "schemes", "security", "summary", "tags"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // repeated string tags = 1; v1 := compiler.MapValueForKey(m, "tags") if v1 != nil { v, ok := compiler.SequenceNodeForNode(v1) if ok { x.Tags = compiler.StringArrayForSequenceNode(v) } else { message := fmt.Sprintf("has unexpected value for tags: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string summary = 2; v2 := compiler.MapValueForKey(m, "summary") if v2 != nil { x.Summary, ok = compiler.StringForScalarNode(v2) if !ok { message := fmt.Sprintf("has unexpected value for summary: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // string description = 3; v3 := compiler.MapValueForKey(m, "description") if v3 != nil { x.Description, ok = compiler.StringForScalarNode(v3) if !ok { message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v3)) errors = append(errors, compiler.NewError(context, message)) } } // ExternalDocs external_docs = 4; v4 := compiler.MapValueForKey(m, "externalDocs") if v4 != nil { var err error x.ExternalDocs, err = NewExternalDocs(v4, compiler.NewContext("externalDocs", v4, context)) if err != nil { errors = append(errors, err) } } // string operation_id = 5; v5 := compiler.MapValueForKey(m, "operationId") if v5 != nil { x.OperationId, ok = compiler.StringForScalarNode(v5) if !ok { message := fmt.Sprintf("has unexpected value for operationId: %s", compiler.Display(v5)) errors = append(errors, compiler.NewError(context, message)) } } // repeated string produces = 6; v6 := compiler.MapValueForKey(m, "produces") if v6 != nil { v, ok := compiler.SequenceNodeForNode(v6) if ok { x.Produces = compiler.StringArrayForSequenceNode(v) } else { message := fmt.Sprintf("has unexpected value for produces: %s", compiler.Display(v6)) errors = append(errors, compiler.NewError(context, message)) } } // repeated string consumes = 7; v7 := compiler.MapValueForKey(m, "consumes") if v7 != nil { v, ok := compiler.SequenceNodeForNode(v7) if ok { x.Consumes = compiler.StringArrayForSequenceNode(v) } else { message := fmt.Sprintf("has unexpected value for consumes: %s", compiler.Display(v7)) errors = append(errors, compiler.NewError(context, message)) } } // repeated ParametersItem parameters = 8; v8 := compiler.MapValueForKey(m, "parameters") if v8 != nil { // repeated ParametersItem x.Parameters = make([]*ParametersItem, 0) a, ok := compiler.SequenceNodeForNode(v8) if ok { for _, item := range a.Content { y, err := NewParametersItem(item, compiler.NewContext("parameters", item, context)) if err != nil { errors = append(errors, err) } x.Parameters = append(x.Parameters, y) } } } // Responses responses = 9; v9 := compiler.MapValueForKey(m, "responses") if v9 != nil { var err error x.Responses, err = NewResponses(v9, compiler.NewContext("responses", v9, context)) if err != nil { errors = append(errors, err) } } // repeated string schemes = 10; v10 := compiler.MapValueForKey(m, "schemes") if v10 != nil { v, ok := compiler.SequenceNodeForNode(v10) if ok { x.Schemes = compiler.StringArrayForSequenceNode(v) } else { message := fmt.Sprintf("has unexpected value for schemes: %s", compiler.Display(v10)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [http https ws wss] if ok && !compiler.StringArrayContainsValues([]string{"http", "https", "ws", "wss"}, x.Schemes) { message := fmt.Sprintf("has unexpected value for schemes: %s", compiler.Display(v10)) errors = append(errors, compiler.NewError(context, message)) } } // bool deprecated = 11; v11 := compiler.MapValueForKey(m, "deprecated") if v11 != nil { x.Deprecated, ok = compiler.BoolForScalarNode(v11) if !ok { message := fmt.Sprintf("has unexpected value for deprecated: %s", compiler.Display(v11)) errors = append(errors, compiler.NewError(context, message)) } } // repeated SecurityRequirement security = 12; v12 := compiler.MapValueForKey(m, "security") if v12 != nil { // repeated SecurityRequirement x.Security = make([]*SecurityRequirement, 0) a, ok := compiler.SequenceNodeForNode(v12) if ok { for _, item := range a.Content { y, err := NewSecurityRequirement(item, compiler.NewContext("security", item, context)) if err != nil { errors = append(errors, err) } x.Security = append(x.Security, y) } } } // repeated NamedAny vendor_extension = 13; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewParameter creates an object of type Parameter if possible, returning an error if not. func NewParameter(in *yaml.Node, context *compiler.Context) (*Parameter, error) { errors := make([]error, 0) x := &Parameter{} matched := false // BodyParameter body_parameter = 1; { m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewBodyParameter(m, compiler.NewContext("bodyParameter", m, context)) if matchingError == nil { x.Oneof = &Parameter_BodyParameter{BodyParameter: t} matched = true } else { errors = append(errors, matchingError) } } } // NonBodyParameter non_body_parameter = 2; { m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewNonBodyParameter(m, compiler.NewContext("nonBodyParameter", m, context)) if matchingError == nil { x.Oneof = &Parameter_NonBodyParameter{NonBodyParameter: t} matched = true } else { errors = append(errors, matchingError) } } } if matched { // since the oneof matched one of its possibilities, discard any matching errors errors = make([]error, 0) } else { message := fmt.Sprintf("contains an invalid Parameter") err := compiler.NewError(context, message) errors = []error{err} } return x, compiler.NewErrorGroupOrNil(errors) } // NewParameterDefinitions creates an object of type ParameterDefinitions if possible, returning an error if not. func NewParameterDefinitions(in *yaml.Node, context *compiler.Context) (*ParameterDefinitions, error) { errors := make([]error, 0) x := &ParameterDefinitions{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { // repeated NamedParameter additional_properties = 1; // MAP: Parameter x.AdditionalProperties = make([]*NamedParameter, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] pair := &NamedParameter{} pair.Name = k var err error pair.Value, err = NewParameter(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } x.AdditionalProperties = append(x.AdditionalProperties, pair) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewParametersItem creates an object of type ParametersItem if possible, returning an error if not. func NewParametersItem(in *yaml.Node, context *compiler.Context) (*ParametersItem, error) { errors := make([]error, 0) x := &ParametersItem{} matched := false // Parameter parameter = 1; { m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewParameter(m, compiler.NewContext("parameter", m, context)) if matchingError == nil { x.Oneof = &ParametersItem_Parameter{Parameter: t} matched = true } else { errors = append(errors, matchingError) } } } // JsonReference json_reference = 2; { m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewJsonReference(m, compiler.NewContext("jsonReference", m, context)) if matchingError == nil { x.Oneof = &ParametersItem_JsonReference{JsonReference: t} matched = true } else { errors = append(errors, matchingError) } } } if matched { // since the oneof matched one of its possibilities, discard any matching errors errors = make([]error, 0) } else { message := fmt.Sprintf("contains an invalid ParametersItem") err := compiler.NewError(context, message) errors = []error{err} } return x, compiler.NewErrorGroupOrNil(errors) } // NewPathItem creates an object of type PathItem if possible, returning an error if not. func NewPathItem(in *yaml.Node, context *compiler.Context) (*PathItem, error) { errors := make([]error, 0) x := &PathItem{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"$ref", "delete", "get", "head", "options", "parameters", "patch", "post", "put"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string _ref = 1; v1 := compiler.MapValueForKey(m, "$ref") if v1 != nil { x.XRef, ok = compiler.StringForScalarNode(v1) if !ok { message := fmt.Sprintf("has unexpected value for $ref: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // Operation get = 2; v2 := compiler.MapValueForKey(m, "get") if v2 != nil { var err error x.Get, err = NewOperation(v2, compiler.NewContext("get", v2, context)) if err != nil { errors = append(errors, err) } } // Operation put = 3; v3 := compiler.MapValueForKey(m, "put") if v3 != nil { var err error x.Put, err = NewOperation(v3, compiler.NewContext("put", v3, context)) if err != nil { errors = append(errors, err) } } // Operation post = 4; v4 := compiler.MapValueForKey(m, "post") if v4 != nil { var err error x.Post, err = NewOperation(v4, compiler.NewContext("post", v4, context)) if err != nil { errors = append(errors, err) } } // Operation delete = 5; v5 := compiler.MapValueForKey(m, "delete") if v5 != nil { var err error x.Delete, err = NewOperation(v5, compiler.NewContext("delete", v5, context)) if err != nil { errors = append(errors, err) } } // Operation options = 6; v6 := compiler.MapValueForKey(m, "options") if v6 != nil { var err error x.Options, err = NewOperation(v6, compiler.NewContext("options", v6, context)) if err != nil { errors = append(errors, err) } } // Operation head = 7; v7 := compiler.MapValueForKey(m, "head") if v7 != nil { var err error x.Head, err = NewOperation(v7, compiler.NewContext("head", v7, context)) if err != nil { errors = append(errors, err) } } // Operation patch = 8; v8 := compiler.MapValueForKey(m, "patch") if v8 != nil { var err error x.Patch, err = NewOperation(v8, compiler.NewContext("patch", v8, context)) if err != nil { errors = append(errors, err) } } // repeated ParametersItem parameters = 9; v9 := compiler.MapValueForKey(m, "parameters") if v9 != nil { // repeated ParametersItem x.Parameters = make([]*ParametersItem, 0) a, ok := compiler.SequenceNodeForNode(v9) if ok { for _, item := range a.Content { y, err := NewParametersItem(item, compiler.NewContext("parameters", item, context)) if err != nil { errors = append(errors, err) } x.Parameters = append(x.Parameters, y) } } } // repeated NamedAny vendor_extension = 10; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewPathParameterSubSchema creates an object of type PathParameterSubSchema if possible, returning an error if not. func NewPathParameterSubSchema(in *yaml.Node, context *compiler.Context) (*PathParameterSubSchema, error) { errors := make([]error, 0) x := &PathParameterSubSchema{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"required"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } allowedKeys := []string{"collectionFormat", "default", "description", "enum", "exclusiveMaximum", "exclusiveMinimum", "format", "in", "items", "maxItems", "maxLength", "maximum", "minItems", "minLength", "minimum", "multipleOf", "name", "pattern", "required", "type", "uniqueItems"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // bool required = 1; v1 := compiler.MapValueForKey(m, "required") if v1 != nil { x.Required, ok = compiler.BoolForScalarNode(v1) if !ok { message := fmt.Sprintf("has unexpected value for required: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string in = 2; v2 := compiler.MapValueForKey(m, "in") if v2 != nil { x.In, ok = compiler.StringForScalarNode(v2) if !ok { message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [path] if ok && !compiler.StringArrayContainsValue([]string{"path"}, x.In) { message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // string description = 3; v3 := compiler.MapValueForKey(m, "description") if v3 != nil { x.Description, ok = compiler.StringForScalarNode(v3) if !ok { message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v3)) errors = append(errors, compiler.NewError(context, message)) } } // string name = 4; v4 := compiler.MapValueForKey(m, "name") if v4 != nil { x.Name, ok = compiler.StringForScalarNode(v4) if !ok { message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } } // string type = 5; v5 := compiler.MapValueForKey(m, "type") if v5 != nil { x.Type, ok = compiler.StringForScalarNode(v5) if !ok { message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v5)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [string number boolean integer array] if ok && !compiler.StringArrayContainsValue([]string{"string", "number", "boolean", "integer", "array"}, x.Type) { message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v5)) errors = append(errors, compiler.NewError(context, message)) } } // string format = 6; v6 := compiler.MapValueForKey(m, "format") if v6 != nil { x.Format, ok = compiler.StringForScalarNode(v6) if !ok { message := fmt.Sprintf("has unexpected value for format: %s", compiler.Display(v6)) errors = append(errors, compiler.NewError(context, message)) } } // PrimitivesItems items = 7; v7 := compiler.MapValueForKey(m, "items") if v7 != nil { var err error x.Items, err = NewPrimitivesItems(v7, compiler.NewContext("items", v7, context)) if err != nil { errors = append(errors, err) } } // string collection_format = 8; v8 := compiler.MapValueForKey(m, "collectionFormat") if v8 != nil { x.CollectionFormat, ok = compiler.StringForScalarNode(v8) if !ok { message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v8)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [csv ssv tsv pipes] if ok && !compiler.StringArrayContainsValue([]string{"csv", "ssv", "tsv", "pipes"}, x.CollectionFormat) { message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v8)) errors = append(errors, compiler.NewError(context, message)) } } // Any default = 9; v9 := compiler.MapValueForKey(m, "default") if v9 != nil { var err error x.Default, err = NewAny(v9, compiler.NewContext("default", v9, context)) if err != nil { errors = append(errors, err) } } // float maximum = 10; v10 := compiler.MapValueForKey(m, "maximum") if v10 != nil { v, ok := compiler.FloatForScalarNode(v10) if ok { x.Maximum = v } else { message := fmt.Sprintf("has unexpected value for maximum: %s", compiler.Display(v10)) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_maximum = 11; v11 := compiler.MapValueForKey(m, "exclusiveMaximum") if v11 != nil { x.ExclusiveMaximum, ok = compiler.BoolForScalarNode(v11) if !ok { message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %s", compiler.Display(v11)) errors = append(errors, compiler.NewError(context, message)) } } // float minimum = 12; v12 := compiler.MapValueForKey(m, "minimum") if v12 != nil { v, ok := compiler.FloatForScalarNode(v12) if ok { x.Minimum = v } else { message := fmt.Sprintf("has unexpected value for minimum: %s", compiler.Display(v12)) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_minimum = 13; v13 := compiler.MapValueForKey(m, "exclusiveMinimum") if v13 != nil { x.ExclusiveMinimum, ok = compiler.BoolForScalarNode(v13) if !ok { message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %s", compiler.Display(v13)) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_length = 14; v14 := compiler.MapValueForKey(m, "maxLength") if v14 != nil { t, ok := compiler.IntForScalarNode(v14) if ok { x.MaxLength = int64(t) } else { message := fmt.Sprintf("has unexpected value for maxLength: %s", compiler.Display(v14)) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_length = 15; v15 := compiler.MapValueForKey(m, "minLength") if v15 != nil { t, ok := compiler.IntForScalarNode(v15) if ok { x.MinLength = int64(t) } else { message := fmt.Sprintf("has unexpected value for minLength: %s", compiler.Display(v15)) errors = append(errors, compiler.NewError(context, message)) } } // string pattern = 16; v16 := compiler.MapValueForKey(m, "pattern") if v16 != nil { x.Pattern, ok = compiler.StringForScalarNode(v16) if !ok { message := fmt.Sprintf("has unexpected value for pattern: %s", compiler.Display(v16)) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_items = 17; v17 := compiler.MapValueForKey(m, "maxItems") if v17 != nil { t, ok := compiler.IntForScalarNode(v17) if ok { x.MaxItems = int64(t) } else { message := fmt.Sprintf("has unexpected value for maxItems: %s", compiler.Display(v17)) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_items = 18; v18 := compiler.MapValueForKey(m, "minItems") if v18 != nil { t, ok := compiler.IntForScalarNode(v18) if ok { x.MinItems = int64(t) } else { message := fmt.Sprintf("has unexpected value for minItems: %s", compiler.Display(v18)) errors = append(errors, compiler.NewError(context, message)) } } // bool unique_items = 19; v19 := compiler.MapValueForKey(m, "uniqueItems") if v19 != nil { x.UniqueItems, ok = compiler.BoolForScalarNode(v19) if !ok { message := fmt.Sprintf("has unexpected value for uniqueItems: %s", compiler.Display(v19)) errors = append(errors, compiler.NewError(context, message)) } } // repeated Any enum = 20; v20 := compiler.MapValueForKey(m, "enum") if v20 != nil { // repeated Any x.Enum = make([]*Any, 0) a, ok := compiler.SequenceNodeForNode(v20) if ok { for _, item := range a.Content { y, err := NewAny(item, compiler.NewContext("enum", item, context)) if err != nil { errors = append(errors, err) } x.Enum = append(x.Enum, y) } } } // float multiple_of = 21; v21 := compiler.MapValueForKey(m, "multipleOf") if v21 != nil { v, ok := compiler.FloatForScalarNode(v21) if ok { x.MultipleOf = v } else { message := fmt.Sprintf("has unexpected value for multipleOf: %s", compiler.Display(v21)) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 22; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewPaths creates an object of type Paths if possible, returning an error if not. func NewPaths(in *yaml.Node, context *compiler.Context) (*Paths, error) { errors := make([]error, 0) x := &Paths{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{} allowedPatterns := []*regexp.Regexp{pattern0, pattern1} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // repeated NamedAny vendor_extension = 1; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } // repeated NamedPathItem path = 2; // MAP: PathItem ^/ x.Path = make([]*NamedPathItem, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] if strings.HasPrefix(k, "/") { pair := &NamedPathItem{} pair.Name = k var err error pair.Value, err = NewPathItem(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } x.Path = append(x.Path, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewPrimitivesItems creates an object of type PrimitivesItems if possible, returning an error if not. func NewPrimitivesItems(in *yaml.Node, context *compiler.Context) (*PrimitivesItems, error) { errors := make([]error, 0) x := &PrimitivesItems{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"collectionFormat", "default", "enum", "exclusiveMaximum", "exclusiveMinimum", "format", "items", "maxItems", "maxLength", "maximum", "minItems", "minLength", "minimum", "multipleOf", "pattern", "type", "uniqueItems"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string type = 1; v1 := compiler.MapValueForKey(m, "type") if v1 != nil { x.Type, ok = compiler.StringForScalarNode(v1) if !ok { message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [string number integer boolean array] if ok && !compiler.StringArrayContainsValue([]string{"string", "number", "integer", "boolean", "array"}, x.Type) { message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string format = 2; v2 := compiler.MapValueForKey(m, "format") if v2 != nil { x.Format, ok = compiler.StringForScalarNode(v2) if !ok { message := fmt.Sprintf("has unexpected value for format: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // PrimitivesItems items = 3; v3 := compiler.MapValueForKey(m, "items") if v3 != nil { var err error x.Items, err = NewPrimitivesItems(v3, compiler.NewContext("items", v3, context)) if err != nil { errors = append(errors, err) } } // string collection_format = 4; v4 := compiler.MapValueForKey(m, "collectionFormat") if v4 != nil { x.CollectionFormat, ok = compiler.StringForScalarNode(v4) if !ok { message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [csv ssv tsv pipes] if ok && !compiler.StringArrayContainsValue([]string{"csv", "ssv", "tsv", "pipes"}, x.CollectionFormat) { message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } } // Any default = 5; v5 := compiler.MapValueForKey(m, "default") if v5 != nil { var err error x.Default, err = NewAny(v5, compiler.NewContext("default", v5, context)) if err != nil { errors = append(errors, err) } } // float maximum = 6; v6 := compiler.MapValueForKey(m, "maximum") if v6 != nil { v, ok := compiler.FloatForScalarNode(v6) if ok { x.Maximum = v } else { message := fmt.Sprintf("has unexpected value for maximum: %s", compiler.Display(v6)) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_maximum = 7; v7 := compiler.MapValueForKey(m, "exclusiveMaximum") if v7 != nil { x.ExclusiveMaximum, ok = compiler.BoolForScalarNode(v7) if !ok { message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %s", compiler.Display(v7)) errors = append(errors, compiler.NewError(context, message)) } } // float minimum = 8; v8 := compiler.MapValueForKey(m, "minimum") if v8 != nil { v, ok := compiler.FloatForScalarNode(v8) if ok { x.Minimum = v } else { message := fmt.Sprintf("has unexpected value for minimum: %s", compiler.Display(v8)) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_minimum = 9; v9 := compiler.MapValueForKey(m, "exclusiveMinimum") if v9 != nil { x.ExclusiveMinimum, ok = compiler.BoolForScalarNode(v9) if !ok { message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %s", compiler.Display(v9)) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_length = 10; v10 := compiler.MapValueForKey(m, "maxLength") if v10 != nil { t, ok := compiler.IntForScalarNode(v10) if ok { x.MaxLength = int64(t) } else { message := fmt.Sprintf("has unexpected value for maxLength: %s", compiler.Display(v10)) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_length = 11; v11 := compiler.MapValueForKey(m, "minLength") if v11 != nil { t, ok := compiler.IntForScalarNode(v11) if ok { x.MinLength = int64(t) } else { message := fmt.Sprintf("has unexpected value for minLength: %s", compiler.Display(v11)) errors = append(errors, compiler.NewError(context, message)) } } // string pattern = 12; v12 := compiler.MapValueForKey(m, "pattern") if v12 != nil { x.Pattern, ok = compiler.StringForScalarNode(v12) if !ok { message := fmt.Sprintf("has unexpected value for pattern: %s", compiler.Display(v12)) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_items = 13; v13 := compiler.MapValueForKey(m, "maxItems") if v13 != nil { t, ok := compiler.IntForScalarNode(v13) if ok { x.MaxItems = int64(t) } else { message := fmt.Sprintf("has unexpected value for maxItems: %s", compiler.Display(v13)) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_items = 14; v14 := compiler.MapValueForKey(m, "minItems") if v14 != nil { t, ok := compiler.IntForScalarNode(v14) if ok { x.MinItems = int64(t) } else { message := fmt.Sprintf("has unexpected value for minItems: %s", compiler.Display(v14)) errors = append(errors, compiler.NewError(context, message)) } } // bool unique_items = 15; v15 := compiler.MapValueForKey(m, "uniqueItems") if v15 != nil { x.UniqueItems, ok = compiler.BoolForScalarNode(v15) if !ok { message := fmt.Sprintf("has unexpected value for uniqueItems: %s", compiler.Display(v15)) errors = append(errors, compiler.NewError(context, message)) } } // repeated Any enum = 16; v16 := compiler.MapValueForKey(m, "enum") if v16 != nil { // repeated Any x.Enum = make([]*Any, 0) a, ok := compiler.SequenceNodeForNode(v16) if ok { for _, item := range a.Content { y, err := NewAny(item, compiler.NewContext("enum", item, context)) if err != nil { errors = append(errors, err) } x.Enum = append(x.Enum, y) } } } // float multiple_of = 17; v17 := compiler.MapValueForKey(m, "multipleOf") if v17 != nil { v, ok := compiler.FloatForScalarNode(v17) if ok { x.MultipleOf = v } else { message := fmt.Sprintf("has unexpected value for multipleOf: %s", compiler.Display(v17)) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 18; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewProperties creates an object of type Properties if possible, returning an error if not. func NewProperties(in *yaml.Node, context *compiler.Context) (*Properties, error) { errors := make([]error, 0) x := &Properties{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { // repeated NamedSchema additional_properties = 1; // MAP: Schema x.AdditionalProperties = make([]*NamedSchema, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] pair := &NamedSchema{} pair.Name = k var err error pair.Value, err = NewSchema(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } x.AdditionalProperties = append(x.AdditionalProperties, pair) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewQueryParameterSubSchema creates an object of type QueryParameterSubSchema if possible, returning an error if not. func NewQueryParameterSubSchema(in *yaml.Node, context *compiler.Context) (*QueryParameterSubSchema, error) { errors := make([]error, 0) x := &QueryParameterSubSchema{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"allowEmptyValue", "collectionFormat", "default", "description", "enum", "exclusiveMaximum", "exclusiveMinimum", "format", "in", "items", "maxItems", "maxLength", "maximum", "minItems", "minLength", "minimum", "multipleOf", "name", "pattern", "required", "type", "uniqueItems"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // bool required = 1; v1 := compiler.MapValueForKey(m, "required") if v1 != nil { x.Required, ok = compiler.BoolForScalarNode(v1) if !ok { message := fmt.Sprintf("has unexpected value for required: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string in = 2; v2 := compiler.MapValueForKey(m, "in") if v2 != nil { x.In, ok = compiler.StringForScalarNode(v2) if !ok { message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [query] if ok && !compiler.StringArrayContainsValue([]string{"query"}, x.In) { message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // string description = 3; v3 := compiler.MapValueForKey(m, "description") if v3 != nil { x.Description, ok = compiler.StringForScalarNode(v3) if !ok { message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v3)) errors = append(errors, compiler.NewError(context, message)) } } // string name = 4; v4 := compiler.MapValueForKey(m, "name") if v4 != nil { x.Name, ok = compiler.StringForScalarNode(v4) if !ok { message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } } // bool allow_empty_value = 5; v5 := compiler.MapValueForKey(m, "allowEmptyValue") if v5 != nil { x.AllowEmptyValue, ok = compiler.BoolForScalarNode(v5) if !ok { message := fmt.Sprintf("has unexpected value for allowEmptyValue: %s", compiler.Display(v5)) errors = append(errors, compiler.NewError(context, message)) } } // string type = 6; v6 := compiler.MapValueForKey(m, "type") if v6 != nil { x.Type, ok = compiler.StringForScalarNode(v6) if !ok { message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v6)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [string number boolean integer array] if ok && !compiler.StringArrayContainsValue([]string{"string", "number", "boolean", "integer", "array"}, x.Type) { message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v6)) errors = append(errors, compiler.NewError(context, message)) } } // string format = 7; v7 := compiler.MapValueForKey(m, "format") if v7 != nil { x.Format, ok = compiler.StringForScalarNode(v7) if !ok { message := fmt.Sprintf("has unexpected value for format: %s", compiler.Display(v7)) errors = append(errors, compiler.NewError(context, message)) } } // PrimitivesItems items = 8; v8 := compiler.MapValueForKey(m, "items") if v8 != nil { var err error x.Items, err = NewPrimitivesItems(v8, compiler.NewContext("items", v8, context)) if err != nil { errors = append(errors, err) } } // string collection_format = 9; v9 := compiler.MapValueForKey(m, "collectionFormat") if v9 != nil { x.CollectionFormat, ok = compiler.StringForScalarNode(v9) if !ok { message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v9)) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [csv ssv tsv pipes multi] if ok && !compiler.StringArrayContainsValue([]string{"csv", "ssv", "tsv", "pipes", "multi"}, x.CollectionFormat) { message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v9)) errors = append(errors, compiler.NewError(context, message)) } } // Any default = 10; v10 := compiler.MapValueForKey(m, "default") if v10 != nil { var err error x.Default, err = NewAny(v10, compiler.NewContext("default", v10, context)) if err != nil { errors = append(errors, err) } } // float maximum = 11; v11 := compiler.MapValueForKey(m, "maximum") if v11 != nil { v, ok := compiler.FloatForScalarNode(v11) if ok { x.Maximum = v } else { message := fmt.Sprintf("has unexpected value for maximum: %s", compiler.Display(v11)) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_maximum = 12; v12 := compiler.MapValueForKey(m, "exclusiveMaximum") if v12 != nil { x.ExclusiveMaximum, ok = compiler.BoolForScalarNode(v12) if !ok { message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %s", compiler.Display(v12)) errors = append(errors, compiler.NewError(context, message)) } } // float minimum = 13; v13 := compiler.MapValueForKey(m, "minimum") if v13 != nil { v, ok := compiler.FloatForScalarNode(v13) if ok { x.Minimum = v } else { message := fmt.Sprintf("has unexpected value for minimum: %s", compiler.Display(v13)) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_minimum = 14; v14 := compiler.MapValueForKey(m, "exclusiveMinimum") if v14 != nil { x.ExclusiveMinimum, ok = compiler.BoolForScalarNode(v14) if !ok { message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %s", compiler.Display(v14)) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_length = 15; v15 := compiler.MapValueForKey(m, "maxLength") if v15 != nil { t, ok := compiler.IntForScalarNode(v15) if ok { x.MaxLength = int64(t) } else { message := fmt.Sprintf("has unexpected value for maxLength: %s", compiler.Display(v15)) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_length = 16; v16 := compiler.MapValueForKey(m, "minLength") if v16 != nil { t, ok := compiler.IntForScalarNode(v16) if ok { x.MinLength = int64(t) } else { message := fmt.Sprintf("has unexpected value for minLength: %s", compiler.Display(v16)) errors = append(errors, compiler.NewError(context, message)) } } // string pattern = 17; v17 := compiler.MapValueForKey(m, "pattern") if v17 != nil { x.Pattern, ok = compiler.StringForScalarNode(v17) if !ok { message := fmt.Sprintf("has unexpected value for pattern: %s", compiler.Display(v17)) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_items = 18; v18 := compiler.MapValueForKey(m, "maxItems") if v18 != nil { t, ok := compiler.IntForScalarNode(v18) if ok { x.MaxItems = int64(t) } else { message := fmt.Sprintf("has unexpected value for maxItems: %s", compiler.Display(v18)) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_items = 19; v19 := compiler.MapValueForKey(m, "minItems") if v19 != nil { t, ok := compiler.IntForScalarNode(v19) if ok { x.MinItems = int64(t) } else { message := fmt.Sprintf("has unexpected value for minItems: %s", compiler.Display(v19)) errors = append(errors, compiler.NewError(context, message)) } } // bool unique_items = 20; v20 := compiler.MapValueForKey(m, "uniqueItems") if v20 != nil { x.UniqueItems, ok = compiler.BoolForScalarNode(v20) if !ok { message := fmt.Sprintf("has unexpected value for uniqueItems: %s", compiler.Display(v20)) errors = append(errors, compiler.NewError(context, message)) } } // repeated Any enum = 21; v21 := compiler.MapValueForKey(m, "enum") if v21 != nil { // repeated Any x.Enum = make([]*Any, 0) a, ok := compiler.SequenceNodeForNode(v21) if ok { for _, item := range a.Content { y, err := NewAny(item, compiler.NewContext("enum", item, context)) if err != nil { errors = append(errors, err) } x.Enum = append(x.Enum, y) } } } // float multiple_of = 22; v22 := compiler.MapValueForKey(m, "multipleOf") if v22 != nil { v, ok := compiler.FloatForScalarNode(v22) if ok { x.MultipleOf = v } else { message := fmt.Sprintf("has unexpected value for multipleOf: %s", compiler.Display(v22)) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 23; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewResponse creates an object of type Response if possible, returning an error if not. func NewResponse(in *yaml.Node, context *compiler.Context) (*Response, error) { errors := make([]error, 0) x := &Response{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"description"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } allowedKeys := []string{"description", "examples", "headers", "schema"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string description = 1; v1 := compiler.MapValueForKey(m, "description") if v1 != nil { x.Description, ok = compiler.StringForScalarNode(v1) if !ok { message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // SchemaItem schema = 2; v2 := compiler.MapValueForKey(m, "schema") if v2 != nil { var err error x.Schema, err = NewSchemaItem(v2, compiler.NewContext("schema", v2, context)) if err != nil { errors = append(errors, err) } } // Headers headers = 3; v3 := compiler.MapValueForKey(m, "headers") if v3 != nil { var err error x.Headers, err = NewHeaders(v3, compiler.NewContext("headers", v3, context)) if err != nil { errors = append(errors, err) } } // Examples examples = 4; v4 := compiler.MapValueForKey(m, "examples") if v4 != nil { var err error x.Examples, err = NewExamples(v4, compiler.NewContext("examples", v4, context)) if err != nil { errors = append(errors, err) } } // repeated NamedAny vendor_extension = 5; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewResponseDefinitions creates an object of type ResponseDefinitions if possible, returning an error if not. func NewResponseDefinitions(in *yaml.Node, context *compiler.Context) (*ResponseDefinitions, error) { errors := make([]error, 0) x := &ResponseDefinitions{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { // repeated NamedResponse additional_properties = 1; // MAP: Response x.AdditionalProperties = make([]*NamedResponse, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] pair := &NamedResponse{} pair.Name = k var err error pair.Value, err = NewResponse(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } x.AdditionalProperties = append(x.AdditionalProperties, pair) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewResponseValue creates an object of type ResponseValue if possible, returning an error if not. func NewResponseValue(in *yaml.Node, context *compiler.Context) (*ResponseValue, error) { errors := make([]error, 0) x := &ResponseValue{} matched := false // Response response = 1; { m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewResponse(m, compiler.NewContext("response", m, context)) if matchingError == nil { x.Oneof = &ResponseValue_Response{Response: t} matched = true } else { errors = append(errors, matchingError) } } } // JsonReference json_reference = 2; { m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewJsonReference(m, compiler.NewContext("jsonReference", m, context)) if matchingError == nil { x.Oneof = &ResponseValue_JsonReference{JsonReference: t} matched = true } else { errors = append(errors, matchingError) } } } if matched { // since the oneof matched one of its possibilities, discard any matching errors errors = make([]error, 0) } else { message := fmt.Sprintf("contains an invalid ResponseValue") err := compiler.NewError(context, message) errors = []error{err} } return x, compiler.NewErrorGroupOrNil(errors) } // NewResponses creates an object of type Responses if possible, returning an error if not. func NewResponses(in *yaml.Node, context *compiler.Context) (*Responses, error) { errors := make([]error, 0) x := &Responses{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{} allowedPatterns := []*regexp.Regexp{pattern2, pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // repeated NamedResponseValue response_code = 1; // MAP: ResponseValue ^([0-9]{3})$|^(default)$ x.ResponseCode = make([]*NamedResponseValue, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] if pattern2.MatchString(k) { pair := &NamedResponseValue{} pair.Name = k var err error pair.Value, err = NewResponseValue(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } x.ResponseCode = append(x.ResponseCode, pair) } } } // repeated NamedAny vendor_extension = 2; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewSchema creates an object of type Schema if possible, returning an error if not. func NewSchema(in *yaml.Node, context *compiler.Context) (*Schema, error) { errors := make([]error, 0) x := &Schema{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"$ref", "additionalProperties", "allOf", "default", "description", "discriminator", "enum", "example", "exclusiveMaximum", "exclusiveMinimum", "externalDocs", "format", "items", "maxItems", "maxLength", "maxProperties", "maximum", "minItems", "minLength", "minProperties", "minimum", "multipleOf", "pattern", "properties", "readOnly", "required", "title", "type", "uniqueItems", "xml"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string _ref = 1; v1 := compiler.MapValueForKey(m, "$ref") if v1 != nil { x.XRef, ok = compiler.StringForScalarNode(v1) if !ok { message := fmt.Sprintf("has unexpected value for $ref: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string format = 2; v2 := compiler.MapValueForKey(m, "format") if v2 != nil { x.Format, ok = compiler.StringForScalarNode(v2) if !ok { message := fmt.Sprintf("has unexpected value for format: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // string title = 3; v3 := compiler.MapValueForKey(m, "title") if v3 != nil { x.Title, ok = compiler.StringForScalarNode(v3) if !ok { message := fmt.Sprintf("has unexpected value for title: %s", compiler.Display(v3)) errors = append(errors, compiler.NewError(context, message)) } } // string description = 4; v4 := compiler.MapValueForKey(m, "description") if v4 != nil { x.Description, ok = compiler.StringForScalarNode(v4) if !ok { message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } } // Any default = 5; v5 := compiler.MapValueForKey(m, "default") if v5 != nil { var err error x.Default, err = NewAny(v5, compiler.NewContext("default", v5, context)) if err != nil { errors = append(errors, err) } } // float multiple_of = 6; v6 := compiler.MapValueForKey(m, "multipleOf") if v6 != nil { v, ok := compiler.FloatForScalarNode(v6) if ok { x.MultipleOf = v } else { message := fmt.Sprintf("has unexpected value for multipleOf: %s", compiler.Display(v6)) errors = append(errors, compiler.NewError(context, message)) } } // float maximum = 7; v7 := compiler.MapValueForKey(m, "maximum") if v7 != nil { v, ok := compiler.FloatForScalarNode(v7) if ok { x.Maximum = v } else { message := fmt.Sprintf("has unexpected value for maximum: %s", compiler.Display(v7)) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_maximum = 8; v8 := compiler.MapValueForKey(m, "exclusiveMaximum") if v8 != nil { x.ExclusiveMaximum, ok = compiler.BoolForScalarNode(v8) if !ok { message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %s", compiler.Display(v8)) errors = append(errors, compiler.NewError(context, message)) } } // float minimum = 9; v9 := compiler.MapValueForKey(m, "minimum") if v9 != nil { v, ok := compiler.FloatForScalarNode(v9) if ok { x.Minimum = v } else { message := fmt.Sprintf("has unexpected value for minimum: %s", compiler.Display(v9)) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_minimum = 10; v10 := compiler.MapValueForKey(m, "exclusiveMinimum") if v10 != nil { x.ExclusiveMinimum, ok = compiler.BoolForScalarNode(v10) if !ok { message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %s", compiler.Display(v10)) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_length = 11; v11 := compiler.MapValueForKey(m, "maxLength") if v11 != nil { t, ok := compiler.IntForScalarNode(v11) if ok { x.MaxLength = int64(t) } else { message := fmt.Sprintf("has unexpected value for maxLength: %s", compiler.Display(v11)) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_length = 12; v12 := compiler.MapValueForKey(m, "minLength") if v12 != nil { t, ok := compiler.IntForScalarNode(v12) if ok { x.MinLength = int64(t) } else { message := fmt.Sprintf("has unexpected value for minLength: %s", compiler.Display(v12)) errors = append(errors, compiler.NewError(context, message)) } } // string pattern = 13; v13 := compiler.MapValueForKey(m, "pattern") if v13 != nil { x.Pattern, ok = compiler.StringForScalarNode(v13) if !ok { message := fmt.Sprintf("has unexpected value for pattern: %s", compiler.Display(v13)) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_items = 14; v14 := compiler.MapValueForKey(m, "maxItems") if v14 != nil { t, ok := compiler.IntForScalarNode(v14) if ok { x.MaxItems = int64(t) } else { message := fmt.Sprintf("has unexpected value for maxItems: %s", compiler.Display(v14)) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_items = 15; v15 := compiler.MapValueForKey(m, "minItems") if v15 != nil { t, ok := compiler.IntForScalarNode(v15) if ok { x.MinItems = int64(t) } else { message := fmt.Sprintf("has unexpected value for minItems: %s", compiler.Display(v15)) errors = append(errors, compiler.NewError(context, message)) } } // bool unique_items = 16; v16 := compiler.MapValueForKey(m, "uniqueItems") if v16 != nil { x.UniqueItems, ok = compiler.BoolForScalarNode(v16) if !ok { message := fmt.Sprintf("has unexpected value for uniqueItems: %s", compiler.Display(v16)) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_properties = 17; v17 := compiler.MapValueForKey(m, "maxProperties") if v17 != nil { t, ok := compiler.IntForScalarNode(v17) if ok { x.MaxProperties = int64(t) } else { message := fmt.Sprintf("has unexpected value for maxProperties: %s", compiler.Display(v17)) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_properties = 18; v18 := compiler.MapValueForKey(m, "minProperties") if v18 != nil { t, ok := compiler.IntForScalarNode(v18) if ok { x.MinProperties = int64(t) } else { message := fmt.Sprintf("has unexpected value for minProperties: %s", compiler.Display(v18)) errors = append(errors, compiler.NewError(context, message)) } } // repeated string required = 19; v19 := compiler.MapValueForKey(m, "required") if v19 != nil { v, ok := compiler.SequenceNodeForNode(v19) if ok { x.Required = compiler.StringArrayForSequenceNode(v) } else { message := fmt.Sprintf("has unexpected value for required: %s", compiler.Display(v19)) errors = append(errors, compiler.NewError(context, message)) } } // repeated Any enum = 20; v20 := compiler.MapValueForKey(m, "enum") if v20 != nil { // repeated Any x.Enum = make([]*Any, 0) a, ok := compiler.SequenceNodeForNode(v20) if ok { for _, item := range a.Content { y, err := NewAny(item, compiler.NewContext("enum", item, context)) if err != nil { errors = append(errors, err) } x.Enum = append(x.Enum, y) } } } // AdditionalPropertiesItem additional_properties = 21; v21 := compiler.MapValueForKey(m, "additionalProperties") if v21 != nil { var err error x.AdditionalProperties, err = NewAdditionalPropertiesItem(v21, compiler.NewContext("additionalProperties", v21, context)) if err != nil { errors = append(errors, err) } } // TypeItem type = 22; v22 := compiler.MapValueForKey(m, "type") if v22 != nil { var err error x.Type, err = NewTypeItem(v22, compiler.NewContext("type", v22, context)) if err != nil { errors = append(errors, err) } } // ItemsItem items = 23; v23 := compiler.MapValueForKey(m, "items") if v23 != nil { var err error x.Items, err = NewItemsItem(v23, compiler.NewContext("items", v23, context)) if err != nil { errors = append(errors, err) } } // repeated Schema all_of = 24; v24 := compiler.MapValueForKey(m, "allOf") if v24 != nil { // repeated Schema x.AllOf = make([]*Schema, 0) a, ok := compiler.SequenceNodeForNode(v24) if ok { for _, item := range a.Content { y, err := NewSchema(item, compiler.NewContext("allOf", item, context)) if err != nil { errors = append(errors, err) } x.AllOf = append(x.AllOf, y) } } } // Properties properties = 25; v25 := compiler.MapValueForKey(m, "properties") if v25 != nil { var err error x.Properties, err = NewProperties(v25, compiler.NewContext("properties", v25, context)) if err != nil { errors = append(errors, err) } } // string discriminator = 26; v26 := compiler.MapValueForKey(m, "discriminator") if v26 != nil { x.Discriminator, ok = compiler.StringForScalarNode(v26) if !ok { message := fmt.Sprintf("has unexpected value for discriminator: %s", compiler.Display(v26)) errors = append(errors, compiler.NewError(context, message)) } } // bool read_only = 27; v27 := compiler.MapValueForKey(m, "readOnly") if v27 != nil { x.ReadOnly, ok = compiler.BoolForScalarNode(v27) if !ok { message := fmt.Sprintf("has unexpected value for readOnly: %s", compiler.Display(v27)) errors = append(errors, compiler.NewError(context, message)) } } // Xml xml = 28; v28 := compiler.MapValueForKey(m, "xml") if v28 != nil { var err error x.Xml, err = NewXml(v28, compiler.NewContext("xml", v28, context)) if err != nil { errors = append(errors, err) } } // ExternalDocs external_docs = 29; v29 := compiler.MapValueForKey(m, "externalDocs") if v29 != nil { var err error x.ExternalDocs, err = NewExternalDocs(v29, compiler.NewContext("externalDocs", v29, context)) if err != nil { errors = append(errors, err) } } // Any example = 30; v30 := compiler.MapValueForKey(m, "example") if v30 != nil { var err error x.Example, err = NewAny(v30, compiler.NewContext("example", v30, context)) if err != nil { errors = append(errors, err) } } // repeated NamedAny vendor_extension = 31; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewSchemaItem creates an object of type SchemaItem if possible, returning an error if not. func NewSchemaItem(in *yaml.Node, context *compiler.Context) (*SchemaItem, error) { errors := make([]error, 0) x := &SchemaItem{} matched := false // Schema schema = 1; { m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewSchema(m, compiler.NewContext("schema", m, context)) if matchingError == nil { x.Oneof = &SchemaItem_Schema{Schema: t} matched = true } else { errors = append(errors, matchingError) } } } // FileSchema file_schema = 2; { m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewFileSchema(m, compiler.NewContext("fileSchema", m, context)) if matchingError == nil { x.Oneof = &SchemaItem_FileSchema{FileSchema: t} matched = true } else { errors = append(errors, matchingError) } } } if matched { // since the oneof matched one of its possibilities, discard any matching errors errors = make([]error, 0) } else { message := fmt.Sprintf("contains an invalid SchemaItem") err := compiler.NewError(context, message) errors = []error{err} } return x, compiler.NewErrorGroupOrNil(errors) } // NewSecurityDefinitions creates an object of type SecurityDefinitions if possible, returning an error if not. func NewSecurityDefinitions(in *yaml.Node, context *compiler.Context) (*SecurityDefinitions, error) { errors := make([]error, 0) x := &SecurityDefinitions{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { // repeated NamedSecurityDefinitionsItem additional_properties = 1; // MAP: SecurityDefinitionsItem x.AdditionalProperties = make([]*NamedSecurityDefinitionsItem, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] pair := &NamedSecurityDefinitionsItem{} pair.Name = k var err error pair.Value, err = NewSecurityDefinitionsItem(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } x.AdditionalProperties = append(x.AdditionalProperties, pair) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewSecurityDefinitionsItem creates an object of type SecurityDefinitionsItem if possible, returning an error if not. func NewSecurityDefinitionsItem(in *yaml.Node, context *compiler.Context) (*SecurityDefinitionsItem, error) { errors := make([]error, 0) x := &SecurityDefinitionsItem{} matched := false // BasicAuthenticationSecurity basic_authentication_security = 1; { m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewBasicAuthenticationSecurity(m, compiler.NewContext("basicAuthenticationSecurity", m, context)) if matchingError == nil { x.Oneof = &SecurityDefinitionsItem_BasicAuthenticationSecurity{BasicAuthenticationSecurity: t} matched = true } else { errors = append(errors, matchingError) } } } // ApiKeySecurity api_key_security = 2; { m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewApiKeySecurity(m, compiler.NewContext("apiKeySecurity", m, context)) if matchingError == nil { x.Oneof = &SecurityDefinitionsItem_ApiKeySecurity{ApiKeySecurity: t} matched = true } else { errors = append(errors, matchingError) } } } // Oauth2ImplicitSecurity oauth2_implicit_security = 3; { m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewOauth2ImplicitSecurity(m, compiler.NewContext("oauth2ImplicitSecurity", m, context)) if matchingError == nil { x.Oneof = &SecurityDefinitionsItem_Oauth2ImplicitSecurity{Oauth2ImplicitSecurity: t} matched = true } else { errors = append(errors, matchingError) } } } // Oauth2PasswordSecurity oauth2_password_security = 4; { m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewOauth2PasswordSecurity(m, compiler.NewContext("oauth2PasswordSecurity", m, context)) if matchingError == nil { x.Oneof = &SecurityDefinitionsItem_Oauth2PasswordSecurity{Oauth2PasswordSecurity: t} matched = true } else { errors = append(errors, matchingError) } } } // Oauth2ApplicationSecurity oauth2_application_security = 5; { m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewOauth2ApplicationSecurity(m, compiler.NewContext("oauth2ApplicationSecurity", m, context)) if matchingError == nil { x.Oneof = &SecurityDefinitionsItem_Oauth2ApplicationSecurity{Oauth2ApplicationSecurity: t} matched = true } else { errors = append(errors, matchingError) } } } // Oauth2AccessCodeSecurity oauth2_access_code_security = 6; { m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewOauth2AccessCodeSecurity(m, compiler.NewContext("oauth2AccessCodeSecurity", m, context)) if matchingError == nil { x.Oneof = &SecurityDefinitionsItem_Oauth2AccessCodeSecurity{Oauth2AccessCodeSecurity: t} matched = true } else { errors = append(errors, matchingError) } } } if matched { // since the oneof matched one of its possibilities, discard any matching errors errors = make([]error, 0) } else { message := fmt.Sprintf("contains an invalid SecurityDefinitionsItem") err := compiler.NewError(context, message) errors = []error{err} } return x, compiler.NewErrorGroupOrNil(errors) } // NewSecurityRequirement creates an object of type SecurityRequirement if possible, returning an error if not. func NewSecurityRequirement(in *yaml.Node, context *compiler.Context) (*SecurityRequirement, error) { errors := make([]error, 0) x := &SecurityRequirement{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { // repeated NamedStringArray additional_properties = 1; // MAP: StringArray x.AdditionalProperties = make([]*NamedStringArray, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] pair := &NamedStringArray{} pair.Name = k var err error pair.Value, err = NewStringArray(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } x.AdditionalProperties = append(x.AdditionalProperties, pair) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewStringArray creates an object of type StringArray if possible, returning an error if not. func NewStringArray(in *yaml.Node, context *compiler.Context) (*StringArray, error) { errors := make([]error, 0) x := &StringArray{} x.Value = make([]string, 0) for _, node := range in.Content { s, _ := compiler.StringForScalarNode(node) x.Value = append(x.Value, s) } return x, compiler.NewErrorGroupOrNil(errors) } // NewTag creates an object of type Tag if possible, returning an error if not. func NewTag(in *yaml.Node, context *compiler.Context) (*Tag, error) { errors := make([]error, 0) x := &Tag{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"name"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } allowedKeys := []string{"description", "externalDocs", "name"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { x.Name, ok = compiler.StringForScalarNode(v1) if !ok { message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string description = 2; v2 := compiler.MapValueForKey(m, "description") if v2 != nil { x.Description, ok = compiler.StringForScalarNode(v2) if !ok { message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // ExternalDocs external_docs = 3; v3 := compiler.MapValueForKey(m, "externalDocs") if v3 != nil { var err error x.ExternalDocs, err = NewExternalDocs(v3, compiler.NewContext("externalDocs", v3, context)) if err != nil { errors = append(errors, err) } } // repeated NamedAny vendor_extension = 4; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewTypeItem creates an object of type TypeItem if possible, returning an error if not. func NewTypeItem(in *yaml.Node, context *compiler.Context) (*TypeItem, error) { errors := make([]error, 0) x := &TypeItem{} v1 := in switch v1.Kind { case yaml.ScalarNode: x.Value = make([]string, 0) x.Value = append(x.Value, v1.Value) case yaml.SequenceNode: x.Value = make([]string, 0) for _, v := range v1.Content { value := v.Value ok := v.Kind == yaml.ScalarNode if ok { x.Value = append(x.Value, value) } else { message := fmt.Sprintf("has unexpected value for string array element: %+v (%T)", value, value) errors = append(errors, compiler.NewError(context, message)) } } default: message := fmt.Sprintf("has unexpected value for string array: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } return x, compiler.NewErrorGroupOrNil(errors) } // NewVendorExtension creates an object of type VendorExtension if possible, returning an error if not. func NewVendorExtension(in *yaml.Node, context *compiler.Context) (*VendorExtension, error) { errors := make([]error, 0) x := &VendorExtension{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { // repeated NamedAny additional_properties = 1; // MAP: Any x.AdditionalProperties = make([]*NamedAny, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } } x.AdditionalProperties = append(x.AdditionalProperties, pair) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewXml creates an object of type Xml if possible, returning an error if not. func NewXml(in *yaml.Node, context *compiler.Context) (*Xml, error) { errors := make([]error, 0) x := &Xml{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"attribute", "name", "namespace", "prefix", "wrapped"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { x.Name, ok = compiler.StringForScalarNode(v1) if !ok { message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) errors = append(errors, compiler.NewError(context, message)) } } // string namespace = 2; v2 := compiler.MapValueForKey(m, "namespace") if v2 != nil { x.Namespace, ok = compiler.StringForScalarNode(v2) if !ok { message := fmt.Sprintf("has unexpected value for namespace: %s", compiler.Display(v2)) errors = append(errors, compiler.NewError(context, message)) } } // string prefix = 3; v3 := compiler.MapValueForKey(m, "prefix") if v3 != nil { x.Prefix, ok = compiler.StringForScalarNode(v3) if !ok { message := fmt.Sprintf("has unexpected value for prefix: %s", compiler.Display(v3)) errors = append(errors, compiler.NewError(context, message)) } } // bool attribute = 4; v4 := compiler.MapValueForKey(m, "attribute") if v4 != nil { x.Attribute, ok = compiler.BoolForScalarNode(v4) if !ok { message := fmt.Sprintf("has unexpected value for attribute: %s", compiler.Display(v4)) errors = append(errors, compiler.NewError(context, message)) } } // bool wrapped = 5; v5 := compiler.MapValueForKey(m, "wrapped") if v5 != nil { x.Wrapped, ok = compiler.BoolForScalarNode(v5) if !ok { message := fmt.Sprintf("has unexpected value for wrapped: %s", compiler.Display(v5)) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 6; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for i := 0; i < len(m.Content); i += 2 { k, ok := compiler.StringForScalarNode(m.Content[i]) if ok { v := m.Content[i+1] if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.CallExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes := compiler.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside AdditionalPropertiesItem objects. func (m *AdditionalPropertiesItem) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) { p, ok := m.Oneof.(*AdditionalPropertiesItem_Schema) if ok { _, err := p.Schema.ResolveReferences(root) if err != nil { return nil, err } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Any objects. func (m *Any) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside ApiKeySecurity objects. func (m *ApiKeySecurity) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside BasicAuthenticationSecurity objects. func (m *BasicAuthenticationSecurity) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside BodyParameter objects. func (m *BodyParameter) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Schema != nil { _, err := m.Schema.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Contact objects. func (m *Contact) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Default objects. func (m *Default) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.AdditionalProperties { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Definitions objects. func (m *Definitions) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.AdditionalProperties { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Document objects. func (m *Document) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Info != nil { _, err := m.Info.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Paths != nil { _, err := m.Paths.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Definitions != nil { _, err := m.Definitions.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Parameters != nil { _, err := m.Parameters.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Responses != nil { _, err := m.Responses.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.Security { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } if m.SecurityDefinitions != nil { _, err := m.SecurityDefinitions.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.Tags { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } if m.ExternalDocs != nil { _, err := m.ExternalDocs.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Examples objects. func (m *Examples) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.AdditionalProperties { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside ExternalDocs objects. func (m *ExternalDocs) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside FileSchema objects. func (m *FileSchema) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Default != nil { _, err := m.Default.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.ExternalDocs != nil { _, err := m.ExternalDocs.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Example != nil { _, err := m.Example.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside FormDataParameterSubSchema objects. func (m *FormDataParameterSubSchema) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Items != nil { _, err := m.Items.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Default != nil { _, err := m.Default.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.Enum { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Header objects. func (m *Header) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Items != nil { _, err := m.Items.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Default != nil { _, err := m.Default.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.Enum { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside HeaderParameterSubSchema objects. func (m *HeaderParameterSubSchema) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Items != nil { _, err := m.Items.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Default != nil { _, err := m.Default.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.Enum { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Headers objects. func (m *Headers) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.AdditionalProperties { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Info objects. func (m *Info) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Contact != nil { _, err := m.Contact.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.License != nil { _, err := m.License.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside ItemsItem objects. func (m *ItemsItem) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.Schema { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside JsonReference objects. func (m *JsonReference) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.XRef != "" { info, err := compiler.ReadInfoForRef(root, m.XRef) if err != nil { return nil, err } if info != nil { replacement, err := NewJsonReference(info, nil) if err == nil { *m = *replacement return m.ResolveReferences(root) } } return info, nil } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside License objects. func (m *License) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside NamedAny objects. func (m *NamedAny) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Value != nil { _, err := m.Value.ResolveReferences(root) if err != nil { errors = append(errors, err) } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside NamedHeader objects. func (m *NamedHeader) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Value != nil { _, err := m.Value.ResolveReferences(root) if err != nil { errors = append(errors, err) } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside NamedParameter objects. func (m *NamedParameter) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Value != nil { _, err := m.Value.ResolveReferences(root) if err != nil { errors = append(errors, err) } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside NamedPathItem objects. func (m *NamedPathItem) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Value != nil { _, err := m.Value.ResolveReferences(root) if err != nil { errors = append(errors, err) } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside NamedResponse objects. func (m *NamedResponse) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Value != nil { _, err := m.Value.ResolveReferences(root) if err != nil { errors = append(errors, err) } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside NamedResponseValue objects. func (m *NamedResponseValue) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Value != nil { _, err := m.Value.ResolveReferences(root) if err != nil { errors = append(errors, err) } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside NamedSchema objects. func (m *NamedSchema) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Value != nil { _, err := m.Value.ResolveReferences(root) if err != nil { errors = append(errors, err) } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside NamedSecurityDefinitionsItem objects. func (m *NamedSecurityDefinitionsItem) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Value != nil { _, err := m.Value.ResolveReferences(root) if err != nil { errors = append(errors, err) } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside NamedString objects. func (m *NamedString) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside NamedStringArray objects. func (m *NamedStringArray) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Value != nil { _, err := m.Value.ResolveReferences(root) if err != nil { errors = append(errors, err) } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside NonBodyParameter objects. func (m *NonBodyParameter) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) { p, ok := m.Oneof.(*NonBodyParameter_HeaderParameterSubSchema) if ok { _, err := p.HeaderParameterSubSchema.ResolveReferences(root) if err != nil { return nil, err } } } { p, ok := m.Oneof.(*NonBodyParameter_FormDataParameterSubSchema) if ok { _, err := p.FormDataParameterSubSchema.ResolveReferences(root) if err != nil { return nil, err } } } { p, ok := m.Oneof.(*NonBodyParameter_QueryParameterSubSchema) if ok { _, err := p.QueryParameterSubSchema.ResolveReferences(root) if err != nil { return nil, err } } } { p, ok := m.Oneof.(*NonBodyParameter_PathParameterSubSchema) if ok { _, err := p.PathParameterSubSchema.ResolveReferences(root) if err != nil { return nil, err } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Oauth2AccessCodeSecurity objects. func (m *Oauth2AccessCodeSecurity) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Scopes != nil { _, err := m.Scopes.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Oauth2ApplicationSecurity objects. func (m *Oauth2ApplicationSecurity) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Scopes != nil { _, err := m.Scopes.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Oauth2ImplicitSecurity objects. func (m *Oauth2ImplicitSecurity) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Scopes != nil { _, err := m.Scopes.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Oauth2PasswordSecurity objects. func (m *Oauth2PasswordSecurity) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Scopes != nil { _, err := m.Scopes.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Oauth2Scopes objects. func (m *Oauth2Scopes) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.AdditionalProperties { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Operation objects. func (m *Operation) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.ExternalDocs != nil { _, err := m.ExternalDocs.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.Parameters { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } if m.Responses != nil { _, err := m.Responses.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.Security { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Parameter objects. func (m *Parameter) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) { p, ok := m.Oneof.(*Parameter_BodyParameter) if ok { _, err := p.BodyParameter.ResolveReferences(root) if err != nil { return nil, err } } } { p, ok := m.Oneof.(*Parameter_NonBodyParameter) if ok { _, err := p.NonBodyParameter.ResolveReferences(root) if err != nil { return nil, err } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside ParameterDefinitions objects. func (m *ParameterDefinitions) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.AdditionalProperties { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside ParametersItem objects. func (m *ParametersItem) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) { p, ok := m.Oneof.(*ParametersItem_Parameter) if ok { _, err := p.Parameter.ResolveReferences(root) if err != nil { return nil, err } } } { p, ok := m.Oneof.(*ParametersItem_JsonReference) if ok { info, err := p.JsonReference.ResolveReferences(root) if err != nil { return nil, err } else if info != nil { n, err := NewParametersItem(info, nil) if err != nil { return nil, err } else if n != nil { *m = *n return nil, nil } } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside PathItem objects. func (m *PathItem) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.XRef != "" { info, err := compiler.ReadInfoForRef(root, m.XRef) if err != nil { return nil, err } if info != nil { replacement, err := NewPathItem(info, nil) if err == nil { *m = *replacement return m.ResolveReferences(root) } } return info, nil } if m.Get != nil { _, err := m.Get.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Put != nil { _, err := m.Put.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Post != nil { _, err := m.Post.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Delete != nil { _, err := m.Delete.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Options != nil { _, err := m.Options.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Head != nil { _, err := m.Head.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Patch != nil { _, err := m.Patch.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.Parameters { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside PathParameterSubSchema objects. func (m *PathParameterSubSchema) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Items != nil { _, err := m.Items.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Default != nil { _, err := m.Default.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.Enum { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Paths objects. func (m *Paths) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } for _, item := range m.Path { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside PrimitivesItems objects. func (m *PrimitivesItems) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Items != nil { _, err := m.Items.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Default != nil { _, err := m.Default.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.Enum { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Properties objects. func (m *Properties) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.AdditionalProperties { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside QueryParameterSubSchema objects. func (m *QueryParameterSubSchema) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Items != nil { _, err := m.Items.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Default != nil { _, err := m.Default.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.Enum { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Response objects. func (m *Response) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.Schema != nil { _, err := m.Schema.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Headers != nil { _, err := m.Headers.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Examples != nil { _, err := m.Examples.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside ResponseDefinitions objects. func (m *ResponseDefinitions) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.AdditionalProperties { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside ResponseValue objects. func (m *ResponseValue) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) { p, ok := m.Oneof.(*ResponseValue_Response) if ok { _, err := p.Response.ResolveReferences(root) if err != nil { return nil, err } } } { p, ok := m.Oneof.(*ResponseValue_JsonReference) if ok { info, err := p.JsonReference.ResolveReferences(root) if err != nil { return nil, err } else if info != nil { n, err := NewResponseValue(info, nil) if err != nil { return nil, err } else if n != nil { *m = *n return nil, nil } } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Responses objects. func (m *Responses) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.ResponseCode { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Schema objects. func (m *Schema) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.XRef != "" { info, err := compiler.ReadInfoForRef(root, m.XRef) if err != nil { return nil, err } if info != nil { replacement, err := NewSchema(info, nil) if err == nil { *m = *replacement return m.ResolveReferences(root) } } return info, nil } if m.Default != nil { _, err := m.Default.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.Enum { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } if m.AdditionalProperties != nil { _, err := m.AdditionalProperties.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Type != nil { _, err := m.Type.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Items != nil { _, err := m.Items.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.AllOf { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } if m.Properties != nil { _, err := m.Properties.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Xml != nil { _, err := m.Xml.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.ExternalDocs != nil { _, err := m.ExternalDocs.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Example != nil { _, err := m.Example.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside SchemaItem objects. func (m *SchemaItem) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) { p, ok := m.Oneof.(*SchemaItem_Schema) if ok { _, err := p.Schema.ResolveReferences(root) if err != nil { return nil, err } } } { p, ok := m.Oneof.(*SchemaItem_FileSchema) if ok { _, err := p.FileSchema.ResolveReferences(root) if err != nil { return nil, err } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside SecurityDefinitions objects. func (m *SecurityDefinitions) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.AdditionalProperties { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside SecurityDefinitionsItem objects. func (m *SecurityDefinitionsItem) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) { p, ok := m.Oneof.(*SecurityDefinitionsItem_BasicAuthenticationSecurity) if ok { _, err := p.BasicAuthenticationSecurity.ResolveReferences(root) if err != nil { return nil, err } } } { p, ok := m.Oneof.(*SecurityDefinitionsItem_ApiKeySecurity) if ok { _, err := p.ApiKeySecurity.ResolveReferences(root) if err != nil { return nil, err } } } { p, ok := m.Oneof.(*SecurityDefinitionsItem_Oauth2ImplicitSecurity) if ok { _, err := p.Oauth2ImplicitSecurity.ResolveReferences(root) if err != nil { return nil, err } } } { p, ok := m.Oneof.(*SecurityDefinitionsItem_Oauth2PasswordSecurity) if ok { _, err := p.Oauth2PasswordSecurity.ResolveReferences(root) if err != nil { return nil, err } } } { p, ok := m.Oneof.(*SecurityDefinitionsItem_Oauth2ApplicationSecurity) if ok { _, err := p.Oauth2ApplicationSecurity.ResolveReferences(root) if err != nil { return nil, err } } } { p, ok := m.Oneof.(*SecurityDefinitionsItem_Oauth2AccessCodeSecurity) if ok { _, err := p.Oauth2AccessCodeSecurity.ResolveReferences(root) if err != nil { return nil, err } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside SecurityRequirement objects. func (m *SecurityRequirement) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.AdditionalProperties { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside StringArray objects. func (m *StringArray) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Tag objects. func (m *Tag) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) if m.ExternalDocs != nil { _, err := m.ExternalDocs.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside TypeItem objects. func (m *TypeItem) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside VendorExtension objects. func (m *VendorExtension) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.AdditionalProperties { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Xml objects. func (m *Xml) ResolveReferences(root string) (*yaml.Node, error) { errors := make([]error, 0) for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ToRawInfo returns a description of AdditionalPropertiesItem suitable for JSON or YAML export. func (m *AdditionalPropertiesItem) ToRawInfo() *yaml.Node { // ONE OF WRAPPER // AdditionalPropertiesItem // {Name:schema Type:Schema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v0 := m.GetSchema() if v0 != nil { return v0.ToRawInfo() } // {Name:boolean Type:bool StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if v1, ok := m.GetOneof().(*AdditionalPropertiesItem_Boolean); ok { return compiler.NewScalarNodeForBool(v1.Boolean) } return compiler.NewNullNode() } // ToRawInfo returns a description of Any suitable for JSON or YAML export. func (m *Any) ToRawInfo() *yaml.Node { var err error var node yaml.Node err = yaml.Unmarshal([]byte(m.Yaml), &node) if err == nil { if node.Kind == yaml.DocumentNode { return node.Content[0] } return &node } return compiler.NewNullNode() } // ToRawInfo returns a description of ApiKeySecurity suitable for JSON or YAML export. func (m *ApiKeySecurity) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } // always include this required field. info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) // always include this required field. info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) // always include this required field. info.Content = append(info.Content, compiler.NewScalarNodeForString("in")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.In)) if m.Description != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of BasicAuthenticationSecurity suitable for JSON or YAML export. func (m *BasicAuthenticationSecurity) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } // always include this required field. info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) if m.Description != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of BodyParameter suitable for JSON or YAML export. func (m *BodyParameter) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if m.Description != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } // always include this required field. info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) // always include this required field. info.Content = append(info.Content, compiler.NewScalarNodeForString("in")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.In)) if m.Required != false { info.Content = append(info.Content, compiler.NewScalarNodeForString("required")) info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Required)) } // always include this required field. info.Content = append(info.Content, compiler.NewScalarNodeForString("schema")) info.Content = append(info.Content, m.Schema.ToRawInfo()) if m.VendorExtension != nil { for _, item := range m.VendorExtension { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of Contact suitable for JSON or YAML export. func (m *Contact) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if m.Name != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) } if m.Url != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("url")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Url)) } if m.Email != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("email")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Email)) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of Default suitable for JSON or YAML export. func (m *Default) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of Definitions suitable for JSON or YAML export. func (m *Definitions) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of Document suitable for JSON or YAML export. func (m *Document) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } // always include this required field. info.Content = append(info.Content, compiler.NewScalarNodeForString("swagger")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Swagger)) // always include this required field. info.Content = append(info.Content, compiler.NewScalarNodeForString("info")) info.Content = append(info.Content, m.Info.ToRawInfo()) if m.Host != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("host")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Host)) } if m.BasePath != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("basePath")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.BasePath)) } if len(m.Schemes) != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("schemes")) info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Schemes)) } if len(m.Consumes) != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("consumes")) info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Consumes)) } if len(m.Produces) != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("produces")) info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Produces)) } // always include this required field. info.Content = append(info.Content, compiler.NewScalarNodeForString("paths")) info.Content = append(info.Content, m.Paths.ToRawInfo()) if m.Definitions != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("definitions")) info.Content = append(info.Content, m.Definitions.ToRawInfo()) } if m.Parameters != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("parameters")) info.Content = append(info.Content, m.Parameters.ToRawInfo()) } if m.Responses != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("responses")) info.Content = append(info.Content, m.Responses.ToRawInfo()) } if len(m.Security) != 0 { items := compiler.NewSequenceNode() for _, item := range m.Security { items.Content = append(items.Content, item.ToRawInfo()) } info.Content = append(info.Content, compiler.NewScalarNodeForString("security")) info.Content = append(info.Content, items) } if m.SecurityDefinitions != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("securityDefinitions")) info.Content = append(info.Content, m.SecurityDefinitions.ToRawInfo()) } if len(m.Tags) != 0 { items := compiler.NewSequenceNode() for _, item := range m.Tags { items.Content = append(items.Content, item.ToRawInfo()) } info.Content = append(info.Content, compiler.NewScalarNodeForString("tags")) info.Content = append(info.Content, items) } if m.ExternalDocs != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("externalDocs")) info.Content = append(info.Content, m.ExternalDocs.ToRawInfo()) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of Examples suitable for JSON or YAML export. func (m *Examples) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of ExternalDocs suitable for JSON or YAML export. func (m *ExternalDocs) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if m.Description != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } // always include this required field. info.Content = append(info.Content, compiler.NewScalarNodeForString("url")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Url)) if m.VendorExtension != nil { for _, item := range m.VendorExtension { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of FileSchema suitable for JSON or YAML export. func (m *FileSchema) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if m.Format != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("format")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Format)) } if m.Title != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("title")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Title)) } if m.Description != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } if m.Default != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("default")) info.Content = append(info.Content, m.Default.ToRawInfo()) } if len(m.Required) != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("required")) info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Required)) } // always include this required field. info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) if m.ReadOnly != false { info.Content = append(info.Content, compiler.NewScalarNodeForString("readOnly")) info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ReadOnly)) } if m.ExternalDocs != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("externalDocs")) info.Content = append(info.Content, m.ExternalDocs.ToRawInfo()) } if m.Example != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("example")) info.Content = append(info.Content, m.Example.ToRawInfo()) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of FormDataParameterSubSchema suitable for JSON or YAML export. func (m *FormDataParameterSubSchema) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if m.Required != false { info.Content = append(info.Content, compiler.NewScalarNodeForString("required")) info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Required)) } if m.In != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("in")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.In)) } if m.Description != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } if m.Name != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) } if m.AllowEmptyValue != false { info.Content = append(info.Content, compiler.NewScalarNodeForString("allowEmptyValue")) info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.AllowEmptyValue)) } if m.Type != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) } if m.Format != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("format")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Format)) } if m.Items != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("items")) info.Content = append(info.Content, m.Items.ToRawInfo()) } if m.CollectionFormat != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("collectionFormat")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.CollectionFormat)) } if m.Default != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("default")) info.Content = append(info.Content, m.Default.ToRawInfo()) } if m.Maximum != 0.0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("maximum")) info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Maximum)) } if m.ExclusiveMaximum != false { info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMaximum")) info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMaximum)) } if m.Minimum != 0.0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("minimum")) info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Minimum)) } if m.ExclusiveMinimum != false { info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMinimum")) info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMinimum)) } if m.MaxLength != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("maxLength")) info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxLength)) } if m.MinLength != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("minLength")) info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinLength)) } if m.Pattern != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("pattern")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Pattern)) } if m.MaxItems != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("maxItems")) info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxItems)) } if m.MinItems != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("minItems")) info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinItems)) } if m.UniqueItems != false { info.Content = append(info.Content, compiler.NewScalarNodeForString("uniqueItems")) info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.UniqueItems)) } if len(m.Enum) != 0 { items := compiler.NewSequenceNode() for _, item := range m.Enum { items.Content = append(items.Content, item.ToRawInfo()) } info.Content = append(info.Content, compiler.NewScalarNodeForString("enum")) info.Content = append(info.Content, items) } if m.MultipleOf != 0.0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("multipleOf")) info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.MultipleOf)) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of Header suitable for JSON or YAML export. func (m *Header) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } // always include this required field. info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) if m.Format != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("format")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Format)) } if m.Items != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("items")) info.Content = append(info.Content, m.Items.ToRawInfo()) } if m.CollectionFormat != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("collectionFormat")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.CollectionFormat)) } if m.Default != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("default")) info.Content = append(info.Content, m.Default.ToRawInfo()) } if m.Maximum != 0.0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("maximum")) info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Maximum)) } if m.ExclusiveMaximum != false { info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMaximum")) info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMaximum)) } if m.Minimum != 0.0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("minimum")) info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Minimum)) } if m.ExclusiveMinimum != false { info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMinimum")) info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMinimum)) } if m.MaxLength != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("maxLength")) info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxLength)) } if m.MinLength != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("minLength")) info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinLength)) } if m.Pattern != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("pattern")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Pattern)) } if m.MaxItems != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("maxItems")) info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxItems)) } if m.MinItems != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("minItems")) info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinItems)) } if m.UniqueItems != false { info.Content = append(info.Content, compiler.NewScalarNodeForString("uniqueItems")) info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.UniqueItems)) } if len(m.Enum) != 0 { items := compiler.NewSequenceNode() for _, item := range m.Enum { items.Content = append(items.Content, item.ToRawInfo()) } info.Content = append(info.Content, compiler.NewScalarNodeForString("enum")) info.Content = append(info.Content, items) } if m.MultipleOf != 0.0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("multipleOf")) info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.MultipleOf)) } if m.Description != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of HeaderParameterSubSchema suitable for JSON or YAML export. func (m *HeaderParameterSubSchema) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if m.Required != false { info.Content = append(info.Content, compiler.NewScalarNodeForString("required")) info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Required)) } if m.In != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("in")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.In)) } if m.Description != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } if m.Name != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) } if m.Type != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) } if m.Format != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("format")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Format)) } if m.Items != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("items")) info.Content = append(info.Content, m.Items.ToRawInfo()) } if m.CollectionFormat != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("collectionFormat")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.CollectionFormat)) } if m.Default != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("default")) info.Content = append(info.Content, m.Default.ToRawInfo()) } if m.Maximum != 0.0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("maximum")) info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Maximum)) } if m.ExclusiveMaximum != false { info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMaximum")) info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMaximum)) } if m.Minimum != 0.0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("minimum")) info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Minimum)) } if m.ExclusiveMinimum != false { info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMinimum")) info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMinimum)) } if m.MaxLength != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("maxLength")) info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxLength)) } if m.MinLength != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("minLength")) info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinLength)) } if m.Pattern != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("pattern")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Pattern)) } if m.MaxItems != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("maxItems")) info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxItems)) } if m.MinItems != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("minItems")) info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinItems)) } if m.UniqueItems != false { info.Content = append(info.Content, compiler.NewScalarNodeForString("uniqueItems")) info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.UniqueItems)) } if len(m.Enum) != 0 { items := compiler.NewSequenceNode() for _, item := range m.Enum { items.Content = append(items.Content, item.ToRawInfo()) } info.Content = append(info.Content, compiler.NewScalarNodeForString("enum")) info.Content = append(info.Content, items) } if m.MultipleOf != 0.0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("multipleOf")) info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.MultipleOf)) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of Headers suitable for JSON or YAML export. func (m *Headers) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of Info suitable for JSON or YAML export. func (m *Info) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } // always include this required field. info.Content = append(info.Content, compiler.NewScalarNodeForString("title")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Title)) // always include this required field. info.Content = append(info.Content, compiler.NewScalarNodeForString("version")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Version)) if m.Description != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } if m.TermsOfService != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("termsOfService")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.TermsOfService)) } if m.Contact != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("contact")) info.Content = append(info.Content, m.Contact.ToRawInfo()) } if m.License != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("license")) info.Content = append(info.Content, m.License.ToRawInfo()) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of ItemsItem suitable for JSON or YAML export. func (m *ItemsItem) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if len(m.Schema) != 0 { items := compiler.NewSequenceNode() for _, item := range m.Schema { items.Content = append(items.Content, item.ToRawInfo()) } info.Content = append(info.Content, compiler.NewScalarNodeForString("schema")) info.Content = append(info.Content, items) } return info } // ToRawInfo returns a description of JsonReference suitable for JSON or YAML export. func (m *JsonReference) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } // always include this required field. info.Content = append(info.Content, compiler.NewScalarNodeForString("$ref")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.XRef)) if m.Description != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } return info } // ToRawInfo returns a description of License suitable for JSON or YAML export. func (m *License) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } // always include this required field. info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) if m.Url != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("url")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Url)) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of NamedAny suitable for JSON or YAML export. func (m *NamedAny) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if m.Name != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) } // &{Name:value Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info } // ToRawInfo returns a description of NamedHeader suitable for JSON or YAML export. func (m *NamedHeader) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if m.Name != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) } // &{Name:value Type:Header StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info } // ToRawInfo returns a description of NamedParameter suitable for JSON or YAML export. func (m *NamedParameter) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if m.Name != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) } // &{Name:value Type:Parameter StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info } // ToRawInfo returns a description of NamedPathItem suitable for JSON or YAML export. func (m *NamedPathItem) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if m.Name != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) } // &{Name:value Type:PathItem StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info } // ToRawInfo returns a description of NamedResponse suitable for JSON or YAML export. func (m *NamedResponse) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if m.Name != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) } // &{Name:value Type:Response StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info } // ToRawInfo returns a description of NamedResponseValue suitable for JSON or YAML export. func (m *NamedResponseValue) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if m.Name != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) } // &{Name:value Type:ResponseValue StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info } // ToRawInfo returns a description of NamedSchema suitable for JSON or YAML export. func (m *NamedSchema) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if m.Name != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) } // &{Name:value Type:Schema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info } // ToRawInfo returns a description of NamedSecurityDefinitionsItem suitable for JSON or YAML export. func (m *NamedSecurityDefinitionsItem) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if m.Name != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) } // &{Name:value Type:SecurityDefinitionsItem StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info } // ToRawInfo returns a description of NamedString suitable for JSON or YAML export. func (m *NamedString) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if m.Name != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) } if m.Value != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("value")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Value)) } return info } // ToRawInfo returns a description of NamedStringArray suitable for JSON or YAML export. func (m *NamedStringArray) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if m.Name != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) } // &{Name:value Type:StringArray StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info } // ToRawInfo returns a description of NonBodyParameter suitable for JSON or YAML export. func (m *NonBodyParameter) ToRawInfo() *yaml.Node { // ONE OF WRAPPER // NonBodyParameter // {Name:headerParameterSubSchema Type:HeaderParameterSubSchema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v0 := m.GetHeaderParameterSubSchema() if v0 != nil { return v0.ToRawInfo() } // {Name:formDataParameterSubSchema Type:FormDataParameterSubSchema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v1 := m.GetFormDataParameterSubSchema() if v1 != nil { return v1.ToRawInfo() } // {Name:queryParameterSubSchema Type:QueryParameterSubSchema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v2 := m.GetQueryParameterSubSchema() if v2 != nil { return v2.ToRawInfo() } // {Name:pathParameterSubSchema Type:PathParameterSubSchema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v3 := m.GetPathParameterSubSchema() if v3 != nil { return v3.ToRawInfo() } return compiler.NewNullNode() } // ToRawInfo returns a description of Oauth2AccessCodeSecurity suitable for JSON or YAML export. func (m *Oauth2AccessCodeSecurity) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } // always include this required field. info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) // always include this required field. info.Content = append(info.Content, compiler.NewScalarNodeForString("flow")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Flow)) if m.Scopes != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("scopes")) info.Content = append(info.Content, m.Scopes.ToRawInfo()) } // always include this required field. info.Content = append(info.Content, compiler.NewScalarNodeForString("authorizationUrl")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.AuthorizationUrl)) // always include this required field. info.Content = append(info.Content, compiler.NewScalarNodeForString("tokenUrl")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.TokenUrl)) if m.Description != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of Oauth2ApplicationSecurity suitable for JSON or YAML export. func (m *Oauth2ApplicationSecurity) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } // always include this required field. info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) // always include this required field. info.Content = append(info.Content, compiler.NewScalarNodeForString("flow")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Flow)) if m.Scopes != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("scopes")) info.Content = append(info.Content, m.Scopes.ToRawInfo()) } // always include this required field. info.Content = append(info.Content, compiler.NewScalarNodeForString("tokenUrl")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.TokenUrl)) if m.Description != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of Oauth2ImplicitSecurity suitable for JSON or YAML export. func (m *Oauth2ImplicitSecurity) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } // always include this required field. info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) // always include this required field. info.Content = append(info.Content, compiler.NewScalarNodeForString("flow")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Flow)) if m.Scopes != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("scopes")) info.Content = append(info.Content, m.Scopes.ToRawInfo()) } // always include this required field. info.Content = append(info.Content, compiler.NewScalarNodeForString("authorizationUrl")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.AuthorizationUrl)) if m.Description != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of Oauth2PasswordSecurity suitable for JSON or YAML export. func (m *Oauth2PasswordSecurity) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } // always include this required field. info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) // always include this required field. info.Content = append(info.Content, compiler.NewScalarNodeForString("flow")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Flow)) if m.Scopes != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("scopes")) info.Content = append(info.Content, m.Scopes.ToRawInfo()) } // always include this required field. info.Content = append(info.Content, compiler.NewScalarNodeForString("tokenUrl")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.TokenUrl)) if m.Description != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of Oauth2Scopes suitable for JSON or YAML export. func (m *Oauth2Scopes) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } // &{Name:additionalProperties Type:NamedString StringEnumValues:[] MapType:string Repeated:true Pattern: Implicit:true Description:} return info } // ToRawInfo returns a description of Operation suitable for JSON or YAML export. func (m *Operation) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if len(m.Tags) != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("tags")) info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Tags)) } if m.Summary != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("summary")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Summary)) } if m.Description != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } if m.ExternalDocs != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("externalDocs")) info.Content = append(info.Content, m.ExternalDocs.ToRawInfo()) } if m.OperationId != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("operationId")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.OperationId)) } if len(m.Produces) != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("produces")) info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Produces)) } if len(m.Consumes) != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("consumes")) info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Consumes)) } if len(m.Parameters) != 0 { items := compiler.NewSequenceNode() for _, item := range m.Parameters { items.Content = append(items.Content, item.ToRawInfo()) } info.Content = append(info.Content, compiler.NewScalarNodeForString("parameters")) info.Content = append(info.Content, items) } // always include this required field. info.Content = append(info.Content, compiler.NewScalarNodeForString("responses")) info.Content = append(info.Content, m.Responses.ToRawInfo()) if len(m.Schemes) != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("schemes")) info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Schemes)) } if m.Deprecated != false { info.Content = append(info.Content, compiler.NewScalarNodeForString("deprecated")) info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Deprecated)) } if len(m.Security) != 0 { items := compiler.NewSequenceNode() for _, item := range m.Security { items.Content = append(items.Content, item.ToRawInfo()) } info.Content = append(info.Content, compiler.NewScalarNodeForString("security")) info.Content = append(info.Content, items) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of Parameter suitable for JSON or YAML export. func (m *Parameter) ToRawInfo() *yaml.Node { // ONE OF WRAPPER // Parameter // {Name:bodyParameter Type:BodyParameter StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v0 := m.GetBodyParameter() if v0 != nil { return v0.ToRawInfo() } // {Name:nonBodyParameter Type:NonBodyParameter StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v1 := m.GetNonBodyParameter() if v1 != nil { return v1.ToRawInfo() } return compiler.NewNullNode() } // ToRawInfo returns a description of ParameterDefinitions suitable for JSON or YAML export. func (m *ParameterDefinitions) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of ParametersItem suitable for JSON or YAML export. func (m *ParametersItem) ToRawInfo() *yaml.Node { // ONE OF WRAPPER // ParametersItem // {Name:parameter Type:Parameter StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v0 := m.GetParameter() if v0 != nil { return v0.ToRawInfo() } // {Name:jsonReference Type:JsonReference StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v1 := m.GetJsonReference() if v1 != nil { return v1.ToRawInfo() } return compiler.NewNullNode() } // ToRawInfo returns a description of PathItem suitable for JSON or YAML export. func (m *PathItem) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if m.XRef != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("$ref")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.XRef)) } if m.Get != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("get")) info.Content = append(info.Content, m.Get.ToRawInfo()) } if m.Put != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("put")) info.Content = append(info.Content, m.Put.ToRawInfo()) } if m.Post != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("post")) info.Content = append(info.Content, m.Post.ToRawInfo()) } if m.Delete != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("delete")) info.Content = append(info.Content, m.Delete.ToRawInfo()) } if m.Options != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("options")) info.Content = append(info.Content, m.Options.ToRawInfo()) } if m.Head != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("head")) info.Content = append(info.Content, m.Head.ToRawInfo()) } if m.Patch != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("patch")) info.Content = append(info.Content, m.Patch.ToRawInfo()) } if len(m.Parameters) != 0 { items := compiler.NewSequenceNode() for _, item := range m.Parameters { items.Content = append(items.Content, item.ToRawInfo()) } info.Content = append(info.Content, compiler.NewScalarNodeForString("parameters")) info.Content = append(info.Content, items) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of PathParameterSubSchema suitable for JSON or YAML export. func (m *PathParameterSubSchema) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } // always include this required field. info.Content = append(info.Content, compiler.NewScalarNodeForString("required")) info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Required)) if m.In != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("in")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.In)) } if m.Description != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } if m.Name != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) } if m.Type != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) } if m.Format != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("format")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Format)) } if m.Items != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("items")) info.Content = append(info.Content, m.Items.ToRawInfo()) } if m.CollectionFormat != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("collectionFormat")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.CollectionFormat)) } if m.Default != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("default")) info.Content = append(info.Content, m.Default.ToRawInfo()) } if m.Maximum != 0.0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("maximum")) info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Maximum)) } if m.ExclusiveMaximum != false { info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMaximum")) info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMaximum)) } if m.Minimum != 0.0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("minimum")) info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Minimum)) } if m.ExclusiveMinimum != false { info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMinimum")) info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMinimum)) } if m.MaxLength != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("maxLength")) info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxLength)) } if m.MinLength != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("minLength")) info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinLength)) } if m.Pattern != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("pattern")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Pattern)) } if m.MaxItems != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("maxItems")) info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxItems)) } if m.MinItems != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("minItems")) info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinItems)) } if m.UniqueItems != false { info.Content = append(info.Content, compiler.NewScalarNodeForString("uniqueItems")) info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.UniqueItems)) } if len(m.Enum) != 0 { items := compiler.NewSequenceNode() for _, item := range m.Enum { items.Content = append(items.Content, item.ToRawInfo()) } info.Content = append(info.Content, compiler.NewScalarNodeForString("enum")) info.Content = append(info.Content, items) } if m.MultipleOf != 0.0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("multipleOf")) info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.MultipleOf)) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of Paths suitable for JSON or YAML export. func (m *Paths) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } if m.Path != nil { for _, item := range m.Path { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of PrimitivesItems suitable for JSON or YAML export. func (m *PrimitivesItems) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if m.Type != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) } if m.Format != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("format")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Format)) } if m.Items != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("items")) info.Content = append(info.Content, m.Items.ToRawInfo()) } if m.CollectionFormat != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("collectionFormat")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.CollectionFormat)) } if m.Default != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("default")) info.Content = append(info.Content, m.Default.ToRawInfo()) } if m.Maximum != 0.0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("maximum")) info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Maximum)) } if m.ExclusiveMaximum != false { info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMaximum")) info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMaximum)) } if m.Minimum != 0.0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("minimum")) info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Minimum)) } if m.ExclusiveMinimum != false { info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMinimum")) info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMinimum)) } if m.MaxLength != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("maxLength")) info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxLength)) } if m.MinLength != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("minLength")) info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinLength)) } if m.Pattern != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("pattern")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Pattern)) } if m.MaxItems != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("maxItems")) info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxItems)) } if m.MinItems != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("minItems")) info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinItems)) } if m.UniqueItems != false { info.Content = append(info.Content, compiler.NewScalarNodeForString("uniqueItems")) info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.UniqueItems)) } if len(m.Enum) != 0 { items := compiler.NewSequenceNode() for _, item := range m.Enum { items.Content = append(items.Content, item.ToRawInfo()) } info.Content = append(info.Content, compiler.NewScalarNodeForString("enum")) info.Content = append(info.Content, items) } if m.MultipleOf != 0.0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("multipleOf")) info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.MultipleOf)) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of Properties suitable for JSON or YAML export. func (m *Properties) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of QueryParameterSubSchema suitable for JSON or YAML export. func (m *QueryParameterSubSchema) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if m.Required != false { info.Content = append(info.Content, compiler.NewScalarNodeForString("required")) info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Required)) } if m.In != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("in")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.In)) } if m.Description != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } if m.Name != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) } if m.AllowEmptyValue != false { info.Content = append(info.Content, compiler.NewScalarNodeForString("allowEmptyValue")) info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.AllowEmptyValue)) } if m.Type != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) } if m.Format != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("format")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Format)) } if m.Items != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("items")) info.Content = append(info.Content, m.Items.ToRawInfo()) } if m.CollectionFormat != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("collectionFormat")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.CollectionFormat)) } if m.Default != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("default")) info.Content = append(info.Content, m.Default.ToRawInfo()) } if m.Maximum != 0.0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("maximum")) info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Maximum)) } if m.ExclusiveMaximum != false { info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMaximum")) info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMaximum)) } if m.Minimum != 0.0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("minimum")) info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Minimum)) } if m.ExclusiveMinimum != false { info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMinimum")) info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMinimum)) } if m.MaxLength != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("maxLength")) info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxLength)) } if m.MinLength != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("minLength")) info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinLength)) } if m.Pattern != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("pattern")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Pattern)) } if m.MaxItems != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("maxItems")) info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxItems)) } if m.MinItems != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("minItems")) info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinItems)) } if m.UniqueItems != false { info.Content = append(info.Content, compiler.NewScalarNodeForString("uniqueItems")) info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.UniqueItems)) } if len(m.Enum) != 0 { items := compiler.NewSequenceNode() for _, item := range m.Enum { items.Content = append(items.Content, item.ToRawInfo()) } info.Content = append(info.Content, compiler.NewScalarNodeForString("enum")) info.Content = append(info.Content, items) } if m.MultipleOf != 0.0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("multipleOf")) info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.MultipleOf)) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of Response suitable for JSON or YAML export. func (m *Response) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } // always include this required field. info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) if m.Schema != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("schema")) info.Content = append(info.Content, m.Schema.ToRawInfo()) } if m.Headers != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("headers")) info.Content = append(info.Content, m.Headers.ToRawInfo()) } if m.Examples != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("examples")) info.Content = append(info.Content, m.Examples.ToRawInfo()) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of ResponseDefinitions suitable for JSON or YAML export. func (m *ResponseDefinitions) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of ResponseValue suitable for JSON or YAML export. func (m *ResponseValue) ToRawInfo() *yaml.Node { // ONE OF WRAPPER // ResponseValue // {Name:response Type:Response StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v0 := m.GetResponse() if v0 != nil { return v0.ToRawInfo() } // {Name:jsonReference Type:JsonReference StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v1 := m.GetJsonReference() if v1 != nil { return v1.ToRawInfo() } return compiler.NewNullNode() } // ToRawInfo returns a description of Responses suitable for JSON or YAML export. func (m *Responses) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if m.ResponseCode != nil { for _, item := range m.ResponseCode { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of Schema suitable for JSON or YAML export. func (m *Schema) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if m.XRef != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("$ref")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.XRef)) } if m.Format != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("format")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Format)) } if m.Title != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("title")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Title)) } if m.Description != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } if m.Default != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("default")) info.Content = append(info.Content, m.Default.ToRawInfo()) } if m.MultipleOf != 0.0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("multipleOf")) info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.MultipleOf)) } if m.Maximum != 0.0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("maximum")) info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Maximum)) } if m.ExclusiveMaximum != false { info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMaximum")) info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMaximum)) } if m.Minimum != 0.0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("minimum")) info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Minimum)) } if m.ExclusiveMinimum != false { info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMinimum")) info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMinimum)) } if m.MaxLength != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("maxLength")) info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxLength)) } if m.MinLength != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("minLength")) info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinLength)) } if m.Pattern != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("pattern")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Pattern)) } if m.MaxItems != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("maxItems")) info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxItems)) } if m.MinItems != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("minItems")) info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinItems)) } if m.UniqueItems != false { info.Content = append(info.Content, compiler.NewScalarNodeForString("uniqueItems")) info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.UniqueItems)) } if m.MaxProperties != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("maxProperties")) info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxProperties)) } if m.MinProperties != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("minProperties")) info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinProperties)) } if len(m.Required) != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("required")) info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Required)) } if len(m.Enum) != 0 { items := compiler.NewSequenceNode() for _, item := range m.Enum { items.Content = append(items.Content, item.ToRawInfo()) } info.Content = append(info.Content, compiler.NewScalarNodeForString("enum")) info.Content = append(info.Content, items) } if m.AdditionalProperties != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("additionalProperties")) info.Content = append(info.Content, m.AdditionalProperties.ToRawInfo()) } if m.Type != nil { if len(m.Type.Value) == 1 { info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type.Value[0])) } else { info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Type.Value)) } } if m.Items != nil { items := compiler.NewSequenceNode() for _, item := range m.Items.Schema { items.Content = append(items.Content, item.ToRawInfo()) } if len(items.Content) == 1 { items = items.Content[0] } info.Content = append(info.Content, compiler.NewScalarNodeForString("items")) info.Content = append(info.Content, items) } if len(m.AllOf) != 0 { items := compiler.NewSequenceNode() for _, item := range m.AllOf { items.Content = append(items.Content, item.ToRawInfo()) } info.Content = append(info.Content, compiler.NewScalarNodeForString("allOf")) info.Content = append(info.Content, items) } if m.Properties != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("properties")) info.Content = append(info.Content, m.Properties.ToRawInfo()) } if m.Discriminator != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("discriminator")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Discriminator)) } if m.ReadOnly != false { info.Content = append(info.Content, compiler.NewScalarNodeForString("readOnly")) info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ReadOnly)) } if m.Xml != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("xml")) info.Content = append(info.Content, m.Xml.ToRawInfo()) } if m.ExternalDocs != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("externalDocs")) info.Content = append(info.Content, m.ExternalDocs.ToRawInfo()) } if m.Example != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("example")) info.Content = append(info.Content, m.Example.ToRawInfo()) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of SchemaItem suitable for JSON or YAML export. func (m *SchemaItem) ToRawInfo() *yaml.Node { // ONE OF WRAPPER // SchemaItem // {Name:schema Type:Schema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v0 := m.GetSchema() if v0 != nil { return v0.ToRawInfo() } // {Name:fileSchema Type:FileSchema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v1 := m.GetFileSchema() if v1 != nil { return v1.ToRawInfo() } return compiler.NewNullNode() } // ToRawInfo returns a description of SecurityDefinitions suitable for JSON or YAML export. func (m *SecurityDefinitions) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of SecurityDefinitionsItem suitable for JSON or YAML export. func (m *SecurityDefinitionsItem) ToRawInfo() *yaml.Node { // ONE OF WRAPPER // SecurityDefinitionsItem // {Name:basicAuthenticationSecurity Type:BasicAuthenticationSecurity StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v0 := m.GetBasicAuthenticationSecurity() if v0 != nil { return v0.ToRawInfo() } // {Name:apiKeySecurity Type:ApiKeySecurity StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v1 := m.GetApiKeySecurity() if v1 != nil { return v1.ToRawInfo() } // {Name:oauth2ImplicitSecurity Type:Oauth2ImplicitSecurity StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v2 := m.GetOauth2ImplicitSecurity() if v2 != nil { return v2.ToRawInfo() } // {Name:oauth2PasswordSecurity Type:Oauth2PasswordSecurity StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v3 := m.GetOauth2PasswordSecurity() if v3 != nil { return v3.ToRawInfo() } // {Name:oauth2ApplicationSecurity Type:Oauth2ApplicationSecurity StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v4 := m.GetOauth2ApplicationSecurity() if v4 != nil { return v4.ToRawInfo() } // {Name:oauth2AccessCodeSecurity Type:Oauth2AccessCodeSecurity StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v5 := m.GetOauth2AccessCodeSecurity() if v5 != nil { return v5.ToRawInfo() } return compiler.NewNullNode() } // ToRawInfo returns a description of SecurityRequirement suitable for JSON or YAML export. func (m *SecurityRequirement) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of StringArray suitable for JSON or YAML export. func (m *StringArray) ToRawInfo() *yaml.Node { return compiler.NewSequenceNodeForStringArray(m.Value) } // ToRawInfo returns a description of Tag suitable for JSON or YAML export. func (m *Tag) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } // always include this required field. info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) if m.Description != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) } if m.ExternalDocs != nil { info.Content = append(info.Content, compiler.NewScalarNodeForString("externalDocs")) info.Content = append(info.Content, m.ExternalDocs.ToRawInfo()) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of TypeItem suitable for JSON or YAML export. func (m *TypeItem) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if len(m.Value) != 0 { info.Content = append(info.Content, compiler.NewScalarNodeForString("value")) info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Value)) } return info } // ToRawInfo returns a description of VendorExtension suitable for JSON or YAML export. func (m *VendorExtension) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } // ToRawInfo returns a description of Xml suitable for JSON or YAML export. func (m *Xml) ToRawInfo() *yaml.Node { info := compiler.NewMappingNode() if m == nil { return info } if m.Name != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) } if m.Namespace != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("namespace")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Namespace)) } if m.Prefix != "" { info.Content = append(info.Content, compiler.NewScalarNodeForString("prefix")) info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Prefix)) } if m.Attribute != false { info.Content = append(info.Content, compiler.NewScalarNodeForString("attribute")) info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Attribute)) } if m.Wrapped != false { info.Content = append(info.Content, compiler.NewScalarNodeForString("wrapped")) info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Wrapped)) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) info.Content = append(info.Content, item.Value.ToRawInfo()) } } return info } var ( pattern0 = regexp.MustCompile("^x-") pattern1 = regexp.MustCompile("^/") pattern2 = regexp.MustCompile("^([0-9]{3})$|^(default)$") )
8,912
0
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic/OpenAPIv2/document.go
// Copyright 2020 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package openapi_v2 import ( "github.com/googleapis/gnostic/compiler" "gopkg.in/yaml.v3" ) // ParseDocument reads an OpenAPI v2 description from a YAML/JSON representation. func ParseDocument(b []byte) (*Document, error) { info, err := compiler.ReadInfoFromBytes("", b) if err != nil { return nil, err } root := info.Content[0] return NewDocument(root, compiler.NewContextWithExtensions("$root", root, nil, nil)) } // YAMLValue produces a serialized YAML representation of the document. func (d *Document) YAMLValue(comment string) ([]byte, error) { rawInfo := d.ToRawInfo() rawInfo = &yaml.Node{ Kind: yaml.DocumentNode, Content: []*yaml.Node{rawInfo}, HeadComment: comment, } return yaml.Marshal(rawInfo) }
8,913
0
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic/OpenAPIv2/README.md
# OpenAPI v2 Protocol Buffer Models This directory contains a Protocol Buffer-language model and related code for supporting OpenAPI v2. Gnostic applications and plugins can use OpenAPIv2.proto to generate Protocol Buffer support code for their preferred languages. OpenAPIv2.go is used by Gnostic to read JSON and YAML OpenAPI descriptions into the Protocol Buffer-based datastructures generated from OpenAPIv2.proto. OpenAPIv2.proto and OpenAPIv2.go are generated by the Gnostic compiler generator, and OpenAPIv2.pb.go is generated by protoc, the Protocol Buffer compiler, and protoc-gen-go, the Protocol Buffer Go code generation plugin.
8,914
0
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic/OpenAPIv2/openapi-2.0.json
{ "title": "A JSON Schema for Swagger 2.0 API.", "id": "http://swagger.io/v2/schema.json#", "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "required": [ "swagger", "info", "paths" ], "additionalProperties": false, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } }, "properties": { "swagger": { "type": "string", "enum": [ "2.0" ], "description": "The Swagger version of this document." }, "info": { "$ref": "#/definitions/info" }, "host": { "type": "string", "pattern": "^[^{}/ :\\\\]+(?::\\d+)?$", "description": "The host (name or ip) of the API. Example: 'swagger.io'" }, "basePath": { "type": "string", "pattern": "^/", "description": "The base path to the API. Example: '/api'." }, "schemes": { "$ref": "#/definitions/schemesList" }, "consumes": { "description": "A list of MIME types accepted by the API.", "allOf": [ { "$ref": "#/definitions/mediaTypeList" } ] }, "produces": { "description": "A list of MIME types the API can produce.", "allOf": [ { "$ref": "#/definitions/mediaTypeList" } ] }, "paths": { "$ref": "#/definitions/paths" }, "definitions": { "$ref": "#/definitions/definitions" }, "parameters": { "$ref": "#/definitions/parameterDefinitions" }, "responses": { "$ref": "#/definitions/responseDefinitions" }, "security": { "$ref": "#/definitions/security" }, "securityDefinitions": { "$ref": "#/definitions/securityDefinitions" }, "tags": { "type": "array", "items": { "$ref": "#/definitions/tag" }, "uniqueItems": true }, "externalDocs": { "$ref": "#/definitions/externalDocs" } }, "definitions": { "info": { "type": "object", "description": "General information about the API.", "required": [ "version", "title" ], "additionalProperties": false, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } }, "properties": { "title": { "type": "string", "description": "A unique and precise title of the API." }, "version": { "type": "string", "description": "A semantic version number of the API." }, "description": { "type": "string", "description": "A longer description of the API. Should be different from the title. GitHub Flavored Markdown is allowed." }, "termsOfService": { "type": "string", "description": "The terms of service for the API." }, "contact": { "$ref": "#/definitions/contact" }, "license": { "$ref": "#/definitions/license" } } }, "contact": { "type": "object", "description": "Contact information for the owners of the API.", "additionalProperties": false, "properties": { "name": { "type": "string", "description": "The identifying name of the contact person/organization." }, "url": { "type": "string", "description": "The URL pointing to the contact information.", "format": "uri" }, "email": { "type": "string", "description": "The email address of the contact person/organization.", "format": "email" } }, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } } }, "license": { "type": "object", "required": [ "name" ], "additionalProperties": false, "properties": { "name": { "type": "string", "description": "The name of the license type. It's encouraged to use an OSI compatible license." }, "url": { "type": "string", "description": "The URL pointing to the license.", "format": "uri" } }, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } } }, "paths": { "type": "object", "description": "Relative paths to the individual endpoints. They must be relative to the 'basePath'.", "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" }, "^/": { "$ref": "#/definitions/pathItem" } }, "additionalProperties": false }, "definitions": { "type": "object", "additionalProperties": { "$ref": "#/definitions/schema" }, "description": "One or more JSON objects describing the schemas being consumed and produced by the API." }, "parameterDefinitions": { "type": "object", "additionalProperties": { "$ref": "#/definitions/parameter" }, "description": "One or more JSON representations for parameters" }, "responseDefinitions": { "type": "object", "additionalProperties": { "$ref": "#/definitions/response" }, "description": "One or more JSON representations for responses" }, "externalDocs": { "type": "object", "additionalProperties": false, "description": "information about external documentation", "required": [ "url" ], "properties": { "description": { "type": "string" }, "url": { "type": "string", "format": "uri" } }, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } } }, "examples": { "type": "object", "additionalProperties": true }, "mimeType": { "type": "string", "description": "The MIME type of the HTTP message." }, "operation": { "type": "object", "required": [ "responses" ], "additionalProperties": false, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } }, "properties": { "tags": { "type": "array", "items": { "type": "string" }, "uniqueItems": true }, "summary": { "type": "string", "description": "A brief summary of the operation." }, "description": { "type": "string", "description": "A longer description of the operation, GitHub Flavored Markdown is allowed." }, "externalDocs": { "$ref": "#/definitions/externalDocs" }, "operationId": { "type": "string", "description": "A unique identifier of the operation." }, "produces": { "description": "A list of MIME types the API can produce.", "allOf": [ { "$ref": "#/definitions/mediaTypeList" } ] }, "consumes": { "description": "A list of MIME types the API can consume.", "allOf": [ { "$ref": "#/definitions/mediaTypeList" } ] }, "parameters": { "$ref": "#/definitions/parametersList" }, "responses": { "$ref": "#/definitions/responses" }, "schemes": { "$ref": "#/definitions/schemesList" }, "deprecated": { "type": "boolean", "default": false }, "security": { "$ref": "#/definitions/security" } } }, "pathItem": { "type": "object", "additionalProperties": false, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } }, "properties": { "$ref": { "type": "string" }, "get": { "$ref": "#/definitions/operation" }, "put": { "$ref": "#/definitions/operation" }, "post": { "$ref": "#/definitions/operation" }, "delete": { "$ref": "#/definitions/operation" }, "options": { "$ref": "#/definitions/operation" }, "head": { "$ref": "#/definitions/operation" }, "patch": { "$ref": "#/definitions/operation" }, "parameters": { "$ref": "#/definitions/parametersList" } } }, "responses": { "type": "object", "description": "Response objects names can either be any valid HTTP status code or 'default'.", "minProperties": 1, "additionalProperties": false, "patternProperties": { "^([0-9]{3})$|^(default)$": { "$ref": "#/definitions/responseValue" }, "^x-": { "$ref": "#/definitions/vendorExtension" } }, "not": { "type": "object", "additionalProperties": false, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } } } }, "responseValue": { "oneOf": [ { "$ref": "#/definitions/response" }, { "$ref": "#/definitions/jsonReference" } ] }, "response": { "type": "object", "required": [ "description" ], "properties": { "description": { "type": "string" }, "schema": { "oneOf": [ { "$ref": "#/definitions/schema" }, { "$ref": "#/definitions/fileSchema" } ] }, "headers": { "$ref": "#/definitions/headers" }, "examples": { "$ref": "#/definitions/examples" } }, "additionalProperties": false, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } } }, "headers": { "type": "object", "additionalProperties": { "$ref": "#/definitions/header" } }, "header": { "type": "object", "additionalProperties": false, "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "string", "number", "integer", "boolean", "array" ] }, "format": { "type": "string" }, "items": { "$ref": "#/definitions/primitivesItems" }, "collectionFormat": { "$ref": "#/definitions/collectionFormat" }, "default": { "$ref": "#/definitions/default" }, "maximum": { "$ref": "#/definitions/maximum" }, "exclusiveMaximum": { "$ref": "#/definitions/exclusiveMaximum" }, "minimum": { "$ref": "#/definitions/minimum" }, "exclusiveMinimum": { "$ref": "#/definitions/exclusiveMinimum" }, "maxLength": { "$ref": "#/definitions/maxLength" }, "minLength": { "$ref": "#/definitions/minLength" }, "pattern": { "$ref": "#/definitions/pattern" }, "maxItems": { "$ref": "#/definitions/maxItems" }, "minItems": { "$ref": "#/definitions/minItems" }, "uniqueItems": { "$ref": "#/definitions/uniqueItems" }, "enum": { "$ref": "#/definitions/enum" }, "multipleOf": { "$ref": "#/definitions/multipleOf" }, "description": { "type": "string" } }, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } } }, "vendorExtension": { "description": "Any property starting with x- is valid.", "additionalProperties": true, "additionalItems": true }, "bodyParameter": { "type": "object", "required": [ "name", "in", "schema" ], "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } }, "properties": { "description": { "type": "string", "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." }, "name": { "type": "string", "description": "The name of the parameter." }, "in": { "type": "string", "description": "Determines the location of the parameter.", "enum": [ "body" ] }, "required": { "type": "boolean", "description": "Determines whether or not this parameter is required or optional.", "default": false }, "schema": { "$ref": "#/definitions/schema" } }, "additionalProperties": false }, "headerParameterSubSchema": { "additionalProperties": false, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } }, "properties": { "required": { "type": "boolean", "description": "Determines whether or not this parameter is required or optional.", "default": false }, "in": { "type": "string", "description": "Determines the location of the parameter.", "enum": [ "header" ] }, "description": { "type": "string", "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." }, "name": { "type": "string", "description": "The name of the parameter." }, "type": { "type": "string", "enum": [ "string", "number", "boolean", "integer", "array" ] }, "format": { "type": "string" }, "items": { "$ref": "#/definitions/primitivesItems" }, "collectionFormat": { "$ref": "#/definitions/collectionFormat" }, "default": { "$ref": "#/definitions/default" }, "maximum": { "$ref": "#/definitions/maximum" }, "exclusiveMaximum": { "$ref": "#/definitions/exclusiveMaximum" }, "minimum": { "$ref": "#/definitions/minimum" }, "exclusiveMinimum": { "$ref": "#/definitions/exclusiveMinimum" }, "maxLength": { "$ref": "#/definitions/maxLength" }, "minLength": { "$ref": "#/definitions/minLength" }, "pattern": { "$ref": "#/definitions/pattern" }, "maxItems": { "$ref": "#/definitions/maxItems" }, "minItems": { "$ref": "#/definitions/minItems" }, "uniqueItems": { "$ref": "#/definitions/uniqueItems" }, "enum": { "$ref": "#/definitions/enum" }, "multipleOf": { "$ref": "#/definitions/multipleOf" } } }, "queryParameterSubSchema": { "additionalProperties": false, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } }, "properties": { "required": { "type": "boolean", "description": "Determines whether or not this parameter is required or optional.", "default": false }, "in": { "type": "string", "description": "Determines the location of the parameter.", "enum": [ "query" ] }, "description": { "type": "string", "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." }, "name": { "type": "string", "description": "The name of the parameter." }, "allowEmptyValue": { "type": "boolean", "default": false, "description": "allows sending a parameter by name only or with an empty value." }, "type": { "type": "string", "enum": [ "string", "number", "boolean", "integer", "array" ] }, "format": { "type": "string" }, "items": { "$ref": "#/definitions/primitivesItems" }, "collectionFormat": { "$ref": "#/definitions/collectionFormatWithMulti" }, "default": { "$ref": "#/definitions/default" }, "maximum": { "$ref": "#/definitions/maximum" }, "exclusiveMaximum": { "$ref": "#/definitions/exclusiveMaximum" }, "minimum": { "$ref": "#/definitions/minimum" }, "exclusiveMinimum": { "$ref": "#/definitions/exclusiveMinimum" }, "maxLength": { "$ref": "#/definitions/maxLength" }, "minLength": { "$ref": "#/definitions/minLength" }, "pattern": { "$ref": "#/definitions/pattern" }, "maxItems": { "$ref": "#/definitions/maxItems" }, "minItems": { "$ref": "#/definitions/minItems" }, "uniqueItems": { "$ref": "#/definitions/uniqueItems" }, "enum": { "$ref": "#/definitions/enum" }, "multipleOf": { "$ref": "#/definitions/multipleOf" } } }, "formDataParameterSubSchema": { "additionalProperties": false, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } }, "properties": { "required": { "type": "boolean", "description": "Determines whether or not this parameter is required or optional.", "default": false }, "in": { "type": "string", "description": "Determines the location of the parameter.", "enum": [ "formData" ] }, "description": { "type": "string", "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." }, "name": { "type": "string", "description": "The name of the parameter." }, "allowEmptyValue": { "type": "boolean", "default": false, "description": "allows sending a parameter by name only or with an empty value." }, "type": { "type": "string", "enum": [ "string", "number", "boolean", "integer", "array", "file" ] }, "format": { "type": "string" }, "items": { "$ref": "#/definitions/primitivesItems" }, "collectionFormat": { "$ref": "#/definitions/collectionFormatWithMulti" }, "default": { "$ref": "#/definitions/default" }, "maximum": { "$ref": "#/definitions/maximum" }, "exclusiveMaximum": { "$ref": "#/definitions/exclusiveMaximum" }, "minimum": { "$ref": "#/definitions/minimum" }, "exclusiveMinimum": { "$ref": "#/definitions/exclusiveMinimum" }, "maxLength": { "$ref": "#/definitions/maxLength" }, "minLength": { "$ref": "#/definitions/minLength" }, "pattern": { "$ref": "#/definitions/pattern" }, "maxItems": { "$ref": "#/definitions/maxItems" }, "minItems": { "$ref": "#/definitions/minItems" }, "uniqueItems": { "$ref": "#/definitions/uniqueItems" }, "enum": { "$ref": "#/definitions/enum" }, "multipleOf": { "$ref": "#/definitions/multipleOf" } } }, "pathParameterSubSchema": { "additionalProperties": false, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } }, "required": [ "required" ], "properties": { "required": { "type": "boolean", "enum": [ true ], "description": "Determines whether or not this parameter is required or optional." }, "in": { "type": "string", "description": "Determines the location of the parameter.", "enum": [ "path" ] }, "description": { "type": "string", "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." }, "name": { "type": "string", "description": "The name of the parameter." }, "type": { "type": "string", "enum": [ "string", "number", "boolean", "integer", "array" ] }, "format": { "type": "string" }, "items": { "$ref": "#/definitions/primitivesItems" }, "collectionFormat": { "$ref": "#/definitions/collectionFormat" }, "default": { "$ref": "#/definitions/default" }, "maximum": { "$ref": "#/definitions/maximum" }, "exclusiveMaximum": { "$ref": "#/definitions/exclusiveMaximum" }, "minimum": { "$ref": "#/definitions/minimum" }, "exclusiveMinimum": { "$ref": "#/definitions/exclusiveMinimum" }, "maxLength": { "$ref": "#/definitions/maxLength" }, "minLength": { "$ref": "#/definitions/minLength" }, "pattern": { "$ref": "#/definitions/pattern" }, "maxItems": { "$ref": "#/definitions/maxItems" }, "minItems": { "$ref": "#/definitions/minItems" }, "uniqueItems": { "$ref": "#/definitions/uniqueItems" }, "enum": { "$ref": "#/definitions/enum" }, "multipleOf": { "$ref": "#/definitions/multipleOf" } } }, "nonBodyParameter": { "type": "object", "required": [ "name", "in", "type" ], "oneOf": [ { "$ref": "#/definitions/headerParameterSubSchema" }, { "$ref": "#/definitions/formDataParameterSubSchema" }, { "$ref": "#/definitions/queryParameterSubSchema" }, { "$ref": "#/definitions/pathParameterSubSchema" } ] }, "parameter": { "oneOf": [ { "$ref": "#/definitions/bodyParameter" }, { "$ref": "#/definitions/nonBodyParameter" } ] }, "schema": { "type": "object", "description": "A deterministic version of a JSON Schema object.", "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } }, "properties": { "$ref": { "type": "string" }, "format": { "type": "string" }, "title": { "$ref": "http://json-schema.org/draft-04/schema#/properties/title" }, "description": { "$ref": "http://json-schema.org/draft-04/schema#/properties/description" }, "default": { "$ref": "http://json-schema.org/draft-04/schema#/properties/default" }, "multipleOf": { "$ref": "http://json-schema.org/draft-04/schema#/properties/multipleOf" }, "maximum": { "$ref": "http://json-schema.org/draft-04/schema#/properties/maximum" }, "exclusiveMaximum": { "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum" }, "minimum": { "$ref": "http://json-schema.org/draft-04/schema#/properties/minimum" }, "exclusiveMinimum": { "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum" }, "maxLength": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger" }, "minLength": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0" }, "pattern": { "$ref": "http://json-schema.org/draft-04/schema#/properties/pattern" }, "maxItems": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger" }, "minItems": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0" }, "uniqueItems": { "$ref": "http://json-schema.org/draft-04/schema#/properties/uniqueItems" }, "maxProperties": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger" }, "minProperties": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0" }, "required": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray" }, "enum": { "$ref": "http://json-schema.org/draft-04/schema#/properties/enum" }, "additionalProperties": { "oneOf": [ { "$ref": "#/definitions/schema" }, { "type": "boolean" } ], "default": {} }, "type": { "$ref": "http://json-schema.org/draft-04/schema#/properties/type" }, "items": { "anyOf": [ { "$ref": "#/definitions/schema" }, { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/schema" } } ], "default": {} }, "allOf": { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/schema" } }, "properties": { "type": "object", "additionalProperties": { "$ref": "#/definitions/schema" }, "default": {} }, "discriminator": { "type": "string" }, "readOnly": { "type": "boolean", "default": false }, "xml": { "$ref": "#/definitions/xml" }, "externalDocs": { "$ref": "#/definitions/externalDocs" }, "example": {} }, "additionalProperties": false }, "fileSchema": { "type": "object", "description": "A deterministic version of a JSON Schema object.", "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } }, "required": [ "type" ], "properties": { "format": { "type": "string" }, "title": { "$ref": "http://json-schema.org/draft-04/schema#/properties/title" }, "description": { "$ref": "http://json-schema.org/draft-04/schema#/properties/description" }, "default": { "$ref": "http://json-schema.org/draft-04/schema#/properties/default" }, "required": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray" }, "type": { "type": "string", "enum": [ "file" ] }, "readOnly": { "type": "boolean", "default": false }, "externalDocs": { "$ref": "#/definitions/externalDocs" }, "example": {} }, "additionalProperties": false }, "primitivesItems": { "type": "object", "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "string", "number", "integer", "boolean", "array" ] }, "format": { "type": "string" }, "items": { "$ref": "#/definitions/primitivesItems" }, "collectionFormat": { "$ref": "#/definitions/collectionFormat" }, "default": { "$ref": "#/definitions/default" }, "maximum": { "$ref": "#/definitions/maximum" }, "exclusiveMaximum": { "$ref": "#/definitions/exclusiveMaximum" }, "minimum": { "$ref": "#/definitions/minimum" }, "exclusiveMinimum": { "$ref": "#/definitions/exclusiveMinimum" }, "maxLength": { "$ref": "#/definitions/maxLength" }, "minLength": { "$ref": "#/definitions/minLength" }, "pattern": { "$ref": "#/definitions/pattern" }, "maxItems": { "$ref": "#/definitions/maxItems" }, "minItems": { "$ref": "#/definitions/minItems" }, "uniqueItems": { "$ref": "#/definitions/uniqueItems" }, "enum": { "$ref": "#/definitions/enum" }, "multipleOf": { "$ref": "#/definitions/multipleOf" } }, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } } }, "security": { "type": "array", "items": { "$ref": "#/definitions/securityRequirement" }, "uniqueItems": true }, "securityRequirement": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" }, "uniqueItems": true } }, "xml": { "type": "object", "additionalProperties": false, "properties": { "name": { "type": "string" }, "namespace": { "type": "string" }, "prefix": { "type": "string" }, "attribute": { "type": "boolean", "default": false }, "wrapped": { "type": "boolean", "default": false } }, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } } }, "tag": { "type": "object", "additionalProperties": false, "required": [ "name" ], "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "externalDocs": { "$ref": "#/definitions/externalDocs" } }, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } } }, "securityDefinitions": { "type": "object", "additionalProperties": { "oneOf": [ { "$ref": "#/definitions/basicAuthenticationSecurity" }, { "$ref": "#/definitions/apiKeySecurity" }, { "$ref": "#/definitions/oauth2ImplicitSecurity" }, { "$ref": "#/definitions/oauth2PasswordSecurity" }, { "$ref": "#/definitions/oauth2ApplicationSecurity" }, { "$ref": "#/definitions/oauth2AccessCodeSecurity" } ] } }, "basicAuthenticationSecurity": { "type": "object", "additionalProperties": false, "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "basic" ] }, "description": { "type": "string" } }, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } } }, "apiKeySecurity": { "type": "object", "additionalProperties": false, "required": [ "type", "name", "in" ], "properties": { "type": { "type": "string", "enum": [ "apiKey" ] }, "name": { "type": "string" }, "in": { "type": "string", "enum": [ "header", "query" ] }, "description": { "type": "string" } }, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } } }, "oauth2ImplicitSecurity": { "type": "object", "additionalProperties": false, "required": [ "type", "flow", "authorizationUrl" ], "properties": { "type": { "type": "string", "enum": [ "oauth2" ] }, "flow": { "type": "string", "enum": [ "implicit" ] }, "scopes": { "$ref": "#/definitions/oauth2Scopes" }, "authorizationUrl": { "type": "string", "format": "uri" }, "description": { "type": "string" } }, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } } }, "oauth2PasswordSecurity": { "type": "object", "additionalProperties": false, "required": [ "type", "flow", "tokenUrl" ], "properties": { "type": { "type": "string", "enum": [ "oauth2" ] }, "flow": { "type": "string", "enum": [ "password" ] }, "scopes": { "$ref": "#/definitions/oauth2Scopes" }, "tokenUrl": { "type": "string", "format": "uri" }, "description": { "type": "string" } }, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } } }, "oauth2ApplicationSecurity": { "type": "object", "additionalProperties": false, "required": [ "type", "flow", "tokenUrl" ], "properties": { "type": { "type": "string", "enum": [ "oauth2" ] }, "flow": { "type": "string", "enum": [ "application" ] }, "scopes": { "$ref": "#/definitions/oauth2Scopes" }, "tokenUrl": { "type": "string", "format": "uri" }, "description": { "type": "string" } }, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } } }, "oauth2AccessCodeSecurity": { "type": "object", "additionalProperties": false, "required": [ "type", "flow", "authorizationUrl", "tokenUrl" ], "properties": { "type": { "type": "string", "enum": [ "oauth2" ] }, "flow": { "type": "string", "enum": [ "accessCode" ] }, "scopes": { "$ref": "#/definitions/oauth2Scopes" }, "authorizationUrl": { "type": "string", "format": "uri" }, "tokenUrl": { "type": "string", "format": "uri" }, "description": { "type": "string" } }, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } } }, "oauth2Scopes": { "type": "object", "additionalProperties": { "type": "string" } }, "mediaTypeList": { "type": "array", "items": { "$ref": "#/definitions/mimeType" }, "uniqueItems": true }, "parametersList": { "type": "array", "description": "The parameters needed to send a valid API call.", "additionalItems": false, "items": { "oneOf": [ { "$ref": "#/definitions/parameter" }, { "$ref": "#/definitions/jsonReference" } ] }, "uniqueItems": true }, "schemesList": { "type": "array", "description": "The transfer protocol of the API.", "items": { "type": "string", "enum": [ "http", "https", "ws", "wss" ] }, "uniqueItems": true }, "collectionFormat": { "type": "string", "enum": [ "csv", "ssv", "tsv", "pipes" ], "default": "csv" }, "collectionFormatWithMulti": { "type": "string", "enum": [ "csv", "ssv", "tsv", "pipes", "multi" ], "default": "csv" }, "title": { "$ref": "http://json-schema.org/draft-04/schema#/properties/title" }, "description": { "$ref": "http://json-schema.org/draft-04/schema#/properties/description" }, "default": { "$ref": "http://json-schema.org/draft-04/schema#/properties/default" }, "multipleOf": { "$ref": "http://json-schema.org/draft-04/schema#/properties/multipleOf" }, "maximum": { "$ref": "http://json-schema.org/draft-04/schema#/properties/maximum" }, "exclusiveMaximum": { "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum" }, "minimum": { "$ref": "http://json-schema.org/draft-04/schema#/properties/minimum" }, "exclusiveMinimum": { "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum" }, "maxLength": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger" }, "minLength": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0" }, "pattern": { "$ref": "http://json-schema.org/draft-04/schema#/properties/pattern" }, "maxItems": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger" }, "minItems": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0" }, "uniqueItems": { "$ref": "http://json-schema.org/draft-04/schema#/properties/uniqueItems" }, "enum": { "$ref": "http://json-schema.org/draft-04/schema#/properties/enum" }, "jsonReference": { "type": "object", "required": [ "$ref" ], "additionalProperties": false, "properties": { "$ref": { "type": "string" }, "description": { "type": "string" } } } } }
8,915
0
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic/OpenAPIv2/OpenAPIv2.pb.go
// Copyright 2020 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // THIS FILE IS AUTOMATICALLY GENERATED. // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.24.0 // protoc v3.12.0 // source: openapiv2/OpenAPIv2.proto package openapi_v2 import ( proto "github.com/golang/protobuf/proto" any "github.com/golang/protobuf/ptypes/any" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) // This is a compile-time assertion that a sufficiently up-to-date version // of the legacy proto package is being used. const _ = proto.ProtoPackageIsVersion4 type AdditionalPropertiesItem struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Types that are assignable to Oneof: // *AdditionalPropertiesItem_Schema // *AdditionalPropertiesItem_Boolean Oneof isAdditionalPropertiesItem_Oneof `protobuf_oneof:"oneof"` } func (x *AdditionalPropertiesItem) Reset() { *x = AdditionalPropertiesItem{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *AdditionalPropertiesItem) String() string { return protoimpl.X.MessageStringOf(x) } func (*AdditionalPropertiesItem) ProtoMessage() {} func (x *AdditionalPropertiesItem) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use AdditionalPropertiesItem.ProtoReflect.Descriptor instead. func (*AdditionalPropertiesItem) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{0} } func (m *AdditionalPropertiesItem) GetOneof() isAdditionalPropertiesItem_Oneof { if m != nil { return m.Oneof } return nil } func (x *AdditionalPropertiesItem) GetSchema() *Schema { if x, ok := x.GetOneof().(*AdditionalPropertiesItem_Schema); ok { return x.Schema } return nil } func (x *AdditionalPropertiesItem) GetBoolean() bool { if x, ok := x.GetOneof().(*AdditionalPropertiesItem_Boolean); ok { return x.Boolean } return false } type isAdditionalPropertiesItem_Oneof interface { isAdditionalPropertiesItem_Oneof() } type AdditionalPropertiesItem_Schema struct { Schema *Schema `protobuf:"bytes,1,opt,name=schema,proto3,oneof"` } type AdditionalPropertiesItem_Boolean struct { Boolean bool `protobuf:"varint,2,opt,name=boolean,proto3,oneof"` } func (*AdditionalPropertiesItem_Schema) isAdditionalPropertiesItem_Oneof() {} func (*AdditionalPropertiesItem_Boolean) isAdditionalPropertiesItem_Oneof() {} type Any struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Value *any.Any `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` Yaml string `protobuf:"bytes,2,opt,name=yaml,proto3" json:"yaml,omitempty"` } func (x *Any) Reset() { *x = Any{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Any) String() string { return protoimpl.X.MessageStringOf(x) } func (*Any) ProtoMessage() {} func (x *Any) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Any.ProtoReflect.Descriptor instead. func (*Any) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{1} } func (x *Any) GetValue() *any.Any { if x != nil { return x.Value } return nil } func (x *Any) GetYaml() string { if x != nil { return x.Yaml } return "" } type ApiKeySecurity struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` In string `protobuf:"bytes,3,opt,name=in,proto3" json:"in,omitempty"` Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,5,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } func (x *ApiKeySecurity) Reset() { *x = ApiKeySecurity{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *ApiKeySecurity) String() string { return protoimpl.X.MessageStringOf(x) } func (*ApiKeySecurity) ProtoMessage() {} func (x *ApiKeySecurity) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use ApiKeySecurity.ProtoReflect.Descriptor instead. func (*ApiKeySecurity) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{2} } func (x *ApiKeySecurity) GetType() string { if x != nil { return x.Type } return "" } func (x *ApiKeySecurity) GetName() string { if x != nil { return x.Name } return "" } func (x *ApiKeySecurity) GetIn() string { if x != nil { return x.In } return "" } func (x *ApiKeySecurity) GetDescription() string { if x != nil { return x.Description } return "" } func (x *ApiKeySecurity) GetVendorExtension() []*NamedAny { if x != nil { return x.VendorExtension } return nil } type BasicAuthenticationSecurity struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,3,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } func (x *BasicAuthenticationSecurity) Reset() { *x = BasicAuthenticationSecurity{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *BasicAuthenticationSecurity) String() string { return protoimpl.X.MessageStringOf(x) } func (*BasicAuthenticationSecurity) ProtoMessage() {} func (x *BasicAuthenticationSecurity) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use BasicAuthenticationSecurity.ProtoReflect.Descriptor instead. func (*BasicAuthenticationSecurity) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{3} } func (x *BasicAuthenticationSecurity) GetType() string { if x != nil { return x.Type } return "" } func (x *BasicAuthenticationSecurity) GetDescription() string { if x != nil { return x.Description } return "" } func (x *BasicAuthenticationSecurity) GetVendorExtension() []*NamedAny { if x != nil { return x.VendorExtension } return nil } type BodyParameter struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` // The name of the parameter. Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // Determines the location of the parameter. In string `protobuf:"bytes,3,opt,name=in,proto3" json:"in,omitempty"` // Determines whether or not this parameter is required or optional. Required bool `protobuf:"varint,4,opt,name=required,proto3" json:"required,omitempty"` Schema *Schema `protobuf:"bytes,5,opt,name=schema,proto3" json:"schema,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } func (x *BodyParameter) Reset() { *x = BodyParameter{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *BodyParameter) String() string { return protoimpl.X.MessageStringOf(x) } func (*BodyParameter) ProtoMessage() {} func (x *BodyParameter) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use BodyParameter.ProtoReflect.Descriptor instead. func (*BodyParameter) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{4} } func (x *BodyParameter) GetDescription() string { if x != nil { return x.Description } return "" } func (x *BodyParameter) GetName() string { if x != nil { return x.Name } return "" } func (x *BodyParameter) GetIn() string { if x != nil { return x.In } return "" } func (x *BodyParameter) GetRequired() bool { if x != nil { return x.Required } return false } func (x *BodyParameter) GetSchema() *Schema { if x != nil { return x.Schema } return nil } func (x *BodyParameter) GetVendorExtension() []*NamedAny { if x != nil { return x.VendorExtension } return nil } // Contact information for the owners of the API. type Contact struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The identifying name of the contact person/organization. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // The URL pointing to the contact information. Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` // The email address of the contact person/organization. Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,4,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } func (x *Contact) Reset() { *x = Contact{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Contact) String() string { return protoimpl.X.MessageStringOf(x) } func (*Contact) ProtoMessage() {} func (x *Contact) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Contact.ProtoReflect.Descriptor instead. func (*Contact) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{5} } func (x *Contact) GetName() string { if x != nil { return x.Name } return "" } func (x *Contact) GetUrl() string { if x != nil { return x.Url } return "" } func (x *Contact) GetEmail() string { if x != nil { return x.Email } return "" } func (x *Contact) GetVendorExtension() []*NamedAny { if x != nil { return x.VendorExtension } return nil } type Default struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields AdditionalProperties []*NamedAny `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` } func (x *Default) Reset() { *x = Default{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Default) String() string { return protoimpl.X.MessageStringOf(x) } func (*Default) ProtoMessage() {} func (x *Default) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Default.ProtoReflect.Descriptor instead. func (*Default) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{6} } func (x *Default) GetAdditionalProperties() []*NamedAny { if x != nil { return x.AdditionalProperties } return nil } // One or more JSON objects describing the schemas being consumed and produced by the API. type Definitions struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields AdditionalProperties []*NamedSchema `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` } func (x *Definitions) Reset() { *x = Definitions{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Definitions) String() string { return protoimpl.X.MessageStringOf(x) } func (*Definitions) ProtoMessage() {} func (x *Definitions) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Definitions.ProtoReflect.Descriptor instead. func (*Definitions) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{7} } func (x *Definitions) GetAdditionalProperties() []*NamedSchema { if x != nil { return x.AdditionalProperties } return nil } type Document struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The Swagger version of this document. Swagger string `protobuf:"bytes,1,opt,name=swagger,proto3" json:"swagger,omitempty"` Info *Info `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` // The host (name or ip) of the API. Example: 'swagger.io' Host string `protobuf:"bytes,3,opt,name=host,proto3" json:"host,omitempty"` // The base path to the API. Example: '/api'. BasePath string `protobuf:"bytes,4,opt,name=base_path,json=basePath,proto3" json:"base_path,omitempty"` // The transfer protocol of the API. Schemes []string `protobuf:"bytes,5,rep,name=schemes,proto3" json:"schemes,omitempty"` // A list of MIME types accepted by the API. Consumes []string `protobuf:"bytes,6,rep,name=consumes,proto3" json:"consumes,omitempty"` // A list of MIME types the API can produce. Produces []string `protobuf:"bytes,7,rep,name=produces,proto3" json:"produces,omitempty"` Paths *Paths `protobuf:"bytes,8,opt,name=paths,proto3" json:"paths,omitempty"` Definitions *Definitions `protobuf:"bytes,9,opt,name=definitions,proto3" json:"definitions,omitempty"` Parameters *ParameterDefinitions `protobuf:"bytes,10,opt,name=parameters,proto3" json:"parameters,omitempty"` Responses *ResponseDefinitions `protobuf:"bytes,11,opt,name=responses,proto3" json:"responses,omitempty"` Security []*SecurityRequirement `protobuf:"bytes,12,rep,name=security,proto3" json:"security,omitempty"` SecurityDefinitions *SecurityDefinitions `protobuf:"bytes,13,opt,name=security_definitions,json=securityDefinitions,proto3" json:"security_definitions,omitempty"` Tags []*Tag `protobuf:"bytes,14,rep,name=tags,proto3" json:"tags,omitempty"` ExternalDocs *ExternalDocs `protobuf:"bytes,15,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,16,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } func (x *Document) Reset() { *x = Document{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Document) String() string { return protoimpl.X.MessageStringOf(x) } func (*Document) ProtoMessage() {} func (x *Document) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Document.ProtoReflect.Descriptor instead. func (*Document) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{8} } func (x *Document) GetSwagger() string { if x != nil { return x.Swagger } return "" } func (x *Document) GetInfo() *Info { if x != nil { return x.Info } return nil } func (x *Document) GetHost() string { if x != nil { return x.Host } return "" } func (x *Document) GetBasePath() string { if x != nil { return x.BasePath } return "" } func (x *Document) GetSchemes() []string { if x != nil { return x.Schemes } return nil } func (x *Document) GetConsumes() []string { if x != nil { return x.Consumes } return nil } func (x *Document) GetProduces() []string { if x != nil { return x.Produces } return nil } func (x *Document) GetPaths() *Paths { if x != nil { return x.Paths } return nil } func (x *Document) GetDefinitions() *Definitions { if x != nil { return x.Definitions } return nil } func (x *Document) GetParameters() *ParameterDefinitions { if x != nil { return x.Parameters } return nil } func (x *Document) GetResponses() *ResponseDefinitions { if x != nil { return x.Responses } return nil } func (x *Document) GetSecurity() []*SecurityRequirement { if x != nil { return x.Security } return nil } func (x *Document) GetSecurityDefinitions() *SecurityDefinitions { if x != nil { return x.SecurityDefinitions } return nil } func (x *Document) GetTags() []*Tag { if x != nil { return x.Tags } return nil } func (x *Document) GetExternalDocs() *ExternalDocs { if x != nil { return x.ExternalDocs } return nil } func (x *Document) GetVendorExtension() []*NamedAny { if x != nil { return x.VendorExtension } return nil } type Examples struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields AdditionalProperties []*NamedAny `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` } func (x *Examples) Reset() { *x = Examples{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Examples) String() string { return protoimpl.X.MessageStringOf(x) } func (*Examples) ProtoMessage() {} func (x *Examples) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Examples.ProtoReflect.Descriptor instead. func (*Examples) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{9} } func (x *Examples) GetAdditionalProperties() []*NamedAny { if x != nil { return x.AdditionalProperties } return nil } // information about external documentation type ExternalDocs struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,3,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } func (x *ExternalDocs) Reset() { *x = ExternalDocs{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *ExternalDocs) String() string { return protoimpl.X.MessageStringOf(x) } func (*ExternalDocs) ProtoMessage() {} func (x *ExternalDocs) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use ExternalDocs.ProtoReflect.Descriptor instead. func (*ExternalDocs) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{10} } func (x *ExternalDocs) GetDescription() string { if x != nil { return x.Description } return "" } func (x *ExternalDocs) GetUrl() string { if x != nil { return x.Url } return "" } func (x *ExternalDocs) GetVendorExtension() []*NamedAny { if x != nil { return x.VendorExtension } return nil } // A deterministic version of a JSON Schema object. type FileSchema struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Format string `protobuf:"bytes,1,opt,name=format,proto3" json:"format,omitempty"` Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` Default *Any `protobuf:"bytes,4,opt,name=default,proto3" json:"default,omitempty"` Required []string `protobuf:"bytes,5,rep,name=required,proto3" json:"required,omitempty"` Type string `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"` ReadOnly bool `protobuf:"varint,7,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"` ExternalDocs *ExternalDocs `protobuf:"bytes,8,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"` Example *Any `protobuf:"bytes,9,opt,name=example,proto3" json:"example,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,10,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } func (x *FileSchema) Reset() { *x = FileSchema{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *FileSchema) String() string { return protoimpl.X.MessageStringOf(x) } func (*FileSchema) ProtoMessage() {} func (x *FileSchema) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use FileSchema.ProtoReflect.Descriptor instead. func (*FileSchema) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{11} } func (x *FileSchema) GetFormat() string { if x != nil { return x.Format } return "" } func (x *FileSchema) GetTitle() string { if x != nil { return x.Title } return "" } func (x *FileSchema) GetDescription() string { if x != nil { return x.Description } return "" } func (x *FileSchema) GetDefault() *Any { if x != nil { return x.Default } return nil } func (x *FileSchema) GetRequired() []string { if x != nil { return x.Required } return nil } func (x *FileSchema) GetType() string { if x != nil { return x.Type } return "" } func (x *FileSchema) GetReadOnly() bool { if x != nil { return x.ReadOnly } return false } func (x *FileSchema) GetExternalDocs() *ExternalDocs { if x != nil { return x.ExternalDocs } return nil } func (x *FileSchema) GetExample() *Any { if x != nil { return x.Example } return nil } func (x *FileSchema) GetVendorExtension() []*NamedAny { if x != nil { return x.VendorExtension } return nil } type FormDataParameterSubSchema struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Determines whether or not this parameter is required or optional. Required bool `protobuf:"varint,1,opt,name=required,proto3" json:"required,omitempty"` // Determines the location of the parameter. In string `protobuf:"bytes,2,opt,name=in,proto3" json:"in,omitempty"` // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` // The name of the parameter. Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` // allows sending a parameter by name only or with an empty value. AllowEmptyValue bool `protobuf:"varint,5,opt,name=allow_empty_value,json=allowEmptyValue,proto3" json:"allow_empty_value,omitempty"` Type string `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"` Format string `protobuf:"bytes,7,opt,name=format,proto3" json:"format,omitempty"` Items *PrimitivesItems `protobuf:"bytes,8,opt,name=items,proto3" json:"items,omitempty"` CollectionFormat string `protobuf:"bytes,9,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"` Default *Any `protobuf:"bytes,10,opt,name=default,proto3" json:"default,omitempty"` Maximum float64 `protobuf:"fixed64,11,opt,name=maximum,proto3" json:"maximum,omitempty"` ExclusiveMaximum bool `protobuf:"varint,12,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` Minimum float64 `protobuf:"fixed64,13,opt,name=minimum,proto3" json:"minimum,omitempty"` ExclusiveMinimum bool `protobuf:"varint,14,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` MaxLength int64 `protobuf:"varint,15,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` MinLength int64 `protobuf:"varint,16,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` Pattern string `protobuf:"bytes,17,opt,name=pattern,proto3" json:"pattern,omitempty"` MaxItems int64 `protobuf:"varint,18,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` MinItems int64 `protobuf:"varint,19,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` UniqueItems bool `protobuf:"varint,20,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` Enum []*Any `protobuf:"bytes,21,rep,name=enum,proto3" json:"enum,omitempty"` MultipleOf float64 `protobuf:"fixed64,22,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,23,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } func (x *FormDataParameterSubSchema) Reset() { *x = FormDataParameterSubSchema{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *FormDataParameterSubSchema) String() string { return protoimpl.X.MessageStringOf(x) } func (*FormDataParameterSubSchema) ProtoMessage() {} func (x *FormDataParameterSubSchema) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use FormDataParameterSubSchema.ProtoReflect.Descriptor instead. func (*FormDataParameterSubSchema) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{12} } func (x *FormDataParameterSubSchema) GetRequired() bool { if x != nil { return x.Required } return false } func (x *FormDataParameterSubSchema) GetIn() string { if x != nil { return x.In } return "" } func (x *FormDataParameterSubSchema) GetDescription() string { if x != nil { return x.Description } return "" } func (x *FormDataParameterSubSchema) GetName() string { if x != nil { return x.Name } return "" } func (x *FormDataParameterSubSchema) GetAllowEmptyValue() bool { if x != nil { return x.AllowEmptyValue } return false } func (x *FormDataParameterSubSchema) GetType() string { if x != nil { return x.Type } return "" } func (x *FormDataParameterSubSchema) GetFormat() string { if x != nil { return x.Format } return "" } func (x *FormDataParameterSubSchema) GetItems() *PrimitivesItems { if x != nil { return x.Items } return nil } func (x *FormDataParameterSubSchema) GetCollectionFormat() string { if x != nil { return x.CollectionFormat } return "" } func (x *FormDataParameterSubSchema) GetDefault() *Any { if x != nil { return x.Default } return nil } func (x *FormDataParameterSubSchema) GetMaximum() float64 { if x != nil { return x.Maximum } return 0 } func (x *FormDataParameterSubSchema) GetExclusiveMaximum() bool { if x != nil { return x.ExclusiveMaximum } return false } func (x *FormDataParameterSubSchema) GetMinimum() float64 { if x != nil { return x.Minimum } return 0 } func (x *FormDataParameterSubSchema) GetExclusiveMinimum() bool { if x != nil { return x.ExclusiveMinimum } return false } func (x *FormDataParameterSubSchema) GetMaxLength() int64 { if x != nil { return x.MaxLength } return 0 } func (x *FormDataParameterSubSchema) GetMinLength() int64 { if x != nil { return x.MinLength } return 0 } func (x *FormDataParameterSubSchema) GetPattern() string { if x != nil { return x.Pattern } return "" } func (x *FormDataParameterSubSchema) GetMaxItems() int64 { if x != nil { return x.MaxItems } return 0 } func (x *FormDataParameterSubSchema) GetMinItems() int64 { if x != nil { return x.MinItems } return 0 } func (x *FormDataParameterSubSchema) GetUniqueItems() bool { if x != nil { return x.UniqueItems } return false } func (x *FormDataParameterSubSchema) GetEnum() []*Any { if x != nil { return x.Enum } return nil } func (x *FormDataParameterSubSchema) GetMultipleOf() float64 { if x != nil { return x.MultipleOf } return 0 } func (x *FormDataParameterSubSchema) GetVendorExtension() []*NamedAny { if x != nil { return x.VendorExtension } return nil } type Header struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` Format string `protobuf:"bytes,2,opt,name=format,proto3" json:"format,omitempty"` Items *PrimitivesItems `protobuf:"bytes,3,opt,name=items,proto3" json:"items,omitempty"` CollectionFormat string `protobuf:"bytes,4,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"` Default *Any `protobuf:"bytes,5,opt,name=default,proto3" json:"default,omitempty"` Maximum float64 `protobuf:"fixed64,6,opt,name=maximum,proto3" json:"maximum,omitempty"` ExclusiveMaximum bool `protobuf:"varint,7,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` Minimum float64 `protobuf:"fixed64,8,opt,name=minimum,proto3" json:"minimum,omitempty"` ExclusiveMinimum bool `protobuf:"varint,9,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` MaxLength int64 `protobuf:"varint,10,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` MinLength int64 `protobuf:"varint,11,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` Pattern string `protobuf:"bytes,12,opt,name=pattern,proto3" json:"pattern,omitempty"` MaxItems int64 `protobuf:"varint,13,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` MinItems int64 `protobuf:"varint,14,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` UniqueItems bool `protobuf:"varint,15,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` Enum []*Any `protobuf:"bytes,16,rep,name=enum,proto3" json:"enum,omitempty"` MultipleOf float64 `protobuf:"fixed64,17,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` Description string `protobuf:"bytes,18,opt,name=description,proto3" json:"description,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,19,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } func (x *Header) Reset() { *x = Header{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Header) String() string { return protoimpl.X.MessageStringOf(x) } func (*Header) ProtoMessage() {} func (x *Header) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Header.ProtoReflect.Descriptor instead. func (*Header) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{13} } func (x *Header) GetType() string { if x != nil { return x.Type } return "" } func (x *Header) GetFormat() string { if x != nil { return x.Format } return "" } func (x *Header) GetItems() *PrimitivesItems { if x != nil { return x.Items } return nil } func (x *Header) GetCollectionFormat() string { if x != nil { return x.CollectionFormat } return "" } func (x *Header) GetDefault() *Any { if x != nil { return x.Default } return nil } func (x *Header) GetMaximum() float64 { if x != nil { return x.Maximum } return 0 } func (x *Header) GetExclusiveMaximum() bool { if x != nil { return x.ExclusiveMaximum } return false } func (x *Header) GetMinimum() float64 { if x != nil { return x.Minimum } return 0 } func (x *Header) GetExclusiveMinimum() bool { if x != nil { return x.ExclusiveMinimum } return false } func (x *Header) GetMaxLength() int64 { if x != nil { return x.MaxLength } return 0 } func (x *Header) GetMinLength() int64 { if x != nil { return x.MinLength } return 0 } func (x *Header) GetPattern() string { if x != nil { return x.Pattern } return "" } func (x *Header) GetMaxItems() int64 { if x != nil { return x.MaxItems } return 0 } func (x *Header) GetMinItems() int64 { if x != nil { return x.MinItems } return 0 } func (x *Header) GetUniqueItems() bool { if x != nil { return x.UniqueItems } return false } func (x *Header) GetEnum() []*Any { if x != nil { return x.Enum } return nil } func (x *Header) GetMultipleOf() float64 { if x != nil { return x.MultipleOf } return 0 } func (x *Header) GetDescription() string { if x != nil { return x.Description } return "" } func (x *Header) GetVendorExtension() []*NamedAny { if x != nil { return x.VendorExtension } return nil } type HeaderParameterSubSchema struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Determines whether or not this parameter is required or optional. Required bool `protobuf:"varint,1,opt,name=required,proto3" json:"required,omitempty"` // Determines the location of the parameter. In string `protobuf:"bytes,2,opt,name=in,proto3" json:"in,omitempty"` // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` // The name of the parameter. Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` Type string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"` Format string `protobuf:"bytes,6,opt,name=format,proto3" json:"format,omitempty"` Items *PrimitivesItems `protobuf:"bytes,7,opt,name=items,proto3" json:"items,omitempty"` CollectionFormat string `protobuf:"bytes,8,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"` Default *Any `protobuf:"bytes,9,opt,name=default,proto3" json:"default,omitempty"` Maximum float64 `protobuf:"fixed64,10,opt,name=maximum,proto3" json:"maximum,omitempty"` ExclusiveMaximum bool `protobuf:"varint,11,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` Minimum float64 `protobuf:"fixed64,12,opt,name=minimum,proto3" json:"minimum,omitempty"` ExclusiveMinimum bool `protobuf:"varint,13,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` MaxLength int64 `protobuf:"varint,14,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` MinLength int64 `protobuf:"varint,15,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` Pattern string `protobuf:"bytes,16,opt,name=pattern,proto3" json:"pattern,omitempty"` MaxItems int64 `protobuf:"varint,17,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` MinItems int64 `protobuf:"varint,18,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` UniqueItems bool `protobuf:"varint,19,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` Enum []*Any `protobuf:"bytes,20,rep,name=enum,proto3" json:"enum,omitempty"` MultipleOf float64 `protobuf:"fixed64,21,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,22,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } func (x *HeaderParameterSubSchema) Reset() { *x = HeaderParameterSubSchema{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *HeaderParameterSubSchema) String() string { return protoimpl.X.MessageStringOf(x) } func (*HeaderParameterSubSchema) ProtoMessage() {} func (x *HeaderParameterSubSchema) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use HeaderParameterSubSchema.ProtoReflect.Descriptor instead. func (*HeaderParameterSubSchema) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{14} } func (x *HeaderParameterSubSchema) GetRequired() bool { if x != nil { return x.Required } return false } func (x *HeaderParameterSubSchema) GetIn() string { if x != nil { return x.In } return "" } func (x *HeaderParameterSubSchema) GetDescription() string { if x != nil { return x.Description } return "" } func (x *HeaderParameterSubSchema) GetName() string { if x != nil { return x.Name } return "" } func (x *HeaderParameterSubSchema) GetType() string { if x != nil { return x.Type } return "" } func (x *HeaderParameterSubSchema) GetFormat() string { if x != nil { return x.Format } return "" } func (x *HeaderParameterSubSchema) GetItems() *PrimitivesItems { if x != nil { return x.Items } return nil } func (x *HeaderParameterSubSchema) GetCollectionFormat() string { if x != nil { return x.CollectionFormat } return "" } func (x *HeaderParameterSubSchema) GetDefault() *Any { if x != nil { return x.Default } return nil } func (x *HeaderParameterSubSchema) GetMaximum() float64 { if x != nil { return x.Maximum } return 0 } func (x *HeaderParameterSubSchema) GetExclusiveMaximum() bool { if x != nil { return x.ExclusiveMaximum } return false } func (x *HeaderParameterSubSchema) GetMinimum() float64 { if x != nil { return x.Minimum } return 0 } func (x *HeaderParameterSubSchema) GetExclusiveMinimum() bool { if x != nil { return x.ExclusiveMinimum } return false } func (x *HeaderParameterSubSchema) GetMaxLength() int64 { if x != nil { return x.MaxLength } return 0 } func (x *HeaderParameterSubSchema) GetMinLength() int64 { if x != nil { return x.MinLength } return 0 } func (x *HeaderParameterSubSchema) GetPattern() string { if x != nil { return x.Pattern } return "" } func (x *HeaderParameterSubSchema) GetMaxItems() int64 { if x != nil { return x.MaxItems } return 0 } func (x *HeaderParameterSubSchema) GetMinItems() int64 { if x != nil { return x.MinItems } return 0 } func (x *HeaderParameterSubSchema) GetUniqueItems() bool { if x != nil { return x.UniqueItems } return false } func (x *HeaderParameterSubSchema) GetEnum() []*Any { if x != nil { return x.Enum } return nil } func (x *HeaderParameterSubSchema) GetMultipleOf() float64 { if x != nil { return x.MultipleOf } return 0 } func (x *HeaderParameterSubSchema) GetVendorExtension() []*NamedAny { if x != nil { return x.VendorExtension } return nil } type Headers struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields AdditionalProperties []*NamedHeader `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` } func (x *Headers) Reset() { *x = Headers{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Headers) String() string { return protoimpl.X.MessageStringOf(x) } func (*Headers) ProtoMessage() {} func (x *Headers) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Headers.ProtoReflect.Descriptor instead. func (*Headers) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{15} } func (x *Headers) GetAdditionalProperties() []*NamedHeader { if x != nil { return x.AdditionalProperties } return nil } // General information about the API. type Info struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // A unique and precise title of the API. Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` // A semantic version number of the API. Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // A longer description of the API. Should be different from the title. GitHub Flavored Markdown is allowed. Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` // The terms of service for the API. TermsOfService string `protobuf:"bytes,4,opt,name=terms_of_service,json=termsOfService,proto3" json:"terms_of_service,omitempty"` Contact *Contact `protobuf:"bytes,5,opt,name=contact,proto3" json:"contact,omitempty"` License *License `protobuf:"bytes,6,opt,name=license,proto3" json:"license,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,7,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } func (x *Info) Reset() { *x = Info{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Info) String() string { return protoimpl.X.MessageStringOf(x) } func (*Info) ProtoMessage() {} func (x *Info) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Info.ProtoReflect.Descriptor instead. func (*Info) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{16} } func (x *Info) GetTitle() string { if x != nil { return x.Title } return "" } func (x *Info) GetVersion() string { if x != nil { return x.Version } return "" } func (x *Info) GetDescription() string { if x != nil { return x.Description } return "" } func (x *Info) GetTermsOfService() string { if x != nil { return x.TermsOfService } return "" } func (x *Info) GetContact() *Contact { if x != nil { return x.Contact } return nil } func (x *Info) GetLicense() *License { if x != nil { return x.License } return nil } func (x *Info) GetVendorExtension() []*NamedAny { if x != nil { return x.VendorExtension } return nil } type ItemsItem struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Schema []*Schema `protobuf:"bytes,1,rep,name=schema,proto3" json:"schema,omitempty"` } func (x *ItemsItem) Reset() { *x = ItemsItem{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *ItemsItem) String() string { return protoimpl.X.MessageStringOf(x) } func (*ItemsItem) ProtoMessage() {} func (x *ItemsItem) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use ItemsItem.ProtoReflect.Descriptor instead. func (*ItemsItem) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{17} } func (x *ItemsItem) GetSchema() []*Schema { if x != nil { return x.Schema } return nil } type JsonReference struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields XRef string `protobuf:"bytes,1,opt,name=_ref,json=Ref,proto3" json:"_ref,omitempty"` Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` } func (x *JsonReference) Reset() { *x = JsonReference{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *JsonReference) String() string { return protoimpl.X.MessageStringOf(x) } func (*JsonReference) ProtoMessage() {} func (x *JsonReference) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use JsonReference.ProtoReflect.Descriptor instead. func (*JsonReference) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{18} } func (x *JsonReference) GetXRef() string { if x != nil { return x.XRef } return "" } func (x *JsonReference) GetDescription() string { if x != nil { return x.Description } return "" } type License struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The name of the license type. It's encouraged to use an OSI compatible license. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // The URL pointing to the license. Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,3,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } func (x *License) Reset() { *x = License{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *License) String() string { return protoimpl.X.MessageStringOf(x) } func (*License) ProtoMessage() {} func (x *License) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use License.ProtoReflect.Descriptor instead. func (*License) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{19} } func (x *License) GetName() string { if x != nil { return x.Name } return "" } func (x *License) GetUrl() string { if x != nil { return x.Url } return "" } func (x *License) GetVendorExtension() []*NamedAny { if x != nil { return x.VendorExtension } return nil } // Automatically-generated message used to represent maps of Any as ordered (name,value) pairs. type NamedAny struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Map key Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Mapped value Value *Any `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` } func (x *NamedAny) Reset() { *x = NamedAny{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *NamedAny) String() string { return protoimpl.X.MessageStringOf(x) } func (*NamedAny) ProtoMessage() {} func (x *NamedAny) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use NamedAny.ProtoReflect.Descriptor instead. func (*NamedAny) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{20} } func (x *NamedAny) GetName() string { if x != nil { return x.Name } return "" } func (x *NamedAny) GetValue() *Any { if x != nil { return x.Value } return nil } // Automatically-generated message used to represent maps of Header as ordered (name,value) pairs. type NamedHeader struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Map key Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Mapped value Value *Header `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` } func (x *NamedHeader) Reset() { *x = NamedHeader{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *NamedHeader) String() string { return protoimpl.X.MessageStringOf(x) } func (*NamedHeader) ProtoMessage() {} func (x *NamedHeader) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use NamedHeader.ProtoReflect.Descriptor instead. func (*NamedHeader) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{21} } func (x *NamedHeader) GetName() string { if x != nil { return x.Name } return "" } func (x *NamedHeader) GetValue() *Header { if x != nil { return x.Value } return nil } // Automatically-generated message used to represent maps of Parameter as ordered (name,value) pairs. type NamedParameter struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Map key Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Mapped value Value *Parameter `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` } func (x *NamedParameter) Reset() { *x = NamedParameter{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *NamedParameter) String() string { return protoimpl.X.MessageStringOf(x) } func (*NamedParameter) ProtoMessage() {} func (x *NamedParameter) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use NamedParameter.ProtoReflect.Descriptor instead. func (*NamedParameter) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{22} } func (x *NamedParameter) GetName() string { if x != nil { return x.Name } return "" } func (x *NamedParameter) GetValue() *Parameter { if x != nil { return x.Value } return nil } // Automatically-generated message used to represent maps of PathItem as ordered (name,value) pairs. type NamedPathItem struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Map key Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Mapped value Value *PathItem `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` } func (x *NamedPathItem) Reset() { *x = NamedPathItem{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *NamedPathItem) String() string { return protoimpl.X.MessageStringOf(x) } func (*NamedPathItem) ProtoMessage() {} func (x *NamedPathItem) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use NamedPathItem.ProtoReflect.Descriptor instead. func (*NamedPathItem) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{23} } func (x *NamedPathItem) GetName() string { if x != nil { return x.Name } return "" } func (x *NamedPathItem) GetValue() *PathItem { if x != nil { return x.Value } return nil } // Automatically-generated message used to represent maps of Response as ordered (name,value) pairs. type NamedResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Map key Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Mapped value Value *Response `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` } func (x *NamedResponse) Reset() { *x = NamedResponse{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *NamedResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*NamedResponse) ProtoMessage() {} func (x *NamedResponse) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use NamedResponse.ProtoReflect.Descriptor instead. func (*NamedResponse) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{24} } func (x *NamedResponse) GetName() string { if x != nil { return x.Name } return "" } func (x *NamedResponse) GetValue() *Response { if x != nil { return x.Value } return nil } // Automatically-generated message used to represent maps of ResponseValue as ordered (name,value) pairs. type NamedResponseValue struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Map key Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Mapped value Value *ResponseValue `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` } func (x *NamedResponseValue) Reset() { *x = NamedResponseValue{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *NamedResponseValue) String() string { return protoimpl.X.MessageStringOf(x) } func (*NamedResponseValue) ProtoMessage() {} func (x *NamedResponseValue) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use NamedResponseValue.ProtoReflect.Descriptor instead. func (*NamedResponseValue) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{25} } func (x *NamedResponseValue) GetName() string { if x != nil { return x.Name } return "" } func (x *NamedResponseValue) GetValue() *ResponseValue { if x != nil { return x.Value } return nil } // Automatically-generated message used to represent maps of Schema as ordered (name,value) pairs. type NamedSchema struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Map key Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Mapped value Value *Schema `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` } func (x *NamedSchema) Reset() { *x = NamedSchema{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *NamedSchema) String() string { return protoimpl.X.MessageStringOf(x) } func (*NamedSchema) ProtoMessage() {} func (x *NamedSchema) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use NamedSchema.ProtoReflect.Descriptor instead. func (*NamedSchema) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{26} } func (x *NamedSchema) GetName() string { if x != nil { return x.Name } return "" } func (x *NamedSchema) GetValue() *Schema { if x != nil { return x.Value } return nil } // Automatically-generated message used to represent maps of SecurityDefinitionsItem as ordered (name,value) pairs. type NamedSecurityDefinitionsItem struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Map key Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Mapped value Value *SecurityDefinitionsItem `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` } func (x *NamedSecurityDefinitionsItem) Reset() { *x = NamedSecurityDefinitionsItem{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *NamedSecurityDefinitionsItem) String() string { return protoimpl.X.MessageStringOf(x) } func (*NamedSecurityDefinitionsItem) ProtoMessage() {} func (x *NamedSecurityDefinitionsItem) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use NamedSecurityDefinitionsItem.ProtoReflect.Descriptor instead. func (*NamedSecurityDefinitionsItem) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{27} } func (x *NamedSecurityDefinitionsItem) GetName() string { if x != nil { return x.Name } return "" } func (x *NamedSecurityDefinitionsItem) GetValue() *SecurityDefinitionsItem { if x != nil { return x.Value } return nil } // Automatically-generated message used to represent maps of string as ordered (name,value) pairs. type NamedString struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Map key Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Mapped value Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` } func (x *NamedString) Reset() { *x = NamedString{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *NamedString) String() string { return protoimpl.X.MessageStringOf(x) } func (*NamedString) ProtoMessage() {} func (x *NamedString) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use NamedString.ProtoReflect.Descriptor instead. func (*NamedString) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{28} } func (x *NamedString) GetName() string { if x != nil { return x.Name } return "" } func (x *NamedString) GetValue() string { if x != nil { return x.Value } return "" } // Automatically-generated message used to represent maps of StringArray as ordered (name,value) pairs. type NamedStringArray struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Map key Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Mapped value Value *StringArray `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` } func (x *NamedStringArray) Reset() { *x = NamedStringArray{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *NamedStringArray) String() string { return protoimpl.X.MessageStringOf(x) } func (*NamedStringArray) ProtoMessage() {} func (x *NamedStringArray) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use NamedStringArray.ProtoReflect.Descriptor instead. func (*NamedStringArray) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{29} } func (x *NamedStringArray) GetName() string { if x != nil { return x.Name } return "" } func (x *NamedStringArray) GetValue() *StringArray { if x != nil { return x.Value } return nil } type NonBodyParameter struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Types that are assignable to Oneof: // *NonBodyParameter_HeaderParameterSubSchema // *NonBodyParameter_FormDataParameterSubSchema // *NonBodyParameter_QueryParameterSubSchema // *NonBodyParameter_PathParameterSubSchema Oneof isNonBodyParameter_Oneof `protobuf_oneof:"oneof"` } func (x *NonBodyParameter) Reset() { *x = NonBodyParameter{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *NonBodyParameter) String() string { return protoimpl.X.MessageStringOf(x) } func (*NonBodyParameter) ProtoMessage() {} func (x *NonBodyParameter) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use NonBodyParameter.ProtoReflect.Descriptor instead. func (*NonBodyParameter) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{30} } func (m *NonBodyParameter) GetOneof() isNonBodyParameter_Oneof { if m != nil { return m.Oneof } return nil } func (x *NonBodyParameter) GetHeaderParameterSubSchema() *HeaderParameterSubSchema { if x, ok := x.GetOneof().(*NonBodyParameter_HeaderParameterSubSchema); ok { return x.HeaderParameterSubSchema } return nil } func (x *NonBodyParameter) GetFormDataParameterSubSchema() *FormDataParameterSubSchema { if x, ok := x.GetOneof().(*NonBodyParameter_FormDataParameterSubSchema); ok { return x.FormDataParameterSubSchema } return nil } func (x *NonBodyParameter) GetQueryParameterSubSchema() *QueryParameterSubSchema { if x, ok := x.GetOneof().(*NonBodyParameter_QueryParameterSubSchema); ok { return x.QueryParameterSubSchema } return nil } func (x *NonBodyParameter) GetPathParameterSubSchema() *PathParameterSubSchema { if x, ok := x.GetOneof().(*NonBodyParameter_PathParameterSubSchema); ok { return x.PathParameterSubSchema } return nil } type isNonBodyParameter_Oneof interface { isNonBodyParameter_Oneof() } type NonBodyParameter_HeaderParameterSubSchema struct { HeaderParameterSubSchema *HeaderParameterSubSchema `protobuf:"bytes,1,opt,name=header_parameter_sub_schema,json=headerParameterSubSchema,proto3,oneof"` } type NonBodyParameter_FormDataParameterSubSchema struct { FormDataParameterSubSchema *FormDataParameterSubSchema `protobuf:"bytes,2,opt,name=form_data_parameter_sub_schema,json=formDataParameterSubSchema,proto3,oneof"` } type NonBodyParameter_QueryParameterSubSchema struct { QueryParameterSubSchema *QueryParameterSubSchema `protobuf:"bytes,3,opt,name=query_parameter_sub_schema,json=queryParameterSubSchema,proto3,oneof"` } type NonBodyParameter_PathParameterSubSchema struct { PathParameterSubSchema *PathParameterSubSchema `protobuf:"bytes,4,opt,name=path_parameter_sub_schema,json=pathParameterSubSchema,proto3,oneof"` } func (*NonBodyParameter_HeaderParameterSubSchema) isNonBodyParameter_Oneof() {} func (*NonBodyParameter_FormDataParameterSubSchema) isNonBodyParameter_Oneof() {} func (*NonBodyParameter_QueryParameterSubSchema) isNonBodyParameter_Oneof() {} func (*NonBodyParameter_PathParameterSubSchema) isNonBodyParameter_Oneof() {} type Oauth2AccessCodeSecurity struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` Flow string `protobuf:"bytes,2,opt,name=flow,proto3" json:"flow,omitempty"` Scopes *Oauth2Scopes `protobuf:"bytes,3,opt,name=scopes,proto3" json:"scopes,omitempty"` AuthorizationUrl string `protobuf:"bytes,4,opt,name=authorization_url,json=authorizationUrl,proto3" json:"authorization_url,omitempty"` TokenUrl string `protobuf:"bytes,5,opt,name=token_url,json=tokenUrl,proto3" json:"token_url,omitempty"` Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,7,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } func (x *Oauth2AccessCodeSecurity) Reset() { *x = Oauth2AccessCodeSecurity{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Oauth2AccessCodeSecurity) String() string { return protoimpl.X.MessageStringOf(x) } func (*Oauth2AccessCodeSecurity) ProtoMessage() {} func (x *Oauth2AccessCodeSecurity) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Oauth2AccessCodeSecurity.ProtoReflect.Descriptor instead. func (*Oauth2AccessCodeSecurity) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{31} } func (x *Oauth2AccessCodeSecurity) GetType() string { if x != nil { return x.Type } return "" } func (x *Oauth2AccessCodeSecurity) GetFlow() string { if x != nil { return x.Flow } return "" } func (x *Oauth2AccessCodeSecurity) GetScopes() *Oauth2Scopes { if x != nil { return x.Scopes } return nil } func (x *Oauth2AccessCodeSecurity) GetAuthorizationUrl() string { if x != nil { return x.AuthorizationUrl } return "" } func (x *Oauth2AccessCodeSecurity) GetTokenUrl() string { if x != nil { return x.TokenUrl } return "" } func (x *Oauth2AccessCodeSecurity) GetDescription() string { if x != nil { return x.Description } return "" } func (x *Oauth2AccessCodeSecurity) GetVendorExtension() []*NamedAny { if x != nil { return x.VendorExtension } return nil } type Oauth2ApplicationSecurity struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` Flow string `protobuf:"bytes,2,opt,name=flow,proto3" json:"flow,omitempty"` Scopes *Oauth2Scopes `protobuf:"bytes,3,opt,name=scopes,proto3" json:"scopes,omitempty"` TokenUrl string `protobuf:"bytes,4,opt,name=token_url,json=tokenUrl,proto3" json:"token_url,omitempty"` Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } func (x *Oauth2ApplicationSecurity) Reset() { *x = Oauth2ApplicationSecurity{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Oauth2ApplicationSecurity) String() string { return protoimpl.X.MessageStringOf(x) } func (*Oauth2ApplicationSecurity) ProtoMessage() {} func (x *Oauth2ApplicationSecurity) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Oauth2ApplicationSecurity.ProtoReflect.Descriptor instead. func (*Oauth2ApplicationSecurity) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{32} } func (x *Oauth2ApplicationSecurity) GetType() string { if x != nil { return x.Type } return "" } func (x *Oauth2ApplicationSecurity) GetFlow() string { if x != nil { return x.Flow } return "" } func (x *Oauth2ApplicationSecurity) GetScopes() *Oauth2Scopes { if x != nil { return x.Scopes } return nil } func (x *Oauth2ApplicationSecurity) GetTokenUrl() string { if x != nil { return x.TokenUrl } return "" } func (x *Oauth2ApplicationSecurity) GetDescription() string { if x != nil { return x.Description } return "" } func (x *Oauth2ApplicationSecurity) GetVendorExtension() []*NamedAny { if x != nil { return x.VendorExtension } return nil } type Oauth2ImplicitSecurity struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` Flow string `protobuf:"bytes,2,opt,name=flow,proto3" json:"flow,omitempty"` Scopes *Oauth2Scopes `protobuf:"bytes,3,opt,name=scopes,proto3" json:"scopes,omitempty"` AuthorizationUrl string `protobuf:"bytes,4,opt,name=authorization_url,json=authorizationUrl,proto3" json:"authorization_url,omitempty"` Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } func (x *Oauth2ImplicitSecurity) Reset() { *x = Oauth2ImplicitSecurity{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Oauth2ImplicitSecurity) String() string { return protoimpl.X.MessageStringOf(x) } func (*Oauth2ImplicitSecurity) ProtoMessage() {} func (x *Oauth2ImplicitSecurity) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Oauth2ImplicitSecurity.ProtoReflect.Descriptor instead. func (*Oauth2ImplicitSecurity) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{33} } func (x *Oauth2ImplicitSecurity) GetType() string { if x != nil { return x.Type } return "" } func (x *Oauth2ImplicitSecurity) GetFlow() string { if x != nil { return x.Flow } return "" } func (x *Oauth2ImplicitSecurity) GetScopes() *Oauth2Scopes { if x != nil { return x.Scopes } return nil } func (x *Oauth2ImplicitSecurity) GetAuthorizationUrl() string { if x != nil { return x.AuthorizationUrl } return "" } func (x *Oauth2ImplicitSecurity) GetDescription() string { if x != nil { return x.Description } return "" } func (x *Oauth2ImplicitSecurity) GetVendorExtension() []*NamedAny { if x != nil { return x.VendorExtension } return nil } type Oauth2PasswordSecurity struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` Flow string `protobuf:"bytes,2,opt,name=flow,proto3" json:"flow,omitempty"` Scopes *Oauth2Scopes `protobuf:"bytes,3,opt,name=scopes,proto3" json:"scopes,omitempty"` TokenUrl string `protobuf:"bytes,4,opt,name=token_url,json=tokenUrl,proto3" json:"token_url,omitempty"` Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } func (x *Oauth2PasswordSecurity) Reset() { *x = Oauth2PasswordSecurity{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Oauth2PasswordSecurity) String() string { return protoimpl.X.MessageStringOf(x) } func (*Oauth2PasswordSecurity) ProtoMessage() {} func (x *Oauth2PasswordSecurity) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Oauth2PasswordSecurity.ProtoReflect.Descriptor instead. func (*Oauth2PasswordSecurity) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{34} } func (x *Oauth2PasswordSecurity) GetType() string { if x != nil { return x.Type } return "" } func (x *Oauth2PasswordSecurity) GetFlow() string { if x != nil { return x.Flow } return "" } func (x *Oauth2PasswordSecurity) GetScopes() *Oauth2Scopes { if x != nil { return x.Scopes } return nil } func (x *Oauth2PasswordSecurity) GetTokenUrl() string { if x != nil { return x.TokenUrl } return "" } func (x *Oauth2PasswordSecurity) GetDescription() string { if x != nil { return x.Description } return "" } func (x *Oauth2PasswordSecurity) GetVendorExtension() []*NamedAny { if x != nil { return x.VendorExtension } return nil } type Oauth2Scopes struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields AdditionalProperties []*NamedString `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` } func (x *Oauth2Scopes) Reset() { *x = Oauth2Scopes{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Oauth2Scopes) String() string { return protoimpl.X.MessageStringOf(x) } func (*Oauth2Scopes) ProtoMessage() {} func (x *Oauth2Scopes) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[35] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Oauth2Scopes.ProtoReflect.Descriptor instead. func (*Oauth2Scopes) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{35} } func (x *Oauth2Scopes) GetAdditionalProperties() []*NamedString { if x != nil { return x.AdditionalProperties } return nil } type Operation struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Tags []string `protobuf:"bytes,1,rep,name=tags,proto3" json:"tags,omitempty"` // A brief summary of the operation. Summary string `protobuf:"bytes,2,opt,name=summary,proto3" json:"summary,omitempty"` // A longer description of the operation, GitHub Flavored Markdown is allowed. Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` ExternalDocs *ExternalDocs `protobuf:"bytes,4,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"` // A unique identifier of the operation. OperationId string `protobuf:"bytes,5,opt,name=operation_id,json=operationId,proto3" json:"operation_id,omitempty"` // A list of MIME types the API can produce. Produces []string `protobuf:"bytes,6,rep,name=produces,proto3" json:"produces,omitempty"` // A list of MIME types the API can consume. Consumes []string `protobuf:"bytes,7,rep,name=consumes,proto3" json:"consumes,omitempty"` // The parameters needed to send a valid API call. Parameters []*ParametersItem `protobuf:"bytes,8,rep,name=parameters,proto3" json:"parameters,omitempty"` Responses *Responses `protobuf:"bytes,9,opt,name=responses,proto3" json:"responses,omitempty"` // The transfer protocol of the API. Schemes []string `protobuf:"bytes,10,rep,name=schemes,proto3" json:"schemes,omitempty"` Deprecated bool `protobuf:"varint,11,opt,name=deprecated,proto3" json:"deprecated,omitempty"` Security []*SecurityRequirement `protobuf:"bytes,12,rep,name=security,proto3" json:"security,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,13,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } func (x *Operation) Reset() { *x = Operation{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Operation) String() string { return protoimpl.X.MessageStringOf(x) } func (*Operation) ProtoMessage() {} func (x *Operation) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[36] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Operation.ProtoReflect.Descriptor instead. func (*Operation) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{36} } func (x *Operation) GetTags() []string { if x != nil { return x.Tags } return nil } func (x *Operation) GetSummary() string { if x != nil { return x.Summary } return "" } func (x *Operation) GetDescription() string { if x != nil { return x.Description } return "" } func (x *Operation) GetExternalDocs() *ExternalDocs { if x != nil { return x.ExternalDocs } return nil } func (x *Operation) GetOperationId() string { if x != nil { return x.OperationId } return "" } func (x *Operation) GetProduces() []string { if x != nil { return x.Produces } return nil } func (x *Operation) GetConsumes() []string { if x != nil { return x.Consumes } return nil } func (x *Operation) GetParameters() []*ParametersItem { if x != nil { return x.Parameters } return nil } func (x *Operation) GetResponses() *Responses { if x != nil { return x.Responses } return nil } func (x *Operation) GetSchemes() []string { if x != nil { return x.Schemes } return nil } func (x *Operation) GetDeprecated() bool { if x != nil { return x.Deprecated } return false } func (x *Operation) GetSecurity() []*SecurityRequirement { if x != nil { return x.Security } return nil } func (x *Operation) GetVendorExtension() []*NamedAny { if x != nil { return x.VendorExtension } return nil } type Parameter struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Types that are assignable to Oneof: // *Parameter_BodyParameter // *Parameter_NonBodyParameter Oneof isParameter_Oneof `protobuf_oneof:"oneof"` } func (x *Parameter) Reset() { *x = Parameter{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Parameter) String() string { return protoimpl.X.MessageStringOf(x) } func (*Parameter) ProtoMessage() {} func (x *Parameter) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[37] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Parameter.ProtoReflect.Descriptor instead. func (*Parameter) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{37} } func (m *Parameter) GetOneof() isParameter_Oneof { if m != nil { return m.Oneof } return nil } func (x *Parameter) GetBodyParameter() *BodyParameter { if x, ok := x.GetOneof().(*Parameter_BodyParameter); ok { return x.BodyParameter } return nil } func (x *Parameter) GetNonBodyParameter() *NonBodyParameter { if x, ok := x.GetOneof().(*Parameter_NonBodyParameter); ok { return x.NonBodyParameter } return nil } type isParameter_Oneof interface { isParameter_Oneof() } type Parameter_BodyParameter struct { BodyParameter *BodyParameter `protobuf:"bytes,1,opt,name=body_parameter,json=bodyParameter,proto3,oneof"` } type Parameter_NonBodyParameter struct { NonBodyParameter *NonBodyParameter `protobuf:"bytes,2,opt,name=non_body_parameter,json=nonBodyParameter,proto3,oneof"` } func (*Parameter_BodyParameter) isParameter_Oneof() {} func (*Parameter_NonBodyParameter) isParameter_Oneof() {} // One or more JSON representations for parameters type ParameterDefinitions struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields AdditionalProperties []*NamedParameter `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` } func (x *ParameterDefinitions) Reset() { *x = ParameterDefinitions{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *ParameterDefinitions) String() string { return protoimpl.X.MessageStringOf(x) } func (*ParameterDefinitions) ProtoMessage() {} func (x *ParameterDefinitions) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[38] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use ParameterDefinitions.ProtoReflect.Descriptor instead. func (*ParameterDefinitions) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{38} } func (x *ParameterDefinitions) GetAdditionalProperties() []*NamedParameter { if x != nil { return x.AdditionalProperties } return nil } type ParametersItem struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Types that are assignable to Oneof: // *ParametersItem_Parameter // *ParametersItem_JsonReference Oneof isParametersItem_Oneof `protobuf_oneof:"oneof"` } func (x *ParametersItem) Reset() { *x = ParametersItem{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *ParametersItem) String() string { return protoimpl.X.MessageStringOf(x) } func (*ParametersItem) ProtoMessage() {} func (x *ParametersItem) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[39] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use ParametersItem.ProtoReflect.Descriptor instead. func (*ParametersItem) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{39} } func (m *ParametersItem) GetOneof() isParametersItem_Oneof { if m != nil { return m.Oneof } return nil } func (x *ParametersItem) GetParameter() *Parameter { if x, ok := x.GetOneof().(*ParametersItem_Parameter); ok { return x.Parameter } return nil } func (x *ParametersItem) GetJsonReference() *JsonReference { if x, ok := x.GetOneof().(*ParametersItem_JsonReference); ok { return x.JsonReference } return nil } type isParametersItem_Oneof interface { isParametersItem_Oneof() } type ParametersItem_Parameter struct { Parameter *Parameter `protobuf:"bytes,1,opt,name=parameter,proto3,oneof"` } type ParametersItem_JsonReference struct { JsonReference *JsonReference `protobuf:"bytes,2,opt,name=json_reference,json=jsonReference,proto3,oneof"` } func (*ParametersItem_Parameter) isParametersItem_Oneof() {} func (*ParametersItem_JsonReference) isParametersItem_Oneof() {} type PathItem struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields XRef string `protobuf:"bytes,1,opt,name=_ref,json=Ref,proto3" json:"_ref,omitempty"` Get *Operation `protobuf:"bytes,2,opt,name=get,proto3" json:"get,omitempty"` Put *Operation `protobuf:"bytes,3,opt,name=put,proto3" json:"put,omitempty"` Post *Operation `protobuf:"bytes,4,opt,name=post,proto3" json:"post,omitempty"` Delete *Operation `protobuf:"bytes,5,opt,name=delete,proto3" json:"delete,omitempty"` Options *Operation `protobuf:"bytes,6,opt,name=options,proto3" json:"options,omitempty"` Head *Operation `protobuf:"bytes,7,opt,name=head,proto3" json:"head,omitempty"` Patch *Operation `protobuf:"bytes,8,opt,name=patch,proto3" json:"patch,omitempty"` // The parameters needed to send a valid API call. Parameters []*ParametersItem `protobuf:"bytes,9,rep,name=parameters,proto3" json:"parameters,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,10,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } func (x *PathItem) Reset() { *x = PathItem{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *PathItem) String() string { return protoimpl.X.MessageStringOf(x) } func (*PathItem) ProtoMessage() {} func (x *PathItem) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[40] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use PathItem.ProtoReflect.Descriptor instead. func (*PathItem) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{40} } func (x *PathItem) GetXRef() string { if x != nil { return x.XRef } return "" } func (x *PathItem) GetGet() *Operation { if x != nil { return x.Get } return nil } func (x *PathItem) GetPut() *Operation { if x != nil { return x.Put } return nil } func (x *PathItem) GetPost() *Operation { if x != nil { return x.Post } return nil } func (x *PathItem) GetDelete() *Operation { if x != nil { return x.Delete } return nil } func (x *PathItem) GetOptions() *Operation { if x != nil { return x.Options } return nil } func (x *PathItem) GetHead() *Operation { if x != nil { return x.Head } return nil } func (x *PathItem) GetPatch() *Operation { if x != nil { return x.Patch } return nil } func (x *PathItem) GetParameters() []*ParametersItem { if x != nil { return x.Parameters } return nil } func (x *PathItem) GetVendorExtension() []*NamedAny { if x != nil { return x.VendorExtension } return nil } type PathParameterSubSchema struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Determines whether or not this parameter is required or optional. Required bool `protobuf:"varint,1,opt,name=required,proto3" json:"required,omitempty"` // Determines the location of the parameter. In string `protobuf:"bytes,2,opt,name=in,proto3" json:"in,omitempty"` // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` // The name of the parameter. Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` Type string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"` Format string `protobuf:"bytes,6,opt,name=format,proto3" json:"format,omitempty"` Items *PrimitivesItems `protobuf:"bytes,7,opt,name=items,proto3" json:"items,omitempty"` CollectionFormat string `protobuf:"bytes,8,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"` Default *Any `protobuf:"bytes,9,opt,name=default,proto3" json:"default,omitempty"` Maximum float64 `protobuf:"fixed64,10,opt,name=maximum,proto3" json:"maximum,omitempty"` ExclusiveMaximum bool `protobuf:"varint,11,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` Minimum float64 `protobuf:"fixed64,12,opt,name=minimum,proto3" json:"minimum,omitempty"` ExclusiveMinimum bool `protobuf:"varint,13,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` MaxLength int64 `protobuf:"varint,14,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` MinLength int64 `protobuf:"varint,15,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` Pattern string `protobuf:"bytes,16,opt,name=pattern,proto3" json:"pattern,omitempty"` MaxItems int64 `protobuf:"varint,17,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` MinItems int64 `protobuf:"varint,18,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` UniqueItems bool `protobuf:"varint,19,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` Enum []*Any `protobuf:"bytes,20,rep,name=enum,proto3" json:"enum,omitempty"` MultipleOf float64 `protobuf:"fixed64,21,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,22,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } func (x *PathParameterSubSchema) Reset() { *x = PathParameterSubSchema{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *PathParameterSubSchema) String() string { return protoimpl.X.MessageStringOf(x) } func (*PathParameterSubSchema) ProtoMessage() {} func (x *PathParameterSubSchema) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[41] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use PathParameterSubSchema.ProtoReflect.Descriptor instead. func (*PathParameterSubSchema) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{41} } func (x *PathParameterSubSchema) GetRequired() bool { if x != nil { return x.Required } return false } func (x *PathParameterSubSchema) GetIn() string { if x != nil { return x.In } return "" } func (x *PathParameterSubSchema) GetDescription() string { if x != nil { return x.Description } return "" } func (x *PathParameterSubSchema) GetName() string { if x != nil { return x.Name } return "" } func (x *PathParameterSubSchema) GetType() string { if x != nil { return x.Type } return "" } func (x *PathParameterSubSchema) GetFormat() string { if x != nil { return x.Format } return "" } func (x *PathParameterSubSchema) GetItems() *PrimitivesItems { if x != nil { return x.Items } return nil } func (x *PathParameterSubSchema) GetCollectionFormat() string { if x != nil { return x.CollectionFormat } return "" } func (x *PathParameterSubSchema) GetDefault() *Any { if x != nil { return x.Default } return nil } func (x *PathParameterSubSchema) GetMaximum() float64 { if x != nil { return x.Maximum } return 0 } func (x *PathParameterSubSchema) GetExclusiveMaximum() bool { if x != nil { return x.ExclusiveMaximum } return false } func (x *PathParameterSubSchema) GetMinimum() float64 { if x != nil { return x.Minimum } return 0 } func (x *PathParameterSubSchema) GetExclusiveMinimum() bool { if x != nil { return x.ExclusiveMinimum } return false } func (x *PathParameterSubSchema) GetMaxLength() int64 { if x != nil { return x.MaxLength } return 0 } func (x *PathParameterSubSchema) GetMinLength() int64 { if x != nil { return x.MinLength } return 0 } func (x *PathParameterSubSchema) GetPattern() string { if x != nil { return x.Pattern } return "" } func (x *PathParameterSubSchema) GetMaxItems() int64 { if x != nil { return x.MaxItems } return 0 } func (x *PathParameterSubSchema) GetMinItems() int64 { if x != nil { return x.MinItems } return 0 } func (x *PathParameterSubSchema) GetUniqueItems() bool { if x != nil { return x.UniqueItems } return false } func (x *PathParameterSubSchema) GetEnum() []*Any { if x != nil { return x.Enum } return nil } func (x *PathParameterSubSchema) GetMultipleOf() float64 { if x != nil { return x.MultipleOf } return 0 } func (x *PathParameterSubSchema) GetVendorExtension() []*NamedAny { if x != nil { return x.VendorExtension } return nil } // Relative paths to the individual endpoints. They must be relative to the 'basePath'. type Paths struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields VendorExtension []*NamedAny `protobuf:"bytes,1,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` Path []*NamedPathItem `protobuf:"bytes,2,rep,name=path,proto3" json:"path,omitempty"` } func (x *Paths) Reset() { *x = Paths{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Paths) String() string { return protoimpl.X.MessageStringOf(x) } func (*Paths) ProtoMessage() {} func (x *Paths) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[42] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Paths.ProtoReflect.Descriptor instead. func (*Paths) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{42} } func (x *Paths) GetVendorExtension() []*NamedAny { if x != nil { return x.VendorExtension } return nil } func (x *Paths) GetPath() []*NamedPathItem { if x != nil { return x.Path } return nil } type PrimitivesItems struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` Format string `protobuf:"bytes,2,opt,name=format,proto3" json:"format,omitempty"` Items *PrimitivesItems `protobuf:"bytes,3,opt,name=items,proto3" json:"items,omitempty"` CollectionFormat string `protobuf:"bytes,4,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"` Default *Any `protobuf:"bytes,5,opt,name=default,proto3" json:"default,omitempty"` Maximum float64 `protobuf:"fixed64,6,opt,name=maximum,proto3" json:"maximum,omitempty"` ExclusiveMaximum bool `protobuf:"varint,7,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` Minimum float64 `protobuf:"fixed64,8,opt,name=minimum,proto3" json:"minimum,omitempty"` ExclusiveMinimum bool `protobuf:"varint,9,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` MaxLength int64 `protobuf:"varint,10,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` MinLength int64 `protobuf:"varint,11,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` Pattern string `protobuf:"bytes,12,opt,name=pattern,proto3" json:"pattern,omitempty"` MaxItems int64 `protobuf:"varint,13,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` MinItems int64 `protobuf:"varint,14,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` UniqueItems bool `protobuf:"varint,15,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` Enum []*Any `protobuf:"bytes,16,rep,name=enum,proto3" json:"enum,omitempty"` MultipleOf float64 `protobuf:"fixed64,17,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,18,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } func (x *PrimitivesItems) Reset() { *x = PrimitivesItems{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *PrimitivesItems) String() string { return protoimpl.X.MessageStringOf(x) } func (*PrimitivesItems) ProtoMessage() {} func (x *PrimitivesItems) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[43] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use PrimitivesItems.ProtoReflect.Descriptor instead. func (*PrimitivesItems) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{43} } func (x *PrimitivesItems) GetType() string { if x != nil { return x.Type } return "" } func (x *PrimitivesItems) GetFormat() string { if x != nil { return x.Format } return "" } func (x *PrimitivesItems) GetItems() *PrimitivesItems { if x != nil { return x.Items } return nil } func (x *PrimitivesItems) GetCollectionFormat() string { if x != nil { return x.CollectionFormat } return "" } func (x *PrimitivesItems) GetDefault() *Any { if x != nil { return x.Default } return nil } func (x *PrimitivesItems) GetMaximum() float64 { if x != nil { return x.Maximum } return 0 } func (x *PrimitivesItems) GetExclusiveMaximum() bool { if x != nil { return x.ExclusiveMaximum } return false } func (x *PrimitivesItems) GetMinimum() float64 { if x != nil { return x.Minimum } return 0 } func (x *PrimitivesItems) GetExclusiveMinimum() bool { if x != nil { return x.ExclusiveMinimum } return false } func (x *PrimitivesItems) GetMaxLength() int64 { if x != nil { return x.MaxLength } return 0 } func (x *PrimitivesItems) GetMinLength() int64 { if x != nil { return x.MinLength } return 0 } func (x *PrimitivesItems) GetPattern() string { if x != nil { return x.Pattern } return "" } func (x *PrimitivesItems) GetMaxItems() int64 { if x != nil { return x.MaxItems } return 0 } func (x *PrimitivesItems) GetMinItems() int64 { if x != nil { return x.MinItems } return 0 } func (x *PrimitivesItems) GetUniqueItems() bool { if x != nil { return x.UniqueItems } return false } func (x *PrimitivesItems) GetEnum() []*Any { if x != nil { return x.Enum } return nil } func (x *PrimitivesItems) GetMultipleOf() float64 { if x != nil { return x.MultipleOf } return 0 } func (x *PrimitivesItems) GetVendorExtension() []*NamedAny { if x != nil { return x.VendorExtension } return nil } type Properties struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields AdditionalProperties []*NamedSchema `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` } func (x *Properties) Reset() { *x = Properties{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Properties) String() string { return protoimpl.X.MessageStringOf(x) } func (*Properties) ProtoMessage() {} func (x *Properties) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[44] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Properties.ProtoReflect.Descriptor instead. func (*Properties) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{44} } func (x *Properties) GetAdditionalProperties() []*NamedSchema { if x != nil { return x.AdditionalProperties } return nil } type QueryParameterSubSchema struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Determines whether or not this parameter is required or optional. Required bool `protobuf:"varint,1,opt,name=required,proto3" json:"required,omitempty"` // Determines the location of the parameter. In string `protobuf:"bytes,2,opt,name=in,proto3" json:"in,omitempty"` // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` // The name of the parameter. Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` // allows sending a parameter by name only or with an empty value. AllowEmptyValue bool `protobuf:"varint,5,opt,name=allow_empty_value,json=allowEmptyValue,proto3" json:"allow_empty_value,omitempty"` Type string `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"` Format string `protobuf:"bytes,7,opt,name=format,proto3" json:"format,omitempty"` Items *PrimitivesItems `protobuf:"bytes,8,opt,name=items,proto3" json:"items,omitempty"` CollectionFormat string `protobuf:"bytes,9,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"` Default *Any `protobuf:"bytes,10,opt,name=default,proto3" json:"default,omitempty"` Maximum float64 `protobuf:"fixed64,11,opt,name=maximum,proto3" json:"maximum,omitempty"` ExclusiveMaximum bool `protobuf:"varint,12,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` Minimum float64 `protobuf:"fixed64,13,opt,name=minimum,proto3" json:"minimum,omitempty"` ExclusiveMinimum bool `protobuf:"varint,14,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` MaxLength int64 `protobuf:"varint,15,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` MinLength int64 `protobuf:"varint,16,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` Pattern string `protobuf:"bytes,17,opt,name=pattern,proto3" json:"pattern,omitempty"` MaxItems int64 `protobuf:"varint,18,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` MinItems int64 `protobuf:"varint,19,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` UniqueItems bool `protobuf:"varint,20,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` Enum []*Any `protobuf:"bytes,21,rep,name=enum,proto3" json:"enum,omitempty"` MultipleOf float64 `protobuf:"fixed64,22,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,23,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } func (x *QueryParameterSubSchema) Reset() { *x = QueryParameterSubSchema{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *QueryParameterSubSchema) String() string { return protoimpl.X.MessageStringOf(x) } func (*QueryParameterSubSchema) ProtoMessage() {} func (x *QueryParameterSubSchema) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[45] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use QueryParameterSubSchema.ProtoReflect.Descriptor instead. func (*QueryParameterSubSchema) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{45} } func (x *QueryParameterSubSchema) GetRequired() bool { if x != nil { return x.Required } return false } func (x *QueryParameterSubSchema) GetIn() string { if x != nil { return x.In } return "" } func (x *QueryParameterSubSchema) GetDescription() string { if x != nil { return x.Description } return "" } func (x *QueryParameterSubSchema) GetName() string { if x != nil { return x.Name } return "" } func (x *QueryParameterSubSchema) GetAllowEmptyValue() bool { if x != nil { return x.AllowEmptyValue } return false } func (x *QueryParameterSubSchema) GetType() string { if x != nil { return x.Type } return "" } func (x *QueryParameterSubSchema) GetFormat() string { if x != nil { return x.Format } return "" } func (x *QueryParameterSubSchema) GetItems() *PrimitivesItems { if x != nil { return x.Items } return nil } func (x *QueryParameterSubSchema) GetCollectionFormat() string { if x != nil { return x.CollectionFormat } return "" } func (x *QueryParameterSubSchema) GetDefault() *Any { if x != nil { return x.Default } return nil } func (x *QueryParameterSubSchema) GetMaximum() float64 { if x != nil { return x.Maximum } return 0 } func (x *QueryParameterSubSchema) GetExclusiveMaximum() bool { if x != nil { return x.ExclusiveMaximum } return false } func (x *QueryParameterSubSchema) GetMinimum() float64 { if x != nil { return x.Minimum } return 0 } func (x *QueryParameterSubSchema) GetExclusiveMinimum() bool { if x != nil { return x.ExclusiveMinimum } return false } func (x *QueryParameterSubSchema) GetMaxLength() int64 { if x != nil { return x.MaxLength } return 0 } func (x *QueryParameterSubSchema) GetMinLength() int64 { if x != nil { return x.MinLength } return 0 } func (x *QueryParameterSubSchema) GetPattern() string { if x != nil { return x.Pattern } return "" } func (x *QueryParameterSubSchema) GetMaxItems() int64 { if x != nil { return x.MaxItems } return 0 } func (x *QueryParameterSubSchema) GetMinItems() int64 { if x != nil { return x.MinItems } return 0 } func (x *QueryParameterSubSchema) GetUniqueItems() bool { if x != nil { return x.UniqueItems } return false } func (x *QueryParameterSubSchema) GetEnum() []*Any { if x != nil { return x.Enum } return nil } func (x *QueryParameterSubSchema) GetMultipleOf() float64 { if x != nil { return x.MultipleOf } return 0 } func (x *QueryParameterSubSchema) GetVendorExtension() []*NamedAny { if x != nil { return x.VendorExtension } return nil } type Response struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` Schema *SchemaItem `protobuf:"bytes,2,opt,name=schema,proto3" json:"schema,omitempty"` Headers *Headers `protobuf:"bytes,3,opt,name=headers,proto3" json:"headers,omitempty"` Examples *Examples `protobuf:"bytes,4,opt,name=examples,proto3" json:"examples,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,5,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } func (x *Response) Reset() { *x = Response{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Response) String() string { return protoimpl.X.MessageStringOf(x) } func (*Response) ProtoMessage() {} func (x *Response) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[46] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Response.ProtoReflect.Descriptor instead. func (*Response) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{46} } func (x *Response) GetDescription() string { if x != nil { return x.Description } return "" } func (x *Response) GetSchema() *SchemaItem { if x != nil { return x.Schema } return nil } func (x *Response) GetHeaders() *Headers { if x != nil { return x.Headers } return nil } func (x *Response) GetExamples() *Examples { if x != nil { return x.Examples } return nil } func (x *Response) GetVendorExtension() []*NamedAny { if x != nil { return x.VendorExtension } return nil } // One or more JSON representations for responses type ResponseDefinitions struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields AdditionalProperties []*NamedResponse `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` } func (x *ResponseDefinitions) Reset() { *x = ResponseDefinitions{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *ResponseDefinitions) String() string { return protoimpl.X.MessageStringOf(x) } func (*ResponseDefinitions) ProtoMessage() {} func (x *ResponseDefinitions) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[47] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use ResponseDefinitions.ProtoReflect.Descriptor instead. func (*ResponseDefinitions) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{47} } func (x *ResponseDefinitions) GetAdditionalProperties() []*NamedResponse { if x != nil { return x.AdditionalProperties } return nil } type ResponseValue struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Types that are assignable to Oneof: // *ResponseValue_Response // *ResponseValue_JsonReference Oneof isResponseValue_Oneof `protobuf_oneof:"oneof"` } func (x *ResponseValue) Reset() { *x = ResponseValue{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[48] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *ResponseValue) String() string { return protoimpl.X.MessageStringOf(x) } func (*ResponseValue) ProtoMessage() {} func (x *ResponseValue) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[48] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use ResponseValue.ProtoReflect.Descriptor instead. func (*ResponseValue) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{48} } func (m *ResponseValue) GetOneof() isResponseValue_Oneof { if m != nil { return m.Oneof } return nil } func (x *ResponseValue) GetResponse() *Response { if x, ok := x.GetOneof().(*ResponseValue_Response); ok { return x.Response } return nil } func (x *ResponseValue) GetJsonReference() *JsonReference { if x, ok := x.GetOneof().(*ResponseValue_JsonReference); ok { return x.JsonReference } return nil } type isResponseValue_Oneof interface { isResponseValue_Oneof() } type ResponseValue_Response struct { Response *Response `protobuf:"bytes,1,opt,name=response,proto3,oneof"` } type ResponseValue_JsonReference struct { JsonReference *JsonReference `protobuf:"bytes,2,opt,name=json_reference,json=jsonReference,proto3,oneof"` } func (*ResponseValue_Response) isResponseValue_Oneof() {} func (*ResponseValue_JsonReference) isResponseValue_Oneof() {} // Response objects names can either be any valid HTTP status code or 'default'. type Responses struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields ResponseCode []*NamedResponseValue `protobuf:"bytes,1,rep,name=response_code,json=responseCode,proto3" json:"response_code,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,2,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } func (x *Responses) Reset() { *x = Responses{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[49] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Responses) String() string { return protoimpl.X.MessageStringOf(x) } func (*Responses) ProtoMessage() {} func (x *Responses) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[49] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Responses.ProtoReflect.Descriptor instead. func (*Responses) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{49} } func (x *Responses) GetResponseCode() []*NamedResponseValue { if x != nil { return x.ResponseCode } return nil } func (x *Responses) GetVendorExtension() []*NamedAny { if x != nil { return x.VendorExtension } return nil } // A deterministic version of a JSON Schema object. type Schema struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields XRef string `protobuf:"bytes,1,opt,name=_ref,json=Ref,proto3" json:"_ref,omitempty"` Format string `protobuf:"bytes,2,opt,name=format,proto3" json:"format,omitempty"` Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` Default *Any `protobuf:"bytes,5,opt,name=default,proto3" json:"default,omitempty"` MultipleOf float64 `protobuf:"fixed64,6,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` Maximum float64 `protobuf:"fixed64,7,opt,name=maximum,proto3" json:"maximum,omitempty"` ExclusiveMaximum bool `protobuf:"varint,8,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` Minimum float64 `protobuf:"fixed64,9,opt,name=minimum,proto3" json:"minimum,omitempty"` ExclusiveMinimum bool `protobuf:"varint,10,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` MaxLength int64 `protobuf:"varint,11,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` MinLength int64 `protobuf:"varint,12,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` Pattern string `protobuf:"bytes,13,opt,name=pattern,proto3" json:"pattern,omitempty"` MaxItems int64 `protobuf:"varint,14,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` MinItems int64 `protobuf:"varint,15,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` UniqueItems bool `protobuf:"varint,16,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` MaxProperties int64 `protobuf:"varint,17,opt,name=max_properties,json=maxProperties,proto3" json:"max_properties,omitempty"` MinProperties int64 `protobuf:"varint,18,opt,name=min_properties,json=minProperties,proto3" json:"min_properties,omitempty"` Required []string `protobuf:"bytes,19,rep,name=required,proto3" json:"required,omitempty"` Enum []*Any `protobuf:"bytes,20,rep,name=enum,proto3" json:"enum,omitempty"` AdditionalProperties *AdditionalPropertiesItem `protobuf:"bytes,21,opt,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` Type *TypeItem `protobuf:"bytes,22,opt,name=type,proto3" json:"type,omitempty"` Items *ItemsItem `protobuf:"bytes,23,opt,name=items,proto3" json:"items,omitempty"` AllOf []*Schema `protobuf:"bytes,24,rep,name=all_of,json=allOf,proto3" json:"all_of,omitempty"` Properties *Properties `protobuf:"bytes,25,opt,name=properties,proto3" json:"properties,omitempty"` Discriminator string `protobuf:"bytes,26,opt,name=discriminator,proto3" json:"discriminator,omitempty"` ReadOnly bool `protobuf:"varint,27,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"` Xml *Xml `protobuf:"bytes,28,opt,name=xml,proto3" json:"xml,omitempty"` ExternalDocs *ExternalDocs `protobuf:"bytes,29,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"` Example *Any `protobuf:"bytes,30,opt,name=example,proto3" json:"example,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,31,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } func (x *Schema) Reset() { *x = Schema{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[50] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Schema) String() string { return protoimpl.X.MessageStringOf(x) } func (*Schema) ProtoMessage() {} func (x *Schema) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[50] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Schema.ProtoReflect.Descriptor instead. func (*Schema) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{50} } func (x *Schema) GetXRef() string { if x != nil { return x.XRef } return "" } func (x *Schema) GetFormat() string { if x != nil { return x.Format } return "" } func (x *Schema) GetTitle() string { if x != nil { return x.Title } return "" } func (x *Schema) GetDescription() string { if x != nil { return x.Description } return "" } func (x *Schema) GetDefault() *Any { if x != nil { return x.Default } return nil } func (x *Schema) GetMultipleOf() float64 { if x != nil { return x.MultipleOf } return 0 } func (x *Schema) GetMaximum() float64 { if x != nil { return x.Maximum } return 0 } func (x *Schema) GetExclusiveMaximum() bool { if x != nil { return x.ExclusiveMaximum } return false } func (x *Schema) GetMinimum() float64 { if x != nil { return x.Minimum } return 0 } func (x *Schema) GetExclusiveMinimum() bool { if x != nil { return x.ExclusiveMinimum } return false } func (x *Schema) GetMaxLength() int64 { if x != nil { return x.MaxLength } return 0 } func (x *Schema) GetMinLength() int64 { if x != nil { return x.MinLength } return 0 } func (x *Schema) GetPattern() string { if x != nil { return x.Pattern } return "" } func (x *Schema) GetMaxItems() int64 { if x != nil { return x.MaxItems } return 0 } func (x *Schema) GetMinItems() int64 { if x != nil { return x.MinItems } return 0 } func (x *Schema) GetUniqueItems() bool { if x != nil { return x.UniqueItems } return false } func (x *Schema) GetMaxProperties() int64 { if x != nil { return x.MaxProperties } return 0 } func (x *Schema) GetMinProperties() int64 { if x != nil { return x.MinProperties } return 0 } func (x *Schema) GetRequired() []string { if x != nil { return x.Required } return nil } func (x *Schema) GetEnum() []*Any { if x != nil { return x.Enum } return nil } func (x *Schema) GetAdditionalProperties() *AdditionalPropertiesItem { if x != nil { return x.AdditionalProperties } return nil } func (x *Schema) GetType() *TypeItem { if x != nil { return x.Type } return nil } func (x *Schema) GetItems() *ItemsItem { if x != nil { return x.Items } return nil } func (x *Schema) GetAllOf() []*Schema { if x != nil { return x.AllOf } return nil } func (x *Schema) GetProperties() *Properties { if x != nil { return x.Properties } return nil } func (x *Schema) GetDiscriminator() string { if x != nil { return x.Discriminator } return "" } func (x *Schema) GetReadOnly() bool { if x != nil { return x.ReadOnly } return false } func (x *Schema) GetXml() *Xml { if x != nil { return x.Xml } return nil } func (x *Schema) GetExternalDocs() *ExternalDocs { if x != nil { return x.ExternalDocs } return nil } func (x *Schema) GetExample() *Any { if x != nil { return x.Example } return nil } func (x *Schema) GetVendorExtension() []*NamedAny { if x != nil { return x.VendorExtension } return nil } type SchemaItem struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Types that are assignable to Oneof: // *SchemaItem_Schema // *SchemaItem_FileSchema Oneof isSchemaItem_Oneof `protobuf_oneof:"oneof"` } func (x *SchemaItem) Reset() { *x = SchemaItem{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[51] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *SchemaItem) String() string { return protoimpl.X.MessageStringOf(x) } func (*SchemaItem) ProtoMessage() {} func (x *SchemaItem) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[51] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use SchemaItem.ProtoReflect.Descriptor instead. func (*SchemaItem) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{51} } func (m *SchemaItem) GetOneof() isSchemaItem_Oneof { if m != nil { return m.Oneof } return nil } func (x *SchemaItem) GetSchema() *Schema { if x, ok := x.GetOneof().(*SchemaItem_Schema); ok { return x.Schema } return nil } func (x *SchemaItem) GetFileSchema() *FileSchema { if x, ok := x.GetOneof().(*SchemaItem_FileSchema); ok { return x.FileSchema } return nil } type isSchemaItem_Oneof interface { isSchemaItem_Oneof() } type SchemaItem_Schema struct { Schema *Schema `protobuf:"bytes,1,opt,name=schema,proto3,oneof"` } type SchemaItem_FileSchema struct { FileSchema *FileSchema `protobuf:"bytes,2,opt,name=file_schema,json=fileSchema,proto3,oneof"` } func (*SchemaItem_Schema) isSchemaItem_Oneof() {} func (*SchemaItem_FileSchema) isSchemaItem_Oneof() {} type SecurityDefinitions struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields AdditionalProperties []*NamedSecurityDefinitionsItem `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` } func (x *SecurityDefinitions) Reset() { *x = SecurityDefinitions{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[52] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *SecurityDefinitions) String() string { return protoimpl.X.MessageStringOf(x) } func (*SecurityDefinitions) ProtoMessage() {} func (x *SecurityDefinitions) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[52] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use SecurityDefinitions.ProtoReflect.Descriptor instead. func (*SecurityDefinitions) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{52} } func (x *SecurityDefinitions) GetAdditionalProperties() []*NamedSecurityDefinitionsItem { if x != nil { return x.AdditionalProperties } return nil } type SecurityDefinitionsItem struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Types that are assignable to Oneof: // *SecurityDefinitionsItem_BasicAuthenticationSecurity // *SecurityDefinitionsItem_ApiKeySecurity // *SecurityDefinitionsItem_Oauth2ImplicitSecurity // *SecurityDefinitionsItem_Oauth2PasswordSecurity // *SecurityDefinitionsItem_Oauth2ApplicationSecurity // *SecurityDefinitionsItem_Oauth2AccessCodeSecurity Oneof isSecurityDefinitionsItem_Oneof `protobuf_oneof:"oneof"` } func (x *SecurityDefinitionsItem) Reset() { *x = SecurityDefinitionsItem{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[53] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *SecurityDefinitionsItem) String() string { return protoimpl.X.MessageStringOf(x) } func (*SecurityDefinitionsItem) ProtoMessage() {} func (x *SecurityDefinitionsItem) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[53] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use SecurityDefinitionsItem.ProtoReflect.Descriptor instead. func (*SecurityDefinitionsItem) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{53} } func (m *SecurityDefinitionsItem) GetOneof() isSecurityDefinitionsItem_Oneof { if m != nil { return m.Oneof } return nil } func (x *SecurityDefinitionsItem) GetBasicAuthenticationSecurity() *BasicAuthenticationSecurity { if x, ok := x.GetOneof().(*SecurityDefinitionsItem_BasicAuthenticationSecurity); ok { return x.BasicAuthenticationSecurity } return nil } func (x *SecurityDefinitionsItem) GetApiKeySecurity() *ApiKeySecurity { if x, ok := x.GetOneof().(*SecurityDefinitionsItem_ApiKeySecurity); ok { return x.ApiKeySecurity } return nil } func (x *SecurityDefinitionsItem) GetOauth2ImplicitSecurity() *Oauth2ImplicitSecurity { if x, ok := x.GetOneof().(*SecurityDefinitionsItem_Oauth2ImplicitSecurity); ok { return x.Oauth2ImplicitSecurity } return nil } func (x *SecurityDefinitionsItem) GetOauth2PasswordSecurity() *Oauth2PasswordSecurity { if x, ok := x.GetOneof().(*SecurityDefinitionsItem_Oauth2PasswordSecurity); ok { return x.Oauth2PasswordSecurity } return nil } func (x *SecurityDefinitionsItem) GetOauth2ApplicationSecurity() *Oauth2ApplicationSecurity { if x, ok := x.GetOneof().(*SecurityDefinitionsItem_Oauth2ApplicationSecurity); ok { return x.Oauth2ApplicationSecurity } return nil } func (x *SecurityDefinitionsItem) GetOauth2AccessCodeSecurity() *Oauth2AccessCodeSecurity { if x, ok := x.GetOneof().(*SecurityDefinitionsItem_Oauth2AccessCodeSecurity); ok { return x.Oauth2AccessCodeSecurity } return nil } type isSecurityDefinitionsItem_Oneof interface { isSecurityDefinitionsItem_Oneof() } type SecurityDefinitionsItem_BasicAuthenticationSecurity struct { BasicAuthenticationSecurity *BasicAuthenticationSecurity `protobuf:"bytes,1,opt,name=basic_authentication_security,json=basicAuthenticationSecurity,proto3,oneof"` } type SecurityDefinitionsItem_ApiKeySecurity struct { ApiKeySecurity *ApiKeySecurity `protobuf:"bytes,2,opt,name=api_key_security,json=apiKeySecurity,proto3,oneof"` } type SecurityDefinitionsItem_Oauth2ImplicitSecurity struct { Oauth2ImplicitSecurity *Oauth2ImplicitSecurity `protobuf:"bytes,3,opt,name=oauth2_implicit_security,json=oauth2ImplicitSecurity,proto3,oneof"` } type SecurityDefinitionsItem_Oauth2PasswordSecurity struct { Oauth2PasswordSecurity *Oauth2PasswordSecurity `protobuf:"bytes,4,opt,name=oauth2_password_security,json=oauth2PasswordSecurity,proto3,oneof"` } type SecurityDefinitionsItem_Oauth2ApplicationSecurity struct { Oauth2ApplicationSecurity *Oauth2ApplicationSecurity `protobuf:"bytes,5,opt,name=oauth2_application_security,json=oauth2ApplicationSecurity,proto3,oneof"` } type SecurityDefinitionsItem_Oauth2AccessCodeSecurity struct { Oauth2AccessCodeSecurity *Oauth2AccessCodeSecurity `protobuf:"bytes,6,opt,name=oauth2_access_code_security,json=oauth2AccessCodeSecurity,proto3,oneof"` } func (*SecurityDefinitionsItem_BasicAuthenticationSecurity) isSecurityDefinitionsItem_Oneof() {} func (*SecurityDefinitionsItem_ApiKeySecurity) isSecurityDefinitionsItem_Oneof() {} func (*SecurityDefinitionsItem_Oauth2ImplicitSecurity) isSecurityDefinitionsItem_Oneof() {} func (*SecurityDefinitionsItem_Oauth2PasswordSecurity) isSecurityDefinitionsItem_Oneof() {} func (*SecurityDefinitionsItem_Oauth2ApplicationSecurity) isSecurityDefinitionsItem_Oneof() {} func (*SecurityDefinitionsItem_Oauth2AccessCodeSecurity) isSecurityDefinitionsItem_Oneof() {} type SecurityRequirement struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields AdditionalProperties []*NamedStringArray `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` } func (x *SecurityRequirement) Reset() { *x = SecurityRequirement{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[54] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *SecurityRequirement) String() string { return protoimpl.X.MessageStringOf(x) } func (*SecurityRequirement) ProtoMessage() {} func (x *SecurityRequirement) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[54] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use SecurityRequirement.ProtoReflect.Descriptor instead. func (*SecurityRequirement) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{54} } func (x *SecurityRequirement) GetAdditionalProperties() []*NamedStringArray { if x != nil { return x.AdditionalProperties } return nil } type StringArray struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Value []string `protobuf:"bytes,1,rep,name=value,proto3" json:"value,omitempty"` } func (x *StringArray) Reset() { *x = StringArray{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[55] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *StringArray) String() string { return protoimpl.X.MessageStringOf(x) } func (*StringArray) ProtoMessage() {} func (x *StringArray) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[55] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use StringArray.ProtoReflect.Descriptor instead. func (*StringArray) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{55} } func (x *StringArray) GetValue() []string { if x != nil { return x.Value } return nil } type Tag struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` ExternalDocs *ExternalDocs `protobuf:"bytes,3,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,4,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } func (x *Tag) Reset() { *x = Tag{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[56] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Tag) String() string { return protoimpl.X.MessageStringOf(x) } func (*Tag) ProtoMessage() {} func (x *Tag) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[56] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Tag.ProtoReflect.Descriptor instead. func (*Tag) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{56} } func (x *Tag) GetName() string { if x != nil { return x.Name } return "" } func (x *Tag) GetDescription() string { if x != nil { return x.Description } return "" } func (x *Tag) GetExternalDocs() *ExternalDocs { if x != nil { return x.ExternalDocs } return nil } func (x *Tag) GetVendorExtension() []*NamedAny { if x != nil { return x.VendorExtension } return nil } type TypeItem struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Value []string `protobuf:"bytes,1,rep,name=value,proto3" json:"value,omitempty"` } func (x *TypeItem) Reset() { *x = TypeItem{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[57] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *TypeItem) String() string { return protoimpl.X.MessageStringOf(x) } func (*TypeItem) ProtoMessage() {} func (x *TypeItem) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[57] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use TypeItem.ProtoReflect.Descriptor instead. func (*TypeItem) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{57} } func (x *TypeItem) GetValue() []string { if x != nil { return x.Value } return nil } // Any property starting with x- is valid. type VendorExtension struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields AdditionalProperties []*NamedAny `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` } func (x *VendorExtension) Reset() { *x = VendorExtension{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[58] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *VendorExtension) String() string { return protoimpl.X.MessageStringOf(x) } func (*VendorExtension) ProtoMessage() {} func (x *VendorExtension) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[58] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use VendorExtension.ProtoReflect.Descriptor instead. func (*VendorExtension) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{58} } func (x *VendorExtension) GetAdditionalProperties() []*NamedAny { if x != nil { return x.AdditionalProperties } return nil } type Xml struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` Prefix string `protobuf:"bytes,3,opt,name=prefix,proto3" json:"prefix,omitempty"` Attribute bool `protobuf:"varint,4,opt,name=attribute,proto3" json:"attribute,omitempty"` Wrapped bool `protobuf:"varint,5,opt,name=wrapped,proto3" json:"wrapped,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` } func (x *Xml) Reset() { *x = Xml{} if protoimpl.UnsafeEnabled { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[59] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Xml) String() string { return protoimpl.X.MessageStringOf(x) } func (*Xml) ProtoMessage() {} func (x *Xml) ProtoReflect() protoreflect.Message { mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[59] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Xml.ProtoReflect.Descriptor instead. func (*Xml) Descriptor() ([]byte, []int) { return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{59} } func (x *Xml) GetName() string { if x != nil { return x.Name } return "" } func (x *Xml) GetNamespace() string { if x != nil { return x.Namespace } return "" } func (x *Xml) GetPrefix() string { if x != nil { return x.Prefix } return "" } func (x *Xml) GetAttribute() bool { if x != nil { return x.Attribute } return false } func (x *Xml) GetWrapped() bool { if x != nil { return x.Wrapped } return false } func (x *Xml) GetVendorExtension() []*NamedAny { if x != nil { return x.VendorExtension } return nil } var File_openapiv2_OpenAPIv2_proto protoreflect.FileDescriptor var file_openapiv2_OpenAPIv2_proto_rawDesc = []byte{ 0x0a, 0x19, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x4f, 0x70, 0x65, 0x6e, 0x41, 0x50, 0x49, 0x76, 0x32, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6d, 0x0a, 0x18, 0x41, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x2c, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x48, 0x00, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x1a, 0x0a, 0x07, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x07, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x42, 0x07, 0x0a, 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x22, 0x45, 0x0a, 0x03, 0x41, 0x6e, 0x79, 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x79, 0x61, 0x6d, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x79, 0x61, 0x6d, 0x6c, 0x22, 0xab, 0x01, 0x0a, 0x0e, 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x94, 0x01, 0x0a, 0x1b, 0x42, 0x61, 0x73, 0x69, 0x63, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xde, 0x01, 0x0a, 0x0d, 0x42, 0x6f, 0x64, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x86, 0x01, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x54, 0x0a, 0x07, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x49, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0x5b, 0x0a, 0x0b, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x4c, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0xe8, 0x05, 0x0a, 0x08, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x77, 0x61, 0x67, 0x67, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x77, 0x61, 0x67, 0x67, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, 0x73, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x73, 0x12, 0x27, 0x0a, 0x05, 0x70, 0x61, 0x74, 0x68, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x73, 0x52, 0x05, 0x70, 0x61, 0x74, 0x68, 0x73, 0x12, 0x39, 0x0a, 0x0b, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0b, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x40, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x3d, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x12, 0x3b, 0x0a, 0x08, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x52, 0x0a, 0x14, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x13, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x23, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x61, 0x67, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x3d, 0x0a, 0x0d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x64, 0x6f, 0x63, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x52, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x55, 0x0a, 0x08, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x12, 0x49, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0x83, 0x01, 0x0a, 0x0c, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xff, 0x02, 0x0a, 0x0a, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x3d, 0x0a, 0x0d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x64, 0x6f, 0x63, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x52, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x12, 0x29, 0x0a, 0x07, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xab, 0x06, 0x0a, 0x1a, 0x46, 0x6f, 0x72, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x75, 0x62, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x31, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x29, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x78, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x69, 0x6e, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x10, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x69, 0x6e, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6e, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x13, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x69, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x23, 0x0a, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x15, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x6f, 0x66, 0x18, 0x16, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x4f, 0x66, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x17, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xab, 0x05, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x31, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x29, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x78, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x69, 0x6e, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x69, 0x6e, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6e, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x69, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x23, 0x0a, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x6f, 0x66, 0x18, 0x11, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x4f, 0x66, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x13, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xfd, 0x05, 0x0a, 0x18, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x75, 0x62, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x31, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x29, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x78, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x69, 0x6e, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x69, 0x6e, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6e, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x69, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x13, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x23, 0x0a, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x14, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x6f, 0x66, 0x18, 0x15, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x4f, 0x66, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x16, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x57, 0x0a, 0x07, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x4c, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0xa1, 0x02, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x10, 0x74, 0x65, 0x72, 0x6d, 0x73, 0x5f, 0x6f, 0x66, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x74, 0x65, 0x72, 0x6d, 0x73, 0x4f, 0x66, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x2d, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x12, 0x2d, 0x0a, 0x07, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x52, 0x07, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x37, 0x0a, 0x09, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x22, 0x44, 0x0a, 0x0d, 0x4a, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x11, 0x0a, 0x04, 0x5f, 0x72, 0x65, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x52, 0x65, 0x66, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x70, 0x0a, 0x07, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x45, 0x0a, 0x08, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x4b, 0x0a, 0x0b, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x51, 0x0a, 0x0e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2b, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x4f, 0x0a, 0x0d, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x50, 0x61, 0x74, 0x68, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x4f, 0x0a, 0x0d, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x59, 0x0a, 0x12, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x4b, 0x0a, 0x0b, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x6d, 0x0a, 0x1c, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x37, 0x0a, 0x0b, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x55, 0x0a, 0x10, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x41, 0x72, 0x72, 0x61, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2d, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x41, 0x72, 0x72, 0x61, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xb5, 0x03, 0x0a, 0x10, 0x4e, 0x6f, 0x6e, 0x42, 0x6f, 0x64, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x65, 0x0a, 0x1b, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x75, 0x62, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x75, 0x62, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x48, 0x00, 0x52, 0x18, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x75, 0x62, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x6c, 0x0a, 0x1e, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x75, 0x62, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x75, 0x62, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x48, 0x00, 0x52, 0x1a, 0x66, 0x6f, 0x72, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x75, 0x62, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x62, 0x0a, 0x1a, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x75, 0x62, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x75, 0x62, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x48, 0x00, 0x52, 0x17, 0x71, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x75, 0x62, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x5f, 0x0a, 0x19, 0x70, 0x61, 0x74, 0x68, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x75, 0x62, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x75, 0x62, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x48, 0x00, 0x52, 0x16, 0x70, 0x61, 0x74, 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x75, 0x62, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x42, 0x07, 0x0a, 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x22, 0xa1, 0x02, 0x0a, 0x18, 0x4f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x6c, 0x6f, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x55, 0x72, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xf5, 0x01, 0x0a, 0x19, 0x4f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x6c, 0x6f, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x55, 0x72, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x82, 0x02, 0x0a, 0x16, 0x4f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x49, 0x6d, 0x70, 0x6c, 0x69, 0x63, 0x69, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x6c, 0x6f, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x72, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xf2, 0x01, 0x0a, 0x16, 0x4f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x6c, 0x6f, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x55, 0x72, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x5c, 0x0a, 0x0c, 0x4f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x4c, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0x9e, 0x04, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x0d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x64, 0x6f, 0x63, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x52, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x33, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x3b, 0x0a, 0x08, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xa6, 0x01, 0x0a, 0x09, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x42, 0x0a, 0x0e, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x48, 0x00, 0x52, 0x0d, 0x62, 0x6f, 0x64, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x4c, 0x0a, 0x12, 0x6e, 0x6f, 0x6e, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x6f, 0x6e, 0x42, 0x6f, 0x64, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x48, 0x00, 0x52, 0x10, 0x6e, 0x6f, 0x6e, 0x42, 0x6f, 0x64, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x42, 0x07, 0x0a, 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x22, 0x67, 0x0a, 0x14, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x4f, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0x94, 0x01, 0x0a, 0x0e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x35, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x48, 0x00, 0x52, 0x09, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x42, 0x0a, 0x0e, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4a, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x6a, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x22, 0xcf, 0x03, 0x0a, 0x08, 0x50, 0x61, 0x74, 0x68, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x11, 0x0a, 0x04, 0x5f, 0x72, 0x65, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x52, 0x65, 0x66, 0x12, 0x27, 0x0a, 0x03, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x03, 0x67, 0x65, 0x74, 0x12, 0x27, 0x0a, 0x03, 0x70, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x03, 0x70, 0x75, 0x74, 0x12, 0x29, 0x0a, 0x04, 0x70, 0x6f, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x70, 0x6f, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x2f, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x29, 0x0a, 0x04, 0x68, 0x65, 0x61, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x68, 0x65, 0x61, 0x64, 0x12, 0x2b, 0x0a, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, 0x12, 0x3a, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xfb, 0x05, 0x0a, 0x16, 0x50, 0x61, 0x74, 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x75, 0x62, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x31, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x29, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x78, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x69, 0x6e, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x69, 0x6e, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6e, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x69, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x13, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x23, 0x0a, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x14, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x6f, 0x66, 0x18, 0x15, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x4f, 0x66, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x16, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x77, 0x0a, 0x05, 0x50, 0x61, 0x74, 0x68, 0x73, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x50, 0x61, 0x74, 0x68, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x92, 0x05, 0x0a, 0x0f, 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x31, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x29, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x78, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x69, 0x6e, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x69, 0x6e, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6e, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x69, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x23, 0x0a, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x6f, 0x66, 0x18, 0x11, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x4f, 0x66, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x12, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x5a, 0x0a, 0x0a, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x12, 0x4c, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0xa8, 0x06, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x75, 0x62, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x31, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x29, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x78, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x69, 0x6e, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x10, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x69, 0x6e, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6e, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x13, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x69, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x23, 0x0a, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x15, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x6f, 0x66, 0x18, 0x16, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x4f, 0x66, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x17, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xfe, 0x01, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x2d, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x30, 0x0a, 0x08, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x52, 0x08, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x65, 0x0a, 0x13, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x4e, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0x90, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0e, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4a, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x6a, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x22, 0x91, 0x01, 0x0a, 0x09, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x12, 0x43, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xaf, 0x09, 0x0a, 0x06, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x11, 0x0a, 0x04, 0x5f, 0x72, 0x65, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x52, 0x65, 0x66, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x6f, 0x66, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x4f, 0x66, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x78, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x69, 0x6e, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x69, 0x6e, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6e, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x69, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x6d, 0x61, 0x78, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x6d, 0x69, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x6d, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x13, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x23, 0x0a, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x14, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x59, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x12, 0x28, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2b, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x29, 0x0a, 0x06, 0x61, 0x6c, 0x6c, 0x5f, 0x6f, 0x66, 0x18, 0x18, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x05, 0x61, 0x6c, 0x6c, 0x4f, 0x66, 0x12, 0x36, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x19, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x64, 0x69, 0x73, 0x63, 0x72, 0x69, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x69, 0x73, 0x63, 0x72, 0x69, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x21, 0x0a, 0x03, 0x78, 0x6d, 0x6c, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x58, 0x6d, 0x6c, 0x52, 0x03, 0x78, 0x6d, 0x6c, 0x12, 0x3d, 0x0a, 0x0d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x64, 0x6f, 0x63, 0x73, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x52, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x12, 0x29, 0x0a, 0x07, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x1f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x7e, 0x0a, 0x0a, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x2c, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x48, 0x00, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x39, 0x0a, 0x0b, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x48, 0x00, 0x52, 0x0a, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x42, 0x07, 0x0a, 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x22, 0x74, 0x0a, 0x13, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x5d, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0xe9, 0x04, 0x0a, 0x17, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x6d, 0x0a, 0x1d, 0x62, 0x61, 0x73, 0x69, 0x63, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x61, 0x73, 0x69, 0x63, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x48, 0x00, 0x52, 0x1b, 0x62, 0x61, 0x73, 0x69, 0x63, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x46, 0x0a, 0x10, 0x61, 0x70, 0x69, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x48, 0x00, 0x52, 0x0e, 0x61, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x5e, 0x0a, 0x18, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x5f, 0x69, 0x6d, 0x70, 0x6c, 0x69, 0x63, 0x69, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x49, 0x6d, 0x70, 0x6c, 0x69, 0x63, 0x69, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x48, 0x00, 0x52, 0x16, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x49, 0x6d, 0x70, 0x6c, 0x69, 0x63, 0x69, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x5e, 0x0a, 0x18, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x5f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x48, 0x00, 0x52, 0x16, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x67, 0x0a, 0x1b, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x5f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x48, 0x00, 0x52, 0x19, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x65, 0x0a, 0x1b, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x48, 0x00, 0x52, 0x18, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x42, 0x07, 0x0a, 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x22, 0x68, 0x0a, 0x13, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x51, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x41, 0x72, 0x72, 0x61, 0x79, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0x23, 0x0a, 0x0b, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x41, 0x72, 0x72, 0x61, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xbb, 0x01, 0x0a, 0x03, 0x54, 0x61, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x0d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x64, 0x6f, 0x63, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x52, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x20, 0x0a, 0x08, 0x54, 0x79, 0x70, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x5c, 0x0a, 0x0f, 0x56, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x49, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0xc8, 0x01, 0x0a, 0x03, 0x58, 0x6d, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x3c, 0x0a, 0x0e, 0x6f, 0x72, 0x67, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x5f, 0x76, 0x32, 0x42, 0x0c, 0x4f, 0x70, 0x65, 0x6e, 0x41, 0x50, 0x49, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x14, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x3b, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x5f, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x4f, 0x41, 0x53, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_openapiv2_OpenAPIv2_proto_rawDescOnce sync.Once file_openapiv2_OpenAPIv2_proto_rawDescData = file_openapiv2_OpenAPIv2_proto_rawDesc ) func file_openapiv2_OpenAPIv2_proto_rawDescGZIP() []byte { file_openapiv2_OpenAPIv2_proto_rawDescOnce.Do(func() { file_openapiv2_OpenAPIv2_proto_rawDescData = protoimpl.X.CompressGZIP(file_openapiv2_OpenAPIv2_proto_rawDescData) }) return file_openapiv2_OpenAPIv2_proto_rawDescData } var file_openapiv2_OpenAPIv2_proto_msgTypes = make([]protoimpl.MessageInfo, 60) var file_openapiv2_OpenAPIv2_proto_goTypes = []interface{}{ (*AdditionalPropertiesItem)(nil), // 0: openapi.v2.AdditionalPropertiesItem (*Any)(nil), // 1: openapi.v2.Any (*ApiKeySecurity)(nil), // 2: openapi.v2.ApiKeySecurity (*BasicAuthenticationSecurity)(nil), // 3: openapi.v2.BasicAuthenticationSecurity (*BodyParameter)(nil), // 4: openapi.v2.BodyParameter (*Contact)(nil), // 5: openapi.v2.Contact (*Default)(nil), // 6: openapi.v2.Default (*Definitions)(nil), // 7: openapi.v2.Definitions (*Document)(nil), // 8: openapi.v2.Document (*Examples)(nil), // 9: openapi.v2.Examples (*ExternalDocs)(nil), // 10: openapi.v2.ExternalDocs (*FileSchema)(nil), // 11: openapi.v2.FileSchema (*FormDataParameterSubSchema)(nil), // 12: openapi.v2.FormDataParameterSubSchema (*Header)(nil), // 13: openapi.v2.Header (*HeaderParameterSubSchema)(nil), // 14: openapi.v2.HeaderParameterSubSchema (*Headers)(nil), // 15: openapi.v2.Headers (*Info)(nil), // 16: openapi.v2.Info (*ItemsItem)(nil), // 17: openapi.v2.ItemsItem (*JsonReference)(nil), // 18: openapi.v2.JsonReference (*License)(nil), // 19: openapi.v2.License (*NamedAny)(nil), // 20: openapi.v2.NamedAny (*NamedHeader)(nil), // 21: openapi.v2.NamedHeader (*NamedParameter)(nil), // 22: openapi.v2.NamedParameter (*NamedPathItem)(nil), // 23: openapi.v2.NamedPathItem (*NamedResponse)(nil), // 24: openapi.v2.NamedResponse (*NamedResponseValue)(nil), // 25: openapi.v2.NamedResponseValue (*NamedSchema)(nil), // 26: openapi.v2.NamedSchema (*NamedSecurityDefinitionsItem)(nil), // 27: openapi.v2.NamedSecurityDefinitionsItem (*NamedString)(nil), // 28: openapi.v2.NamedString (*NamedStringArray)(nil), // 29: openapi.v2.NamedStringArray (*NonBodyParameter)(nil), // 30: openapi.v2.NonBodyParameter (*Oauth2AccessCodeSecurity)(nil), // 31: openapi.v2.Oauth2AccessCodeSecurity (*Oauth2ApplicationSecurity)(nil), // 32: openapi.v2.Oauth2ApplicationSecurity (*Oauth2ImplicitSecurity)(nil), // 33: openapi.v2.Oauth2ImplicitSecurity (*Oauth2PasswordSecurity)(nil), // 34: openapi.v2.Oauth2PasswordSecurity (*Oauth2Scopes)(nil), // 35: openapi.v2.Oauth2Scopes (*Operation)(nil), // 36: openapi.v2.Operation (*Parameter)(nil), // 37: openapi.v2.Parameter (*ParameterDefinitions)(nil), // 38: openapi.v2.ParameterDefinitions (*ParametersItem)(nil), // 39: openapi.v2.ParametersItem (*PathItem)(nil), // 40: openapi.v2.PathItem (*PathParameterSubSchema)(nil), // 41: openapi.v2.PathParameterSubSchema (*Paths)(nil), // 42: openapi.v2.Paths (*PrimitivesItems)(nil), // 43: openapi.v2.PrimitivesItems (*Properties)(nil), // 44: openapi.v2.Properties (*QueryParameterSubSchema)(nil), // 45: openapi.v2.QueryParameterSubSchema (*Response)(nil), // 46: openapi.v2.Response (*ResponseDefinitions)(nil), // 47: openapi.v2.ResponseDefinitions (*ResponseValue)(nil), // 48: openapi.v2.ResponseValue (*Responses)(nil), // 49: openapi.v2.Responses (*Schema)(nil), // 50: openapi.v2.Schema (*SchemaItem)(nil), // 51: openapi.v2.SchemaItem (*SecurityDefinitions)(nil), // 52: openapi.v2.SecurityDefinitions (*SecurityDefinitionsItem)(nil), // 53: openapi.v2.SecurityDefinitionsItem (*SecurityRequirement)(nil), // 54: openapi.v2.SecurityRequirement (*StringArray)(nil), // 55: openapi.v2.StringArray (*Tag)(nil), // 56: openapi.v2.Tag (*TypeItem)(nil), // 57: openapi.v2.TypeItem (*VendorExtension)(nil), // 58: openapi.v2.VendorExtension (*Xml)(nil), // 59: openapi.v2.Xml (*any.Any)(nil), // 60: google.protobuf.Any } var file_openapiv2_OpenAPIv2_proto_depIdxs = []int32{ 50, // 0: openapi.v2.AdditionalPropertiesItem.schema:type_name -> openapi.v2.Schema 60, // 1: openapi.v2.Any.value:type_name -> google.protobuf.Any 20, // 2: openapi.v2.ApiKeySecurity.vendor_extension:type_name -> openapi.v2.NamedAny 20, // 3: openapi.v2.BasicAuthenticationSecurity.vendor_extension:type_name -> openapi.v2.NamedAny 50, // 4: openapi.v2.BodyParameter.schema:type_name -> openapi.v2.Schema 20, // 5: openapi.v2.BodyParameter.vendor_extension:type_name -> openapi.v2.NamedAny 20, // 6: openapi.v2.Contact.vendor_extension:type_name -> openapi.v2.NamedAny 20, // 7: openapi.v2.Default.additional_properties:type_name -> openapi.v2.NamedAny 26, // 8: openapi.v2.Definitions.additional_properties:type_name -> openapi.v2.NamedSchema 16, // 9: openapi.v2.Document.info:type_name -> openapi.v2.Info 42, // 10: openapi.v2.Document.paths:type_name -> openapi.v2.Paths 7, // 11: openapi.v2.Document.definitions:type_name -> openapi.v2.Definitions 38, // 12: openapi.v2.Document.parameters:type_name -> openapi.v2.ParameterDefinitions 47, // 13: openapi.v2.Document.responses:type_name -> openapi.v2.ResponseDefinitions 54, // 14: openapi.v2.Document.security:type_name -> openapi.v2.SecurityRequirement 52, // 15: openapi.v2.Document.security_definitions:type_name -> openapi.v2.SecurityDefinitions 56, // 16: openapi.v2.Document.tags:type_name -> openapi.v2.Tag 10, // 17: openapi.v2.Document.external_docs:type_name -> openapi.v2.ExternalDocs 20, // 18: openapi.v2.Document.vendor_extension:type_name -> openapi.v2.NamedAny 20, // 19: openapi.v2.Examples.additional_properties:type_name -> openapi.v2.NamedAny 20, // 20: openapi.v2.ExternalDocs.vendor_extension:type_name -> openapi.v2.NamedAny 1, // 21: openapi.v2.FileSchema.default:type_name -> openapi.v2.Any 10, // 22: openapi.v2.FileSchema.external_docs:type_name -> openapi.v2.ExternalDocs 1, // 23: openapi.v2.FileSchema.example:type_name -> openapi.v2.Any 20, // 24: openapi.v2.FileSchema.vendor_extension:type_name -> openapi.v2.NamedAny 43, // 25: openapi.v2.FormDataParameterSubSchema.items:type_name -> openapi.v2.PrimitivesItems 1, // 26: openapi.v2.FormDataParameterSubSchema.default:type_name -> openapi.v2.Any 1, // 27: openapi.v2.FormDataParameterSubSchema.enum:type_name -> openapi.v2.Any 20, // 28: openapi.v2.FormDataParameterSubSchema.vendor_extension:type_name -> openapi.v2.NamedAny 43, // 29: openapi.v2.Header.items:type_name -> openapi.v2.PrimitivesItems 1, // 30: openapi.v2.Header.default:type_name -> openapi.v2.Any 1, // 31: openapi.v2.Header.enum:type_name -> openapi.v2.Any 20, // 32: openapi.v2.Header.vendor_extension:type_name -> openapi.v2.NamedAny 43, // 33: openapi.v2.HeaderParameterSubSchema.items:type_name -> openapi.v2.PrimitivesItems 1, // 34: openapi.v2.HeaderParameterSubSchema.default:type_name -> openapi.v2.Any 1, // 35: openapi.v2.HeaderParameterSubSchema.enum:type_name -> openapi.v2.Any 20, // 36: openapi.v2.HeaderParameterSubSchema.vendor_extension:type_name -> openapi.v2.NamedAny 21, // 37: openapi.v2.Headers.additional_properties:type_name -> openapi.v2.NamedHeader 5, // 38: openapi.v2.Info.contact:type_name -> openapi.v2.Contact 19, // 39: openapi.v2.Info.license:type_name -> openapi.v2.License 20, // 40: openapi.v2.Info.vendor_extension:type_name -> openapi.v2.NamedAny 50, // 41: openapi.v2.ItemsItem.schema:type_name -> openapi.v2.Schema 20, // 42: openapi.v2.License.vendor_extension:type_name -> openapi.v2.NamedAny 1, // 43: openapi.v2.NamedAny.value:type_name -> openapi.v2.Any 13, // 44: openapi.v2.NamedHeader.value:type_name -> openapi.v2.Header 37, // 45: openapi.v2.NamedParameter.value:type_name -> openapi.v2.Parameter 40, // 46: openapi.v2.NamedPathItem.value:type_name -> openapi.v2.PathItem 46, // 47: openapi.v2.NamedResponse.value:type_name -> openapi.v2.Response 48, // 48: openapi.v2.NamedResponseValue.value:type_name -> openapi.v2.ResponseValue 50, // 49: openapi.v2.NamedSchema.value:type_name -> openapi.v2.Schema 53, // 50: openapi.v2.NamedSecurityDefinitionsItem.value:type_name -> openapi.v2.SecurityDefinitionsItem 55, // 51: openapi.v2.NamedStringArray.value:type_name -> openapi.v2.StringArray 14, // 52: openapi.v2.NonBodyParameter.header_parameter_sub_schema:type_name -> openapi.v2.HeaderParameterSubSchema 12, // 53: openapi.v2.NonBodyParameter.form_data_parameter_sub_schema:type_name -> openapi.v2.FormDataParameterSubSchema 45, // 54: openapi.v2.NonBodyParameter.query_parameter_sub_schema:type_name -> openapi.v2.QueryParameterSubSchema 41, // 55: openapi.v2.NonBodyParameter.path_parameter_sub_schema:type_name -> openapi.v2.PathParameterSubSchema 35, // 56: openapi.v2.Oauth2AccessCodeSecurity.scopes:type_name -> openapi.v2.Oauth2Scopes 20, // 57: openapi.v2.Oauth2AccessCodeSecurity.vendor_extension:type_name -> openapi.v2.NamedAny 35, // 58: openapi.v2.Oauth2ApplicationSecurity.scopes:type_name -> openapi.v2.Oauth2Scopes 20, // 59: openapi.v2.Oauth2ApplicationSecurity.vendor_extension:type_name -> openapi.v2.NamedAny 35, // 60: openapi.v2.Oauth2ImplicitSecurity.scopes:type_name -> openapi.v2.Oauth2Scopes 20, // 61: openapi.v2.Oauth2ImplicitSecurity.vendor_extension:type_name -> openapi.v2.NamedAny 35, // 62: openapi.v2.Oauth2PasswordSecurity.scopes:type_name -> openapi.v2.Oauth2Scopes 20, // 63: openapi.v2.Oauth2PasswordSecurity.vendor_extension:type_name -> openapi.v2.NamedAny 28, // 64: openapi.v2.Oauth2Scopes.additional_properties:type_name -> openapi.v2.NamedString 10, // 65: openapi.v2.Operation.external_docs:type_name -> openapi.v2.ExternalDocs 39, // 66: openapi.v2.Operation.parameters:type_name -> openapi.v2.ParametersItem 49, // 67: openapi.v2.Operation.responses:type_name -> openapi.v2.Responses 54, // 68: openapi.v2.Operation.security:type_name -> openapi.v2.SecurityRequirement 20, // 69: openapi.v2.Operation.vendor_extension:type_name -> openapi.v2.NamedAny 4, // 70: openapi.v2.Parameter.body_parameter:type_name -> openapi.v2.BodyParameter 30, // 71: openapi.v2.Parameter.non_body_parameter:type_name -> openapi.v2.NonBodyParameter 22, // 72: openapi.v2.ParameterDefinitions.additional_properties:type_name -> openapi.v2.NamedParameter 37, // 73: openapi.v2.ParametersItem.parameter:type_name -> openapi.v2.Parameter 18, // 74: openapi.v2.ParametersItem.json_reference:type_name -> openapi.v2.JsonReference 36, // 75: openapi.v2.PathItem.get:type_name -> openapi.v2.Operation 36, // 76: openapi.v2.PathItem.put:type_name -> openapi.v2.Operation 36, // 77: openapi.v2.PathItem.post:type_name -> openapi.v2.Operation 36, // 78: openapi.v2.PathItem.delete:type_name -> openapi.v2.Operation 36, // 79: openapi.v2.PathItem.options:type_name -> openapi.v2.Operation 36, // 80: openapi.v2.PathItem.head:type_name -> openapi.v2.Operation 36, // 81: openapi.v2.PathItem.patch:type_name -> openapi.v2.Operation 39, // 82: openapi.v2.PathItem.parameters:type_name -> openapi.v2.ParametersItem 20, // 83: openapi.v2.PathItem.vendor_extension:type_name -> openapi.v2.NamedAny 43, // 84: openapi.v2.PathParameterSubSchema.items:type_name -> openapi.v2.PrimitivesItems 1, // 85: openapi.v2.PathParameterSubSchema.default:type_name -> openapi.v2.Any 1, // 86: openapi.v2.PathParameterSubSchema.enum:type_name -> openapi.v2.Any 20, // 87: openapi.v2.PathParameterSubSchema.vendor_extension:type_name -> openapi.v2.NamedAny 20, // 88: openapi.v2.Paths.vendor_extension:type_name -> openapi.v2.NamedAny 23, // 89: openapi.v2.Paths.path:type_name -> openapi.v2.NamedPathItem 43, // 90: openapi.v2.PrimitivesItems.items:type_name -> openapi.v2.PrimitivesItems 1, // 91: openapi.v2.PrimitivesItems.default:type_name -> openapi.v2.Any 1, // 92: openapi.v2.PrimitivesItems.enum:type_name -> openapi.v2.Any 20, // 93: openapi.v2.PrimitivesItems.vendor_extension:type_name -> openapi.v2.NamedAny 26, // 94: openapi.v2.Properties.additional_properties:type_name -> openapi.v2.NamedSchema 43, // 95: openapi.v2.QueryParameterSubSchema.items:type_name -> openapi.v2.PrimitivesItems 1, // 96: openapi.v2.QueryParameterSubSchema.default:type_name -> openapi.v2.Any 1, // 97: openapi.v2.QueryParameterSubSchema.enum:type_name -> openapi.v2.Any 20, // 98: openapi.v2.QueryParameterSubSchema.vendor_extension:type_name -> openapi.v2.NamedAny 51, // 99: openapi.v2.Response.schema:type_name -> openapi.v2.SchemaItem 15, // 100: openapi.v2.Response.headers:type_name -> openapi.v2.Headers 9, // 101: openapi.v2.Response.examples:type_name -> openapi.v2.Examples 20, // 102: openapi.v2.Response.vendor_extension:type_name -> openapi.v2.NamedAny 24, // 103: openapi.v2.ResponseDefinitions.additional_properties:type_name -> openapi.v2.NamedResponse 46, // 104: openapi.v2.ResponseValue.response:type_name -> openapi.v2.Response 18, // 105: openapi.v2.ResponseValue.json_reference:type_name -> openapi.v2.JsonReference 25, // 106: openapi.v2.Responses.response_code:type_name -> openapi.v2.NamedResponseValue 20, // 107: openapi.v2.Responses.vendor_extension:type_name -> openapi.v2.NamedAny 1, // 108: openapi.v2.Schema.default:type_name -> openapi.v2.Any 1, // 109: openapi.v2.Schema.enum:type_name -> openapi.v2.Any 0, // 110: openapi.v2.Schema.additional_properties:type_name -> openapi.v2.AdditionalPropertiesItem 57, // 111: openapi.v2.Schema.type:type_name -> openapi.v2.TypeItem 17, // 112: openapi.v2.Schema.items:type_name -> openapi.v2.ItemsItem 50, // 113: openapi.v2.Schema.all_of:type_name -> openapi.v2.Schema 44, // 114: openapi.v2.Schema.properties:type_name -> openapi.v2.Properties 59, // 115: openapi.v2.Schema.xml:type_name -> openapi.v2.Xml 10, // 116: openapi.v2.Schema.external_docs:type_name -> openapi.v2.ExternalDocs 1, // 117: openapi.v2.Schema.example:type_name -> openapi.v2.Any 20, // 118: openapi.v2.Schema.vendor_extension:type_name -> openapi.v2.NamedAny 50, // 119: openapi.v2.SchemaItem.schema:type_name -> openapi.v2.Schema 11, // 120: openapi.v2.SchemaItem.file_schema:type_name -> openapi.v2.FileSchema 27, // 121: openapi.v2.SecurityDefinitions.additional_properties:type_name -> openapi.v2.NamedSecurityDefinitionsItem 3, // 122: openapi.v2.SecurityDefinitionsItem.basic_authentication_security:type_name -> openapi.v2.BasicAuthenticationSecurity 2, // 123: openapi.v2.SecurityDefinitionsItem.api_key_security:type_name -> openapi.v2.ApiKeySecurity 33, // 124: openapi.v2.SecurityDefinitionsItem.oauth2_implicit_security:type_name -> openapi.v2.Oauth2ImplicitSecurity 34, // 125: openapi.v2.SecurityDefinitionsItem.oauth2_password_security:type_name -> openapi.v2.Oauth2PasswordSecurity 32, // 126: openapi.v2.SecurityDefinitionsItem.oauth2_application_security:type_name -> openapi.v2.Oauth2ApplicationSecurity 31, // 127: openapi.v2.SecurityDefinitionsItem.oauth2_access_code_security:type_name -> openapi.v2.Oauth2AccessCodeSecurity 29, // 128: openapi.v2.SecurityRequirement.additional_properties:type_name -> openapi.v2.NamedStringArray 10, // 129: openapi.v2.Tag.external_docs:type_name -> openapi.v2.ExternalDocs 20, // 130: openapi.v2.Tag.vendor_extension:type_name -> openapi.v2.NamedAny 20, // 131: openapi.v2.VendorExtension.additional_properties:type_name -> openapi.v2.NamedAny 20, // 132: openapi.v2.Xml.vendor_extension:type_name -> openapi.v2.NamedAny 133, // [133:133] is the sub-list for method output_type 133, // [133:133] is the sub-list for method input_type 133, // [133:133] is the sub-list for extension type_name 133, // [133:133] is the sub-list for extension extendee 0, // [0:133] is the sub-list for field type_name } func init() { file_openapiv2_OpenAPIv2_proto_init() } func file_openapiv2_OpenAPIv2_proto_init() { if File_openapiv2_OpenAPIv2_proto != nil { return } if !protoimpl.UnsafeEnabled { file_openapiv2_OpenAPIv2_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AdditionalPropertiesItem); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Any); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ApiKeySecurity); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BasicAuthenticationSecurity); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BodyParameter); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Contact); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Default); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Definitions); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Document); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Examples); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExternalDocs); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*FileSchema); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*FormDataParameterSubSchema); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Header); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*HeaderParameterSubSchema); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Headers); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Info); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ItemsItem); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*JsonReference); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*License); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*NamedAny); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*NamedHeader); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*NamedParameter); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*NamedPathItem); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*NamedResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*NamedResponseValue); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*NamedSchema); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*NamedSecurityDefinitionsItem); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*NamedString); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*NamedStringArray); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*NonBodyParameter); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Oauth2AccessCodeSecurity); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Oauth2ApplicationSecurity); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Oauth2ImplicitSecurity); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Oauth2PasswordSecurity); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Oauth2Scopes); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Operation); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Parameter); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ParameterDefinitions); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ParametersItem); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PathItem); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PathParameterSubSchema); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Paths); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PrimitivesItems); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Properties); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryParameterSubSchema); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Response); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ResponseDefinitions); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ResponseValue); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Responses); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Schema); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SchemaItem); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SecurityDefinitions); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SecurityDefinitionsItem); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SecurityRequirement); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StringArray); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Tag); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*TypeItem); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*VendorExtension); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_openapiv2_OpenAPIv2_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Xml); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } file_openapiv2_OpenAPIv2_proto_msgTypes[0].OneofWrappers = []interface{}{ (*AdditionalPropertiesItem_Schema)(nil), (*AdditionalPropertiesItem_Boolean)(nil), } file_openapiv2_OpenAPIv2_proto_msgTypes[30].OneofWrappers = []interface{}{ (*NonBodyParameter_HeaderParameterSubSchema)(nil), (*NonBodyParameter_FormDataParameterSubSchema)(nil), (*NonBodyParameter_QueryParameterSubSchema)(nil), (*NonBodyParameter_PathParameterSubSchema)(nil), } file_openapiv2_OpenAPIv2_proto_msgTypes[37].OneofWrappers = []interface{}{ (*Parameter_BodyParameter)(nil), (*Parameter_NonBodyParameter)(nil), } file_openapiv2_OpenAPIv2_proto_msgTypes[39].OneofWrappers = []interface{}{ (*ParametersItem_Parameter)(nil), (*ParametersItem_JsonReference)(nil), } file_openapiv2_OpenAPIv2_proto_msgTypes[48].OneofWrappers = []interface{}{ (*ResponseValue_Response)(nil), (*ResponseValue_JsonReference)(nil), } file_openapiv2_OpenAPIv2_proto_msgTypes[51].OneofWrappers = []interface{}{ (*SchemaItem_Schema)(nil), (*SchemaItem_FileSchema)(nil), } file_openapiv2_OpenAPIv2_proto_msgTypes[53].OneofWrappers = []interface{}{ (*SecurityDefinitionsItem_BasicAuthenticationSecurity)(nil), (*SecurityDefinitionsItem_ApiKeySecurity)(nil), (*SecurityDefinitionsItem_Oauth2ImplicitSecurity)(nil), (*SecurityDefinitionsItem_Oauth2PasswordSecurity)(nil), (*SecurityDefinitionsItem_Oauth2ApplicationSecurity)(nil), (*SecurityDefinitionsItem_Oauth2AccessCodeSecurity)(nil), } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_openapiv2_OpenAPIv2_proto_rawDesc, NumEnums: 0, NumMessages: 60, NumExtensions: 0, NumServices: 0, }, GoTypes: file_openapiv2_OpenAPIv2_proto_goTypes, DependencyIndexes: file_openapiv2_OpenAPIv2_proto_depIdxs, MessageInfos: file_openapiv2_OpenAPIv2_proto_msgTypes, }.Build() File_openapiv2_OpenAPIv2_proto = out.File file_openapiv2_OpenAPIv2_proto_rawDesc = nil file_openapiv2_OpenAPIv2_proto_goTypes = nil file_openapiv2_OpenAPIv2_proto_depIdxs = nil }
8,916
0
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic/OpenAPIv2/OpenAPIv2.proto
// Copyright 2020 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // THIS FILE IS AUTOMATICALLY GENERATED. syntax = "proto3"; package openapi.v2; import "google/protobuf/any.proto"; // This option lets the proto compiler generate Java code inside the package // name (see below) instead of inside an outer class. It creates a simpler // developer experience by reducing one-level of name nesting and be // consistent with most programming languages that don't support outer classes. option java_multiple_files = true; // The Java outer classname should be the filename in UpperCamelCase. This // class is only used to hold proto descriptor, so developers don't need to // work with it directly. option java_outer_classname = "OpenAPIProto"; // The Java package name must be proto package name with proper prefix. option java_package = "org.openapi_v2"; // A reasonable prefix for the Objective-C symbols generated from the package. // It should at a minimum be 3 characters long, all uppercase, and convention // is to use an abbreviation of the package name. Something short, but // hopefully unique enough to not conflict with things that may come along in // the future. 'GPB' is reserved for the protocol buffer implementation itself. option objc_class_prefix = "OAS"; // The Go package name. option go_package = "openapiv2;openapi_v2"; message AdditionalPropertiesItem { oneof oneof { Schema schema = 1; bool boolean = 2; } } message Any { google.protobuf.Any value = 1; string yaml = 2; } message ApiKeySecurity { string type = 1; string name = 2; string in = 3; string description = 4; repeated NamedAny vendor_extension = 5; } message BasicAuthenticationSecurity { string type = 1; string description = 2; repeated NamedAny vendor_extension = 3; } message BodyParameter { // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. string description = 1; // The name of the parameter. string name = 2; // Determines the location of the parameter. string in = 3; // Determines whether or not this parameter is required or optional. bool required = 4; Schema schema = 5; repeated NamedAny vendor_extension = 6; } // Contact information for the owners of the API. message Contact { // The identifying name of the contact person/organization. string name = 1; // The URL pointing to the contact information. string url = 2; // The email address of the contact person/organization. string email = 3; repeated NamedAny vendor_extension = 4; } message Default { repeated NamedAny additional_properties = 1; } // One or more JSON objects describing the schemas being consumed and produced by the API. message Definitions { repeated NamedSchema additional_properties = 1; } message Document { // The Swagger version of this document. string swagger = 1; Info info = 2; // The host (name or ip) of the API. Example: 'swagger.io' string host = 3; // The base path to the API. Example: '/api'. string base_path = 4; // The transfer protocol of the API. repeated string schemes = 5; // A list of MIME types accepted by the API. repeated string consumes = 6; // A list of MIME types the API can produce. repeated string produces = 7; Paths paths = 8; Definitions definitions = 9; ParameterDefinitions parameters = 10; ResponseDefinitions responses = 11; repeated SecurityRequirement security = 12; SecurityDefinitions security_definitions = 13; repeated Tag tags = 14; ExternalDocs external_docs = 15; repeated NamedAny vendor_extension = 16; } message Examples { repeated NamedAny additional_properties = 1; } // information about external documentation message ExternalDocs { string description = 1; string url = 2; repeated NamedAny vendor_extension = 3; } // A deterministic version of a JSON Schema object. message FileSchema { string format = 1; string title = 2; string description = 3; Any default = 4; repeated string required = 5; string type = 6; bool read_only = 7; ExternalDocs external_docs = 8; Any example = 9; repeated NamedAny vendor_extension = 10; } message FormDataParameterSubSchema { // Determines whether or not this parameter is required or optional. bool required = 1; // Determines the location of the parameter. string in = 2; // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. string description = 3; // The name of the parameter. string name = 4; // allows sending a parameter by name only or with an empty value. bool allow_empty_value = 5; string type = 6; string format = 7; PrimitivesItems items = 8; string collection_format = 9; Any default = 10; double maximum = 11; bool exclusive_maximum = 12; double minimum = 13; bool exclusive_minimum = 14; int64 max_length = 15; int64 min_length = 16; string pattern = 17; int64 max_items = 18; int64 min_items = 19; bool unique_items = 20; repeated Any enum = 21; double multiple_of = 22; repeated NamedAny vendor_extension = 23; } message Header { string type = 1; string format = 2; PrimitivesItems items = 3; string collection_format = 4; Any default = 5; double maximum = 6; bool exclusive_maximum = 7; double minimum = 8; bool exclusive_minimum = 9; int64 max_length = 10; int64 min_length = 11; string pattern = 12; int64 max_items = 13; int64 min_items = 14; bool unique_items = 15; repeated Any enum = 16; double multiple_of = 17; string description = 18; repeated NamedAny vendor_extension = 19; } message HeaderParameterSubSchema { // Determines whether or not this parameter is required or optional. bool required = 1; // Determines the location of the parameter. string in = 2; // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. string description = 3; // The name of the parameter. string name = 4; string type = 5; string format = 6; PrimitivesItems items = 7; string collection_format = 8; Any default = 9; double maximum = 10; bool exclusive_maximum = 11; double minimum = 12; bool exclusive_minimum = 13; int64 max_length = 14; int64 min_length = 15; string pattern = 16; int64 max_items = 17; int64 min_items = 18; bool unique_items = 19; repeated Any enum = 20; double multiple_of = 21; repeated NamedAny vendor_extension = 22; } message Headers { repeated NamedHeader additional_properties = 1; } // General information about the API. message Info { // A unique and precise title of the API. string title = 1; // A semantic version number of the API. string version = 2; // A longer description of the API. Should be different from the title. GitHub Flavored Markdown is allowed. string description = 3; // The terms of service for the API. string terms_of_service = 4; Contact contact = 5; License license = 6; repeated NamedAny vendor_extension = 7; } message ItemsItem { repeated Schema schema = 1; } message JsonReference { string _ref = 1; string description = 2; } message License { // The name of the license type. It's encouraged to use an OSI compatible license. string name = 1; // The URL pointing to the license. string url = 2; repeated NamedAny vendor_extension = 3; } // Automatically-generated message used to represent maps of Any as ordered (name,value) pairs. message NamedAny { // Map key string name = 1; // Mapped value Any value = 2; } // Automatically-generated message used to represent maps of Header as ordered (name,value) pairs. message NamedHeader { // Map key string name = 1; // Mapped value Header value = 2; } // Automatically-generated message used to represent maps of Parameter as ordered (name,value) pairs. message NamedParameter { // Map key string name = 1; // Mapped value Parameter value = 2; } // Automatically-generated message used to represent maps of PathItem as ordered (name,value) pairs. message NamedPathItem { // Map key string name = 1; // Mapped value PathItem value = 2; } // Automatically-generated message used to represent maps of Response as ordered (name,value) pairs. message NamedResponse { // Map key string name = 1; // Mapped value Response value = 2; } // Automatically-generated message used to represent maps of ResponseValue as ordered (name,value) pairs. message NamedResponseValue { // Map key string name = 1; // Mapped value ResponseValue value = 2; } // Automatically-generated message used to represent maps of Schema as ordered (name,value) pairs. message NamedSchema { // Map key string name = 1; // Mapped value Schema value = 2; } // Automatically-generated message used to represent maps of SecurityDefinitionsItem as ordered (name,value) pairs. message NamedSecurityDefinitionsItem { // Map key string name = 1; // Mapped value SecurityDefinitionsItem value = 2; } // Automatically-generated message used to represent maps of string as ordered (name,value) pairs. message NamedString { // Map key string name = 1; // Mapped value string value = 2; } // Automatically-generated message used to represent maps of StringArray as ordered (name,value) pairs. message NamedStringArray { // Map key string name = 1; // Mapped value StringArray value = 2; } message NonBodyParameter { oneof oneof { HeaderParameterSubSchema header_parameter_sub_schema = 1; FormDataParameterSubSchema form_data_parameter_sub_schema = 2; QueryParameterSubSchema query_parameter_sub_schema = 3; PathParameterSubSchema path_parameter_sub_schema = 4; } } message Oauth2AccessCodeSecurity { string type = 1; string flow = 2; Oauth2Scopes scopes = 3; string authorization_url = 4; string token_url = 5; string description = 6; repeated NamedAny vendor_extension = 7; } message Oauth2ApplicationSecurity { string type = 1; string flow = 2; Oauth2Scopes scopes = 3; string token_url = 4; string description = 5; repeated NamedAny vendor_extension = 6; } message Oauth2ImplicitSecurity { string type = 1; string flow = 2; Oauth2Scopes scopes = 3; string authorization_url = 4; string description = 5; repeated NamedAny vendor_extension = 6; } message Oauth2PasswordSecurity { string type = 1; string flow = 2; Oauth2Scopes scopes = 3; string token_url = 4; string description = 5; repeated NamedAny vendor_extension = 6; } message Oauth2Scopes { repeated NamedString additional_properties = 1; } message Operation { repeated string tags = 1; // A brief summary of the operation. string summary = 2; // A longer description of the operation, GitHub Flavored Markdown is allowed. string description = 3; ExternalDocs external_docs = 4; // A unique identifier of the operation. string operation_id = 5; // A list of MIME types the API can produce. repeated string produces = 6; // A list of MIME types the API can consume. repeated string consumes = 7; // The parameters needed to send a valid API call. repeated ParametersItem parameters = 8; Responses responses = 9; // The transfer protocol of the API. repeated string schemes = 10; bool deprecated = 11; repeated SecurityRequirement security = 12; repeated NamedAny vendor_extension = 13; } message Parameter { oneof oneof { BodyParameter body_parameter = 1; NonBodyParameter non_body_parameter = 2; } } // One or more JSON representations for parameters message ParameterDefinitions { repeated NamedParameter additional_properties = 1; } message ParametersItem { oneof oneof { Parameter parameter = 1; JsonReference json_reference = 2; } } message PathItem { string _ref = 1; Operation get = 2; Operation put = 3; Operation post = 4; Operation delete = 5; Operation options = 6; Operation head = 7; Operation patch = 8; // The parameters needed to send a valid API call. repeated ParametersItem parameters = 9; repeated NamedAny vendor_extension = 10; } message PathParameterSubSchema { // Determines whether or not this parameter is required or optional. bool required = 1; // Determines the location of the parameter. string in = 2; // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. string description = 3; // The name of the parameter. string name = 4; string type = 5; string format = 6; PrimitivesItems items = 7; string collection_format = 8; Any default = 9; double maximum = 10; bool exclusive_maximum = 11; double minimum = 12; bool exclusive_minimum = 13; int64 max_length = 14; int64 min_length = 15; string pattern = 16; int64 max_items = 17; int64 min_items = 18; bool unique_items = 19; repeated Any enum = 20; double multiple_of = 21; repeated NamedAny vendor_extension = 22; } // Relative paths to the individual endpoints. They must be relative to the 'basePath'. message Paths { repeated NamedAny vendor_extension = 1; repeated NamedPathItem path = 2; } message PrimitivesItems { string type = 1; string format = 2; PrimitivesItems items = 3; string collection_format = 4; Any default = 5; double maximum = 6; bool exclusive_maximum = 7; double minimum = 8; bool exclusive_minimum = 9; int64 max_length = 10; int64 min_length = 11; string pattern = 12; int64 max_items = 13; int64 min_items = 14; bool unique_items = 15; repeated Any enum = 16; double multiple_of = 17; repeated NamedAny vendor_extension = 18; } message Properties { repeated NamedSchema additional_properties = 1; } message QueryParameterSubSchema { // Determines whether or not this parameter is required or optional. bool required = 1; // Determines the location of the parameter. string in = 2; // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. string description = 3; // The name of the parameter. string name = 4; // allows sending a parameter by name only or with an empty value. bool allow_empty_value = 5; string type = 6; string format = 7; PrimitivesItems items = 8; string collection_format = 9; Any default = 10; double maximum = 11; bool exclusive_maximum = 12; double minimum = 13; bool exclusive_minimum = 14; int64 max_length = 15; int64 min_length = 16; string pattern = 17; int64 max_items = 18; int64 min_items = 19; bool unique_items = 20; repeated Any enum = 21; double multiple_of = 22; repeated NamedAny vendor_extension = 23; } message Response { string description = 1; SchemaItem schema = 2; Headers headers = 3; Examples examples = 4; repeated NamedAny vendor_extension = 5; } // One or more JSON representations for responses message ResponseDefinitions { repeated NamedResponse additional_properties = 1; } message ResponseValue { oneof oneof { Response response = 1; JsonReference json_reference = 2; } } // Response objects names can either be any valid HTTP status code or 'default'. message Responses { repeated NamedResponseValue response_code = 1; repeated NamedAny vendor_extension = 2; } // A deterministic version of a JSON Schema object. message Schema { string _ref = 1; string format = 2; string title = 3; string description = 4; Any default = 5; double multiple_of = 6; double maximum = 7; bool exclusive_maximum = 8; double minimum = 9; bool exclusive_minimum = 10; int64 max_length = 11; int64 min_length = 12; string pattern = 13; int64 max_items = 14; int64 min_items = 15; bool unique_items = 16; int64 max_properties = 17; int64 min_properties = 18; repeated string required = 19; repeated Any enum = 20; AdditionalPropertiesItem additional_properties = 21; TypeItem type = 22; ItemsItem items = 23; repeated Schema all_of = 24; Properties properties = 25; string discriminator = 26; bool read_only = 27; Xml xml = 28; ExternalDocs external_docs = 29; Any example = 30; repeated NamedAny vendor_extension = 31; } message SchemaItem { oneof oneof { Schema schema = 1; FileSchema file_schema = 2; } } message SecurityDefinitions { repeated NamedSecurityDefinitionsItem additional_properties = 1; } message SecurityDefinitionsItem { oneof oneof { BasicAuthenticationSecurity basic_authentication_security = 1; ApiKeySecurity api_key_security = 2; Oauth2ImplicitSecurity oauth2_implicit_security = 3; Oauth2PasswordSecurity oauth2_password_security = 4; Oauth2ApplicationSecurity oauth2_application_security = 5; Oauth2AccessCodeSecurity oauth2_access_code_security = 6; } } message SecurityRequirement { repeated NamedStringArray additional_properties = 1; } message StringArray { repeated string value = 1; } message Tag { string name = 1; string description = 2; ExternalDocs external_docs = 3; repeated NamedAny vendor_extension = 4; } message TypeItem { repeated string value = 1; } // Any property starting with x- is valid. message VendorExtension { repeated NamedAny additional_properties = 1; } message Xml { string name = 1; string namespace = 2; string prefix = 3; bool attribute = 4; bool wrapped = 5; repeated NamedAny vendor_extension = 6; }
8,917
0
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic/jsonschema/README.md
# jsonschema This directory contains code for reading, writing, and manipulating JSON schemas.
8,918
0
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic/jsonschema/reader.go
// Copyright 2017 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. //go:generate go run generate-base.go package jsonschema import ( "fmt" "io/ioutil" "strconv" "gopkg.in/yaml.v3" ) // This is a global map of all known Schemas. // It is initialized when the first Schema is created and inserted. var schemas map[string]*Schema // NewBaseSchema builds a schema object from an embedded json representation. func NewBaseSchema() (schema *Schema, err error) { b, err := baseSchemaBytes() if err != nil { return nil, err } var node yaml.Node err = yaml.Unmarshal(b, &node) if err != nil { return nil, err } return NewSchemaFromObject(&node), nil } // NewSchemaFromFile reads a schema from a file. // Currently this assumes that schemas are stored in the source distribution of this project. func NewSchemaFromFile(filename string) (schema *Schema, err error) { file, err := ioutil.ReadFile(filename) if err != nil { return nil, err } var node yaml.Node err = yaml.Unmarshal(file, &node) if err != nil { return nil, err } return NewSchemaFromObject(&node), nil } // NewSchemaFromObject constructs a schema from a parsed JSON object. // Due to the complexity of the schema representation, this is a // custom reader and not the standard Go JSON reader (encoding/json). func NewSchemaFromObject(jsonData *yaml.Node) *Schema { switch jsonData.Kind { case yaml.DocumentNode: return NewSchemaFromObject(jsonData.Content[0]) case yaml.MappingNode: schema := &Schema{} for i := 0; i < len(jsonData.Content); i += 2 { k := jsonData.Content[i].Value v := jsonData.Content[i+1] switch k { case "$schema": schema.Schema = schema.stringValue(v) case "id": schema.ID = schema.stringValue(v) case "multipleOf": schema.MultipleOf = schema.numberValue(v) case "maximum": schema.Maximum = schema.numberValue(v) case "exclusiveMaximum": schema.ExclusiveMaximum = schema.boolValue(v) case "minimum": schema.Minimum = schema.numberValue(v) case "exclusiveMinimum": schema.ExclusiveMinimum = schema.boolValue(v) case "maxLength": schema.MaxLength = schema.intValue(v) case "minLength": schema.MinLength = schema.intValue(v) case "pattern": schema.Pattern = schema.stringValue(v) case "additionalItems": schema.AdditionalItems = schema.schemaOrBooleanValue(v) case "items": schema.Items = schema.schemaOrSchemaArrayValue(v) case "maxItems": schema.MaxItems = schema.intValue(v) case "minItems": schema.MinItems = schema.intValue(v) case "uniqueItems": schema.UniqueItems = schema.boolValue(v) case "maxProperties": schema.MaxProperties = schema.intValue(v) case "minProperties": schema.MinProperties = schema.intValue(v) case "required": schema.Required = schema.arrayOfStringsValue(v) case "additionalProperties": schema.AdditionalProperties = schema.schemaOrBooleanValue(v) case "properties": schema.Properties = schema.mapOfSchemasValue(v) case "patternProperties": schema.PatternProperties = schema.mapOfSchemasValue(v) case "dependencies": schema.Dependencies = schema.mapOfSchemasOrStringArraysValue(v) case "enum": schema.Enumeration = schema.arrayOfEnumValuesValue(v) case "type": schema.Type = schema.stringOrStringArrayValue(v) case "allOf": schema.AllOf = schema.arrayOfSchemasValue(v) case "anyOf": schema.AnyOf = schema.arrayOfSchemasValue(v) case "oneOf": schema.OneOf = schema.arrayOfSchemasValue(v) case "not": schema.Not = NewSchemaFromObject(v) case "definitions": schema.Definitions = schema.mapOfSchemasValue(v) case "title": schema.Title = schema.stringValue(v) case "description": schema.Description = schema.stringValue(v) case "default": schema.Default = v case "format": schema.Format = schema.stringValue(v) case "$ref": schema.Ref = schema.stringValue(v) default: fmt.Printf("UNSUPPORTED (%s)\n", k) } } // insert schema in global map if schema.ID != nil { if schemas == nil { schemas = make(map[string]*Schema, 0) } schemas[*(schema.ID)] = schema } return schema default: fmt.Printf("schemaValue: unexpected node %+v\n", jsonData) return nil } return nil } // // BUILDERS // The following methods build elements of Schemas from interface{} values. // Each returns nil if it is unable to build the desired element. // // Gets the string value of an interface{} value if possible. func (schema *Schema) stringValue(v *yaml.Node) *string { switch v.Kind { case yaml.ScalarNode: return &v.Value default: fmt.Printf("stringValue: unexpected node %+v\n", v) } return nil } // Gets the numeric value of an interface{} value if possible. func (schema *Schema) numberValue(v *yaml.Node) *SchemaNumber { number := &SchemaNumber{} switch v.Kind { case yaml.ScalarNode: switch v.Tag { case "!!float": v2, _ := strconv.ParseFloat(v.Value, 64) number.Float = &v2 return number case "!!int": v2, _ := strconv.ParseInt(v.Value, 10, 64) number.Integer = &v2 return number default: fmt.Printf("stringValue: unexpected node %+v\n", v) } default: fmt.Printf("stringValue: unexpected node %+v\n", v) } return nil } // Gets the integer value of an interface{} value if possible. func (schema *Schema) intValue(v *yaml.Node) *int64 { switch v.Kind { case yaml.ScalarNode: switch v.Tag { case "!!float": v2, _ := strconv.ParseFloat(v.Value, 64) v3 := int64(v2) return &v3 case "!!int": v2, _ := strconv.ParseInt(v.Value, 10, 64) return &v2 default: fmt.Printf("intValue: unexpected node %+v\n", v) } default: fmt.Printf("intValue: unexpected node %+v\n", v) } return nil } // Gets the bool value of an interface{} value if possible. func (schema *Schema) boolValue(v *yaml.Node) *bool { switch v.Kind { case yaml.ScalarNode: switch v.Tag { case "!!bool": v2, _ := strconv.ParseBool(v.Value) return &v2 default: fmt.Printf("boolValue: unexpected node %+v\n", v) } default: fmt.Printf("boolValue: unexpected node %+v\n", v) } return nil } // Gets a map of Schemas from an interface{} value if possible. func (schema *Schema) mapOfSchemasValue(v *yaml.Node) *[]*NamedSchema { switch v.Kind { case yaml.MappingNode: m := make([]*NamedSchema, 0) for i := 0; i < len(v.Content); i += 2 { k2 := v.Content[i].Value v2 := v.Content[i+1] pair := &NamedSchema{Name: k2, Value: NewSchemaFromObject(v2)} m = append(m, pair) } return &m default: fmt.Printf("mapOfSchemasValue: unexpected node %+v\n", v) } return nil } // Gets an array of Schemas from an interface{} value if possible. func (schema *Schema) arrayOfSchemasValue(v *yaml.Node) *[]*Schema { switch v.Kind { case yaml.SequenceNode: m := make([]*Schema, 0) for _, v2 := range v.Content { switch v2.Kind { case yaml.MappingNode: s := NewSchemaFromObject(v2) m = append(m, s) default: fmt.Printf("arrayOfSchemasValue: unexpected node %+v\n", v2) } } return &m case yaml.MappingNode: m := make([]*Schema, 0) s := NewSchemaFromObject(v) m = append(m, s) return &m default: fmt.Printf("arrayOfSchemasValue: unexpected node %+v\n", v) } return nil } // Gets a Schema or an array of Schemas from an interface{} value if possible. func (schema *Schema) schemaOrSchemaArrayValue(v *yaml.Node) *SchemaOrSchemaArray { switch v.Kind { case yaml.SequenceNode: m := make([]*Schema, 0) for _, v2 := range v.Content { switch v2.Kind { case yaml.MappingNode: s := NewSchemaFromObject(v2) m = append(m, s) default: fmt.Printf("schemaOrSchemaArrayValue: unexpected node %+v\n", v2) } } return &SchemaOrSchemaArray{SchemaArray: &m} case yaml.MappingNode: s := NewSchemaFromObject(v) return &SchemaOrSchemaArray{Schema: s} default: fmt.Printf("schemaOrSchemaArrayValue: unexpected node %+v\n", v) } return nil } // Gets an array of strings from an interface{} value if possible. func (schema *Schema) arrayOfStringsValue(v *yaml.Node) *[]string { switch v.Kind { case yaml.ScalarNode: a := []string{v.Value} return &a case yaml.SequenceNode: a := make([]string, 0) for _, v2 := range v.Content { switch v2.Kind { case yaml.ScalarNode: a = append(a, v2.Value) default: fmt.Printf("arrayOfStringsValue: unexpected node %+v\n", v2) } } return &a default: fmt.Printf("arrayOfStringsValue: unexpected node %+v\n", v) } return nil } // Gets a string or an array of strings from an interface{} value if possible. func (schema *Schema) stringOrStringArrayValue(v *yaml.Node) *StringOrStringArray { switch v.Kind { case yaml.ScalarNode: s := &StringOrStringArray{} s.String = &v.Value return s case yaml.SequenceNode: a := make([]string, 0) for _, v2 := range v.Content { switch v2.Kind { case yaml.ScalarNode: a = append(a, v2.Value) default: fmt.Printf("arrayOfStringsValue: unexpected node %+v\n", v2) } } s := &StringOrStringArray{} s.StringArray = &a return s default: fmt.Printf("arrayOfStringsValue: unexpected node %+v\n", v) } return nil } // Gets an array of enum values from an interface{} value if possible. func (schema *Schema) arrayOfEnumValuesValue(v *yaml.Node) *[]SchemaEnumValue { a := make([]SchemaEnumValue, 0) switch v.Kind { case yaml.SequenceNode: for _, v2 := range v.Content { switch v2.Kind { case yaml.ScalarNode: switch v2.Tag { case "!!str": a = append(a, SchemaEnumValue{String: &v2.Value}) case "!!bool": v3, _ := strconv.ParseBool(v2.Value) a = append(a, SchemaEnumValue{Bool: &v3}) default: fmt.Printf("arrayOfEnumValuesValue: unexpected type %s\n", v2.Tag) } default: fmt.Printf("arrayOfEnumValuesValue: unexpected node %+v\n", v2) } } default: fmt.Printf("arrayOfEnumValuesValue: unexpected node %+v\n", v) } return &a } // Gets a map of schemas or string arrays from an interface{} value if possible. func (schema *Schema) mapOfSchemasOrStringArraysValue(v *yaml.Node) *[]*NamedSchemaOrStringArray { m := make([]*NamedSchemaOrStringArray, 0) switch v.Kind { case yaml.MappingNode: for i := 0; i < len(v.Content); i += 2 { k2 := v.Content[i].Value v2 := v.Content[i+1] switch v2.Kind { case yaml.SequenceNode: a := make([]string, 0) for _, v3 := range v2.Content { switch v3.Kind { case yaml.ScalarNode: a = append(a, v3.Value) default: fmt.Printf("mapOfSchemasOrStringArraysValue: unexpected node %+v\n", v3) } } s := &SchemaOrStringArray{} s.StringArray = &a pair := &NamedSchemaOrStringArray{Name: k2, Value: s} m = append(m, pair) default: fmt.Printf("mapOfSchemasOrStringArraysValue: unexpected node %+v\n", v2) } } default: fmt.Printf("mapOfSchemasOrStringArraysValue: unexpected node %+v\n", v) } return &m } // Gets a schema or a boolean value from an interface{} value if possible. func (schema *Schema) schemaOrBooleanValue(v *yaml.Node) *SchemaOrBoolean { schemaOrBoolean := &SchemaOrBoolean{} switch v.Kind { case yaml.ScalarNode: v2, _ := strconv.ParseBool(v.Value) schemaOrBoolean.Boolean = &v2 case yaml.MappingNode: schemaOrBoolean.Schema = NewSchemaFromObject(v) default: fmt.Printf("schemaOrBooleanValue: unexpected node %+v\n", v) } return schemaOrBoolean }
8,919
0
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic/jsonschema/models.go
// Copyright 2017 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Package jsonschema supports the reading, writing, and manipulation // of JSON Schemas. package jsonschema import "gopkg.in/yaml.v3" // The Schema struct models a JSON Schema and, because schemas are // defined hierarchically, contains many references to itself. // All fields are pointers and are nil if the associated values // are not specified. type Schema struct { Schema *string // $schema ID *string // id keyword used for $ref resolution scope Ref *string // $ref, i.e. JSON Pointers // http://json-schema.org/latest/json-schema-validation.html // 5.1. Validation keywords for numeric instances (number and integer) MultipleOf *SchemaNumber Maximum *SchemaNumber ExclusiveMaximum *bool Minimum *SchemaNumber ExclusiveMinimum *bool // 5.2. Validation keywords for strings MaxLength *int64 MinLength *int64 Pattern *string // 5.3. Validation keywords for arrays AdditionalItems *SchemaOrBoolean Items *SchemaOrSchemaArray MaxItems *int64 MinItems *int64 UniqueItems *bool // 5.4. Validation keywords for objects MaxProperties *int64 MinProperties *int64 Required *[]string AdditionalProperties *SchemaOrBoolean Properties *[]*NamedSchema PatternProperties *[]*NamedSchema Dependencies *[]*NamedSchemaOrStringArray // 5.5. Validation keywords for any instance type Enumeration *[]SchemaEnumValue Type *StringOrStringArray AllOf *[]*Schema AnyOf *[]*Schema OneOf *[]*Schema Not *Schema Definitions *[]*NamedSchema // 6. Metadata keywords Title *string Description *string Default *yaml.Node // 7. Semantic validation with "format" Format *string } // These helper structs represent "combination" types that generally can // have values of one type or another. All are used to represent parts // of Schemas. // SchemaNumber represents a value that can be either an Integer or a Float. type SchemaNumber struct { Integer *int64 Float *float64 } // NewSchemaNumberWithInteger creates and returns a new object func NewSchemaNumberWithInteger(i int64) *SchemaNumber { result := &SchemaNumber{} result.Integer = &i return result } // NewSchemaNumberWithFloat creates and returns a new object func NewSchemaNumberWithFloat(f float64) *SchemaNumber { result := &SchemaNumber{} result.Float = &f return result } // SchemaOrBoolean represents a value that can be either a Schema or a Boolean. type SchemaOrBoolean struct { Schema *Schema Boolean *bool } // NewSchemaOrBooleanWithSchema creates and returns a new object func NewSchemaOrBooleanWithSchema(s *Schema) *SchemaOrBoolean { result := &SchemaOrBoolean{} result.Schema = s return result } // NewSchemaOrBooleanWithBoolean creates and returns a new object func NewSchemaOrBooleanWithBoolean(b bool) *SchemaOrBoolean { result := &SchemaOrBoolean{} result.Boolean = &b return result } // StringOrStringArray represents a value that can be either // a String or an Array of Strings. type StringOrStringArray struct { String *string StringArray *[]string } // NewStringOrStringArrayWithString creates and returns a new object func NewStringOrStringArrayWithString(s string) *StringOrStringArray { result := &StringOrStringArray{} result.String = &s return result } // NewStringOrStringArrayWithStringArray creates and returns a new object func NewStringOrStringArrayWithStringArray(a []string) *StringOrStringArray { result := &StringOrStringArray{} result.StringArray = &a return result } // SchemaOrStringArray represents a value that can be either // a Schema or an Array of Strings. type SchemaOrStringArray struct { Schema *Schema StringArray *[]string } // SchemaOrSchemaArray represents a value that can be either // a Schema or an Array of Schemas. type SchemaOrSchemaArray struct { Schema *Schema SchemaArray *[]*Schema } // NewSchemaOrSchemaArrayWithSchema creates and returns a new object func NewSchemaOrSchemaArrayWithSchema(s *Schema) *SchemaOrSchemaArray { result := &SchemaOrSchemaArray{} result.Schema = s return result } // NewSchemaOrSchemaArrayWithSchemaArray creates and returns a new object func NewSchemaOrSchemaArrayWithSchemaArray(a []*Schema) *SchemaOrSchemaArray { result := &SchemaOrSchemaArray{} result.SchemaArray = &a return result } // SchemaEnumValue represents a value that can be part of an // enumeration in a Schema. type SchemaEnumValue struct { String *string Bool *bool } // NamedSchema is a name-value pair that is used to emulate maps // with ordered keys. type NamedSchema struct { Name string Value *Schema } // NewNamedSchema creates and returns a new object func NewNamedSchema(name string, value *Schema) *NamedSchema { return &NamedSchema{Name: name, Value: value} } // NamedSchemaOrStringArray is a name-value pair that is used // to emulate maps with ordered keys. type NamedSchemaOrStringArray struct { Name string Value *SchemaOrStringArray } // Access named subschemas by name func namedSchemaArrayElementWithName(array *[]*NamedSchema, name string) *Schema { if array == nil { return nil } for _, pair := range *array { if pair.Name == name { return pair.Value } } return nil } // PropertyWithName returns the selected element. func (s *Schema) PropertyWithName(name string) *Schema { return namedSchemaArrayElementWithName(s.Properties, name) } // PatternPropertyWithName returns the selected element. func (s *Schema) PatternPropertyWithName(name string) *Schema { return namedSchemaArrayElementWithName(s.PatternProperties, name) } // DefinitionWithName returns the selected element. func (s *Schema) DefinitionWithName(name string) *Schema { return namedSchemaArrayElementWithName(s.Definitions, name) } // AddProperty adds a named property. func (s *Schema) AddProperty(name string, property *Schema) { *s.Properties = append(*s.Properties, NewNamedSchema(name, property)) }
8,920
0
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic/jsonschema/writer.go
// Copyright 2017 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package jsonschema import ( "fmt" "gopkg.in/yaml.v3" ) const indentation = " " func renderMappingNode(node *yaml.Node, indent string) (result string) { result = "{\n" innerIndent := indent + indentation for i := 0; i < len(node.Content); i += 2 { // first print the key key := node.Content[i].Value result += fmt.Sprintf("%s\"%+v\": ", innerIndent, key) // then the value value := node.Content[i+1] switch value.Kind { case yaml.ScalarNode: result += "\"" + value.Value + "\"" case yaml.MappingNode: result += renderMappingNode(value, innerIndent) case yaml.SequenceNode: result += renderSequenceNode(value, innerIndent) default: result += fmt.Sprintf("???MapItem(Key:%+v, Value:%T)", value, value) } if i < len(node.Content)-2 { result += "," } result += "\n" } result += indent + "}" return result } func renderSequenceNode(node *yaml.Node, indent string) (result string) { result = "[\n" innerIndent := indent + indentation for i := 0; i < len(node.Content); i++ { item := node.Content[i] switch item.Kind { case yaml.ScalarNode: result += innerIndent + "\"" + item.Value + "\"" case yaml.MappingNode: result += innerIndent + renderMappingNode(item, innerIndent) + "" default: result += innerIndent + fmt.Sprintf("???ArrayItem(%+v)", item) } if i < len(node.Content)-1 { result += "," } result += "\n" } result += indent + "]" return result } func renderStringArray(array []string, indent string) (result string) { result = "[\n" innerIndent := indent + indentation for i, item := range array { result += innerIndent + "\"" + item + "\"" if i < len(array)-1 { result += "," } result += "\n" } result += indent + "]" return result } // Render renders a yaml.Node as JSON func Render(node *yaml.Node) string { if node.Kind == yaml.DocumentNode { if len(node.Content) == 1 { return Render(node.Content[0]) } } else if node.Kind == yaml.MappingNode { return renderMappingNode(node, "") + "\n" } else if node.Kind == yaml.SequenceNode { return renderSequenceNode(node, "") + "\n" } return "" } func (object *SchemaNumber) nodeValue() *yaml.Node { if object.Integer != nil { return nodeForInt64(*object.Integer) } else if object.Float != nil { return nodeForFloat64(*object.Float) } else { return nil } } func (object *SchemaOrBoolean) nodeValue() *yaml.Node { if object.Schema != nil { return object.Schema.nodeValue() } else if object.Boolean != nil { return nodeForBoolean(*object.Boolean) } else { return nil } } func nodeForStringArray(array []string) *yaml.Node { content := make([]*yaml.Node, 0) for _, item := range array { content = append(content, nodeForString(item)) } return nodeForSequence(content) } func nodeForSchemaArray(array []*Schema) *yaml.Node { content := make([]*yaml.Node, 0) for _, item := range array { content = append(content, item.nodeValue()) } return nodeForSequence(content) } func (object *StringOrStringArray) nodeValue() *yaml.Node { if object.String != nil { return nodeForString(*object.String) } else if object.StringArray != nil { return nodeForStringArray(*(object.StringArray)) } else { return nil } } func (object *SchemaOrStringArray) nodeValue() *yaml.Node { if object.Schema != nil { return object.Schema.nodeValue() } else if object.StringArray != nil { return nodeForStringArray(*(object.StringArray)) } else { return nil } } func (object *SchemaOrSchemaArray) nodeValue() *yaml.Node { if object.Schema != nil { return object.Schema.nodeValue() } else if object.SchemaArray != nil { return nodeForSchemaArray(*(object.SchemaArray)) } else { return nil } } func (object *SchemaEnumValue) nodeValue() *yaml.Node { if object.String != nil { return nodeForString(*object.String) } else if object.Bool != nil { return nodeForBoolean(*object.Bool) } else { return nil } } func nodeForNamedSchemaArray(array *[]*NamedSchema) *yaml.Node { content := make([]*yaml.Node, 0) for _, pair := range *(array) { content = appendPair(content, pair.Name, pair.Value.nodeValue()) } return nodeForMapping(content) } func nodeForNamedSchemaOrStringArray(array *[]*NamedSchemaOrStringArray) *yaml.Node { content := make([]*yaml.Node, 0) for _, pair := range *(array) { content = appendPair(content, pair.Name, pair.Value.nodeValue()) } return nodeForMapping(content) } func nodeForSchemaEnumArray(array *[]SchemaEnumValue) *yaml.Node { content := make([]*yaml.Node, 0) for _, item := range *array { content = append(content, item.nodeValue()) } return nodeForSequence(content) } func nodeForMapping(content []*yaml.Node) *yaml.Node { return &yaml.Node{ Kind: yaml.MappingNode, Content: content, } } func nodeForSequence(content []*yaml.Node) *yaml.Node { return &yaml.Node{ Kind: yaml.SequenceNode, Content: content, } } func nodeForString(value string) *yaml.Node { return &yaml.Node{ Kind: yaml.ScalarNode, Tag: "!!str", Value: value, } } func nodeForBoolean(value bool) *yaml.Node { return &yaml.Node{ Kind: yaml.ScalarNode, Tag: "!!bool", Value: fmt.Sprintf("%t", value), } } func nodeForInt64(value int64) *yaml.Node { return &yaml.Node{ Kind: yaml.ScalarNode, Tag: "!!int", Value: fmt.Sprintf("%d", value), } } func nodeForFloat64(value float64) *yaml.Node { return &yaml.Node{ Kind: yaml.ScalarNode, Tag: "!!float", Value: fmt.Sprintf("%f", value), } } func appendPair(nodes []*yaml.Node, name string, value *yaml.Node) []*yaml.Node { nodes = append(nodes, nodeForString(name)) nodes = append(nodes, value) return nodes } func (schema *Schema) nodeValue() *yaml.Node { n := &yaml.Node{Kind: yaml.MappingNode} content := make([]*yaml.Node, 0) if schema.Title != nil { content = appendPair(content, "title", nodeForString(*schema.Title)) } if schema.ID != nil { content = appendPair(content, "id", nodeForString(*schema.ID)) } if schema.Schema != nil { content = appendPair(content, "$schema", nodeForString(*schema.Schema)) } if schema.Type != nil { content = appendPair(content, "type", schema.Type.nodeValue()) } if schema.Items != nil { content = appendPair(content, "items", schema.Items.nodeValue()) } if schema.Description != nil { content = appendPair(content, "description", nodeForString(*schema.Description)) } if schema.Required != nil { content = appendPair(content, "required", nodeForStringArray(*schema.Required)) } if schema.AdditionalProperties != nil { content = appendPair(content, "additionalProperties", schema.AdditionalProperties.nodeValue()) } if schema.PatternProperties != nil { content = appendPair(content, "patternProperties", nodeForNamedSchemaArray(schema.PatternProperties)) } if schema.Properties != nil { content = appendPair(content, "properties", nodeForNamedSchemaArray(schema.Properties)) } if schema.Dependencies != nil { content = appendPair(content, "dependencies", nodeForNamedSchemaOrStringArray(schema.Dependencies)) } if schema.Ref != nil { content = appendPair(content, "$ref", nodeForString(*schema.Ref)) } if schema.MultipleOf != nil { content = appendPair(content, "multipleOf", schema.MultipleOf.nodeValue()) } if schema.Maximum != nil { content = appendPair(content, "maximum", schema.Maximum.nodeValue()) } if schema.ExclusiveMaximum != nil { content = appendPair(content, "exclusiveMaximum", nodeForBoolean(*schema.ExclusiveMaximum)) } if schema.Minimum != nil { content = appendPair(content, "minimum", schema.Minimum.nodeValue()) } if schema.ExclusiveMinimum != nil { content = appendPair(content, "exclusiveMinimum", nodeForBoolean(*schema.ExclusiveMinimum)) } if schema.MaxLength != nil { content = appendPair(content, "maxLength", nodeForInt64(*schema.MaxLength)) } if schema.MinLength != nil { content = appendPair(content, "minLength", nodeForInt64(*schema.MinLength)) } if schema.Pattern != nil { content = appendPair(content, "pattern", nodeForString(*schema.Pattern)) } if schema.AdditionalItems != nil { content = appendPair(content, "additionalItems", schema.AdditionalItems.nodeValue()) } if schema.MaxItems != nil { content = appendPair(content, "maxItems", nodeForInt64(*schema.MaxItems)) } if schema.MinItems != nil { content = appendPair(content, "minItems", nodeForInt64(*schema.MinItems)) } if schema.UniqueItems != nil { content = appendPair(content, "uniqueItems", nodeForBoolean(*schema.UniqueItems)) } if schema.MaxProperties != nil { content = appendPair(content, "maxProperties", nodeForInt64(*schema.MaxProperties)) } if schema.MinProperties != nil { content = appendPair(content, "minProperties", nodeForInt64(*schema.MinProperties)) } if schema.Enumeration != nil { content = appendPair(content, "enum", nodeForSchemaEnumArray(schema.Enumeration)) } if schema.AllOf != nil { content = appendPair(content, "allOf", nodeForSchemaArray(*schema.AllOf)) } if schema.AnyOf != nil { content = appendPair(content, "anyOf", nodeForSchemaArray(*schema.AnyOf)) } if schema.OneOf != nil { content = appendPair(content, "oneOf", nodeForSchemaArray(*schema.OneOf)) } if schema.Not != nil { content = appendPair(content, "not", schema.Not.nodeValue()) } if schema.Definitions != nil { content = appendPair(content, "definitions", nodeForNamedSchemaArray(schema.Definitions)) } if schema.Default != nil { // m = append(m, yaml.MapItem{Key: "default", Value: *schema.Default}) } if schema.Format != nil { content = appendPair(content, "format", nodeForString(*schema.Format)) } n.Content = content return n } // JSONString returns a json representation of a schema. func (schema *Schema) JSONString() string { node := schema.nodeValue() return Render(node) }
8,921
0
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic/jsonschema/base.go
// THIS FILE IS AUTOMATICALLY GENERATED. package jsonschema import ( "encoding/base64" ) func baseSchemaBytes() ([]byte, error){ return base64.StdEncoding.DecodeString( `ewogICAgImlkIjogImh0dHA6Ly9qc29uLXNjaGVtYS5vcmcvZHJhZnQtMDQvc2NoZW1hIyIsCiAgICAi JHNjaGVtYSI6ICJodHRwOi8vanNvbi1zY2hlbWEub3JnL2RyYWZ0LTA0L3NjaGVtYSMiLAogICAgImRl c2NyaXB0aW9uIjogIkNvcmUgc2NoZW1hIG1ldGEtc2NoZW1hIiwKICAgICJkZWZpbml0aW9ucyI6IHsK ICAgICAgICAic2NoZW1hQXJyYXkiOiB7CiAgICAgICAgICAgICJ0eXBlIjogImFycmF5IiwKICAgICAg ICAgICAgIm1pbkl0ZW1zIjogMSwKICAgICAgICAgICAgIml0ZW1zIjogeyAiJHJlZiI6ICIjIiB9CiAg ICAgICAgfSwKICAgICAgICAicG9zaXRpdmVJbnRlZ2VyIjogewogICAgICAgICAgICAidHlwZSI6ICJp bnRlZ2VyIiwKICAgICAgICAgICAgIm1pbmltdW0iOiAwCiAgICAgICAgfSwKICAgICAgICAicG9zaXRp dmVJbnRlZ2VyRGVmYXVsdDAiOiB7CiAgICAgICAgICAgICJhbGxPZiI6IFsgeyAiJHJlZiI6ICIjL2Rl ZmluaXRpb25zL3Bvc2l0aXZlSW50ZWdlciIgfSwgeyAiZGVmYXVsdCI6IDAgfSBdCiAgICAgICAgfSwK ICAgICAgICAic2ltcGxlVHlwZXMiOiB7CiAgICAgICAgICAgICJlbnVtIjogWyAiYXJyYXkiLCAiYm9v bGVhbiIsICJpbnRlZ2VyIiwgIm51bGwiLCAibnVtYmVyIiwgIm9iamVjdCIsICJzdHJpbmciIF0KICAg ICAgICB9LAogICAgICAgICJzdHJpbmdBcnJheSI6IHsKICAgICAgICAgICAgInR5cGUiOiAiYXJyYXki LAogICAgICAgICAgICAiaXRlbXMiOiB7ICJ0eXBlIjogInN0cmluZyIgfSwKICAgICAgICAgICAgIm1p bkl0ZW1zIjogMSwKICAgICAgICAgICAgInVuaXF1ZUl0ZW1zIjogdHJ1ZQogICAgICAgIH0KICAgIH0s CiAgICAidHlwZSI6ICJvYmplY3QiLAogICAgInByb3BlcnRpZXMiOiB7CiAgICAgICAgImlkIjogewog ICAgICAgICAgICAidHlwZSI6ICJzdHJpbmciLAogICAgICAgICAgICAiZm9ybWF0IjogInVyaSIKICAg ICAgICB9LAogICAgICAgICIkc2NoZW1hIjogewogICAgICAgICAgICAidHlwZSI6ICJzdHJpbmciLAog ICAgICAgICAgICAiZm9ybWF0IjogInVyaSIKICAgICAgICB9LAogICAgICAgICJ0aXRsZSI6IHsKICAg ICAgICAgICAgInR5cGUiOiAic3RyaW5nIgogICAgICAgIH0sCiAgICAgICAgImRlc2NyaXB0aW9uIjog ewogICAgICAgICAgICAidHlwZSI6ICJzdHJpbmciCiAgICAgICAgfSwKICAgICAgICAiZGVmYXVsdCI6 IHt9LAogICAgICAgICJtdWx0aXBsZU9mIjogewogICAgICAgICAgICAidHlwZSI6ICJudW1iZXIiLAog ICAgICAgICAgICAibWluaW11bSI6IDAsCiAgICAgICAgICAgICJleGNsdXNpdmVNaW5pbXVtIjogdHJ1 ZQogICAgICAgIH0sCiAgICAgICAgIm1heGltdW0iOiB7CiAgICAgICAgICAgICJ0eXBlIjogIm51bWJl ciIKICAgICAgICB9LAogICAgICAgICJleGNsdXNpdmVNYXhpbXVtIjogewogICAgICAgICAgICAidHlw ZSI6ICJib29sZWFuIiwKICAgICAgICAgICAgImRlZmF1bHQiOiBmYWxzZQogICAgICAgIH0sCiAgICAg ICAgIm1pbmltdW0iOiB7CiAgICAgICAgICAgICJ0eXBlIjogIm51bWJlciIKICAgICAgICB9LAogICAg ICAgICJleGNsdXNpdmVNaW5pbXVtIjogewogICAgICAgICAgICAidHlwZSI6ICJib29sZWFuIiwKICAg ICAgICAgICAgImRlZmF1bHQiOiBmYWxzZQogICAgICAgIH0sCiAgICAgICAgIm1heExlbmd0aCI6IHsg IiRyZWYiOiAiIy9kZWZpbml0aW9ucy9wb3NpdGl2ZUludGVnZXIiIH0sCiAgICAgICAgIm1pbkxlbmd0 aCI6IHsgIiRyZWYiOiAiIy9kZWZpbml0aW9ucy9wb3NpdGl2ZUludGVnZXJEZWZhdWx0MCIgfSwKICAg ICAgICAicGF0dGVybiI6IHsKICAgICAgICAgICAgInR5cGUiOiAic3RyaW5nIiwKICAgICAgICAgICAg ImZvcm1hdCI6ICJyZWdleCIKICAgICAgICB9LAogICAgICAgICJhZGRpdGlvbmFsSXRlbXMiOiB7CiAg ICAgICAgICAgICJhbnlPZiI6IFsKICAgICAgICAgICAgICAgIHsgInR5cGUiOiAiYm9vbGVhbiIgfSwK ICAgICAgICAgICAgICAgIHsgIiRyZWYiOiAiIyIgfQogICAgICAgICAgICBdLAogICAgICAgICAgICAi ZGVmYXVsdCI6IHt9CiAgICAgICAgfSwKICAgICAgICAiaXRlbXMiOiB7CiAgICAgICAgICAgICJhbnlP ZiI6IFsKICAgICAgICAgICAgICAgIHsgIiRyZWYiOiAiIyIgfSwKICAgICAgICAgICAgICAgIHsgIiRy ZWYiOiAiIy9kZWZpbml0aW9ucy9zY2hlbWFBcnJheSIgfQogICAgICAgICAgICBdLAogICAgICAgICAg ICAiZGVmYXVsdCI6IHt9CiAgICAgICAgfSwKICAgICAgICAibWF4SXRlbXMiOiB7ICIkcmVmIjogIiMv ZGVmaW5pdGlvbnMvcG9zaXRpdmVJbnRlZ2VyIiB9LAogICAgICAgICJtaW5JdGVtcyI6IHsgIiRyZWYi OiAiIy9kZWZpbml0aW9ucy9wb3NpdGl2ZUludGVnZXJEZWZhdWx0MCIgfSwKICAgICAgICAidW5pcXVl SXRlbXMiOiB7CiAgICAgICAgICAgICJ0eXBlIjogImJvb2xlYW4iLAogICAgICAgICAgICAiZGVmYXVs dCI6IGZhbHNlCiAgICAgICAgfSwKICAgICAgICAibWF4UHJvcGVydGllcyI6IHsgIiRyZWYiOiAiIy9k ZWZpbml0aW9ucy9wb3NpdGl2ZUludGVnZXIiIH0sCiAgICAgICAgIm1pblByb3BlcnRpZXMiOiB7ICIk cmVmIjogIiMvZGVmaW5pdGlvbnMvcG9zaXRpdmVJbnRlZ2VyRGVmYXVsdDAiIH0sCiAgICAgICAgInJl cXVpcmVkIjogeyAiJHJlZiI6ICIjL2RlZmluaXRpb25zL3N0cmluZ0FycmF5IiB9LAogICAgICAgICJh ZGRpdGlvbmFsUHJvcGVydGllcyI6IHsKICAgICAgICAgICAgImFueU9mIjogWwogICAgICAgICAgICAg ICAgeyAidHlwZSI6ICJib29sZWFuIiB9LAogICAgICAgICAgICAgICAgeyAiJHJlZiI6ICIjIiB9CiAg ICAgICAgICAgIF0sCiAgICAgICAgICAgICJkZWZhdWx0Ijoge30KICAgICAgICB9LAogICAgICAgICJk ZWZpbml0aW9ucyI6IHsKICAgICAgICAgICAgInR5cGUiOiAib2JqZWN0IiwKICAgICAgICAgICAgImFk ZGl0aW9uYWxQcm9wZXJ0aWVzIjogeyAiJHJlZiI6ICIjIiB9LAogICAgICAgICAgICAiZGVmYXVsdCI6 IHt9CiAgICAgICAgfSwKICAgICAgICAicHJvcGVydGllcyI6IHsKICAgICAgICAgICAgInR5cGUiOiAi b2JqZWN0IiwKICAgICAgICAgICAgImFkZGl0aW9uYWxQcm9wZXJ0aWVzIjogeyAiJHJlZiI6ICIjIiB9 LAogICAgICAgICAgICAiZGVmYXVsdCI6IHt9CiAgICAgICAgfSwKICAgICAgICAicGF0dGVyblByb3Bl cnRpZXMiOiB7CiAgICAgICAgICAgICJ0eXBlIjogIm9iamVjdCIsCiAgICAgICAgICAgICJhZGRpdGlv bmFsUHJvcGVydGllcyI6IHsgIiRyZWYiOiAiIyIgfSwKICAgICAgICAgICAgImRlZmF1bHQiOiB7fQog ICAgICAgIH0sCiAgICAgICAgImRlcGVuZGVuY2llcyI6IHsKICAgICAgICAgICAgInR5cGUiOiAib2Jq ZWN0IiwKICAgICAgICAgICAgImFkZGl0aW9uYWxQcm9wZXJ0aWVzIjogewogICAgICAgICAgICAgICAg ImFueU9mIjogWwogICAgICAgICAgICAgICAgICAgIHsgIiRyZWYiOiAiIyIgfSwKICAgICAgICAgICAg ICAgICAgICB7ICIkcmVmIjogIiMvZGVmaW5pdGlvbnMvc3RyaW5nQXJyYXkiIH0KICAgICAgICAgICAg ICAgIF0KICAgICAgICAgICAgfQogICAgICAgIH0sCiAgICAgICAgImVudW0iOiB7CiAgICAgICAgICAg ICJ0eXBlIjogImFycmF5IiwKICAgICAgICAgICAgIm1pbkl0ZW1zIjogMSwKICAgICAgICAgICAgInVu aXF1ZUl0ZW1zIjogdHJ1ZQogICAgICAgIH0sCiAgICAgICAgInR5cGUiOiB7CiAgICAgICAgICAgICJh bnlPZiI6IFsKICAgICAgICAgICAgICAgIHsgIiRyZWYiOiAiIy9kZWZpbml0aW9ucy9zaW1wbGVUeXBl cyIgfSwKICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICAidHlwZSI6ICJhcnJheSIs CiAgICAgICAgICAgICAgICAgICAgIml0ZW1zIjogeyAiJHJlZiI6ICIjL2RlZmluaXRpb25zL3NpbXBs ZVR5cGVzIiB9LAogICAgICAgICAgICAgICAgICAgICJtaW5JdGVtcyI6IDEsCiAgICAgICAgICAgICAg ICAgICAgInVuaXF1ZUl0ZW1zIjogdHJ1ZQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICBdCiAg ICAgICAgfSwKICAgICAgICAiYWxsT2YiOiB7ICIkcmVmIjogIiMvZGVmaW5pdGlvbnMvc2NoZW1hQXJy YXkiIH0sCiAgICAgICAgImFueU9mIjogeyAiJHJlZiI6ICIjL2RlZmluaXRpb25zL3NjaGVtYUFycmF5 IiB9LAogICAgICAgICJvbmVPZiI6IHsgIiRyZWYiOiAiIy9kZWZpbml0aW9ucy9zY2hlbWFBcnJheSIg fSwKICAgICAgICAibm90IjogeyAiJHJlZiI6ICIjIiB9CiAgICB9LAogICAgImRlcGVuZGVuY2llcyI6 IHsKICAgICAgICAiZXhjbHVzaXZlTWF4aW11bSI6IFsgIm1heGltdW0iIF0sCiAgICAgICAgImV4Y2x1 c2l2ZU1pbmltdW0iOiBbICJtaW5pbXVtIiBdCiAgICB9LAogICAgImRlZmF1bHQiOiB7fQp9Cg==`)}
8,922
0
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic/jsonschema/operations.go
// Copyright 2017 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package jsonschema import ( "fmt" "log" "strings" ) // // OPERATIONS // The following methods perform operations on Schemas. // // IsEmpty returns true if no members of the Schema are specified. func (schema *Schema) IsEmpty() bool { return (schema.Schema == nil) && (schema.ID == nil) && (schema.MultipleOf == nil) && (schema.Maximum == nil) && (schema.ExclusiveMaximum == nil) && (schema.Minimum == nil) && (schema.ExclusiveMinimum == nil) && (schema.MaxLength == nil) && (schema.MinLength == nil) && (schema.Pattern == nil) && (schema.AdditionalItems == nil) && (schema.Items == nil) && (schema.MaxItems == nil) && (schema.MinItems == nil) && (schema.UniqueItems == nil) && (schema.MaxProperties == nil) && (schema.MinProperties == nil) && (schema.Required == nil) && (schema.AdditionalProperties == nil) && (schema.Properties == nil) && (schema.PatternProperties == nil) && (schema.Dependencies == nil) && (schema.Enumeration == nil) && (schema.Type == nil) && (schema.AllOf == nil) && (schema.AnyOf == nil) && (schema.OneOf == nil) && (schema.Not == nil) && (schema.Definitions == nil) && (schema.Title == nil) && (schema.Description == nil) && (schema.Default == nil) && (schema.Format == nil) && (schema.Ref == nil) } // IsEqual returns true if two schemas are equal. func (schema *Schema) IsEqual(schema2 *Schema) bool { return schema.String() == schema2.String() } // SchemaOperation represents a function that can be applied to a Schema. type SchemaOperation func(schema *Schema, context string) // Applies a specified function to a Schema and all of the Schemas that it contains. func (schema *Schema) applyToSchemas(operation SchemaOperation, context string) { if schema.AdditionalItems != nil { s := schema.AdditionalItems.Schema if s != nil { s.applyToSchemas(operation, "AdditionalItems") } } if schema.Items != nil { if schema.Items.SchemaArray != nil { for _, s := range *(schema.Items.SchemaArray) { s.applyToSchemas(operation, "Items.SchemaArray") } } else if schema.Items.Schema != nil { schema.Items.Schema.applyToSchemas(operation, "Items.Schema") } } if schema.AdditionalProperties != nil { s := schema.AdditionalProperties.Schema if s != nil { s.applyToSchemas(operation, "AdditionalProperties") } } if schema.Properties != nil { for _, pair := range *(schema.Properties) { s := pair.Value s.applyToSchemas(operation, "Properties") } } if schema.PatternProperties != nil { for _, pair := range *(schema.PatternProperties) { s := pair.Value s.applyToSchemas(operation, "PatternProperties") } } if schema.Dependencies != nil { for _, pair := range *(schema.Dependencies) { schemaOrStringArray := pair.Value s := schemaOrStringArray.Schema if s != nil { s.applyToSchemas(operation, "Dependencies") } } } if schema.AllOf != nil { for _, s := range *(schema.AllOf) { s.applyToSchemas(operation, "AllOf") } } if schema.AnyOf != nil { for _, s := range *(schema.AnyOf) { s.applyToSchemas(operation, "AnyOf") } } if schema.OneOf != nil { for _, s := range *(schema.OneOf) { s.applyToSchemas(operation, "OneOf") } } if schema.Not != nil { schema.Not.applyToSchemas(operation, "Not") } if schema.Definitions != nil { for _, pair := range *(schema.Definitions) { s := pair.Value s.applyToSchemas(operation, "Definitions") } } operation(schema, context) } // CopyProperties copies all non-nil properties from the source Schema to the schema Schema. func (schema *Schema) CopyProperties(source *Schema) { if source.Schema != nil { schema.Schema = source.Schema } if source.ID != nil { schema.ID = source.ID } if source.MultipleOf != nil { schema.MultipleOf = source.MultipleOf } if source.Maximum != nil { schema.Maximum = source.Maximum } if source.ExclusiveMaximum != nil { schema.ExclusiveMaximum = source.ExclusiveMaximum } if source.Minimum != nil { schema.Minimum = source.Minimum } if source.ExclusiveMinimum != nil { schema.ExclusiveMinimum = source.ExclusiveMinimum } if source.MaxLength != nil { schema.MaxLength = source.MaxLength } if source.MinLength != nil { schema.MinLength = source.MinLength } if source.Pattern != nil { schema.Pattern = source.Pattern } if source.AdditionalItems != nil { schema.AdditionalItems = source.AdditionalItems } if source.Items != nil { schema.Items = source.Items } if source.MaxItems != nil { schema.MaxItems = source.MaxItems } if source.MinItems != nil { schema.MinItems = source.MinItems } if source.UniqueItems != nil { schema.UniqueItems = source.UniqueItems } if source.MaxProperties != nil { schema.MaxProperties = source.MaxProperties } if source.MinProperties != nil { schema.MinProperties = source.MinProperties } if source.Required != nil { schema.Required = source.Required } if source.AdditionalProperties != nil { schema.AdditionalProperties = source.AdditionalProperties } if source.Properties != nil { schema.Properties = source.Properties } if source.PatternProperties != nil { schema.PatternProperties = source.PatternProperties } if source.Dependencies != nil { schema.Dependencies = source.Dependencies } if source.Enumeration != nil { schema.Enumeration = source.Enumeration } if source.Type != nil { schema.Type = source.Type } if source.AllOf != nil { schema.AllOf = source.AllOf } if source.AnyOf != nil { schema.AnyOf = source.AnyOf } if source.OneOf != nil { schema.OneOf = source.OneOf } if source.Not != nil { schema.Not = source.Not } if source.Definitions != nil { schema.Definitions = source.Definitions } if source.Title != nil { schema.Title = source.Title } if source.Description != nil { schema.Description = source.Description } if source.Default != nil { schema.Default = source.Default } if source.Format != nil { schema.Format = source.Format } if source.Ref != nil { schema.Ref = source.Ref } } // TypeIs returns true if the Type of a Schema includes the specified type func (schema *Schema) TypeIs(typeName string) bool { if schema.Type != nil { // the schema Type is either a string or an array of strings if schema.Type.String != nil { return (*(schema.Type.String) == typeName) } else if schema.Type.StringArray != nil { for _, n := range *(schema.Type.StringArray) { if n == typeName { return true } } } } return false } // ResolveRefs resolves "$ref" elements in a Schema and its children. // But if a reference refers to an object type, is inside a oneOf, or contains a oneOf, // the reference is kept and we expect downstream tools to separately model these // referenced schemas. func (schema *Schema) ResolveRefs() { rootSchema := schema count := 1 for count > 0 { count = 0 schema.applyToSchemas( func(schema *Schema, context string) { if schema.Ref != nil { resolvedRef, err := rootSchema.resolveJSONPointer(*(schema.Ref)) if err != nil { log.Printf("%+v", err) } else if resolvedRef.TypeIs("object") { // don't substitute for objects, we'll model the referenced schema with a class } else if context == "OneOf" { // don't substitute for references inside oneOf declarations } else if resolvedRef.OneOf != nil { // don't substitute for references that contain oneOf declarations } else if resolvedRef.AdditionalProperties != nil { // don't substitute for references that look like objects } else { schema.Ref = nil schema.CopyProperties(resolvedRef) count++ } } }, "") } } // resolveJSONPointer resolves JSON pointers. // This current implementation is very crude and custom for OpenAPI 2.0 schemas. // It panics for any pointer that it is unable to resolve. func (schema *Schema) resolveJSONPointer(ref string) (result *Schema, err error) { parts := strings.Split(ref, "#") if len(parts) == 2 { documentName := parts[0] + "#" if documentName == "#" && schema.ID != nil { documentName = *(schema.ID) } path := parts[1] document := schemas[documentName] pathParts := strings.Split(path, "/") // we currently do a very limited (hard-coded) resolution of certain paths and log errors for missed cases if len(pathParts) == 1 { return document, nil } else if len(pathParts) == 3 { switch pathParts[1] { case "definitions": dictionary := document.Definitions for _, pair := range *dictionary { if pair.Name == pathParts[2] { result = pair.Value } } case "properties": dictionary := document.Properties for _, pair := range *dictionary { if pair.Name == pathParts[2] { result = pair.Value } } default: break } } } if result == nil { return nil, fmt.Errorf("unresolved pointer: %+v", ref) } return result, nil } // ResolveAllOfs replaces "allOf" elements by merging their properties into the parent Schema. func (schema *Schema) ResolveAllOfs() { schema.applyToSchemas( func(schema *Schema, context string) { if schema.AllOf != nil { for _, allOf := range *(schema.AllOf) { schema.CopyProperties(allOf) } schema.AllOf = nil } }, "resolveAllOfs") } // ResolveAnyOfs replaces all "anyOf" elements with "oneOf". func (schema *Schema) ResolveAnyOfs() { schema.applyToSchemas( func(schema *Schema, context string) { if schema.AnyOf != nil { schema.OneOf = schema.AnyOf schema.AnyOf = nil } }, "resolveAnyOfs") } // return a pointer to a copy of a passed-in string func stringptr(input string) (output *string) { return &input } // CopyOfficialSchemaProperty copies a named property from the official JSON Schema definition func (schema *Schema) CopyOfficialSchemaProperty(name string) { *schema.Properties = append(*schema.Properties, NewNamedSchema(name, &Schema{Ref: stringptr("http://json-schema.org/draft-04/schema#/properties/" + name)})) } // CopyOfficialSchemaProperties copies named properties from the official JSON Schema definition func (schema *Schema) CopyOfficialSchemaProperties(names []string) { for _, name := range names { schema.CopyOfficialSchemaProperty(name) } }
8,923
0
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic/jsonschema/schema.json
{ "id": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-04/schema#", "description": "Core schema meta-schema", "definitions": { "schemaArray": { "type": "array", "minItems": 1, "items": { "$ref": "#" } }, "positiveInteger": { "type": "integer", "minimum": 0 }, "positiveIntegerDefault0": { "allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ] }, "simpleTypes": { "enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ] }, "stringArray": { "type": "array", "items": { "type": "string" }, "minItems": 1, "uniqueItems": true } }, "type": "object", "properties": { "id": { "type": "string", "format": "uri" }, "$schema": { "type": "string", "format": "uri" }, "title": { "type": "string" }, "description": { "type": "string" }, "default": {}, "multipleOf": { "type": "number", "minimum": 0, "exclusiveMinimum": true }, "maximum": { "type": "number" }, "exclusiveMaximum": { "type": "boolean", "default": false }, "minimum": { "type": "number" }, "exclusiveMinimum": { "type": "boolean", "default": false }, "maxLength": { "$ref": "#/definitions/positiveInteger" }, "minLength": { "$ref": "#/definitions/positiveIntegerDefault0" }, "pattern": { "type": "string", "format": "regex" }, "additionalItems": { "anyOf": [ { "type": "boolean" }, { "$ref": "#" } ], "default": {} }, "items": { "anyOf": [ { "$ref": "#" }, { "$ref": "#/definitions/schemaArray" } ], "default": {} }, "maxItems": { "$ref": "#/definitions/positiveInteger" }, "minItems": { "$ref": "#/definitions/positiveIntegerDefault0" }, "uniqueItems": { "type": "boolean", "default": false }, "maxProperties": { "$ref": "#/definitions/positiveInteger" }, "minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" }, "required": { "$ref": "#/definitions/stringArray" }, "additionalProperties": { "anyOf": [ { "type": "boolean" }, { "$ref": "#" } ], "default": {} }, "definitions": { "type": "object", "additionalProperties": { "$ref": "#" }, "default": {} }, "properties": { "type": "object", "additionalProperties": { "$ref": "#" }, "default": {} }, "patternProperties": { "type": "object", "additionalProperties": { "$ref": "#" }, "default": {} }, "dependencies": { "type": "object", "additionalProperties": { "anyOf": [ { "$ref": "#" }, { "$ref": "#/definitions/stringArray" } ] } }, "enum": { "type": "array", "minItems": 1, "uniqueItems": true }, "type": { "anyOf": [ { "$ref": "#/definitions/simpleTypes" }, { "type": "array", "items": { "$ref": "#/definitions/simpleTypes" }, "minItems": 1, "uniqueItems": true } ] }, "allOf": { "$ref": "#/definitions/schemaArray" }, "anyOf": { "$ref": "#/definitions/schemaArray" }, "oneOf": { "$ref": "#/definitions/schemaArray" }, "not": { "$ref": "#" } }, "dependencies": { "exclusiveMaximum": [ "maximum" ], "exclusiveMinimum": [ "minimum" ] }, "default": {} }
8,924
0
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic/jsonschema/display.go
// Copyright 2017 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package jsonschema import ( "fmt" "strings" ) // // DISPLAY // The following methods display Schemas. // // Description returns a string representation of a string or string array. func (s *StringOrStringArray) Description() string { if s.String != nil { return *s.String } if s.StringArray != nil { return strings.Join(*s.StringArray, ", ") } return "" } // Returns a string representation of a Schema. func (schema *Schema) String() string { return schema.describeSchema("") } // Helper: Returns a string representation of a Schema indented by a specified string. func (schema *Schema) describeSchema(indent string) string { result := "" if schema.Schema != nil { result += indent + "$schema: " + *(schema.Schema) + "\n" } if schema.ID != nil { result += indent + "id: " + *(schema.ID) + "\n" } if schema.MultipleOf != nil { result += indent + fmt.Sprintf("multipleOf: %+v\n", *(schema.MultipleOf)) } if schema.Maximum != nil { result += indent + fmt.Sprintf("maximum: %+v\n", *(schema.Maximum)) } if schema.ExclusiveMaximum != nil { result += indent + fmt.Sprintf("exclusiveMaximum: %+v\n", *(schema.ExclusiveMaximum)) } if schema.Minimum != nil { result += indent + fmt.Sprintf("minimum: %+v\n", *(schema.Minimum)) } if schema.ExclusiveMinimum != nil { result += indent + fmt.Sprintf("exclusiveMinimum: %+v\n", *(schema.ExclusiveMinimum)) } if schema.MaxLength != nil { result += indent + fmt.Sprintf("maxLength: %+v\n", *(schema.MaxLength)) } if schema.MinLength != nil { result += indent + fmt.Sprintf("minLength: %+v\n", *(schema.MinLength)) } if schema.Pattern != nil { result += indent + fmt.Sprintf("pattern: %+v\n", *(schema.Pattern)) } if schema.AdditionalItems != nil { s := schema.AdditionalItems.Schema if s != nil { result += indent + "additionalItems:\n" result += s.describeSchema(indent + " ") } else { b := *(schema.AdditionalItems.Boolean) result += indent + fmt.Sprintf("additionalItems: %+v\n", b) } } if schema.Items != nil { result += indent + "items:\n" items := schema.Items if items.SchemaArray != nil { for i, s := range *(items.SchemaArray) { result += indent + " " + fmt.Sprintf("%d", i) + ":\n" result += s.describeSchema(indent + " " + " ") } } else if items.Schema != nil { result += items.Schema.describeSchema(indent + " " + " ") } } if schema.MaxItems != nil { result += indent + fmt.Sprintf("maxItems: %+v\n", *(schema.MaxItems)) } if schema.MinItems != nil { result += indent + fmt.Sprintf("minItems: %+v\n", *(schema.MinItems)) } if schema.UniqueItems != nil { result += indent + fmt.Sprintf("uniqueItems: %+v\n", *(schema.UniqueItems)) } if schema.MaxProperties != nil { result += indent + fmt.Sprintf("maxProperties: %+v\n", *(schema.MaxProperties)) } if schema.MinProperties != nil { result += indent + fmt.Sprintf("minProperties: %+v\n", *(schema.MinProperties)) } if schema.Required != nil { result += indent + fmt.Sprintf("required: %+v\n", *(schema.Required)) } if schema.AdditionalProperties != nil { s := schema.AdditionalProperties.Schema if s != nil { result += indent + "additionalProperties:\n" result += s.describeSchema(indent + " ") } else { b := *(schema.AdditionalProperties.Boolean) result += indent + fmt.Sprintf("additionalProperties: %+v\n", b) } } if schema.Properties != nil { result += indent + "properties:\n" for _, pair := range *(schema.Properties) { name := pair.Name s := pair.Value result += indent + " " + name + ":\n" result += s.describeSchema(indent + " " + " ") } } if schema.PatternProperties != nil { result += indent + "patternProperties:\n" for _, pair := range *(schema.PatternProperties) { name := pair.Name s := pair.Value result += indent + " " + name + ":\n" result += s.describeSchema(indent + " " + " ") } } if schema.Dependencies != nil { result += indent + "dependencies:\n" for _, pair := range *(schema.Dependencies) { name := pair.Name schemaOrStringArray := pair.Value s := schemaOrStringArray.Schema if s != nil { result += indent + " " + name + ":\n" result += s.describeSchema(indent + " " + " ") } else { a := schemaOrStringArray.StringArray if a != nil { result += indent + " " + name + ":\n" for _, s2 := range *a { result += indent + " " + " " + s2 + "\n" } } } } } if schema.Enumeration != nil { result += indent + "enumeration:\n" for _, value := range *(schema.Enumeration) { if value.String != nil { result += indent + " " + fmt.Sprintf("%+v\n", *value.String) } else { result += indent + " " + fmt.Sprintf("%+v\n", *value.Bool) } } } if schema.Type != nil { result += indent + fmt.Sprintf("type: %+v\n", schema.Type.Description()) } if schema.AllOf != nil { result += indent + "allOf:\n" for _, s := range *(schema.AllOf) { result += s.describeSchema(indent + " ") result += indent + "-\n" } } if schema.AnyOf != nil { result += indent + "anyOf:\n" for _, s := range *(schema.AnyOf) { result += s.describeSchema(indent + " ") result += indent + "-\n" } } if schema.OneOf != nil { result += indent + "oneOf:\n" for _, s := range *(schema.OneOf) { result += s.describeSchema(indent + " ") result += indent + "-\n" } } if schema.Not != nil { result += indent + "not:\n" result += schema.Not.describeSchema(indent + " ") } if schema.Definitions != nil { result += indent + "definitions:\n" for _, pair := range *(schema.Definitions) { name := pair.Name s := pair.Value result += indent + " " + name + ":\n" result += s.describeSchema(indent + " " + " ") } } if schema.Title != nil { result += indent + "title: " + *(schema.Title) + "\n" } if schema.Description != nil { result += indent + "description: " + *(schema.Description) + "\n" } if schema.Default != nil { result += indent + "default:\n" result += indent + fmt.Sprintf(" %+v\n", *(schema.Default)) } if schema.Format != nil { result += indent + "format: " + *(schema.Format) + "\n" } if schema.Ref != nil { result += indent + "$ref: " + *(schema.Ref) + "\n" } return result }
8,925
0
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic/compiler/context.go
// Copyright 2017 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package compiler import ( yaml "gopkg.in/yaml.v3" ) // Context contains state of the compiler as it traverses a document. type Context struct { Parent *Context Name string Node *yaml.Node ExtensionHandlers *[]ExtensionHandler } // NewContextWithExtensions returns a new object representing the compiler state func NewContextWithExtensions(name string, node *yaml.Node, parent *Context, extensionHandlers *[]ExtensionHandler) *Context { return &Context{Name: name, Node: node, Parent: parent, ExtensionHandlers: extensionHandlers} } // NewContext returns a new object representing the compiler state func NewContext(name string, node *yaml.Node, parent *Context) *Context { if parent != nil { return &Context{Name: name, Node: node, Parent: parent, ExtensionHandlers: parent.ExtensionHandlers} } return &Context{Name: name, Parent: parent, ExtensionHandlers: nil} } // Description returns a text description of the compiler state func (context *Context) Description() string { name := context.Name if context.Parent != nil { name = context.Parent.Description() + "." + name } return name }
8,926
0
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic/compiler/error.go
// Copyright 2017 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package compiler import "fmt" // Error represents compiler errors and their location in the document. type Error struct { Context *Context Message string } // NewError creates an Error. func NewError(context *Context, message string) *Error { return &Error{Context: context, Message: message} } func (err *Error) locationDescription() string { if err.Context.Node != nil { return fmt.Sprintf("[%d,%d] %s", err.Context.Node.Line, err.Context.Node.Column, err.Context.Description()) } return err.Context.Description() } // Error returns the string value of an Error. func (err *Error) Error() string { if err.Context == nil { return err.Message } return err.locationDescription() + " " + err.Message } // ErrorGroup is a container for groups of Error values. type ErrorGroup struct { Errors []error } // NewErrorGroupOrNil returns a new ErrorGroup for a slice of errors or nil if the slice is empty. func NewErrorGroupOrNil(errors []error) error { if len(errors) == 0 { return nil } else if len(errors) == 1 { return errors[0] } else { return &ErrorGroup{Errors: errors} } } func (group *ErrorGroup) Error() string { result := "" for i, err := range group.Errors { if i > 0 { result += "\n" } result += err.Error() } return result }
8,927
0
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic/compiler/README.md
# Compiler support code This directory contains compiler support code used by Gnostic and Gnostic extensions.
8,928
0
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic/compiler/reader.go
// Copyright 2017 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package compiler import ( "fmt" "io/ioutil" "log" "net/http" "net/url" "path/filepath" "strings" "sync" yaml "gopkg.in/yaml.v3" ) var verboseReader = false var fileCache map[string][]byte var infoCache map[string]*yaml.Node var fileCacheEnable = true var infoCacheEnable = true // These locks are used to synchronize accesses to the fileCache and infoCache // maps (above). They are global state and can throw thread-related errors // when modified from separate goroutines. The general strategy is to protect // all public functions in this file with mutex Lock() calls. As a result, to // avoid deadlock, these public functions should not call other public // functions, so some public functions have private equivalents. // In the future, we might consider replacing the maps with sync.Map and // eliminating these mutexes. var fileCacheMutex sync.Mutex var infoCacheMutex sync.Mutex func initializeFileCache() { if fileCache == nil { fileCache = make(map[string][]byte, 0) } } func initializeInfoCache() { if infoCache == nil { infoCache = make(map[string]*yaml.Node, 0) } } // EnableFileCache turns on file caching. func EnableFileCache() { fileCacheMutex.Lock() defer fileCacheMutex.Unlock() fileCacheEnable = true } // EnableInfoCache turns on parsed info caching. func EnableInfoCache() { infoCacheMutex.Lock() defer infoCacheMutex.Unlock() infoCacheEnable = true } // DisableFileCache turns off file caching. func DisableFileCache() { fileCacheMutex.Lock() defer fileCacheMutex.Unlock() fileCacheEnable = false } // DisableInfoCache turns off parsed info caching. func DisableInfoCache() { infoCacheMutex.Lock() defer infoCacheMutex.Unlock() infoCacheEnable = false } // RemoveFromFileCache removes an entry from the file cache. func RemoveFromFileCache(fileurl string) { fileCacheMutex.Lock() defer fileCacheMutex.Unlock() if !fileCacheEnable { return } initializeFileCache() delete(fileCache, fileurl) } // RemoveFromInfoCache removes an entry from the info cache. func RemoveFromInfoCache(filename string) { infoCacheMutex.Lock() defer infoCacheMutex.Unlock() if !infoCacheEnable { return } initializeInfoCache() delete(infoCache, filename) } // GetInfoCache returns the info cache map. func GetInfoCache() map[string]*yaml.Node { infoCacheMutex.Lock() defer infoCacheMutex.Unlock() if infoCache == nil { initializeInfoCache() } return infoCache } // ClearFileCache clears the file cache. func ClearFileCache() { fileCacheMutex.Lock() defer fileCacheMutex.Unlock() fileCache = make(map[string][]byte, 0) } // ClearInfoCache clears the info cache. func ClearInfoCache() { infoCacheMutex.Lock() defer infoCacheMutex.Unlock() infoCache = make(map[string]*yaml.Node) } // ClearCaches clears all caches. func ClearCaches() { ClearFileCache() ClearInfoCache() } // FetchFile gets a specified file from the local filesystem or a remote location. func FetchFile(fileurl string) ([]byte, error) { fileCacheMutex.Lock() defer fileCacheMutex.Unlock() return fetchFile(fileurl) } func fetchFile(fileurl string) ([]byte, error) { var bytes []byte initializeFileCache() if fileCacheEnable { bytes, ok := fileCache[fileurl] if ok { if verboseReader { log.Printf("Cache hit %s", fileurl) } return bytes, nil } if verboseReader { log.Printf("Fetching %s", fileurl) } } response, err := http.Get(fileurl) if err != nil { return nil, err } defer response.Body.Close() if response.StatusCode != 200 { return nil, fmt.Errorf("Error downloading %s: %s", fileurl, response.Status) } bytes, err = ioutil.ReadAll(response.Body) if fileCacheEnable && err == nil { fileCache[fileurl] = bytes } return bytes, err } // ReadBytesForFile reads the bytes of a file. func ReadBytesForFile(filename string) ([]byte, error) { fileCacheMutex.Lock() defer fileCacheMutex.Unlock() return readBytesForFile(filename) } func readBytesForFile(filename string) ([]byte, error) { // is the filename a url? fileurl, _ := url.Parse(filename) if fileurl.Scheme != "" { // yes, fetch it bytes, err := fetchFile(filename) if err != nil { return nil, err } return bytes, nil } // no, it's a local filename bytes, err := ioutil.ReadFile(filename) if err != nil { return nil, err } return bytes, nil } // ReadInfoFromBytes unmarshals a file as a *yaml.Node. func ReadInfoFromBytes(filename string, bytes []byte) (*yaml.Node, error) { infoCacheMutex.Lock() defer infoCacheMutex.Unlock() return readInfoFromBytes(filename, bytes) } func readInfoFromBytes(filename string, bytes []byte) (*yaml.Node, error) { initializeInfoCache() if infoCacheEnable { cachedInfo, ok := infoCache[filename] if ok { if verboseReader { log.Printf("Cache hit info for file %s", filename) } return cachedInfo, nil } if verboseReader { log.Printf("Reading info for file %s", filename) } } var info yaml.Node err := yaml.Unmarshal(bytes, &info) if err != nil { return nil, err } if infoCacheEnable && len(filename) > 0 { infoCache[filename] = &info } return &info, nil } // ReadInfoForRef reads a file and return the fragment needed to resolve a $ref. func ReadInfoForRef(basefile string, ref string) (*yaml.Node, error) { fileCacheMutex.Lock() defer fileCacheMutex.Unlock() infoCacheMutex.Lock() defer infoCacheMutex.Unlock() initializeInfoCache() if infoCacheEnable { info, ok := infoCache[ref] if ok { if verboseReader { log.Printf("Cache hit for ref %s#%s", basefile, ref) } return info, nil } if verboseReader { log.Printf("Reading info for ref %s#%s", basefile, ref) } } basedir, _ := filepath.Split(basefile) parts := strings.Split(ref, "#") var filename string if parts[0] != "" { filename = parts[0] if _, err := url.ParseRequestURI(parts[0]); err != nil { // It is not an URL, so the file is local filename = basedir + parts[0] } } else { filename = basefile } bytes, err := readBytesForFile(filename) if err != nil { return nil, err } info, err := readInfoFromBytes(filename, bytes) if info != nil && info.Kind == yaml.DocumentNode { info = info.Content[0] } if err != nil { log.Printf("File error: %v\n", err) } else { if info == nil { return nil, NewError(nil, fmt.Sprintf("could not resolve %s", ref)) } if len(parts) > 1 { path := strings.Split(parts[1], "/") for i, key := range path { if i > 0 { m := info if true { found := false for i := 0; i < len(m.Content); i += 2 { if m.Content[i].Value == key { info = m.Content[i+1] found = true } } if !found { infoCache[ref] = nil return nil, NewError(nil, fmt.Sprintf("could not resolve %s", ref)) } } } } } } if infoCacheEnable { infoCache[ref] = info } return info, nil }
8,929
0
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic/compiler/helpers.go
// Copyright 2017 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package compiler import ( "fmt" "regexp" "sort" "strconv" "github.com/googleapis/gnostic/jsonschema" "gopkg.in/yaml.v3" ) // compiler helper functions, usually called from generated code // UnpackMap gets a *yaml.Node if possible. func UnpackMap(in *yaml.Node) (*yaml.Node, bool) { if in == nil { return nil, false } return in, true } // SortedKeysForMap returns the sorted keys of a yamlv2.MapSlice. func SortedKeysForMap(m *yaml.Node) []string { keys := make([]string, 0) if m.Kind == yaml.MappingNode { for i := 0; i < len(m.Content); i += 2 { keys = append(keys, m.Content[i].Value) } } sort.Strings(keys) return keys } // MapHasKey returns true if a yamlv2.MapSlice contains a specified key. func MapHasKey(m *yaml.Node, key string) bool { if m == nil { return false } if m.Kind == yaml.MappingNode { for i := 0; i < len(m.Content); i += 2 { itemKey := m.Content[i].Value if key == itemKey { return true } } } return false } // MapValueForKey gets the value of a map value for a specified key. func MapValueForKey(m *yaml.Node, key string) *yaml.Node { if m == nil { return nil } if m.Kind == yaml.MappingNode { for i := 0; i < len(m.Content); i += 2 { itemKey := m.Content[i].Value if key == itemKey { return m.Content[i+1] } } } return nil } // ConvertInterfaceArrayToStringArray converts an array of interfaces to an array of strings, if possible. func ConvertInterfaceArrayToStringArray(interfaceArray []interface{}) []string { stringArray := make([]string, 0) for _, item := range interfaceArray { v, ok := item.(string) if ok { stringArray = append(stringArray, v) } } return stringArray } // SequenceNodeForNode returns a node if it is a SequenceNode. func SequenceNodeForNode(node *yaml.Node) (*yaml.Node, bool) { if node.Kind != yaml.SequenceNode { return nil, false } return node, true } // BoolForScalarNode returns the bool value of a node. func BoolForScalarNode(node *yaml.Node) (bool, bool) { if node == nil { return false, false } if node.Kind == yaml.DocumentNode { return BoolForScalarNode(node.Content[0]) } if node.Kind != yaml.ScalarNode { return false, false } if node.Tag != "!!bool" { return false, false } v, err := strconv.ParseBool(node.Value) if err != nil { return false, false } return v, true } // IntForScalarNode returns the integer value of a node. func IntForScalarNode(node *yaml.Node) (int64, bool) { if node == nil { return 0, false } if node.Kind == yaml.DocumentNode { return IntForScalarNode(node.Content[0]) } if node.Kind != yaml.ScalarNode { return 0, false } if node.Tag != "!!int" { return 0, false } v, err := strconv.ParseInt(node.Value, 10, 64) if err != nil { return 0, false } return v, true } // FloatForScalarNode returns the float value of a node. func FloatForScalarNode(node *yaml.Node) (float64, bool) { if node == nil { return 0.0, false } if node.Kind == yaml.DocumentNode { return FloatForScalarNode(node.Content[0]) } if node.Kind != yaml.ScalarNode { return 0.0, false } if (node.Tag != "!!int") && (node.Tag != "!!float") { return 0.0, false } v, err := strconv.ParseFloat(node.Value, 64) if err != nil { return 0.0, false } return v, true } // StringForScalarNode returns the string value of a node. func StringForScalarNode(node *yaml.Node) (string, bool) { if node == nil { return "", false } if node.Kind == yaml.DocumentNode { return StringForScalarNode(node.Content[0]) } switch node.Kind { case yaml.ScalarNode: switch node.Tag { case "!!int": return node.Value, true case "!!str": return node.Value, true case "!!timestamp": return node.Value, true case "!!null": return "", true default: return "", false } default: return "", false } } // StringArrayForSequenceNode converts a sequence node to an array of strings, if possible. func StringArrayForSequenceNode(node *yaml.Node) []string { stringArray := make([]string, 0) for _, item := range node.Content { v, ok := StringForScalarNode(item) if ok { stringArray = append(stringArray, v) } } return stringArray } // MissingKeysInMap identifies which keys from a list of required keys are not in a map. func MissingKeysInMap(m *yaml.Node, requiredKeys []string) []string { missingKeys := make([]string, 0) for _, k := range requiredKeys { if !MapHasKey(m, k) { missingKeys = append(missingKeys, k) } } return missingKeys } // InvalidKeysInMap returns keys in a map that don't match a list of allowed keys and patterns. func InvalidKeysInMap(m *yaml.Node, allowedKeys []string, allowedPatterns []*regexp.Regexp) []string { invalidKeys := make([]string, 0) if m == nil || m.Kind != yaml.MappingNode { return invalidKeys } for i := 0; i < len(m.Content); i += 2 { key := m.Content[i].Value found := false // does the key match an allowed key? for _, allowedKey := range allowedKeys { if key == allowedKey { found = true break } } if !found { // does the key match an allowed pattern? for _, allowedPattern := range allowedPatterns { if allowedPattern.MatchString(key) { found = true break } } if !found { invalidKeys = append(invalidKeys, key) } } } return invalidKeys } // NewNullNode creates a new Null node. func NewNullNode() *yaml.Node { node := &yaml.Node{ Kind: yaml.ScalarNode, Tag: "!!null", } return node } // NewMappingNode creates a new Mapping node. func NewMappingNode() *yaml.Node { return &yaml.Node{ Kind: yaml.MappingNode, Content: make([]*yaml.Node, 0), } } // NewSequenceNode creates a new Sequence node. func NewSequenceNode() *yaml.Node { node := &yaml.Node{ Kind: yaml.SequenceNode, Content: make([]*yaml.Node, 0), } return node } // NewScalarNodeForString creates a new node to hold a string. func NewScalarNodeForString(s string) *yaml.Node { return &yaml.Node{ Kind: yaml.ScalarNode, Tag: "!!str", Value: s, } } // NewSequenceNodeForStringArray creates a new node to hold an array of strings. func NewSequenceNodeForStringArray(strings []string) *yaml.Node { node := &yaml.Node{ Kind: yaml.SequenceNode, Content: make([]*yaml.Node, 0), } for _, s := range strings { node.Content = append(node.Content, NewScalarNodeForString(s)) } return node } // NewScalarNodeForBool creates a new node to hold a bool. func NewScalarNodeForBool(b bool) *yaml.Node { return &yaml.Node{ Kind: yaml.ScalarNode, Tag: "!!bool", Value: fmt.Sprintf("%t", b), } } // NewScalarNodeForFloat creates a new node to hold a float. func NewScalarNodeForFloat(f float64) *yaml.Node { return &yaml.Node{ Kind: yaml.ScalarNode, Tag: "!!float", Value: fmt.Sprintf("%g", f), } } // NewScalarNodeForInt creates a new node to hold an integer. func NewScalarNodeForInt(i int64) *yaml.Node { return &yaml.Node{ Kind: yaml.ScalarNode, Tag: "!!int", Value: fmt.Sprintf("%d", i), } } // PluralProperties returns the string "properties" pluralized. func PluralProperties(count int) string { if count == 1 { return "property" } return "properties" } // StringArrayContainsValue returns true if a string array contains a specified value. func StringArrayContainsValue(array []string, value string) bool { for _, item := range array { if item == value { return true } } return false } // StringArrayContainsValues returns true if a string array contains all of a list of specified values. func StringArrayContainsValues(array []string, values []string) bool { for _, value := range values { if !StringArrayContainsValue(array, value) { return false } } return true } // StringValue returns the string value of an item. func StringValue(item interface{}) (value string, ok bool) { value, ok = item.(string) if ok { return value, ok } intValue, ok := item.(int) if ok { return strconv.Itoa(intValue), true } return "", false } // Description returns a human-readable represention of an item. func Description(item interface{}) string { value, ok := item.(*yaml.Node) if ok { return jsonschema.Render(value) } return fmt.Sprintf("%+v", item) } // Display returns a description of a node for use in error messages. func Display(node *yaml.Node) string { switch node.Kind { case yaml.ScalarNode: switch node.Tag { case "!!str": return fmt.Sprintf("%s (string)", node.Value) } } return fmt.Sprintf("%+v (%T)", node, node) } // Marshal creates a yaml version of a structure in our preferred style func Marshal(in *yaml.Node) []byte { clearStyle(in) //bytes, _ := yaml.Marshal(&yaml.Node{Kind: yaml.DocumentNode, Content: []*yaml.Node{in}}) bytes, _ := yaml.Marshal(in) return bytes } func clearStyle(node *yaml.Node) { node.Style = 0 for _, c := range node.Content { clearStyle(c) } }
8,930
0
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic/compiler/main.go
// Copyright 2017 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Package compiler provides support functions to generated compiler code. package compiler
8,931
0
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic/compiler/extensions.go
// Copyright 2017 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package compiler import ( "bytes" "fmt" "os/exec" "strings" "github.com/golang/protobuf/proto" "github.com/golang/protobuf/ptypes/any" extensions "github.com/googleapis/gnostic/extensions" yaml "gopkg.in/yaml.v3" ) // ExtensionHandler describes a binary that is called by the compiler to handle specification extensions. type ExtensionHandler struct { Name string } // CallExtension calls a binary extension handler. func CallExtension(context *Context, in *yaml.Node, extensionName string) (handled bool, response *any.Any, err error) { if context == nil || context.ExtensionHandlers == nil { return false, nil, nil } handled = false for _, handler := range *(context.ExtensionHandlers) { response, err = handler.handle(in, extensionName) if response == nil { continue } else { handled = true break } } return handled, response, err } func (extensionHandlers *ExtensionHandler) handle(in *yaml.Node, extensionName string) (*any.Any, error) { if extensionHandlers.Name != "" { yamlData, _ := yaml.Marshal(in) request := &extensions.ExtensionHandlerRequest{ CompilerVersion: &extensions.Version{ Major: 0, Minor: 1, Patch: 0, }, Wrapper: &extensions.Wrapper{ Version: "unknown", // TODO: set this to the type/version of spec being parsed. Yaml: string(yamlData), ExtensionName: extensionName, }, } requestBytes, _ := proto.Marshal(request) cmd := exec.Command(extensionHandlers.Name) cmd.Stdin = bytes.NewReader(requestBytes) output, err := cmd.Output() if err != nil { return nil, err } response := &extensions.ExtensionHandlerResponse{} err = proto.Unmarshal(output, response) if err != nil || !response.Handled { return nil, err } if len(response.Errors) != 0 { return nil, fmt.Errorf("Errors when parsing: %+v for field %s by vendor extension handler %s. Details %+v", in, extensionName, extensionHandlers.Name, strings.Join(response.Errors, ",")) } return response.Value, nil } return nil, nil }
8,932
0
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic/extensions/README.md
# Extensions **Extension Support is experimental.** This directory contains support code for building Gnostic extensio handlers and associated examples. Extension handlers can be used to compile vendor or specification extensions into protocol buffer structures. Like plugins, extension handlers are built as separate executables. Extension bodies are written to extension handlers as serialized ExtensionHandlerRequests.
8,933
0
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic/extensions/extension.proto
// Copyright 2017 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package gnostic.extension.v1; import "google/protobuf/any.proto"; // This option lets the proto compiler generate Java code inside the package // name (see below) instead of inside an outer class. It creates a simpler // developer experience by reducing one-level of name nesting and be // consistent with most programming languages that don't support outer classes. option java_multiple_files = true; // The Java outer classname should be the filename in UpperCamelCase. This // class is only used to hold proto descriptor, so developers don't need to // work with it directly. option java_outer_classname = "GnosticExtension"; // The Java package name must be proto package name with proper prefix. option java_package = "org.gnostic.v1"; // A reasonable prefix for the Objective-C symbols generated from the package. // It should at a minimum be 3 characters long, all uppercase, and convention // is to use an abbreviation of the package name. Something short, but // hopefully unique enough to not conflict with things that may come along in // the future. 'GPB' is reserved for the protocol buffer implementation itself. // option objc_class_prefix = "GNX"; // "Gnostic Extension" // The Go package name. option go_package = "extensions;gnostic_extension_v1"; // The version number of Gnostic. message Version { int32 major = 1; int32 minor = 2; int32 patch = 3; // A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should // be empty for mainline stable releases. string suffix = 4; } // An encoded Request is written to the ExtensionHandler's stdin. message ExtensionHandlerRequest { // The extension to process. Wrapper wrapper = 1; // The version number of Gnostic. Version compiler_version = 2; } // The extensions writes an encoded ExtensionHandlerResponse to stdout. message ExtensionHandlerResponse { // true if the extension is handled by the extension handler; false otherwise bool handled = 1; // Error message(s). If non-empty, the extension handling failed. // The extension handler process should exit with status code zero // even if it reports an error in this way. // // This should be used to indicate errors which prevent the extension from // operating as intended. Errors which indicate a problem in gnostic // itself -- such as the input Document being unparseable -- should be // reported by writing a message to stderr and exiting with a non-zero // status code. repeated string errors = 2; // text output google.protobuf.Any value = 3; } message Wrapper { // version of the OpenAPI specification in which this extension was written. string version = 1; // Name of the extension. string extension_name = 2; // YAML-formatted extension value. string yaml = 3; }
8,934
0
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic/extensions/extension.pb.go
// Copyright 2017 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.24.0 // protoc v3.12.0 // source: extensions/extension.proto package gnostic_extension_v1 import ( proto "github.com/golang/protobuf/proto" any "github.com/golang/protobuf/ptypes/any" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) // This is a compile-time assertion that a sufficiently up-to-date version // of the legacy proto package is being used. const _ = proto.ProtoPackageIsVersion4 // The version number of Gnostic. type Version struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Major int32 `protobuf:"varint,1,opt,name=major,proto3" json:"major,omitempty"` Minor int32 `protobuf:"varint,2,opt,name=minor,proto3" json:"minor,omitempty"` Patch int32 `protobuf:"varint,3,opt,name=patch,proto3" json:"patch,omitempty"` // A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should // be empty for mainline stable releases. Suffix string `protobuf:"bytes,4,opt,name=suffix,proto3" json:"suffix,omitempty"` } func (x *Version) Reset() { *x = Version{} if protoimpl.UnsafeEnabled { mi := &file_extensions_extension_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Version) String() string { return protoimpl.X.MessageStringOf(x) } func (*Version) ProtoMessage() {} func (x *Version) ProtoReflect() protoreflect.Message { mi := &file_extensions_extension_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Version.ProtoReflect.Descriptor instead. func (*Version) Descriptor() ([]byte, []int) { return file_extensions_extension_proto_rawDescGZIP(), []int{0} } func (x *Version) GetMajor() int32 { if x != nil { return x.Major } return 0 } func (x *Version) GetMinor() int32 { if x != nil { return x.Minor } return 0 } func (x *Version) GetPatch() int32 { if x != nil { return x.Patch } return 0 } func (x *Version) GetSuffix() string { if x != nil { return x.Suffix } return "" } // An encoded Request is written to the ExtensionHandler's stdin. type ExtensionHandlerRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The extension to process. Wrapper *Wrapper `protobuf:"bytes,1,opt,name=wrapper,proto3" json:"wrapper,omitempty"` // The version number of Gnostic. CompilerVersion *Version `protobuf:"bytes,2,opt,name=compiler_version,json=compilerVersion,proto3" json:"compiler_version,omitempty"` } func (x *ExtensionHandlerRequest) Reset() { *x = ExtensionHandlerRequest{} if protoimpl.UnsafeEnabled { mi := &file_extensions_extension_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *ExtensionHandlerRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*ExtensionHandlerRequest) ProtoMessage() {} func (x *ExtensionHandlerRequest) ProtoReflect() protoreflect.Message { mi := &file_extensions_extension_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use ExtensionHandlerRequest.ProtoReflect.Descriptor instead. func (*ExtensionHandlerRequest) Descriptor() ([]byte, []int) { return file_extensions_extension_proto_rawDescGZIP(), []int{1} } func (x *ExtensionHandlerRequest) GetWrapper() *Wrapper { if x != nil { return x.Wrapper } return nil } func (x *ExtensionHandlerRequest) GetCompilerVersion() *Version { if x != nil { return x.CompilerVersion } return nil } // The extensions writes an encoded ExtensionHandlerResponse to stdout. type ExtensionHandlerResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // true if the extension is handled by the extension handler; false otherwise Handled bool `protobuf:"varint,1,opt,name=handled,proto3" json:"handled,omitempty"` // Error message(s). If non-empty, the extension handling failed. // The extension handler process should exit with status code zero // even if it reports an error in this way. // // This should be used to indicate errors which prevent the extension from // operating as intended. Errors which indicate a problem in gnostic // itself -- such as the input Document being unparseable -- should be // reported by writing a message to stderr and exiting with a non-zero // status code. Errors []string `protobuf:"bytes,2,rep,name=errors,proto3" json:"errors,omitempty"` // text output Value *any.Any `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` } func (x *ExtensionHandlerResponse) Reset() { *x = ExtensionHandlerResponse{} if protoimpl.UnsafeEnabled { mi := &file_extensions_extension_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *ExtensionHandlerResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*ExtensionHandlerResponse) ProtoMessage() {} func (x *ExtensionHandlerResponse) ProtoReflect() protoreflect.Message { mi := &file_extensions_extension_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use ExtensionHandlerResponse.ProtoReflect.Descriptor instead. func (*ExtensionHandlerResponse) Descriptor() ([]byte, []int) { return file_extensions_extension_proto_rawDescGZIP(), []int{2} } func (x *ExtensionHandlerResponse) GetHandled() bool { if x != nil { return x.Handled } return false } func (x *ExtensionHandlerResponse) GetErrors() []string { if x != nil { return x.Errors } return nil } func (x *ExtensionHandlerResponse) GetValue() *any.Any { if x != nil { return x.Value } return nil } type Wrapper struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // version of the OpenAPI specification in which this extension was written. Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` // Name of the extension. ExtensionName string `protobuf:"bytes,2,opt,name=extension_name,json=extensionName,proto3" json:"extension_name,omitempty"` // YAML-formatted extension value. Yaml string `protobuf:"bytes,3,opt,name=yaml,proto3" json:"yaml,omitempty"` } func (x *Wrapper) Reset() { *x = Wrapper{} if protoimpl.UnsafeEnabled { mi := &file_extensions_extension_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Wrapper) String() string { return protoimpl.X.MessageStringOf(x) } func (*Wrapper) ProtoMessage() {} func (x *Wrapper) ProtoReflect() protoreflect.Message { mi := &file_extensions_extension_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Wrapper.ProtoReflect.Descriptor instead. func (*Wrapper) Descriptor() ([]byte, []int) { return file_extensions_extension_proto_rawDescGZIP(), []int{3} } func (x *Wrapper) GetVersion() string { if x != nil { return x.Version } return "" } func (x *Wrapper) GetExtensionName() string { if x != nil { return x.ExtensionName } return "" } func (x *Wrapper) GetYaml() string { if x != nil { return x.Yaml } return "" } var File_extensions_extension_proto protoreflect.FileDescriptor var file_extensions_extension_proto_rawDesc = []byte{ 0x0a, 0x1a, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x63, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x75, 0x66, 0x66, 0x69, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x75, 0x66, 0x66, 0x69, 0x78, 0x22, 0x9c, 0x01, 0x0a, 0x17, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x07, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x52, 0x07, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x12, 0x48, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x78, 0x0a, 0x18, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x5e, 0x0a, 0x07, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x79, 0x61, 0x6d, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x79, 0x61, 0x6d, 0x6c, 0x42, 0x4b, 0x0a, 0x0e, 0x6f, 0x72, 0x67, 0x2e, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x42, 0x10, 0x47, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x01, 0x5a, 0x1f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x3b, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x47, 0x4e, 0x58, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_extensions_extension_proto_rawDescOnce sync.Once file_extensions_extension_proto_rawDescData = file_extensions_extension_proto_rawDesc ) func file_extensions_extension_proto_rawDescGZIP() []byte { file_extensions_extension_proto_rawDescOnce.Do(func() { file_extensions_extension_proto_rawDescData = protoimpl.X.CompressGZIP(file_extensions_extension_proto_rawDescData) }) return file_extensions_extension_proto_rawDescData } var file_extensions_extension_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_extensions_extension_proto_goTypes = []interface{}{ (*Version)(nil), // 0: gnostic.extension.v1.Version (*ExtensionHandlerRequest)(nil), // 1: gnostic.extension.v1.ExtensionHandlerRequest (*ExtensionHandlerResponse)(nil), // 2: gnostic.extension.v1.ExtensionHandlerResponse (*Wrapper)(nil), // 3: gnostic.extension.v1.Wrapper (*any.Any)(nil), // 4: google.protobuf.Any } var file_extensions_extension_proto_depIdxs = []int32{ 3, // 0: gnostic.extension.v1.ExtensionHandlerRequest.wrapper:type_name -> gnostic.extension.v1.Wrapper 0, // 1: gnostic.extension.v1.ExtensionHandlerRequest.compiler_version:type_name -> gnostic.extension.v1.Version 4, // 2: gnostic.extension.v1.ExtensionHandlerResponse.value:type_name -> google.protobuf.Any 3, // [3:3] is the sub-list for method output_type 3, // [3:3] is the sub-list for method input_type 3, // [3:3] is the sub-list for extension type_name 3, // [3:3] is the sub-list for extension extendee 0, // [0:3] is the sub-list for field type_name } func init() { file_extensions_extension_proto_init() } func file_extensions_extension_proto_init() { if File_extensions_extension_proto != nil { return } if !protoimpl.UnsafeEnabled { file_extensions_extension_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Version); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_extensions_extension_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExtensionHandlerRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_extensions_extension_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExtensionHandlerResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_extensions_extension_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Wrapper); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_extensions_extension_proto_rawDesc, NumEnums: 0, NumMessages: 4, NumExtensions: 0, NumServices: 0, }, GoTypes: file_extensions_extension_proto_goTypes, DependencyIndexes: file_extensions_extension_proto_depIdxs, MessageInfos: file_extensions_extension_proto_msgTypes, }.Build() File_extensions_extension_proto = out.File file_extensions_extension_proto_rawDesc = nil file_extensions_extension_proto_goTypes = nil file_extensions_extension_proto_depIdxs = nil }
8,935
0
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic
kubeflow_public_repos/fate-operator/vendor/github.com/googleapis/gnostic/extensions/extensions.go
// Copyright 2017 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package gnostic_extension_v1 import ( "io/ioutil" "log" "os" "github.com/golang/protobuf/proto" "github.com/golang/protobuf/ptypes" ) type extensionHandler func(name string, yamlInput string) (bool, proto.Message, error) // Main implements the main program of an extension handler. func Main(handler extensionHandler) { // unpack the request data, err := ioutil.ReadAll(os.Stdin) if err != nil { log.Println("File error:", err.Error()) os.Exit(1) } if len(data) == 0 { log.Println("No input data.") os.Exit(1) } request := &ExtensionHandlerRequest{} err = proto.Unmarshal(data, request) if err != nil { log.Println("Input error:", err.Error()) os.Exit(1) } // call the handler handled, output, err := handler(request.Wrapper.ExtensionName, request.Wrapper.Yaml) // respond with the output of the handler response := &ExtensionHandlerResponse{ Handled: false, // default assumption Errors: make([]string, 0), } if err != nil { response.Errors = append(response.Errors, err.Error()) } else if handled { response.Handled = true response.Value, err = ptypes.MarshalAny(output) if err != nil { response.Errors = append(response.Errors, err.Error()) } } responseBytes, _ := proto.Marshal(response) os.Stdout.Write(responseBytes) }
8,936
0
kubeflow_public_repos/fate-operator/vendor/github.com/inconshreveable
kubeflow_public_repos/fate-operator/vendor/github.com/inconshreveable/mousetrap/trap_windows.go
// +build windows // +build !go1.4 package mousetrap import ( "fmt" "os" "syscall" "unsafe" ) const ( // defined by the Win32 API th32cs_snapprocess uintptr = 0x2 ) var ( kernel = syscall.MustLoadDLL("kernel32.dll") CreateToolhelp32Snapshot = kernel.MustFindProc("CreateToolhelp32Snapshot") Process32First = kernel.MustFindProc("Process32FirstW") Process32Next = kernel.MustFindProc("Process32NextW") ) // ProcessEntry32 structure defined by the Win32 API type processEntry32 struct { dwSize uint32 cntUsage uint32 th32ProcessID uint32 th32DefaultHeapID int th32ModuleID uint32 cntThreads uint32 th32ParentProcessID uint32 pcPriClassBase int32 dwFlags uint32 szExeFile [syscall.MAX_PATH]uint16 } func getProcessEntry(pid int) (pe *processEntry32, err error) { snapshot, _, e1 := CreateToolhelp32Snapshot.Call(th32cs_snapprocess, uintptr(0)) if snapshot == uintptr(syscall.InvalidHandle) { err = fmt.Errorf("CreateToolhelp32Snapshot: %v", e1) return } defer syscall.CloseHandle(syscall.Handle(snapshot)) var processEntry processEntry32 processEntry.dwSize = uint32(unsafe.Sizeof(processEntry)) ok, _, e1 := Process32First.Call(snapshot, uintptr(unsafe.Pointer(&processEntry))) if ok == 0 { err = fmt.Errorf("Process32First: %v", e1) return } for { if processEntry.th32ProcessID == uint32(pid) { pe = &processEntry return } ok, _, e1 = Process32Next.Call(snapshot, uintptr(unsafe.Pointer(&processEntry))) if ok == 0 { err = fmt.Errorf("Process32Next: %v", e1) return } } } func getppid() (pid int, err error) { pe, err := getProcessEntry(os.Getpid()) if err != nil { return } pid = int(pe.th32ParentProcessID) return } // StartedByExplorer returns true if the program was invoked by the user double-clicking // on the executable from explorer.exe // // It is conservative and returns false if any of the internal calls fail. // It does not guarantee that the program was run from a terminal. It only can tell you // whether it was launched from explorer.exe func StartedByExplorer() bool { ppid, err := getppid() if err != nil { return false } pe, err := getProcessEntry(ppid) if err != nil { return false } name := syscall.UTF16ToString(pe.szExeFile[:]) return name == "explorer.exe" }
8,937
0
kubeflow_public_repos/fate-operator/vendor/github.com/inconshreveable
kubeflow_public_repos/fate-operator/vendor/github.com/inconshreveable/mousetrap/README.md
# mousetrap mousetrap is a tiny library that answers a single question. On a Windows machine, was the process invoked by someone double clicking on the executable file while browsing in explorer? ### Motivation Windows developers unfamiliar with command line tools will often "double-click" the executable for a tool. Because most CLI tools print the help and then exit when invoked without arguments, this is often very frustrating for those users. mousetrap provides a way to detect these invocations so that you can provide more helpful behavior and instructions on how to run the CLI tool. To see what this looks like, both from an organizational and a technical perspective, see https://inconshreveable.com/09-09-2014/sweat-the-small-stuff/ ### The interface The library exposes a single interface: func StartedByExplorer() (bool)
8,938
0
kubeflow_public_repos/fate-operator/vendor/github.com/inconshreveable
kubeflow_public_repos/fate-operator/vendor/github.com/inconshreveable/mousetrap/LICENSE
Copyright 2014 Alan Shreve Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
8,939
0
kubeflow_public_repos/fate-operator/vendor/github.com/inconshreveable
kubeflow_public_repos/fate-operator/vendor/github.com/inconshreveable/mousetrap/trap_windows_1.4.go
// +build windows // +build go1.4 package mousetrap import ( "os" "syscall" "unsafe" ) func getProcessEntry(pid int) (*syscall.ProcessEntry32, error) { snapshot, err := syscall.CreateToolhelp32Snapshot(syscall.TH32CS_SNAPPROCESS, 0) if err != nil { return nil, err } defer syscall.CloseHandle(snapshot) var procEntry syscall.ProcessEntry32 procEntry.Size = uint32(unsafe.Sizeof(procEntry)) if err = syscall.Process32First(snapshot, &procEntry); err != nil { return nil, err } for { if procEntry.ProcessID == uint32(pid) { return &procEntry, nil } err = syscall.Process32Next(snapshot, &procEntry) if err != nil { return nil, err } } } // StartedByExplorer returns true if the program was invoked by the user double-clicking // on the executable from explorer.exe // // It is conservative and returns false if any of the internal calls fail. // It does not guarantee that the program was run from a terminal. It only can tell you // whether it was launched from explorer.exe func StartedByExplorer() bool { pe, err := getProcessEntry(os.Getppid()) if err != nil { return false } return "explorer.exe" == syscall.UTF16ToString(pe.ExeFile[:]) }
8,940
0
kubeflow_public_repos/fate-operator/vendor/github.com/inconshreveable
kubeflow_public_repos/fate-operator/vendor/github.com/inconshreveable/mousetrap/trap_others.go
// +build !windows package mousetrap // StartedByExplorer returns true if the program was invoked by the user // double-clicking on the executable from explorer.exe // // It is conservative and returns false if any of the internal calls fail. // It does not guarantee that the program was run from a terminal. It only can tell you // whether it was launched from explorer.exe // // On non-Windows platforms, it always returns false. func StartedByExplorer() bool { return false }
8,941
0
kubeflow_public_repos/fate-operator/vendor/github.com/jinzhu
kubeflow_public_repos/fate-operator/vendor/github.com/jinzhu/now/go.mod
module github.com/jinzhu/now go 1.12
8,942
0
kubeflow_public_repos/fate-operator/vendor/github.com/jinzhu
kubeflow_public_repos/fate-operator/vendor/github.com/jinzhu/now/Guardfile
guard 'gotest' do watch(%r{\.go$}) end
8,943
0
kubeflow_public_repos/fate-operator/vendor/github.com/jinzhu
kubeflow_public_repos/fate-operator/vendor/github.com/jinzhu/now/README.md
## Now Now is a time toolkit for golang [![wercker status](https://app.wercker.com/status/a350da4eae6cb28a35687ba41afb565a/s/master "wercker status")](https://app.wercker.com/project/byKey/a350da4eae6cb28a35687ba41afb565a) ## Install ``` go get -u github.com/jinzhu/now ``` ## Usage Calculating time based on current time ```go import "github.com/jinzhu/now" time.Now() // 2013-11-18 17:51:49.123456789 Mon now.BeginningOfMinute() // 2013-11-18 17:51:00 Mon now.BeginningOfHour() // 2013-11-18 17:00:00 Mon now.BeginningOfDay() // 2013-11-18 00:00:00 Mon now.BeginningOfWeek() // 2013-11-17 00:00:00 Sun now.BeginningOfMonth() // 2013-11-01 00:00:00 Fri now.BeginningOfQuarter() // 2013-10-01 00:00:00 Tue now.BeginningOfYear() // 2013-01-01 00:00:00 Tue now.WeekStartDay = time.Monday // Set Monday as first day, default is Sunday now.BeginningOfWeek() // 2013-11-18 00:00:00 Mon now.EndOfMinute() // 2013-11-18 17:51:59.999999999 Mon now.EndOfHour() // 2013-11-18 17:59:59.999999999 Mon now.EndOfDay() // 2013-11-18 23:59:59.999999999 Mon now.EndOfWeek() // 2013-11-23 23:59:59.999999999 Sat now.EndOfMonth() // 2013-11-30 23:59:59.999999999 Sat now.EndOfQuarter() // 2013-12-31 23:59:59.999999999 Tue now.EndOfYear() // 2013-12-31 23:59:59.999999999 Tue now.WeekStartDay = time.Monday // Set Monday as first day, default is Sunday now.EndOfWeek() // 2013-11-24 23:59:59.999999999 Sun ``` Calculating time based on another time ```go t := time.Date(2013, 02, 18, 17, 51, 49, 123456789, time.Now().Location()) now.With(t).EndOfMonth() // 2013-02-28 23:59:59.999999999 Thu ``` Calculating time based on configuration ```go location, err := time.LoadLocation("Asia/Shanghai") myConfig := &now.Config{ WeekStartDay: time.Monday, TimeLocation: location, TimeFormats: []string{"2006-01-02 15:04:05"}, } t := time.Date(2013, 11, 18, 17, 51, 49, 123456789, time.Now().Location()) // // 2013-11-18 17:51:49.123456789 Mon myConfig.With(t).BeginningOfWeek() // 2013-11-18 00:00:00 Mon myConfig.Parse("2002-10-12 22:14:01") // 2002-10-12 22:14:01 myConfig.Parse("2002-10-12 22:14") // returns error 'can't parse string as time: 2002-10-12 22:14' ``` ### Monday/Sunday Don't be bothered with the `WeekStartDay` setting, you can use `Monday`, `Sunday` ```go now.Monday() // 2013-11-18 00:00:00 Mon now.Sunday() // 2013-11-24 00:00:00 Sun (Next Sunday) now.EndOfSunday() // 2013-11-24 23:59:59.999999999 Sun (End of next Sunday) t := time.Date(2013, 11, 24, 17, 51, 49, 123456789, time.Now().Location()) // 2013-11-24 17:51:49.123456789 Sun now.With(t).Monday() // 2013-11-18 00:00:00 Sun (Last Monday if today is Sunday) now.With(t).Sunday() // 2013-11-24 00:00:00 Sun (Beginning Of Today if today is Sunday) now.With(t).EndOfSunday() // 2013-11-24 23:59:59.999999999 Sun (End of Today if today is Sunday) ``` ### Parse String to Time ```go time.Now() // 2013-11-18 17:51:49.123456789 Mon // Parse(string) (time.Time, error) t, err := now.Parse("2017") // 2017-01-01 00:00:00, nil t, err := now.Parse("2017-10") // 2017-10-01 00:00:00, nil t, err := now.Parse("2017-10-13") // 2017-10-13 00:00:00, nil t, err := now.Parse("1999-12-12 12") // 1999-12-12 12:00:00, nil t, err := now.Parse("1999-12-12 12:20") // 1999-12-12 12:20:00, nil t, err := now.Parse("1999-12-12 12:20:21") // 1999-12-12 12:20:00, nil t, err := now.Parse("10-13") // 2013-10-13 00:00:00, nil t, err := now.Parse("12:20") // 2013-11-18 12:20:00, nil t, err := now.Parse("12:20:13") // 2013-11-18 12:20:13, nil t, err := now.Parse("14") // 2013-11-18 14:00:00, nil t, err := now.Parse("99:99") // 2013-11-18 12:20:00, Can't parse string as time: 99:99 // MustParse must parse string to time or it will panic now.MustParse("2013-01-13") // 2013-01-13 00:00:00 now.MustParse("02-17") // 2013-02-17 00:00:00 now.MustParse("2-17") // 2013-02-17 00:00:00 now.MustParse("8") // 2013-11-18 08:00:00 now.MustParse("2002-10-12 22:14") // 2002-10-12 22:14:00 now.MustParse("99:99") // panic: Can't parse string as time: 99:99 ``` Extend `now` to support more formats is quite easy, just update `now.TimeFormats` with other time layouts, e.g: ```go now.TimeFormats = append(now.TimeFormats, "02 Jan 2006 15:04") ``` Please send me pull requests if you want a format to be supported officially ## Contributing You can help to make the project better, check out [http://gorm.io/contribute.html](http://gorm.io/contribute.html) for things you can do. # Author **jinzhu** * <http://github.com/jinzhu> * <[email protected]> * <http://twitter.com/zhangjinzhu> ## License Released under the [MIT License](http://www.opensource.org/licenses/MIT).
8,944
0
kubeflow_public_repos/fate-operator/vendor/github.com/jinzhu
kubeflow_public_repos/fate-operator/vendor/github.com/jinzhu/now/main.go
// Package now is a time toolkit for golang. // // More details README here: https://github.com/jinzhu/now // // import "github.com/jinzhu/now" // // now.BeginningOfMinute() // 2013-11-18 17:51:00 Mon // now.BeginningOfDay() // 2013-11-18 00:00:00 Mon // now.EndOfDay() // 2013-11-18 23:59:59.999999999 Mon package now import "time" // WeekStartDay set week start day, default is sunday var WeekStartDay = time.Sunday // TimeFormats default time formats will be parsed as var TimeFormats = []string{ "2006", "2006-1", "2006-1-2", "2006-1-2 15", "2006-1-2 15:4", "2006-1-2 15:4:5", "1-2", "15:4:5", "15:4", "15", "15:4:5 Jan 2, 2006 MST", "2006-01-02 15:04:05.999999999 -0700 MST", "2006-01-02T15:04:05-07:00", "2006.1.2", "2006.1.2 15:04:05", "2006.01.02", "2006.01.02 15:04:05", "1/2/2006", "1/2/2006 15:4:5", "2006/01/02", "2006/01/02 15:04:05", time.ANSIC, time.UnixDate, time.RubyDate, time.RFC822, time.RFC822Z, time.RFC850, time.RFC1123, time.RFC1123Z, time.RFC3339, time.RFC3339Nano, time.Kitchen, time.Stamp, time.StampMilli, time.StampMicro, time.StampNano, } // Config configuration for now package type Config struct { WeekStartDay time.Weekday TimeLocation *time.Location TimeFormats []string } // DefaultConfig default config var DefaultConfig *Config // New initialize Now based on configuration func (config *Config) With(t time.Time) *Now { return &Now{Time: t, Config: config} } // Parse parse string to time based on configuration func (config *Config) Parse(strs ...string) (time.Time, error) { if config.TimeLocation == nil { return config.With(time.Now()).Parse(strs...) } else { return config.With(time.Now().In(config.TimeLocation)).Parse(strs...) } } // MustParse must parse string to time or will panic func (config *Config) MustParse(strs ...string) time.Time { if config.TimeLocation == nil { return config.With(time.Now()).MustParse(strs...) } else { return config.With(time.Now().In(config.TimeLocation)).MustParse(strs...) } } // Now now struct type Now struct { time.Time *Config } // With initialize Now with time func With(t time.Time) *Now { config := DefaultConfig if config == nil { config = &Config{ WeekStartDay: WeekStartDay, TimeFormats: TimeFormats, } } return &Now{Time: t, Config: config} } // New initialize Now with time func New(t time.Time) *Now { return With(t) } // BeginningOfMinute beginning of minute func BeginningOfMinute() time.Time { return With(time.Now()).BeginningOfMinute() } // BeginningOfHour beginning of hour func BeginningOfHour() time.Time { return With(time.Now()).BeginningOfHour() } // BeginningOfDay beginning of day func BeginningOfDay() time.Time { return With(time.Now()).BeginningOfDay() } // BeginningOfWeek beginning of week func BeginningOfWeek() time.Time { return With(time.Now()).BeginningOfWeek() } // BeginningOfMonth beginning of month func BeginningOfMonth() time.Time { return With(time.Now()).BeginningOfMonth() } // BeginningOfQuarter beginning of quarter func BeginningOfQuarter() time.Time { return With(time.Now()).BeginningOfQuarter() } // BeginningOfYear beginning of year func BeginningOfYear() time.Time { return With(time.Now()).BeginningOfYear() } // EndOfMinute end of minute func EndOfMinute() time.Time { return With(time.Now()).EndOfMinute() } // EndOfHour end of hour func EndOfHour() time.Time { return With(time.Now()).EndOfHour() } // EndOfDay end of day func EndOfDay() time.Time { return With(time.Now()).EndOfDay() } // EndOfWeek end of week func EndOfWeek() time.Time { return With(time.Now()).EndOfWeek() } // EndOfMonth end of month func EndOfMonth() time.Time { return With(time.Now()).EndOfMonth() } // EndOfQuarter end of quarter func EndOfQuarter() time.Time { return With(time.Now()).EndOfQuarter() } // EndOfYear end of year func EndOfYear() time.Time { return With(time.Now()).EndOfYear() } // Monday monday func Monday() time.Time { return With(time.Now()).Monday() } // Sunday sunday func Sunday() time.Time { return With(time.Now()).Sunday() } // EndOfSunday end of sunday func EndOfSunday() time.Time { return With(time.Now()).EndOfSunday() } // Parse parse string to time func Parse(strs ...string) (time.Time, error) { return With(time.Now()).Parse(strs...) } // ParseInLocation parse string to time in location func ParseInLocation(loc *time.Location, strs ...string) (time.Time, error) { return With(time.Now().In(loc)).Parse(strs...) } // MustParse must parse string to time or will panic func MustParse(strs ...string) time.Time { return With(time.Now()).MustParse(strs...) } // MustParseInLocation must parse string to time in location or will panic func MustParseInLocation(loc *time.Location, strs ...string) time.Time { return With(time.Now().In(loc)).MustParse(strs...) } // Between check now between the begin, end time or not func Between(time1, time2 string) bool { return With(time.Now()).Between(time1, time2) }
8,945
0
kubeflow_public_repos/fate-operator/vendor/github.com/jinzhu
kubeflow_public_repos/fate-operator/vendor/github.com/jinzhu/now/License
The MIT License (MIT) Copyright (c) 2013-NOW Jinzhu <[email protected]> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8,946
0
kubeflow_public_repos/fate-operator/vendor/github.com/jinzhu
kubeflow_public_repos/fate-operator/vendor/github.com/jinzhu/now/wercker.yml
box: golang build: steps: - setup-go-workspace # Gets the dependencies - script: name: go get code: | go get # Build the project - script: name: go build code: | go build ./... # Test the project - script: name: go test code: | go test ./...
8,947
0
kubeflow_public_repos/fate-operator/vendor/github.com/jinzhu
kubeflow_public_repos/fate-operator/vendor/github.com/jinzhu/now/now.go
package now import ( "errors" "regexp" "time" ) // BeginningOfMinute beginning of minute func (now *Now) BeginningOfMinute() time.Time { return now.Truncate(time.Minute) } // BeginningOfHour beginning of hour func (now *Now) BeginningOfHour() time.Time { y, m, d := now.Date() return time.Date(y, m, d, now.Time.Hour(), 0, 0, 0, now.Time.Location()) } // BeginningOfDay beginning of day func (now *Now) BeginningOfDay() time.Time { y, m, d := now.Date() return time.Date(y, m, d, 0, 0, 0, 0, now.Time.Location()) } // BeginningOfWeek beginning of week func (now *Now) BeginningOfWeek() time.Time { t := now.BeginningOfDay() weekday := int(t.Weekday()) if now.WeekStartDay != time.Sunday { weekStartDayInt := int(now.WeekStartDay) if weekday < weekStartDayInt { weekday = weekday + 7 - weekStartDayInt } else { weekday = weekday - weekStartDayInt } } return t.AddDate(0, 0, -weekday) } // BeginningOfMonth beginning of month func (now *Now) BeginningOfMonth() time.Time { y, m, _ := now.Date() return time.Date(y, m, 1, 0, 0, 0, 0, now.Location()) } // BeginningOfQuarter beginning of quarter func (now *Now) BeginningOfQuarter() time.Time { month := now.BeginningOfMonth() offset := (int(month.Month()) - 1) % 3 return month.AddDate(0, -offset, 0) } // BeginningOfHalf beginning of half year func (now *Now) BeginningOfHalf() time.Time { month := now.BeginningOfMonth() offset := (int(month.Month()) - 1) % 6 return month.AddDate(0, -offset, 0) } // BeginningOfYear BeginningOfYear beginning of year func (now *Now) BeginningOfYear() time.Time { y, _, _ := now.Date() return time.Date(y, time.January, 1, 0, 0, 0, 0, now.Location()) } // EndOfMinute end of minute func (now *Now) EndOfMinute() time.Time { return now.BeginningOfMinute().Add(time.Minute - time.Nanosecond) } // EndOfHour end of hour func (now *Now) EndOfHour() time.Time { return now.BeginningOfHour().Add(time.Hour - time.Nanosecond) } // EndOfDay end of day func (now *Now) EndOfDay() time.Time { y, m, d := now.Date() return time.Date(y, m, d, 23, 59, 59, int(time.Second-time.Nanosecond), now.Location()) } // EndOfWeek end of week func (now *Now) EndOfWeek() time.Time { return now.BeginningOfWeek().AddDate(0, 0, 7).Add(-time.Nanosecond) } // EndOfMonth end of month func (now *Now) EndOfMonth() time.Time { return now.BeginningOfMonth().AddDate(0, 1, 0).Add(-time.Nanosecond) } // EndOfQuarter end of quarter func (now *Now) EndOfQuarter() time.Time { return now.BeginningOfQuarter().AddDate(0, 3, 0).Add(-time.Nanosecond) } // EndOfHalf end of half year func (now *Now) EndOfHalf() time.Time { return now.BeginningOfHalf().AddDate(0, 6, 0).Add(-time.Nanosecond) } // EndOfYear end of year func (now *Now) EndOfYear() time.Time { return now.BeginningOfYear().AddDate(1, 0, 0).Add(-time.Nanosecond) } // Monday monday func (now *Now) Monday() time.Time { t := now.BeginningOfDay() weekday := int(t.Weekday()) if weekday == 0 { weekday = 7 } return t.AddDate(0, 0, -weekday+1) } // Sunday sunday func (now *Now) Sunday() time.Time { t := now.BeginningOfDay() weekday := int(t.Weekday()) if weekday == 0 { return t } return t.AddDate(0, 0, (7 - weekday)) } // EndOfSunday end of sunday func (now *Now) EndOfSunday() time.Time { return New(now.Sunday()).EndOfDay() } func (now *Now) parseWithFormat(str string, location *time.Location) (t time.Time, err error) { for _, format := range now.TimeFormats { t, err = time.ParseInLocation(format, str, location) if err == nil { return } } err = errors.New("Can't parse string as time: " + str) return } var hasTimeRegexp = regexp.MustCompile(`(\s+|^\s*)\d{1,2}((:\d{1,2})*|((:\d{1,2}){2}\.(\d{3}|\d{6}|\d{9})))\s*$`) // match 15:04:05, 15:04:05.000, 15:04:05.000000 15, 2017-01-01 15:04, etc var onlyTimeRegexp = regexp.MustCompile(`^\s*\d{1,2}((:\d{1,2})*|((:\d{1,2}){2}\.(\d{3}|\d{6}|\d{9})))\s*$`) // match 15:04:05, 15, 15:04:05.000, 15:04:05.000000, etc // Parse parse string to time func (now *Now) Parse(strs ...string) (t time.Time, err error) { var ( setCurrentTime bool parseTime []int currentTime = []int{now.Nanosecond(), now.Second(), now.Minute(), now.Hour(), now.Day(), int(now.Month()), now.Year()} currentLocation = now.Location() onlyTimeInStr = true ) for _, str := range strs { hasTimeInStr := hasTimeRegexp.MatchString(str) // match 15:04:05, 15 onlyTimeInStr = hasTimeInStr && onlyTimeInStr && onlyTimeRegexp.MatchString(str) if t, err = now.parseWithFormat(str, currentLocation); err == nil { location := t.Location() parseTime = []int{t.Nanosecond(), t.Second(), t.Minute(), t.Hour(), t.Day(), int(t.Month()), t.Year()} for i, v := range parseTime { // Don't reset hour, minute, second if current time str including time if hasTimeInStr && i <= 3 { continue } // If value is zero, replace it with current time if v == 0 { if setCurrentTime { parseTime[i] = currentTime[i] } } else { setCurrentTime = true } // if current time only includes time, should change day, month to current time if onlyTimeInStr { if i == 4 || i == 5 { parseTime[i] = currentTime[i] continue } } } t = time.Date(parseTime[6], time.Month(parseTime[5]), parseTime[4], parseTime[3], parseTime[2], parseTime[1], parseTime[0], location) currentTime = []int{t.Nanosecond(), t.Second(), t.Minute(), t.Hour(), t.Day(), int(t.Month()), t.Year()} } } return } // MustParse must parse string to time or it will panic func (now *Now) MustParse(strs ...string) (t time.Time) { t, err := now.Parse(strs...) if err != nil { panic(err) } return t } // Between check time between the begin, end time or not func (now *Now) Between(begin, end string) bool { beginTime := now.MustParse(begin) endTime := now.MustParse(end) return now.After(beginTime) && now.Before(endTime) }
8,948
0
kubeflow_public_repos/fate-operator/vendor/github.com/jinzhu
kubeflow_public_repos/fate-operator/vendor/github.com/jinzhu/inflection/go.mod
module github.com/jinzhu/inflection
8,949
0
kubeflow_public_repos/fate-operator/vendor/github.com/jinzhu
kubeflow_public_repos/fate-operator/vendor/github.com/jinzhu/inflection/README.md
# Inflection Inflection pluralizes and singularizes English nouns [![wercker status](https://app.wercker.com/status/f8c7432b097d1f4ce636879670be0930/s/master "wercker status")](https://app.wercker.com/project/byKey/f8c7432b097d1f4ce636879670be0930) ## Basic Usage ```go inflection.Plural("person") => "people" inflection.Plural("Person") => "People" inflection.Plural("PERSON") => "PEOPLE" inflection.Plural("bus") => "buses" inflection.Plural("BUS") => "BUSES" inflection.Plural("Bus") => "Buses" inflection.Singular("people") => "person" inflection.Singular("People") => "Person" inflection.Singular("PEOPLE") => "PERSON" inflection.Singular("buses") => "bus" inflection.Singular("BUSES") => "BUS" inflection.Singular("Buses") => "Bus" inflection.Plural("FancyPerson") => "FancyPeople" inflection.Singular("FancyPeople") => "FancyPerson" ``` ## Register Rules Standard rules are from Rails's ActiveSupport (https://github.com/rails/rails/blob/master/activesupport/lib/active_support/inflections.rb) If you want to register more rules, follow: ``` inflection.AddUncountable("fish") inflection.AddIrregular("person", "people") inflection.AddPlural("(bu)s$", "${1}ses") # "bus" => "buses" / "BUS" => "BUSES" / "Bus" => "Buses" inflection.AddSingular("(bus)(es)?$", "${1}") # "buses" => "bus" / "Buses" => "Bus" / "BUSES" => "BUS" ``` ## Contributing You can help to make the project better, check out [http://gorm.io/contribute.html](http://gorm.io/contribute.html) for things you can do. ## Author **jinzhu** * <http://github.com/jinzhu> * <[email protected]> * <http://twitter.com/zhangjinzhu> ## License Released under the [MIT License](http://www.opensource.org/licenses/MIT).
8,950
0
kubeflow_public_repos/fate-operator/vendor/github.com/jinzhu
kubeflow_public_repos/fate-operator/vendor/github.com/jinzhu/inflection/LICENSE
The MIT License (MIT) Copyright (c) 2015 - Jinzhu Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8,951
0
kubeflow_public_repos/fate-operator/vendor/github.com/jinzhu
kubeflow_public_repos/fate-operator/vendor/github.com/jinzhu/inflection/wercker.yml
box: golang build: steps: - setup-go-workspace # Gets the dependencies - script: name: go get code: | go get # Build the project - script: name: go build code: | go build ./... # Test the project - script: name: go test code: | go test ./...
8,952
0
kubeflow_public_repos/fate-operator/vendor/github.com/jinzhu
kubeflow_public_repos/fate-operator/vendor/github.com/jinzhu/inflection/inflections.go
/* Package inflection pluralizes and singularizes English nouns. inflection.Plural("person") => "people" inflection.Plural("Person") => "People" inflection.Plural("PERSON") => "PEOPLE" inflection.Singular("people") => "person" inflection.Singular("People") => "Person" inflection.Singular("PEOPLE") => "PERSON" inflection.Plural("FancyPerson") => "FancydPeople" inflection.Singular("FancyPeople") => "FancydPerson" Standard rules are from Rails's ActiveSupport (https://github.com/rails/rails/blob/master/activesupport/lib/active_support/inflections.rb) If you want to register more rules, follow: inflection.AddUncountable("fish") inflection.AddIrregular("person", "people") inflection.AddPlural("(bu)s$", "${1}ses") # "bus" => "buses" / "BUS" => "BUSES" / "Bus" => "Buses" inflection.AddSingular("(bus)(es)?$", "${1}") # "buses" => "bus" / "Buses" => "Bus" / "BUSES" => "BUS" */ package inflection import ( "regexp" "strings" ) type inflection struct { regexp *regexp.Regexp replace string } // Regular is a regexp find replace inflection type Regular struct { find string replace string } // Irregular is a hard replace inflection, // containing both singular and plural forms type Irregular struct { singular string plural string } // RegularSlice is a slice of Regular inflections type RegularSlice []Regular // IrregularSlice is a slice of Irregular inflections type IrregularSlice []Irregular var pluralInflections = RegularSlice{ {"([a-z])$", "${1}s"}, {"s$", "s"}, {"^(ax|test)is$", "${1}es"}, {"(octop|vir)us$", "${1}i"}, {"(octop|vir)i$", "${1}i"}, {"(alias|status)$", "${1}es"}, {"(bu)s$", "${1}ses"}, {"(buffal|tomat)o$", "${1}oes"}, {"([ti])um$", "${1}a"}, {"([ti])a$", "${1}a"}, {"sis$", "ses"}, {"(?:([^f])fe|([lr])f)$", "${1}${2}ves"}, {"(hive)$", "${1}s"}, {"([^aeiouy]|qu)y$", "${1}ies"}, {"(x|ch|ss|sh)$", "${1}es"}, {"(matr|vert|ind)(?:ix|ex)$", "${1}ices"}, {"^(m|l)ouse$", "${1}ice"}, {"^(m|l)ice$", "${1}ice"}, {"^(ox)$", "${1}en"}, {"^(oxen)$", "${1}"}, {"(quiz)$", "${1}zes"}, } var singularInflections = RegularSlice{ {"s$", ""}, {"(ss)$", "${1}"}, {"(n)ews$", "${1}ews"}, {"([ti])a$", "${1}um"}, {"((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)(sis|ses)$", "${1}sis"}, {"(^analy)(sis|ses)$", "${1}sis"}, {"([^f])ves$", "${1}fe"}, {"(hive)s$", "${1}"}, {"(tive)s$", "${1}"}, {"([lr])ves$", "${1}f"}, {"([^aeiouy]|qu)ies$", "${1}y"}, {"(s)eries$", "${1}eries"}, {"(m)ovies$", "${1}ovie"}, {"(c)ookies$", "${1}ookie"}, {"(x|ch|ss|sh)es$", "${1}"}, {"^(m|l)ice$", "${1}ouse"}, {"(bus)(es)?$", "${1}"}, {"(o)es$", "${1}"}, {"(shoe)s$", "${1}"}, {"(cris|test)(is|es)$", "${1}is"}, {"^(a)x[ie]s$", "${1}xis"}, {"(octop|vir)(us|i)$", "${1}us"}, {"(alias|status)(es)?$", "${1}"}, {"^(ox)en", "${1}"}, {"(vert|ind)ices$", "${1}ex"}, {"(matr)ices$", "${1}ix"}, {"(quiz)zes$", "${1}"}, {"(database)s$", "${1}"}, } var irregularInflections = IrregularSlice{ {"person", "people"}, {"man", "men"}, {"child", "children"}, {"sex", "sexes"}, {"move", "moves"}, {"mombie", "mombies"}, } var uncountableInflections = []string{"equipment", "information", "rice", "money", "species", "series", "fish", "sheep", "jeans", "police"} var compiledPluralMaps []inflection var compiledSingularMaps []inflection func compile() { compiledPluralMaps = []inflection{} compiledSingularMaps = []inflection{} for _, uncountable := range uncountableInflections { inf := inflection{ regexp: regexp.MustCompile("^(?i)(" + uncountable + ")$"), replace: "${1}", } compiledPluralMaps = append(compiledPluralMaps, inf) compiledSingularMaps = append(compiledSingularMaps, inf) } for _, value := range irregularInflections { infs := []inflection{ inflection{regexp: regexp.MustCompile(strings.ToUpper(value.singular) + "$"), replace: strings.ToUpper(value.plural)}, inflection{regexp: regexp.MustCompile(strings.Title(value.singular) + "$"), replace: strings.Title(value.plural)}, inflection{regexp: regexp.MustCompile(value.singular + "$"), replace: value.plural}, } compiledPluralMaps = append(compiledPluralMaps, infs...) } for _, value := range irregularInflections { infs := []inflection{ inflection{regexp: regexp.MustCompile(strings.ToUpper(value.plural) + "$"), replace: strings.ToUpper(value.singular)}, inflection{regexp: regexp.MustCompile(strings.Title(value.plural) + "$"), replace: strings.Title(value.singular)}, inflection{regexp: regexp.MustCompile(value.plural + "$"), replace: value.singular}, } compiledSingularMaps = append(compiledSingularMaps, infs...) } for i := len(pluralInflections) - 1; i >= 0; i-- { value := pluralInflections[i] infs := []inflection{ inflection{regexp: regexp.MustCompile(strings.ToUpper(value.find)), replace: strings.ToUpper(value.replace)}, inflection{regexp: regexp.MustCompile(value.find), replace: value.replace}, inflection{regexp: regexp.MustCompile("(?i)" + value.find), replace: value.replace}, } compiledPluralMaps = append(compiledPluralMaps, infs...) } for i := len(singularInflections) - 1; i >= 0; i-- { value := singularInflections[i] infs := []inflection{ inflection{regexp: regexp.MustCompile(strings.ToUpper(value.find)), replace: strings.ToUpper(value.replace)}, inflection{regexp: regexp.MustCompile(value.find), replace: value.replace}, inflection{regexp: regexp.MustCompile("(?i)" + value.find), replace: value.replace}, } compiledSingularMaps = append(compiledSingularMaps, infs...) } } func init() { compile() } // AddPlural adds a plural inflection func AddPlural(find, replace string) { pluralInflections = append(pluralInflections, Regular{find, replace}) compile() } // AddSingular adds a singular inflection func AddSingular(find, replace string) { singularInflections = append(singularInflections, Regular{find, replace}) compile() } // AddIrregular adds an irregular inflection func AddIrregular(singular, plural string) { irregularInflections = append(irregularInflections, Irregular{singular, plural}) compile() } // AddUncountable adds an uncountable inflection func AddUncountable(values ...string) { uncountableInflections = append(uncountableInflections, values...) compile() } // GetPlural retrieves the plural inflection values func GetPlural() RegularSlice { plurals := make(RegularSlice, len(pluralInflections)) copy(plurals, pluralInflections) return plurals } // GetSingular retrieves the singular inflection values func GetSingular() RegularSlice { singulars := make(RegularSlice, len(singularInflections)) copy(singulars, singularInflections) return singulars } // GetIrregular retrieves the irregular inflection values func GetIrregular() IrregularSlice { irregular := make(IrregularSlice, len(irregularInflections)) copy(irregular, irregularInflections) return irregular } // GetUncountable retrieves the uncountable inflection values func GetUncountable() []string { uncountables := make([]string, len(uncountableInflections)) copy(uncountables, uncountableInflections) return uncountables } // SetPlural sets the plural inflections slice func SetPlural(inflections RegularSlice) { pluralInflections = inflections compile() } // SetSingular sets the singular inflections slice func SetSingular(inflections RegularSlice) { singularInflections = inflections compile() } // SetIrregular sets the irregular inflections slice func SetIrregular(inflections IrregularSlice) { irregularInflections = inflections compile() } // SetUncountable sets the uncountable inflections slice func SetUncountable(inflections []string) { uncountableInflections = inflections compile() } // Plural converts a word to its plural form func Plural(str string) string { for _, inflection := range compiledPluralMaps { if inflection.regexp.MatchString(str) { return inflection.regexp.ReplaceAllString(str, inflection.replace) } } return str } // Singular converts a word to its singular form func Singular(str string) string { for _, inflection := range compiledSingularMaps { if inflection.regexp.MatchString(str) { return inflection.regexp.ReplaceAllString(str, inflection.replace) } } return str }
8,953
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/config.go
package jsoniter import ( "encoding/json" "io" "reflect" "sync" "unsafe" "github.com/modern-go/concurrent" "github.com/modern-go/reflect2" ) // Config customize how the API should behave. // The API is created from Config by Froze. type Config struct { IndentionStep int MarshalFloatWith6Digits bool EscapeHTML bool SortMapKeys bool UseNumber bool DisallowUnknownFields bool TagKey string OnlyTaggedField bool ValidateJsonRawMessage bool ObjectFieldMustBeSimpleString bool CaseSensitive bool } // API the public interface of this package. // Primary Marshal and Unmarshal. type API interface { IteratorPool StreamPool MarshalToString(v interface{}) (string, error) Marshal(v interface{}) ([]byte, error) MarshalIndent(v interface{}, prefix, indent string) ([]byte, error) UnmarshalFromString(str string, v interface{}) error Unmarshal(data []byte, v interface{}) error Get(data []byte, path ...interface{}) Any NewEncoder(writer io.Writer) *Encoder NewDecoder(reader io.Reader) *Decoder Valid(data []byte) bool RegisterExtension(extension Extension) DecoderOf(typ reflect2.Type) ValDecoder EncoderOf(typ reflect2.Type) ValEncoder } // ConfigDefault the default API var ConfigDefault = Config{ EscapeHTML: true, }.Froze() // ConfigCompatibleWithStandardLibrary tries to be 100% compatible with standard library behavior var ConfigCompatibleWithStandardLibrary = Config{ EscapeHTML: true, SortMapKeys: true, ValidateJsonRawMessage: true, }.Froze() // ConfigFastest marshals float with only 6 digits precision var ConfigFastest = Config{ EscapeHTML: false, MarshalFloatWith6Digits: true, // will lose precession ObjectFieldMustBeSimpleString: true, // do not unescape object field }.Froze() type frozenConfig struct { configBeforeFrozen Config sortMapKeys bool indentionStep int objectFieldMustBeSimpleString bool onlyTaggedField bool disallowUnknownFields bool decoderCache *concurrent.Map encoderCache *concurrent.Map encoderExtension Extension decoderExtension Extension extraExtensions []Extension streamPool *sync.Pool iteratorPool *sync.Pool caseSensitive bool } func (cfg *frozenConfig) initCache() { cfg.decoderCache = concurrent.NewMap() cfg.encoderCache = concurrent.NewMap() } func (cfg *frozenConfig) addDecoderToCache(cacheKey uintptr, decoder ValDecoder) { cfg.decoderCache.Store(cacheKey, decoder) } func (cfg *frozenConfig) addEncoderToCache(cacheKey uintptr, encoder ValEncoder) { cfg.encoderCache.Store(cacheKey, encoder) } func (cfg *frozenConfig) getDecoderFromCache(cacheKey uintptr) ValDecoder { decoder, found := cfg.decoderCache.Load(cacheKey) if found { return decoder.(ValDecoder) } return nil } func (cfg *frozenConfig) getEncoderFromCache(cacheKey uintptr) ValEncoder { encoder, found := cfg.encoderCache.Load(cacheKey) if found { return encoder.(ValEncoder) } return nil } var cfgCache = concurrent.NewMap() func getFrozenConfigFromCache(cfg Config) *frozenConfig { obj, found := cfgCache.Load(cfg) if found { return obj.(*frozenConfig) } return nil } func addFrozenConfigToCache(cfg Config, frozenConfig *frozenConfig) { cfgCache.Store(cfg, frozenConfig) } // Froze forge API from config func (cfg Config) Froze() API { api := &frozenConfig{ sortMapKeys: cfg.SortMapKeys, indentionStep: cfg.IndentionStep, objectFieldMustBeSimpleString: cfg.ObjectFieldMustBeSimpleString, onlyTaggedField: cfg.OnlyTaggedField, disallowUnknownFields: cfg.DisallowUnknownFields, caseSensitive: cfg.CaseSensitive, } api.streamPool = &sync.Pool{ New: func() interface{} { return NewStream(api, nil, 512) }, } api.iteratorPool = &sync.Pool{ New: func() interface{} { return NewIterator(api) }, } api.initCache() encoderExtension := EncoderExtension{} decoderExtension := DecoderExtension{} if cfg.MarshalFloatWith6Digits { api.marshalFloatWith6Digits(encoderExtension) } if cfg.EscapeHTML { api.escapeHTML(encoderExtension) } if cfg.UseNumber { api.useNumber(decoderExtension) } if cfg.ValidateJsonRawMessage { api.validateJsonRawMessage(encoderExtension) } api.encoderExtension = encoderExtension api.decoderExtension = decoderExtension api.configBeforeFrozen = cfg return api } func (cfg Config) frozeWithCacheReuse(extraExtensions []Extension) *frozenConfig { api := getFrozenConfigFromCache(cfg) if api != nil { return api } api = cfg.Froze().(*frozenConfig) for _, extension := range extraExtensions { api.RegisterExtension(extension) } addFrozenConfigToCache(cfg, api) return api } func (cfg *frozenConfig) validateJsonRawMessage(extension EncoderExtension) { encoder := &funcEncoder{func(ptr unsafe.Pointer, stream *Stream) { rawMessage := *(*json.RawMessage)(ptr) iter := cfg.BorrowIterator([]byte(rawMessage)) defer cfg.ReturnIterator(iter) iter.Read() if iter.Error != nil && iter.Error != io.EOF { stream.WriteRaw("null") } else { stream.WriteRaw(string(rawMessage)) } }, func(ptr unsafe.Pointer) bool { return len(*((*json.RawMessage)(ptr))) == 0 }} extension[reflect2.TypeOfPtr((*json.RawMessage)(nil)).Elem()] = encoder extension[reflect2.TypeOfPtr((*RawMessage)(nil)).Elem()] = encoder } func (cfg *frozenConfig) useNumber(extension DecoderExtension) { extension[reflect2.TypeOfPtr((*interface{})(nil)).Elem()] = &funcDecoder{func(ptr unsafe.Pointer, iter *Iterator) { exitingValue := *((*interface{})(ptr)) if exitingValue != nil && reflect.TypeOf(exitingValue).Kind() == reflect.Ptr { iter.ReadVal(exitingValue) return } if iter.WhatIsNext() == NumberValue { *((*interface{})(ptr)) = json.Number(iter.readNumberAsString()) } else { *((*interface{})(ptr)) = iter.Read() } }} } func (cfg *frozenConfig) getTagKey() string { tagKey := cfg.configBeforeFrozen.TagKey if tagKey == "" { return "json" } return tagKey } func (cfg *frozenConfig) RegisterExtension(extension Extension) { cfg.extraExtensions = append(cfg.extraExtensions, extension) copied := cfg.configBeforeFrozen cfg.configBeforeFrozen = copied } type lossyFloat32Encoder struct { } func (encoder *lossyFloat32Encoder) Encode(ptr unsafe.Pointer, stream *Stream) { stream.WriteFloat32Lossy(*((*float32)(ptr))) } func (encoder *lossyFloat32Encoder) IsEmpty(ptr unsafe.Pointer) bool { return *((*float32)(ptr)) == 0 } type lossyFloat64Encoder struct { } func (encoder *lossyFloat64Encoder) Encode(ptr unsafe.Pointer, stream *Stream) { stream.WriteFloat64Lossy(*((*float64)(ptr))) } func (encoder *lossyFloat64Encoder) IsEmpty(ptr unsafe.Pointer) bool { return *((*float64)(ptr)) == 0 } // EnableLossyFloatMarshalling keeps 10**(-6) precision // for float variables for better performance. func (cfg *frozenConfig) marshalFloatWith6Digits(extension EncoderExtension) { // for better performance extension[reflect2.TypeOfPtr((*float32)(nil)).Elem()] = &lossyFloat32Encoder{} extension[reflect2.TypeOfPtr((*float64)(nil)).Elem()] = &lossyFloat64Encoder{} } type htmlEscapedStringEncoder struct { } func (encoder *htmlEscapedStringEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { str := *((*string)(ptr)) stream.WriteStringWithHTMLEscaped(str) } func (encoder *htmlEscapedStringEncoder) IsEmpty(ptr unsafe.Pointer) bool { return *((*string)(ptr)) == "" } func (cfg *frozenConfig) escapeHTML(encoderExtension EncoderExtension) { encoderExtension[reflect2.TypeOfPtr((*string)(nil)).Elem()] = &htmlEscapedStringEncoder{} } func (cfg *frozenConfig) cleanDecoders() { typeDecoders = map[string]ValDecoder{} fieldDecoders = map[string]ValDecoder{} *cfg = *(cfg.configBeforeFrozen.Froze().(*frozenConfig)) } func (cfg *frozenConfig) cleanEncoders() { typeEncoders = map[string]ValEncoder{} fieldEncoders = map[string]ValEncoder{} *cfg = *(cfg.configBeforeFrozen.Froze().(*frozenConfig)) } func (cfg *frozenConfig) MarshalToString(v interface{}) (string, error) { stream := cfg.BorrowStream(nil) defer cfg.ReturnStream(stream) stream.WriteVal(v) if stream.Error != nil { return "", stream.Error } return string(stream.Buffer()), nil } func (cfg *frozenConfig) Marshal(v interface{}) ([]byte, error) { stream := cfg.BorrowStream(nil) defer cfg.ReturnStream(stream) stream.WriteVal(v) if stream.Error != nil { return nil, stream.Error } result := stream.Buffer() copied := make([]byte, len(result)) copy(copied, result) return copied, nil } func (cfg *frozenConfig) MarshalIndent(v interface{}, prefix, indent string) ([]byte, error) { if prefix != "" { panic("prefix is not supported") } for _, r := range indent { if r != ' ' { panic("indent can only be space") } } newCfg := cfg.configBeforeFrozen newCfg.IndentionStep = len(indent) return newCfg.frozeWithCacheReuse(cfg.extraExtensions).Marshal(v) } func (cfg *frozenConfig) UnmarshalFromString(str string, v interface{}) error { data := []byte(str) iter := cfg.BorrowIterator(data) defer cfg.ReturnIterator(iter) iter.ReadVal(v) c := iter.nextToken() if c == 0 { if iter.Error == io.EOF { return nil } return iter.Error } iter.ReportError("Unmarshal", "there are bytes left after unmarshal") return iter.Error } func (cfg *frozenConfig) Get(data []byte, path ...interface{}) Any { iter := cfg.BorrowIterator(data) defer cfg.ReturnIterator(iter) return locatePath(iter, path) } func (cfg *frozenConfig) Unmarshal(data []byte, v interface{}) error { iter := cfg.BorrowIterator(data) defer cfg.ReturnIterator(iter) iter.ReadVal(v) c := iter.nextToken() if c == 0 { if iter.Error == io.EOF { return nil } return iter.Error } iter.ReportError("Unmarshal", "there are bytes left after unmarshal") return iter.Error } func (cfg *frozenConfig) NewEncoder(writer io.Writer) *Encoder { stream := NewStream(cfg, writer, 512) return &Encoder{stream} } func (cfg *frozenConfig) NewDecoder(reader io.Reader) *Decoder { iter := Parse(cfg, reader, 512) return &Decoder{iter} } func (cfg *frozenConfig) Valid(data []byte) bool { iter := cfg.BorrowIterator(data) defer cfg.ReturnIterator(iter) iter.Skip() return iter.Error == nil }
8,954
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/fuzzy_mode_convert_table.md
| json type \ dest type | bool | int | uint | float |string| | --- | --- | --- | --- |--|--| | number | positive => true <br/> negative => true <br/> zero => false| 23.2 => 23 <br/> -32.1 => -32| 12.1 => 12 <br/> -12.1 => 0|as normal|same as origin| | string | empty string => false <br/> string "0" => false <br/> other strings => true | "123.32" => 123 <br/> "-123.4" => -123 <br/> "123.23xxxw" => 123 <br/> "abcde12" => 0 <br/> "-32.1" => -32| 13.2 => 13 <br/> -1.1 => 0 |12.1 => 12.1 <br/> -12.3 => -12.3<br/> 12.4xxa => 12.4 <br/> +1.1e2 =>110 |same as origin| | bool | true => true <br/> false => false| true => 1 <br/> false => 0 | true => 1 <br/> false => 0 |true => 1 <br/>false => 0|true => "true" <br/> false => "false"| | object | true | 0 | 0 |0|originnal json| | array | empty array => false <br/> nonempty array => true| [] => 0 <br/> [1,2] => 1 | [] => 0 <br/> [1,2] => 1 |[] => 0<br/>[1,2] => 1|original json|
8,955
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/Gopkg.toml
# Gopkg.toml example # # Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md # for detailed Gopkg.toml documentation. # # required = ["github.com/user/thing/cmd/thing"] # ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] # # [[constraint]] # name = "github.com/user/project" # version = "1.0.0" # # [[constraint]] # name = "github.com/user/project2" # branch = "dev" # source = "github.com/myfork/project2" # # [[override]] # name = "github.com/x/y" # version = "2.4.0" ignored = ["github.com/davecgh/go-spew*","github.com/google/gofuzz*","github.com/stretchr/testify*"] [[constraint]] name = "github.com/modern-go/reflect2" version = "1.0.1"
8,956
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/go.mod
module github.com/json-iterator/go go 1.12 require ( github.com/davecgh/go-spew v1.1.1 github.com/google/gofuzz v1.0.0 github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 github.com/stretchr/testify v1.3.0 )
8,957
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/build.sh
#!/bin/bash set -e set -x if [ ! -d /tmp/build-golang/src/github.com/json-iterator ]; then mkdir -p /tmp/build-golang/src/github.com/json-iterator ln -s $PWD /tmp/build-golang/src/github.com/json-iterator/go fi export GOPATH=/tmp/build-golang go get -u github.com/golang/dep/cmd/dep cd /tmp/build-golang/src/github.com/json-iterator/go exec $GOPATH/bin/dep ensure -update
8,958
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/reflect_slice.go
package jsoniter import ( "fmt" "github.com/modern-go/reflect2" "io" "unsafe" ) func decoderOfSlice(ctx *ctx, typ reflect2.Type) ValDecoder { sliceType := typ.(*reflect2.UnsafeSliceType) decoder := decoderOfType(ctx.append("[sliceElem]"), sliceType.Elem()) return &sliceDecoder{sliceType, decoder} } func encoderOfSlice(ctx *ctx, typ reflect2.Type) ValEncoder { sliceType := typ.(*reflect2.UnsafeSliceType) encoder := encoderOfType(ctx.append("[sliceElem]"), sliceType.Elem()) return &sliceEncoder{sliceType, encoder} } type sliceEncoder struct { sliceType *reflect2.UnsafeSliceType elemEncoder ValEncoder } func (encoder *sliceEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { if encoder.sliceType.UnsafeIsNil(ptr) { stream.WriteNil() return } length := encoder.sliceType.UnsafeLengthOf(ptr) if length == 0 { stream.WriteEmptyArray() return } stream.WriteArrayStart() encoder.elemEncoder.Encode(encoder.sliceType.UnsafeGetIndex(ptr, 0), stream) for i := 1; i < length; i++ { stream.WriteMore() elemPtr := encoder.sliceType.UnsafeGetIndex(ptr, i) encoder.elemEncoder.Encode(elemPtr, stream) } stream.WriteArrayEnd() if stream.Error != nil && stream.Error != io.EOF { stream.Error = fmt.Errorf("%v: %s", encoder.sliceType, stream.Error.Error()) } } func (encoder *sliceEncoder) IsEmpty(ptr unsafe.Pointer) bool { return encoder.sliceType.UnsafeLengthOf(ptr) == 0 } type sliceDecoder struct { sliceType *reflect2.UnsafeSliceType elemDecoder ValDecoder } func (decoder *sliceDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { decoder.doDecode(ptr, iter) if iter.Error != nil && iter.Error != io.EOF { iter.Error = fmt.Errorf("%v: %s", decoder.sliceType, iter.Error.Error()) } } func (decoder *sliceDecoder) doDecode(ptr unsafe.Pointer, iter *Iterator) { c := iter.nextToken() sliceType := decoder.sliceType if c == 'n' { iter.skipThreeBytes('u', 'l', 'l') sliceType.UnsafeSetNil(ptr) return } if c != '[' { iter.ReportError("decode slice", "expect [ or n, but found "+string([]byte{c})) return } c = iter.nextToken() if c == ']' { sliceType.UnsafeSet(ptr, sliceType.UnsafeMakeSlice(0, 0)) return } iter.unreadByte() sliceType.UnsafeGrow(ptr, 1) elemPtr := sliceType.UnsafeGetIndex(ptr, 0) decoder.elemDecoder.Decode(elemPtr, iter) length := 1 for c = iter.nextToken(); c == ','; c = iter.nextToken() { idx := length length += 1 sliceType.UnsafeGrow(ptr, length) elemPtr = sliceType.UnsafeGetIndex(ptr, idx) decoder.elemDecoder.Decode(elemPtr, iter) } if c != ']' { iter.ReportError("decode slice", "expect ], but found "+string([]byte{c})) return } }
8,959
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/Gopkg.lock
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. [[projects]] name = "github.com/modern-go/concurrent" packages = ["."] revision = "e0a39a4cb4216ea8db28e22a69f4ec25610d513a" version = "1.0.0" [[projects]] name = "github.com/modern-go/reflect2" packages = ["."] revision = "4b7aa43c6742a2c18fdef89dd197aaae7dac7ccd" version = "1.0.1" [solve-meta] analyzer-name = "dep" analyzer-version = 1 inputs-digest = "ea54a775e5a354cb015502d2e7aa4b74230fc77e894f34a838b268c25ec8eeb8" solver-name = "gps-cdcl" solver-version = 1
8,960
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/iter_skip_sloppy.go
//+build jsoniter_sloppy package jsoniter // sloppy but faster implementation, do not validate the input json func (iter *Iterator) skipNumber() { for { for i := iter.head; i < iter.tail; i++ { c := iter.buf[i] switch c { case ' ', '\n', '\r', '\t', ',', '}', ']': iter.head = i return } } if !iter.loadMore() { return } } } func (iter *Iterator) skipArray() { level := 1 if !iter.incrementDepth() { return } for { for i := iter.head; i < iter.tail; i++ { switch iter.buf[i] { case '"': // If inside string, skip it iter.head = i + 1 iter.skipString() i = iter.head - 1 // it will be i++ soon case '[': // If open symbol, increase level level++ if !iter.incrementDepth() { return } case ']': // If close symbol, increase level level-- if !iter.decrementDepth() { return } // If we have returned to the original level, we're done if level == 0 { iter.head = i + 1 return } } } if !iter.loadMore() { iter.ReportError("skipObject", "incomplete array") return } } } func (iter *Iterator) skipObject() { level := 1 if !iter.incrementDepth() { return } for { for i := iter.head; i < iter.tail; i++ { switch iter.buf[i] { case '"': // If inside string, skip it iter.head = i + 1 iter.skipString() i = iter.head - 1 // it will be i++ soon case '{': // If open symbol, increase level level++ if !iter.incrementDepth() { return } case '}': // If close symbol, increase level level-- if !iter.decrementDepth() { return } // If we have returned to the original level, we're done if level == 0 { iter.head = i + 1 return } } } if !iter.loadMore() { iter.ReportError("skipObject", "incomplete object") return } } } func (iter *Iterator) skipString() { for { end, escaped := iter.findStringEnd() if end == -1 { if !iter.loadMore() { iter.ReportError("skipString", "incomplete string") return } if escaped { iter.head = 1 // skip the first char as last char read is \ } } else { iter.head = end return } } } // adapted from: https://github.com/buger/jsonparser/blob/master/parser.go // Tries to find the end of string // Support if string contains escaped quote symbols. func (iter *Iterator) findStringEnd() (int, bool) { escaped := false for i := iter.head; i < iter.tail; i++ { c := iter.buf[i] if c == '"' { if !escaped { return i + 1, false } j := i - 1 for { if j < iter.head || iter.buf[j] != '\\' { // even number of backslashes // either end of buffer, or " found return i + 1, true } j-- if j < iter.head || iter.buf[j] != '\\' { // odd number of backslashes // it is \" or \\\" break } j-- } } else if c == '\\' { escaped = true } } j := iter.tail - 1 for { if j < iter.head || iter.buf[j] != '\\' { // even number of backslashes // either end of buffer, or " found return -1, false // do not end with \ } j-- if j < iter.head || iter.buf[j] != '\\' { // odd number of backslashes // it is \" or \\\" break } j-- } return -1, true // end with \ }
8,961
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/jsoniter.go
// Package jsoniter implements encoding and decoding of JSON as defined in // RFC 4627 and provides interfaces with identical syntax of standard lib encoding/json. // Converting from encoding/json to jsoniter is no more than replacing the package with jsoniter // and variable type declarations (if any). // jsoniter interfaces gives 100% compatibility with code using standard lib. // // "JSON and Go" // (https://golang.org/doc/articles/json_and_go.html) // gives a description of how Marshal/Unmarshal operate // between arbitrary or predefined json objects and bytes, // and it applies to jsoniter.Marshal/Unmarshal as well. // // Besides, jsoniter.Iterator provides a different set of interfaces // iterating given bytes/string/reader // and yielding parsed elements one by one. // This set of interfaces reads input as required and gives // better performance. package jsoniter
8,962
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/README.md
[![Sourcegraph](https://sourcegraph.com/github.com/json-iterator/go/-/badge.svg)](https://sourcegraph.com/github.com/json-iterator/go?badge) [![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](https://pkg.go.dev/github.com/json-iterator/go) [![Build Status](https://travis-ci.org/json-iterator/go.svg?branch=master)](https://travis-ci.org/json-iterator/go) [![codecov](https://codecov.io/gh/json-iterator/go/branch/master/graph/badge.svg)](https://codecov.io/gh/json-iterator/go) [![rcard](https://goreportcard.com/badge/github.com/json-iterator/go)](https://goreportcard.com/report/github.com/json-iterator/go) [![License](http://img.shields.io/badge/license-mit-blue.svg?style=flat-square)](https://raw.githubusercontent.com/json-iterator/go/master/LICENSE) [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/json-iterator/Lobby) A high-performance 100% compatible drop-in replacement of "encoding/json" You can also use thrift like JSON using [thrift-iterator](https://github.com/thrift-iterator/go) # Benchmark ![benchmark](http://jsoniter.com/benchmarks/go-benchmark.png) Source code: https://github.com/json-iterator/go-benchmark/blob/master/src/github.com/json-iterator/go-benchmark/benchmark_medium_payload_test.go Raw Result (easyjson requires static code generation) | | ns/op | allocation bytes | allocation times | | --------------- | ----------- | ---------------- | ---------------- | | std decode | 35510 ns/op | 1960 B/op | 99 allocs/op | | easyjson decode | 8499 ns/op | 160 B/op | 4 allocs/op | | jsoniter decode | 5623 ns/op | 160 B/op | 3 allocs/op | | std encode | 2213 ns/op | 712 B/op | 5 allocs/op | | easyjson encode | 883 ns/op | 576 B/op | 3 allocs/op | | jsoniter encode | 837 ns/op | 384 B/op | 4 allocs/op | Always benchmark with your own workload. The result depends heavily on the data input. # Usage 100% compatibility with standard lib Replace ```go import "encoding/json" json.Marshal(&data) ``` with ```go import jsoniter "github.com/json-iterator/go" var json = jsoniter.ConfigCompatibleWithStandardLibrary json.Marshal(&data) ``` Replace ```go import "encoding/json" json.Unmarshal(input, &data) ``` with ```go import jsoniter "github.com/json-iterator/go" var json = jsoniter.ConfigCompatibleWithStandardLibrary json.Unmarshal(input, &data) ``` [More documentation](http://jsoniter.com/migrate-from-go-std.html) # How to get ``` go get github.com/json-iterator/go ``` # Contribution Welcomed ! Contributors - [thockin](https://github.com/thockin) - [mattn](https://github.com/mattn) - [cch123](https://github.com/cch123) - [Oleg Shaldybin](https://github.com/olegshaldybin) - [Jason Toffaletti](https://github.com/toffaletti) Report issue or pull request, or email [email protected], or [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/json-iterator/Lobby)
8,963
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/reflect_struct_encoder.go
package jsoniter import ( "fmt" "github.com/modern-go/reflect2" "io" "reflect" "unsafe" ) func encoderOfStruct(ctx *ctx, typ reflect2.Type) ValEncoder { type bindingTo struct { binding *Binding toName string ignored bool } orderedBindings := []*bindingTo{} structDescriptor := describeStruct(ctx, typ) for _, binding := range structDescriptor.Fields { for _, toName := range binding.ToNames { new := &bindingTo{ binding: binding, toName: toName, } for _, old := range orderedBindings { if old.toName != toName { continue } old.ignored, new.ignored = resolveConflictBinding(ctx.frozenConfig, old.binding, new.binding) } orderedBindings = append(orderedBindings, new) } } if len(orderedBindings) == 0 { return &emptyStructEncoder{} } finalOrderedFields := []structFieldTo{} for _, bindingTo := range orderedBindings { if !bindingTo.ignored { finalOrderedFields = append(finalOrderedFields, structFieldTo{ encoder: bindingTo.binding.Encoder.(*structFieldEncoder), toName: bindingTo.toName, }) } } return &structEncoder{typ, finalOrderedFields} } func createCheckIsEmpty(ctx *ctx, typ reflect2.Type) checkIsEmpty { encoder := createEncoderOfNative(ctx, typ) if encoder != nil { return encoder } kind := typ.Kind() switch kind { case reflect.Interface: return &dynamicEncoder{typ} case reflect.Struct: return &structEncoder{typ: typ} case reflect.Array: return &arrayEncoder{} case reflect.Slice: return &sliceEncoder{} case reflect.Map: return encoderOfMap(ctx, typ) case reflect.Ptr: return &OptionalEncoder{} default: return &lazyErrorEncoder{err: fmt.Errorf("unsupported type: %v", typ)} } } func resolveConflictBinding(cfg *frozenConfig, old, new *Binding) (ignoreOld, ignoreNew bool) { newTagged := new.Field.Tag().Get(cfg.getTagKey()) != "" oldTagged := old.Field.Tag().Get(cfg.getTagKey()) != "" if newTagged { if oldTagged { if len(old.levels) > len(new.levels) { return true, false } else if len(new.levels) > len(old.levels) { return false, true } else { return true, true } } else { return true, false } } else { if oldTagged { return true, false } if len(old.levels) > len(new.levels) { return true, false } else if len(new.levels) > len(old.levels) { return false, true } else { return true, true } } } type structFieldEncoder struct { field reflect2.StructField fieldEncoder ValEncoder omitempty bool } func (encoder *structFieldEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { fieldPtr := encoder.field.UnsafeGet(ptr) encoder.fieldEncoder.Encode(fieldPtr, stream) if stream.Error != nil && stream.Error != io.EOF { stream.Error = fmt.Errorf("%s: %s", encoder.field.Name(), stream.Error.Error()) } } func (encoder *structFieldEncoder) IsEmpty(ptr unsafe.Pointer) bool { fieldPtr := encoder.field.UnsafeGet(ptr) return encoder.fieldEncoder.IsEmpty(fieldPtr) } func (encoder *structFieldEncoder) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool { isEmbeddedPtrNil, converted := encoder.fieldEncoder.(IsEmbeddedPtrNil) if !converted { return false } fieldPtr := encoder.field.UnsafeGet(ptr) return isEmbeddedPtrNil.IsEmbeddedPtrNil(fieldPtr) } type IsEmbeddedPtrNil interface { IsEmbeddedPtrNil(ptr unsafe.Pointer) bool } type structEncoder struct { typ reflect2.Type fields []structFieldTo } type structFieldTo struct { encoder *structFieldEncoder toName string } func (encoder *structEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { stream.WriteObjectStart() isNotFirst := false for _, field := range encoder.fields { if field.encoder.omitempty && field.encoder.IsEmpty(ptr) { continue } if field.encoder.IsEmbeddedPtrNil(ptr) { continue } if isNotFirst { stream.WriteMore() } stream.WriteObjectField(field.toName) field.encoder.Encode(ptr, stream) isNotFirst = true } stream.WriteObjectEnd() if stream.Error != nil && stream.Error != io.EOF { stream.Error = fmt.Errorf("%v.%s", encoder.typ, stream.Error.Error()) } } func (encoder *structEncoder) IsEmpty(ptr unsafe.Pointer) bool { return false } type emptyStructEncoder struct { } func (encoder *emptyStructEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { stream.WriteEmptyObject() } func (encoder *emptyStructEncoder) IsEmpty(ptr unsafe.Pointer) bool { return false } type stringModeNumberEncoder struct { elemEncoder ValEncoder } func (encoder *stringModeNumberEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { stream.writeByte('"') encoder.elemEncoder.Encode(ptr, stream) stream.writeByte('"') } func (encoder *stringModeNumberEncoder) IsEmpty(ptr unsafe.Pointer) bool { return encoder.elemEncoder.IsEmpty(ptr) } type stringModeStringEncoder struct { elemEncoder ValEncoder cfg *frozenConfig } func (encoder *stringModeStringEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { tempStream := encoder.cfg.BorrowStream(nil) tempStream.Attachment = stream.Attachment defer encoder.cfg.ReturnStream(tempStream) encoder.elemEncoder.Encode(ptr, tempStream) stream.WriteString(string(tempStream.Buffer())) } func (encoder *stringModeStringEncoder) IsEmpty(ptr unsafe.Pointer) bool { return encoder.elemEncoder.IsEmpty(ptr) }
8,964
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/any_object.go
package jsoniter import ( "reflect" "unsafe" ) type objectLazyAny struct { baseAny cfg *frozenConfig buf []byte err error } func (any *objectLazyAny) ValueType() ValueType { return ObjectValue } func (any *objectLazyAny) MustBeValid() Any { return any } func (any *objectLazyAny) LastError() error { return any.err } func (any *objectLazyAny) ToBool() bool { return true } func (any *objectLazyAny) ToInt() int { return 0 } func (any *objectLazyAny) ToInt32() int32 { return 0 } func (any *objectLazyAny) ToInt64() int64 { return 0 } func (any *objectLazyAny) ToUint() uint { return 0 } func (any *objectLazyAny) ToUint32() uint32 { return 0 } func (any *objectLazyAny) ToUint64() uint64 { return 0 } func (any *objectLazyAny) ToFloat32() float32 { return 0 } func (any *objectLazyAny) ToFloat64() float64 { return 0 } func (any *objectLazyAny) ToString() string { return *(*string)(unsafe.Pointer(&any.buf)) } func (any *objectLazyAny) ToVal(obj interface{}) { iter := any.cfg.BorrowIterator(any.buf) defer any.cfg.ReturnIterator(iter) iter.ReadVal(obj) } func (any *objectLazyAny) Get(path ...interface{}) Any { if len(path) == 0 { return any } switch firstPath := path[0].(type) { case string: iter := any.cfg.BorrowIterator(any.buf) defer any.cfg.ReturnIterator(iter) valueBytes := locateObjectField(iter, firstPath) if valueBytes == nil { return newInvalidAny(path) } iter.ResetBytes(valueBytes) return locatePath(iter, path[1:]) case int32: if '*' == firstPath { mappedAll := map[string]Any{} iter := any.cfg.BorrowIterator(any.buf) defer any.cfg.ReturnIterator(iter) iter.ReadMapCB(func(iter *Iterator, field string) bool { mapped := locatePath(iter, path[1:]) if mapped.ValueType() != InvalidValue { mappedAll[field] = mapped } return true }) return wrapMap(mappedAll) } return newInvalidAny(path) default: return newInvalidAny(path) } } func (any *objectLazyAny) Keys() []string { keys := []string{} iter := any.cfg.BorrowIterator(any.buf) defer any.cfg.ReturnIterator(iter) iter.ReadMapCB(func(iter *Iterator, field string) bool { iter.Skip() keys = append(keys, field) return true }) return keys } func (any *objectLazyAny) Size() int { size := 0 iter := any.cfg.BorrowIterator(any.buf) defer any.cfg.ReturnIterator(iter) iter.ReadObjectCB(func(iter *Iterator, field string) bool { iter.Skip() size++ return true }) return size } func (any *objectLazyAny) WriteTo(stream *Stream) { stream.Write(any.buf) } func (any *objectLazyAny) GetInterface() interface{} { iter := any.cfg.BorrowIterator(any.buf) defer any.cfg.ReturnIterator(iter) return iter.Read() } type objectAny struct { baseAny err error val reflect.Value } func wrapStruct(val interface{}) *objectAny { return &objectAny{baseAny{}, nil, reflect.ValueOf(val)} } func (any *objectAny) ValueType() ValueType { return ObjectValue } func (any *objectAny) MustBeValid() Any { return any } func (any *objectAny) Parse() *Iterator { return nil } func (any *objectAny) LastError() error { return any.err } func (any *objectAny) ToBool() bool { return any.val.NumField() != 0 } func (any *objectAny) ToInt() int { return 0 } func (any *objectAny) ToInt32() int32 { return 0 } func (any *objectAny) ToInt64() int64 { return 0 } func (any *objectAny) ToUint() uint { return 0 } func (any *objectAny) ToUint32() uint32 { return 0 } func (any *objectAny) ToUint64() uint64 { return 0 } func (any *objectAny) ToFloat32() float32 { return 0 } func (any *objectAny) ToFloat64() float64 { return 0 } func (any *objectAny) ToString() string { str, err := MarshalToString(any.val.Interface()) any.err = err return str } func (any *objectAny) Get(path ...interface{}) Any { if len(path) == 0 { return any } switch firstPath := path[0].(type) { case string: field := any.val.FieldByName(firstPath) if !field.IsValid() { return newInvalidAny(path) } return Wrap(field.Interface()) case int32: if '*' == firstPath { mappedAll := map[string]Any{} for i := 0; i < any.val.NumField(); i++ { field := any.val.Field(i) if field.CanInterface() { mapped := Wrap(field.Interface()).Get(path[1:]...) if mapped.ValueType() != InvalidValue { mappedAll[any.val.Type().Field(i).Name] = mapped } } } return wrapMap(mappedAll) } return newInvalidAny(path) default: return newInvalidAny(path) } } func (any *objectAny) Keys() []string { keys := make([]string, 0, any.val.NumField()) for i := 0; i < any.val.NumField(); i++ { keys = append(keys, any.val.Type().Field(i).Name) } return keys } func (any *objectAny) Size() int { return any.val.NumField() } func (any *objectAny) WriteTo(stream *Stream) { stream.WriteVal(any.val) } func (any *objectAny) GetInterface() interface{} { return any.val.Interface() } type mapAny struct { baseAny err error val reflect.Value } func wrapMap(val interface{}) *mapAny { return &mapAny{baseAny{}, nil, reflect.ValueOf(val)} } func (any *mapAny) ValueType() ValueType { return ObjectValue } func (any *mapAny) MustBeValid() Any { return any } func (any *mapAny) Parse() *Iterator { return nil } func (any *mapAny) LastError() error { return any.err } func (any *mapAny) ToBool() bool { return true } func (any *mapAny) ToInt() int { return 0 } func (any *mapAny) ToInt32() int32 { return 0 } func (any *mapAny) ToInt64() int64 { return 0 } func (any *mapAny) ToUint() uint { return 0 } func (any *mapAny) ToUint32() uint32 { return 0 } func (any *mapAny) ToUint64() uint64 { return 0 } func (any *mapAny) ToFloat32() float32 { return 0 } func (any *mapAny) ToFloat64() float64 { return 0 } func (any *mapAny) ToString() string { str, err := MarshalToString(any.val.Interface()) any.err = err return str } func (any *mapAny) Get(path ...interface{}) Any { if len(path) == 0 { return any } switch firstPath := path[0].(type) { case int32: if '*' == firstPath { mappedAll := map[string]Any{} for _, key := range any.val.MapKeys() { keyAsStr := key.String() element := Wrap(any.val.MapIndex(key).Interface()) mapped := element.Get(path[1:]...) if mapped.ValueType() != InvalidValue { mappedAll[keyAsStr] = mapped } } return wrapMap(mappedAll) } return newInvalidAny(path) default: value := any.val.MapIndex(reflect.ValueOf(firstPath)) if !value.IsValid() { return newInvalidAny(path) } return Wrap(value.Interface()) } } func (any *mapAny) Keys() []string { keys := make([]string, 0, any.val.Len()) for _, key := range any.val.MapKeys() { keys = append(keys, key.String()) } return keys } func (any *mapAny) Size() int { return any.val.Len() } func (any *mapAny) WriteTo(stream *Stream) { stream.WriteVal(any.val) } func (any *mapAny) GetInterface() interface{} { return any.val.Interface() }
8,965
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/iter_skip.go
package jsoniter import "fmt" // ReadNil reads a json object as nil and // returns whether it's a nil or not func (iter *Iterator) ReadNil() (ret bool) { c := iter.nextToken() if c == 'n' { iter.skipThreeBytes('u', 'l', 'l') // null return true } iter.unreadByte() return false } // ReadBool reads a json object as BoolValue func (iter *Iterator) ReadBool() (ret bool) { c := iter.nextToken() if c == 't' { iter.skipThreeBytes('r', 'u', 'e') return true } if c == 'f' { iter.skipFourBytes('a', 'l', 's', 'e') return false } iter.ReportError("ReadBool", "expect t or f, but found "+string([]byte{c})) return } // SkipAndReturnBytes skip next JSON element, and return its content as []byte. // The []byte can be kept, it is a copy of data. func (iter *Iterator) SkipAndReturnBytes() []byte { iter.startCapture(iter.head) iter.Skip() return iter.stopCapture() } // SkipAndAppendBytes skips next JSON element and appends its content to // buffer, returning the result. func (iter *Iterator) SkipAndAppendBytes(buf []byte) []byte { iter.startCaptureTo(buf, iter.head) iter.Skip() return iter.stopCapture() } func (iter *Iterator) startCaptureTo(buf []byte, captureStartedAt int) { if iter.captured != nil { panic("already in capture mode") } iter.captureStartedAt = captureStartedAt iter.captured = buf } func (iter *Iterator) startCapture(captureStartedAt int) { iter.startCaptureTo(make([]byte, 0, 32), captureStartedAt) } func (iter *Iterator) stopCapture() []byte { if iter.captured == nil { panic("not in capture mode") } captured := iter.captured remaining := iter.buf[iter.captureStartedAt:iter.head] iter.captureStartedAt = -1 iter.captured = nil return append(captured, remaining...) } // Skip skips a json object and positions to relatively the next json object func (iter *Iterator) Skip() { c := iter.nextToken() switch c { case '"': iter.skipString() case 'n': iter.skipThreeBytes('u', 'l', 'l') // null case 't': iter.skipThreeBytes('r', 'u', 'e') // true case 'f': iter.skipFourBytes('a', 'l', 's', 'e') // false case '0': iter.unreadByte() iter.ReadFloat32() case '-', '1', '2', '3', '4', '5', '6', '7', '8', '9': iter.skipNumber() case '[': iter.skipArray() case '{': iter.skipObject() default: iter.ReportError("Skip", fmt.Sprintf("do not know how to skip: %v", c)) return } } func (iter *Iterator) skipFourBytes(b1, b2, b3, b4 byte) { if iter.readByte() != b1 { iter.ReportError("skipFourBytes", fmt.Sprintf("expect %s", string([]byte{b1, b2, b3, b4}))) return } if iter.readByte() != b2 { iter.ReportError("skipFourBytes", fmt.Sprintf("expect %s", string([]byte{b1, b2, b3, b4}))) return } if iter.readByte() != b3 { iter.ReportError("skipFourBytes", fmt.Sprintf("expect %s", string([]byte{b1, b2, b3, b4}))) return } if iter.readByte() != b4 { iter.ReportError("skipFourBytes", fmt.Sprintf("expect %s", string([]byte{b1, b2, b3, b4}))) return } } func (iter *Iterator) skipThreeBytes(b1, b2, b3 byte) { if iter.readByte() != b1 { iter.ReportError("skipThreeBytes", fmt.Sprintf("expect %s", string([]byte{b1, b2, b3}))) return } if iter.readByte() != b2 { iter.ReportError("skipThreeBytes", fmt.Sprintf("expect %s", string([]byte{b1, b2, b3}))) return } if iter.readByte() != b3 { iter.ReportError("skipThreeBytes", fmt.Sprintf("expect %s", string([]byte{b1, b2, b3}))) return } }
8,966
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/stream_str.go
package jsoniter import ( "unicode/utf8" ) // htmlSafeSet holds the value true if the ASCII character with the given // array position can be safely represented inside a JSON string, embedded // inside of HTML <script> tags, without any additional escaping. // // All values are true except for the ASCII control characters (0-31), the // double quote ("), the backslash character ("\"), HTML opening and closing // tags ("<" and ">"), and the ampersand ("&"). var htmlSafeSet = [utf8.RuneSelf]bool{ ' ': true, '!': true, '"': false, '#': true, '$': true, '%': true, '&': false, '\'': true, '(': true, ')': true, '*': true, '+': true, ',': true, '-': true, '.': true, '/': true, '0': true, '1': true, '2': true, '3': true, '4': true, '5': true, '6': true, '7': true, '8': true, '9': true, ':': true, ';': true, '<': false, '=': true, '>': false, '?': true, '@': true, 'A': true, 'B': true, 'C': true, 'D': true, 'E': true, 'F': true, 'G': true, 'H': true, 'I': true, 'J': true, 'K': true, 'L': true, 'M': true, 'N': true, 'O': true, 'P': true, 'Q': true, 'R': true, 'S': true, 'T': true, 'U': true, 'V': true, 'W': true, 'X': true, 'Y': true, 'Z': true, '[': true, '\\': false, ']': true, '^': true, '_': true, '`': true, 'a': true, 'b': true, 'c': true, 'd': true, 'e': true, 'f': true, 'g': true, 'h': true, 'i': true, 'j': true, 'k': true, 'l': true, 'm': true, 'n': true, 'o': true, 'p': true, 'q': true, 'r': true, 's': true, 't': true, 'u': true, 'v': true, 'w': true, 'x': true, 'y': true, 'z': true, '{': true, '|': true, '}': true, '~': true, '\u007f': true, } // safeSet holds the value true if the ASCII character with the given array // position can be represented inside a JSON string without any further // escaping. // // All values are true except for the ASCII control characters (0-31), the // double quote ("), and the backslash character ("\"). var safeSet = [utf8.RuneSelf]bool{ ' ': true, '!': true, '"': false, '#': true, '$': true, '%': true, '&': true, '\'': true, '(': true, ')': true, '*': true, '+': true, ',': true, '-': true, '.': true, '/': true, '0': true, '1': true, '2': true, '3': true, '4': true, '5': true, '6': true, '7': true, '8': true, '9': true, ':': true, ';': true, '<': true, '=': true, '>': true, '?': true, '@': true, 'A': true, 'B': true, 'C': true, 'D': true, 'E': true, 'F': true, 'G': true, 'H': true, 'I': true, 'J': true, 'K': true, 'L': true, 'M': true, 'N': true, 'O': true, 'P': true, 'Q': true, 'R': true, 'S': true, 'T': true, 'U': true, 'V': true, 'W': true, 'X': true, 'Y': true, 'Z': true, '[': true, '\\': false, ']': true, '^': true, '_': true, '`': true, 'a': true, 'b': true, 'c': true, 'd': true, 'e': true, 'f': true, 'g': true, 'h': true, 'i': true, 'j': true, 'k': true, 'l': true, 'm': true, 'n': true, 'o': true, 'p': true, 'q': true, 'r': true, 's': true, 't': true, 'u': true, 'v': true, 'w': true, 'x': true, 'y': true, 'z': true, '{': true, '|': true, '}': true, '~': true, '\u007f': true, } var hex = "0123456789abcdef" // WriteStringWithHTMLEscaped write string to stream with html special characters escaped func (stream *Stream) WriteStringWithHTMLEscaped(s string) { valLen := len(s) stream.buf = append(stream.buf, '"') // write string, the fast path, without utf8 and escape support i := 0 for ; i < valLen; i++ { c := s[i] if c < utf8.RuneSelf && htmlSafeSet[c] { stream.buf = append(stream.buf, c) } else { break } } if i == valLen { stream.buf = append(stream.buf, '"') return } writeStringSlowPathWithHTMLEscaped(stream, i, s, valLen) } func writeStringSlowPathWithHTMLEscaped(stream *Stream, i int, s string, valLen int) { start := i // for the remaining parts, we process them char by char for i < valLen { if b := s[i]; b < utf8.RuneSelf { if htmlSafeSet[b] { i++ continue } if start < i { stream.WriteRaw(s[start:i]) } switch b { case '\\', '"': stream.writeTwoBytes('\\', b) case '\n': stream.writeTwoBytes('\\', 'n') case '\r': stream.writeTwoBytes('\\', 'r') case '\t': stream.writeTwoBytes('\\', 't') default: // This encodes bytes < 0x20 except for \t, \n and \r. // If escapeHTML is set, it also escapes <, >, and & // because they can lead to security holes when // user-controlled strings are rendered into JSON // and served to some browsers. stream.WriteRaw(`\u00`) stream.writeTwoBytes(hex[b>>4], hex[b&0xF]) } i++ start = i continue } c, size := utf8.DecodeRuneInString(s[i:]) if c == utf8.RuneError && size == 1 { if start < i { stream.WriteRaw(s[start:i]) } stream.WriteRaw(`\ufffd`) i++ start = i continue } // U+2028 is LINE SEPARATOR. // U+2029 is PARAGRAPH SEPARATOR. // They are both technically valid characters in JSON strings, // but don't work in JSONP, which has to be evaluated as JavaScript, // and can lead to security holes there. It is valid JSON to // escape them, so we do so unconditionally. // See http://timelessrepo.com/json-isnt-a-javascript-subset for discussion. if c == '\u2028' || c == '\u2029' { if start < i { stream.WriteRaw(s[start:i]) } stream.WriteRaw(`\u202`) stream.writeByte(hex[c&0xF]) i += size start = i continue } i += size } if start < len(s) { stream.WriteRaw(s[start:]) } stream.writeByte('"') } // WriteString write string to stream without html escape func (stream *Stream) WriteString(s string) { valLen := len(s) stream.buf = append(stream.buf, '"') // write string, the fast path, without utf8 and escape support i := 0 for ; i < valLen; i++ { c := s[i] if c > 31 && c != '"' && c != '\\' { stream.buf = append(stream.buf, c) } else { break } } if i == valLen { stream.buf = append(stream.buf, '"') return } writeStringSlowPath(stream, i, s, valLen) } func writeStringSlowPath(stream *Stream, i int, s string, valLen int) { start := i // for the remaining parts, we process them char by char for i < valLen { if b := s[i]; b < utf8.RuneSelf { if safeSet[b] { i++ continue } if start < i { stream.WriteRaw(s[start:i]) } switch b { case '\\', '"': stream.writeTwoBytes('\\', b) case '\n': stream.writeTwoBytes('\\', 'n') case '\r': stream.writeTwoBytes('\\', 'r') case '\t': stream.writeTwoBytes('\\', 't') default: // This encodes bytes < 0x20 except for \t, \n and \r. // If escapeHTML is set, it also escapes <, >, and & // because they can lead to security holes when // user-controlled strings are rendered into JSON // and served to some browsers. stream.WriteRaw(`\u00`) stream.writeTwoBytes(hex[b>>4], hex[b&0xF]) } i++ start = i continue } i++ continue } if start < len(s) { stream.WriteRaw(s[start:]) } stream.writeByte('"') }
8,967
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/reflect_extension.go
package jsoniter import ( "fmt" "github.com/modern-go/reflect2" "reflect" "sort" "strings" "unicode" "unsafe" ) var typeDecoders = map[string]ValDecoder{} var fieldDecoders = map[string]ValDecoder{} var typeEncoders = map[string]ValEncoder{} var fieldEncoders = map[string]ValEncoder{} var extensions = []Extension{} // StructDescriptor describe how should we encode/decode the struct type StructDescriptor struct { Type reflect2.Type Fields []*Binding } // GetField get one field from the descriptor by its name. // Can not use map here to keep field orders. func (structDescriptor *StructDescriptor) GetField(fieldName string) *Binding { for _, binding := range structDescriptor.Fields { if binding.Field.Name() == fieldName { return binding } } return nil } // Binding describe how should we encode/decode the struct field type Binding struct { levels []int Field reflect2.StructField FromNames []string ToNames []string Encoder ValEncoder Decoder ValDecoder } // Extension the one for all SPI. Customize encoding/decoding by specifying alternate encoder/decoder. // Can also rename fields by UpdateStructDescriptor. type Extension interface { UpdateStructDescriptor(structDescriptor *StructDescriptor) CreateMapKeyDecoder(typ reflect2.Type) ValDecoder CreateMapKeyEncoder(typ reflect2.Type) ValEncoder CreateDecoder(typ reflect2.Type) ValDecoder CreateEncoder(typ reflect2.Type) ValEncoder DecorateDecoder(typ reflect2.Type, decoder ValDecoder) ValDecoder DecorateEncoder(typ reflect2.Type, encoder ValEncoder) ValEncoder } // DummyExtension embed this type get dummy implementation for all methods of Extension type DummyExtension struct { } // UpdateStructDescriptor No-op func (extension *DummyExtension) UpdateStructDescriptor(structDescriptor *StructDescriptor) { } // CreateMapKeyDecoder No-op func (extension *DummyExtension) CreateMapKeyDecoder(typ reflect2.Type) ValDecoder { return nil } // CreateMapKeyEncoder No-op func (extension *DummyExtension) CreateMapKeyEncoder(typ reflect2.Type) ValEncoder { return nil } // CreateDecoder No-op func (extension *DummyExtension) CreateDecoder(typ reflect2.Type) ValDecoder { return nil } // CreateEncoder No-op func (extension *DummyExtension) CreateEncoder(typ reflect2.Type) ValEncoder { return nil } // DecorateDecoder No-op func (extension *DummyExtension) DecorateDecoder(typ reflect2.Type, decoder ValDecoder) ValDecoder { return decoder } // DecorateEncoder No-op func (extension *DummyExtension) DecorateEncoder(typ reflect2.Type, encoder ValEncoder) ValEncoder { return encoder } type EncoderExtension map[reflect2.Type]ValEncoder // UpdateStructDescriptor No-op func (extension EncoderExtension) UpdateStructDescriptor(structDescriptor *StructDescriptor) { } // CreateDecoder No-op func (extension EncoderExtension) CreateDecoder(typ reflect2.Type) ValDecoder { return nil } // CreateEncoder get encoder from map func (extension EncoderExtension) CreateEncoder(typ reflect2.Type) ValEncoder { return extension[typ] } // CreateMapKeyDecoder No-op func (extension EncoderExtension) CreateMapKeyDecoder(typ reflect2.Type) ValDecoder { return nil } // CreateMapKeyEncoder No-op func (extension EncoderExtension) CreateMapKeyEncoder(typ reflect2.Type) ValEncoder { return nil } // DecorateDecoder No-op func (extension EncoderExtension) DecorateDecoder(typ reflect2.Type, decoder ValDecoder) ValDecoder { return decoder } // DecorateEncoder No-op func (extension EncoderExtension) DecorateEncoder(typ reflect2.Type, encoder ValEncoder) ValEncoder { return encoder } type DecoderExtension map[reflect2.Type]ValDecoder // UpdateStructDescriptor No-op func (extension DecoderExtension) UpdateStructDescriptor(structDescriptor *StructDescriptor) { } // CreateMapKeyDecoder No-op func (extension DecoderExtension) CreateMapKeyDecoder(typ reflect2.Type) ValDecoder { return nil } // CreateMapKeyEncoder No-op func (extension DecoderExtension) CreateMapKeyEncoder(typ reflect2.Type) ValEncoder { return nil } // CreateDecoder get decoder from map func (extension DecoderExtension) CreateDecoder(typ reflect2.Type) ValDecoder { return extension[typ] } // CreateEncoder No-op func (extension DecoderExtension) CreateEncoder(typ reflect2.Type) ValEncoder { return nil } // DecorateDecoder No-op func (extension DecoderExtension) DecorateDecoder(typ reflect2.Type, decoder ValDecoder) ValDecoder { return decoder } // DecorateEncoder No-op func (extension DecoderExtension) DecorateEncoder(typ reflect2.Type, encoder ValEncoder) ValEncoder { return encoder } type funcDecoder struct { fun DecoderFunc } func (decoder *funcDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { decoder.fun(ptr, iter) } type funcEncoder struct { fun EncoderFunc isEmptyFunc func(ptr unsafe.Pointer) bool } func (encoder *funcEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { encoder.fun(ptr, stream) } func (encoder *funcEncoder) IsEmpty(ptr unsafe.Pointer) bool { if encoder.isEmptyFunc == nil { return false } return encoder.isEmptyFunc(ptr) } // DecoderFunc the function form of TypeDecoder type DecoderFunc func(ptr unsafe.Pointer, iter *Iterator) // EncoderFunc the function form of TypeEncoder type EncoderFunc func(ptr unsafe.Pointer, stream *Stream) // RegisterTypeDecoderFunc register TypeDecoder for a type with function func RegisterTypeDecoderFunc(typ string, fun DecoderFunc) { typeDecoders[typ] = &funcDecoder{fun} } // RegisterTypeDecoder register TypeDecoder for a typ func RegisterTypeDecoder(typ string, decoder ValDecoder) { typeDecoders[typ] = decoder } // RegisterFieldDecoderFunc register TypeDecoder for a struct field with function func RegisterFieldDecoderFunc(typ string, field string, fun DecoderFunc) { RegisterFieldDecoder(typ, field, &funcDecoder{fun}) } // RegisterFieldDecoder register TypeDecoder for a struct field func RegisterFieldDecoder(typ string, field string, decoder ValDecoder) { fieldDecoders[fmt.Sprintf("%s/%s", typ, field)] = decoder } // RegisterTypeEncoderFunc register TypeEncoder for a type with encode/isEmpty function func RegisterTypeEncoderFunc(typ string, fun EncoderFunc, isEmptyFunc func(unsafe.Pointer) bool) { typeEncoders[typ] = &funcEncoder{fun, isEmptyFunc} } // RegisterTypeEncoder register TypeEncoder for a type func RegisterTypeEncoder(typ string, encoder ValEncoder) { typeEncoders[typ] = encoder } // RegisterFieldEncoderFunc register TypeEncoder for a struct field with encode/isEmpty function func RegisterFieldEncoderFunc(typ string, field string, fun EncoderFunc, isEmptyFunc func(unsafe.Pointer) bool) { RegisterFieldEncoder(typ, field, &funcEncoder{fun, isEmptyFunc}) } // RegisterFieldEncoder register TypeEncoder for a struct field func RegisterFieldEncoder(typ string, field string, encoder ValEncoder) { fieldEncoders[fmt.Sprintf("%s/%s", typ, field)] = encoder } // RegisterExtension register extension func RegisterExtension(extension Extension) { extensions = append(extensions, extension) } func getTypeDecoderFromExtension(ctx *ctx, typ reflect2.Type) ValDecoder { decoder := _getTypeDecoderFromExtension(ctx, typ) if decoder != nil { for _, extension := range extensions { decoder = extension.DecorateDecoder(typ, decoder) } decoder = ctx.decoderExtension.DecorateDecoder(typ, decoder) for _, extension := range ctx.extraExtensions { decoder = extension.DecorateDecoder(typ, decoder) } } return decoder } func _getTypeDecoderFromExtension(ctx *ctx, typ reflect2.Type) ValDecoder { for _, extension := range extensions { decoder := extension.CreateDecoder(typ) if decoder != nil { return decoder } } decoder := ctx.decoderExtension.CreateDecoder(typ) if decoder != nil { return decoder } for _, extension := range ctx.extraExtensions { decoder := extension.CreateDecoder(typ) if decoder != nil { return decoder } } typeName := typ.String() decoder = typeDecoders[typeName] if decoder != nil { return decoder } if typ.Kind() == reflect.Ptr { ptrType := typ.(*reflect2.UnsafePtrType) decoder := typeDecoders[ptrType.Elem().String()] if decoder != nil { return &OptionalDecoder{ptrType.Elem(), decoder} } } return nil } func getTypeEncoderFromExtension(ctx *ctx, typ reflect2.Type) ValEncoder { encoder := _getTypeEncoderFromExtension(ctx, typ) if encoder != nil { for _, extension := range extensions { encoder = extension.DecorateEncoder(typ, encoder) } encoder = ctx.encoderExtension.DecorateEncoder(typ, encoder) for _, extension := range ctx.extraExtensions { encoder = extension.DecorateEncoder(typ, encoder) } } return encoder } func _getTypeEncoderFromExtension(ctx *ctx, typ reflect2.Type) ValEncoder { for _, extension := range extensions { encoder := extension.CreateEncoder(typ) if encoder != nil { return encoder } } encoder := ctx.encoderExtension.CreateEncoder(typ) if encoder != nil { return encoder } for _, extension := range ctx.extraExtensions { encoder := extension.CreateEncoder(typ) if encoder != nil { return encoder } } typeName := typ.String() encoder = typeEncoders[typeName] if encoder != nil { return encoder } if typ.Kind() == reflect.Ptr { typePtr := typ.(*reflect2.UnsafePtrType) encoder := typeEncoders[typePtr.Elem().String()] if encoder != nil { return &OptionalEncoder{encoder} } } return nil } func describeStruct(ctx *ctx, typ reflect2.Type) *StructDescriptor { structType := typ.(*reflect2.UnsafeStructType) embeddedBindings := []*Binding{} bindings := []*Binding{} for i := 0; i < structType.NumField(); i++ { field := structType.Field(i) tag, hastag := field.Tag().Lookup(ctx.getTagKey()) if ctx.onlyTaggedField && !hastag && !field.Anonymous() { continue } if tag == "-" || field.Name() == "_" { continue } tagParts := strings.Split(tag, ",") if field.Anonymous() && (tag == "" || tagParts[0] == "") { if field.Type().Kind() == reflect.Struct { structDescriptor := describeStruct(ctx, field.Type()) for _, binding := range structDescriptor.Fields { binding.levels = append([]int{i}, binding.levels...) omitempty := binding.Encoder.(*structFieldEncoder).omitempty binding.Encoder = &structFieldEncoder{field, binding.Encoder, omitempty} binding.Decoder = &structFieldDecoder{field, binding.Decoder} embeddedBindings = append(embeddedBindings, binding) } continue } else if field.Type().Kind() == reflect.Ptr { ptrType := field.Type().(*reflect2.UnsafePtrType) if ptrType.Elem().Kind() == reflect.Struct { structDescriptor := describeStruct(ctx, ptrType.Elem()) for _, binding := range structDescriptor.Fields { binding.levels = append([]int{i}, binding.levels...) omitempty := binding.Encoder.(*structFieldEncoder).omitempty binding.Encoder = &dereferenceEncoder{binding.Encoder} binding.Encoder = &structFieldEncoder{field, binding.Encoder, omitempty} binding.Decoder = &dereferenceDecoder{ptrType.Elem(), binding.Decoder} binding.Decoder = &structFieldDecoder{field, binding.Decoder} embeddedBindings = append(embeddedBindings, binding) } continue } } } fieldNames := calcFieldNames(field.Name(), tagParts[0], tag) fieldCacheKey := fmt.Sprintf("%s/%s", typ.String(), field.Name()) decoder := fieldDecoders[fieldCacheKey] if decoder == nil { decoder = decoderOfType(ctx.append(field.Name()), field.Type()) } encoder := fieldEncoders[fieldCacheKey] if encoder == nil { encoder = encoderOfType(ctx.append(field.Name()), field.Type()) } binding := &Binding{ Field: field, FromNames: fieldNames, ToNames: fieldNames, Decoder: decoder, Encoder: encoder, } binding.levels = []int{i} bindings = append(bindings, binding) } return createStructDescriptor(ctx, typ, bindings, embeddedBindings) } func createStructDescriptor(ctx *ctx, typ reflect2.Type, bindings []*Binding, embeddedBindings []*Binding) *StructDescriptor { structDescriptor := &StructDescriptor{ Type: typ, Fields: bindings, } for _, extension := range extensions { extension.UpdateStructDescriptor(structDescriptor) } ctx.encoderExtension.UpdateStructDescriptor(structDescriptor) ctx.decoderExtension.UpdateStructDescriptor(structDescriptor) for _, extension := range ctx.extraExtensions { extension.UpdateStructDescriptor(structDescriptor) } processTags(structDescriptor, ctx.frozenConfig) // merge normal & embedded bindings & sort with original order allBindings := sortableBindings(append(embeddedBindings, structDescriptor.Fields...)) sort.Sort(allBindings) structDescriptor.Fields = allBindings return structDescriptor } type sortableBindings []*Binding func (bindings sortableBindings) Len() int { return len(bindings) } func (bindings sortableBindings) Less(i, j int) bool { left := bindings[i].levels right := bindings[j].levels k := 0 for { if left[k] < right[k] { return true } else if left[k] > right[k] { return false } k++ } } func (bindings sortableBindings) Swap(i, j int) { bindings[i], bindings[j] = bindings[j], bindings[i] } func processTags(structDescriptor *StructDescriptor, cfg *frozenConfig) { for _, binding := range structDescriptor.Fields { shouldOmitEmpty := false tagParts := strings.Split(binding.Field.Tag().Get(cfg.getTagKey()), ",") for _, tagPart := range tagParts[1:] { if tagPart == "omitempty" { shouldOmitEmpty = true } else if tagPart == "string" { if binding.Field.Type().Kind() == reflect.String { binding.Decoder = &stringModeStringDecoder{binding.Decoder, cfg} binding.Encoder = &stringModeStringEncoder{binding.Encoder, cfg} } else { binding.Decoder = &stringModeNumberDecoder{binding.Decoder} binding.Encoder = &stringModeNumberEncoder{binding.Encoder} } } } binding.Decoder = &structFieldDecoder{binding.Field, binding.Decoder} binding.Encoder = &structFieldEncoder{binding.Field, binding.Encoder, shouldOmitEmpty} } } func calcFieldNames(originalFieldName string, tagProvidedFieldName string, wholeTag string) []string { // ignore? if wholeTag == "-" { return []string{} } // rename? var fieldNames []string if tagProvidedFieldName == "" { fieldNames = []string{originalFieldName} } else { fieldNames = []string{tagProvidedFieldName} } // private? isNotExported := unicode.IsLower(rune(originalFieldName[0])) || originalFieldName[0] == '_' if isNotExported { fieldNames = []string{} } return fieldNames }
8,968
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/any_float.go
package jsoniter import ( "strconv" ) type floatAny struct { baseAny val float64 } func (any *floatAny) Parse() *Iterator { return nil } func (any *floatAny) ValueType() ValueType { return NumberValue } func (any *floatAny) MustBeValid() Any { return any } func (any *floatAny) LastError() error { return nil } func (any *floatAny) ToBool() bool { return any.ToFloat64() != 0 } func (any *floatAny) ToInt() int { return int(any.val) } func (any *floatAny) ToInt32() int32 { return int32(any.val) } func (any *floatAny) ToInt64() int64 { return int64(any.val) } func (any *floatAny) ToUint() uint { if any.val > 0 { return uint(any.val) } return 0 } func (any *floatAny) ToUint32() uint32 { if any.val > 0 { return uint32(any.val) } return 0 } func (any *floatAny) ToUint64() uint64 { if any.val > 0 { return uint64(any.val) } return 0 } func (any *floatAny) ToFloat32() float32 { return float32(any.val) } func (any *floatAny) ToFloat64() float64 { return any.val } func (any *floatAny) ToString() string { return strconv.FormatFloat(any.val, 'E', -1, 64) } func (any *floatAny) WriteTo(stream *Stream) { stream.WriteFloat64(any.val) } func (any *floatAny) GetInterface() interface{} { return any.val }
8,969
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/any_invalid.go
package jsoniter import "fmt" type invalidAny struct { baseAny err error } func newInvalidAny(path []interface{}) *invalidAny { return &invalidAny{baseAny{}, fmt.Errorf("%v not found", path)} } func (any *invalidAny) LastError() error { return any.err } func (any *invalidAny) ValueType() ValueType { return InvalidValue } func (any *invalidAny) MustBeValid() Any { panic(any.err) } func (any *invalidAny) ToBool() bool { return false } func (any *invalidAny) ToInt() int { return 0 } func (any *invalidAny) ToInt32() int32 { return 0 } func (any *invalidAny) ToInt64() int64 { return 0 } func (any *invalidAny) ToUint() uint { return 0 } func (any *invalidAny) ToUint32() uint32 { return 0 } func (any *invalidAny) ToUint64() uint64 { return 0 } func (any *invalidAny) ToFloat32() float32 { return 0 } func (any *invalidAny) ToFloat64() float64 { return 0 } func (any *invalidAny) ToString() string { return "" } func (any *invalidAny) WriteTo(stream *Stream) { } func (any *invalidAny) Get(path ...interface{}) Any { if any.err == nil { return &invalidAny{baseAny{}, fmt.Errorf("get %v from invalid", path)} } return &invalidAny{baseAny{}, fmt.Errorf("%v, get %v from invalid", any.err, path)} } func (any *invalidAny) Parse() *Iterator { return nil } func (any *invalidAny) GetInterface() interface{} { return nil }
8,970
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/iter_object.go
package jsoniter import ( "fmt" "strings" ) // ReadObject read one field from object. // If object ended, returns empty string. // Otherwise, returns the field name. func (iter *Iterator) ReadObject() (ret string) { c := iter.nextToken() switch c { case 'n': iter.skipThreeBytes('u', 'l', 'l') return "" // null case '{': c = iter.nextToken() if c == '"' { iter.unreadByte() field := iter.ReadString() c = iter.nextToken() if c != ':' { iter.ReportError("ReadObject", "expect : after object field, but found "+string([]byte{c})) } return field } if c == '}' { return "" // end of object } iter.ReportError("ReadObject", `expect " after {, but found `+string([]byte{c})) return case ',': field := iter.ReadString() c = iter.nextToken() if c != ':' { iter.ReportError("ReadObject", "expect : after object field, but found "+string([]byte{c})) } return field case '}': return "" // end of object default: iter.ReportError("ReadObject", fmt.Sprintf(`expect { or , or } or n, but found %s`, string([]byte{c}))) return } } // CaseInsensitive func (iter *Iterator) readFieldHash() int64 { hash := int64(0x811c9dc5) c := iter.nextToken() if c != '"' { iter.ReportError("readFieldHash", `expect ", but found `+string([]byte{c})) return 0 } for { for i := iter.head; i < iter.tail; i++ { // require ascii string and no escape b := iter.buf[i] if b == '\\' { iter.head = i for _, b := range iter.readStringSlowPath() { if 'A' <= b && b <= 'Z' && !iter.cfg.caseSensitive { b += 'a' - 'A' } hash ^= int64(b) hash *= 0x1000193 } c = iter.nextToken() if c != ':' { iter.ReportError("readFieldHash", `expect :, but found `+string([]byte{c})) return 0 } return hash } if b == '"' { iter.head = i + 1 c = iter.nextToken() if c != ':' { iter.ReportError("readFieldHash", `expect :, but found `+string([]byte{c})) return 0 } return hash } if 'A' <= b && b <= 'Z' && !iter.cfg.caseSensitive { b += 'a' - 'A' } hash ^= int64(b) hash *= 0x1000193 } if !iter.loadMore() { iter.ReportError("readFieldHash", `incomplete field name`) return 0 } } } func calcHash(str string, caseSensitive bool) int64 { if !caseSensitive { str = strings.ToLower(str) } hash := int64(0x811c9dc5) for _, b := range []byte(str) { hash ^= int64(b) hash *= 0x1000193 } return int64(hash) } // ReadObjectCB read object with callback, the key is ascii only and field name not copied func (iter *Iterator) ReadObjectCB(callback func(*Iterator, string) bool) bool { c := iter.nextToken() var field string if c == '{' { if !iter.incrementDepth() { return false } c = iter.nextToken() if c == '"' { iter.unreadByte() field = iter.ReadString() c = iter.nextToken() if c != ':' { iter.ReportError("ReadObject", "expect : after object field, but found "+string([]byte{c})) } if !callback(iter, field) { iter.decrementDepth() return false } c = iter.nextToken() for c == ',' { field = iter.ReadString() c = iter.nextToken() if c != ':' { iter.ReportError("ReadObject", "expect : after object field, but found "+string([]byte{c})) } if !callback(iter, field) { iter.decrementDepth() return false } c = iter.nextToken() } if c != '}' { iter.ReportError("ReadObjectCB", `object not ended with }`) iter.decrementDepth() return false } return iter.decrementDepth() } if c == '}' { return iter.decrementDepth() } iter.ReportError("ReadObjectCB", `expect " after {, but found `+string([]byte{c})) iter.decrementDepth() return false } if c == 'n' { iter.skipThreeBytes('u', 'l', 'l') return true // null } iter.ReportError("ReadObjectCB", `expect { or n, but found `+string([]byte{c})) return false } // ReadMapCB read map with callback, the key can be any string func (iter *Iterator) ReadMapCB(callback func(*Iterator, string) bool) bool { c := iter.nextToken() if c == '{' { if !iter.incrementDepth() { return false } c = iter.nextToken() if c == '"' { iter.unreadByte() field := iter.ReadString() if iter.nextToken() != ':' { iter.ReportError("ReadMapCB", "expect : after object field, but found "+string([]byte{c})) iter.decrementDepth() return false } if !callback(iter, field) { iter.decrementDepth() return false } c = iter.nextToken() for c == ',' { field = iter.ReadString() if iter.nextToken() != ':' { iter.ReportError("ReadMapCB", "expect : after object field, but found "+string([]byte{c})) iter.decrementDepth() return false } if !callback(iter, field) { iter.decrementDepth() return false } c = iter.nextToken() } if c != '}' { iter.ReportError("ReadMapCB", `object not ended with }`) iter.decrementDepth() return false } return iter.decrementDepth() } if c == '}' { return iter.decrementDepth() } iter.ReportError("ReadMapCB", `expect " after {, but found `+string([]byte{c})) iter.decrementDepth() return false } if c == 'n' { iter.skipThreeBytes('u', 'l', 'l') return true // null } iter.ReportError("ReadMapCB", `expect { or n, but found `+string([]byte{c})) return false } func (iter *Iterator) readObjectStart() bool { c := iter.nextToken() if c == '{' { c = iter.nextToken() if c == '}' { return false } iter.unreadByte() return true } else if c == 'n' { iter.skipThreeBytes('u', 'l', 'l') return false } iter.ReportError("readObjectStart", "expect { or n, but found "+string([]byte{c})) return false } func (iter *Iterator) readObjectFieldAsBytes() (ret []byte) { str := iter.ReadStringAsSlice() if iter.skipWhitespacesWithoutLoadMore() { if ret == nil { ret = make([]byte, len(str)) copy(ret, str) } if !iter.loadMore() { return } } if iter.buf[iter.head] != ':' { iter.ReportError("readObjectFieldAsBytes", "expect : after object field, but found "+string([]byte{iter.buf[iter.head]})) return } iter.head++ if iter.skipWhitespacesWithoutLoadMore() { if ret == nil { ret = make([]byte, len(str)) copy(ret, str) } if !iter.loadMore() { return } } if ret == nil { return str } return ret }
8,971
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/reflect.go
package jsoniter import ( "fmt" "reflect" "unsafe" "github.com/modern-go/reflect2" ) // ValDecoder is an internal type registered to cache as needed. // Don't confuse jsoniter.ValDecoder with json.Decoder. // For json.Decoder's adapter, refer to jsoniter.AdapterDecoder(todo link). // // Reflection on type to create decoders, which is then cached // Reflection on value is avoided as we can, as the reflect.Value itself will allocate, with following exceptions // 1. create instance of new value, for example *int will need a int to be allocated // 2. append to slice, if the existing cap is not enough, allocate will be done using Reflect.New // 3. assignment to map, both key and value will be reflect.Value // For a simple struct binding, it will be reflect.Value free and allocation free type ValDecoder interface { Decode(ptr unsafe.Pointer, iter *Iterator) } // ValEncoder is an internal type registered to cache as needed. // Don't confuse jsoniter.ValEncoder with json.Encoder. // For json.Encoder's adapter, refer to jsoniter.AdapterEncoder(todo godoc link). type ValEncoder interface { IsEmpty(ptr unsafe.Pointer) bool Encode(ptr unsafe.Pointer, stream *Stream) } type checkIsEmpty interface { IsEmpty(ptr unsafe.Pointer) bool } type ctx struct { *frozenConfig prefix string encoders map[reflect2.Type]ValEncoder decoders map[reflect2.Type]ValDecoder } func (b *ctx) caseSensitive() bool { if b.frozenConfig == nil { // default is case-insensitive return false } return b.frozenConfig.caseSensitive } func (b *ctx) append(prefix string) *ctx { return &ctx{ frozenConfig: b.frozenConfig, prefix: b.prefix + " " + prefix, encoders: b.encoders, decoders: b.decoders, } } // ReadVal copy the underlying JSON into go interface, same as json.Unmarshal func (iter *Iterator) ReadVal(obj interface{}) { depth := iter.depth cacheKey := reflect2.RTypeOf(obj) decoder := iter.cfg.getDecoderFromCache(cacheKey) if decoder == nil { typ := reflect2.TypeOf(obj) if typ.Kind() != reflect.Ptr { iter.ReportError("ReadVal", "can only unmarshal into pointer") return } decoder = iter.cfg.DecoderOf(typ) } ptr := reflect2.PtrOf(obj) if ptr == nil { iter.ReportError("ReadVal", "can not read into nil pointer") return } decoder.Decode(ptr, iter) if iter.depth != depth { iter.ReportError("ReadVal", "unexpected mismatched nesting") return } } // WriteVal copy the go interface into underlying JSON, same as json.Marshal func (stream *Stream) WriteVal(val interface{}) { if nil == val { stream.WriteNil() return } cacheKey := reflect2.RTypeOf(val) encoder := stream.cfg.getEncoderFromCache(cacheKey) if encoder == nil { typ := reflect2.TypeOf(val) encoder = stream.cfg.EncoderOf(typ) } encoder.Encode(reflect2.PtrOf(val), stream) } func (cfg *frozenConfig) DecoderOf(typ reflect2.Type) ValDecoder { cacheKey := typ.RType() decoder := cfg.getDecoderFromCache(cacheKey) if decoder != nil { return decoder } ctx := &ctx{ frozenConfig: cfg, prefix: "", decoders: map[reflect2.Type]ValDecoder{}, encoders: map[reflect2.Type]ValEncoder{}, } ptrType := typ.(*reflect2.UnsafePtrType) decoder = decoderOfType(ctx, ptrType.Elem()) cfg.addDecoderToCache(cacheKey, decoder) return decoder } func decoderOfType(ctx *ctx, typ reflect2.Type) ValDecoder { decoder := getTypeDecoderFromExtension(ctx, typ) if decoder != nil { return decoder } decoder = createDecoderOfType(ctx, typ) for _, extension := range extensions { decoder = extension.DecorateDecoder(typ, decoder) } decoder = ctx.decoderExtension.DecorateDecoder(typ, decoder) for _, extension := range ctx.extraExtensions { decoder = extension.DecorateDecoder(typ, decoder) } return decoder } func createDecoderOfType(ctx *ctx, typ reflect2.Type) ValDecoder { decoder := ctx.decoders[typ] if decoder != nil { return decoder } placeholder := &placeholderDecoder{} ctx.decoders[typ] = placeholder decoder = _createDecoderOfType(ctx, typ) placeholder.decoder = decoder return decoder } func _createDecoderOfType(ctx *ctx, typ reflect2.Type) ValDecoder { decoder := createDecoderOfJsonRawMessage(ctx, typ) if decoder != nil { return decoder } decoder = createDecoderOfJsonNumber(ctx, typ) if decoder != nil { return decoder } decoder = createDecoderOfMarshaler(ctx, typ) if decoder != nil { return decoder } decoder = createDecoderOfAny(ctx, typ) if decoder != nil { return decoder } decoder = createDecoderOfNative(ctx, typ) if decoder != nil { return decoder } switch typ.Kind() { case reflect.Interface: ifaceType, isIFace := typ.(*reflect2.UnsafeIFaceType) if isIFace { return &ifaceDecoder{valType: ifaceType} } return &efaceDecoder{} case reflect.Struct: return decoderOfStruct(ctx, typ) case reflect.Array: return decoderOfArray(ctx, typ) case reflect.Slice: return decoderOfSlice(ctx, typ) case reflect.Map: return decoderOfMap(ctx, typ) case reflect.Ptr: return decoderOfOptional(ctx, typ) default: return &lazyErrorDecoder{err: fmt.Errorf("%s%s is unsupported type", ctx.prefix, typ.String())} } } func (cfg *frozenConfig) EncoderOf(typ reflect2.Type) ValEncoder { cacheKey := typ.RType() encoder := cfg.getEncoderFromCache(cacheKey) if encoder != nil { return encoder } ctx := &ctx{ frozenConfig: cfg, prefix: "", decoders: map[reflect2.Type]ValDecoder{}, encoders: map[reflect2.Type]ValEncoder{}, } encoder = encoderOfType(ctx, typ) if typ.LikePtr() { encoder = &onePtrEncoder{encoder} } cfg.addEncoderToCache(cacheKey, encoder) return encoder } type onePtrEncoder struct { encoder ValEncoder } func (encoder *onePtrEncoder) IsEmpty(ptr unsafe.Pointer) bool { return encoder.encoder.IsEmpty(unsafe.Pointer(&ptr)) } func (encoder *onePtrEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { encoder.encoder.Encode(unsafe.Pointer(&ptr), stream) } func encoderOfType(ctx *ctx, typ reflect2.Type) ValEncoder { encoder := getTypeEncoderFromExtension(ctx, typ) if encoder != nil { return encoder } encoder = createEncoderOfType(ctx, typ) for _, extension := range extensions { encoder = extension.DecorateEncoder(typ, encoder) } encoder = ctx.encoderExtension.DecorateEncoder(typ, encoder) for _, extension := range ctx.extraExtensions { encoder = extension.DecorateEncoder(typ, encoder) } return encoder } func createEncoderOfType(ctx *ctx, typ reflect2.Type) ValEncoder { encoder := ctx.encoders[typ] if encoder != nil { return encoder } placeholder := &placeholderEncoder{} ctx.encoders[typ] = placeholder encoder = _createEncoderOfType(ctx, typ) placeholder.encoder = encoder return encoder } func _createEncoderOfType(ctx *ctx, typ reflect2.Type) ValEncoder { encoder := createEncoderOfJsonRawMessage(ctx, typ) if encoder != nil { return encoder } encoder = createEncoderOfJsonNumber(ctx, typ) if encoder != nil { return encoder } encoder = createEncoderOfMarshaler(ctx, typ) if encoder != nil { return encoder } encoder = createEncoderOfAny(ctx, typ) if encoder != nil { return encoder } encoder = createEncoderOfNative(ctx, typ) if encoder != nil { return encoder } kind := typ.Kind() switch kind { case reflect.Interface: return &dynamicEncoder{typ} case reflect.Struct: return encoderOfStruct(ctx, typ) case reflect.Array: return encoderOfArray(ctx, typ) case reflect.Slice: return encoderOfSlice(ctx, typ) case reflect.Map: return encoderOfMap(ctx, typ) case reflect.Ptr: return encoderOfOptional(ctx, typ) default: return &lazyErrorEncoder{err: fmt.Errorf("%s%s is unsupported type", ctx.prefix, typ.String())} } } type lazyErrorDecoder struct { err error } func (decoder *lazyErrorDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { if iter.WhatIsNext() != NilValue { if iter.Error == nil { iter.Error = decoder.err } } else { iter.Skip() } } type lazyErrorEncoder struct { err error } func (encoder *lazyErrorEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { if ptr == nil { stream.WriteNil() } else if stream.Error == nil { stream.Error = encoder.err } } func (encoder *lazyErrorEncoder) IsEmpty(ptr unsafe.Pointer) bool { return false } type placeholderDecoder struct { decoder ValDecoder } func (decoder *placeholderDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { decoder.decoder.Decode(ptr, iter) } type placeholderEncoder struct { encoder ValEncoder } func (encoder *placeholderEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { encoder.encoder.Encode(ptr, stream) } func (encoder *placeholderEncoder) IsEmpty(ptr unsafe.Pointer) bool { return encoder.encoder.IsEmpty(ptr) }
8,972
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/reflect_map.go
package jsoniter import ( "fmt" "github.com/modern-go/reflect2" "io" "reflect" "sort" "unsafe" ) func decoderOfMap(ctx *ctx, typ reflect2.Type) ValDecoder { mapType := typ.(*reflect2.UnsafeMapType) keyDecoder := decoderOfMapKey(ctx.append("[mapKey]"), mapType.Key()) elemDecoder := decoderOfType(ctx.append("[mapElem]"), mapType.Elem()) return &mapDecoder{ mapType: mapType, keyType: mapType.Key(), elemType: mapType.Elem(), keyDecoder: keyDecoder, elemDecoder: elemDecoder, } } func encoderOfMap(ctx *ctx, typ reflect2.Type) ValEncoder { mapType := typ.(*reflect2.UnsafeMapType) if ctx.sortMapKeys { return &sortKeysMapEncoder{ mapType: mapType, keyEncoder: encoderOfMapKey(ctx.append("[mapKey]"), mapType.Key()), elemEncoder: encoderOfType(ctx.append("[mapElem]"), mapType.Elem()), } } return &mapEncoder{ mapType: mapType, keyEncoder: encoderOfMapKey(ctx.append("[mapKey]"), mapType.Key()), elemEncoder: encoderOfType(ctx.append("[mapElem]"), mapType.Elem()), } } func decoderOfMapKey(ctx *ctx, typ reflect2.Type) ValDecoder { decoder := ctx.decoderExtension.CreateMapKeyDecoder(typ) if decoder != nil { return decoder } for _, extension := range ctx.extraExtensions { decoder := extension.CreateMapKeyDecoder(typ) if decoder != nil { return decoder } } ptrType := reflect2.PtrTo(typ) if ptrType.Implements(unmarshalerType) { return &referenceDecoder{ &unmarshalerDecoder{ valType: ptrType, }, } } if typ.Implements(unmarshalerType) { return &unmarshalerDecoder{ valType: typ, } } if ptrType.Implements(textUnmarshalerType) { return &referenceDecoder{ &textUnmarshalerDecoder{ valType: ptrType, }, } } if typ.Implements(textUnmarshalerType) { return &textUnmarshalerDecoder{ valType: typ, } } switch typ.Kind() { case reflect.String: return decoderOfType(ctx, reflect2.DefaultTypeOfKind(reflect.String)) case reflect.Bool, reflect.Uint8, reflect.Int8, reflect.Uint16, reflect.Int16, reflect.Uint32, reflect.Int32, reflect.Uint64, reflect.Int64, reflect.Uint, reflect.Int, reflect.Float32, reflect.Float64, reflect.Uintptr: typ = reflect2.DefaultTypeOfKind(typ.Kind()) return &numericMapKeyDecoder{decoderOfType(ctx, typ)} default: return &lazyErrorDecoder{err: fmt.Errorf("unsupported map key type: %v", typ)} } } func encoderOfMapKey(ctx *ctx, typ reflect2.Type) ValEncoder { encoder := ctx.encoderExtension.CreateMapKeyEncoder(typ) if encoder != nil { return encoder } for _, extension := range ctx.extraExtensions { encoder := extension.CreateMapKeyEncoder(typ) if encoder != nil { return encoder } } if typ == textMarshalerType { return &directTextMarshalerEncoder{ stringEncoder: ctx.EncoderOf(reflect2.TypeOf("")), } } if typ.Implements(textMarshalerType) { return &textMarshalerEncoder{ valType: typ, stringEncoder: ctx.EncoderOf(reflect2.TypeOf("")), } } switch typ.Kind() { case reflect.String: return encoderOfType(ctx, reflect2.DefaultTypeOfKind(reflect.String)) case reflect.Bool, reflect.Uint8, reflect.Int8, reflect.Uint16, reflect.Int16, reflect.Uint32, reflect.Int32, reflect.Uint64, reflect.Int64, reflect.Uint, reflect.Int, reflect.Float32, reflect.Float64, reflect.Uintptr: typ = reflect2.DefaultTypeOfKind(typ.Kind()) return &numericMapKeyEncoder{encoderOfType(ctx, typ)} default: if typ.Kind() == reflect.Interface { return &dynamicMapKeyEncoder{ctx, typ} } return &lazyErrorEncoder{err: fmt.Errorf("unsupported map key type: %v", typ)} } } type mapDecoder struct { mapType *reflect2.UnsafeMapType keyType reflect2.Type elemType reflect2.Type keyDecoder ValDecoder elemDecoder ValDecoder } func (decoder *mapDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { mapType := decoder.mapType c := iter.nextToken() if c == 'n' { iter.skipThreeBytes('u', 'l', 'l') *(*unsafe.Pointer)(ptr) = nil mapType.UnsafeSet(ptr, mapType.UnsafeNew()) return } if mapType.UnsafeIsNil(ptr) { mapType.UnsafeSet(ptr, mapType.UnsafeMakeMap(0)) } if c != '{' { iter.ReportError("ReadMapCB", `expect { or n, but found `+string([]byte{c})) return } c = iter.nextToken() if c == '}' { return } iter.unreadByte() key := decoder.keyType.UnsafeNew() decoder.keyDecoder.Decode(key, iter) c = iter.nextToken() if c != ':' { iter.ReportError("ReadMapCB", "expect : after object field, but found "+string([]byte{c})) return } elem := decoder.elemType.UnsafeNew() decoder.elemDecoder.Decode(elem, iter) decoder.mapType.UnsafeSetIndex(ptr, key, elem) for c = iter.nextToken(); c == ','; c = iter.nextToken() { key := decoder.keyType.UnsafeNew() decoder.keyDecoder.Decode(key, iter) c = iter.nextToken() if c != ':' { iter.ReportError("ReadMapCB", "expect : after object field, but found "+string([]byte{c})) return } elem := decoder.elemType.UnsafeNew() decoder.elemDecoder.Decode(elem, iter) decoder.mapType.UnsafeSetIndex(ptr, key, elem) } if c != '}' { iter.ReportError("ReadMapCB", `expect }, but found `+string([]byte{c})) } } type numericMapKeyDecoder struct { decoder ValDecoder } func (decoder *numericMapKeyDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { c := iter.nextToken() if c != '"' { iter.ReportError("ReadMapCB", `expect ", but found `+string([]byte{c})) return } decoder.decoder.Decode(ptr, iter) c = iter.nextToken() if c != '"' { iter.ReportError("ReadMapCB", `expect ", but found `+string([]byte{c})) return } } type numericMapKeyEncoder struct { encoder ValEncoder } func (encoder *numericMapKeyEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { stream.writeByte('"') encoder.encoder.Encode(ptr, stream) stream.writeByte('"') } func (encoder *numericMapKeyEncoder) IsEmpty(ptr unsafe.Pointer) bool { return false } type dynamicMapKeyEncoder struct { ctx *ctx valType reflect2.Type } func (encoder *dynamicMapKeyEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { obj := encoder.valType.UnsafeIndirect(ptr) encoderOfMapKey(encoder.ctx, reflect2.TypeOf(obj)).Encode(reflect2.PtrOf(obj), stream) } func (encoder *dynamicMapKeyEncoder) IsEmpty(ptr unsafe.Pointer) bool { obj := encoder.valType.UnsafeIndirect(ptr) return encoderOfMapKey(encoder.ctx, reflect2.TypeOf(obj)).IsEmpty(reflect2.PtrOf(obj)) } type mapEncoder struct { mapType *reflect2.UnsafeMapType keyEncoder ValEncoder elemEncoder ValEncoder } func (encoder *mapEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { if *(*unsafe.Pointer)(ptr) == nil { stream.WriteNil() return } stream.WriteObjectStart() iter := encoder.mapType.UnsafeIterate(ptr) for i := 0; iter.HasNext(); i++ { if i != 0 { stream.WriteMore() } key, elem := iter.UnsafeNext() encoder.keyEncoder.Encode(key, stream) if stream.indention > 0 { stream.writeTwoBytes(byte(':'), byte(' ')) } else { stream.writeByte(':') } encoder.elemEncoder.Encode(elem, stream) } stream.WriteObjectEnd() } func (encoder *mapEncoder) IsEmpty(ptr unsafe.Pointer) bool { iter := encoder.mapType.UnsafeIterate(ptr) return !iter.HasNext() } type sortKeysMapEncoder struct { mapType *reflect2.UnsafeMapType keyEncoder ValEncoder elemEncoder ValEncoder } func (encoder *sortKeysMapEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { if *(*unsafe.Pointer)(ptr) == nil { stream.WriteNil() return } stream.WriteObjectStart() mapIter := encoder.mapType.UnsafeIterate(ptr) subStream := stream.cfg.BorrowStream(nil) subStream.Attachment = stream.Attachment subIter := stream.cfg.BorrowIterator(nil) keyValues := encodedKeyValues{} for mapIter.HasNext() { key, elem := mapIter.UnsafeNext() subStreamIndex := subStream.Buffered() encoder.keyEncoder.Encode(key, subStream) if subStream.Error != nil && subStream.Error != io.EOF && stream.Error == nil { stream.Error = subStream.Error } encodedKey := subStream.Buffer()[subStreamIndex:] subIter.ResetBytes(encodedKey) decodedKey := subIter.ReadString() if stream.indention > 0 { subStream.writeTwoBytes(byte(':'), byte(' ')) } else { subStream.writeByte(':') } encoder.elemEncoder.Encode(elem, subStream) keyValues = append(keyValues, encodedKV{ key: decodedKey, keyValue: subStream.Buffer()[subStreamIndex:], }) } sort.Sort(keyValues) for i, keyValue := range keyValues { if i != 0 { stream.WriteMore() } stream.Write(keyValue.keyValue) } if subStream.Error != nil && stream.Error == nil { stream.Error = subStream.Error } stream.WriteObjectEnd() stream.cfg.ReturnStream(subStream) stream.cfg.ReturnIterator(subIter) } func (encoder *sortKeysMapEncoder) IsEmpty(ptr unsafe.Pointer) bool { iter := encoder.mapType.UnsafeIterate(ptr) return !iter.HasNext() } type encodedKeyValues []encodedKV type encodedKV struct { key string keyValue []byte } func (sv encodedKeyValues) Len() int { return len(sv) } func (sv encodedKeyValues) Swap(i, j int) { sv[i], sv[j] = sv[j], sv[i] } func (sv encodedKeyValues) Less(i, j int) bool { return sv[i].key < sv[j].key }
8,973
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/stream_int.go
package jsoniter var digits []uint32 func init() { digits = make([]uint32, 1000) for i := uint32(0); i < 1000; i++ { digits[i] = (((i / 100) + '0') << 16) + ((((i / 10) % 10) + '0') << 8) + i%10 + '0' if i < 10 { digits[i] += 2 << 24 } else if i < 100 { digits[i] += 1 << 24 } } } func writeFirstBuf(space []byte, v uint32) []byte { start := v >> 24 if start == 0 { space = append(space, byte(v>>16), byte(v>>8)) } else if start == 1 { space = append(space, byte(v>>8)) } space = append(space, byte(v)) return space } func writeBuf(buf []byte, v uint32) []byte { return append(buf, byte(v>>16), byte(v>>8), byte(v)) } // WriteUint8 write uint8 to stream func (stream *Stream) WriteUint8(val uint8) { stream.buf = writeFirstBuf(stream.buf, digits[val]) } // WriteInt8 write int8 to stream func (stream *Stream) WriteInt8(nval int8) { var val uint8 if nval < 0 { val = uint8(-nval) stream.buf = append(stream.buf, '-') } else { val = uint8(nval) } stream.buf = writeFirstBuf(stream.buf, digits[val]) } // WriteUint16 write uint16 to stream func (stream *Stream) WriteUint16(val uint16) { q1 := val / 1000 if q1 == 0 { stream.buf = writeFirstBuf(stream.buf, digits[val]) return } r1 := val - q1*1000 stream.buf = writeFirstBuf(stream.buf, digits[q1]) stream.buf = writeBuf(stream.buf, digits[r1]) return } // WriteInt16 write int16 to stream func (stream *Stream) WriteInt16(nval int16) { var val uint16 if nval < 0 { val = uint16(-nval) stream.buf = append(stream.buf, '-') } else { val = uint16(nval) } stream.WriteUint16(val) } // WriteUint32 write uint32 to stream func (stream *Stream) WriteUint32(val uint32) { q1 := val / 1000 if q1 == 0 { stream.buf = writeFirstBuf(stream.buf, digits[val]) return } r1 := val - q1*1000 q2 := q1 / 1000 if q2 == 0 { stream.buf = writeFirstBuf(stream.buf, digits[q1]) stream.buf = writeBuf(stream.buf, digits[r1]) return } r2 := q1 - q2*1000 q3 := q2 / 1000 if q3 == 0 { stream.buf = writeFirstBuf(stream.buf, digits[q2]) } else { r3 := q2 - q3*1000 stream.buf = append(stream.buf, byte(q3+'0')) stream.buf = writeBuf(stream.buf, digits[r3]) } stream.buf = writeBuf(stream.buf, digits[r2]) stream.buf = writeBuf(stream.buf, digits[r1]) } // WriteInt32 write int32 to stream func (stream *Stream) WriteInt32(nval int32) { var val uint32 if nval < 0 { val = uint32(-nval) stream.buf = append(stream.buf, '-') } else { val = uint32(nval) } stream.WriteUint32(val) } // WriteUint64 write uint64 to stream func (stream *Stream) WriteUint64(val uint64) { q1 := val / 1000 if q1 == 0 { stream.buf = writeFirstBuf(stream.buf, digits[val]) return } r1 := val - q1*1000 q2 := q1 / 1000 if q2 == 0 { stream.buf = writeFirstBuf(stream.buf, digits[q1]) stream.buf = writeBuf(stream.buf, digits[r1]) return } r2 := q1 - q2*1000 q3 := q2 / 1000 if q3 == 0 { stream.buf = writeFirstBuf(stream.buf, digits[q2]) stream.buf = writeBuf(stream.buf, digits[r2]) stream.buf = writeBuf(stream.buf, digits[r1]) return } r3 := q2 - q3*1000 q4 := q3 / 1000 if q4 == 0 { stream.buf = writeFirstBuf(stream.buf, digits[q3]) stream.buf = writeBuf(stream.buf, digits[r3]) stream.buf = writeBuf(stream.buf, digits[r2]) stream.buf = writeBuf(stream.buf, digits[r1]) return } r4 := q3 - q4*1000 q5 := q4 / 1000 if q5 == 0 { stream.buf = writeFirstBuf(stream.buf, digits[q4]) stream.buf = writeBuf(stream.buf, digits[r4]) stream.buf = writeBuf(stream.buf, digits[r3]) stream.buf = writeBuf(stream.buf, digits[r2]) stream.buf = writeBuf(stream.buf, digits[r1]) return } r5 := q4 - q5*1000 q6 := q5 / 1000 if q6 == 0 { stream.buf = writeFirstBuf(stream.buf, digits[q5]) } else { stream.buf = writeFirstBuf(stream.buf, digits[q6]) r6 := q5 - q6*1000 stream.buf = writeBuf(stream.buf, digits[r6]) } stream.buf = writeBuf(stream.buf, digits[r5]) stream.buf = writeBuf(stream.buf, digits[r4]) stream.buf = writeBuf(stream.buf, digits[r3]) stream.buf = writeBuf(stream.buf, digits[r2]) stream.buf = writeBuf(stream.buf, digits[r1]) } // WriteInt64 write int64 to stream func (stream *Stream) WriteInt64(nval int64) { var val uint64 if nval < 0 { val = uint64(-nval) stream.buf = append(stream.buf, '-') } else { val = uint64(nval) } stream.WriteUint64(val) } // WriteInt write int to stream func (stream *Stream) WriteInt(val int) { stream.WriteInt64(int64(val)) } // WriteUint write uint to stream func (stream *Stream) WriteUint(val uint) { stream.WriteUint64(uint64(val)) }
8,974
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/reflect_json_number.go
package jsoniter import ( "encoding/json" "github.com/modern-go/reflect2" "strconv" "unsafe" ) type Number string // String returns the literal text of the number. func (n Number) String() string { return string(n) } // Float64 returns the number as a float64. func (n Number) Float64() (float64, error) { return strconv.ParseFloat(string(n), 64) } // Int64 returns the number as an int64. func (n Number) Int64() (int64, error) { return strconv.ParseInt(string(n), 10, 64) } func CastJsonNumber(val interface{}) (string, bool) { switch typedVal := val.(type) { case json.Number: return string(typedVal), true case Number: return string(typedVal), true } return "", false } var jsonNumberType = reflect2.TypeOfPtr((*json.Number)(nil)).Elem() var jsoniterNumberType = reflect2.TypeOfPtr((*Number)(nil)).Elem() func createDecoderOfJsonNumber(ctx *ctx, typ reflect2.Type) ValDecoder { if typ.AssignableTo(jsonNumberType) { return &jsonNumberCodec{} } if typ.AssignableTo(jsoniterNumberType) { return &jsoniterNumberCodec{} } return nil } func createEncoderOfJsonNumber(ctx *ctx, typ reflect2.Type) ValEncoder { if typ.AssignableTo(jsonNumberType) { return &jsonNumberCodec{} } if typ.AssignableTo(jsoniterNumberType) { return &jsoniterNumberCodec{} } return nil } type jsonNumberCodec struct { } func (codec *jsonNumberCodec) Decode(ptr unsafe.Pointer, iter *Iterator) { switch iter.WhatIsNext() { case StringValue: *((*json.Number)(ptr)) = json.Number(iter.ReadString()) case NilValue: iter.skipFourBytes('n', 'u', 'l', 'l') *((*json.Number)(ptr)) = "" default: *((*json.Number)(ptr)) = json.Number([]byte(iter.readNumberAsString())) } } func (codec *jsonNumberCodec) Encode(ptr unsafe.Pointer, stream *Stream) { number := *((*json.Number)(ptr)) if len(number) == 0 { stream.writeByte('0') } else { stream.WriteRaw(string(number)) } } func (codec *jsonNumberCodec) IsEmpty(ptr unsafe.Pointer) bool { return len(*((*json.Number)(ptr))) == 0 } type jsoniterNumberCodec struct { } func (codec *jsoniterNumberCodec) Decode(ptr unsafe.Pointer, iter *Iterator) { switch iter.WhatIsNext() { case StringValue: *((*Number)(ptr)) = Number(iter.ReadString()) case NilValue: iter.skipFourBytes('n', 'u', 'l', 'l') *((*Number)(ptr)) = "" default: *((*Number)(ptr)) = Number([]byte(iter.readNumberAsString())) } } func (codec *jsoniterNumberCodec) Encode(ptr unsafe.Pointer, stream *Stream) { number := *((*Number)(ptr)) if len(number) == 0 { stream.writeByte('0') } else { stream.WriteRaw(string(number)) } } func (codec *jsoniterNumberCodec) IsEmpty(ptr unsafe.Pointer) bool { return len(*((*Number)(ptr))) == 0 }
8,975
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/any_uint64.go
package jsoniter import ( "strconv" ) type uint64Any struct { baseAny val uint64 } func (any *uint64Any) LastError() error { return nil } func (any *uint64Any) ValueType() ValueType { return NumberValue } func (any *uint64Any) MustBeValid() Any { return any } func (any *uint64Any) ToBool() bool { return any.val != 0 } func (any *uint64Any) ToInt() int { return int(any.val) } func (any *uint64Any) ToInt32() int32 { return int32(any.val) } func (any *uint64Any) ToInt64() int64 { return int64(any.val) } func (any *uint64Any) ToUint() uint { return uint(any.val) } func (any *uint64Any) ToUint32() uint32 { return uint32(any.val) } func (any *uint64Any) ToUint64() uint64 { return any.val } func (any *uint64Any) ToFloat32() float32 { return float32(any.val) } func (any *uint64Any) ToFloat64() float64 { return float64(any.val) } func (any *uint64Any) ToString() string { return strconv.FormatUint(any.val, 10) } func (any *uint64Any) WriteTo(stream *Stream) { stream.WriteUint64(any.val) } func (any *uint64Any) Parse() *Iterator { return nil } func (any *uint64Any) GetInterface() interface{} { return any.val }
8,976
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/reflect_struct_decoder.go
package jsoniter import ( "fmt" "io" "strings" "unsafe" "github.com/modern-go/reflect2" ) func decoderOfStruct(ctx *ctx, typ reflect2.Type) ValDecoder { bindings := map[string]*Binding{} structDescriptor := describeStruct(ctx, typ) for _, binding := range structDescriptor.Fields { for _, fromName := range binding.FromNames { old := bindings[fromName] if old == nil { bindings[fromName] = binding continue } ignoreOld, ignoreNew := resolveConflictBinding(ctx.frozenConfig, old, binding) if ignoreOld { delete(bindings, fromName) } if !ignoreNew { bindings[fromName] = binding } } } fields := map[string]*structFieldDecoder{} for k, binding := range bindings { fields[k] = binding.Decoder.(*structFieldDecoder) } if !ctx.caseSensitive() { for k, binding := range bindings { if _, found := fields[strings.ToLower(k)]; !found { fields[strings.ToLower(k)] = binding.Decoder.(*structFieldDecoder) } } } return createStructDecoder(ctx, typ, fields) } func createStructDecoder(ctx *ctx, typ reflect2.Type, fields map[string]*structFieldDecoder) ValDecoder { if ctx.disallowUnknownFields { return &generalStructDecoder{typ: typ, fields: fields, disallowUnknownFields: true} } knownHash := map[int64]struct{}{ 0: {}, } switch len(fields) { case 0: return &skipObjectDecoder{typ} case 1: for fieldName, fieldDecoder := range fields { fieldHash := calcHash(fieldName, ctx.caseSensitive()) _, known := knownHash[fieldHash] if known { return &generalStructDecoder{typ, fields, false} } knownHash[fieldHash] = struct{}{} return &oneFieldStructDecoder{typ, fieldHash, fieldDecoder} } case 2: var fieldHash1 int64 var fieldHash2 int64 var fieldDecoder1 *structFieldDecoder var fieldDecoder2 *structFieldDecoder for fieldName, fieldDecoder := range fields { fieldHash := calcHash(fieldName, ctx.caseSensitive()) _, known := knownHash[fieldHash] if known { return &generalStructDecoder{typ, fields, false} } knownHash[fieldHash] = struct{}{} if fieldHash1 == 0 { fieldHash1 = fieldHash fieldDecoder1 = fieldDecoder } else { fieldHash2 = fieldHash fieldDecoder2 = fieldDecoder } } return &twoFieldsStructDecoder{typ, fieldHash1, fieldDecoder1, fieldHash2, fieldDecoder2} case 3: var fieldName1 int64 var fieldName2 int64 var fieldName3 int64 var fieldDecoder1 *structFieldDecoder var fieldDecoder2 *structFieldDecoder var fieldDecoder3 *structFieldDecoder for fieldName, fieldDecoder := range fields { fieldHash := calcHash(fieldName, ctx.caseSensitive()) _, known := knownHash[fieldHash] if known { return &generalStructDecoder{typ, fields, false} } knownHash[fieldHash] = struct{}{} if fieldName1 == 0 { fieldName1 = fieldHash fieldDecoder1 = fieldDecoder } else if fieldName2 == 0 { fieldName2 = fieldHash fieldDecoder2 = fieldDecoder } else { fieldName3 = fieldHash fieldDecoder3 = fieldDecoder } } return &threeFieldsStructDecoder{typ, fieldName1, fieldDecoder1, fieldName2, fieldDecoder2, fieldName3, fieldDecoder3} case 4: var fieldName1 int64 var fieldName2 int64 var fieldName3 int64 var fieldName4 int64 var fieldDecoder1 *structFieldDecoder var fieldDecoder2 *structFieldDecoder var fieldDecoder3 *structFieldDecoder var fieldDecoder4 *structFieldDecoder for fieldName, fieldDecoder := range fields { fieldHash := calcHash(fieldName, ctx.caseSensitive()) _, known := knownHash[fieldHash] if known { return &generalStructDecoder{typ, fields, false} } knownHash[fieldHash] = struct{}{} if fieldName1 == 0 { fieldName1 = fieldHash fieldDecoder1 = fieldDecoder } else if fieldName2 == 0 { fieldName2 = fieldHash fieldDecoder2 = fieldDecoder } else if fieldName3 == 0 { fieldName3 = fieldHash fieldDecoder3 = fieldDecoder } else { fieldName4 = fieldHash fieldDecoder4 = fieldDecoder } } return &fourFieldsStructDecoder{typ, fieldName1, fieldDecoder1, fieldName2, fieldDecoder2, fieldName3, fieldDecoder3, fieldName4, fieldDecoder4} case 5: var fieldName1 int64 var fieldName2 int64 var fieldName3 int64 var fieldName4 int64 var fieldName5 int64 var fieldDecoder1 *structFieldDecoder var fieldDecoder2 *structFieldDecoder var fieldDecoder3 *structFieldDecoder var fieldDecoder4 *structFieldDecoder var fieldDecoder5 *structFieldDecoder for fieldName, fieldDecoder := range fields { fieldHash := calcHash(fieldName, ctx.caseSensitive()) _, known := knownHash[fieldHash] if known { return &generalStructDecoder{typ, fields, false} } knownHash[fieldHash] = struct{}{} if fieldName1 == 0 { fieldName1 = fieldHash fieldDecoder1 = fieldDecoder } else if fieldName2 == 0 { fieldName2 = fieldHash fieldDecoder2 = fieldDecoder } else if fieldName3 == 0 { fieldName3 = fieldHash fieldDecoder3 = fieldDecoder } else if fieldName4 == 0 { fieldName4 = fieldHash fieldDecoder4 = fieldDecoder } else { fieldName5 = fieldHash fieldDecoder5 = fieldDecoder } } return &fiveFieldsStructDecoder{typ, fieldName1, fieldDecoder1, fieldName2, fieldDecoder2, fieldName3, fieldDecoder3, fieldName4, fieldDecoder4, fieldName5, fieldDecoder5} case 6: var fieldName1 int64 var fieldName2 int64 var fieldName3 int64 var fieldName4 int64 var fieldName5 int64 var fieldName6 int64 var fieldDecoder1 *structFieldDecoder var fieldDecoder2 *structFieldDecoder var fieldDecoder3 *structFieldDecoder var fieldDecoder4 *structFieldDecoder var fieldDecoder5 *structFieldDecoder var fieldDecoder6 *structFieldDecoder for fieldName, fieldDecoder := range fields { fieldHash := calcHash(fieldName, ctx.caseSensitive()) _, known := knownHash[fieldHash] if known { return &generalStructDecoder{typ, fields, false} } knownHash[fieldHash] = struct{}{} if fieldName1 == 0 { fieldName1 = fieldHash fieldDecoder1 = fieldDecoder } else if fieldName2 == 0 { fieldName2 = fieldHash fieldDecoder2 = fieldDecoder } else if fieldName3 == 0 { fieldName3 = fieldHash fieldDecoder3 = fieldDecoder } else if fieldName4 == 0 { fieldName4 = fieldHash fieldDecoder4 = fieldDecoder } else if fieldName5 == 0 { fieldName5 = fieldHash fieldDecoder5 = fieldDecoder } else { fieldName6 = fieldHash fieldDecoder6 = fieldDecoder } } return &sixFieldsStructDecoder{typ, fieldName1, fieldDecoder1, fieldName2, fieldDecoder2, fieldName3, fieldDecoder3, fieldName4, fieldDecoder4, fieldName5, fieldDecoder5, fieldName6, fieldDecoder6} case 7: var fieldName1 int64 var fieldName2 int64 var fieldName3 int64 var fieldName4 int64 var fieldName5 int64 var fieldName6 int64 var fieldName7 int64 var fieldDecoder1 *structFieldDecoder var fieldDecoder2 *structFieldDecoder var fieldDecoder3 *structFieldDecoder var fieldDecoder4 *structFieldDecoder var fieldDecoder5 *structFieldDecoder var fieldDecoder6 *structFieldDecoder var fieldDecoder7 *structFieldDecoder for fieldName, fieldDecoder := range fields { fieldHash := calcHash(fieldName, ctx.caseSensitive()) _, known := knownHash[fieldHash] if known { return &generalStructDecoder{typ, fields, false} } knownHash[fieldHash] = struct{}{} if fieldName1 == 0 { fieldName1 = fieldHash fieldDecoder1 = fieldDecoder } else if fieldName2 == 0 { fieldName2 = fieldHash fieldDecoder2 = fieldDecoder } else if fieldName3 == 0 { fieldName3 = fieldHash fieldDecoder3 = fieldDecoder } else if fieldName4 == 0 { fieldName4 = fieldHash fieldDecoder4 = fieldDecoder } else if fieldName5 == 0 { fieldName5 = fieldHash fieldDecoder5 = fieldDecoder } else if fieldName6 == 0 { fieldName6 = fieldHash fieldDecoder6 = fieldDecoder } else { fieldName7 = fieldHash fieldDecoder7 = fieldDecoder } } return &sevenFieldsStructDecoder{typ, fieldName1, fieldDecoder1, fieldName2, fieldDecoder2, fieldName3, fieldDecoder3, fieldName4, fieldDecoder4, fieldName5, fieldDecoder5, fieldName6, fieldDecoder6, fieldName7, fieldDecoder7} case 8: var fieldName1 int64 var fieldName2 int64 var fieldName3 int64 var fieldName4 int64 var fieldName5 int64 var fieldName6 int64 var fieldName7 int64 var fieldName8 int64 var fieldDecoder1 *structFieldDecoder var fieldDecoder2 *structFieldDecoder var fieldDecoder3 *structFieldDecoder var fieldDecoder4 *structFieldDecoder var fieldDecoder5 *structFieldDecoder var fieldDecoder6 *structFieldDecoder var fieldDecoder7 *structFieldDecoder var fieldDecoder8 *structFieldDecoder for fieldName, fieldDecoder := range fields { fieldHash := calcHash(fieldName, ctx.caseSensitive()) _, known := knownHash[fieldHash] if known { return &generalStructDecoder{typ, fields, false} } knownHash[fieldHash] = struct{}{} if fieldName1 == 0 { fieldName1 = fieldHash fieldDecoder1 = fieldDecoder } else if fieldName2 == 0 { fieldName2 = fieldHash fieldDecoder2 = fieldDecoder } else if fieldName3 == 0 { fieldName3 = fieldHash fieldDecoder3 = fieldDecoder } else if fieldName4 == 0 { fieldName4 = fieldHash fieldDecoder4 = fieldDecoder } else if fieldName5 == 0 { fieldName5 = fieldHash fieldDecoder5 = fieldDecoder } else if fieldName6 == 0 { fieldName6 = fieldHash fieldDecoder6 = fieldDecoder } else if fieldName7 == 0 { fieldName7 = fieldHash fieldDecoder7 = fieldDecoder } else { fieldName8 = fieldHash fieldDecoder8 = fieldDecoder } } return &eightFieldsStructDecoder{typ, fieldName1, fieldDecoder1, fieldName2, fieldDecoder2, fieldName3, fieldDecoder3, fieldName4, fieldDecoder4, fieldName5, fieldDecoder5, fieldName6, fieldDecoder6, fieldName7, fieldDecoder7, fieldName8, fieldDecoder8} case 9: var fieldName1 int64 var fieldName2 int64 var fieldName3 int64 var fieldName4 int64 var fieldName5 int64 var fieldName6 int64 var fieldName7 int64 var fieldName8 int64 var fieldName9 int64 var fieldDecoder1 *structFieldDecoder var fieldDecoder2 *structFieldDecoder var fieldDecoder3 *structFieldDecoder var fieldDecoder4 *structFieldDecoder var fieldDecoder5 *structFieldDecoder var fieldDecoder6 *structFieldDecoder var fieldDecoder7 *structFieldDecoder var fieldDecoder8 *structFieldDecoder var fieldDecoder9 *structFieldDecoder for fieldName, fieldDecoder := range fields { fieldHash := calcHash(fieldName, ctx.caseSensitive()) _, known := knownHash[fieldHash] if known { return &generalStructDecoder{typ, fields, false} } knownHash[fieldHash] = struct{}{} if fieldName1 == 0 { fieldName1 = fieldHash fieldDecoder1 = fieldDecoder } else if fieldName2 == 0 { fieldName2 = fieldHash fieldDecoder2 = fieldDecoder } else if fieldName3 == 0 { fieldName3 = fieldHash fieldDecoder3 = fieldDecoder } else if fieldName4 == 0 { fieldName4 = fieldHash fieldDecoder4 = fieldDecoder } else if fieldName5 == 0 { fieldName5 = fieldHash fieldDecoder5 = fieldDecoder } else if fieldName6 == 0 { fieldName6 = fieldHash fieldDecoder6 = fieldDecoder } else if fieldName7 == 0 { fieldName7 = fieldHash fieldDecoder7 = fieldDecoder } else if fieldName8 == 0 { fieldName8 = fieldHash fieldDecoder8 = fieldDecoder } else { fieldName9 = fieldHash fieldDecoder9 = fieldDecoder } } return &nineFieldsStructDecoder{typ, fieldName1, fieldDecoder1, fieldName2, fieldDecoder2, fieldName3, fieldDecoder3, fieldName4, fieldDecoder4, fieldName5, fieldDecoder5, fieldName6, fieldDecoder6, fieldName7, fieldDecoder7, fieldName8, fieldDecoder8, fieldName9, fieldDecoder9} case 10: var fieldName1 int64 var fieldName2 int64 var fieldName3 int64 var fieldName4 int64 var fieldName5 int64 var fieldName6 int64 var fieldName7 int64 var fieldName8 int64 var fieldName9 int64 var fieldName10 int64 var fieldDecoder1 *structFieldDecoder var fieldDecoder2 *structFieldDecoder var fieldDecoder3 *structFieldDecoder var fieldDecoder4 *structFieldDecoder var fieldDecoder5 *structFieldDecoder var fieldDecoder6 *structFieldDecoder var fieldDecoder7 *structFieldDecoder var fieldDecoder8 *structFieldDecoder var fieldDecoder9 *structFieldDecoder var fieldDecoder10 *structFieldDecoder for fieldName, fieldDecoder := range fields { fieldHash := calcHash(fieldName, ctx.caseSensitive()) _, known := knownHash[fieldHash] if known { return &generalStructDecoder{typ, fields, false} } knownHash[fieldHash] = struct{}{} if fieldName1 == 0 { fieldName1 = fieldHash fieldDecoder1 = fieldDecoder } else if fieldName2 == 0 { fieldName2 = fieldHash fieldDecoder2 = fieldDecoder } else if fieldName3 == 0 { fieldName3 = fieldHash fieldDecoder3 = fieldDecoder } else if fieldName4 == 0 { fieldName4 = fieldHash fieldDecoder4 = fieldDecoder } else if fieldName5 == 0 { fieldName5 = fieldHash fieldDecoder5 = fieldDecoder } else if fieldName6 == 0 { fieldName6 = fieldHash fieldDecoder6 = fieldDecoder } else if fieldName7 == 0 { fieldName7 = fieldHash fieldDecoder7 = fieldDecoder } else if fieldName8 == 0 { fieldName8 = fieldHash fieldDecoder8 = fieldDecoder } else if fieldName9 == 0 { fieldName9 = fieldHash fieldDecoder9 = fieldDecoder } else { fieldName10 = fieldHash fieldDecoder10 = fieldDecoder } } return &tenFieldsStructDecoder{typ, fieldName1, fieldDecoder1, fieldName2, fieldDecoder2, fieldName3, fieldDecoder3, fieldName4, fieldDecoder4, fieldName5, fieldDecoder5, fieldName6, fieldDecoder6, fieldName7, fieldDecoder7, fieldName8, fieldDecoder8, fieldName9, fieldDecoder9, fieldName10, fieldDecoder10} } return &generalStructDecoder{typ, fields, false} } type generalStructDecoder struct { typ reflect2.Type fields map[string]*structFieldDecoder disallowUnknownFields bool } func (decoder *generalStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.readObjectStart() { return } if !iter.incrementDepth() { return } var c byte for c = ','; c == ','; c = iter.nextToken() { decoder.decodeOneField(ptr, iter) } if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 { iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) } if c != '}' { iter.ReportError("struct Decode", `expect }, but found `+string([]byte{c})) } iter.decrementDepth() } func (decoder *generalStructDecoder) decodeOneField(ptr unsafe.Pointer, iter *Iterator) { var field string var fieldDecoder *structFieldDecoder if iter.cfg.objectFieldMustBeSimpleString { fieldBytes := iter.ReadStringAsSlice() field = *(*string)(unsafe.Pointer(&fieldBytes)) fieldDecoder = decoder.fields[field] if fieldDecoder == nil && !iter.cfg.caseSensitive { fieldDecoder = decoder.fields[strings.ToLower(field)] } } else { field = iter.ReadString() fieldDecoder = decoder.fields[field] if fieldDecoder == nil && !iter.cfg.caseSensitive { fieldDecoder = decoder.fields[strings.ToLower(field)] } } if fieldDecoder == nil { if decoder.disallowUnknownFields { msg := "found unknown field: " + field iter.ReportError("ReadObject", msg) } c := iter.nextToken() if c != ':' { iter.ReportError("ReadObject", "expect : after object field, but found "+string([]byte{c})) } iter.Skip() return } c := iter.nextToken() if c != ':' { iter.ReportError("ReadObject", "expect : after object field, but found "+string([]byte{c})) } fieldDecoder.Decode(ptr, iter) } type skipObjectDecoder struct { typ reflect2.Type } func (decoder *skipObjectDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { valueType := iter.WhatIsNext() if valueType != ObjectValue && valueType != NilValue { iter.ReportError("skipObjectDecoder", "expect object or null") return } iter.Skip() } type oneFieldStructDecoder struct { typ reflect2.Type fieldHash int64 fieldDecoder *structFieldDecoder } func (decoder *oneFieldStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.readObjectStart() { return } if !iter.incrementDepth() { return } for { if iter.readFieldHash() == decoder.fieldHash { decoder.fieldDecoder.Decode(ptr, iter) } else { iter.Skip() } if iter.isObjectEnd() { break } } if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 { iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) } iter.decrementDepth() } type twoFieldsStructDecoder struct { typ reflect2.Type fieldHash1 int64 fieldDecoder1 *structFieldDecoder fieldHash2 int64 fieldDecoder2 *structFieldDecoder } func (decoder *twoFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.readObjectStart() { return } if !iter.incrementDepth() { return } for { switch iter.readFieldHash() { case decoder.fieldHash1: decoder.fieldDecoder1.Decode(ptr, iter) case decoder.fieldHash2: decoder.fieldDecoder2.Decode(ptr, iter) default: iter.Skip() } if iter.isObjectEnd() { break } } if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 { iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) } iter.decrementDepth() } type threeFieldsStructDecoder struct { typ reflect2.Type fieldHash1 int64 fieldDecoder1 *structFieldDecoder fieldHash2 int64 fieldDecoder2 *structFieldDecoder fieldHash3 int64 fieldDecoder3 *structFieldDecoder } func (decoder *threeFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.readObjectStart() { return } if !iter.incrementDepth() { return } for { switch iter.readFieldHash() { case decoder.fieldHash1: decoder.fieldDecoder1.Decode(ptr, iter) case decoder.fieldHash2: decoder.fieldDecoder2.Decode(ptr, iter) case decoder.fieldHash3: decoder.fieldDecoder3.Decode(ptr, iter) default: iter.Skip() } if iter.isObjectEnd() { break } } if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 { iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) } iter.decrementDepth() } type fourFieldsStructDecoder struct { typ reflect2.Type fieldHash1 int64 fieldDecoder1 *structFieldDecoder fieldHash2 int64 fieldDecoder2 *structFieldDecoder fieldHash3 int64 fieldDecoder3 *structFieldDecoder fieldHash4 int64 fieldDecoder4 *structFieldDecoder } func (decoder *fourFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.readObjectStart() { return } if !iter.incrementDepth() { return } for { switch iter.readFieldHash() { case decoder.fieldHash1: decoder.fieldDecoder1.Decode(ptr, iter) case decoder.fieldHash2: decoder.fieldDecoder2.Decode(ptr, iter) case decoder.fieldHash3: decoder.fieldDecoder3.Decode(ptr, iter) case decoder.fieldHash4: decoder.fieldDecoder4.Decode(ptr, iter) default: iter.Skip() } if iter.isObjectEnd() { break } } if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 { iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) } iter.decrementDepth() } type fiveFieldsStructDecoder struct { typ reflect2.Type fieldHash1 int64 fieldDecoder1 *structFieldDecoder fieldHash2 int64 fieldDecoder2 *structFieldDecoder fieldHash3 int64 fieldDecoder3 *structFieldDecoder fieldHash4 int64 fieldDecoder4 *structFieldDecoder fieldHash5 int64 fieldDecoder5 *structFieldDecoder } func (decoder *fiveFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.readObjectStart() { return } if !iter.incrementDepth() { return } for { switch iter.readFieldHash() { case decoder.fieldHash1: decoder.fieldDecoder1.Decode(ptr, iter) case decoder.fieldHash2: decoder.fieldDecoder2.Decode(ptr, iter) case decoder.fieldHash3: decoder.fieldDecoder3.Decode(ptr, iter) case decoder.fieldHash4: decoder.fieldDecoder4.Decode(ptr, iter) case decoder.fieldHash5: decoder.fieldDecoder5.Decode(ptr, iter) default: iter.Skip() } if iter.isObjectEnd() { break } } if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 { iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) } iter.decrementDepth() } type sixFieldsStructDecoder struct { typ reflect2.Type fieldHash1 int64 fieldDecoder1 *structFieldDecoder fieldHash2 int64 fieldDecoder2 *structFieldDecoder fieldHash3 int64 fieldDecoder3 *structFieldDecoder fieldHash4 int64 fieldDecoder4 *structFieldDecoder fieldHash5 int64 fieldDecoder5 *structFieldDecoder fieldHash6 int64 fieldDecoder6 *structFieldDecoder } func (decoder *sixFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.readObjectStart() { return } if !iter.incrementDepth() { return } for { switch iter.readFieldHash() { case decoder.fieldHash1: decoder.fieldDecoder1.Decode(ptr, iter) case decoder.fieldHash2: decoder.fieldDecoder2.Decode(ptr, iter) case decoder.fieldHash3: decoder.fieldDecoder3.Decode(ptr, iter) case decoder.fieldHash4: decoder.fieldDecoder4.Decode(ptr, iter) case decoder.fieldHash5: decoder.fieldDecoder5.Decode(ptr, iter) case decoder.fieldHash6: decoder.fieldDecoder6.Decode(ptr, iter) default: iter.Skip() } if iter.isObjectEnd() { break } } if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 { iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) } iter.decrementDepth() } type sevenFieldsStructDecoder struct { typ reflect2.Type fieldHash1 int64 fieldDecoder1 *structFieldDecoder fieldHash2 int64 fieldDecoder2 *structFieldDecoder fieldHash3 int64 fieldDecoder3 *structFieldDecoder fieldHash4 int64 fieldDecoder4 *structFieldDecoder fieldHash5 int64 fieldDecoder5 *structFieldDecoder fieldHash6 int64 fieldDecoder6 *structFieldDecoder fieldHash7 int64 fieldDecoder7 *structFieldDecoder } func (decoder *sevenFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.readObjectStart() { return } if !iter.incrementDepth() { return } for { switch iter.readFieldHash() { case decoder.fieldHash1: decoder.fieldDecoder1.Decode(ptr, iter) case decoder.fieldHash2: decoder.fieldDecoder2.Decode(ptr, iter) case decoder.fieldHash3: decoder.fieldDecoder3.Decode(ptr, iter) case decoder.fieldHash4: decoder.fieldDecoder4.Decode(ptr, iter) case decoder.fieldHash5: decoder.fieldDecoder5.Decode(ptr, iter) case decoder.fieldHash6: decoder.fieldDecoder6.Decode(ptr, iter) case decoder.fieldHash7: decoder.fieldDecoder7.Decode(ptr, iter) default: iter.Skip() } if iter.isObjectEnd() { break } } if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 { iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) } iter.decrementDepth() } type eightFieldsStructDecoder struct { typ reflect2.Type fieldHash1 int64 fieldDecoder1 *structFieldDecoder fieldHash2 int64 fieldDecoder2 *structFieldDecoder fieldHash3 int64 fieldDecoder3 *structFieldDecoder fieldHash4 int64 fieldDecoder4 *structFieldDecoder fieldHash5 int64 fieldDecoder5 *structFieldDecoder fieldHash6 int64 fieldDecoder6 *structFieldDecoder fieldHash7 int64 fieldDecoder7 *structFieldDecoder fieldHash8 int64 fieldDecoder8 *structFieldDecoder } func (decoder *eightFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.readObjectStart() { return } if !iter.incrementDepth() { return } for { switch iter.readFieldHash() { case decoder.fieldHash1: decoder.fieldDecoder1.Decode(ptr, iter) case decoder.fieldHash2: decoder.fieldDecoder2.Decode(ptr, iter) case decoder.fieldHash3: decoder.fieldDecoder3.Decode(ptr, iter) case decoder.fieldHash4: decoder.fieldDecoder4.Decode(ptr, iter) case decoder.fieldHash5: decoder.fieldDecoder5.Decode(ptr, iter) case decoder.fieldHash6: decoder.fieldDecoder6.Decode(ptr, iter) case decoder.fieldHash7: decoder.fieldDecoder7.Decode(ptr, iter) case decoder.fieldHash8: decoder.fieldDecoder8.Decode(ptr, iter) default: iter.Skip() } if iter.isObjectEnd() { break } } if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 { iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) } iter.decrementDepth() } type nineFieldsStructDecoder struct { typ reflect2.Type fieldHash1 int64 fieldDecoder1 *structFieldDecoder fieldHash2 int64 fieldDecoder2 *structFieldDecoder fieldHash3 int64 fieldDecoder3 *structFieldDecoder fieldHash4 int64 fieldDecoder4 *structFieldDecoder fieldHash5 int64 fieldDecoder5 *structFieldDecoder fieldHash6 int64 fieldDecoder6 *structFieldDecoder fieldHash7 int64 fieldDecoder7 *structFieldDecoder fieldHash8 int64 fieldDecoder8 *structFieldDecoder fieldHash9 int64 fieldDecoder9 *structFieldDecoder } func (decoder *nineFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.readObjectStart() { return } if !iter.incrementDepth() { return } for { switch iter.readFieldHash() { case decoder.fieldHash1: decoder.fieldDecoder1.Decode(ptr, iter) case decoder.fieldHash2: decoder.fieldDecoder2.Decode(ptr, iter) case decoder.fieldHash3: decoder.fieldDecoder3.Decode(ptr, iter) case decoder.fieldHash4: decoder.fieldDecoder4.Decode(ptr, iter) case decoder.fieldHash5: decoder.fieldDecoder5.Decode(ptr, iter) case decoder.fieldHash6: decoder.fieldDecoder6.Decode(ptr, iter) case decoder.fieldHash7: decoder.fieldDecoder7.Decode(ptr, iter) case decoder.fieldHash8: decoder.fieldDecoder8.Decode(ptr, iter) case decoder.fieldHash9: decoder.fieldDecoder9.Decode(ptr, iter) default: iter.Skip() } if iter.isObjectEnd() { break } } if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 { iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) } iter.decrementDepth() } type tenFieldsStructDecoder struct { typ reflect2.Type fieldHash1 int64 fieldDecoder1 *structFieldDecoder fieldHash2 int64 fieldDecoder2 *structFieldDecoder fieldHash3 int64 fieldDecoder3 *structFieldDecoder fieldHash4 int64 fieldDecoder4 *structFieldDecoder fieldHash5 int64 fieldDecoder5 *structFieldDecoder fieldHash6 int64 fieldDecoder6 *structFieldDecoder fieldHash7 int64 fieldDecoder7 *structFieldDecoder fieldHash8 int64 fieldDecoder8 *structFieldDecoder fieldHash9 int64 fieldDecoder9 *structFieldDecoder fieldHash10 int64 fieldDecoder10 *structFieldDecoder } func (decoder *tenFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.readObjectStart() { return } if !iter.incrementDepth() { return } for { switch iter.readFieldHash() { case decoder.fieldHash1: decoder.fieldDecoder1.Decode(ptr, iter) case decoder.fieldHash2: decoder.fieldDecoder2.Decode(ptr, iter) case decoder.fieldHash3: decoder.fieldDecoder3.Decode(ptr, iter) case decoder.fieldHash4: decoder.fieldDecoder4.Decode(ptr, iter) case decoder.fieldHash5: decoder.fieldDecoder5.Decode(ptr, iter) case decoder.fieldHash6: decoder.fieldDecoder6.Decode(ptr, iter) case decoder.fieldHash7: decoder.fieldDecoder7.Decode(ptr, iter) case decoder.fieldHash8: decoder.fieldDecoder8.Decode(ptr, iter) case decoder.fieldHash9: decoder.fieldDecoder9.Decode(ptr, iter) case decoder.fieldHash10: decoder.fieldDecoder10.Decode(ptr, iter) default: iter.Skip() } if iter.isObjectEnd() { break } } if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 { iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) } iter.decrementDepth() } type structFieldDecoder struct { field reflect2.StructField fieldDecoder ValDecoder } func (decoder *structFieldDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { fieldPtr := decoder.field.UnsafeGet(ptr) decoder.fieldDecoder.Decode(fieldPtr, iter) if iter.Error != nil && iter.Error != io.EOF { iter.Error = fmt.Errorf("%s: %s", decoder.field.Name(), iter.Error.Error()) } } type stringModeStringDecoder struct { elemDecoder ValDecoder cfg *frozenConfig } func (decoder *stringModeStringDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { decoder.elemDecoder.Decode(ptr, iter) str := *((*string)(ptr)) tempIter := decoder.cfg.BorrowIterator([]byte(str)) defer decoder.cfg.ReturnIterator(tempIter) *((*string)(ptr)) = tempIter.ReadString() } type stringModeNumberDecoder struct { elemDecoder ValDecoder } func (decoder *stringModeNumberDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { c := iter.nextToken() if c != '"' { iter.ReportError("stringModeNumberDecoder", `expect ", but found `+string([]byte{c})) return } decoder.elemDecoder.Decode(ptr, iter) if iter.Error != nil { return } c = iter.readByte() if c != '"' { iter.ReportError("stringModeNumberDecoder", `expect ", but found `+string([]byte{c})) return } }
8,977
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/LICENSE
MIT License Copyright (c) 2016 json-iterator Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8,978
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/iter_array.go
package jsoniter // ReadArray read array element, tells if the array has more element to read. func (iter *Iterator) ReadArray() (ret bool) { c := iter.nextToken() switch c { case 'n': iter.skipThreeBytes('u', 'l', 'l') return false // null case '[': c = iter.nextToken() if c != ']' { iter.unreadByte() return true } return false case ']': return false case ',': return true default: iter.ReportError("ReadArray", "expect [ or , or ] or n, but found "+string([]byte{c})) return } } // ReadArrayCB read array with callback func (iter *Iterator) ReadArrayCB(callback func(*Iterator) bool) (ret bool) { c := iter.nextToken() if c == '[' { if !iter.incrementDepth() { return false } c = iter.nextToken() if c != ']' { iter.unreadByte() if !callback(iter) { iter.decrementDepth() return false } c = iter.nextToken() for c == ',' { if !callback(iter) { iter.decrementDepth() return false } c = iter.nextToken() } if c != ']' { iter.ReportError("ReadArrayCB", "expect ] in the end, but found "+string([]byte{c})) iter.decrementDepth() return false } return iter.decrementDepth() } return iter.decrementDepth() } if c == 'n' { iter.skipThreeBytes('u', 'l', 'l') return true // null } iter.ReportError("ReadArrayCB", "expect [ or n, but found "+string([]byte{c})) return false }
8,979
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/any.go
package jsoniter import ( "errors" "fmt" "github.com/modern-go/reflect2" "io" "reflect" "strconv" "unsafe" ) // Any generic object representation. // The lazy json implementation holds []byte and parse lazily. type Any interface { LastError() error ValueType() ValueType MustBeValid() Any ToBool() bool ToInt() int ToInt32() int32 ToInt64() int64 ToUint() uint ToUint32() uint32 ToUint64() uint64 ToFloat32() float32 ToFloat64() float64 ToString() string ToVal(val interface{}) Get(path ...interface{}) Any Size() int Keys() []string GetInterface() interface{} WriteTo(stream *Stream) } type baseAny struct{} func (any *baseAny) Get(path ...interface{}) Any { return &invalidAny{baseAny{}, fmt.Errorf("GetIndex %v from simple value", path)} } func (any *baseAny) Size() int { return 0 } func (any *baseAny) Keys() []string { return []string{} } func (any *baseAny) ToVal(obj interface{}) { panic("not implemented") } // WrapInt32 turn int32 into Any interface func WrapInt32(val int32) Any { return &int32Any{baseAny{}, val} } // WrapInt64 turn int64 into Any interface func WrapInt64(val int64) Any { return &int64Any{baseAny{}, val} } // WrapUint32 turn uint32 into Any interface func WrapUint32(val uint32) Any { return &uint32Any{baseAny{}, val} } // WrapUint64 turn uint64 into Any interface func WrapUint64(val uint64) Any { return &uint64Any{baseAny{}, val} } // WrapFloat64 turn float64 into Any interface func WrapFloat64(val float64) Any { return &floatAny{baseAny{}, val} } // WrapString turn string into Any interface func WrapString(val string) Any { return &stringAny{baseAny{}, val} } // Wrap turn a go object into Any interface func Wrap(val interface{}) Any { if val == nil { return &nilAny{} } asAny, isAny := val.(Any) if isAny { return asAny } typ := reflect2.TypeOf(val) switch typ.Kind() { case reflect.Slice: return wrapArray(val) case reflect.Struct: return wrapStruct(val) case reflect.Map: return wrapMap(val) case reflect.String: return WrapString(val.(string)) case reflect.Int: if strconv.IntSize == 32 { return WrapInt32(int32(val.(int))) } return WrapInt64(int64(val.(int))) case reflect.Int8: return WrapInt32(int32(val.(int8))) case reflect.Int16: return WrapInt32(int32(val.(int16))) case reflect.Int32: return WrapInt32(val.(int32)) case reflect.Int64: return WrapInt64(val.(int64)) case reflect.Uint: if strconv.IntSize == 32 { return WrapUint32(uint32(val.(uint))) } return WrapUint64(uint64(val.(uint))) case reflect.Uintptr: if ptrSize == 32 { return WrapUint32(uint32(val.(uintptr))) } return WrapUint64(uint64(val.(uintptr))) case reflect.Uint8: return WrapUint32(uint32(val.(uint8))) case reflect.Uint16: return WrapUint32(uint32(val.(uint16))) case reflect.Uint32: return WrapUint32(uint32(val.(uint32))) case reflect.Uint64: return WrapUint64(val.(uint64)) case reflect.Float32: return WrapFloat64(float64(val.(float32))) case reflect.Float64: return WrapFloat64(val.(float64)) case reflect.Bool: if val.(bool) == true { return &trueAny{} } return &falseAny{} } return &invalidAny{baseAny{}, fmt.Errorf("unsupported type: %v", typ)} } // ReadAny read next JSON element as an Any object. It is a better json.RawMessage. func (iter *Iterator) ReadAny() Any { return iter.readAny() } func (iter *Iterator) readAny() Any { c := iter.nextToken() switch c { case '"': iter.unreadByte() return &stringAny{baseAny{}, iter.ReadString()} case 'n': iter.skipThreeBytes('u', 'l', 'l') // null return &nilAny{} case 't': iter.skipThreeBytes('r', 'u', 'e') // true return &trueAny{} case 'f': iter.skipFourBytes('a', 'l', 's', 'e') // false return &falseAny{} case '{': return iter.readObjectAny() case '[': return iter.readArrayAny() case '-': return iter.readNumberAny(false) case 0: return &invalidAny{baseAny{}, errors.New("input is empty")} default: return iter.readNumberAny(true) } } func (iter *Iterator) readNumberAny(positive bool) Any { iter.startCapture(iter.head - 1) iter.skipNumber() lazyBuf := iter.stopCapture() return &numberLazyAny{baseAny{}, iter.cfg, lazyBuf, nil} } func (iter *Iterator) readObjectAny() Any { iter.startCapture(iter.head - 1) iter.skipObject() lazyBuf := iter.stopCapture() return &objectLazyAny{baseAny{}, iter.cfg, lazyBuf, nil} } func (iter *Iterator) readArrayAny() Any { iter.startCapture(iter.head - 1) iter.skipArray() lazyBuf := iter.stopCapture() return &arrayLazyAny{baseAny{}, iter.cfg, lazyBuf, nil} } func locateObjectField(iter *Iterator, target string) []byte { var found []byte iter.ReadObjectCB(func(iter *Iterator, field string) bool { if field == target { found = iter.SkipAndReturnBytes() return false } iter.Skip() return true }) return found } func locateArrayElement(iter *Iterator, target int) []byte { var found []byte n := 0 iter.ReadArrayCB(func(iter *Iterator) bool { if n == target { found = iter.SkipAndReturnBytes() return false } iter.Skip() n++ return true }) return found } func locatePath(iter *Iterator, path []interface{}) Any { for i, pathKeyObj := range path { switch pathKey := pathKeyObj.(type) { case string: valueBytes := locateObjectField(iter, pathKey) if valueBytes == nil { return newInvalidAny(path[i:]) } iter.ResetBytes(valueBytes) case int: valueBytes := locateArrayElement(iter, pathKey) if valueBytes == nil { return newInvalidAny(path[i:]) } iter.ResetBytes(valueBytes) case int32: if '*' == pathKey { return iter.readAny().Get(path[i:]...) } return newInvalidAny(path[i:]) default: return newInvalidAny(path[i:]) } } if iter.Error != nil && iter.Error != io.EOF { return &invalidAny{baseAny{}, iter.Error} } return iter.readAny() } var anyType = reflect2.TypeOfPtr((*Any)(nil)).Elem() func createDecoderOfAny(ctx *ctx, typ reflect2.Type) ValDecoder { if typ == anyType { return &directAnyCodec{} } if typ.Implements(anyType) { return &anyCodec{ valType: typ, } } return nil } func createEncoderOfAny(ctx *ctx, typ reflect2.Type) ValEncoder { if typ == anyType { return &directAnyCodec{} } if typ.Implements(anyType) { return &anyCodec{ valType: typ, } } return nil } type anyCodec struct { valType reflect2.Type } func (codec *anyCodec) Decode(ptr unsafe.Pointer, iter *Iterator) { panic("not implemented") } func (codec *anyCodec) Encode(ptr unsafe.Pointer, stream *Stream) { obj := codec.valType.UnsafeIndirect(ptr) any := obj.(Any) any.WriteTo(stream) } func (codec *anyCodec) IsEmpty(ptr unsafe.Pointer) bool { obj := codec.valType.UnsafeIndirect(ptr) any := obj.(Any) return any.Size() == 0 } type directAnyCodec struct { } func (codec *directAnyCodec) Decode(ptr unsafe.Pointer, iter *Iterator) { *(*Any)(ptr) = iter.readAny() } func (codec *directAnyCodec) Encode(ptr unsafe.Pointer, stream *Stream) { any := *(*Any)(ptr) if any == nil { stream.WriteNil() return } any.WriteTo(stream) } func (codec *directAnyCodec) IsEmpty(ptr unsafe.Pointer) bool { any := *(*Any)(ptr) return any.Size() == 0 }
8,980
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/iter.go
package jsoniter import ( "encoding/json" "fmt" "io" ) // ValueType the type for JSON element type ValueType int const ( // InvalidValue invalid JSON element InvalidValue ValueType = iota // StringValue JSON element "string" StringValue // NumberValue JSON element 100 or 0.10 NumberValue // NilValue JSON element null NilValue // BoolValue JSON element true or false BoolValue // ArrayValue JSON element [] ArrayValue // ObjectValue JSON element {} ObjectValue ) var hexDigits []byte var valueTypes []ValueType func init() { hexDigits = make([]byte, 256) for i := 0; i < len(hexDigits); i++ { hexDigits[i] = 255 } for i := '0'; i <= '9'; i++ { hexDigits[i] = byte(i - '0') } for i := 'a'; i <= 'f'; i++ { hexDigits[i] = byte((i - 'a') + 10) } for i := 'A'; i <= 'F'; i++ { hexDigits[i] = byte((i - 'A') + 10) } valueTypes = make([]ValueType, 256) for i := 0; i < len(valueTypes); i++ { valueTypes[i] = InvalidValue } valueTypes['"'] = StringValue valueTypes['-'] = NumberValue valueTypes['0'] = NumberValue valueTypes['1'] = NumberValue valueTypes['2'] = NumberValue valueTypes['3'] = NumberValue valueTypes['4'] = NumberValue valueTypes['5'] = NumberValue valueTypes['6'] = NumberValue valueTypes['7'] = NumberValue valueTypes['8'] = NumberValue valueTypes['9'] = NumberValue valueTypes['t'] = BoolValue valueTypes['f'] = BoolValue valueTypes['n'] = NilValue valueTypes['['] = ArrayValue valueTypes['{'] = ObjectValue } // Iterator is a io.Reader like object, with JSON specific read functions. // Error is not returned as return value, but stored as Error member on this iterator instance. type Iterator struct { cfg *frozenConfig reader io.Reader buf []byte head int tail int depth int captureStartedAt int captured []byte Error error Attachment interface{} // open for customized decoder } // NewIterator creates an empty Iterator instance func NewIterator(cfg API) *Iterator { return &Iterator{ cfg: cfg.(*frozenConfig), reader: nil, buf: nil, head: 0, tail: 0, depth: 0, } } // Parse creates an Iterator instance from io.Reader func Parse(cfg API, reader io.Reader, bufSize int) *Iterator { return &Iterator{ cfg: cfg.(*frozenConfig), reader: reader, buf: make([]byte, bufSize), head: 0, tail: 0, depth: 0, } } // ParseBytes creates an Iterator instance from byte array func ParseBytes(cfg API, input []byte) *Iterator { return &Iterator{ cfg: cfg.(*frozenConfig), reader: nil, buf: input, head: 0, tail: len(input), depth: 0, } } // ParseString creates an Iterator instance from string func ParseString(cfg API, input string) *Iterator { return ParseBytes(cfg, []byte(input)) } // Pool returns a pool can provide more iterator with same configuration func (iter *Iterator) Pool() IteratorPool { return iter.cfg } // Reset reuse iterator instance by specifying another reader func (iter *Iterator) Reset(reader io.Reader) *Iterator { iter.reader = reader iter.head = 0 iter.tail = 0 iter.depth = 0 return iter } // ResetBytes reuse iterator instance by specifying another byte array as input func (iter *Iterator) ResetBytes(input []byte) *Iterator { iter.reader = nil iter.buf = input iter.head = 0 iter.tail = len(input) iter.depth = 0 return iter } // WhatIsNext gets ValueType of relatively next json element func (iter *Iterator) WhatIsNext() ValueType { valueType := valueTypes[iter.nextToken()] iter.unreadByte() return valueType } func (iter *Iterator) skipWhitespacesWithoutLoadMore() bool { for i := iter.head; i < iter.tail; i++ { c := iter.buf[i] switch c { case ' ', '\n', '\t', '\r': continue } iter.head = i return false } return true } func (iter *Iterator) isObjectEnd() bool { c := iter.nextToken() if c == ',' { return false } if c == '}' { return true } iter.ReportError("isObjectEnd", "object ended prematurely, unexpected char "+string([]byte{c})) return true } func (iter *Iterator) nextToken() byte { // a variation of skip whitespaces, returning the next non-whitespace token for { for i := iter.head; i < iter.tail; i++ { c := iter.buf[i] switch c { case ' ', '\n', '\t', '\r': continue } iter.head = i + 1 return c } if !iter.loadMore() { return 0 } } } // ReportError record a error in iterator instance with current position. func (iter *Iterator) ReportError(operation string, msg string) { if iter.Error != nil { if iter.Error != io.EOF { return } } peekStart := iter.head - 10 if peekStart < 0 { peekStart = 0 } peekEnd := iter.head + 10 if peekEnd > iter.tail { peekEnd = iter.tail } parsing := string(iter.buf[peekStart:peekEnd]) contextStart := iter.head - 50 if contextStart < 0 { contextStart = 0 } contextEnd := iter.head + 50 if contextEnd > iter.tail { contextEnd = iter.tail } context := string(iter.buf[contextStart:contextEnd]) iter.Error = fmt.Errorf("%s: %s, error found in #%v byte of ...|%s|..., bigger context ...|%s|...", operation, msg, iter.head-peekStart, parsing, context) } // CurrentBuffer gets current buffer as string for debugging purpose func (iter *Iterator) CurrentBuffer() string { peekStart := iter.head - 10 if peekStart < 0 { peekStart = 0 } return fmt.Sprintf("parsing #%v byte, around ...|%s|..., whole buffer ...|%s|...", iter.head, string(iter.buf[peekStart:iter.head]), string(iter.buf[0:iter.tail])) } func (iter *Iterator) readByte() (ret byte) { if iter.head == iter.tail { if iter.loadMore() { ret = iter.buf[iter.head] iter.head++ return ret } return 0 } ret = iter.buf[iter.head] iter.head++ return ret } func (iter *Iterator) loadMore() bool { if iter.reader == nil { if iter.Error == nil { iter.head = iter.tail iter.Error = io.EOF } return false } if iter.captured != nil { iter.captured = append(iter.captured, iter.buf[iter.captureStartedAt:iter.tail]...) iter.captureStartedAt = 0 } for { n, err := iter.reader.Read(iter.buf) if n == 0 { if err != nil { if iter.Error == nil { iter.Error = err } return false } } else { iter.head = 0 iter.tail = n return true } } } func (iter *Iterator) unreadByte() { if iter.Error != nil { return } iter.head-- return } // Read read the next JSON element as generic interface{}. func (iter *Iterator) Read() interface{} { valueType := iter.WhatIsNext() switch valueType { case StringValue: return iter.ReadString() case NumberValue: if iter.cfg.configBeforeFrozen.UseNumber { return json.Number(iter.readNumberAsString()) } return iter.ReadFloat64() case NilValue: iter.skipFourBytes('n', 'u', 'l', 'l') return nil case BoolValue: return iter.ReadBool() case ArrayValue: arr := []interface{}{} iter.ReadArrayCB(func(iter *Iterator) bool { var elem interface{} iter.ReadVal(&elem) arr = append(arr, elem) return true }) return arr case ObjectValue: obj := map[string]interface{}{} iter.ReadMapCB(func(Iter *Iterator, field string) bool { var elem interface{} iter.ReadVal(&elem) obj[field] = elem return true }) return obj default: iter.ReportError("Read", fmt.Sprintf("unexpected value type: %v", valueType)) return nil } } // limit maximum depth of nesting, as allowed by https://tools.ietf.org/html/rfc7159#section-9 const maxDepth = 10000 func (iter *Iterator) incrementDepth() (success bool) { iter.depth++ if iter.depth <= maxDepth { return true } iter.ReportError("incrementDepth", "exceeded max depth") return false } func (iter *Iterator) decrementDepth() (success bool) { iter.depth-- if iter.depth >= 0 { return true } iter.ReportError("decrementDepth", "unexpected negative nesting") return false }
8,981
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/adapter.go
package jsoniter import ( "bytes" "io" ) // RawMessage to make replace json with jsoniter type RawMessage []byte // Unmarshal adapts to json/encoding Unmarshal API // // Unmarshal parses the JSON-encoded data and stores the result in the value pointed to by v. // Refer to https://godoc.org/encoding/json#Unmarshal for more information func Unmarshal(data []byte, v interface{}) error { return ConfigDefault.Unmarshal(data, v) } // UnmarshalFromString is a convenient method to read from string instead of []byte func UnmarshalFromString(str string, v interface{}) error { return ConfigDefault.UnmarshalFromString(str, v) } // Get quick method to get value from deeply nested JSON structure func Get(data []byte, path ...interface{}) Any { return ConfigDefault.Get(data, path...) } // Marshal adapts to json/encoding Marshal API // // Marshal returns the JSON encoding of v, adapts to json/encoding Marshal API // Refer to https://godoc.org/encoding/json#Marshal for more information func Marshal(v interface{}) ([]byte, error) { return ConfigDefault.Marshal(v) } // MarshalIndent same as json.MarshalIndent. Prefix is not supported. func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error) { return ConfigDefault.MarshalIndent(v, prefix, indent) } // MarshalToString convenient method to write as string instead of []byte func MarshalToString(v interface{}) (string, error) { return ConfigDefault.MarshalToString(v) } // NewDecoder adapts to json/stream NewDecoder API. // // NewDecoder returns a new decoder that reads from r. // // Instead of a json/encoding Decoder, an Decoder is returned // Refer to https://godoc.org/encoding/json#NewDecoder for more information func NewDecoder(reader io.Reader) *Decoder { return ConfigDefault.NewDecoder(reader) } // Decoder reads and decodes JSON values from an input stream. // Decoder provides identical APIs with json/stream Decoder (Token() and UseNumber() are in progress) type Decoder struct { iter *Iterator } // Decode decode JSON into interface{} func (adapter *Decoder) Decode(obj interface{}) error { if adapter.iter.head == adapter.iter.tail && adapter.iter.reader != nil { if !adapter.iter.loadMore() { return io.EOF } } adapter.iter.ReadVal(obj) err := adapter.iter.Error if err == io.EOF { return nil } return adapter.iter.Error } // More is there more? func (adapter *Decoder) More() bool { iter := adapter.iter if iter.Error != nil { return false } c := iter.nextToken() if c == 0 { return false } iter.unreadByte() return c != ']' && c != '}' } // Buffered remaining buffer func (adapter *Decoder) Buffered() io.Reader { remaining := adapter.iter.buf[adapter.iter.head:adapter.iter.tail] return bytes.NewReader(remaining) } // UseNumber causes the Decoder to unmarshal a number into an interface{} as a // Number instead of as a float64. func (adapter *Decoder) UseNumber() { cfg := adapter.iter.cfg.configBeforeFrozen cfg.UseNumber = true adapter.iter.cfg = cfg.frozeWithCacheReuse(adapter.iter.cfg.extraExtensions) } // DisallowUnknownFields causes the Decoder to return an error when the destination // is a struct and the input contains object keys which do not match any // non-ignored, exported fields in the destination. func (adapter *Decoder) DisallowUnknownFields() { cfg := adapter.iter.cfg.configBeforeFrozen cfg.DisallowUnknownFields = true adapter.iter.cfg = cfg.frozeWithCacheReuse(adapter.iter.cfg.extraExtensions) } // NewEncoder same as json.NewEncoder func NewEncoder(writer io.Writer) *Encoder { return ConfigDefault.NewEncoder(writer) } // Encoder same as json.Encoder type Encoder struct { stream *Stream } // Encode encode interface{} as JSON to io.Writer func (adapter *Encoder) Encode(val interface{}) error { adapter.stream.WriteVal(val) adapter.stream.WriteRaw("\n") adapter.stream.Flush() return adapter.stream.Error } // SetIndent set the indention. Prefix is not supported func (adapter *Encoder) SetIndent(prefix, indent string) { config := adapter.stream.cfg.configBeforeFrozen config.IndentionStep = len(indent) adapter.stream.cfg = config.frozeWithCacheReuse(adapter.stream.cfg.extraExtensions) } // SetEscapeHTML escape html by default, set to false to disable func (adapter *Encoder) SetEscapeHTML(escapeHTML bool) { config := adapter.stream.cfg.configBeforeFrozen config.EscapeHTML = escapeHTML adapter.stream.cfg = config.frozeWithCacheReuse(adapter.stream.cfg.extraExtensions) } // Valid reports whether data is a valid JSON encoding. func Valid(data []byte) bool { return ConfigDefault.Valid(data) }
8,982
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/any_nil.go
package jsoniter type nilAny struct { baseAny } func (any *nilAny) LastError() error { return nil } func (any *nilAny) ValueType() ValueType { return NilValue } func (any *nilAny) MustBeValid() Any { return any } func (any *nilAny) ToBool() bool { return false } func (any *nilAny) ToInt() int { return 0 } func (any *nilAny) ToInt32() int32 { return 0 } func (any *nilAny) ToInt64() int64 { return 0 } func (any *nilAny) ToUint() uint { return 0 } func (any *nilAny) ToUint32() uint32 { return 0 } func (any *nilAny) ToUint64() uint64 { return 0 } func (any *nilAny) ToFloat32() float32 { return 0 } func (any *nilAny) ToFloat64() float64 { return 0 } func (any *nilAny) ToString() string { return "" } func (any *nilAny) WriteTo(stream *Stream) { stream.WriteNil() } func (any *nilAny) Parse() *Iterator { return nil } func (any *nilAny) GetInterface() interface{} { return nil }
8,983
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/reflect_native.go
package jsoniter import ( "encoding/base64" "reflect" "strconv" "unsafe" "github.com/modern-go/reflect2" ) const ptrSize = 32 << uintptr(^uintptr(0)>>63) func createEncoderOfNative(ctx *ctx, typ reflect2.Type) ValEncoder { if typ.Kind() == reflect.Slice && typ.(reflect2.SliceType).Elem().Kind() == reflect.Uint8 { sliceDecoder := decoderOfSlice(ctx, typ) return &base64Codec{sliceDecoder: sliceDecoder} } typeName := typ.String() kind := typ.Kind() switch kind { case reflect.String: if typeName != "string" { return encoderOfType(ctx, reflect2.TypeOfPtr((*string)(nil)).Elem()) } return &stringCodec{} case reflect.Int: if typeName != "int" { return encoderOfType(ctx, reflect2.TypeOfPtr((*int)(nil)).Elem()) } if strconv.IntSize == 32 { return &int32Codec{} } return &int64Codec{} case reflect.Int8: if typeName != "int8" { return encoderOfType(ctx, reflect2.TypeOfPtr((*int8)(nil)).Elem()) } return &int8Codec{} case reflect.Int16: if typeName != "int16" { return encoderOfType(ctx, reflect2.TypeOfPtr((*int16)(nil)).Elem()) } return &int16Codec{} case reflect.Int32: if typeName != "int32" { return encoderOfType(ctx, reflect2.TypeOfPtr((*int32)(nil)).Elem()) } return &int32Codec{} case reflect.Int64: if typeName != "int64" { return encoderOfType(ctx, reflect2.TypeOfPtr((*int64)(nil)).Elem()) } return &int64Codec{} case reflect.Uint: if typeName != "uint" { return encoderOfType(ctx, reflect2.TypeOfPtr((*uint)(nil)).Elem()) } if strconv.IntSize == 32 { return &uint32Codec{} } return &uint64Codec{} case reflect.Uint8: if typeName != "uint8" { return encoderOfType(ctx, reflect2.TypeOfPtr((*uint8)(nil)).Elem()) } return &uint8Codec{} case reflect.Uint16: if typeName != "uint16" { return encoderOfType(ctx, reflect2.TypeOfPtr((*uint16)(nil)).Elem()) } return &uint16Codec{} case reflect.Uint32: if typeName != "uint32" { return encoderOfType(ctx, reflect2.TypeOfPtr((*uint32)(nil)).Elem()) } return &uint32Codec{} case reflect.Uintptr: if typeName != "uintptr" { return encoderOfType(ctx, reflect2.TypeOfPtr((*uintptr)(nil)).Elem()) } if ptrSize == 32 { return &uint32Codec{} } return &uint64Codec{} case reflect.Uint64: if typeName != "uint64" { return encoderOfType(ctx, reflect2.TypeOfPtr((*uint64)(nil)).Elem()) } return &uint64Codec{} case reflect.Float32: if typeName != "float32" { return encoderOfType(ctx, reflect2.TypeOfPtr((*float32)(nil)).Elem()) } return &float32Codec{} case reflect.Float64: if typeName != "float64" { return encoderOfType(ctx, reflect2.TypeOfPtr((*float64)(nil)).Elem()) } return &float64Codec{} case reflect.Bool: if typeName != "bool" { return encoderOfType(ctx, reflect2.TypeOfPtr((*bool)(nil)).Elem()) } return &boolCodec{} } return nil } func createDecoderOfNative(ctx *ctx, typ reflect2.Type) ValDecoder { if typ.Kind() == reflect.Slice && typ.(reflect2.SliceType).Elem().Kind() == reflect.Uint8 { sliceDecoder := decoderOfSlice(ctx, typ) return &base64Codec{sliceDecoder: sliceDecoder} } typeName := typ.String() switch typ.Kind() { case reflect.String: if typeName != "string" { return decoderOfType(ctx, reflect2.TypeOfPtr((*string)(nil)).Elem()) } return &stringCodec{} case reflect.Int: if typeName != "int" { return decoderOfType(ctx, reflect2.TypeOfPtr((*int)(nil)).Elem()) } if strconv.IntSize == 32 { return &int32Codec{} } return &int64Codec{} case reflect.Int8: if typeName != "int8" { return decoderOfType(ctx, reflect2.TypeOfPtr((*int8)(nil)).Elem()) } return &int8Codec{} case reflect.Int16: if typeName != "int16" { return decoderOfType(ctx, reflect2.TypeOfPtr((*int16)(nil)).Elem()) } return &int16Codec{} case reflect.Int32: if typeName != "int32" { return decoderOfType(ctx, reflect2.TypeOfPtr((*int32)(nil)).Elem()) } return &int32Codec{} case reflect.Int64: if typeName != "int64" { return decoderOfType(ctx, reflect2.TypeOfPtr((*int64)(nil)).Elem()) } return &int64Codec{} case reflect.Uint: if typeName != "uint" { return decoderOfType(ctx, reflect2.TypeOfPtr((*uint)(nil)).Elem()) } if strconv.IntSize == 32 { return &uint32Codec{} } return &uint64Codec{} case reflect.Uint8: if typeName != "uint8" { return decoderOfType(ctx, reflect2.TypeOfPtr((*uint8)(nil)).Elem()) } return &uint8Codec{} case reflect.Uint16: if typeName != "uint16" { return decoderOfType(ctx, reflect2.TypeOfPtr((*uint16)(nil)).Elem()) } return &uint16Codec{} case reflect.Uint32: if typeName != "uint32" { return decoderOfType(ctx, reflect2.TypeOfPtr((*uint32)(nil)).Elem()) } return &uint32Codec{} case reflect.Uintptr: if typeName != "uintptr" { return decoderOfType(ctx, reflect2.TypeOfPtr((*uintptr)(nil)).Elem()) } if ptrSize == 32 { return &uint32Codec{} } return &uint64Codec{} case reflect.Uint64: if typeName != "uint64" { return decoderOfType(ctx, reflect2.TypeOfPtr((*uint64)(nil)).Elem()) } return &uint64Codec{} case reflect.Float32: if typeName != "float32" { return decoderOfType(ctx, reflect2.TypeOfPtr((*float32)(nil)).Elem()) } return &float32Codec{} case reflect.Float64: if typeName != "float64" { return decoderOfType(ctx, reflect2.TypeOfPtr((*float64)(nil)).Elem()) } return &float64Codec{} case reflect.Bool: if typeName != "bool" { return decoderOfType(ctx, reflect2.TypeOfPtr((*bool)(nil)).Elem()) } return &boolCodec{} } return nil } type stringCodec struct { } func (codec *stringCodec) Decode(ptr unsafe.Pointer, iter *Iterator) { *((*string)(ptr)) = iter.ReadString() } func (codec *stringCodec) Encode(ptr unsafe.Pointer, stream *Stream) { str := *((*string)(ptr)) stream.WriteString(str) } func (codec *stringCodec) IsEmpty(ptr unsafe.Pointer) bool { return *((*string)(ptr)) == "" } type int8Codec struct { } func (codec *int8Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.ReadNil() { *((*int8)(ptr)) = iter.ReadInt8() } } func (codec *int8Codec) Encode(ptr unsafe.Pointer, stream *Stream) { stream.WriteInt8(*((*int8)(ptr))) } func (codec *int8Codec) IsEmpty(ptr unsafe.Pointer) bool { return *((*int8)(ptr)) == 0 } type int16Codec struct { } func (codec *int16Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.ReadNil() { *((*int16)(ptr)) = iter.ReadInt16() } } func (codec *int16Codec) Encode(ptr unsafe.Pointer, stream *Stream) { stream.WriteInt16(*((*int16)(ptr))) } func (codec *int16Codec) IsEmpty(ptr unsafe.Pointer) bool { return *((*int16)(ptr)) == 0 } type int32Codec struct { } func (codec *int32Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.ReadNil() { *((*int32)(ptr)) = iter.ReadInt32() } } func (codec *int32Codec) Encode(ptr unsafe.Pointer, stream *Stream) { stream.WriteInt32(*((*int32)(ptr))) } func (codec *int32Codec) IsEmpty(ptr unsafe.Pointer) bool { return *((*int32)(ptr)) == 0 } type int64Codec struct { } func (codec *int64Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.ReadNil() { *((*int64)(ptr)) = iter.ReadInt64() } } func (codec *int64Codec) Encode(ptr unsafe.Pointer, stream *Stream) { stream.WriteInt64(*((*int64)(ptr))) } func (codec *int64Codec) IsEmpty(ptr unsafe.Pointer) bool { return *((*int64)(ptr)) == 0 } type uint8Codec struct { } func (codec *uint8Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.ReadNil() { *((*uint8)(ptr)) = iter.ReadUint8() } } func (codec *uint8Codec) Encode(ptr unsafe.Pointer, stream *Stream) { stream.WriteUint8(*((*uint8)(ptr))) } func (codec *uint8Codec) IsEmpty(ptr unsafe.Pointer) bool { return *((*uint8)(ptr)) == 0 } type uint16Codec struct { } func (codec *uint16Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.ReadNil() { *((*uint16)(ptr)) = iter.ReadUint16() } } func (codec *uint16Codec) Encode(ptr unsafe.Pointer, stream *Stream) { stream.WriteUint16(*((*uint16)(ptr))) } func (codec *uint16Codec) IsEmpty(ptr unsafe.Pointer) bool { return *((*uint16)(ptr)) == 0 } type uint32Codec struct { } func (codec *uint32Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.ReadNil() { *((*uint32)(ptr)) = iter.ReadUint32() } } func (codec *uint32Codec) Encode(ptr unsafe.Pointer, stream *Stream) { stream.WriteUint32(*((*uint32)(ptr))) } func (codec *uint32Codec) IsEmpty(ptr unsafe.Pointer) bool { return *((*uint32)(ptr)) == 0 } type uint64Codec struct { } func (codec *uint64Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.ReadNil() { *((*uint64)(ptr)) = iter.ReadUint64() } } func (codec *uint64Codec) Encode(ptr unsafe.Pointer, stream *Stream) { stream.WriteUint64(*((*uint64)(ptr))) } func (codec *uint64Codec) IsEmpty(ptr unsafe.Pointer) bool { return *((*uint64)(ptr)) == 0 } type float32Codec struct { } func (codec *float32Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.ReadNil() { *((*float32)(ptr)) = iter.ReadFloat32() } } func (codec *float32Codec) Encode(ptr unsafe.Pointer, stream *Stream) { stream.WriteFloat32(*((*float32)(ptr))) } func (codec *float32Codec) IsEmpty(ptr unsafe.Pointer) bool { return *((*float32)(ptr)) == 0 } type float64Codec struct { } func (codec *float64Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.ReadNil() { *((*float64)(ptr)) = iter.ReadFloat64() } } func (codec *float64Codec) Encode(ptr unsafe.Pointer, stream *Stream) { stream.WriteFloat64(*((*float64)(ptr))) } func (codec *float64Codec) IsEmpty(ptr unsafe.Pointer) bool { return *((*float64)(ptr)) == 0 } type boolCodec struct { } func (codec *boolCodec) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.ReadNil() { *((*bool)(ptr)) = iter.ReadBool() } } func (codec *boolCodec) Encode(ptr unsafe.Pointer, stream *Stream) { stream.WriteBool(*((*bool)(ptr))) } func (codec *boolCodec) IsEmpty(ptr unsafe.Pointer) bool { return !(*((*bool)(ptr))) } type base64Codec struct { sliceType *reflect2.UnsafeSliceType sliceDecoder ValDecoder } func (codec *base64Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { if iter.ReadNil() { codec.sliceType.UnsafeSetNil(ptr) return } switch iter.WhatIsNext() { case StringValue: src := iter.ReadString() dst, err := base64.StdEncoding.DecodeString(src) if err != nil { iter.ReportError("decode base64", err.Error()) } else { codec.sliceType.UnsafeSet(ptr, unsafe.Pointer(&dst)) } case ArrayValue: codec.sliceDecoder.Decode(ptr, iter) default: iter.ReportError("base64Codec", "invalid input") } } func (codec *base64Codec) Encode(ptr unsafe.Pointer, stream *Stream) { if codec.sliceType.UnsafeIsNil(ptr) { stream.WriteNil() return } src := *((*[]byte)(ptr)) encoding := base64.StdEncoding stream.writeByte('"') if len(src) != 0 { size := encoding.EncodedLen(len(src)) buf := make([]byte, size) encoding.Encode(buf, src) stream.buf = append(stream.buf, buf...) } stream.writeByte('"') } func (codec *base64Codec) IsEmpty(ptr unsafe.Pointer) bool { return len(*((*[]byte)(ptr))) == 0 }
8,984
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/reflect_array.go
package jsoniter import ( "fmt" "github.com/modern-go/reflect2" "io" "unsafe" ) func decoderOfArray(ctx *ctx, typ reflect2.Type) ValDecoder { arrayType := typ.(*reflect2.UnsafeArrayType) decoder := decoderOfType(ctx.append("[arrayElem]"), arrayType.Elem()) return &arrayDecoder{arrayType, decoder} } func encoderOfArray(ctx *ctx, typ reflect2.Type) ValEncoder { arrayType := typ.(*reflect2.UnsafeArrayType) if arrayType.Len() == 0 { return emptyArrayEncoder{} } encoder := encoderOfType(ctx.append("[arrayElem]"), arrayType.Elem()) return &arrayEncoder{arrayType, encoder} } type emptyArrayEncoder struct{} func (encoder emptyArrayEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { stream.WriteEmptyArray() } func (encoder emptyArrayEncoder) IsEmpty(ptr unsafe.Pointer) bool { return true } type arrayEncoder struct { arrayType *reflect2.UnsafeArrayType elemEncoder ValEncoder } func (encoder *arrayEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { stream.WriteArrayStart() elemPtr := unsafe.Pointer(ptr) encoder.elemEncoder.Encode(elemPtr, stream) for i := 1; i < encoder.arrayType.Len(); i++ { stream.WriteMore() elemPtr = encoder.arrayType.UnsafeGetIndex(ptr, i) encoder.elemEncoder.Encode(elemPtr, stream) } stream.WriteArrayEnd() if stream.Error != nil && stream.Error != io.EOF { stream.Error = fmt.Errorf("%v: %s", encoder.arrayType, stream.Error.Error()) } } func (encoder *arrayEncoder) IsEmpty(ptr unsafe.Pointer) bool { return false } type arrayDecoder struct { arrayType *reflect2.UnsafeArrayType elemDecoder ValDecoder } func (decoder *arrayDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { decoder.doDecode(ptr, iter) if iter.Error != nil && iter.Error != io.EOF { iter.Error = fmt.Errorf("%v: %s", decoder.arrayType, iter.Error.Error()) } } func (decoder *arrayDecoder) doDecode(ptr unsafe.Pointer, iter *Iterator) { c := iter.nextToken() arrayType := decoder.arrayType if c == 'n' { iter.skipThreeBytes('u', 'l', 'l') return } if c != '[' { iter.ReportError("decode array", "expect [ or n, but found "+string([]byte{c})) return } c = iter.nextToken() if c == ']' { return } iter.unreadByte() elemPtr := arrayType.UnsafeGetIndex(ptr, 0) decoder.elemDecoder.Decode(elemPtr, iter) length := 1 for c = iter.nextToken(); c == ','; c = iter.nextToken() { if length >= arrayType.Len() { iter.Skip() continue } idx := length length += 1 elemPtr = arrayType.UnsafeGetIndex(ptr, idx) decoder.elemDecoder.Decode(elemPtr, iter) } if c != ']' { iter.ReportError("decode array", "expect ], but found "+string([]byte{c})) return } }
8,985
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/any_uint32.go
package jsoniter import ( "strconv" ) type uint32Any struct { baseAny val uint32 } func (any *uint32Any) LastError() error { return nil } func (any *uint32Any) ValueType() ValueType { return NumberValue } func (any *uint32Any) MustBeValid() Any { return any } func (any *uint32Any) ToBool() bool { return any.val != 0 } func (any *uint32Any) ToInt() int { return int(any.val) } func (any *uint32Any) ToInt32() int32 { return int32(any.val) } func (any *uint32Any) ToInt64() int64 { return int64(any.val) } func (any *uint32Any) ToUint() uint { return uint(any.val) } func (any *uint32Any) ToUint32() uint32 { return any.val } func (any *uint32Any) ToUint64() uint64 { return uint64(any.val) } func (any *uint32Any) ToFloat32() float32 { return float32(any.val) } func (any *uint32Any) ToFloat64() float64 { return float64(any.val) } func (any *uint32Any) ToString() string { return strconv.FormatInt(int64(any.val), 10) } func (any *uint32Any) WriteTo(stream *Stream) { stream.WriteUint32(any.val) } func (any *uint32Any) Parse() *Iterator { return nil } func (any *uint32Any) GetInterface() interface{} { return any.val }
8,986
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/reflect_json_raw_message.go
package jsoniter import ( "encoding/json" "github.com/modern-go/reflect2" "unsafe" ) var jsonRawMessageType = reflect2.TypeOfPtr((*json.RawMessage)(nil)).Elem() var jsoniterRawMessageType = reflect2.TypeOfPtr((*RawMessage)(nil)).Elem() func createEncoderOfJsonRawMessage(ctx *ctx, typ reflect2.Type) ValEncoder { if typ == jsonRawMessageType { return &jsonRawMessageCodec{} } if typ == jsoniterRawMessageType { return &jsoniterRawMessageCodec{} } return nil } func createDecoderOfJsonRawMessage(ctx *ctx, typ reflect2.Type) ValDecoder { if typ == jsonRawMessageType { return &jsonRawMessageCodec{} } if typ == jsoniterRawMessageType { return &jsoniterRawMessageCodec{} } return nil } type jsonRawMessageCodec struct { } func (codec *jsonRawMessageCodec) Decode(ptr unsafe.Pointer, iter *Iterator) { *((*json.RawMessage)(ptr)) = json.RawMessage(iter.SkipAndReturnBytes()) } func (codec *jsonRawMessageCodec) Encode(ptr unsafe.Pointer, stream *Stream) { stream.WriteRaw(string(*((*json.RawMessage)(ptr)))) } func (codec *jsonRawMessageCodec) IsEmpty(ptr unsafe.Pointer) bool { return len(*((*json.RawMessage)(ptr))) == 0 } type jsoniterRawMessageCodec struct { } func (codec *jsoniterRawMessageCodec) Decode(ptr unsafe.Pointer, iter *Iterator) { *((*RawMessage)(ptr)) = RawMessage(iter.SkipAndReturnBytes()) } func (codec *jsoniterRawMessageCodec) Encode(ptr unsafe.Pointer, stream *Stream) { stream.WriteRaw(string(*((*RawMessage)(ptr)))) } func (codec *jsoniterRawMessageCodec) IsEmpty(ptr unsafe.Pointer) bool { return len(*((*RawMessage)(ptr))) == 0 }
8,987
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/any_number.go
package jsoniter import ( "io" "unsafe" ) type numberLazyAny struct { baseAny cfg *frozenConfig buf []byte err error } func (any *numberLazyAny) ValueType() ValueType { return NumberValue } func (any *numberLazyAny) MustBeValid() Any { return any } func (any *numberLazyAny) LastError() error { return any.err } func (any *numberLazyAny) ToBool() bool { return any.ToFloat64() != 0 } func (any *numberLazyAny) ToInt() int { iter := any.cfg.BorrowIterator(any.buf) defer any.cfg.ReturnIterator(iter) val := iter.ReadInt() if iter.Error != nil && iter.Error != io.EOF { any.err = iter.Error } return val } func (any *numberLazyAny) ToInt32() int32 { iter := any.cfg.BorrowIterator(any.buf) defer any.cfg.ReturnIterator(iter) val := iter.ReadInt32() if iter.Error != nil && iter.Error != io.EOF { any.err = iter.Error } return val } func (any *numberLazyAny) ToInt64() int64 { iter := any.cfg.BorrowIterator(any.buf) defer any.cfg.ReturnIterator(iter) val := iter.ReadInt64() if iter.Error != nil && iter.Error != io.EOF { any.err = iter.Error } return val } func (any *numberLazyAny) ToUint() uint { iter := any.cfg.BorrowIterator(any.buf) defer any.cfg.ReturnIterator(iter) val := iter.ReadUint() if iter.Error != nil && iter.Error != io.EOF { any.err = iter.Error } return val } func (any *numberLazyAny) ToUint32() uint32 { iter := any.cfg.BorrowIterator(any.buf) defer any.cfg.ReturnIterator(iter) val := iter.ReadUint32() if iter.Error != nil && iter.Error != io.EOF { any.err = iter.Error } return val } func (any *numberLazyAny) ToUint64() uint64 { iter := any.cfg.BorrowIterator(any.buf) defer any.cfg.ReturnIterator(iter) val := iter.ReadUint64() if iter.Error != nil && iter.Error != io.EOF { any.err = iter.Error } return val } func (any *numberLazyAny) ToFloat32() float32 { iter := any.cfg.BorrowIterator(any.buf) defer any.cfg.ReturnIterator(iter) val := iter.ReadFloat32() if iter.Error != nil && iter.Error != io.EOF { any.err = iter.Error } return val } func (any *numberLazyAny) ToFloat64() float64 { iter := any.cfg.BorrowIterator(any.buf) defer any.cfg.ReturnIterator(iter) val := iter.ReadFloat64() if iter.Error != nil && iter.Error != io.EOF { any.err = iter.Error } return val } func (any *numberLazyAny) ToString() string { return *(*string)(unsafe.Pointer(&any.buf)) } func (any *numberLazyAny) WriteTo(stream *Stream) { stream.Write(any.buf) } func (any *numberLazyAny) GetInterface() interface{} { iter := any.cfg.BorrowIterator(any.buf) defer any.cfg.ReturnIterator(iter) return iter.Read() }
8,988
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/any_bool.go
package jsoniter type trueAny struct { baseAny } func (any *trueAny) LastError() error { return nil } func (any *trueAny) ToBool() bool { return true } func (any *trueAny) ToInt() int { return 1 } func (any *trueAny) ToInt32() int32 { return 1 } func (any *trueAny) ToInt64() int64 { return 1 } func (any *trueAny) ToUint() uint { return 1 } func (any *trueAny) ToUint32() uint32 { return 1 } func (any *trueAny) ToUint64() uint64 { return 1 } func (any *trueAny) ToFloat32() float32 { return 1 } func (any *trueAny) ToFloat64() float64 { return 1 } func (any *trueAny) ToString() string { return "true" } func (any *trueAny) WriteTo(stream *Stream) { stream.WriteTrue() } func (any *trueAny) Parse() *Iterator { return nil } func (any *trueAny) GetInterface() interface{} { return true } func (any *trueAny) ValueType() ValueType { return BoolValue } func (any *trueAny) MustBeValid() Any { return any } type falseAny struct { baseAny } func (any *falseAny) LastError() error { return nil } func (any *falseAny) ToBool() bool { return false } func (any *falseAny) ToInt() int { return 0 } func (any *falseAny) ToInt32() int32 { return 0 } func (any *falseAny) ToInt64() int64 { return 0 } func (any *falseAny) ToUint() uint { return 0 } func (any *falseAny) ToUint32() uint32 { return 0 } func (any *falseAny) ToUint64() uint64 { return 0 } func (any *falseAny) ToFloat32() float32 { return 0 } func (any *falseAny) ToFloat64() float64 { return 0 } func (any *falseAny) ToString() string { return "false" } func (any *falseAny) WriteTo(stream *Stream) { stream.WriteFalse() } func (any *falseAny) Parse() *Iterator { return nil } func (any *falseAny) GetInterface() interface{} { return false } func (any *falseAny) ValueType() ValueType { return BoolValue } func (any *falseAny) MustBeValid() Any { return any }
8,989
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/iter_skip_strict.go
//+build !jsoniter_sloppy package jsoniter import ( "fmt" "io" ) func (iter *Iterator) skipNumber() { if !iter.trySkipNumber() { iter.unreadByte() if iter.Error != nil && iter.Error != io.EOF { return } iter.ReadFloat64() if iter.Error != nil && iter.Error != io.EOF { iter.Error = nil iter.ReadBigFloat() } } } func (iter *Iterator) trySkipNumber() bool { dotFound := false for i := iter.head; i < iter.tail; i++ { c := iter.buf[i] switch c { case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': case '.': if dotFound { iter.ReportError("validateNumber", `more than one dot found in number`) return true // already failed } if i+1 == iter.tail { return false } c = iter.buf[i+1] switch c { case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': default: iter.ReportError("validateNumber", `missing digit after dot`) return true // already failed } dotFound = true default: switch c { case ',', ']', '}', ' ', '\t', '\n', '\r': if iter.head == i { return false // if - without following digits } iter.head = i return true // must be valid } return false // may be invalid } } return false } func (iter *Iterator) skipString() { if !iter.trySkipString() { iter.unreadByte() iter.ReadString() } } func (iter *Iterator) trySkipString() bool { for i := iter.head; i < iter.tail; i++ { c := iter.buf[i] if c == '"' { iter.head = i + 1 return true // valid } else if c == '\\' { return false } else if c < ' ' { iter.ReportError("trySkipString", fmt.Sprintf(`invalid control character found: %d`, c)) return true // already failed } } return false } func (iter *Iterator) skipObject() { iter.unreadByte() iter.ReadObjectCB(func(iter *Iterator, field string) bool { iter.Skip() return true }) } func (iter *Iterator) skipArray() { iter.unreadByte() iter.ReadArrayCB(func(iter *Iterator) bool { iter.Skip() return true }) }
8,990
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/any_str.go
package jsoniter import ( "fmt" "strconv" ) type stringAny struct { baseAny val string } func (any *stringAny) Get(path ...interface{}) Any { if len(path) == 0 { return any } return &invalidAny{baseAny{}, fmt.Errorf("GetIndex %v from simple value", path)} } func (any *stringAny) Parse() *Iterator { return nil } func (any *stringAny) ValueType() ValueType { return StringValue } func (any *stringAny) MustBeValid() Any { return any } func (any *stringAny) LastError() error { return nil } func (any *stringAny) ToBool() bool { str := any.ToString() if str == "0" { return false } for _, c := range str { switch c { case ' ', '\n', '\r', '\t': default: return true } } return false } func (any *stringAny) ToInt() int { return int(any.ToInt64()) } func (any *stringAny) ToInt32() int32 { return int32(any.ToInt64()) } func (any *stringAny) ToInt64() int64 { if any.val == "" { return 0 } flag := 1 startPos := 0 if any.val[0] == '+' || any.val[0] == '-' { startPos = 1 } if any.val[0] == '-' { flag = -1 } endPos := startPos for i := startPos; i < len(any.val); i++ { if any.val[i] >= '0' && any.val[i] <= '9' { endPos = i + 1 } else { break } } parsed, _ := strconv.ParseInt(any.val[startPos:endPos], 10, 64) return int64(flag) * parsed } func (any *stringAny) ToUint() uint { return uint(any.ToUint64()) } func (any *stringAny) ToUint32() uint32 { return uint32(any.ToUint64()) } func (any *stringAny) ToUint64() uint64 { if any.val == "" { return 0 } startPos := 0 if any.val[0] == '-' { return 0 } if any.val[0] == '+' { startPos = 1 } endPos := startPos for i := startPos; i < len(any.val); i++ { if any.val[i] >= '0' && any.val[i] <= '9' { endPos = i + 1 } else { break } } parsed, _ := strconv.ParseUint(any.val[startPos:endPos], 10, 64) return parsed } func (any *stringAny) ToFloat32() float32 { return float32(any.ToFloat64()) } func (any *stringAny) ToFloat64() float64 { if len(any.val) == 0 { return 0 } // first char invalid if any.val[0] != '+' && any.val[0] != '-' && (any.val[0] > '9' || any.val[0] < '0') { return 0 } // extract valid num expression from string // eg 123true => 123, -12.12xxa => -12.12 endPos := 1 for i := 1; i < len(any.val); i++ { if any.val[i] == '.' || any.val[i] == 'e' || any.val[i] == 'E' || any.val[i] == '+' || any.val[i] == '-' { endPos = i + 1 continue } // end position is the first char which is not digit if any.val[i] >= '0' && any.val[i] <= '9' { endPos = i + 1 } else { endPos = i break } } parsed, _ := strconv.ParseFloat(any.val[:endPos], 64) return parsed } func (any *stringAny) ToString() string { return any.val } func (any *stringAny) WriteTo(stream *Stream) { stream.WriteString(any.val) } func (any *stringAny) GetInterface() interface{} { return any.val }
8,991
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/iter_str.go
package jsoniter import ( "fmt" "unicode/utf16" ) // ReadString read string from iterator func (iter *Iterator) ReadString() (ret string) { c := iter.nextToken() if c == '"' { for i := iter.head; i < iter.tail; i++ { c := iter.buf[i] if c == '"' { ret = string(iter.buf[iter.head:i]) iter.head = i + 1 return ret } else if c == '\\' { break } else if c < ' ' { iter.ReportError("ReadString", fmt.Sprintf(`invalid control character found: %d`, c)) return } } return iter.readStringSlowPath() } else if c == 'n' { iter.skipThreeBytes('u', 'l', 'l') return "" } iter.ReportError("ReadString", `expects " or n, but found `+string([]byte{c})) return } func (iter *Iterator) readStringSlowPath() (ret string) { var str []byte var c byte for iter.Error == nil { c = iter.readByte() if c == '"' { return string(str) } if c == '\\' { c = iter.readByte() str = iter.readEscapedChar(c, str) } else { str = append(str, c) } } iter.ReportError("readStringSlowPath", "unexpected end of input") return } func (iter *Iterator) readEscapedChar(c byte, str []byte) []byte { switch c { case 'u': r := iter.readU4() if utf16.IsSurrogate(r) { c = iter.readByte() if iter.Error != nil { return nil } if c != '\\' { iter.unreadByte() str = appendRune(str, r) return str } c = iter.readByte() if iter.Error != nil { return nil } if c != 'u' { str = appendRune(str, r) return iter.readEscapedChar(c, str) } r2 := iter.readU4() if iter.Error != nil { return nil } combined := utf16.DecodeRune(r, r2) if combined == '\uFFFD' { str = appendRune(str, r) str = appendRune(str, r2) } else { str = appendRune(str, combined) } } else { str = appendRune(str, r) } case '"': str = append(str, '"') case '\\': str = append(str, '\\') case '/': str = append(str, '/') case 'b': str = append(str, '\b') case 'f': str = append(str, '\f') case 'n': str = append(str, '\n') case 'r': str = append(str, '\r') case 't': str = append(str, '\t') default: iter.ReportError("readEscapedChar", `invalid escape char after \`) return nil } return str } // ReadStringAsSlice read string from iterator without copying into string form. // The []byte can not be kept, as it will change after next iterator call. func (iter *Iterator) ReadStringAsSlice() (ret []byte) { c := iter.nextToken() if c == '"' { for i := iter.head; i < iter.tail; i++ { // require ascii string and no escape // for: field name, base64, number if iter.buf[i] == '"' { // fast path: reuse the underlying buffer ret = iter.buf[iter.head:i] iter.head = i + 1 return ret } } readLen := iter.tail - iter.head copied := make([]byte, readLen, readLen*2) copy(copied, iter.buf[iter.head:iter.tail]) iter.head = iter.tail for iter.Error == nil { c := iter.readByte() if c == '"' { return copied } copied = append(copied, c) } return copied } iter.ReportError("ReadStringAsSlice", `expects " or n, but found `+string([]byte{c})) return } func (iter *Iterator) readU4() (ret rune) { for i := 0; i < 4; i++ { c := iter.readByte() if iter.Error != nil { return } if c >= '0' && c <= '9' { ret = ret*16 + rune(c-'0') } else if c >= 'a' && c <= 'f' { ret = ret*16 + rune(c-'a'+10) } else if c >= 'A' && c <= 'F' { ret = ret*16 + rune(c-'A'+10) } else { iter.ReportError("readU4", "expects 0~9 or a~f, but found "+string([]byte{c})) return } } return ret } const ( t1 = 0x00 // 0000 0000 tx = 0x80 // 1000 0000 t2 = 0xC0 // 1100 0000 t3 = 0xE0 // 1110 0000 t4 = 0xF0 // 1111 0000 t5 = 0xF8 // 1111 1000 maskx = 0x3F // 0011 1111 mask2 = 0x1F // 0001 1111 mask3 = 0x0F // 0000 1111 mask4 = 0x07 // 0000 0111 rune1Max = 1<<7 - 1 rune2Max = 1<<11 - 1 rune3Max = 1<<16 - 1 surrogateMin = 0xD800 surrogateMax = 0xDFFF maxRune = '\U0010FFFF' // Maximum valid Unicode code point. runeError = '\uFFFD' // the "error" Rune or "Unicode replacement character" ) func appendRune(p []byte, r rune) []byte { // Negative values are erroneous. Making it unsigned addresses the problem. switch i := uint32(r); { case i <= rune1Max: p = append(p, byte(r)) return p case i <= rune2Max: p = append(p, t2|byte(r>>6)) p = append(p, tx|byte(r)&maskx) return p case i > maxRune, surrogateMin <= i && i <= surrogateMax: r = runeError fallthrough case i <= rune3Max: p = append(p, t3|byte(r>>12)) p = append(p, tx|byte(r>>6)&maskx) p = append(p, tx|byte(r)&maskx) return p default: p = append(p, t4|byte(r>>18)) p = append(p, tx|byte(r>>12)&maskx) p = append(p, tx|byte(r>>6)&maskx) p = append(p, tx|byte(r)&maskx) return p } }
8,992
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/iter_int.go
package jsoniter import ( "math" "strconv" ) var intDigits []int8 const uint32SafeToMultiply10 = uint32(0xffffffff)/10 - 1 const uint64SafeToMultiple10 = uint64(0xffffffffffffffff)/10 - 1 func init() { intDigits = make([]int8, 256) for i := 0; i < len(intDigits); i++ { intDigits[i] = invalidCharForNumber } for i := int8('0'); i <= int8('9'); i++ { intDigits[i] = i - int8('0') } } // ReadUint read uint func (iter *Iterator) ReadUint() uint { if strconv.IntSize == 32 { return uint(iter.ReadUint32()) } return uint(iter.ReadUint64()) } // ReadInt read int func (iter *Iterator) ReadInt() int { if strconv.IntSize == 32 { return int(iter.ReadInt32()) } return int(iter.ReadInt64()) } // ReadInt8 read int8 func (iter *Iterator) ReadInt8() (ret int8) { c := iter.nextToken() if c == '-' { val := iter.readUint32(iter.readByte()) if val > math.MaxInt8+1 { iter.ReportError("ReadInt8", "overflow: "+strconv.FormatInt(int64(val), 10)) return } return -int8(val) } val := iter.readUint32(c) if val > math.MaxInt8 { iter.ReportError("ReadInt8", "overflow: "+strconv.FormatInt(int64(val), 10)) return } return int8(val) } // ReadUint8 read uint8 func (iter *Iterator) ReadUint8() (ret uint8) { val := iter.readUint32(iter.nextToken()) if val > math.MaxUint8 { iter.ReportError("ReadUint8", "overflow: "+strconv.FormatInt(int64(val), 10)) return } return uint8(val) } // ReadInt16 read int16 func (iter *Iterator) ReadInt16() (ret int16) { c := iter.nextToken() if c == '-' { val := iter.readUint32(iter.readByte()) if val > math.MaxInt16+1 { iter.ReportError("ReadInt16", "overflow: "+strconv.FormatInt(int64(val), 10)) return } return -int16(val) } val := iter.readUint32(c) if val > math.MaxInt16 { iter.ReportError("ReadInt16", "overflow: "+strconv.FormatInt(int64(val), 10)) return } return int16(val) } // ReadUint16 read uint16 func (iter *Iterator) ReadUint16() (ret uint16) { val := iter.readUint32(iter.nextToken()) if val > math.MaxUint16 { iter.ReportError("ReadUint16", "overflow: "+strconv.FormatInt(int64(val), 10)) return } return uint16(val) } // ReadInt32 read int32 func (iter *Iterator) ReadInt32() (ret int32) { c := iter.nextToken() if c == '-' { val := iter.readUint32(iter.readByte()) if val > math.MaxInt32+1 { iter.ReportError("ReadInt32", "overflow: "+strconv.FormatInt(int64(val), 10)) return } return -int32(val) } val := iter.readUint32(c) if val > math.MaxInt32 { iter.ReportError("ReadInt32", "overflow: "+strconv.FormatInt(int64(val), 10)) return } return int32(val) } // ReadUint32 read uint32 func (iter *Iterator) ReadUint32() (ret uint32) { return iter.readUint32(iter.nextToken()) } func (iter *Iterator) readUint32(c byte) (ret uint32) { ind := intDigits[c] if ind == 0 { iter.assertInteger() return 0 // single zero } if ind == invalidCharForNumber { iter.ReportError("readUint32", "unexpected character: "+string([]byte{byte(ind)})) return } value := uint32(ind) if iter.tail-iter.head > 10 { i := iter.head ind2 := intDigits[iter.buf[i]] if ind2 == invalidCharForNumber { iter.head = i iter.assertInteger() return value } i++ ind3 := intDigits[iter.buf[i]] if ind3 == invalidCharForNumber { iter.head = i iter.assertInteger() return value*10 + uint32(ind2) } //iter.head = i + 1 //value = value * 100 + uint32(ind2) * 10 + uint32(ind3) i++ ind4 := intDigits[iter.buf[i]] if ind4 == invalidCharForNumber { iter.head = i iter.assertInteger() return value*100 + uint32(ind2)*10 + uint32(ind3) } i++ ind5 := intDigits[iter.buf[i]] if ind5 == invalidCharForNumber { iter.head = i iter.assertInteger() return value*1000 + uint32(ind2)*100 + uint32(ind3)*10 + uint32(ind4) } i++ ind6 := intDigits[iter.buf[i]] if ind6 == invalidCharForNumber { iter.head = i iter.assertInteger() return value*10000 + uint32(ind2)*1000 + uint32(ind3)*100 + uint32(ind4)*10 + uint32(ind5) } i++ ind7 := intDigits[iter.buf[i]] if ind7 == invalidCharForNumber { iter.head = i iter.assertInteger() return value*100000 + uint32(ind2)*10000 + uint32(ind3)*1000 + uint32(ind4)*100 + uint32(ind5)*10 + uint32(ind6) } i++ ind8 := intDigits[iter.buf[i]] if ind8 == invalidCharForNumber { iter.head = i iter.assertInteger() return value*1000000 + uint32(ind2)*100000 + uint32(ind3)*10000 + uint32(ind4)*1000 + uint32(ind5)*100 + uint32(ind6)*10 + uint32(ind7) } i++ ind9 := intDigits[iter.buf[i]] value = value*10000000 + uint32(ind2)*1000000 + uint32(ind3)*100000 + uint32(ind4)*10000 + uint32(ind5)*1000 + uint32(ind6)*100 + uint32(ind7)*10 + uint32(ind8) iter.head = i if ind9 == invalidCharForNumber { iter.assertInteger() return value } } for { for i := iter.head; i < iter.tail; i++ { ind = intDigits[iter.buf[i]] if ind == invalidCharForNumber { iter.head = i iter.assertInteger() return value } if value > uint32SafeToMultiply10 { value2 := (value << 3) + (value << 1) + uint32(ind) if value2 < value { iter.ReportError("readUint32", "overflow") return } value = value2 continue } value = (value << 3) + (value << 1) + uint32(ind) } if !iter.loadMore() { iter.assertInteger() return value } } } // ReadInt64 read int64 func (iter *Iterator) ReadInt64() (ret int64) { c := iter.nextToken() if c == '-' { val := iter.readUint64(iter.readByte()) if val > math.MaxInt64+1 { iter.ReportError("ReadInt64", "overflow: "+strconv.FormatUint(uint64(val), 10)) return } return -int64(val) } val := iter.readUint64(c) if val > math.MaxInt64 { iter.ReportError("ReadInt64", "overflow: "+strconv.FormatUint(uint64(val), 10)) return } return int64(val) } // ReadUint64 read uint64 func (iter *Iterator) ReadUint64() uint64 { return iter.readUint64(iter.nextToken()) } func (iter *Iterator) readUint64(c byte) (ret uint64) { ind := intDigits[c] if ind == 0 { iter.assertInteger() return 0 // single zero } if ind == invalidCharForNumber { iter.ReportError("readUint64", "unexpected character: "+string([]byte{byte(ind)})) return } value := uint64(ind) if iter.tail-iter.head > 10 { i := iter.head ind2 := intDigits[iter.buf[i]] if ind2 == invalidCharForNumber { iter.head = i iter.assertInteger() return value } i++ ind3 := intDigits[iter.buf[i]] if ind3 == invalidCharForNumber { iter.head = i iter.assertInteger() return value*10 + uint64(ind2) } //iter.head = i + 1 //value = value * 100 + uint32(ind2) * 10 + uint32(ind3) i++ ind4 := intDigits[iter.buf[i]] if ind4 == invalidCharForNumber { iter.head = i iter.assertInteger() return value*100 + uint64(ind2)*10 + uint64(ind3) } i++ ind5 := intDigits[iter.buf[i]] if ind5 == invalidCharForNumber { iter.head = i iter.assertInteger() return value*1000 + uint64(ind2)*100 + uint64(ind3)*10 + uint64(ind4) } i++ ind6 := intDigits[iter.buf[i]] if ind6 == invalidCharForNumber { iter.head = i iter.assertInteger() return value*10000 + uint64(ind2)*1000 + uint64(ind3)*100 + uint64(ind4)*10 + uint64(ind5) } i++ ind7 := intDigits[iter.buf[i]] if ind7 == invalidCharForNumber { iter.head = i iter.assertInteger() return value*100000 + uint64(ind2)*10000 + uint64(ind3)*1000 + uint64(ind4)*100 + uint64(ind5)*10 + uint64(ind6) } i++ ind8 := intDigits[iter.buf[i]] if ind8 == invalidCharForNumber { iter.head = i iter.assertInteger() return value*1000000 + uint64(ind2)*100000 + uint64(ind3)*10000 + uint64(ind4)*1000 + uint64(ind5)*100 + uint64(ind6)*10 + uint64(ind7) } i++ ind9 := intDigits[iter.buf[i]] value = value*10000000 + uint64(ind2)*1000000 + uint64(ind3)*100000 + uint64(ind4)*10000 + uint64(ind5)*1000 + uint64(ind6)*100 + uint64(ind7)*10 + uint64(ind8) iter.head = i if ind9 == invalidCharForNumber { iter.assertInteger() return value } } for { for i := iter.head; i < iter.tail; i++ { ind = intDigits[iter.buf[i]] if ind == invalidCharForNumber { iter.head = i iter.assertInteger() return value } if value > uint64SafeToMultiple10 { value2 := (value << 3) + (value << 1) + uint64(ind) if value2 < value { iter.ReportError("readUint64", "overflow") return } value = value2 continue } value = (value << 3) + (value << 1) + uint64(ind) } if !iter.loadMore() { iter.assertInteger() return value } } } func (iter *Iterator) assertInteger() { if iter.head < len(iter.buf) && iter.buf[iter.head] == '.' { iter.ReportError("assertInteger", "can not decode float as int") } }
8,993
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/reflect_marshaler.go
package jsoniter import ( "encoding" "encoding/json" "unsafe" "github.com/modern-go/reflect2" ) var marshalerType = reflect2.TypeOfPtr((*json.Marshaler)(nil)).Elem() var unmarshalerType = reflect2.TypeOfPtr((*json.Unmarshaler)(nil)).Elem() var textMarshalerType = reflect2.TypeOfPtr((*encoding.TextMarshaler)(nil)).Elem() var textUnmarshalerType = reflect2.TypeOfPtr((*encoding.TextUnmarshaler)(nil)).Elem() func createDecoderOfMarshaler(ctx *ctx, typ reflect2.Type) ValDecoder { ptrType := reflect2.PtrTo(typ) if ptrType.Implements(unmarshalerType) { return &referenceDecoder{ &unmarshalerDecoder{ptrType}, } } if ptrType.Implements(textUnmarshalerType) { return &referenceDecoder{ &textUnmarshalerDecoder{ptrType}, } } return nil } func createEncoderOfMarshaler(ctx *ctx, typ reflect2.Type) ValEncoder { if typ == marshalerType { checkIsEmpty := createCheckIsEmpty(ctx, typ) var encoder ValEncoder = &directMarshalerEncoder{ checkIsEmpty: checkIsEmpty, } return encoder } if typ.Implements(marshalerType) { checkIsEmpty := createCheckIsEmpty(ctx, typ) var encoder ValEncoder = &marshalerEncoder{ valType: typ, checkIsEmpty: checkIsEmpty, } return encoder } ptrType := reflect2.PtrTo(typ) if ctx.prefix != "" && ptrType.Implements(marshalerType) { checkIsEmpty := createCheckIsEmpty(ctx, ptrType) var encoder ValEncoder = &marshalerEncoder{ valType: ptrType, checkIsEmpty: checkIsEmpty, } return &referenceEncoder{encoder} } if typ == textMarshalerType { checkIsEmpty := createCheckIsEmpty(ctx, typ) var encoder ValEncoder = &directTextMarshalerEncoder{ checkIsEmpty: checkIsEmpty, stringEncoder: ctx.EncoderOf(reflect2.TypeOf("")), } return encoder } if typ.Implements(textMarshalerType) { checkIsEmpty := createCheckIsEmpty(ctx, typ) var encoder ValEncoder = &textMarshalerEncoder{ valType: typ, stringEncoder: ctx.EncoderOf(reflect2.TypeOf("")), checkIsEmpty: checkIsEmpty, } return encoder } // if prefix is empty, the type is the root type if ctx.prefix != "" && ptrType.Implements(textMarshalerType) { checkIsEmpty := createCheckIsEmpty(ctx, ptrType) var encoder ValEncoder = &textMarshalerEncoder{ valType: ptrType, stringEncoder: ctx.EncoderOf(reflect2.TypeOf("")), checkIsEmpty: checkIsEmpty, } return &referenceEncoder{encoder} } return nil } type marshalerEncoder struct { checkIsEmpty checkIsEmpty valType reflect2.Type } func (encoder *marshalerEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { obj := encoder.valType.UnsafeIndirect(ptr) if encoder.valType.IsNullable() && reflect2.IsNil(obj) { stream.WriteNil() return } marshaler := obj.(json.Marshaler) bytes, err := marshaler.MarshalJSON() if err != nil { stream.Error = err } else { // html escape was already done by jsoniter // but the extra '\n' should be trimed l := len(bytes) if l > 0 && bytes[l-1] == '\n' { bytes = bytes[:l-1] } stream.Write(bytes) } } func (encoder *marshalerEncoder) IsEmpty(ptr unsafe.Pointer) bool { return encoder.checkIsEmpty.IsEmpty(ptr) } type directMarshalerEncoder struct { checkIsEmpty checkIsEmpty } func (encoder *directMarshalerEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { marshaler := *(*json.Marshaler)(ptr) if marshaler == nil { stream.WriteNil() return } bytes, err := marshaler.MarshalJSON() if err != nil { stream.Error = err } else { stream.Write(bytes) } } func (encoder *directMarshalerEncoder) IsEmpty(ptr unsafe.Pointer) bool { return encoder.checkIsEmpty.IsEmpty(ptr) } type textMarshalerEncoder struct { valType reflect2.Type stringEncoder ValEncoder checkIsEmpty checkIsEmpty } func (encoder *textMarshalerEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { obj := encoder.valType.UnsafeIndirect(ptr) if encoder.valType.IsNullable() && reflect2.IsNil(obj) { stream.WriteNil() return } marshaler := (obj).(encoding.TextMarshaler) bytes, err := marshaler.MarshalText() if err != nil { stream.Error = err } else { str := string(bytes) encoder.stringEncoder.Encode(unsafe.Pointer(&str), stream) } } func (encoder *textMarshalerEncoder) IsEmpty(ptr unsafe.Pointer) bool { return encoder.checkIsEmpty.IsEmpty(ptr) } type directTextMarshalerEncoder struct { stringEncoder ValEncoder checkIsEmpty checkIsEmpty } func (encoder *directTextMarshalerEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { marshaler := *(*encoding.TextMarshaler)(ptr) if marshaler == nil { stream.WriteNil() return } bytes, err := marshaler.MarshalText() if err != nil { stream.Error = err } else { str := string(bytes) encoder.stringEncoder.Encode(unsafe.Pointer(&str), stream) } } func (encoder *directTextMarshalerEncoder) IsEmpty(ptr unsafe.Pointer) bool { return encoder.checkIsEmpty.IsEmpty(ptr) } type unmarshalerDecoder struct { valType reflect2.Type } func (decoder *unmarshalerDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { valType := decoder.valType obj := valType.UnsafeIndirect(ptr) unmarshaler := obj.(json.Unmarshaler) iter.nextToken() iter.unreadByte() // skip spaces bytes := iter.SkipAndReturnBytes() err := unmarshaler.UnmarshalJSON(bytes) if err != nil { iter.ReportError("unmarshalerDecoder", err.Error()) } } type textUnmarshalerDecoder struct { valType reflect2.Type } func (decoder *textUnmarshalerDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { valType := decoder.valType obj := valType.UnsafeIndirect(ptr) if reflect2.IsNil(obj) { ptrType := valType.(*reflect2.UnsafePtrType) elemType := ptrType.Elem() elem := elemType.UnsafeNew() ptrType.UnsafeSet(ptr, unsafe.Pointer(&elem)) obj = valType.UnsafeIndirect(ptr) } unmarshaler := (obj).(encoding.TextUnmarshaler) str := iter.ReadString() err := unmarshaler.UnmarshalText([]byte(str)) if err != nil { iter.ReportError("textUnmarshalerDecoder", err.Error()) } }
8,994
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/stream_float.go
package jsoniter import ( "fmt" "math" "strconv" ) var pow10 []uint64 func init() { pow10 = []uint64{1, 10, 100, 1000, 10000, 100000, 1000000} } // WriteFloat32 write float32 to stream func (stream *Stream) WriteFloat32(val float32) { if math.IsInf(float64(val), 0) || math.IsNaN(float64(val)) { stream.Error = fmt.Errorf("unsupported value: %f", val) return } abs := math.Abs(float64(val)) fmt := byte('f') // Note: Must use float32 comparisons for underlying float32 value to get precise cutoffs right. if abs != 0 { if float32(abs) < 1e-6 || float32(abs) >= 1e21 { fmt = 'e' } } stream.buf = strconv.AppendFloat(stream.buf, float64(val), fmt, -1, 32) } // WriteFloat32Lossy write float32 to stream with ONLY 6 digits precision although much much faster func (stream *Stream) WriteFloat32Lossy(val float32) { if math.IsInf(float64(val), 0) || math.IsNaN(float64(val)) { stream.Error = fmt.Errorf("unsupported value: %f", val) return } if val < 0 { stream.writeByte('-') val = -val } if val > 0x4ffffff { stream.WriteFloat32(val) return } precision := 6 exp := uint64(1000000) // 6 lval := uint64(float64(val)*float64(exp) + 0.5) stream.WriteUint64(lval / exp) fval := lval % exp if fval == 0 { return } stream.writeByte('.') for p := precision - 1; p > 0 && fval < pow10[p]; p-- { stream.writeByte('0') } stream.WriteUint64(fval) for stream.buf[len(stream.buf)-1] == '0' { stream.buf = stream.buf[:len(stream.buf)-1] } } // WriteFloat64 write float64 to stream func (stream *Stream) WriteFloat64(val float64) { if math.IsInf(val, 0) || math.IsNaN(val) { stream.Error = fmt.Errorf("unsupported value: %f", val) return } abs := math.Abs(val) fmt := byte('f') // Note: Must use float32 comparisons for underlying float32 value to get precise cutoffs right. if abs != 0 { if abs < 1e-6 || abs >= 1e21 { fmt = 'e' } } stream.buf = strconv.AppendFloat(stream.buf, float64(val), fmt, -1, 64) } // WriteFloat64Lossy write float64 to stream with ONLY 6 digits precision although much much faster func (stream *Stream) WriteFloat64Lossy(val float64) { if math.IsInf(val, 0) || math.IsNaN(val) { stream.Error = fmt.Errorf("unsupported value: %f", val) return } if val < 0 { stream.writeByte('-') val = -val } if val > 0x4ffffff { stream.WriteFloat64(val) return } precision := 6 exp := uint64(1000000) // 6 lval := uint64(val*float64(exp) + 0.5) stream.WriteUint64(lval / exp) fval := lval % exp if fval == 0 { return } stream.writeByte('.') for p := precision - 1; p > 0 && fval < pow10[p]; p-- { stream.writeByte('0') } stream.WriteUint64(fval) for stream.buf[len(stream.buf)-1] == '0' { stream.buf = stream.buf[:len(stream.buf)-1] } }
8,995
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/any_array.go
package jsoniter import ( "reflect" "unsafe" ) type arrayLazyAny struct { baseAny cfg *frozenConfig buf []byte err error } func (any *arrayLazyAny) ValueType() ValueType { return ArrayValue } func (any *arrayLazyAny) MustBeValid() Any { return any } func (any *arrayLazyAny) LastError() error { return any.err } func (any *arrayLazyAny) ToBool() bool { iter := any.cfg.BorrowIterator(any.buf) defer any.cfg.ReturnIterator(iter) return iter.ReadArray() } func (any *arrayLazyAny) ToInt() int { if any.ToBool() { return 1 } return 0 } func (any *arrayLazyAny) ToInt32() int32 { if any.ToBool() { return 1 } return 0 } func (any *arrayLazyAny) ToInt64() int64 { if any.ToBool() { return 1 } return 0 } func (any *arrayLazyAny) ToUint() uint { if any.ToBool() { return 1 } return 0 } func (any *arrayLazyAny) ToUint32() uint32 { if any.ToBool() { return 1 } return 0 } func (any *arrayLazyAny) ToUint64() uint64 { if any.ToBool() { return 1 } return 0 } func (any *arrayLazyAny) ToFloat32() float32 { if any.ToBool() { return 1 } return 0 } func (any *arrayLazyAny) ToFloat64() float64 { if any.ToBool() { return 1 } return 0 } func (any *arrayLazyAny) ToString() string { return *(*string)(unsafe.Pointer(&any.buf)) } func (any *arrayLazyAny) ToVal(val interface{}) { iter := any.cfg.BorrowIterator(any.buf) defer any.cfg.ReturnIterator(iter) iter.ReadVal(val) } func (any *arrayLazyAny) Get(path ...interface{}) Any { if len(path) == 0 { return any } switch firstPath := path[0].(type) { case int: iter := any.cfg.BorrowIterator(any.buf) defer any.cfg.ReturnIterator(iter) valueBytes := locateArrayElement(iter, firstPath) if valueBytes == nil { return newInvalidAny(path) } iter.ResetBytes(valueBytes) return locatePath(iter, path[1:]) case int32: if '*' == firstPath { iter := any.cfg.BorrowIterator(any.buf) defer any.cfg.ReturnIterator(iter) arr := make([]Any, 0) iter.ReadArrayCB(func(iter *Iterator) bool { found := iter.readAny().Get(path[1:]...) if found.ValueType() != InvalidValue { arr = append(arr, found) } return true }) return wrapArray(arr) } return newInvalidAny(path) default: return newInvalidAny(path) } } func (any *arrayLazyAny) Size() int { size := 0 iter := any.cfg.BorrowIterator(any.buf) defer any.cfg.ReturnIterator(iter) iter.ReadArrayCB(func(iter *Iterator) bool { size++ iter.Skip() return true }) return size } func (any *arrayLazyAny) WriteTo(stream *Stream) { stream.Write(any.buf) } func (any *arrayLazyAny) GetInterface() interface{} { iter := any.cfg.BorrowIterator(any.buf) defer any.cfg.ReturnIterator(iter) return iter.Read() } type arrayAny struct { baseAny val reflect.Value } func wrapArray(val interface{}) *arrayAny { return &arrayAny{baseAny{}, reflect.ValueOf(val)} } func (any *arrayAny) ValueType() ValueType { return ArrayValue } func (any *arrayAny) MustBeValid() Any { return any } func (any *arrayAny) LastError() error { return nil } func (any *arrayAny) ToBool() bool { return any.val.Len() != 0 } func (any *arrayAny) ToInt() int { if any.val.Len() == 0 { return 0 } return 1 } func (any *arrayAny) ToInt32() int32 { if any.val.Len() == 0 { return 0 } return 1 } func (any *arrayAny) ToInt64() int64 { if any.val.Len() == 0 { return 0 } return 1 } func (any *arrayAny) ToUint() uint { if any.val.Len() == 0 { return 0 } return 1 } func (any *arrayAny) ToUint32() uint32 { if any.val.Len() == 0 { return 0 } return 1 } func (any *arrayAny) ToUint64() uint64 { if any.val.Len() == 0 { return 0 } return 1 } func (any *arrayAny) ToFloat32() float32 { if any.val.Len() == 0 { return 0 } return 1 } func (any *arrayAny) ToFloat64() float64 { if any.val.Len() == 0 { return 0 } return 1 } func (any *arrayAny) ToString() string { str, _ := MarshalToString(any.val.Interface()) return str } func (any *arrayAny) Get(path ...interface{}) Any { if len(path) == 0 { return any } switch firstPath := path[0].(type) { case int: if firstPath < 0 || firstPath >= any.val.Len() { return newInvalidAny(path) } return Wrap(any.val.Index(firstPath).Interface()) case int32: if '*' == firstPath { mappedAll := make([]Any, 0) for i := 0; i < any.val.Len(); i++ { mapped := Wrap(any.val.Index(i).Interface()).Get(path[1:]...) if mapped.ValueType() != InvalidValue { mappedAll = append(mappedAll, mapped) } } return wrapArray(mappedAll) } return newInvalidAny(path) default: return newInvalidAny(path) } } func (any *arrayAny) Size() int { return any.val.Len() } func (any *arrayAny) WriteTo(stream *Stream) { stream.WriteVal(any.val) } func (any *arrayAny) GetInterface() interface{} { return any.val.Interface() }
8,996
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/pool.go
package jsoniter import ( "io" ) // IteratorPool a thread safe pool of iterators with same configuration type IteratorPool interface { BorrowIterator(data []byte) *Iterator ReturnIterator(iter *Iterator) } // StreamPool a thread safe pool of streams with same configuration type StreamPool interface { BorrowStream(writer io.Writer) *Stream ReturnStream(stream *Stream) } func (cfg *frozenConfig) BorrowStream(writer io.Writer) *Stream { stream := cfg.streamPool.Get().(*Stream) stream.Reset(writer) return stream } func (cfg *frozenConfig) ReturnStream(stream *Stream) { stream.out = nil stream.Error = nil stream.Attachment = nil cfg.streamPool.Put(stream) } func (cfg *frozenConfig) BorrowIterator(data []byte) *Iterator { iter := cfg.iteratorPool.Get().(*Iterator) iter.ResetBytes(data) return iter } func (cfg *frozenConfig) ReturnIterator(iter *Iterator) { iter.Error = nil iter.Attachment = nil cfg.iteratorPool.Put(iter) }
8,997
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/reflect_optional.go
package jsoniter import ( "github.com/modern-go/reflect2" "unsafe" ) func decoderOfOptional(ctx *ctx, typ reflect2.Type) ValDecoder { ptrType := typ.(*reflect2.UnsafePtrType) elemType := ptrType.Elem() decoder := decoderOfType(ctx, elemType) return &OptionalDecoder{elemType, decoder} } func encoderOfOptional(ctx *ctx, typ reflect2.Type) ValEncoder { ptrType := typ.(*reflect2.UnsafePtrType) elemType := ptrType.Elem() elemEncoder := encoderOfType(ctx, elemType) encoder := &OptionalEncoder{elemEncoder} return encoder } type OptionalDecoder struct { ValueType reflect2.Type ValueDecoder ValDecoder } func (decoder *OptionalDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { if iter.ReadNil() { *((*unsafe.Pointer)(ptr)) = nil } else { if *((*unsafe.Pointer)(ptr)) == nil { //pointer to null, we have to allocate memory to hold the value newPtr := decoder.ValueType.UnsafeNew() decoder.ValueDecoder.Decode(newPtr, iter) *((*unsafe.Pointer)(ptr)) = newPtr } else { //reuse existing instance decoder.ValueDecoder.Decode(*((*unsafe.Pointer)(ptr)), iter) } } } type dereferenceDecoder struct { // only to deference a pointer valueType reflect2.Type valueDecoder ValDecoder } func (decoder *dereferenceDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { if *((*unsafe.Pointer)(ptr)) == nil { //pointer to null, we have to allocate memory to hold the value newPtr := decoder.valueType.UnsafeNew() decoder.valueDecoder.Decode(newPtr, iter) *((*unsafe.Pointer)(ptr)) = newPtr } else { //reuse existing instance decoder.valueDecoder.Decode(*((*unsafe.Pointer)(ptr)), iter) } } type OptionalEncoder struct { ValueEncoder ValEncoder } func (encoder *OptionalEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { if *((*unsafe.Pointer)(ptr)) == nil { stream.WriteNil() } else { encoder.ValueEncoder.Encode(*((*unsafe.Pointer)(ptr)), stream) } } func (encoder *OptionalEncoder) IsEmpty(ptr unsafe.Pointer) bool { return *((*unsafe.Pointer)(ptr)) == nil } type dereferenceEncoder struct { ValueEncoder ValEncoder } func (encoder *dereferenceEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { if *((*unsafe.Pointer)(ptr)) == nil { stream.WriteNil() } else { encoder.ValueEncoder.Encode(*((*unsafe.Pointer)(ptr)), stream) } } func (encoder *dereferenceEncoder) IsEmpty(ptr unsafe.Pointer) bool { dePtr := *((*unsafe.Pointer)(ptr)) if dePtr == nil { return true } return encoder.ValueEncoder.IsEmpty(dePtr) } func (encoder *dereferenceEncoder) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool { deReferenced := *((*unsafe.Pointer)(ptr)) if deReferenced == nil { return true } isEmbeddedPtrNil, converted := encoder.ValueEncoder.(IsEmbeddedPtrNil) if !converted { return false } fieldPtr := unsafe.Pointer(deReferenced) return isEmbeddedPtrNil.IsEmbeddedPtrNil(fieldPtr) } type referenceEncoder struct { encoder ValEncoder } func (encoder *referenceEncoder) Encode(ptr unsafe.Pointer, stream *Stream) { encoder.encoder.Encode(unsafe.Pointer(&ptr), stream) } func (encoder *referenceEncoder) IsEmpty(ptr unsafe.Pointer) bool { return encoder.encoder.IsEmpty(unsafe.Pointer(&ptr)) } type referenceDecoder struct { decoder ValDecoder } func (decoder *referenceDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { decoder.decoder.Decode(unsafe.Pointer(&ptr), iter) }
8,998
0
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator
kubeflow_public_repos/fate-operator/vendor/github.com/json-iterator/go/any_int32.go
package jsoniter import ( "strconv" ) type int32Any struct { baseAny val int32 } func (any *int32Any) LastError() error { return nil } func (any *int32Any) ValueType() ValueType { return NumberValue } func (any *int32Any) MustBeValid() Any { return any } func (any *int32Any) ToBool() bool { return any.val != 0 } func (any *int32Any) ToInt() int { return int(any.val) } func (any *int32Any) ToInt32() int32 { return any.val } func (any *int32Any) ToInt64() int64 { return int64(any.val) } func (any *int32Any) ToUint() uint { return uint(any.val) } func (any *int32Any) ToUint32() uint32 { return uint32(any.val) } func (any *int32Any) ToUint64() uint64 { return uint64(any.val) } func (any *int32Any) ToFloat32() float32 { return float32(any.val) } func (any *int32Any) ToFloat64() float64 { return float64(any.val) } func (any *int32Any) ToString() string { return strconv.FormatInt(int64(any.val), 10) } func (any *int32Any) WriteTo(stream *Stream) { stream.WriteInt32(any.val) } func (any *int32Any) Parse() *Iterator { return nil } func (any *int32Any) GetInterface() interface{} { return any.val }
8,999