pax_global_header00006660000000000000000000000064145731253150014520gustar00rootroot0000000000000052 comment=af9bab81cf9ab52283c1498b1d076ec68a1a2bcd spec-0.21.0/000077500000000000000000000000001457312531500125325ustar00rootroot00000000000000spec-0.21.0/.editorconfig000066400000000000000000000010331457312531500152040ustar00rootroot00000000000000# 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 spec-0.21.0/.github/000077500000000000000000000000001457312531500140725ustar00rootroot00000000000000spec-0.21.0/.github/CONTRIBUTING.md000066400000000000000000000114601457312531500163250ustar00rootroot00000000000000## Contribution Guidelines ### Pull requests are always welcome We are always thrilled to receive pull requests, and do our best to process them as fast as possible. Not sure if that typo is worth a pull request? Do it! We will appreciate it. If your pull request is not accepted on the first try, don't be discouraged! If there's a problem with the implementation, hopefully you received feedback on what to improve. We're trying very hard to keep go-swagger lean and focused. We don't want it to do everything for everybody. This means that we might decide against incorporating a new feature. However, there might be a way to implement that feature *on top of* go-swagger. ### Conventions Fork the repo and make changes on your fork in a feature branch: - If it's a bugfix branch, name it XXX-something where XXX is the number of the issue - If it's a feature branch, create an enhancement issue to announce your intentions, and name it XXX-something where XXX is the number of the issue. Submit unit tests for your changes. Go has a great test framework built in; use it! Take a look at existing tests for inspiration. Run the full test suite on your branch before submitting a pull request. Update the documentation when creating or modifying features. Test your documentation changes for clarity, concision, and correctness, as well as a clean documentation build. See ``docs/README.md`` for more information on building the docs and how docs get released. Write clean code. Universally formatted code promotes ease of writing, reading, and maintenance. Always run `gofmt -s -w file.go` on each changed file before committing your changes. Most editors have plugins that do this automatically. Pull requests descriptions should be as clear as possible and include a reference to all the issues that they address. Pull requests must not contain commits from other users or branches. Commit messages must start with a capitalized and short summary (max. 50 chars) written in the imperative, followed by an optional, more detailed explanatory text which is separated from the summary by an empty line. Code review comments may be added to your pull request. Discuss, then make the suggested modifications and push additional commits to your feature branch. Be sure to post a comment after pushing. The new commits will show up in the pull request automatically, but the reviewers will not be notified unless you comment. Before the pull request is merged, make sure that you squash your commits into logical units of work using `git rebase -i` and `git push -f`. After every commit the test suite should be passing. Include documentation changes in the same commit so that a revert would remove all traces of the feature or fix. Commits that fix or close an issue should include a reference like `Closes #XXX` or `Fixes #XXX`, which will automatically close the issue when merged. ### Sign your work The sign-off is a simple line at the end of the explanation for the patch, which certifies that you wrote it or otherwise have the right to pass it on as an open-source patch. The rules are pretty simple: if you can certify the below (from [developercertificate.org](http://developercertificate.org/)): ``` Developer Certificate of Origin Version 1.1 Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 660 York Street, Suite 102, San Francisco, CA 94110 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. ``` then you just add a line to every git commit message: Signed-off-by: Joe Smith using your real name (sorry, no pseudonyms or anonymous contributions.) You can add the sign off when creating the git commit via `git commit -s`. spec-0.21.0/.github/dependabot.yaml000066400000000000000000000032001457312531500170560ustar00rootroot00000000000000version: 2 updates: - package-ecosystem: "github-actions" directory: "/" schedule: interval: "weekly" day: "friday" open-pull-requests-limit: 2 # <- default is 5 groups: # <- group all github actions updates in a single PR # 1. development-dependencies are auto-merged development-dependencies: patterns: - '*' - package-ecosystem: "gomod" # We define 4 groups of dependencies to regroup update pull requests: # - development (e.g. test dependencies) # - go-openapi updates # - golang.org (e.g. golang.org/x/... packages) # - other dependencies (direct or indirect) # # * All groups are checked once a week and each produce at most 1 PR. # * All dependabot PRs are auto-approved # # Auto-merging policy, when requirements are met: # 1. development-dependencies are auto-merged # 2. golang.org-dependencies are auto-merged # 3. go-openapi patch updates are auto-merged. Minor/major version updates require a manual merge. # 4. other dependencies require a manual merge directory: "/" schedule: interval: "weekly" day: "friday" open-pull-requests-limit: 4 groups: development-dependencies: patterns: - "github.com/stretchr/testify" golang.org-dependencies: patterns: - "golang.org/*" go-openapi-dependencies: patterns: - "github.com/go-openapi/*" other-dependencies: exclude-patterns: - "github.com/go-openapi/*" - "github.com/stretchr/testify" - "golang.org/*" spec-0.21.0/.github/workflows/000077500000000000000000000000001457312531500161275ustar00rootroot00000000000000spec-0.21.0/.github/workflows/auto-merge.yml000066400000000000000000000031301457312531500207140ustar00rootroot00000000000000name: Dependabot auto-merge on: pull_request permissions: contents: write pull-requests: write jobs: dependabot: runs-on: ubuntu-latest if: github.actor == 'dependabot[bot]' steps: - name: Dependabot metadata id: metadata uses: dependabot/fetch-metadata@v1 - name: Auto-approve all dependabot PRs run: gh pr review --approve "$PR_URL" env: PR_URL: ${{github.event.pull_request.html_url}} GH_TOKEN: ${{secrets.GITHUB_TOKEN}} - name: Auto-merge dependabot PRs for development dependencies if: contains(steps.metadata.outputs.dependency-group, 'development-dependencies') run: gh pr merge --auto --rebase "$PR_URL" env: PR_URL: ${{github.event.pull_request.html_url}} GH_TOKEN: ${{secrets.GITHUB_TOKEN}} - name: Auto-merge dependabot PRs for go-openapi patches if: contains(steps.metadata.outputs.dependency-group, 'go-openapi-dependencies') && (steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch') run: gh pr merge --auto --rebase "$PR_URL" env: PR_URL: ${{github.event.pull_request.html_url}} GH_TOKEN: ${{secrets.GITHUB_TOKEN}} - name: Auto-merge dependabot PRs for golang.org updates if: contains(steps.metadata.outputs.dependency-group, 'golang.org-dependencies') run: gh pr merge --auto --rebase "$PR_URL" env: PR_URL: ${{github.event.pull_request.html_url}} GH_TOKEN: ${{secrets.GITHUB_TOKEN}} spec-0.21.0/.github/workflows/go-test.yml000066400000000000000000000024761457312531500202450ustar00rootroot00000000000000name: go test on: push: tags: - v* branches: - master pull_request: jobs: lint: name: Lint runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: go-version: stable check-latest: true cache: true - name: golangci-lint uses: golangci/golangci-lint-action@v4 with: version: latest only-new-issues: true skip-cache: true test: name: Unit tests runs-on: ${{ matrix.os }} strategy: matrix: os: [ ubuntu-latest, macos-latest, windows-latest ] go_version: ['oldstable', 'stable' ] steps: - name: Run unit tests uses: actions/setup-go@v5 with: go-version: '${{ matrix.go_version }}' check-latest: true cache: true - uses: actions/checkout@v4 - run: go test -v -race -coverprofile="coverage-${{ matrix.os }}.${{ matrix.go_version }}.out" -covermode=atomic -coverpkg=$(go list)/... ./... - name: Upload coverage to codecov uses: codecov/codecov-action@v4 with: files: './coverage-${{ matrix.os }}.${{ matrix.go_version }}.out' flags: '${{ matrix.go_version }}' os: '${{ matrix.os }}' fail_ci_if_error: false verbose: true spec-0.21.0/.gitignore000066400000000000000000000000061457312531500145160ustar00rootroot00000000000000*.out spec-0.21.0/.golangci.yml000066400000000000000000000016701457312531500151220ustar00rootroot00000000000000linters-settings: govet: check-shadowing: true golint: min-confidence: 0 gocyclo: min-complexity: 45 maligned: suggest-new: true dupl: threshold: 200 goconst: min-len: 2 min-occurrences: 3 linters: enable-all: true disable: - maligned - unparam - lll - gochecknoinits - gochecknoglobals - funlen - godox - gocognit - whitespace - wsl - wrapcheck - testpackage - nlreturn - gomnd - exhaustivestruct - goerr113 - errorlint - nestif - godot - gofumpt - paralleltest - tparallel - thelper - ifshort - exhaustruct - varnamelen - gci - depguard - errchkjson - inamedparam - nonamedreturns - musttag - ireturn - forcetypeassert - cyclop # deprecated linters - deadcode - interfacer - scopelint - varcheck - structcheck - golint - nosnakecase spec-0.21.0/CODE_OF_CONDUCT.md000066400000000000000000000062411457312531500153340ustar00rootroot00000000000000# 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 ivan+abuse@flanders.co.nz. 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/ spec-0.21.0/LICENSE000066400000000000000000000261361457312531500135470ustar00rootroot00000000000000 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. spec-0.21.0/README.md000066400000000000000000000054701457312531500140170ustar00rootroot00000000000000# OpenAPI v2 object model [![Build Status](https://github.com/go-openapi/spec/actions/workflows/go-test.yml/badge.svg)](https://github.com/go-openapi/spec/actions?query=workflow%3A"go+test") [![codecov](https://codecov.io/gh/go-openapi/spec/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/spec) [![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/spec/master/LICENSE) [![Go Reference](https://pkg.go.dev/badge/github.com/go-openapi/spec.svg)](https://pkg.go.dev/github.com/go-openapi/spec) [![Go Report Card](https://goreportcard.com/badge/github.com/go-openapi/spec)](https://goreportcard.com/report/github.com/go-openapi/spec) The object model for OpenAPI specification documents. ### FAQ * What does this do? > 1. This package knows how to marshal and unmarshal Swagger API specifications into a golang object model > 2. It knows how to resolve $ref and expand them to make a single root document * How does it play with the rest of the go-openapi packages ? > 1. This package is at the core of the go-openapi suite of packages and [code generator](https://github.com/go-swagger/go-swagger) > 2. There is a [spec loading package](https://github.com/go-openapi/loads) to fetch specs as JSON or YAML from local or remote locations > 3. There is a [spec validation package](https://github.com/go-openapi/validate) built on top of it > 4. There is a [spec analysis package](https://github.com/go-openapi/analysis) built on top of it, to analyze, flatten, fix and merge spec documents * Does this library support OpenAPI 3? > No. > This package currently only supports OpenAPI 2.0 (aka Swagger 2.0). > There is no plan to make it evolve toward supporting OpenAPI 3.x. > This [discussion thread](https://github.com/go-openapi/spec/issues/21) relates the full story. > > An early attempt to support Swagger 3 may be found at: https://github.com/go-openapi/spec3 * Does the unmarshaling support YAML? > Not directly. The exposed types know only how to unmarshal from JSON. > > In order to load a YAML document as a Swagger spec, you need to use the loaders provided by > github.com/go-openapi/loads > > Take a look at the example there: https://pkg.go.dev/github.com/go-openapi/loads#example-Spec > > See also https://github.com/go-openapi/spec/issues/164 * How can I validate a spec? > Validation is provided by [the validate package](http://github.com/go-openapi/validate) * Why do we have an `ID` field for `Schema` which is not part of the swagger spec? > We found jsonschema compatibility more important: since `id` in jsonschema influences > how `$ref` are resolved. > This `id` does not conflict with any property named `id`. > > See also https://github.com/go-openapi/spec/issues/23 spec-0.21.0/auth_test.go000066400000000000000000000111171457312531500150620ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "testing" ) func TestSerialization_AuthSerialization(t *testing.T) { assertSerializeJSON(t, BasicAuth(), `{"type":"basic"}`) assertSerializeJSON(t, APIKeyAuth("api-key", "header"), `{"type":"apiKey","name":"api-key","in":"header"}`) assertSerializeJSON( t, OAuth2Implicit("http://foo.com/authorization"), `{"type":"oauth2","flow":"implicit","authorizationUrl":"http://foo.com/authorization"}`) assertSerializeJSON( t, OAuth2Password("http://foo.com/token"), `{"type":"oauth2","flow":"password","tokenUrl":"http://foo.com/token"}`) assertSerializeJSON(t, OAuth2Application("http://foo.com/token"), `{"type":"oauth2","flow":"application","tokenUrl":"http://foo.com/token"}`) assertSerializeJSON( t, OAuth2AccessToken("http://foo.com/authorization", "http://foo.com/token"), `{"type":"oauth2","flow":"accessCode","authorizationUrl":"http://foo.com/authorization",`+ `"tokenUrl":"http://foo.com/token"}`) auth1 := OAuth2Implicit("http://foo.com/authorization") auth1.AddScope("email", "read your email") assertSerializeJSON( t, auth1, `{"type":"oauth2","flow":"implicit","authorizationUrl":"http://foo.com/authorization",`+ `"scopes":{"email":"read your email"}}`) auth2 := OAuth2Password("http://foo.com/authorization") auth2.AddScope("email", "read your email") assertSerializeJSON( t, auth2, `{"type":"oauth2","flow":"password","tokenUrl":"http://foo.com/authorization",`+ `"scopes":{"email":"read your email"}}`) auth3 := OAuth2Application("http://foo.com/token") auth3.AddScope("email", "read your email") assertSerializeJSON( t, auth3, `{"type":"oauth2","flow":"application","tokenUrl":"http://foo.com/token","scopes":{"email":"read your email"}}`) auth4 := OAuth2AccessToken("http://foo.com/authorization", "http://foo.com/token") auth4.AddScope("email", "read your email") assertSerializeJSON( t, auth4, `{"type":"oauth2","flow":"accessCode","authorizationUrl":"http://foo.com/authorization",`+ `"tokenUrl":"http://foo.com/token","scopes":{"email":"read your email"}}`) } func TestSerialization_AuthDeserialization(t *testing.T) { assertParsesJSON(t, `{"type":"basic"}`, BasicAuth()) assertParsesJSON( t, `{"in":"header","name":"api-key","type":"apiKey"}`, APIKeyAuth("api-key", "header")) assertParsesJSON( t, `{"authorizationUrl":"http://foo.com/authorization","flow":"implicit","type":"oauth2"}`, OAuth2Implicit("http://foo.com/authorization")) assertParsesJSON( t, `{"flow":"password","tokenUrl":"http://foo.com/token","type":"oauth2"}`, OAuth2Password("http://foo.com/token")) assertParsesJSON( t, `{"flow":"application","tokenUrl":"http://foo.com/token","type":"oauth2"}`, OAuth2Application("http://foo.com/token")) assertParsesJSON( t, `{"authorizationUrl":"http://foo.com/authorization","flow":"accessCode","tokenUrl":"http://foo.com/token",`+ `"type":"oauth2"}`, OAuth2AccessToken("http://foo.com/authorization", "http://foo.com/token")) auth1 := OAuth2Implicit("http://foo.com/authorization") auth1.AddScope("email", "read your email") assertParsesJSON(t, `{"authorizationUrl":"http://foo.com/authorization","flow":"implicit","scopes":{"email":"read your email"},`+ `"type":"oauth2"}`, auth1) auth2 := OAuth2Password("http://foo.com/token") auth2.AddScope("email", "read your email") assertParsesJSON(t, `{"flow":"password","scopes":{"email":"read your email"},"tokenUrl":"http://foo.com/token","type":"oauth2"}`, auth2) auth3 := OAuth2Application("http://foo.com/token") auth3.AddScope("email", "read your email") assertParsesJSON(t, `{"flow":"application","scopes":{"email":"read your email"},"tokenUrl":"http://foo.com/token","type":"oauth2"}`, auth3) auth4 := OAuth2AccessToken("http://foo.com/authorization", "http://foo.com/token") auth4.AddScope("email", "read your email") assertParsesJSON( t, `{"authorizationUrl":"http://foo.com/authorization","flow":"accessCode","scopes":{"email":"read your email"},`+ `"tokenUrl":"http://foo.com/token","type":"oauth2"}`, auth4) } spec-0.21.0/cache.go000066400000000000000000000050071457312531500141260ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "sync" ) // ResolutionCache a cache for resolving urls type ResolutionCache interface { Get(string) (interface{}, bool) Set(string, interface{}) } type simpleCache struct { lock sync.RWMutex store map[string]interface{} } func (s *simpleCache) ShallowClone() ResolutionCache { store := make(map[string]interface{}, len(s.store)) s.lock.RLock() for k, v := range s.store { store[k] = v } s.lock.RUnlock() return &simpleCache{ store: store, } } // Get retrieves a cached URI func (s *simpleCache) Get(uri string) (interface{}, bool) { s.lock.RLock() v, ok := s.store[uri] s.lock.RUnlock() return v, ok } // Set caches a URI func (s *simpleCache) Set(uri string, data interface{}) { s.lock.Lock() s.store[uri] = data s.lock.Unlock() } var ( // resCache is a package level cache for $ref resolution and expansion. // It is initialized lazily by methods that have the need for it: no // memory is allocated unless some expander methods are called. // // It is initialized with JSON schema and swagger schema, // which do not mutate during normal operations. // // All subsequent utilizations of this cache are produced from a shallow // clone of this initial version. resCache *simpleCache onceCache sync.Once _ ResolutionCache = &simpleCache{} ) // initResolutionCache initializes the URI resolution cache. To be wrapped in a sync.Once.Do call. func initResolutionCache() { resCache = defaultResolutionCache() } func defaultResolutionCache() *simpleCache { return &simpleCache{store: map[string]interface{}{ "http://swagger.io/v2/schema.json": MustLoadSwagger20Schema(), "http://json-schema.org/draft-04/schema": MustLoadJSONSchemaDraft04(), }} } func cacheOrDefault(cache ResolutionCache) ResolutionCache { onceCache.Do(initResolutionCache) if cache != nil { return cache } // get a shallow clone of the base cache with swagger and json schema return resCache.ShallowClone() } spec-0.21.0/cache_test.go000066400000000000000000000012441457312531500151640ustar00rootroot00000000000000package spec import ( "testing" "github.com/stretchr/testify/assert" ) func TestDefaultResolutionCache(t *testing.T) { jsonSchema := MustLoadJSONSchemaDraft04() swaggerSchema := MustLoadSwagger20Schema() cache := defaultResolutionCache() sch, ok := cache.Get("not there") assert.False(t, ok) assert.Nil(t, sch) sch, ok = cache.Get("http://swagger.io/v2/schema.json") assert.True(t, ok) assert.Equal(t, swaggerSchema, sch) sch, ok = cache.Get("http://json-schema.org/draft-04/schema") assert.True(t, ok) assert.Equal(t, jsonSchema, sch) cache.Set("something", "here") sch, ok = cache.Get("something") assert.True(t, ok) assert.Equal(t, "here", sch) } spec-0.21.0/circular_test.go000066400000000000000000000233731457312531500157340ustar00rootroot00000000000000package spec import ( "encoding/json" "net/http" "net/http/httptest" "os" "path/filepath" "testing" "time" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestExpandCircular_Issue3(t *testing.T) { jazon, root := expandThisOrDieTrying(t, "fixtures/expansion/overflow.json") require.NotEmpty(t, jazon) // circular $ref point to the expanded root document assertRefInJSON(t, jazon, "#/definitions") // verify that all $ref can resolved against the new root schema assertRefResolve(t, jazon, "", root) // verify that all $ref can be expanded in the new root schema assertRefExpand(t, jazon, "", root) } func TestExpandCircular_RefExpansion(t *testing.T) { basePath := filepath.Join("fixtures", "expansion", "circularRefs.json") carsDoc, err := jsonDoc(basePath) require.NoError(t, err) spec := new(Swagger) require.NoError(t, json.Unmarshal(carsDoc, spec)) resolver := defaultSchemaLoader(spec, &ExpandOptions{RelativeBase: basePath}, nil, nil) schema := spec.Definitions["car"] _, err = expandSchema(schema, []string{"#/definitions/car"}, resolver, normalizeBase(basePath)) require.NoError(t, err) jazon := asJSON(t, schema) // circular $ref point to the expanded root document // there are only 2 types with circular definitions assertRefInJSONRegexp(t, jazon, "#/definitions/(car|category)") // verify that all $ref can resolved against the new root schema assertRefResolve(t, jazon, "", spec) // verify that all $ref can be expanded in the new root schema assertRefExpand(t, jazon, "", spec) } func TestExpandCircular_Spec2Expansion(t *testing.T) { // TODO: assert repeatable results (see commented section below) fixturePath := filepath.Join("fixtures", "expansion", "circular-minimal.json") jazon, root := expandThisOrDieTrying(t, fixturePath) require.NotEmpty(t, jazon) // circular $ref are not always the same, but they sure are one of the nodes assertRefInJSONRegexp(t, jazon, `#/definitions/node\d+`) // circular $ref always resolve against the root assertRefResolve(t, jazon, "", root) // assert stripped $ref in result assert.NotContainsf(t, jazon, "circular-minimal.json#/", "expected %s to be expanded with stripped circular $ref", fixturePath) fixturePath = filepath.Join("fixtures", "expansion", "circularSpec2.json") jazon, root = expandThisOrDieTrying(t, fixturePath) require.NotEmpty(t, jazon) // circular $ref resolved against the expanded root document assertRefInJSON(t, jazon, `#/definitions/`) // circular $ref always resolve against the root assertRefResolve(t, jazon, "", root) // circular $ref can always be further expanded against the root assertRefExpand(t, jazon, "", root) assert.NotContainsf(t, jazon, "circularSpec.json#/", "expected %s to be expanded with stripped circular $ref", fixturePath) /* At the moment, the result of expanding circular references is not stable, when several cycles have intersections: the spec structure is randomly walked through and mutating as expansion is carried out. detected cycles in $ref are not necessarily the shortest matches. This may result in different, functionally correct expanded specs (e.g. with same validations) for i := 0; i < 1; i++ { bbb := expandThisOrDieTrying(t, fixturePath) t.Log(bbb) if !assert.JSONEqf(t, jazon, bbb, "on iteration %d, we should have stable expanded spec", i) { t.FailNow() return } } */ } func TestExpandCircular_MoreCircular(t *testing.T) { // Additional testcase for circular $ref (from go-openapi/validate): // - $ref with file = current file // - circular is located in remote file // // There are 4 variants to run: // - with/without $ref with local file (so its not really remote) // - with circular in a schema in #/responses // - with circular in a schema in #/parameters fixturePath := filepath.Join("fixtures", "more_circulars", "spec.json") jazon, root := expandThisOrDieTrying(t, fixturePath) require.NotEmpty(t, jazon) assertRefInJSON(t, jazon, "item.json#/item") assertRefResolve(t, jazon, "", root, &ExpandOptions{RelativeBase: fixturePath}) fixturePath = filepath.Join("fixtures", "more_circulars", "spec2.json") jazon, root = expandThisOrDieTrying(t, fixturePath) require.NotEmpty(t, jazon) assertRefInJSON(t, jazon, "item2.json#/item") assertRefResolve(t, jazon, "", root, &ExpandOptions{RelativeBase: fixturePath}) fixturePath = filepath.Join("fixtures", "more_circulars", "spec3.json") jazon, root = expandThisOrDieTrying(t, fixturePath) require.NotEmpty(t, jazon) assertRefInJSON(t, jazon, "item.json#/item") assertRefResolve(t, jazon, "", root, &ExpandOptions{RelativeBase: fixturePath}) fixturePath = filepath.Join("fixtures", "more_circulars", "spec4.json") jazon, root = expandThisOrDieTrying(t, fixturePath) require.NotEmpty(t, jazon) assertRefInJSON(t, jazon, "item4.json#/item") assertRefResolve(t, jazon, "", root, &ExpandOptions{RelativeBase: fixturePath}) } func TestExpandCircular_Issue957(t *testing.T) { fixturePath := filepath.Join("fixtures", "bugs", "957", "fixture-957.json") jazon, root := expandThisOrDieTrying(t, fixturePath) require.NotEmpty(t, jazon) require.NotContainsf(t, jazon, "fixture-957.json#/", "expected %s to be expanded with stripped circular $ref", fixturePath) assertRefInJSON(t, jazon, "#/definitions/") assertRefResolve(t, jazon, "", root) assertRefExpand(t, jazon, "", root) } func TestExpandCircular_Bitbucket(t *testing.T) { // Additional testcase for circular $ref (from bitbucket api) fixturePath := filepath.Join("fixtures", "more_circulars", "bitbucket.json") jazon, root := expandThisOrDieTrying(t, fixturePath) require.NotEmpty(t, jazon) assertRefInJSON(t, jazon, "#/definitions/") assertRefResolve(t, jazon, "", root) assertRefExpand(t, jazon, "", root) } func TestExpandCircular_ResponseWithRoot(t *testing.T) { rootDoc := new(Swagger) b, err := os.ReadFile(filepath.Join("fixtures", "more_circulars", "resp.json")) require.NoError(t, err) require.NoError(t, json.Unmarshal(b, rootDoc)) path := rootDoc.Paths.Paths["/api/v1/getx"] resp := path.Post.Responses.StatusCodeResponses[200] thisCache := cacheOrDefault(nil) // during the first response expand, refs are getting expanded, // so the following expands cannot properly resolve them w/o the document. // this happens in validator.Validate() when different validators try to expand the same mutable response. require.NoError(t, ExpandResponseWithRoot(&resp, rootDoc, thisCache)) jazon := asJSON(t, resp) assertRefInJSON(t, jazon, "#/definitions/MyObj") // do it again require.NoError(t, ExpandResponseWithRoot(&resp, rootDoc, thisCache)) jazon = asJSON(t, resp) assertRefInJSON(t, jazon, "#/definitions/MyObj") } func TestExpandCircular_Issue415(t *testing.T) { jazon, root := expandThisOrDieTrying(t, filepath.Join("fixtures", "expansion", "clickmeter.json")) require.NotEmpty(t, jazon) assertRefInJSON(t, jazon, "#/definitions/") assertRefResolve(t, jazon, "", root) assertRefExpand(t, jazon, "", root) } func TestExpandCircular_SpecExpansion(t *testing.T) { jazon, root := expandThisOrDieTrying(t, filepath.Join("fixtures", "expansion", "circularSpec.json")) require.NotEmpty(t, jazon) assertRefInJSON(t, jazon, "#/definitions/Book") assertRefResolve(t, jazon, "", root) assertRefExpand(t, jazon, "", root) } func TestExpandCircular_RemoteCircularID(t *testing.T) { go func() { err := http.ListenAndServe("localhost:1234", http.FileServer(http.Dir("fixtures/more_circulars/remote"))) //#nosec if err != nil { panic(err.Error()) } }() time.Sleep(100 * time.Millisecond) // from json-schema test suite testcase for remote with circular ID fixturePath := "http://localhost:1234/tree" jazon, root := expandThisSchemaOrDieTrying(t, fixturePath) assertRefResolve(t, jazon, "", root, &ExpandOptions{RelativeBase: fixturePath}) assertRefExpand(t, jazon, "", root, &ExpandOptions{RelativeBase: fixturePath}) require.NoError(t, ExpandSchemaWithBasePath(root, nil, &ExpandOptions{})) jazon = asJSON(t, root) assertRefInJSONRegexp(t, jazon, "^http://localhost:1234/tree$") // $ref now point to the root doc // a spec using the previous circular schema fixtureSpecPath := filepath.Join("fixtures", "more_circulars", "with-id.json") jazon, doc := expandThisOrDieTrying(t, fixtureSpecPath) assertRefInJSON(t, jazon, fixturePath) // all remaining $ref's point to the circular ID (http://...) // ResolveRef fails, because there are some remote $ref, but ResolveRefWithBasePath is successful assertRefResolve(t, jazon, "", doc, &ExpandOptions{}) assertRefExpand(t, jazon, "", doc) } func TestCircular_RemoteExpandAzure(t *testing.T) { // local copy of : https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/network/resource-manager/Microsoft.Network/stable/2020-04-01/publicIpAddress.json server := httptest.NewServer(http.FileServer(http.Dir("fixtures/azure"))) defer server.Close() basePath := server.URL + "/publicIpAddress.json" jazon, sch := expandThisOrDieTrying(t, basePath) // check a pointer with escaped path pth1, err := ResolvePathItem(sch, MustCreateRef("#/paths/~1subscriptions~1%7BsubscriptionId%7D~1providers~1Microsoft.Network~1publicIPAddresses"), nil) require.NoError(t, err) require.NotNil(t, pth1) // check expected remaining $ref assertRefInJSONRegexp(t, jazon, `^(#/definitions/)|(networkInterface.json#/definitions/)|(networkSecurityGroup.json#/definitions/)|(network.json#/definitions)|(virtualNetworkTap.json#/definitions/)|(virtualNetwork.json#/definitions/)|(privateEndpoint.json#/definitions/)|(\./examples/)`) // check all $ref resolve in the expanded root // (filter out the remaining $ref in x-ms-example extensions, which are not expanded) t.Run("resolve $ref azure", func(t *testing.T) { assertRefResolve(t, jazon, `\./example`, sch, &ExpandOptions{RelativeBase: basePath}) }) } spec-0.21.0/contact_info.go000066400000000000000000000031141457312531500155260ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "encoding/json" "github.com/go-openapi/swag" ) // ContactInfo contact information for the exposed API. // // For more information: http://goo.gl/8us55a#contactObject type ContactInfo struct { ContactInfoProps VendorExtensible } // ContactInfoProps hold the properties of a ContactInfo object type ContactInfoProps struct { Name string `json:"name,omitempty"` URL string `json:"url,omitempty"` Email string `json:"email,omitempty"` } // UnmarshalJSON hydrates ContactInfo from json func (c *ContactInfo) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &c.ContactInfoProps); err != nil { return err } return json.Unmarshal(data, &c.VendorExtensible) } // MarshalJSON produces ContactInfo as json func (c ContactInfo) MarshalJSON() ([]byte, error) { b1, err := json.Marshal(c.ContactInfoProps) if err != nil { return nil, err } b2, err := json.Marshal(c.VendorExtensible) if err != nil { return nil, err } return swag.ConcatJSON(b1, b2), nil } spec-0.21.0/contact_info_test.go000066400000000000000000000027071457312531500165740ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "encoding/json" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) const contactInfoJSON = `{ "name": "wordnik api team", "url": "http://developer.wordnik.com", "email": "some@mailayada.dkdkd", "x-teams": "test team" }` var contactInfo = ContactInfo{ContactInfoProps: ContactInfoProps{ Name: "wordnik api team", URL: "http://developer.wordnik.com", Email: "some@mailayada.dkdkd", }, VendorExtensible: VendorExtensible{Extensions: map[string]interface{}{"x-teams": "test team"}}} func TestIntegrationContactInfo(t *testing.T) { b, err := json.MarshalIndent(contactInfo, "", "\t") require.NoError(t, err) assert.Equal(t, contactInfoJSON, string(b)) actual := ContactInfo{} err = json.Unmarshal([]byte(contactInfoJSON), &actual) require.NoError(t, err) assert.EqualValues(t, contactInfo, actual) } spec-0.21.0/debug.go000066400000000000000000000024271457312531500141540ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "fmt" "log" "os" "path" "runtime" ) // Debug is true when the SWAGGER_DEBUG env var is not empty. // // It enables a more verbose logging of this package. var Debug = os.Getenv("SWAGGER_DEBUG") != "" var ( // specLogger is a debug logger for this package specLogger *log.Logger ) func init() { debugOptions() } func debugOptions() { specLogger = log.New(os.Stdout, "spec:", log.LstdFlags) } func debugLog(msg string, args ...interface{}) { // A private, trivial trace logger, based on go-openapi/spec/expander.go:debugLog() if Debug { _, file1, pos1, _ := runtime.Caller(1) specLogger.Printf("%s:%d: %s", path.Base(file1), pos1, fmt.Sprintf(msg, args...)) } } spec-0.21.0/debug_test.go000066400000000000000000000024351457312531500152120ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "os" "sync" "testing" "github.com/stretchr/testify/assert" ) var ( logMutex = &sync.Mutex{} ) func TestDebug(t *testing.T) { tmpFile, _ := os.CreateTemp("", "debug-test") tmpName := tmpFile.Name() defer func() { Debug = false // mutex for -race logMutex.Unlock() _ = os.Remove(tmpName) }() // mutex for -race logMutex.Lock() Debug = true debugOptions() defer func() { specLogger.SetOutput(os.Stdout) }() specLogger.SetOutput(tmpFile) debugLog("A debug") Debug = false _ = tmpFile.Close() flushed, _ := os.Open(tmpName) buf := make([]byte, 500) _, _ = flushed.Read(buf) specLogger.SetOutput(os.Stdout) assert.Contains(t, string(buf), "A debug") } spec-0.21.0/embed.go000066400000000000000000000005341457312531500141370ustar00rootroot00000000000000package spec import ( "embed" "path" ) //go:embed schemas/*.json schemas/*/*.json var assets embed.FS func jsonschemaDraft04JSONBytes() ([]byte, error) { return assets.ReadFile(path.Join("schemas", "jsonschema-draft-04.json")) } func v2SchemaJSONBytes() ([]byte, error) { return assets.ReadFile(path.Join("schemas", "v2", "schema.json")) } spec-0.21.0/errors.go000066400000000000000000000016061457312531500144000ustar00rootroot00000000000000package spec import "errors" // Error codes var ( // ErrUnknownTypeForReference indicates that a resolved reference was found in an unsupported container type ErrUnknownTypeForReference = errors.New("unknown type for the resolved reference") // ErrResolveRefNeedsAPointer indicates that a $ref target must be a valid JSON pointer ErrResolveRefNeedsAPointer = errors.New("resolve ref: target needs to be a pointer") // ErrDerefUnsupportedType indicates that a resolved reference was found in an unsupported container type. // At the moment, $ref are supported only inside: schemas, parameters, responses, path items ErrDerefUnsupportedType = errors.New("deref: unsupported type") // ErrExpandUnsupportedType indicates that $ref expansion is attempted on some invalid type ErrExpandUnsupportedType = errors.New("expand: unsupported type. Input should be of type *Parameter or *Response") ) spec-0.21.0/expander.go000066400000000000000000000422171457312531500146750ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "encoding/json" "fmt" ) // ExpandOptions provides options for the spec expander. // // RelativeBase is the path to the root document. This can be a remote URL or a path to a local file. // // If left empty, the root document is assumed to be located in the current working directory: // all relative $ref's will be resolved from there. // // PathLoader injects a document loading method. By default, this resolves to the function provided by the SpecLoader package variable. type ExpandOptions struct { RelativeBase string // the path to the root document to expand. This is a file, not a directory SkipSchemas bool // do not expand schemas, just paths, parameters and responses ContinueOnError bool // continue expanding even after and error is found PathLoader func(string) (json.RawMessage, error) `json:"-"` // the document loading method that takes a path as input and yields a json document AbsoluteCircularRef bool // circular $ref remaining after expansion remain absolute URLs } func optionsOrDefault(opts *ExpandOptions) *ExpandOptions { if opts != nil { clone := *opts // shallow clone to avoid internal changes to be propagated to the caller if clone.RelativeBase != "" { clone.RelativeBase = normalizeBase(clone.RelativeBase) } // if the relative base is empty, let the schema loader choose a pseudo root document return &clone } return &ExpandOptions{} } // ExpandSpec expands the references in a swagger spec func ExpandSpec(spec *Swagger, options *ExpandOptions) error { options = optionsOrDefault(options) resolver := defaultSchemaLoader(spec, options, nil, nil) specBasePath := options.RelativeBase if !options.SkipSchemas { for key, definition := range spec.Definitions { parentRefs := make([]string, 0, 10) parentRefs = append(parentRefs, "#/definitions/"+key) def, err := expandSchema(definition, parentRefs, resolver, specBasePath) if resolver.shouldStopOnError(err) { return err } if def != nil { spec.Definitions[key] = *def } } } for key := range spec.Parameters { parameter := spec.Parameters[key] if err := expandParameterOrResponse(¶meter, resolver, specBasePath); resolver.shouldStopOnError(err) { return err } spec.Parameters[key] = parameter } for key := range spec.Responses { response := spec.Responses[key] if err := expandParameterOrResponse(&response, resolver, specBasePath); resolver.shouldStopOnError(err) { return err } spec.Responses[key] = response } if spec.Paths != nil { for key := range spec.Paths.Paths { pth := spec.Paths.Paths[key] if err := expandPathItem(&pth, resolver, specBasePath); resolver.shouldStopOnError(err) { return err } spec.Paths.Paths[key] = pth } } return nil } const rootBase = ".root" // baseForRoot loads in the cache the root document and produces a fake ".root" base path entry // for further $ref resolution func baseForRoot(root interface{}, cache ResolutionCache) string { // cache the root document to resolve $ref's normalizedBase := normalizeBase(rootBase) if root == nil { // ensure that we never leave a nil root: always cache the root base pseudo-document cachedRoot, found := cache.Get(normalizedBase) if found && cachedRoot != nil { // the cache is already preloaded with a root return normalizedBase } root = map[string]interface{}{} } cache.Set(normalizedBase, root) return normalizedBase } // ExpandSchema expands the refs in the schema object with reference to the root object. // // go-openapi/validate uses this function. // // Notice that it is impossible to reference a json schema in a different document other than root // (use ExpandSchemaWithBasePath to resolve external references). // // Setting the cache is optional and this parameter may safely be left to nil. func ExpandSchema(schema *Schema, root interface{}, cache ResolutionCache) error { cache = cacheOrDefault(cache) if root == nil { root = schema } opts := &ExpandOptions{ // when a root is specified, cache the root as an in-memory document for $ref retrieval RelativeBase: baseForRoot(root, cache), SkipSchemas: false, ContinueOnError: false, } return ExpandSchemaWithBasePath(schema, cache, opts) } // ExpandSchemaWithBasePath expands the refs in the schema object, base path configured through expand options. // // Setting the cache is optional and this parameter may safely be left to nil. func ExpandSchemaWithBasePath(schema *Schema, cache ResolutionCache, opts *ExpandOptions) error { if schema == nil { return nil } cache = cacheOrDefault(cache) opts = optionsOrDefault(opts) resolver := defaultSchemaLoader(nil, opts, cache, nil) parentRefs := make([]string, 0, 10) s, err := expandSchema(*schema, parentRefs, resolver, opts.RelativeBase) if err != nil { return err } if s != nil { // guard for when continuing on error *schema = *s } return nil } func expandItems(target Schema, parentRefs []string, resolver *schemaLoader, basePath string) (*Schema, error) { if target.Items == nil { return &target, nil } // array if target.Items.Schema != nil { t, err := expandSchema(*target.Items.Schema, parentRefs, resolver, basePath) if err != nil { return nil, err } *target.Items.Schema = *t } // tuple for i := range target.Items.Schemas { t, err := expandSchema(target.Items.Schemas[i], parentRefs, resolver, basePath) if err != nil { return nil, err } target.Items.Schemas[i] = *t } return &target, nil } func expandSchema(target Schema, parentRefs []string, resolver *schemaLoader, basePath string) (*Schema, error) { if target.Ref.String() == "" && target.Ref.IsRoot() { newRef := normalizeRef(&target.Ref, basePath) target.Ref = *newRef return &target, nil } // change the base path of resolution when an ID is encountered // otherwise the basePath should inherit the parent's if target.ID != "" { basePath, _ = resolver.setSchemaID(target, target.ID, basePath) } if target.Ref.String() != "" { if !resolver.options.SkipSchemas { return expandSchemaRef(target, parentRefs, resolver, basePath) } // when "expand" with SkipSchema, we just rebase the existing $ref without replacing // the full schema. rebasedRef, err := NewRef(normalizeURI(target.Ref.String(), basePath)) if err != nil { return nil, err } target.Ref = denormalizeRef(&rebasedRef, resolver.context.basePath, resolver.context.rootID) return &target, nil } for k := range target.Definitions { tt, err := expandSchema(target.Definitions[k], parentRefs, resolver, basePath) if resolver.shouldStopOnError(err) { return &target, err } if tt != nil { target.Definitions[k] = *tt } } t, err := expandItems(target, parentRefs, resolver, basePath) if resolver.shouldStopOnError(err) { return &target, err } if t != nil { target = *t } for i := range target.AllOf { t, err := expandSchema(target.AllOf[i], parentRefs, resolver, basePath) if resolver.shouldStopOnError(err) { return &target, err } if t != nil { target.AllOf[i] = *t } } for i := range target.AnyOf { t, err := expandSchema(target.AnyOf[i], parentRefs, resolver, basePath) if resolver.shouldStopOnError(err) { return &target, err } if t != nil { target.AnyOf[i] = *t } } for i := range target.OneOf { t, err := expandSchema(target.OneOf[i], parentRefs, resolver, basePath) if resolver.shouldStopOnError(err) { return &target, err } if t != nil { target.OneOf[i] = *t } } if target.Not != nil { t, err := expandSchema(*target.Not, parentRefs, resolver, basePath) if resolver.shouldStopOnError(err) { return &target, err } if t != nil { *target.Not = *t } } for k := range target.Properties { t, err := expandSchema(target.Properties[k], parentRefs, resolver, basePath) if resolver.shouldStopOnError(err) { return &target, err } if t != nil { target.Properties[k] = *t } } if target.AdditionalProperties != nil && target.AdditionalProperties.Schema != nil { t, err := expandSchema(*target.AdditionalProperties.Schema, parentRefs, resolver, basePath) if resolver.shouldStopOnError(err) { return &target, err } if t != nil { *target.AdditionalProperties.Schema = *t } } for k := range target.PatternProperties { t, err := expandSchema(target.PatternProperties[k], parentRefs, resolver, basePath) if resolver.shouldStopOnError(err) { return &target, err } if t != nil { target.PatternProperties[k] = *t } } for k := range target.Dependencies { if target.Dependencies[k].Schema != nil { t, err := expandSchema(*target.Dependencies[k].Schema, parentRefs, resolver, basePath) if resolver.shouldStopOnError(err) { return &target, err } if t != nil { *target.Dependencies[k].Schema = *t } } } if target.AdditionalItems != nil && target.AdditionalItems.Schema != nil { t, err := expandSchema(*target.AdditionalItems.Schema, parentRefs, resolver, basePath) if resolver.shouldStopOnError(err) { return &target, err } if t != nil { *target.AdditionalItems.Schema = *t } } return &target, nil } func expandSchemaRef(target Schema, parentRefs []string, resolver *schemaLoader, basePath string) (*Schema, error) { // if a Ref is found, all sibling fields are skipped // Ref also changes the resolution scope of children expandSchema // here the resolution scope is changed because a $ref was encountered normalizedRef := normalizeRef(&target.Ref, basePath) normalizedBasePath := normalizedRef.RemoteURI() if resolver.isCircular(normalizedRef, basePath, parentRefs...) { // this means there is a cycle in the recursion tree: return the Ref // - circular refs cannot be expanded. We leave them as ref. // - denormalization means that a new local file ref is set relative to the original basePath debugLog("short circuit circular ref: basePath: %s, normalizedPath: %s, normalized ref: %s", basePath, normalizedBasePath, normalizedRef.String()) if !resolver.options.AbsoluteCircularRef { target.Ref = denormalizeRef(normalizedRef, resolver.context.basePath, resolver.context.rootID) } else { target.Ref = *normalizedRef } return &target, nil } var t *Schema err := resolver.Resolve(&target.Ref, &t, basePath) if resolver.shouldStopOnError(err) { return nil, err } if t == nil { // guard for when continuing on error return &target, nil } parentRefs = append(parentRefs, normalizedRef.String()) transitiveResolver := resolver.transitiveResolver(basePath, target.Ref) basePath = resolver.updateBasePath(transitiveResolver, normalizedBasePath) return expandSchema(*t, parentRefs, transitiveResolver, basePath) } func expandPathItem(pathItem *PathItem, resolver *schemaLoader, basePath string) error { if pathItem == nil { return nil } parentRefs := make([]string, 0, 10) if err := resolver.deref(pathItem, parentRefs, basePath); resolver.shouldStopOnError(err) { return err } if pathItem.Ref.String() != "" { transitiveResolver := resolver.transitiveResolver(basePath, pathItem.Ref) basePath = transitiveResolver.updateBasePath(resolver, basePath) resolver = transitiveResolver } pathItem.Ref = Ref{} for i := range pathItem.Parameters { if err := expandParameterOrResponse(&(pathItem.Parameters[i]), resolver, basePath); resolver.shouldStopOnError(err) { return err } } ops := []*Operation{ pathItem.Get, pathItem.Head, pathItem.Options, pathItem.Put, pathItem.Post, pathItem.Patch, pathItem.Delete, } for _, op := range ops { if err := expandOperation(op, resolver, basePath); resolver.shouldStopOnError(err) { return err } } return nil } func expandOperation(op *Operation, resolver *schemaLoader, basePath string) error { if op == nil { return nil } for i := range op.Parameters { param := op.Parameters[i] if err := expandParameterOrResponse(¶m, resolver, basePath); resolver.shouldStopOnError(err) { return err } op.Parameters[i] = param } if op.Responses == nil { return nil } responses := op.Responses if err := expandParameterOrResponse(responses.Default, resolver, basePath); resolver.shouldStopOnError(err) { return err } for code := range responses.StatusCodeResponses { response := responses.StatusCodeResponses[code] if err := expandParameterOrResponse(&response, resolver, basePath); resolver.shouldStopOnError(err) { return err } responses.StatusCodeResponses[code] = response } return nil } // ExpandResponseWithRoot expands a response based on a root document, not a fetchable document // // Notice that it is impossible to reference a json schema in a different document other than root // (use ExpandResponse to resolve external references). // // Setting the cache is optional and this parameter may safely be left to nil. func ExpandResponseWithRoot(response *Response, root interface{}, cache ResolutionCache) error { cache = cacheOrDefault(cache) opts := &ExpandOptions{ RelativeBase: baseForRoot(root, cache), } resolver := defaultSchemaLoader(root, opts, cache, nil) return expandParameterOrResponse(response, resolver, opts.RelativeBase) } // ExpandResponse expands a response based on a basepath // // All refs inside response will be resolved relative to basePath func ExpandResponse(response *Response, basePath string) error { opts := optionsOrDefault(&ExpandOptions{ RelativeBase: basePath, }) resolver := defaultSchemaLoader(nil, opts, nil, nil) return expandParameterOrResponse(response, resolver, opts.RelativeBase) } // ExpandParameterWithRoot expands a parameter based on a root document, not a fetchable document. // // Notice that it is impossible to reference a json schema in a different document other than root // (use ExpandParameter to resolve external references). func ExpandParameterWithRoot(parameter *Parameter, root interface{}, cache ResolutionCache) error { cache = cacheOrDefault(cache) opts := &ExpandOptions{ RelativeBase: baseForRoot(root, cache), } resolver := defaultSchemaLoader(root, opts, cache, nil) return expandParameterOrResponse(parameter, resolver, opts.RelativeBase) } // ExpandParameter expands a parameter based on a basepath. // This is the exported version of expandParameter // all refs inside parameter will be resolved relative to basePath func ExpandParameter(parameter *Parameter, basePath string) error { opts := optionsOrDefault(&ExpandOptions{ RelativeBase: basePath, }) resolver := defaultSchemaLoader(nil, opts, nil, nil) return expandParameterOrResponse(parameter, resolver, opts.RelativeBase) } func getRefAndSchema(input interface{}) (*Ref, *Schema, error) { var ( ref *Ref sch *Schema ) switch refable := input.(type) { case *Parameter: if refable == nil { return nil, nil, nil } ref = &refable.Ref sch = refable.Schema case *Response: if refable == nil { return nil, nil, nil } ref = &refable.Ref sch = refable.Schema default: return nil, nil, fmt.Errorf("unsupported type: %T: %w", input, ErrExpandUnsupportedType) } return ref, sch, nil } func expandParameterOrResponse(input interface{}, resolver *schemaLoader, basePath string) error { ref, sch, err := getRefAndSchema(input) if err != nil { return err } if ref == nil && sch == nil { // nothing to do return nil } parentRefs := make([]string, 0, 10) if ref != nil { // dereference this $ref if err = resolver.deref(input, parentRefs, basePath); resolver.shouldStopOnError(err) { return err } ref, sch, _ = getRefAndSchema(input) } if ref.String() != "" { transitiveResolver := resolver.transitiveResolver(basePath, *ref) basePath = resolver.updateBasePath(transitiveResolver, basePath) resolver = transitiveResolver } if sch == nil { // nothing to be expanded if ref != nil { *ref = Ref{} } return nil } if sch.Ref.String() != "" { rebasedRef, ern := NewRef(normalizeURI(sch.Ref.String(), basePath)) if ern != nil { return ern } if resolver.isCircular(&rebasedRef, basePath, parentRefs...) { // this is a circular $ref: stop expansion if !resolver.options.AbsoluteCircularRef { sch.Ref = denormalizeRef(&rebasedRef, resolver.context.basePath, resolver.context.rootID) } else { sch.Ref = rebasedRef } } } // $ref expansion or rebasing is performed by expandSchema below if ref != nil { *ref = Ref{} } // expand schema // yes, we do it even if options.SkipSchema is true: we have to go down that rabbit hole and rebase nested $ref) s, err := expandSchema(*sch, parentRefs, resolver, basePath) if resolver.shouldStopOnError(err) { return err } if s != nil { // guard for when continuing on error *sch = *s } return nil } spec-0.21.0/expander_test.go000066400000000000000000001250571457312531500157400ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "encoding/json" "io" "log" "net/http" "net/http/httptest" "os" "path/filepath" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) const ( crossFileRefFixture = "fixtures/expansion/crossFileRef.json" withoutSchemaID = "removed" withSchemaID = "schema" pathItemsFixture = "fixtures/expansion/pathItems.json" extraRefFixture = "fixtures/expansion/extraRef.json" ) var ( // PetStoreJSONMessage json raw message for Petstore20 PetStoreJSONMessage = json.RawMessage([]byte(PetStore20)) specs = filepath.Join("fixtures", "specs") ) func TestExpand_Issue148(t *testing.T) { fp := filepath.Join("fixtures", "bugs", "schema-148.json") b, err := jsonDoc(fp) require.NoError(t, err) assertAdditionalProps := func(sp Swagger) func(*testing.T) { return func(t *testing.T) { require.Len(t, sp.Definitions, 2) require.Contains(t, sp.Definitions, "empty") empty := sp.Definitions["empty"] require.NotNil(t, empty.AdditionalProperties) require.NotNil(t, empty.AdditionalProperties.Schema) require.True(t, empty.AdditionalProperties.Allows) require.Contains(t, sp.Definitions, "false") additionalIsFalse := sp.Definitions["false"] require.NotNil(t, additionalIsFalse.AdditionalProperties) require.Nil(t, additionalIsFalse.AdditionalProperties.Schema) require.False(t, additionalIsFalse.AdditionalProperties.Allows) } } var sp Swagger require.NoError(t, json.Unmarshal(b, &sp)) t.Run("check additional properties", assertAdditionalProps(sp)) require.NoError(t, ExpandSpec(&sp, nil)) t.Run("check additional properties after expansion", assertAdditionalProps(sp)) } func TestExpand_KnownRef(t *testing.T) { // json schema draft 4 meta schema is embedded by default: it resolves without setup schema := RefProperty("http://json-schema.org/draft-04/schema#") require.NoError(t, ExpandSchema(schema, nil, nil)) assert.Equal(t, "Core schema meta-schema", schema.Description) // from the expanded schema, verify that all remaining $ref actually resolve jazon := asJSON(t, schema) assertRefResolve(t, jazon, "", schema) } func TestExpand_ResponseSchema(t *testing.T) { fp := filepath.Join("fixtures", "local_expansion", "spec.json") b, err := jsonDoc(fp) require.NoError(t, err) var spec Swagger require.NoError(t, json.Unmarshal(b, &spec)) require.NoError(t, ExpandSpec(&spec, &ExpandOptions{RelativeBase: fp})) // verify that the document is full expanded jazon := asJSON(t, spec) assertNoRef(t, jazon) sch := spec.Paths.Paths["/item"].Get.Responses.StatusCodeResponses[200].Schema require.NotNil(t, sch) assert.Empty(t, sch.Ref.String()) assert.Contains(t, sch.Type, "object") assert.Len(t, sch.Properties, 2) } func TestExpand_EmptySpec(t *testing.T) { spec := new(Swagger) // expansion of an empty spec require.NoError(t, ExpandSpec(spec, nil)) // expansion of a nil schema var schema *Schema require.NoError(t, ExpandSchemaWithBasePath(schema, nil, nil)) // expansion of a nil paths var paths *PathItem resolver := defaultSchemaLoader(spec, nil, nil, nil) require.NoError(t, expandPathItem(paths, resolver, "")) // expansion of a nil Parameter var param *Parameter require.NoError(t, expandParameterOrResponse(param, resolver, "")) } func TestExpand_Spec(t *testing.T) { // expansion of a rich spec specPath := filepath.Join("fixtures", "expansion", "all-the-things.json") specDoc, err := jsonDoc(specPath) require.NoError(t, err) opts := &ExpandOptions{ RelativeBase: specPath, } spec := new(Swagger) require.NoError(t, json.Unmarshal(specDoc, spec)) // verify the resulting unmarshaled structure pet := spec.Definitions["pet"] errorModel := spec.Definitions["errorModel"] petResponse := spec.Responses["petResponse"] petResponse.Schema = &pet stringResponse := spec.Responses["stringResponse"] tagParam := spec.Parameters["tag"] idParam := spec.Parameters["idParam"] require.NoError(t, ExpandSpec(spec, opts)) // verify that the spec is fully expanded assertNoRef(t, asJSON(t, spec)) assert.Equal(t, tagParam, spec.Parameters["query"]) assert.Equal(t, petResponse, spec.Responses["petResponse"]) assert.Equal(t, petResponse, spec.Responses["anotherPet"]) assert.Equal(t, pet, *spec.Responses["petResponse"].Schema) assert.Equal(t, stringResponse, *spec.Paths.Paths["/"].Get.Responses.Default) assert.Equal(t, petResponse, spec.Paths.Paths["/"].Get.Responses.StatusCodeResponses[200]) assert.Equal(t, pet, *spec.Paths.Paths["/pets"].Get.Responses.StatusCodeResponses[200].Schema.Items.Schema) assert.Equal(t, errorModel, *spec.Paths.Paths["/pets"].Get.Responses.Default.Schema) assert.Equal(t, pet, spec.Definitions["petInput"].AllOf[0]) assert.Equal(t, spec.Definitions["petInput"], *spec.Paths.Paths["/pets"].Post.Parameters[0].Schema) assert.Equal(t, petResponse, spec.Paths.Paths["/pets"].Post.Responses.StatusCodeResponses[200]) assert.Equal(t, errorModel, *spec.Paths.Paths["/pets"].Post.Responses.Default.Schema) pi := spec.Paths.Paths["/pets/{id}"] assert.Equal(t, idParam, pi.Get.Parameters[0]) assert.Equal(t, petResponse, pi.Get.Responses.StatusCodeResponses[200]) assert.Equal(t, errorModel, *pi.Get.Responses.Default.Schema) assert.Equal(t, idParam, pi.Delete.Parameters[0]) assert.Equal(t, errorModel, *pi.Delete.Responses.Default.Schema) } func TestExpand_InternalResponse(t *testing.T) { basePath := normalizeBase(filepath.Join("fixtures", "expansion", "all-the-things.json")) specDoc, err := jsonDoc(basePath) require.NoError(t, err) spec := new(Swagger) require.NoError(t, json.Unmarshal(specDoc, spec)) resolver := defaultSchemaLoader(spec, nil, nil, nil) expectedPet := spec.Responses["petResponse"] require.NoError(t, expandParameterOrResponse(&expectedPet, resolver, basePath)) jazon := asJSON(t, expectedPet) assert.JSONEq(t, `{ "description": "pet response", "schema": { "required": [ "id", "name" ], "properties": { "id": { "type": "integer", "format": "int64" }, "name": { "type": "string" }, "tag": { "type": "string" } } } }`, jazon) // response pointing to the same target: result is unchanged another := spec.Responses["anotherPet"] require.NoError(t, expandParameterOrResponse(&another, resolver, basePath)) assert.Equal(t, expectedPet, another) defaultResponse := spec.Paths.Paths["/"].Get.Responses.Default require.NoError(t, expandParameterOrResponse(defaultResponse, resolver, basePath)) expectedString := spec.Responses["stringResponse"] assert.Equal(t, expectedString, *defaultResponse) // cascading ref successResponse := spec.Paths.Paths["/"].Get.Responses.StatusCodeResponses[200] jazon = asJSON(t, successResponse) assert.JSONEq(t, `{ "$ref": "#/responses/anotherPet" }`, jazon) require.NoError(t, expandParameterOrResponse(&successResponse, resolver, basePath)) assert.Equal(t, expectedPet, successResponse) } func TestExpand_Response(t *testing.T) { basePath := filepath.Join("fixtures", "expansion", "all-the-things.json") specDoc, err := jsonDoc(basePath) require.NoError(t, err) spec := new(Swagger) require.NoError(t, json.Unmarshal(specDoc, spec)) resp := spec.Responses["anotherPet"] expected := spec.Responses["petResponse"] require.NoError(t, ExpandResponse(&expected, basePath)) require.NoError(t, ExpandResponse(&resp, basePath)) assert.Equal(t, expected, resp) resp2 := spec.Paths.Paths["/"].Get.Responses.Default expected = spec.Responses["stringResponse"] require.NoError(t, ExpandResponse(resp2, basePath)) assert.Equal(t, expected, *resp2) resp = spec.Paths.Paths["/"].Get.Responses.StatusCodeResponses[200] expected = spec.Responses["petResponse"] require.NoError(t, ExpandResponse(&resp, basePath)) assert.Equal(t, expected, resp) } func TestExpand_ResponseAndParamWithRoot(t *testing.T) { specDoc, err := jsonDoc("fixtures/bugs/1614/gitea.json") require.NoError(t, err) var spec Swagger err = json.Unmarshal(specDoc, &spec) require.NoError(t, err) // check responses with $ref resp := spec.Paths.Paths["/admin/users"].Post.Responses.StatusCodeResponses[201] require.NoError(t, ExpandResponseWithRoot(&resp, spec, nil)) jazon := asJSON(t, resp) assertNoRef(t, jazon) resp = spec.Paths.Paths["/admin/users"].Post.Responses.StatusCodeResponses[403] require.NoError(t, ExpandResponseWithRoot(&resp, spec, nil)) jazon = asJSON(t, resp) assertNoRef(t, jazon) // check param with $ref param := spec.Paths.Paths["/admin/users"].Post.Parameters[0] require.NoError(t, ExpandParameterWithRoot(¶m, spec, nil)) jazon = asJSON(t, param) assertNoRef(t, jazon) } func TestExpand_InternalParameter(t *testing.T) { basePath := normalizeBase(filepath.Join("fixtures", "expansion", "params.json")) paramDoc, err := jsonDoc(basePath) require.NoError(t, err) spec := new(Swagger) require.NoError(t, json.Unmarshal(paramDoc, spec)) resolver := defaultSchemaLoader(spec, nil, nil, nil) param := spec.Parameters["query"] expected := spec.Parameters["tag"] require.NoError(t, expandParameterOrResponse(¶m, resolver, basePath)) assert.Equal(t, expected, param) param = spec.Paths.Paths["/cars/{id}"].Parameters[0] expected = spec.Parameters["id"] require.NoError(t, expandParameterOrResponse(¶m, resolver, basePath)) assert.Equal(t, expected, param) } func TestExpand_Parameter(t *testing.T) { basePath := filepath.Join("fixtures", "expansion", "params.json") paramDoc, err := jsonDoc(basePath) require.NoError(t, err) spec := new(Swagger) require.NoError(t, json.Unmarshal(paramDoc, spec)) param := spec.Parameters["query"] expected := spec.Parameters["tag"] require.NoError(t, ExpandParameter(¶m, basePath)) assert.Equal(t, expected, param) param = spec.Paths.Paths["/cars/{id}"].Parameters[0] expected = spec.Parameters["id"] require.NoError(t, ExpandParameter(¶m, basePath)) assert.Equal(t, expected, param) } func TestExpand_JSONSchemaDraft4(t *testing.T) { fixturePath := filepath.Join("schemas", "jsonschema-draft-04.json") jazon, sch := expandThisSchemaOrDieTrying(t, fixturePath) // expansion leaves some circular $ref behind: let's assert those // assert all $ref match // "$ref": "http://json-schema.org/draft-04/something" // // Case: Circular $refs against schema ID assertRefInJSONRegexp(t, jazon, `^(http://json-schema.org/draft-04/)|(#/definitions/schemaArray)`) // verify that all remaining $ref may be expanded in the new root schema assertRefExpand(t, jazon, "", sch) } func TestExpand_SwaggerSchema(t *testing.T) { fixturePath := filepath.Join("schemas", "v2", "schema.json") jazon, sch := expandThisSchemaOrDieTrying(t, fixturePath) // expansion leaves some circular $ref behind: let's assert those // assert all $ref match // "$ref": "#/definitions/something" assertRefInJSON(t, jazon, "#/definitions/") // verify that all $ref resolve in the new root schema assertRefExpand(t, jazon, "", sch) } func TestExpand_ContinueOnError(t *testing.T) { specPath := filepath.Join("fixtures", "expansion", "missingRef.json") defer log.SetOutput(os.Stdout) log.SetOutput(io.Discard) // missing $ref in spec missingRefDoc, err := jsonDoc(specPath) require.NoError(t, err) testCase := struct { Input *Swagger `json:"input"` Expected *Swagger `json:"expected"` }{} require.NoError(t, json.Unmarshal(missingRefDoc, &testCase)) opts := &ExpandOptions{ ContinueOnError: true, RelativeBase: specPath, } require.NoError(t, ExpandSpec(testCase.Input, opts)) assert.Equal(t, testCase.Expected, testCase.Input, "Should continue expanding spec when a definition can't be found.") // missing $ref in items doc, err := jsonDoc("fixtures/expansion/missingItemRef.json") require.NoError(t, err) spec := new(Swagger) require.NoError(t, json.Unmarshal(doc, spec)) assert.NotPanics(t, func() { require.NoError(t, ExpandSpec(spec, opts)) }, "Array of missing refs should not cause a panic, and continue to expand spec.") } func TestExpand_InternalSchemas2(t *testing.T) { basePath := normalizeBase(filepath.Join("fixtures", "expansion", "schemas2.json")) carsDoc, err := jsonDoc(basePath) require.NoError(t, err) spec := new(Swagger) require.NoError(t, json.Unmarshal(carsDoc, spec)) resolver := defaultSchemaLoader(spec, nil, nil, nil) // verify unmarshaled structure schema := spec.Definitions["car"] oldBrand := schema.Properties["brand"] require.NotEmpty(t, oldBrand.Items.Schema.Ref.String()) // this is a $ref require.NotEqual(t, spec.Definitions["brand"], oldBrand) _, err = expandSchema(schema, []string{"#/definitions/car"}, resolver, basePath) require.NoError(t, err) // verify expanded schema for Car, in the document passed newBrand := schema.Properties["brand"] assert.Empty(t, newBrand.Items.Schema.Ref.String()) assert.Equal(t, spec.Definitions["brand"], *newBrand.Items.Schema) // verify expanded schema for Truck, in the returned schema schema = spec.Definitions["truck"] require.NotEmpty(t, schema.Items.Schema.Ref.String()) s, err := expandSchema(schema, []string{"#/definitions/truck"}, resolver, basePath) require.NoError(t, err) require.NotNil(t, s) schema = *s assert.Empty(t, schema.Items.Schema.Ref.String()) // no more a $ref assert.False(t, schema.Items.Schema.Ref.IsRoot()) // no more a $ref assert.Equal(t, spec.Definitions["car"], *schema.Items.Schema) sch := new(Schema) _, err = expandSchema(*sch, []string{""}, resolver, basePath) require.NoError(t, err) // verify expanded schema for Batch, in the returned schema schema = spec.Definitions["batch"] s, err = expandSchema(schema, []string{"#/definitions/batch"}, resolver, basePath) require.NoError(t, err) require.NotNil(t, s) schema = *s assert.Empty(t, schema.Items.Schema.Items.Schema.Ref.String()) assert.Equal(t, *schema.Items.Schema.Items.Schema, spec.Definitions["brand"]) // verify expanded schema for Batch2, in the returned schema schema = spec.Definitions["batch2"] s, err = expandSchema(schema, []string{"#/definitions/batch2"}, resolver, basePath) require.NoError(t, err) require.NotNil(t, s) schema = *s assert.Empty(t, schema.Items.Schemas[0].Items.Schema.Ref.String()) assert.Empty(t, schema.Items.Schemas[1].Items.Schema.Ref.String()) assert.Equal(t, *schema.Items.Schemas[0].Items.Schema, spec.Definitions["brand"]) assert.Equal(t, *schema.Items.Schemas[1].Items.Schema, spec.Definitions["tag"]) // verify expanded schema for AllOfBoth, in the returned schema [expand allOf] schema = spec.Definitions["allofBoth"] s, err = expandSchema(schema, []string{"#/definitions/allofBoth"}, resolver, basePath) require.NoError(t, err) require.NotNil(t, s) schema = *s assert.Empty(t, schema.AllOf[0].Items.Schema.Ref.String()) assert.Empty(t, schema.AllOf[1].Items.Schema.Ref.String()) assert.Equal(t, *schema.AllOf[0].Items.Schema, spec.Definitions["brand"]) assert.Equal(t, *schema.AllOf[1].Items.Schema, spec.Definitions["tag"]) // verify expanded schema for AnyOfBoth, in the returned schema [expand anyOf] schema = spec.Definitions["anyofBoth"] s, err = expandSchema(schema, []string{"#/definitions/anyofBoth"}, resolver, basePath) require.NoError(t, err) require.NotNil(t, s) schema = *s assert.Empty(t, schema.AnyOf[0].Items.Schema.Ref.String()) assert.Empty(t, schema.AnyOf[1].Items.Schema.Ref.String()) assert.Equal(t, *schema.AnyOf[0].Items.Schema, spec.Definitions["brand"]) assert.Equal(t, *schema.AnyOf[1].Items.Schema, spec.Definitions["tag"]) // verify expanded schema for OneOfBoth, in the returned schema [expand oneOf] schema = spec.Definitions["oneofBoth"] s, err = expandSchema(schema, []string{"#/definitions/oneofBoth"}, resolver, basePath) require.NoError(t, err) require.NotNil(t, s) schema = *s assert.Empty(t, schema.OneOf[0].Items.Schema.Ref.String()) assert.Empty(t, schema.OneOf[1].Items.Schema.Ref.String()) assert.Equal(t, *schema.OneOf[0].Items.Schema, spec.Definitions["brand"]) assert.Equal(t, *schema.OneOf[1].Items.Schema, spec.Definitions["tag"]) // verify expanded schema for NotSomething, in the returned schema [expand not] schema = spec.Definitions["notSomething"] s, err = expandSchema(schema, []string{"#/definitions/notSomething"}, resolver, basePath) require.NoError(t, err) require.NotNil(t, s) schema = *s assert.Empty(t, schema.Not.Items.Schema.Ref.String()) assert.Equal(t, *schema.Not.Items.Schema, spec.Definitions["tag"]) // verify expanded schema for WithAdditional, in the returned schema [expand additionalProperties] schema = spec.Definitions["withAdditional"] s, err = expandSchema(schema, []string{"#/definitions/withAdditional"}, resolver, basePath) require.NoError(t, err) require.NotNil(t, s) schema = *s assert.Empty(t, schema.AdditionalProperties.Schema.Items.Schema.Ref.String()) assert.Equal(t, *schema.AdditionalProperties.Schema.Items.Schema, spec.Definitions["tag"]) // verify expanded schema for WithAdditionalItems, in the returned schema [expand additionalItems] schema = spec.Definitions["withAdditionalItems"] s, err = expandSchema(schema, []string{"#/definitions/withAdditionalItems"}, resolver, basePath) require.NoError(t, err) require.NotNil(t, s) schema = *s assert.Empty(t, schema.AdditionalItems.Schema.Items.Schema.Ref.String()) assert.Equal(t, *schema.AdditionalItems.Schema.Items.Schema, spec.Definitions["tag"]) // verify expanded schema for WithPattern, in the returned schema [expand PatternProperties] schema = spec.Definitions["withPattern"] s, err = expandSchema(schema, []string{"#/definitions/withPattern"}, resolver, basePath) require.NoError(t, err) require.NotNil(t, s) schema = *s prop := schema.PatternProperties["^x-ab"] assert.Empty(t, prop.Items.Schema.Ref.String()) assert.Equal(t, *prop.Items.Schema, spec.Definitions["tag"]) // verify expanded schema for Deps, in the returned schema [expand dependencies] schema = spec.Definitions["deps"] s, err = expandSchema(schema, []string{"#/definitions/deps"}, resolver, basePath) require.NoError(t, err) require.NotNil(t, s) schema = *s prop2 := schema.Dependencies["something"] assert.Empty(t, prop2.Schema.Items.Schema.Ref.String()) assert.Equal(t, *prop2.Schema.Items.Schema, spec.Definitions["tag"]) // verify expanded schema for Defined, in the returned schema [expand nested definitions] schema = spec.Definitions["defined"] s, err = expandSchema(schema, []string{"#/definitions/defined"}, resolver, basePath) require.NoError(t, err) require.NotNil(t, s) schema = *s prop = schema.Definitions["something"] assert.Empty(t, prop.Items.Schema.Ref.String()) assert.Equal(t, *prop.Items.Schema, spec.Definitions["tag"]) } func TestExpand_InternalSchemas1(t *testing.T) { basePath := normalizeBase(filepath.Join("fixtures", "expansion", "schemas1.json")) carsDoc, err := jsonDoc(basePath) require.NoError(t, err) spec := new(Swagger) require.NoError(t, json.Unmarshal(carsDoc, spec)) resolver := defaultSchemaLoader(spec, nil, nil, nil) schema := spec.Definitions["car"] oldBrand := schema.Properties["brand"] assert.NotEmpty(t, oldBrand.Ref.String()) assert.NotEqual(t, spec.Definitions["brand"], oldBrand) s, err := expandSchema(schema, []string{"#/definitions/car"}, resolver, basePath) require.NoError(t, err) require.NotNil(t, s) schema = *s newBrand := schema.Properties["brand"] assert.Empty(t, newBrand.Ref.String()) assert.Equal(t, spec.Definitions["brand"], newBrand) schema = spec.Definitions["truck"] assert.NotEmpty(t, schema.Ref.String()) s, err = expandSchema(schema, []string{"#/definitions/truck"}, resolver, basePath) require.NoError(t, err) require.NotNil(t, s) schema = *s assert.Empty(t, schema.Ref.String()) assert.Equal(t, spec.Definitions["car"], schema) sch := new(Schema) _, err = expandSchema(*sch, []string{""}, resolver, basePath) require.NoError(t, err) schema = spec.Definitions["batch"] s, err = expandSchema(schema, []string{"#/definitions/batch"}, resolver, basePath) require.NoError(t, err) require.NotNil(t, s) schema = *s assert.Empty(t, schema.Items.Schema.Ref.String()) assert.Equal(t, *schema.Items.Schema, spec.Definitions["brand"]) schema = spec.Definitions["batch2"] s, err = expandSchema(schema, []string{"#/definitions/batch2"}, resolver, basePath) require.NoError(t, err) require.NotNil(t, s) schema = *s assert.Empty(t, schema.Items.Schemas[0].Ref.String()) assert.Empty(t, schema.Items.Schemas[1].Ref.String()) assert.Equal(t, schema.Items.Schemas[0], spec.Definitions["brand"]) assert.Equal(t, schema.Items.Schemas[1], spec.Definitions["tag"]) schema = spec.Definitions["allofBoth"] s, err = expandSchema(schema, []string{"#/definitions/allofBoth"}, resolver, basePath) require.NoError(t, err) require.NotNil(t, s) schema = *s assert.Empty(t, schema.AllOf[0].Ref.String()) assert.Empty(t, schema.AllOf[1].Ref.String()) assert.Equal(t, schema.AllOf[0], spec.Definitions["brand"]) assert.Equal(t, schema.AllOf[1], spec.Definitions["tag"]) schema = spec.Definitions["anyofBoth"] s, err = expandSchema(schema, []string{"#/definitions/anyofBoth"}, resolver, basePath) require.NoError(t, err) require.NotNil(t, s) schema = *s assert.Empty(t, schema.AnyOf[0].Ref.String()) assert.Empty(t, schema.AnyOf[1].Ref.String()) assert.Equal(t, schema.AnyOf[0], spec.Definitions["brand"]) assert.Equal(t, schema.AnyOf[1], spec.Definitions["tag"]) schema = spec.Definitions["oneofBoth"] s, err = expandSchema(schema, []string{"#/definitions/oneofBoth"}, resolver, basePath) require.NoError(t, err) require.NotNil(t, s) schema = *s assert.Empty(t, schema.OneOf[0].Ref.String()) assert.Empty(t, schema.OneOf[1].Ref.String()) assert.Equal(t, schema.OneOf[0], spec.Definitions["brand"]) assert.Equal(t, schema.OneOf[1], spec.Definitions["tag"]) schema = spec.Definitions["notSomething"] s, err = expandSchema(schema, []string{"#/definitions/notSomething"}, resolver, basePath) require.NoError(t, err) require.NotNil(t, s) schema = *s assert.Empty(t, schema.Not.Ref.String()) assert.Equal(t, *schema.Not, spec.Definitions["tag"]) schema = spec.Definitions["withAdditional"] s, err = expandSchema(schema, []string{"#/definitions/withAdditional"}, resolver, basePath) require.NoError(t, err) require.NotNil(t, s) schema = *s assert.Empty(t, schema.AdditionalProperties.Schema.Ref.String()) assert.Equal(t, *schema.AdditionalProperties.Schema, spec.Definitions["tag"]) schema = spec.Definitions["withAdditionalItems"] s, err = expandSchema(schema, []string{"#/definitions/withAdditionalItems"}, resolver, basePath) require.NoError(t, err) require.NotNil(t, s) schema = *s assert.Empty(t, schema.AdditionalItems.Schema.Ref.String()) assert.Equal(t, *schema.AdditionalItems.Schema, spec.Definitions["tag"]) schema = spec.Definitions["withPattern"] s, err = expandSchema(schema, []string{"#/definitions/withPattern"}, resolver, basePath) require.NoError(t, err) require.NotNil(t, s) schema = *s prop := schema.PatternProperties["^x-ab"] assert.Empty(t, prop.Ref.String()) assert.Equal(t, prop, spec.Definitions["tag"]) schema = spec.Definitions["deps"] s, err = expandSchema(schema, []string{"#/definitions/deps"}, resolver, basePath) require.NoError(t, err) require.NotNil(t, s) schema = *s prop2 := schema.Dependencies["something"] assert.Empty(t, prop2.Schema.Ref.String()) assert.Equal(t, *prop2.Schema, spec.Definitions["tag"]) schema = spec.Definitions["defined"] s, err = expandSchema(schema, []string{"#/definitions/defined"}, resolver, basePath) require.NoError(t, err) require.NotNil(t, s) schema = *s prop = schema.Definitions["something"] assert.Empty(t, prop.Ref.String()) assert.Equal(t, prop, spec.Definitions["tag"]) } func TestExpand_RelativeBaseURI(t *testing.T) { server := httptest.NewServer(http.FileServer(http.Dir("fixtures/remote"))) defer server.Close() spec := new(Swagger) require.NoError(t, ExpandSpec(spec, nil)) // this a spec on local fs... specDoc, err := jsonDoc("fixtures/remote/all-the-things.json") require.NoError(t, err) spec = new(Swagger) require.NoError(t, json.Unmarshal(specDoc, spec)) pet := spec.Definitions["pet"] errorModel := spec.Definitions["errorModel"] petResponse := spec.Responses["petResponse"] petResponse.Schema = &pet stringResponse := spec.Responses["stringResponse"] tagParam := spec.Parameters["tag"] idParam := spec.Parameters["idParam"] anotherPet := spec.Responses["anotherPet"] // ... with some $ref with http scheme anotherPet.Ref = MustCreateRef(server.URL + "/" + anotherPet.Ref.String()) opts := &ExpandOptions{ RelativeBase: server.URL + "/all-the-things.json", } require.NoError(t, ExpandResponse(&anotherPet, opts.RelativeBase)) spec.Responses["anotherPet"] = anotherPet circularA := spec.Responses["circularA"] circularA.Ref = MustCreateRef(server.URL + "/" + circularA.Ref.String()) require.NoError(t, ExpandResponse(&circularA, opts.RelativeBase)) // circularA is self-referencing: results in an empty response: this is okay and expected // for the expand use case. The flatten use case should however be expected to fail on this. assert.Empty(t, circularA.Description) assert.Empty(t, circularA.Ref) spec.Responses["circularA"] = circularA // expand again, no issue should arise require.NoError(t, ExpandSpec(spec, opts)) // backRef navigates back to the root document (relative $ref) backRef := spec.Responses["backRef"] require.NoError(t, ExpandResponse(&backRef, opts.RelativeBase)) assert.Equal(t, "pet response", backRef.Description) assert.NotEmpty(t, backRef.Schema) assert.Empty(t, backRef.Ref) assert.Equal(t, tagParam, spec.Parameters["query"]) assert.Equal(t, petResponse, spec.Responses["petResponse"]) assert.Equal(t, petResponse, spec.Responses["anotherPet"]) assert.Equal(t, petResponse, spec.Paths.Paths["/pets"].Post.Responses.StatusCodeResponses[200]) assert.Equal(t, petResponse, spec.Paths.Paths["/"].Get.Responses.StatusCodeResponses[200]) assert.Equal(t, pet, *spec.Paths.Paths["/pets"].Get.Responses.StatusCodeResponses[200].Schema.Items.Schema) assert.Equal(t, pet, *spec.Responses["petResponse"].Schema) assert.Equal(t, pet, spec.Definitions["petInput"].AllOf[0]) assert.Equal(t, spec.Definitions["petInput"], *spec.Paths.Paths["/pets"].Post.Parameters[0].Schema) assert.Equal(t, stringResponse, *spec.Paths.Paths["/"].Get.Responses.Default) assert.Equal(t, errorModel, *spec.Paths.Paths["/pets"].Get.Responses.Default.Schema) assert.Equal(t, errorModel, *spec.Paths.Paths["/pets"].Post.Responses.Default.Schema) pi := spec.Paths.Paths["/pets/{id}"] assert.Equal(t, idParam, pi.Get.Parameters[0]) assert.Equal(t, petResponse, pi.Get.Responses.StatusCodeResponses[200]) assert.Equal(t, idParam, pi.Delete.Parameters[0]) assert.Equal(t, errorModel, *pi.Get.Responses.Default.Schema) assert.Equal(t, errorModel, *pi.Delete.Responses.Default.Schema) } func resolutionContextServer() *httptest.Server { var servedAt string server := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) { if req.URL.Path == "/resolution.json" { b, _ := os.ReadFile(filepath.Join(specs, "resolution.json")) var ctnt map[string]interface{} _ = json.Unmarshal(b, &ctnt) ctnt["id"] = servedAt rw.Header().Set("Content-Type", "application/json") rw.WriteHeader(http.StatusOK) bb, _ := json.Marshal(ctnt) _, _ = rw.Write(bb) return } if req.URL.Path == "/resolution2.json" { b, _ := os.ReadFile(filepath.Join(specs, "resolution2.json")) var ctnt map[string]interface{} _ = json.Unmarshal(b, &ctnt) ctnt["id"] = servedAt rw.Header().Set("Content-Type", "application/json") bb, _ := json.Marshal(ctnt) _, _ = rw.Write(bb) return } if req.URL.Path == "/boolProp.json" { rw.Header().Set("Content-Type", "application/json") b, _ := json.Marshal(map[string]interface{}{ "type": "boolean", }) _, _ = rw.Write(b) return } if req.URL.Path == "/deeper/stringProp.json" { rw.Header().Set("Content-Type", "application/json") b, _ := json.Marshal(map[string]interface{}{ "type": "string", }) _, _ = rw.Write(b) return } if req.URL.Path == "/deeper/arrayProp.json" { rw.Header().Set("Content-Type", "application/json") b, _ := json.Marshal(map[string]interface{}{ "type": "array", "items": map[string]interface{}{ "type": "file", }, }) _, _ = rw.Write(b) return } rw.WriteHeader(http.StatusNotFound) })) servedAt = server.URL return server } func TestExpand_RemoteRefWithResolutionContext(t *testing.T) { server := resolutionContextServer() defer server.Close() tgt := RefSchema(server.URL + "/resolution.json#/definitions/bool") require.NoError(t, ExpandSchema(tgt, nil, nil)) assert.Equal(t, StringOrArray([]string{"boolean"}), tgt.Type) assert.Empty(t, tgt.Ref) } func TestExpandRemoteRef_WithNestedResolutionContext(t *testing.T) { server := resolutionContextServer() defer server.Close() tgt := RefSchema(server.URL + "/resolution.json#/items") require.NoError(t, ExpandSchema(tgt, nil, nil)) require.Empty(t, tgt.Ref) require.NotNil(t, tgt.Items) require.NotNil(t, tgt.Schema) assert.Equal(t, "deeper/", tgt.ID) // schema id is preserved assert.Equal(t, StringOrArray([]string{"string"}), tgt.Items.Schema.Type) assert.Empty(t, tgt.Items.Schema.Ref) } /* This next test will have to wait until we do full $ID analysis for every subschema on every file that is referenced // For now, TestExpandRemoteRef_WithNestedResolutionContext replaces this next test func TestExpandRemoteRef_WithNestedResolutionContext_WithParentID(t *testing.T) { server := resolutionContextServer() defer server.Close() tgt := RefSchema(server.URL + "/resolution.json#/items/items") require.NoError(t, ExpandSchema(tgt, nil, nil)) t.Logf("%s", asJSON(t, tgt)) assert.Equal(t, StringOrArray([]string{"string"}), tgt.Type) } */ func TestExpand_RemoteRefWithNestedResolutionContextWithFragment(t *testing.T) { server := resolutionContextServer() defer server.Close() tgt := RefSchema(server.URL + "/resolution2.json#/items") require.NoError(t, ExpandSchema(tgt, nil, nil)) require.Empty(t, tgt.Ref) require.NotNil(t, tgt.Items) require.NotNil(t, tgt.Schema) assert.Equal(t, "deeper/", tgt.ID) // schema id is preserved assert.Equal(t, StringOrArray([]string{"file"}), tgt.Items.Schema.Type) assert.Empty(t, tgt.Items.Schema.Ref) } func TestExpand_TransitiveRefs(t *testing.T) { basePath := filepath.Join(specs, "todos.json") rawSpec, err := os.ReadFile(basePath) require.NoError(t, err) var spec *Swagger require.NoError(t, json.Unmarshal(rawSpec, &spec)) opts := &ExpandOptions{ RelativeBase: basePath, } require.NoError(t, ExpandSpec(spec, opts)) assert.Equal(t, "todos.stoplight.io", spec.Host) // i.e. not empty jazon := asJSON(t, spec) // verify that the spec has been fully expanded assertNoRef(t, jazon) } func TestExpand_SchemaWithRoot(t *testing.T) { root := new(Swagger) require.NoError(t, json.Unmarshal(PetStoreJSONMessage, root)) // 1. remove ID from root definition origPet := root.Definitions["Pet"] newPet := origPet newPet.ID = "" root.Definitions["Pet"] = newPet expandRootWithID(t, root, withoutSchemaID) // 2. put back ID in Pet definition // nested $ref should fail root.Definitions["Pet"] = origPet expandRootWithID(t, root, withSchemaID) } func expandRootWithID(t testing.TB, root *Swagger, testcase string) { t.Logf("case: expanding $ref to schema without ID, with nested $ref with %s ID", testcase) sch := RefSchema("#/definitions/newPet") err := ExpandSchema(sch, root, nil) if testcase == withSchemaID { require.Errorf(t, err, "expected %s NOT to expand properly because of the ID in the parent schema", sch.Ref.String()) } else { require.NoErrorf(t, err, "expected %s to expand properly", sch.Ref.String()) // verify that the spec has been fully expanded jazon := asJSON(t, sch) assertNoRef(t, jazon) } t.Log("case: expanding $ref to schema without nested $ref") sch = RefSchema("#/definitions/Category") require.NoErrorf(t, ExpandSchema(sch, root, nil), "expected %s to expand properly", sch.Ref.String()) t.Logf("case: expanding $ref to schema with %s ID and nested $ref", testcase) sch = RefSchema("#/definitions/Pet") err = ExpandSchema(sch, root, nil) if testcase == withSchemaID { require.Errorf(t, err, "expected %s NOT to expand properly because of the ID in the parent schema", sch.Ref.String()) } else { require.NoErrorf(t, err, "expected %s to expand properly", sch.Ref.String()) // verify that the spec has been fully expanded jazon := asJSON(t, sch) assertNoRef(t, jazon) } } func TestExpand_PathItem(t *testing.T) { jazon, _ := expandThisOrDieTrying(t, pathItemsFixture) assert.JSONEq(t, `{ "swagger": "2.0", "info": { "title": "PathItems refs", "version": "1.0" }, "paths": { "/todos": { "get": { "responses": { "200": { "description": "List Todos", "schema": { "type": "array", "items": { "type": "string" } } }, "404": { "description": "error" } } } } } }`, jazon) } func TestExpand_ExtraItems(t *testing.T) { jazon, _ := expandThisOrDieTrying(t, extraRefFixture) assert.JSONEq(t, `{ "schemes": [ "http" ], "swagger": "2.0", "info": { "title": "Supported, but non Swagger 20 compliant $ref constructs", "version": "2.1.0" }, "host": "item.com", "basePath": "/extraRefs", "paths": { "/employees": { "get": { "summary": "List Employee Types", "operationId": "LIST-Employees", "parameters": [ { "description": "unsupported $ref in simple param", "type": "array", "items": { "$ref": "#/definitions/arrayType" }, "name": "myQueryParam", "in": "query" } ], "responses": { "200": { "description": "unsupported $ref in header", "schema": { "type": "string" }, "headers": { "X-header": { "type": "array", "items": { "$ref": "#/definitions/headerType" } } } } } } } }, "definitions": { "arrayType": { "type": "integer", "format": "int32" }, "headerType": { "type": "string", "format": "uuid" } } }`, jazon) } func TestExpand_Issue145(t *testing.T) { cwd, err := os.Getwd() require.NoError(t, err) pseudoRoot := normalizeBase(filepath.Join(cwd, rootBase)) // assert the internal behavior of baseForRoot() t.Run("with nil root, empty cache", func(t *testing.T) { cache := defaultResolutionCache() require.Equal(t, pseudoRoot, baseForRoot(nil, cache)) t.Run("empty root is cached", func(t *testing.T) { value, ok := cache.Get(pseudoRoot) require.True(t, ok) // found in cache asMap, ok := value.(map[string]interface{}) require.True(t, ok) require.Empty(t, asMap) }) }) t.Run("with non-nil root, empty cache", func(t *testing.T) { cache := defaultResolutionCache() require.Equal(t, pseudoRoot, baseForRoot(map[string]interface{}{"key": "arbitrary"}, cache)) t.Run("non-empty root is cached", func(t *testing.T) { value, ok := cache.Get(pseudoRoot) require.True(t, ok) // found in cache asMap, ok := value.(map[string]interface{}) require.True(t, ok) require.Contains(t, asMap, "key") require.Equal(t, "arbitrary", asMap["key"]) }) t.Run("with nil root, non-empty cache", func(t *testing.T) { require.Equal(t, pseudoRoot, baseForRoot(nil, cache)) t.Run("non-empty root is kept", func(t *testing.T) { value, ok := cache.Get(pseudoRoot) require.True(t, ok) // found in cache asMap, ok := value.(map[string]interface{}) require.True(t, ok) require.Contains(t, asMap, "key") require.Equal(t, "arbitrary", asMap["key"]) }) }) }) } // PetStore20 json doc for swagger 2.0 pet store const PetStore20 = `{ "swagger": "2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore", "contact": { "name": "Wordnik API Team", "url": "http://developer.wordnik.com" }, "license": { "name": "Creative Commons 4.0 International", "url": "http://creativecommons.org/licenses/by/4.0/" } }, "host": "petstore.swagger.wordnik.com", "basePath": "/api", "schemes": [ "http" ], "paths": { "/pets": { "get": { "security": [ { "basic": [] } ], "tags": [ "Pet Operations" ], "operationId": "getAllPets", "parameters": [ { "name": "status", "in": "query", "description": "The status to filter by", "type": "string" }, { "name": "limit", "in": "query", "description": "The maximum number of results to return", "type": "integer", "format": "int64" } ], "summary": "Finds all pets in the system", "responses": { "200": { "description": "Pet response", "schema": { "type": "array", "items": { "$ref": "#/definitions/Pet" } } }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } }, "post": { "security": [ { "basic": [] } ], "tags": [ "Pet Operations" ], "operationId": "createPet", "summary": "Creates a new pet", "consumes": ["application/x-yaml"], "produces": ["application/x-yaml"], "parameters": [ { "name": "pet", "in": "body", "description": "The Pet to create", "required": true, "schema": { "$ref": "#/definitions/newPet" } } ], "responses": { "200": { "description": "Created Pet response", "schema": { "$ref": "#/definitions/Pet" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } } }, "/pets/{id}": { "delete": { "security": [ { "apiKey": [] } ], "description": "Deletes the Pet by id", "operationId": "deletePet", "parameters": [ { "name": "id", "in": "path", "description": "ID of pet to delete", "required": true, "type": "integer", "format": "int64" } ], "responses": { "204": { "description": "pet deleted" }, "default": { "description": "unexpected error", "schema": { "$ref": "#/definitions/Error" } } } }, "get": { "tags": [ "Pet Operations" ], "operationId": "getPetById", "summary": "Finds the pet by id", "responses": { "200": { "description": "Pet response", "schema": { "$ref": "#/definitions/Pet" } }, "default": { "description": "Unexpected error", "schema": { "$ref": "#/definitions/Error" } } } }, "parameters": [ { "name": "id", "in": "path", "description": "ID of pet", "required": true, "type": "integer", "format": "int64" } ] } }, "definitions": { "Category": { "id": "Category", "properties": { "id": { "format": "int64", "type": "integer" }, "name": { "type": "string" } } }, "Pet": { "id": "Pet", "properties": { "category": { "$ref": "#/definitions/Category" }, "id": { "description": "unique identifier for the pet", "format": "int64", "maximum": 100.0, "minimum": 0.0, "type": "integer" }, "name": { "type": "string" }, "photoUrls": { "items": { "type": "string" }, "type": "array" }, "status": { "description": "pet status in the store", "enum": [ "available", "pending", "sold" ], "type": "string" }, "tags": { "items": { "$ref": "#/definitions/Tag" }, "type": "array" } }, "required": [ "id", "name" ] }, "newPet": { "anyOf": [ { "$ref": "#/definitions/Pet" }, { "required": [ "name" ] } ] }, "Tag": { "id": "Tag", "properties": { "id": { "format": "int64", "type": "integer" }, "name": { "type": "string" } } }, "Error": { "required": [ "code", "message" ], "properties": { "code": { "type": "integer", "format": "int32" }, "message": { "type": "string" } } } }, "consumes": [ "application/json", "application/xml" ], "produces": [ "application/json", "application/xml", "text/plain", "text/html" ], "securityDefinitions": { "basic": { "type": "basic" }, "apiKey": { "type": "apiKey", "in": "header", "name": "X-API-KEY" } } } ` spec-0.21.0/external_docs.go000066400000000000000000000016261457312531500157200ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec // ExternalDocumentation allows referencing an external resource for // extended documentation. // // For more information: http://goo.gl/8us55a#externalDocumentationObject type ExternalDocumentation struct { Description string `json:"description,omitempty"` URL string `json:"url,omitempty"` } spec-0.21.0/external_docs_test.go000066400000000000000000000020561457312531500167550ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "testing" ) func TestIntegrationExternalDocs(t *testing.T) { var extDocs = ExternalDocumentation{Description: "the name", URL: "the url"} const extDocsYAML = "description: the name\nurl: the url\n" const extDocsJSON = `{"description":"the name","url":"the url"}` assertSerializeJSON(t, extDocs, extDocsJSON) assertSerializeYAML(t, extDocs, extDocsYAML) assertParsesJSON(t, extDocsJSON, extDocs) assertParsesYAML(t, extDocsYAML, extDocs) } spec-0.21.0/fixtures/000077500000000000000000000000001457312531500144035ustar00rootroot00000000000000spec-0.21.0/fixtures/azure/000077500000000000000000000000001457312531500155315ustar00rootroot00000000000000spec-0.21.0/fixtures/azure/applicationGateway.json000066400000000000000000003075241457312531500222640ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "title": "NetworkManagementClient", "description": "The Microsoft Azure Network management API provides a RESTful set of web services that interact with Microsoft Azure Networks service to manage your network resources. The API has entities that capture the relationship between an end user and the Microsoft Azure Networks service.", "version": "2020-04-01" }, "host": "management.azure.com", "schemes": [ "https" ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "security": [ { "azure_auth": [ "user_impersonation" ] } ], "securityDefinitions": { "azure_auth": { "type": "oauth2", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "flow": "implicit", "description": "Azure Active Directory OAuth2 Flow.", "scopes": { "user_impersonation": "impersonate your user account" } } }, "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}": { "delete": { "tags": [ "ApplicationGateways" ], "operationId": "ApplicationGateways_Delete", "x-ms-examples": { "Delete ApplicationGateway": { "$ref": "./examples/ApplicationGatewayDelete.json" } }, "description": "Deletes the specified application gateway.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "applicationGatewayName", "in": "path", "required": true, "type": "string", "description": "The name of the application gateway." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "202": { "description": "Accepted and the operation will complete asynchronously." }, "204": { "description": "Request successful. Resource with the specified name does not exist." }, "200": { "description": "Delete successful." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } }, "get": { "tags": [ "ApplicationGateways" ], "operationId": "ApplicationGateways_Get", "x-ms-examples": { "Get ApplicationGateway": { "$ref": "./examples/ApplicationGatewayGet.json" } }, "description": "Gets the specified application gateway.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "applicationGatewayName", "in": "path", "required": true, "type": "string", "description": "The name of the application gateway." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns an ApplicationGateway resource.", "schema": { "$ref": "#/definitions/ApplicationGateway" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } } }, "put": { "tags": [ "ApplicationGateways" ], "operationId": "ApplicationGateways_CreateOrUpdate", "description": "Creates or updates the specified application gateway.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "applicationGatewayName", "in": "path", "required": true, "type": "string", "description": "The name of the application gateway." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ApplicationGateway" }, "description": "Parameters supplied to the create or update application gateway operation." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "201": { "description": "Create successful. The operation returns the resulting ApplicationGateway resource.", "schema": { "$ref": "#/definitions/ApplicationGateway" } }, "200": { "description": "Update successful. The operation returns the resulting ApplicationGateway resource.", "schema": { "$ref": "#/definitions/ApplicationGateway" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Create Application Gateway": { "$ref": "./examples/ApplicationGatewayCreate.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "azure-async-operation" } }, "patch": { "tags": [ "ApplicationGateways" ], "operationId": "ApplicationGateways_UpdateTags", "x-ms-examples": { "Update Application Gateway tags": { "$ref": "./examples/ApplicationGatewayUpdateTags.json" } }, "description": "Updates the specified application gateway tags.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "applicationGatewayName", "in": "path", "required": true, "type": "string", "description": "The name of the application gateway." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "./network.json#/definitions/TagsObject" }, "description": "Parameters supplied to update application gateway tags." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Update successful. The operation returns the resulting ApplicationGateway resource.", "schema": { "$ref": "#/definitions/ApplicationGateway" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways": { "get": { "tags": [ "ApplicationGateways" ], "operationId": "ApplicationGateways_List", "x-ms-examples": { "Lists all application gateways in a resource group": { "$ref": "./examples/ApplicationGatewayList.json" } }, "description": "Lists all application gateways in a resource group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Success. The operation returns a list of ApplicationGateway resources.", "schema": { "$ref": "#/definitions/ApplicationGatewayListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways": { "get": { "tags": [ "ApplicationGateways" ], "operationId": "ApplicationGateways_ListAll", "x-ms-examples": { "Lists all application gateways in a subscription": { "$ref": "./examples/ApplicationGatewayListAll.json" } }, "description": "Gets all the application gateways in a subscription.", "parameters": [ { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Success. The operation returns a list of ApplicationGateway resources.", "schema": { "$ref": "#/definitions/ApplicationGatewayListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start": { "post": { "tags": [ "ApplicationGateways" ], "operationId": "ApplicationGateways_Start", "x-ms-examples": { "Start Application Gateway": { "$ref": "./examples/ApplicationGatewayStart.json" } }, "description": "Starts the specified application gateway.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "applicationGatewayName", "in": "path", "required": true, "type": "string", "description": "The name of the application gateway." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation starts the ApplicationGateway resource." }, "202": { "description": "Accepted and the operation will complete asynchronously." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop": { "post": { "tags": [ "ApplicationGateways" ], "operationId": "ApplicationGateways_Stop", "x-ms-examples": { "Stop Application Gateway": { "$ref": "./examples/ApplicationGatewayStop.json" } }, "description": "Stops the specified application gateway in a resource group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "applicationGatewayName", "in": "path", "required": true, "type": "string", "description": "The name of the application gateway." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation stops the ApplicationGateway resource." }, "202": { "description": "Accepted and the operation will complete asynchronously." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth": { "post": { "tags": [ "ApplicationGateways" ], "operationId": "ApplicationGateways_BackendHealth", "description": "Gets the backend health of the specified application gateway in a resource group.", "x-ms-examples": { "Get Backend Health": { "$ref": "./examples/ApplicationGatewayBackendHealthGet.json" } }, "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "applicationGatewayName", "in": "path", "required": true, "type": "string", "description": "The name of the application gateway." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" }, { "name": "$expand", "in": "query", "required": false, "type": "string", "description": "Expands BackendAddressPool and BackendHttpSettings referenced in backend health." } ], "responses": { "200": { "description": "Request successful.", "schema": { "$ref": "#/definitions/ApplicationGatewayBackendHealth" } }, "202": { "description": "Accepted and the operation will complete asynchronously." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/getBackendHealthOnDemand": { "post": { "tags": [ "ApplicationGateways" ], "operationId": "ApplicationGateways_BackendHealthOnDemand", "description": "Gets the backend health for given combination of backend pool and http setting of the specified application gateway in a resource group.", "x-ms-examples": { "Test Backend Health": { "$ref": "./examples/ApplicationGatewayBackendHealthTest.json" } }, "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "applicationGatewayName", "in": "path", "required": true, "type": "string", "description": "The name of the application gateway." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" }, { "name": "$expand", "in": "query", "required": false, "type": "string", "description": "Expands BackendAddressPool and BackendHttpSettings referenced in backend health." }, { "name": "probeRequest", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ApplicationGatewayOnDemandProbe" }, "description": "Request body for on-demand test probe operation." } ], "responses": { "200": { "description": "Request successful.", "schema": { "$ref": "#/definitions/ApplicationGatewayBackendHealthOnDemand" } }, "202": { "description": "Accepted and the operation will complete asynchronously." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableServerVariables": { "get": { "tags": [ "ApplicationGateways" ], "operationId": "ApplicationGateways_ListAvailableServerVariables", "x-ms-examples": { "Get Available Server Variables": { "$ref": "./examples/ApplicationGatewayAvailableServerVariablesGet.json" } }, "description": "Lists all available server variables.", "parameters": [ { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Success. The operation returns a list of all available server variables.", "schema": { "$ref": "#/definitions/ApplicationGatewayAvailableServerVariablesResult" } }, "default": { "description": "Unexpected error.", "schema": { "$ref": "./network.json#/definitions/Error" } } } } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableRequestHeaders": { "get": { "tags": [ "ApplicationGateways" ], "operationId": "ApplicationGateways_ListAvailableRequestHeaders", "x-ms-examples": { "Get Available Request Headers": { "$ref": "./examples/ApplicationGatewayAvailableRequestHeadersGet.json" } }, "description": "Lists all available request headers.", "parameters": [ { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Success. The operation returns a list of all available request headers.", "schema": { "$ref": "#/definitions/ApplicationGatewayAvailableRequestHeadersResult" } }, "default": { "description": "Unexpected error.", "schema": { "$ref": "./network.json#/definitions/Error" } } } } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableResponseHeaders": { "get": { "tags": [ "ApplicationGateways" ], "operationId": "ApplicationGateways_ListAvailableResponseHeaders", "x-ms-examples": { "Get Available Response Headers": { "$ref": "./examples/ApplicationGatewayAvailableResponseHeadersGet.json" } }, "description": "Lists all available response headers.", "parameters": [ { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Success. The operation returns a list of all available response headers.", "schema": { "$ref": "#/definitions/ApplicationGatewayAvailableResponseHeadersResult" } }, "default": { "description": "Unexpected error.", "schema": { "$ref": "./network.json#/definitions/Error" } } } } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets": { "get": { "tags": [ "ApplicationGateways" ], "operationId": "ApplicationGateways_ListAvailableWafRuleSets", "x-ms-examples": { "Get Available Waf Rule Sets": { "$ref": "./examples/ApplicationGatewayAvailableWafRuleSetsGet.json" } }, "description": "Lists all available web application firewall rule sets.", "parameters": [ { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Success. The operation returns a list of all available web application firewall rule sets.", "schema": { "$ref": "#/definitions/ApplicationGatewayAvailableWafRuleSetsResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } } } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default": { "get": { "tags": [ "ApplicationGateways" ], "operationId": "ApplicationGateways_ListAvailableSslOptions", "x-ms-examples": { "Get Available Ssl Options": { "$ref": "./examples/ApplicationGatewayAvailableSslOptionsGet.json" } }, "description": "Lists available Ssl options for configuring Ssl policy.", "parameters": [ { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Success. The operation returns all available Ssl options for configuring Ssl policy.", "schema": { "$ref": "#/definitions/ApplicationGatewayAvailableSslOptions" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } } } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies": { "get": { "tags": [ "ApplicationGateways" ], "operationId": "ApplicationGateways_ListAvailableSslPredefinedPolicies", "x-ms-examples": { "Get Available Ssl Predefined Policies": { "$ref": "./examples/ApplicationGatewayAvailableSslOptionsPredefinedPoliciesGet.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" }, "description": "Lists all SSL predefined policies for configuring Ssl policy.", "parameters": [ { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Success. The operation returns a lists of all Ssl predefined policies for configuring Ssl policy.", "schema": { "$ref": "#/definitions/ApplicationGatewayAvailableSslPredefinedPolicies" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } } } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/{predefinedPolicyName}": { "get": { "tags": [ "ApplicationGateways" ], "operationId": "ApplicationGateways_GetSslPredefinedPolicy", "x-ms-examples": { "Get Available Ssl Predefined Policy by name": { "$ref": "./examples/ApplicationGatewayAvailableSslOptionsPredefinedPolicyGet.json" } }, "description": "Gets Ssl predefined policy with the specified policy name.", "parameters": [ { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" }, { "name": "predefinedPolicyName", "in": "path", "required": true, "type": "string", "description": "Name of Ssl predefined policy." } ], "responses": { "200": { "description": "Success. The operation returns a Ssl predefined policy with the specified policy name.", "schema": { "$ref": "#/definitions/ApplicationGatewaySslPredefinedPolicy" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } } } } }, "definitions": { "ApplicationGatewayOnDemandProbe": { "properties": { "protocol": { "$ref": "#/definitions/ApplicationGatewayProtocol", "description": "The protocol used for the probe." }, "host": { "type": "string", "description": "Host name to send the probe to." }, "path": { "type": "string", "description": "Relative path of probe. Valid path starts from '/'. Probe is sent to ://:." }, "timeout": { "type": "integer", "format": "int32", "description": "The probe timeout in seconds. Probe marked as failed if valid response is not received with this timeout period. Acceptable values are from 1 second to 86400 seconds." }, "pickHostNameFromBackendHttpSettings": { "type": "boolean", "description": "Whether the host header should be picked from the backend http settings. Default value is false." }, "match": { "$ref": "#/definitions/ApplicationGatewayProbeHealthResponseMatch", "description": "Criterion for classifying a healthy probe response." }, "backendAddressPool": { "$ref": "./network.json#/definitions/SubResource", "description": "Reference to backend pool of application gateway to which probe request will be sent." }, "backendHttpSettings": { "$ref": "./network.json#/definitions/SubResource", "description": "Reference to backend http setting of application gateway to be used for test probe." } }, "description": "Details of on demand test probe request." }, "ApplicationGatewayBackendHealthOnDemand": { "properties": { "backendAddressPool": { "$ref": "#/definitions/ApplicationGatewayBackendAddressPool", "description": "Reference to an ApplicationGatewayBackendAddressPool resource." }, "backendHealthHttpSettings": { "$ref": "#/definitions/ApplicationGatewayBackendHealthHttpSettings", "description": "Application gateway BackendHealthHttp settings." } }, "description": "Result of on demand test probe." }, "ApplicationGatewayBackendHealth": { "properties": { "backendAddressPools": { "type": "array", "items": { "$ref": "#/definitions/ApplicationGatewayBackendHealthPool" }, "description": "A list of ApplicationGatewayBackendHealthPool resources." } }, "description": "Response for ApplicationGatewayBackendHealth API service call." }, "ApplicationGatewayBackendHealthPool": { "properties": { "backendAddressPool": { "$ref": "#/definitions/ApplicationGatewayBackendAddressPool", "description": "Reference to an ApplicationGatewayBackendAddressPool resource." }, "backendHttpSettingsCollection": { "type": "array", "items": { "$ref": "#/definitions/ApplicationGatewayBackendHealthHttpSettings" }, "description": "List of ApplicationGatewayBackendHealthHttpSettings resources." } }, "description": "Application gateway BackendHealth pool." }, "ApplicationGatewayBackendHealthHttpSettings": { "properties": { "backendHttpSettings": { "$ref": "#/definitions/ApplicationGatewayBackendHttpSettings", "description": "Reference to an ApplicationGatewayBackendHttpSettings resource." }, "servers": { "type": "array", "items": { "$ref": "#/definitions/ApplicationGatewayBackendHealthServer" }, "description": "List of ApplicationGatewayBackendHealthServer resources." } }, "description": "Application gateway BackendHealthHttp settings." }, "ApplicationGatewayBackendHealthServer": { "properties": { "address": { "type": "string", "description": "IP address or FQDN of backend server." }, "ipConfiguration": { "$ref": "./networkInterface.json#/definitions/NetworkInterfaceIPConfiguration", "description": "Reference to IP configuration of backend server." }, "health": { "type": "string", "description": "Health of backend server.", "enum": [ "Unknown", "Up", "Down", "Partial", "Draining" ], "x-ms-enum": { "name": "ApplicationGatewayBackendHealthServerHealth", "modelAsString": true } }, "healthProbeLog": { "type": "string", "description": "Health Probe Log." } }, "description": "Application gateway backendhealth http settings." }, "ApplicationGatewaySku": { "properties": { "name": { "type": "string", "description": "Name of an application gateway SKU.", "enum": [ "Standard_Small", "Standard_Medium", "Standard_Large", "WAF_Medium", "WAF_Large", "Standard_v2", "WAF_v2" ], "x-ms-enum": { "name": "ApplicationGatewaySkuName", "modelAsString": true } }, "tier": { "type": "string", "description": "Tier of an application gateway.", "enum": [ "Standard", "WAF", "Standard_v2", "WAF_v2" ], "x-ms-enum": { "name": "ApplicationGatewayTier", "modelAsString": true } }, "capacity": { "type": "integer", "format": "int32", "description": "Capacity (instance count) of an application gateway." } }, "description": "SKU of an application gateway." }, "ApplicationGatewaySslPolicy": { "properties": { "disabledSslProtocols": { "type": "array", "description": "Ssl protocols to be disabled on application gateway.", "items": { "type": "string", "$ref": "#/definitions/ProtocolsEnum" } }, "policyType": { "type": "string", "description": "Type of Ssl Policy.", "enum": [ "Predefined", "Custom" ], "x-ms-enum": { "name": "ApplicationGatewaySslPolicyType", "modelAsString": true } }, "policyName": { "$ref": "#/definitions/PolicyNameEnum", "description": "Name of Ssl predefined policy." }, "cipherSuites": { "type": "array", "items": { "$ref": "#/definitions/CipherSuitesEnum" }, "description": "Ssl cipher suites to be enabled in the specified order to application gateway." }, "minProtocolVersion": { "$ref": "#/definitions/ProtocolsEnum", "description": "Minimum version of Ssl protocol to be supported on application gateway." } }, "description": "Application Gateway Ssl policy." }, "ApplicationGatewayIPConfigurationPropertiesFormat": { "properties": { "subnet": { "$ref": "./network.json#/definitions/SubResource", "description": "Reference to the subnet resource. A subnet from where application gateway gets its private address." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the application gateway IP configuration resource." } }, "description": "Properties of IP configuration of an application gateway." }, "ApplicationGatewayIPConfiguration": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/ApplicationGatewayIPConfigurationPropertiesFormat", "description": "Properties of the application gateway IP configuration." }, "name": { "type": "string", "description": "Name of the IP configuration that is unique within an Application Gateway." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." }, "type": { "readOnly": true, "type": "string", "description": "Type of the resource." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "IP configuration of an application gateway. Currently 1 public and 1 private IP configuration is allowed." }, "ApplicationGatewayAuthenticationCertificatePropertiesFormat": { "properties": { "data": { "type": "string", "description": "Certificate public data." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the authentication certificate resource." } }, "description": "Authentication certificates properties of an application gateway." }, "ApplicationGatewayAuthenticationCertificate": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/ApplicationGatewayAuthenticationCertificatePropertiesFormat", "description": "Properties of the application gateway authentication certificate." }, "name": { "type": "string", "description": "Name of the authentication certificate that is unique within an Application Gateway." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." }, "type": { "readOnly": true, "type": "string", "description": "Type of the resource." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "Authentication certificates of an application gateway." }, "ApplicationGatewayTrustedRootCertificatePropertiesFormat": { "properties": { "data": { "type": "string", "description": "Certificate public data." }, "keyVaultSecretId": { "type": "string", "description": "Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' object stored in KeyVault." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the trusted root certificate resource." } }, "description": "Trusted Root certificates properties of an application gateway." }, "ApplicationGatewayTrustedRootCertificate": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/ApplicationGatewayTrustedRootCertificatePropertiesFormat", "description": "Properties of the application gateway trusted root certificate." }, "name": { "type": "string", "description": "Name of the trusted root certificate that is unique within an Application Gateway." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." }, "type": { "readOnly": true, "type": "string", "description": "Type of the resource." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "Trusted Root certificates of an application gateway." }, "ApplicationGatewaySslCertificatePropertiesFormat": { "properties": { "data": { "type": "string", "description": "Base-64 encoded pfx certificate. Only applicable in PUT Request." }, "password": { "type": "string", "description": "Password for the pfx file specified in data. Only applicable in PUT request." }, "publicCertData": { "readOnly": true, "type": "string", "description": "Base-64 encoded Public cert data corresponding to pfx specified in data. Only applicable in GET request." }, "keyVaultSecretId": { "type": "string", "description": "Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' object stored in KeyVault." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the SSL certificate resource." } }, "description": "Properties of SSL certificates of an application gateway." }, "ApplicationGatewaySslCertificate": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/ApplicationGatewaySslCertificatePropertiesFormat", "description": "Properties of the application gateway SSL certificate." }, "name": { "type": "string", "description": "Name of the SSL certificate that is unique within an Application Gateway." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." }, "type": { "readOnly": true, "type": "string", "description": "Type of the resource." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "SSL certificates of an application gateway." }, "ApplicationGatewayFrontendIPConfigurationPropertiesFormat": { "properties": { "privateIPAddress": { "type": "string", "description": "PrivateIPAddress of the network interface IP Configuration." }, "privateIPAllocationMethod": { "$ref": "./network.json#/definitions/IPAllocationMethod", "description": "The private IP address allocation method." }, "subnet": { "$ref": "./network.json#/definitions/SubResource", "description": "Reference to the subnet resource." }, "publicIPAddress": { "$ref": "./network.json#/definitions/SubResource", "description": "Reference to the PublicIP resource." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the frontend IP configuration resource." } }, "description": "Properties of Frontend IP configuration of an application gateway." }, "ApplicationGatewayFrontendIPConfiguration": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/ApplicationGatewayFrontendIPConfigurationPropertiesFormat", "description": "Properties of the application gateway frontend IP configuration." }, "name": { "type": "string", "description": "Name of the frontend IP configuration that is unique within an Application Gateway." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." }, "type": { "readOnly": true, "type": "string", "description": "Type of the resource." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "Frontend IP configuration of an application gateway." }, "ApplicationGatewayFrontendPortPropertiesFormat": { "properties": { "port": { "type": "integer", "format": "int32", "description": "Frontend port." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the frontend port resource." } }, "description": "Properties of Frontend port of an application gateway." }, "ApplicationGatewayFrontendPort": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/ApplicationGatewayFrontendPortPropertiesFormat", "description": "Properties of the application gateway frontend port." }, "name": { "type": "string", "description": "Name of the frontend port that is unique within an Application Gateway." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." }, "type": { "readOnly": true, "type": "string", "description": "Type of the resource." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "Frontend port of an application gateway." }, "ApplicationGatewayBackendAddress": { "properties": { "fqdn": { "type": "string", "description": "Fully qualified domain name (FQDN)." }, "ipAddress": { "type": "string", "description": "IP address." } }, "description": "Backend address of an application gateway." }, "ApplicationGatewayBackendAddressPoolPropertiesFormat": { "properties": { "backendIPConfigurations": { "readOnly": true, "type": "array", "items": { "$ref": "./networkInterface.json#/definitions/NetworkInterfaceIPConfiguration" }, "description": "Collection of references to IPs defined in network interfaces." }, "backendAddresses": { "type": "array", "items": { "$ref": "#/definitions/ApplicationGatewayBackendAddress" }, "description": "Backend addresses." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the backend address pool resource." } }, "description": "Properties of Backend Address Pool of an application gateway." }, "ApplicationGatewayBackendAddressPool": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/ApplicationGatewayBackendAddressPoolPropertiesFormat", "description": "Properties of the application gateway backend address pool." }, "name": { "type": "string", "description": "Name of the backend address pool that is unique within an Application Gateway." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." }, "type": { "readOnly": true, "type": "string", "description": "Type of the resource." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "Backend Address Pool of an application gateway." }, "ApplicationGatewayBackendHttpSettingsPropertiesFormat": { "properties": { "port": { "type": "integer", "format": "int32", "description": "The destination port on the backend." }, "protocol": { "$ref": "#/definitions/ApplicationGatewayProtocol", "description": "The protocol used to communicate with the backend." }, "cookieBasedAffinity": { "type": "string", "description": "Cookie based affinity.", "enum": [ "Enabled", "Disabled" ], "x-ms-enum": { "name": "ApplicationGatewayCookieBasedAffinity", "modelAsString": true } }, "requestTimeout": { "type": "integer", "format": "int32", "description": "Request timeout in seconds. Application Gateway will fail the request if response is not received within RequestTimeout. Acceptable values are from 1 second to 86400 seconds." }, "probe": { "$ref": "./network.json#/definitions/SubResource", "description": "Probe resource of an application gateway." }, "authenticationCertificates": { "type": "array", "items": { "$ref": "./network.json#/definitions/SubResource" }, "description": "Array of references to application gateway authentication certificates." }, "trustedRootCertificates": { "type": "array", "items": { "$ref": "./network.json#/definitions/SubResource" }, "description": "Array of references to application gateway trusted root certificates." }, "connectionDraining": { "$ref": "#/definitions/ApplicationGatewayConnectionDraining", "description": "Connection draining of the backend http settings resource." }, "hostName": { "type": "string", "description": "Host header to be sent to the backend servers." }, "pickHostNameFromBackendAddress": { "type": "boolean", "description": "Whether to pick host header should be picked from the host name of the backend server. Default value is false." }, "affinityCookieName": { "type": "string", "description": "Cookie name to use for the affinity cookie." }, "probeEnabled": { "type": "boolean", "description": "Whether the probe is enabled. Default value is false." }, "path": { "type": "string", "description": "Path which should be used as a prefix for all HTTP requests. Null means no path will be prefixed. Default value is null." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the backend HTTP settings resource." } }, "description": "Properties of Backend address pool settings of an application gateway." }, "ApplicationGatewayBackendHttpSettings": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/ApplicationGatewayBackendHttpSettingsPropertiesFormat", "description": "Properties of the application gateway backend HTTP settings." }, "name": { "type": "string", "description": "Name of the backend http settings that is unique within an Application Gateway." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." }, "type": { "readOnly": true, "type": "string", "description": "Type of the resource." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "Backend address pool settings of an application gateway." }, "ApplicationGatewayHttpListenerPropertiesFormat": { "properties": { "frontendIPConfiguration": { "$ref": "./network.json#/definitions/SubResource", "description": "Frontend IP configuration resource of an application gateway." }, "frontendPort": { "$ref": "./network.json#/definitions/SubResource", "description": "Frontend port resource of an application gateway." }, "protocol": { "$ref": "#/definitions/ApplicationGatewayProtocol", "description": "Protocol of the HTTP listener." }, "hostName": { "type": "string", "description": "Host name of HTTP listener." }, "sslCertificate": { "$ref": "./network.json#/definitions/SubResource", "description": "SSL certificate resource of an application gateway." }, "requireServerNameIndication": { "type": "boolean", "description": "Applicable only if protocol is https. Enables SNI for multi-hosting." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the HTTP listener resource." }, "customErrorConfigurations": { "type": "array", "items": { "$ref": "#/definitions/ApplicationGatewayCustomError" }, "description": "Custom error configurations of the HTTP listener." }, "firewallPolicy": { "$ref": "./network.json#/definitions/SubResource", "description": "Reference to the FirewallPolicy resource." }, "hostNames": { "type": "array", "items": { "type": "string" }, "description": "List of Host names for HTTP Listener that allows special wildcard characters as well." } }, "description": "Properties of HTTP listener of an application gateway." }, "ApplicationGatewayHttpListener": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/ApplicationGatewayHttpListenerPropertiesFormat", "description": "Properties of the application gateway HTTP listener." }, "name": { "type": "string", "description": "Name of the HTTP listener that is unique within an Application Gateway." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." }, "type": { "readOnly": true, "type": "string", "description": "Type of the resource." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "Http listener of an application gateway." }, "ApplicationGatewayPathRulePropertiesFormat": { "properties": { "paths": { "type": "array", "items": { "type": "string" }, "description": "Path rules of URL path map." }, "backendAddressPool": { "$ref": "./network.json#/definitions/SubResource", "description": "Backend address pool resource of URL path map path rule." }, "backendHttpSettings": { "$ref": "./network.json#/definitions/SubResource", "description": "Backend http settings resource of URL path map path rule." }, "redirectConfiguration": { "$ref": "./network.json#/definitions/SubResource", "description": "Redirect configuration resource of URL path map path rule." }, "rewriteRuleSet": { "$ref": "./network.json#/definitions/SubResource", "description": "Rewrite rule set resource of URL path map path rule." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the path rule resource." }, "firewallPolicy": { "$ref": "./network.json#/definitions/SubResource", "description": "Reference to the FirewallPolicy resource." } }, "description": "Properties of path rule of an application gateway." }, "ApplicationGatewayPathRule": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/ApplicationGatewayPathRulePropertiesFormat", "description": "Properties of the application gateway path rule." }, "name": { "type": "string", "description": "Name of the path rule that is unique within an Application Gateway." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." }, "type": { "readOnly": true, "type": "string", "description": "Type of the resource." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "Path rule of URL path map of an application gateway." }, "ApplicationGatewayProbePropertiesFormat": { "properties": { "protocol": { "$ref": "#/definitions/ApplicationGatewayProtocol", "description": "The protocol used for the probe." }, "host": { "type": "string", "description": "Host name to send the probe to." }, "path": { "type": "string", "description": "Relative path of probe. Valid path starts from '/'. Probe is sent to ://:." }, "interval": { "type": "integer", "format": "int32", "description": "The probing interval in seconds. This is the time interval between two consecutive probes. Acceptable values are from 1 second to 86400 seconds." }, "timeout": { "type": "integer", "format": "int32", "description": "The probe timeout in seconds. Probe marked as failed if valid response is not received with this timeout period. Acceptable values are from 1 second to 86400 seconds." }, "unhealthyThreshold": { "type": "integer", "format": "int32", "description": "The probe retry count. Backend server is marked down after consecutive probe failure count reaches UnhealthyThreshold. Acceptable values are from 1 second to 20." }, "pickHostNameFromBackendHttpSettings": { "type": "boolean", "description": "Whether the host header should be picked from the backend http settings. Default value is false." }, "minServers": { "type": "integer", "format": "int32", "description": "Minimum number of servers that are always marked healthy. Default value is 0." }, "match": { "$ref": "#/definitions/ApplicationGatewayProbeHealthResponseMatch", "description": "Criterion for classifying a healthy probe response." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the probe resource." }, "port": { "type": "integer", "format": "int32", "description": "Custom port which will be used for probing the backend servers. The valid value ranges from 1 to 65535. In case not set, port from http settings will be used. This property is valid for Standard_v2 and WAF_v2 only.", "minimum": 1, "maximum": 65535 } }, "description": "Properties of probe of an application gateway." }, "ApplicationGatewayProbeHealthResponseMatch": { "properties": { "body": { "type": "string", "description": "Body that must be contained in the health response. Default value is empty." }, "statusCodes": { "type": "array", "items": { "type": "string" }, "description": "Allowed ranges of healthy status codes. Default range of healthy status codes is 200-399." } }, "description": "Application gateway probe health response match." }, "ApplicationGatewayProbe": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/ApplicationGatewayProbePropertiesFormat", "description": "Properties of the application gateway probe." }, "name": { "type": "string", "description": "Name of the probe that is unique within an Application Gateway." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." }, "type": { "readOnly": true, "type": "string", "description": "Type of the resource." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "Probe of the application gateway." }, "ApplicationGatewayRequestRoutingRulePropertiesFormat": { "properties": { "ruleType": { "type": "string", "description": "Rule type.", "enum": [ "Basic", "PathBasedRouting" ], "x-ms-enum": { "name": "ApplicationGatewayRequestRoutingRuleType", "modelAsString": true } }, "priority": { "type": "integer", "format": "int32", "minimum": 1, "exclusiveMinimum": false, "maximum": 20000, "exclusiveMaximum": false, "description": "Priority of the request routing rule." }, "backendAddressPool": { "$ref": "./network.json#/definitions/SubResource", "description": "Backend address pool resource of the application gateway." }, "backendHttpSettings": { "$ref": "./network.json#/definitions/SubResource", "description": "Backend http settings resource of the application gateway." }, "httpListener": { "$ref": "./network.json#/definitions/SubResource", "description": "Http listener resource of the application gateway." }, "urlPathMap": { "$ref": "./network.json#/definitions/SubResource", "description": "URL path map resource of the application gateway." }, "rewriteRuleSet": { "$ref": "./network.json#/definitions/SubResource", "description": "Rewrite Rule Set resource in Basic rule of the application gateway." }, "redirectConfiguration": { "$ref": "./network.json#/definitions/SubResource", "description": "Redirect configuration resource of the application gateway." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the request routing rule resource." } }, "description": "Properties of request routing rule of the application gateway." }, "ApplicationGatewayRequestRoutingRule": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/ApplicationGatewayRequestRoutingRulePropertiesFormat", "description": "Properties of the application gateway request routing rule." }, "name": { "type": "string", "description": "Name of the request routing rule that is unique within an Application Gateway." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." }, "type": { "readOnly": true, "type": "string", "description": "Type of the resource." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "Request routing rule of an application gateway." }, "ApplicationGatewayRewriteRuleSet": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/ApplicationGatewayRewriteRuleSetPropertiesFormat", "description": "Properties of the application gateway rewrite rule set." }, "name": { "type": "string", "description": "Name of the rewrite rule set that is unique within an Application Gateway." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "Rewrite rule set of an application gateway." }, "ApplicationGatewayRewriteRuleSetPropertiesFormat": { "properties": { "rewriteRules": { "type": "array", "items": { "$ref": "#/definitions/ApplicationGatewayRewriteRule" }, "description": "Rewrite rules in the rewrite rule set." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the rewrite rule set resource." } }, "description": "Properties of rewrite rule set of the application gateway." }, "ApplicationGatewayRewriteRule": { "properties": { "name": { "type": "string", "description": "Name of the rewrite rule that is unique within an Application Gateway." }, "ruleSequence": { "type": "integer", "description": "Rule Sequence of the rewrite rule that determines the order of execution of a particular rule in a RewriteRuleSet." }, "conditions": { "type": "array", "items": { "$ref": "#/definitions/ApplicationGatewayRewriteRuleCondition" }, "description": "Conditions based on which the action set execution will be evaluated." }, "actionSet": { "type": "object", "$ref": "#/definitions/ApplicationGatewayRewriteRuleActionSet", "description": "Set of actions to be done as part of the rewrite Rule." } }, "description": "Rewrite rule of an application gateway." }, "ApplicationGatewayRewriteRuleCondition": { "properties": { "variable": { "type": "string", "description": "The condition parameter of the RewriteRuleCondition." }, "pattern": { "type": "string", "description": "The pattern, either fixed string or regular expression, that evaluates the truthfulness of the condition." }, "ignoreCase": { "type": "boolean", "description": "Setting this paramter to truth value with force the pattern to do a case in-sensitive comparison." }, "negate": { "type": "boolean", "description": "Setting this value as truth will force to check the negation of the condition given by the user." } }, "description": "Set of conditions in the Rewrite Rule in Application Gateway." }, "ApplicationGatewayRewriteRuleActionSet": { "properties": { "requestHeaderConfigurations": { "type": "array", "items": { "$ref": "#/definitions/ApplicationGatewayHeaderConfiguration" }, "description": "Request Header Actions in the Action Set." }, "responseHeaderConfigurations": { "type": "array", "items": { "$ref": "#/definitions/ApplicationGatewayHeaderConfiguration" }, "description": "Response Header Actions in the Action Set." }, "urlConfiguration": { "$ref": "#/definitions/ApplicationGatewayUrlConfiguration", "description": "Url Configuration Action in the Action Set." } }, "description": "Set of actions in the Rewrite Rule in Application Gateway." }, "ApplicationGatewayHeaderConfiguration": { "properties": { "headerName": { "type": "string", "description": "Header name of the header configuration." }, "headerValue": { "type": "string", "description": "Header value of the header configuration." } }, "description": "Header configuration of the Actions set in Application Gateway." }, "ApplicationGatewayUrlConfiguration": { "properties": { "modifiedPath": { "type": "string", "description": "Url path which user has provided for url rewrite. Null means no path will be updated. Default value is null." }, "modifiedQueryString": { "type": "string", "description": "Query string which user has provided for url rewrite. Null means no query string will be updated. Default value is null." }, "reroute": { "type": "boolean", "description": "If set as true, it will re-evaluate the url path map provided in path based request routing rules using modified path. Default value is false." } }, "description": "Url configuration of the Actions set in Application Gateway." }, "ApplicationGatewayRedirectConfigurationPropertiesFormat": { "properties": { "redirectType": { "type": "string", "$ref": "#/definitions/RedirectTypeEnum", "description": "HTTP redirection type." }, "targetListener": { "$ref": "./network.json#/definitions/SubResource", "description": "Reference to a listener to redirect the request to." }, "targetUrl": { "type": "string", "description": "Url to redirect the request to." }, "includePath": { "type": "boolean", "description": "Include path in the redirected url." }, "includeQueryString": { "type": "boolean", "description": "Include query string in the redirected url." }, "requestRoutingRules": { "type": "array", "items": { "$ref": "./network.json#/definitions/SubResource" }, "description": "Request routing specifying redirect configuration." }, "urlPathMaps": { "type": "array", "items": { "$ref": "./network.json#/definitions/SubResource" }, "description": "Url path maps specifying default redirect configuration." }, "pathRules": { "type": "array", "items": { "$ref": "./network.json#/definitions/SubResource" }, "description": "Path rules specifying redirect configuration." } }, "description": "Properties of redirect configuration of the application gateway." }, "ApplicationGatewayRedirectConfiguration": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/ApplicationGatewayRedirectConfigurationPropertiesFormat", "description": "Properties of the application gateway redirect configuration." }, "name": { "type": "string", "description": "Name of the redirect configuration that is unique within an Application Gateway." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." }, "type": { "readOnly": true, "type": "string", "description": "Type of the resource." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "Redirect configuration of an application gateway." }, "ApplicationGatewayPropertiesFormat": { "properties": { "sku": { "$ref": "#/definitions/ApplicationGatewaySku", "description": "SKU of the application gateway resource." }, "sslPolicy": { "$ref": "#/definitions/ApplicationGatewaySslPolicy", "description": "SSL policy of the application gateway resource." }, "operationalState": { "readOnly": true, "type": "string", "description": "Operational state of the application gateway resource.", "enum": [ "Stopped", "Starting", "Running", "Stopping" ], "x-ms-enum": { "name": "ApplicationGatewayOperationalState", "modelAsString": true } }, "gatewayIPConfigurations": { "type": "array", "items": { "$ref": "#/definitions/ApplicationGatewayIPConfiguration" }, "description": "Subnets of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits)." }, "authenticationCertificates": { "type": "array", "items": { "$ref": "#/definitions/ApplicationGatewayAuthenticationCertificate" }, "description": "Authentication certificates of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits)." }, "trustedRootCertificates": { "type": "array", "items": { "$ref": "#/definitions/ApplicationGatewayTrustedRootCertificate" }, "description": "Trusted Root certificates of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits)." }, "sslCertificates": { "type": "array", "items": { "$ref": "#/definitions/ApplicationGatewaySslCertificate" }, "description": "SSL certificates of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits)." }, "frontendIPConfigurations": { "type": "array", "items": { "$ref": "#/definitions/ApplicationGatewayFrontendIPConfiguration" }, "description": "Frontend IP addresses of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits)." }, "frontendPorts": { "type": "array", "items": { "$ref": "#/definitions/ApplicationGatewayFrontendPort" }, "description": "Frontend ports of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits)." }, "probes": { "type": "array", "items": { "$ref": "#/definitions/ApplicationGatewayProbe" }, "description": "Probes of the application gateway resource." }, "backendAddressPools": { "type": "array", "items": { "$ref": "#/definitions/ApplicationGatewayBackendAddressPool" }, "description": "Backend address pool of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits)." }, "backendHttpSettingsCollection": { "type": "array", "items": { "$ref": "#/definitions/ApplicationGatewayBackendHttpSettings" }, "description": "Backend http settings of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits)." }, "httpListeners": { "type": "array", "items": { "$ref": "#/definitions/ApplicationGatewayHttpListener" }, "description": "Http listeners of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits)." }, "urlPathMaps": { "type": "array", "items": { "$ref": "#/definitions/ApplicationGatewayUrlPathMap" }, "description": "URL path map of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits)." }, "requestRoutingRules": { "type": "array", "items": { "$ref": "#/definitions/ApplicationGatewayRequestRoutingRule" }, "description": "Request routing rules of the application gateway resource." }, "rewriteRuleSets": { "type": "array", "items": { "$ref": "#/definitions/ApplicationGatewayRewriteRuleSet" }, "description": "Rewrite rules for the application gateway resource." }, "redirectConfigurations": { "type": "array", "items": { "$ref": "#/definitions/ApplicationGatewayRedirectConfiguration" }, "description": "Redirect configurations of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits)." }, "webApplicationFirewallConfiguration": { "$ref": "#/definitions/ApplicationGatewayWebApplicationFirewallConfiguration", "description": "Web application firewall configuration." }, "firewallPolicy": { "$ref": "./network.json#/definitions/SubResource", "description": "Reference to the FirewallPolicy resource." }, "enableHttp2": { "type": "boolean", "description": "Whether HTTP2 is enabled on the application gateway resource." }, "enableFips": { "type": "boolean", "description": "Whether FIPS is enabled on the application gateway resource." }, "autoscaleConfiguration": { "$ref": "#/definitions/ApplicationGatewayAutoscaleConfiguration", "description": "Autoscale Configuration." }, "resourceGuid": { "readOnly": true, "type": "string", "description": "The resource GUID property of the application gateway resource." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the application gateway resource." }, "customErrorConfigurations": { "type": "array", "items": { "$ref": "#/definitions/ApplicationGatewayCustomError" }, "description": "Custom error configurations of the application gateway resource." }, "forceFirewallPolicyAssociation": { "type": "boolean", "description": "If true, associates a firewall policy with an application gateway regardless whether the policy differs from the WAF Config." } }, "description": "Properties of the application gateway." }, "ApplicationGateway": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/ApplicationGatewayPropertiesFormat", "description": "Properties of the application gateway." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." }, "zones": { "type": "array", "items": { "type": "string" }, "description": "A list of availability zones denoting where the resource needs to come from." }, "identity": { "$ref": "./network.json#/definitions/ManagedServiceIdentity", "description": "The identity of the application gateway, if configured." } }, "allOf": [ { "$ref": "./network.json#/definitions/Resource" } ], "description": "Application gateway resource." }, "ApplicationGatewayListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/ApplicationGateway" }, "description": "List of an application gateways in a resource group." }, "nextLink": { "type": "string", "description": "URL to get the next set of results." } }, "description": "Response for ListApplicationGateways API service call." }, "ApplicationGatewayUrlPathMapPropertiesFormat": { "properties": { "defaultBackendAddressPool": { "$ref": "./network.json#/definitions/SubResource", "description": "Default backend address pool resource of URL path map." }, "defaultBackendHttpSettings": { "$ref": "./network.json#/definitions/SubResource", "description": "Default backend http settings resource of URL path map." }, "defaultRewriteRuleSet": { "$ref": "./network.json#/definitions/SubResource", "description": "Default Rewrite rule set resource of URL path map." }, "defaultRedirectConfiguration": { "$ref": "./network.json#/definitions/SubResource", "description": "Default redirect configuration resource of URL path map." }, "pathRules": { "type": "array", "items": { "$ref": "#/definitions/ApplicationGatewayPathRule" }, "description": "Path rule of URL path map resource." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the URL path map resource." } }, "description": "Properties of UrlPathMap of the application gateway." }, "ApplicationGatewayUrlPathMap": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/ApplicationGatewayUrlPathMapPropertiesFormat", "description": "Properties of the application gateway URL path map." }, "name": { "type": "string", "description": "Name of the URL path map that is unique within an Application Gateway." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." }, "type": { "readOnly": true, "type": "string", "description": "Type of the resource." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "UrlPathMaps give a url path to the backend mapping information for PathBasedRouting." }, "ApplicationGatewayWebApplicationFirewallConfiguration": { "properties": { "enabled": { "type": "boolean", "description": "Whether the web application firewall is enabled or not." }, "firewallMode": { "type": "string", "description": "Web application firewall mode.", "enum": [ "Detection", "Prevention" ], "x-ms-enum": { "name": "ApplicationGatewayFirewallMode", "modelAsString": true } }, "ruleSetType": { "type": "string", "description": "The type of the web application firewall rule set. Possible values are: 'OWASP'." }, "ruleSetVersion": { "type": "string", "description": "The version of the rule set type." }, "disabledRuleGroups": { "type": "array", "items": { "$ref": "#/definitions/ApplicationGatewayFirewallDisabledRuleGroup" }, "description": "The disabled rule groups." }, "requestBodyCheck": { "type": "boolean", "description": "Whether allow WAF to check request Body." }, "maxRequestBodySize": { "type": "integer", "format": "int32", "maximum": 128, "exclusiveMaximum": false, "minimum": 8, "exclusiveMinimum": false, "description": "Maximum request body size for WAF." }, "maxRequestBodySizeInKb": { "type": "integer", "format": "int32", "maximum": 128, "exclusiveMaximum": false, "minimum": 8, "exclusiveMinimum": false, "description": "Maximum request body size in Kb for WAF." }, "fileUploadLimitInMb": { "type": "integer", "format": "int32", "minimum": 0, "exclusiveMinimum": false, "description": "Maximum file upload size in Mb for WAF." }, "exclusions": { "type": "array", "items": { "$ref": "#/definitions/ApplicationGatewayFirewallExclusion" }, "description": "The exclusion list." } }, "required": [ "enabled", "firewallMode", "ruleSetType", "ruleSetVersion" ], "description": "Application gateway web application firewall configuration." }, "ApplicationGatewayAutoscaleConfiguration": { "properties": { "minCapacity": { "type": "integer", "format": "int32", "minimum": 0, "exclusiveMinimum": false, "description": "Lower bound on number of Application Gateway capacity." }, "maxCapacity": { "type": "integer", "format": "int32", "minimum": 2, "exclusiveMinimum": false, "description": "Upper bound on number of Application Gateway capacity." } }, "required": [ "minCapacity" ], "description": "Application Gateway autoscale configuration." }, "ApplicationGatewayConnectionDraining": { "properties": { "enabled": { "type": "boolean", "description": "Whether connection draining is enabled or not." }, "drainTimeoutInSec": { "type": "integer", "format": "int32", "maximum": 3600, "exclusiveMaximum": false, "minimum": 1, "exclusiveMinimum": false, "description": "The number of seconds connection draining is active. Acceptable values are from 1 second to 3600 seconds." } }, "required": [ "enabled", "drainTimeoutInSec" ], "description": "Connection draining allows open connections to a backend server to be active for a specified time after the backend server got removed from the configuration." }, "ApplicationGatewayFirewallDisabledRuleGroup": { "properties": { "ruleGroupName": { "type": "string", "description": "The name of the rule group that will be disabled." }, "rules": { "type": "array", "items": { "type": "integer", "format": "int32", "x-nullable": false }, "description": "The list of rules that will be disabled. If null, all rules of the rule group will be disabled." } }, "required": [ "ruleGroupName" ], "description": "Allows to disable rules within a rule group or an entire rule group." }, "ApplicationGatewayAvailableServerVariablesResult": { "type": "array", "items": { "type": "string" }, "description": "Response for ApplicationGatewayAvailableServerVariables API service call." }, "ApplicationGatewayAvailableRequestHeadersResult": { "type": "array", "items": { "type": "string" }, "description": "Response for ApplicationGatewayAvailableRequestHeaders API service call." }, "ApplicationGatewayAvailableResponseHeadersResult": { "type": "array", "items": { "type": "string" }, "description": "Response for ApplicationGatewayAvailableResponseHeaders API service call." }, "ApplicationGatewayFirewallExclusion": { "properties": { "matchVariable": { "type": "string", "description": "The variable to be excluded." }, "selectorMatchOperator": { "type": "string", "description": "When matchVariable is a collection, operate on the selector to specify which elements in the collection this exclusion applies to." }, "selector": { "type": "string", "description": "When matchVariable is a collection, operator used to specify which elements in the collection this exclusion applies to." } }, "required": [ "matchVariable", "selectorMatchOperator", "selector" ], "description": "Allow to exclude some variable satisfy the condition for the WAF check." }, "ApplicationGatewayAvailableWafRuleSetsResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/ApplicationGatewayFirewallRuleSet" }, "description": "The list of application gateway rule sets." } }, "description": "Response for ApplicationGatewayAvailableWafRuleSets API service call." }, "ApplicationGatewayFirewallRuleSet": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/ApplicationGatewayFirewallRuleSetPropertiesFormat", "description": "Properties of the application gateway firewall rule set." } }, "allOf": [ { "$ref": "./network.json#/definitions/Resource" } ], "description": "A web application firewall rule set." }, "ApplicationGatewayFirewallRuleSetPropertiesFormat": { "properties": { "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the web application firewall rule set." }, "ruleSetType": { "type": "string", "description": "The type of the web application firewall rule set." }, "ruleSetVersion": { "type": "string", "description": "The version of the web application firewall rule set type." }, "ruleGroups": { "type": "array", "items": { "$ref": "#/definitions/ApplicationGatewayFirewallRuleGroup" }, "description": "The rule groups of the web application firewall rule set." } }, "required": [ "ruleSetType", "ruleSetVersion", "ruleGroups" ], "description": "Properties of the web application firewall rule set." }, "ApplicationGatewayFirewallRuleGroup": { "properties": { "ruleGroupName": { "type": "string", "description": "The name of the web application firewall rule group." }, "description": { "type": "string", "description": "The description of the web application firewall rule group." }, "rules": { "type": "array", "items": { "$ref": "#/definitions/ApplicationGatewayFirewallRule" }, "description": "The rules of the web application firewall rule group." } }, "required": [ "ruleGroupName", "rules" ], "description": "A web application firewall rule group." }, "ApplicationGatewayFirewallRule": { "properties": { "ruleId": { "type": "integer", "format": "int32", "description": "The identifier of the web application firewall rule." }, "description": { "type": "string", "description": "The description of the web application firewall rule." } }, "required": [ "ruleId" ], "description": "A web application firewall rule." }, "ApplicationGatewayAvailableSslOptions": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/ApplicationGatewayAvailableSslOptionsPropertiesFormat", "description": "Properties of the application gateway available SSL options." } }, "allOf": [ { "$ref": "./network.json#/definitions/Resource" } ], "description": "Response for ApplicationGatewayAvailableSslOptions API service call." }, "ApplicationGatewayAvailableSslOptionsPropertiesFormat": { "properties": { "predefinedPolicies": { "type": "array", "items": { "$ref": "./network.json#/definitions/SubResource" }, "description": "List of available Ssl predefined policy." }, "defaultPolicy": { "$ref": "#/definitions/PolicyNameEnum", "description": "Name of the Ssl predefined policy applied by default to application gateway." }, "availableCipherSuites": { "type": "array", "items": { "$ref": "#/definitions/CipherSuitesEnum" }, "description": "List of available Ssl cipher suites." }, "availableProtocols": { "type": "array", "items": { "$ref": "#/definitions/ProtocolsEnum" }, "description": "List of available Ssl protocols." } }, "description": "Properties of ApplicationGatewayAvailableSslOptions." }, "ApplicationGatewayAvailableSslPredefinedPolicies": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/ApplicationGatewaySslPredefinedPolicy" }, "description": "List of available Ssl predefined policy." }, "nextLink": { "type": "string", "description": "URL to get the next set of results." } }, "description": "Response for ApplicationGatewayAvailableSslOptions API service call." }, "ApplicationGatewaySslPredefinedPolicy": { "properties": { "name": { "type": "string", "description": "Name of the Ssl predefined policy." }, "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/ApplicationGatewaySslPredefinedPolicyPropertiesFormat", "description": "Properties of the application gateway SSL predefined policy." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "An Ssl predefined policy." }, "ApplicationGatewaySslPredefinedPolicyPropertiesFormat": { "properties": { "cipherSuites": { "type": "array", "items": { "$ref": "#/definitions/CipherSuitesEnum" }, "description": "Ssl cipher suites to be enabled in the specified order for application gateway." }, "minProtocolVersion": { "$ref": "#/definitions/ProtocolsEnum", "description": "Minimum version of Ssl protocol to be supported on application gateway." } }, "description": "Properties of ApplicationGatewaySslPredefinedPolicy." }, "ApplicationGatewayCustomError": { "properties": { "statusCode": { "type": "string", "description": "Status code of the application gateway customer error.", "enum": [ "HttpStatus403", "HttpStatus502" ], "x-ms-enum": { "name": "ApplicationGatewayCustomErrorStatusCode", "modelAsString": true } }, "customErrorPageUrl": { "type": "string", "description": "Error page URL of the application gateway customer error." } }, "description": "Customer error of an application gateway." }, "PolicyNameEnum": { "type": "string", "description": "Ssl predefined policy name enums.", "enum": [ "AppGwSslPolicy20150501", "AppGwSslPolicy20170401", "AppGwSslPolicy20170401S" ], "x-ms-enum": { "name": "ApplicationGatewaySslPolicyName", "modelAsString": true } }, "ProtocolsEnum": { "type": "string", "description": "Ssl protocol enums.", "enum": [ "TLSv1_0", "TLSv1_1", "TLSv1_2" ], "x-ms-enum": { "name": "ApplicationGatewaySslProtocol", "modelAsString": true } }, "CipherSuitesEnum": { "type": "string", "description": "Ssl cipher suites enums.", "enum": [ "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384", "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384", "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256", "TLS_DHE_RSA_WITH_AES_256_CBC_SHA", "TLS_DHE_RSA_WITH_AES_128_CBC_SHA", "TLS_RSA_WITH_AES_256_GCM_SHA384", "TLS_RSA_WITH_AES_128_GCM_SHA256", "TLS_RSA_WITH_AES_256_CBC_SHA256", "TLS_RSA_WITH_AES_128_CBC_SHA256", "TLS_RSA_WITH_AES_256_CBC_SHA", "TLS_RSA_WITH_AES_128_CBC_SHA", "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384", "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256", "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256", "TLS_DHE_DSS_WITH_AES_256_CBC_SHA", "TLS_DHE_DSS_WITH_AES_128_CBC_SHA", "TLS_RSA_WITH_3DES_EDE_CBC_SHA", "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA", "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" ], "x-ms-enum": { "name": "ApplicationGatewaySslCipherSuite", "modelAsString": true } }, "RedirectTypeEnum": { "type": "string", "description": "Redirect type enum.", "enum": [ "Permanent", "Found", "SeeOther", "Temporary" ], "x-ms-enum": { "name": "ApplicationGatewayRedirectType", "modelAsString": true } }, "ApplicationGatewayProtocol": { "type": "string", "description": "Application Gateway protocol.", "enum": [ "Http", "Https" ], "x-ms-enum": { "name": "ApplicationGatewayProtocol", "modelAsString": true } } } } spec-0.21.0/fixtures/azure/applicationSecurityGroup.json000066400000000000000000000323511457312531500235000ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "title": "NetworkManagementClient", "description": "The Microsoft Azure Network management API provides a RESTful set of web services that interact with Microsoft Azure Networks service to manage your network resources. The API has entities that capture the relationship between an end user and the Microsoft Azure Networks service.", "version": "2020-04-01" }, "host": "management.azure.com", "schemes": [ "https" ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "security": [ { "azure_auth": [ "user_impersonation" ] } ], "securityDefinitions": { "azure_auth": { "type": "oauth2", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "flow": "implicit", "description": "Azure Active Directory OAuth2 Flow.", "scopes": { "user_impersonation": "impersonate your user account" } } }, "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}": { "delete": { "tags": [ "ApplicationSecurityGroups" ], "operationId": "ApplicationSecurityGroups_Delete", "description": "Deletes the specified application security group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "applicationSecurityGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the application security group." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "204": { "description": "Request successful. Resource does not exist." }, "202": { "description": "Accepted and the operation will complete asynchronously." }, "200": { "description": "Delete successful." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" }, "x-ms-examples": { "Delete application security group": { "$ref": "./examples/ApplicationSecurityGroupDelete.json" } } }, "get": { "tags": [ "ApplicationSecurityGroups" ], "operationId": "ApplicationSecurityGroups_Get", "description": "Gets information about the specified application security group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "applicationSecurityGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the application security group." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns the specified application security group resource.", "schema": { "$ref": "#/definitions/ApplicationSecurityGroup" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Get application security group": { "$ref": "./examples/ApplicationSecurityGroupGet.json" } } }, "put": { "tags": [ "ApplicationSecurityGroups" ], "operationId": "ApplicationSecurityGroups_CreateOrUpdate", "description": "Creates or updates an application security group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "applicationSecurityGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the application security group." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ApplicationSecurityGroup" }, "description": "Parameters supplied to the create or update ApplicationSecurityGroup operation." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "201": { "description": "Create successful. The operation returns the resulting application security group resource.", "schema": { "$ref": "#/definitions/ApplicationSecurityGroup" } }, "200": { "description": "Update successful. The operation returns the resulting application security group resource.", "schema": { "$ref": "#/definitions/ApplicationSecurityGroup" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "azure-async-operation" }, "x-ms-examples": { "Create application security group": { "$ref": "./examples/ApplicationSecurityGroupCreate.json" } } }, "patch": { "tags": [ "applicationSecurityGroups" ], "operationId": "ApplicationSecurityGroups_UpdateTags", "description": "Updates an application security group's tags.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "applicationSecurityGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the application security group." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "./network.json#/definitions/TagsObject" }, "description": "Parameters supplied to update application security group tags." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Update successful. The operation returns the resulting ApplicationSecurityGroup resource.", "schema": { "$ref": "#/definitions/ApplicationSecurityGroup" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Update application security group tags": { "$ref": "./examples/ApplicationSecurityGroupUpdateTags.json" } } } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationSecurityGroups": { "get": { "tags": [ "ApplicationSecurityGroups" ], "operationId": "ApplicationSecurityGroups_ListAll", "description": "Gets all application security groups in a subscription.", "parameters": [ { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of application security group resources.", "schema": { "$ref": "#/definitions/ApplicationSecurityGroupListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" }, "x-ms-examples": { "List all application security groups": { "$ref": "./examples/ApplicationSecurityGroupListAll.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups": { "get": { "tags": [ "ApplicationSecurityGroups" ], "operationId": "ApplicationSecurityGroups_List", "description": "Gets all the application security groups in a resource group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of application security group resources.", "schema": { "$ref": "#/definitions/ApplicationSecurityGroupListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "List load balancers in resource group": { "$ref": "./examples/ApplicationSecurityGroupList.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } } }, "definitions": { "ApplicationSecurityGroup": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/ApplicationSecurityGroupPropertiesFormat", "description": "Properties of the application security group." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." } }, "allOf": [ { "$ref": "./network.json#/definitions/Resource" } ], "description": "An application security group in a resource group." }, "ApplicationSecurityGroupPropertiesFormat": { "properties": { "resourceGuid": { "readOnly": true, "type": "string", "description": "The resource GUID property of the application security group resource. It uniquely identifies a resource, even if the user changes its name or migrate the resource across subscriptions or resource groups." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the application security group resource." } }, "description": "Application security group properties." }, "ApplicationSecurityGroupListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/ApplicationSecurityGroup" }, "description": "A list of application security groups." }, "nextLink": { "readOnly": true, "type": "string", "description": "The URL to get the next set of results." } }, "description": "A list of application security groups." } } } spec-0.21.0/fixtures/azure/examples/000077500000000000000000000000001457312531500173475ustar00rootroot00000000000000spec-0.21.0/fixtures/azure/examples/NetworkInterfaceCreate.json000066400000000000000000000071201457312531500246400ustar00rootroot00000000000000{ "parameters": { "api-version": "2020-04-01", "subscriptionId": "subid", "resourceGroupName": "rg1", "networkInterfaceName": "test-nic", "parameters": { "properties": { "enableAcceleratedNetworking": true, "ipConfigurations": [ { "name": "ipconfig1", "properties": { "publicIPAddress": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip" }, "subnet": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default" } } } ] }, "location": "eastus" } }, "responses": { "200": { "body": { "name": "test-nic", "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic", "location": "eastus", "properties": { "provisioningState": "Succeeded", "ipConfigurations": [ { "name": "ipconfig1", "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig1", "properties": { "provisioningState": "Succeeded", "privateIPAddress": "172.20.2.4", "privateIPAllocationMethod": "Dynamic", "publicIPAddress": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip" }, "subnet": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default" }, "primary": true, "privateIPAddressVersion": "IPv4" } } ], "dnsSettings": { "dnsServers": [], "appliedDnsServers": [] }, "enableAcceleratedNetworking": true, "enableIPForwarding": false }, "type": "Microsoft.Network/networkInterfaces" } }, "201": { "body": { "name": "test-nic", "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic", "location": "eastus", "properties": { "provisioningState": "Succeeded", "ipConfigurations": [ { "name": "ipconfig1", "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig1", "properties": { "provisioningState": "Succeeded", "privateIPAddress": "172.20.2.4", "privateIPAllocationMethod": "Dynamic", "publicIPAddress": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip" }, "subnet": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default" }, "primary": true, "privateIPAddressVersion": "IPv4" } } ], "dnsSettings": { "dnsServers": [], "appliedDnsServers": [] }, "enableAcceleratedNetworking": true, "enableIPForwarding": false }, "type": "Microsoft.Network/networkInterfaces" } } } } spec-0.21.0/fixtures/azure/examples/NetworkInterfaceDelete.json000066400000000000000000000003431457312531500246370ustar00rootroot00000000000000{ "parameters": { "api-version": "2020-04-01", "subscriptionId": "subid", "resourceGroupName": "rg1", "networkInterfaceName": "test-nic" }, "responses": { "200": {}, "202": {}, "204": {} } } spec-0.21.0/fixtures/azure/examples/NetworkInterfaceEffectiveNSGList.json000066400000000000000000000045761457312531500265550ustar00rootroot00000000000000{ "parameters": { "api-version": "2020-04-01", "subscriptionId": "subid", "resourceGroupName": "rg1", "networkInterfaceName": "nic1" }, "responses": { "200": { "body": { "value": [ { "networkSecurityGroup": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/test-nsg" }, "association": { "subnet": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default" }, "networkInterface": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/nic1" } }, "effectiveSecurityRules": [ { "name": "securityRules/rule1", "protocol": "Tcp", "sourcePortRange": "456-456", "destinationPortRange": "6579-6579", "sourceAddressPrefix": "0.0.0.0/32", "destinationAddressPrefix": "0.0.0.0/32", "access": "Allow", "priority": 234, "direction": "Inbound" }, { "name": "securityRules/default-allow-rdp", "protocol": "Tcp", "sourcePortRange": "0-65535", "destinationPortRange": "3389-3389", "sourceAddressPrefix": "1.1.1.1/32", "destinationAddressPrefix": "0.0.0.0/0", "access": "Allow", "priority": 1000, "direction": "Inbound" }, { "name": "defaultSecurityRules/AllowInternetOutBound", "protocol": "All", "sourcePortRange": "0-65535", "destinationPortRange": "0-65535", "sourceAddressPrefix": "0.0.0.0/0", "destinationAddressPrefix": "Internet", "expandedDestinationAddressPrefix": [ "32.0.0.0/3", "4.0.0.0/6", "2.0.0.0/7", "1.0.0.0/8" ], "access": "Allow", "priority": 65001, "direction": "Outbound" } ] } ] } }, "202": {} } } spec-0.21.0/fixtures/azure/examples/NetworkInterfaceEffectiveRouteTableList.json000066400000000000000000000032161457312531500301620ustar00rootroot00000000000000{ "parameters": { "api-version": "2020-04-01", "subscriptionId": "subid", "resourceGroupName": "rg1", "networkInterfaceName": "nic1" }, "responses": { "200": { "body": { "value": [ { "source": "Default", "state": "Active", "addressPrefix": [ "172.20.2.0/24" ], "nextHopType": "VnetLocal", "nextHopIpAddress": [] }, { "source": "Default", "state": "Active", "addressPrefix": [ "0.0.0.0/0" ], "nextHopType": "Internet", "nextHopIpAddress": [] }, { "source": "Default", "state": "Active", "addressPrefix": [ "10.0.0.0/8" ], "nextHopType": "None", "nextHopIpAddress": [] }, { "source": "Default", "state": "Active", "addressPrefix": [ "100.64.0.0/10" ], "nextHopType": "None", "nextHopIpAddress": [] }, { "source": "Default", "state": "Active", "addressPrefix": [ "172.16.0.0/12" ], "nextHopType": "None", "nextHopIpAddress": [] }, { "source": "Default", "state": "Active", "addressPrefix": [ "192.168.0.0/16" ], "nextHopType": "None", "nextHopIpAddress": [] } ] } }, "202": {} } } spec-0.21.0/fixtures/azure/examples/NetworkInterfaceGet.json000066400000000000000000000040331457312531500241540ustar00rootroot00000000000000{ "parameters": { "api-version": "2020-04-01", "subscriptionId": "subid", "resourceGroupName": "rg1", "networkInterfaceName": "test-nic" }, "responses": { "200": { "body": { "name": "test-nic", "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic", "location": "eastus", "properties": { "provisioningState": "Succeeded", "ipConfigurations": [ { "name": "ipconfig1", "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig1", "properties": { "provisioningState": "Succeeded", "privateIPAddress": "172.20.2.4", "privateIPAllocationMethod": "Dynamic", "publicIPAddress": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip" }, "subnet": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default" }, "primary": true, "privateIPAddressVersion": "IPv4" } } ], "dnsSettings": { "dnsServers": [], "appliedDnsServers": [], "internalDomainNameSuffix": "test.bx.internal.cloudapp.net" }, "macAddress": "00-0D-3A-1B-C7-21", "enableAcceleratedNetworking": true, "enableIPForwarding": false, "networkSecurityGroup": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg" }, "primary": true, "virtualMachine": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1" } }, "type": "Microsoft.Network/networkInterfaces" } } } } spec-0.21.0/fixtures/azure/examples/NetworkInterfaceIPConfigurationGet.json000066400000000000000000000032331457312531500271360ustar00rootroot00000000000000{ "parameters": { "subscriptionId": "subid", "resourceGroupName": "testrg", "networkInterfaceName": "mynic", "ipConfigurationName": "ipconfig1", "api-version": "2020-04-01" }, "responses": { "200": { "body": { "name": "ipconfig1", "id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/mynic/ipConfigurations/ipconfig1", "etag": "W/\\\"00000000-0000-0000-0000-000000000000\\\"", "properties": { "provisioningState": "Succeeded", "privateIPAddress": "10.0.1.4", "privateIPAllocationMethod": "Dynamic", "subnet": { "id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/frontendSubnet" }, "privateIPAddressVersion": "IPv4", "loadBalancerBackendAddressPools": [ { "id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/backendAddressPools/bepool1" } ], "loadBalancerInboundNatRules": [ { "id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/inboundNatRules/inbound1" } ], "virtualNetworkTaps": [ { "id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworkTaps/vTAP1" }, { "id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworkTaps/vTAP2" } ] } } } } } spec-0.21.0/fixtures/azure/examples/NetworkInterfaceIPConfigurationList.json000066400000000000000000000017121457312531500273320ustar00rootroot00000000000000{ "parameters": { "subscriptionId": "subid", "resourceGroupName": "testrg", "networkInterfaceName": "nic1", "api-version": "2020-04-01" }, "responses": { "200": { "body": { "value": [ { "name": "ipconfig1", "id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/nic1/ipConfigurations/ipconfig1", "etag": "W/\\\"00000000-0000-0000-0000-000000000000\\\"", "properties": { "provisioningState": "Succeeded", "privateIPAddress": "10.0.0.4", "privateIPAllocationMethod": "Dynamic", "subnet": { "id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet12/subnets/subnet12" }, "primary": true, "privateIPAddressVersion": "IPv4" } } ] } } } } spec-0.21.0/fixtures/azure/examples/NetworkInterfaceList.json000066400000000000000000000073301457312531500243530ustar00rootroot00000000000000{ "parameters": { "api-version": "2020-04-01", "subscriptionId": "subid", "resourceGroupName": "rg1" }, "responses": { "200": { "body": { "value": [ { "name": "test-nic", "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic", "location": "eastus", "properties": { "provisioningState": "Succeeded", "ipConfigurations": [ { "name": "ipconfig1", "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig1", "properties": { "provisioningState": "Succeeded", "privateIPAddress": "172.20.2.4", "privateIPAllocationMethod": "Dynamic", "publicIPAddress": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip" }, "subnet": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default" }, "primary": true, "privateIPAddressVersion": "IPv4" } } ], "dnsSettings": { "dnsServers": [], "appliedDnsServers": [], "internalDomainNameSuffix": "test.bx.internal.cloudapp.net" }, "macAddress": "00-0D-3A-1B-C7-21", "enableAcceleratedNetworking": true, "enableIPForwarding": false, "networkSecurityGroup": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg" }, "primary": true, "virtualMachine": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1" } }, "type": "Microsoft.Network/networkInterfaces" }, { "name": "test-nic2", "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic2", "location": "eastus", "properties": { "provisioningState": "Succeeded", "ipConfigurations": [ { "name": "ipconfig1", "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic2/ipConfigurations/ipconfig1", "properties": { "provisioningState": "Succeeded", "privateIPAddress": "172.20.2.4", "privateIPAllocationMethod": "Dynamic", "publicIPAddress": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip2" }, "subnet": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet2/subnets/default" }, "primary": true, "privateIPAddressVersion": "IPv4" } } ], "dnsSettings": { "dnsServers": [], "appliedDnsServers": [] }, "enableAcceleratedNetworking": true, "enableIPForwarding": false }, "type": "Microsoft.Network/networkInterfaces" } ] } } } } spec-0.21.0/fixtures/azure/examples/NetworkInterfaceListAll.json000066400000000000000000000073021457312531500250030ustar00rootroot00000000000000{ "parameters": { "api-version": "2020-04-01", "subscriptionId": "subid" }, "responses": { "200": { "body": { "value": [ { "name": "test-nic", "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic", "location": "eastus", "properties": { "provisioningState": "Succeeded", "ipConfigurations": [ { "name": "ipconfig1", "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig1", "properties": { "provisioningState": "Succeeded", "privateIPAddress": "172.20.2.4", "privateIPAllocationMethod": "Dynamic", "publicIPAddress": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip" }, "subnet": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default" }, "primary": true, "privateIPAddressVersion": "IPv4" } } ], "dnsSettings": { "dnsServers": [], "appliedDnsServers": [], "internalDomainNameSuffix": "test.bx.internal.cloudapp.net" }, "macAddress": "00-0D-3A-1B-C7-21", "enableAcceleratedNetworking": true, "enableIPForwarding": false, "networkSecurityGroup": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg" }, "primary": true, "virtualMachine": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1" } }, "type": "Microsoft.Network/networkInterfaces" }, { "name": "test-nic2", "id": "/subscriptions/subid/resourceGroups/rgnew/providers/Microsoft.Network/networkInterfaces/test-nic2", "location": "eastus", "properties": { "provisioningState": "Succeeded", "ipConfigurations": [ { "name": "ipconfig1", "id": "/subscriptions/subid/resourceGroups/rgnew/providers/Microsoft.Network/networkInterfaces/test-nic2/ipConfigurations/ipconfig1", "properties": { "provisioningState": "Succeeded", "privateIPAddress": "172.20.2.4", "privateIPAllocationMethod": "Dynamic", "publicIPAddress": { "id": "/subscriptions/subid/resourceGroups/rgnew/providers/Microsoft.Network/publicIPAddresses/test-ip2" }, "subnet": { "id": "/subscriptions/subid/resourceGroups/rgnew/providers/Microsoft.Network/virtualNetworks/rgnew-vnet2/subnets/default" }, "primary": true, "privateIPAddressVersion": "IPv4" } } ], "dnsSettings": { "dnsServers": [], "appliedDnsServers": [] }, "enableAcceleratedNetworking": true, "enableIPForwarding": false }, "type": "Microsoft.Network/networkInterfaces" } ] } } } } spec-0.21.0/fixtures/azure/examples/NetworkInterfaceLoadBalancerList.json000066400000000000000000000145031457312531500266030ustar00rootroot00000000000000{ "parameters": { "subscriptionId": "subid", "resourceGroupName": "testrg", "networkInterfaceName": "nic1", "api-version": "2020-04-01" }, "responses": { "200": { "body": { "value": [ { "name": "lbname1", "id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1", "etag": "W/\\\"00000000-0000-0000-0000-000000000000\\\"", "type": "Microsoft.Network/loadBalancers", "location": "westus", "properties": { "provisioningState": "Succeeded", "resourceGuid": "00000000-0000-0000-0000-000000000000", "frontendIPConfigurations": [ { "name": "lbfrontend", "id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/frontendIPConfigurations/lbfrontend", "etag": "W/\\\"00000000-0000-0000-0000-000000000000\\\"", "properties": { "provisioningState": "Succeeded", "privateIPAllocationMethod": "Dynamic", "publicIPAddress": { "id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/publicIPAddresses/myDynamicPublicIP" }, "loadBalancingRules": [ { "id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/loadBalancingRules/rule1" } ], "inboundNatRules": [ { "id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/inboundNatRules/inbound1" } ] } } ], "backendAddressPools": [ { "name": "bepool1", "id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/backendAddressPools/bepool1", "etag": "W/\\\"00000000-0000-0000-0000-000000000000\\\"", "properties": { "provisioningState": "Succeeded", "backendIPConfigurations": [ { "id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/nic1/ipConfigurations/ipconfig1" } ], "loadBalancingRules": [ { "id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/loadBalancingRules/rule1" } ] } } ], "loadBalancingRules": [ { "name": "rule1", "id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/loadBalancingRules/rule1", "etag": "W/\\\"00000000-0000-0000-0000-000000000000\\\"", "properties": { "provisioningState": "Succeeded", "frontendIPConfiguration": { "id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/frontendIPConfigurations/lbfrontend" }, "frontendPort": 80, "backendPort": 80, "enableFloatingIP": false, "idleTimeoutInMinutes": 15, "protocol": "Tcp", "loadDistribution": "Default", "backendAddressPool": { "id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/backendAddressPools/bepool1" }, "probe": { "id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/probes/probe1" } } } ], "probes": [ { "name": "probe1", "id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/probes/probe1", "etag": "W/\\\"00000000-0000-0000-0000-000000000000\\\"", "properties": { "provisioningState": "Succeeded", "protocol": "Http", "port": 80, "requestPath": "healthcheck.aspx", "intervalInSeconds": 15, "numberOfProbes": 2, "loadBalancingRules": [ { "id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/loadBalancingRules/rule1" } ] } } ], "inboundNatRules": [ { "name": "inbound1", "id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/inboundNatRules/inbound1", "etag": "W/\\\"00000000-0000-0000-0000-000000000000\\\"", "properties": { "provisioningState": "Succeeded", "frontendIPConfiguration": { "id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lbname1/frontendIPConfigurations/lbfrontend" }, "frontendPort": 3389, "backendPort": 3389, "enableFloatingIP": false, "idleTimeoutInMinutes": 15, "protocol": "Tcp", "backendIPConfiguration": { "id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/nic1/ipConfigurations/ipconfig1" } } } ], "outboundRules": [], "inboundNatPools": [] } } ] } } } } spec-0.21.0/fixtures/azure/examples/NetworkInterfaceTapConfigurationCreate.json000066400000000000000000000030741457312531500300410ustar00rootroot00000000000000{ "parameters": { "subscriptionId": "subid", "resourceGroupName": "testrg", "networkInterfaceName": "mynic", "tapConfigurationName": "tapconfiguration1", "api-version": "2020-04-01", "tapConfigurationParameters": { "properties": { "virtualNetworkTap": { "id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworkTaps/testvtap" } } } }, "responses": { "200": { "body": { "name": "tapConfiguration1", "id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/mynic/tapConfigurations/tapConfiguration1", "etag": "etag", "type": "Microsoft.Network/networkInterfaces/tapConfigurations", "properties": { "virtualNetworkTap": { "id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworkTaps/testvtap" }, "provisioningState": "Succeded" } } }, "201": { "body": { "name": "tapConfiguration1", "id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/mynic/tapConfigurations/tapConfiguration1", "etag": "etag", "type": "Microsoft.Network/networkInterfaces/tapConfigurations", "properties": { "virtualNetworkTap": { "id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworkTaps/testvtap" }, "provisioningState": "Succeded" } } } } } spec-0.21.0/fixtures/azure/examples/NetworkInterfaceTapConfigurationDelete.json000066400000000000000000000004451457312531500300370ustar00rootroot00000000000000{ "parameters": { "api-version": "2020-04-01", "subscriptionId": "subid", "resourceGroupName": "rg1", "networkInterfaceName": "test-networkinterface", "tapConfigurationName": "test-tapconfiguration" }, "responses": { "200": {}, "202": {}, "204": {} } } spec-0.21.0/fixtures/azure/examples/NetworkInterfaceTapConfigurationGet.json000066400000000000000000000014361457312531500273550ustar00rootroot00000000000000{ "parameters": { "subscriptionId": "subid", "resourceGroupName": "testrg", "networkInterfaceName": "mynic", "tapConfigurationName": "tapconfiguration1", "api-version": "2020-04-01" }, "responses": { "200": { "body": { "name": "tapConfiguration1", "id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/mynic/tapConfigurations/tapConfiguration1", "etag": "etag", "type": "Microsoft.Network/networkInterfaces/tapConfigurations", "properties": { "virtualNetworkTap": { "id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworkTaps/testvtap" }, "provisioningState": "Succeded" } } } } } spec-0.21.0/fixtures/azure/examples/NetworkInterfaceTapConfigurationList.json000066400000000000000000000015071457312531500275500ustar00rootroot00000000000000{ "parameters": { "api-version": "2020-04-01", "subscriptionId": "subid", "resourceGroupName": "rg1", "networkInterfaceName": "mynic" }, "responses": { "200": { "body": { "value": [ { "name": "tapConfiguration1", "id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkInterfaces/mynic/tapConfigurations/tapConfiguration1", "etag": "etag", "type": "Microsoft.Network/networkInterfaces/tapConfigurations", "properties": { "virtualNetworkTap": { "id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworkTaps/testvtap" }, "provisioningState": "Succeded" } } ] } } } } spec-0.21.0/fixtures/azure/examples/NetworkInterfaceUpdateTags.json000066400000000000000000000034121457312531500254760ustar00rootroot00000000000000{ "parameters": { "api-version": "2020-04-01", "subscriptionId": "subid", "resourceGroupName": "rg1", "networkInterfaceName": "test-nic", "parameters": { "tags": { "tag1": "value1", "tag2": "value2" } } }, "responses": { "200": { "body": { "name": "test-nic", "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic", "location": "eastus", "tags": { "tag1": "value1", "tag2": "value2" }, "properties": { "provisioningState": "Succeeded", "ipConfigurations": [ { "name": "ipconfig1", "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/test-nic/ipConfigurations/ipconfig1", "properties": { "provisioningState": "Succeeded", "privateIPAddress": "172.20.2.4", "privateIPAllocationMethod": "Dynamic", "publicIPAddress": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip" }, "subnet": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default" }, "primary": true, "privateIPAddressVersion": "IPv4" } } ], "dnsSettings": { "dnsServers": [], "appliedDnsServers": [] }, "enableAcceleratedNetworking": true, "enableIPForwarding": false }, "type": "Microsoft.Network/networkInterfaces" } } } } spec-0.21.0/fixtures/azure/examples/PublicIpAddressCreateCustomizedValues.json000066400000000000000000000037231457312531500276370ustar00rootroot00000000000000{ "parameters": { "api-version": "2020-04-01", "subscriptionId": "subid", "resourceGroupName": "rg1", "publicIpAddressName": "test-ip", "zones": [ "1" ], "parameters": { "properties": { "publicIPAllocationMethod": "Static", "idleTimeoutInMinutes": 10, "publicIPAddressVersion": "IPv4" }, "sku": { "name": "Standard" }, "location": "eastus" } }, "responses": { "200": { "body": { "name": "testDNS-ip", "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip", "location": "eastus", "zones": [ "1" ], "properties": { "provisioningState": "Succeeded", "publicIPAddressVersion": "IPv4", "publicIPAllocationMethod": "Static", "idleTimeoutInMinutes": 10, "ipConfiguration": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1" } }, "sku": { "name": "Standard" }, "type": "Microsoft.Network/publicIPAddresses" } }, "201": { "body": { "name": "testDNS-ip", "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip", "location": "eastus", "zones": [ "1" ], "properties": { "provisioningState": "Succeeded", "publicIPAddressVersion": "IPv4", "publicIPAllocationMethod": "Static", "idleTimeoutInMinutes": 10, "ipConfiguration": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1" } }, "sku": { "name": "Standard" }, "type": "Microsoft.Network/publicIPAddresses" } } } } spec-0.21.0/fixtures/azure/examples/PublicIpAddressCreateDefaults.json000066400000000000000000000032101457312531500260670ustar00rootroot00000000000000{ "parameters": { "api-version": "2020-04-01", "subscriptionId": "subid", "resourceGroupName": "rg1", "publicIpAddressName": "test-ip", "parameters": { "location": "eastus" } }, "responses": { "200": { "body": { "name": "testDNS-ip", "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip", "location": "eastus", "properties": { "provisioningState": "Succeeded", "publicIPAddressVersion": "IPv4", "publicIPAllocationMethod": "Dynamic", "idleTimeoutInMinutes": 4, "ipConfiguration": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1" } }, "sku": { "name": "Basic" }, "type": "Microsoft.Network/publicIPAddresses" } }, "201": { "body": { "name": "testDNS-ip", "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip", "location": "eastus", "properties": { "provisioningState": "Succeeded", "publicIPAddressVersion": "IPv4", "publicIPAllocationMethod": "Dynamic", "idleTimeoutInMinutes": 4, "ipConfiguration": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1" } }, "sku": { "name": "Basic" }, "type": "Microsoft.Network/publicIPAddresses" } } } } spec-0.21.0/fixtures/azure/examples/PublicIpAddressCreateDns.json000066400000000000000000000036241457312531500250550ustar00rootroot00000000000000{ "parameters": { "api-version": "2020-04-01", "subscriptionId": "subid", "resourceGroupName": "rg1", "publicIpAddressName": "test-ip", "parameters": { "properties": { "dnsSettings": { "domainNameLabel": "dnslbl" } }, "location": "eastus" } }, "responses": { "200": { "body": { "name": "testDNS-ip", "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip", "location": "eastus", "properties": { "provisioningState": "Succeeded", "publicIPAddressVersion": "IPv4", "publicIPAllocationMethod": "Dynamic", "idleTimeoutInMinutes": 4, "dnsSettings": { "domainNameLabel": "dnslbl", "fqdn": "dnslbl.westus.cloudapp.azure.com" }, "ipConfiguration": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1" } }, "type": "Microsoft.Network/publicIPAddresses" } }, "201": { "body": { "name": "testDNS-ip", "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip", "location": "eastus", "properties": { "provisioningState": "Succeeded", "publicIPAddressVersion": "IPv4", "publicIPAllocationMethod": "Dynamic", "idleTimeoutInMinutes": 4, "dnsSettings": { "domainNameLabel": "dnslbl", "fqdn": "dnslbl.westus.cloudapp.azure.com" }, "ipConfiguration": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1" } }, "type": "Microsoft.Network/publicIPAddresses" } } } } spec-0.21.0/fixtures/azure/examples/PublicIpAddressDelete.json000066400000000000000000000003411457312531500244000ustar00rootroot00000000000000{ "parameters": { "api-version": "2020-04-01", "subscriptionId": "subid", "resourceGroupName": "rg1", "publicIpAddressName": "test-ip" }, "responses": { "200": {}, "202": {}, "204": {} } } spec-0.21.0/fixtures/azure/examples/PublicIpAddressGet.json000066400000000000000000000021051457312531500237150ustar00rootroot00000000000000{ "parameters": { "api-version": "2020-04-01", "subscriptionId": "subid", "resourceGroupName": "rg1", "publicIpAddressName": "testDNS-ip" }, "responses": { "200": { "body": { "name": "testDNS-ip", "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/testDNS-ip", "location": "westus", "properties": { "provisioningState": "Succeeded", "publicIPAddressVersion": "IPv4", "publicIPAllocationMethod": "Dynamic", "idleTimeoutInMinutes": 4, "ipConfiguration": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1" }, "ipTags": [ { "ipTagType": "FirstPartyUsage", "tag": "SQL" }, { "ipTagType": "FirstPartyUsage", "tag": "Storage" } ] }, "type": "Microsoft.Network/publicIPAddresses" } } } } spec-0.21.0/fixtures/azure/examples/PublicIpAddressList.json000066400000000000000000000040571457312531500241210ustar00rootroot00000000000000{ "parameters": { "api-version": "2020-04-01", "subscriptionId": "subid", "resourceGroupName": "rg1" }, "responses": { "200": { "body": { "value": [ { "name": "testDNS-ip", "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/testDNS-ip", "location": "westus", "properties": { "provisioningState": "Succeeded", "publicIPAddressVersion": "IPv4", "publicIPAllocationMethod": "Dynamic", "idleTimeoutInMinutes": 4, "ipConfiguration": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1" }, "ipTags": [ { "ipTagType": "FirstPartyUsage", "tag": "SQL" }, { "ipTagType": "FirstPartyUsage", "tag": "Storage" } ] }, "type": "Microsoft.Network/publicIPAddresses" }, { "name": "ip03", "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/ip03", "location": "westus", "properties": { "provisioningState": "Succeeded", "ipAddress": "40.85.154.247", "publicIPAddressVersion": "IPv4", "publicIPAllocationMethod": "Dynamic", "idleTimeoutInMinutes": 4, "dnsSettings": { "domainNameLabel": "testlbl", "fqdn": "testlbl.westus.cloudapp.azure.com" }, "ipConfiguration": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/testLb/frontendIPConfigurations/LoadBalancerFrontEnd" } }, "type": "Microsoft.Network/publicIPAddresses" } ] } } } } spec-0.21.0/fixtures/azure/examples/PublicIpAddressListAll.json000066400000000000000000000033651457312531500245530ustar00rootroot00000000000000{ "parameters": { "api-version": "2020-04-01", "subscriptionId": "subid" }, "responses": { "200": { "body": { "value": [ { "name": "testDNS-ip", "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/testDNS-ip", "location": "westus", "properties": { "provisioningState": "Succeeded", "publicIPAddressVersion": "IPv4", "publicIPAllocationMethod": "Dynamic", "idleTimeoutInMinutes": 4, "ipConfiguration": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1" } }, "type": "Microsoft.Network/publicIPAddresses" }, { "name": "ip01", "id": "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/publicIPAddresses/ip01", "location": "westus", "properties": { "provisioningState": "Succeeded", "ipAddress": "40.85.154.247", "publicIPAddressVersion": "IPv4", "publicIPAllocationMethod": "Dynamic", "idleTimeoutInMinutes": 4, "dnsSettings": { "domainNameLabel": "testlbl", "fqdn": "testlbl.westus.cloudapp.azure.com" }, "ipConfiguration": { "id": "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/loadBalancers/testLb/frontendIPConfigurations/LoadBalancerFrontEnd" } }, "type": "Microsoft.Network/publicIPAddresses" } ] } } } } spec-0.21.0/fixtures/azure/examples/PublicIpAddressUpdateTags.json000066400000000000000000000020071457312531500252400ustar00rootroot00000000000000{ "parameters": { "api-version": "2020-04-01", "subscriptionId": "subid", "resourceGroupName": "rg1", "publicIpAddressName": "test-ip", "parameters": { "tags": { "tag1": "value1", "tag2": "value2" } } }, "responses": { "200": { "body": { "name": "testDNS-ip", "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip", "location": "westus", "properties": { "provisioningState": "Succeeded", "publicIPAddressVersion": "IPv4", "publicIPAllocationMethod": "Static", "idleTimeoutInMinutes": 10, "ipConfiguration": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testDNS649/ipConfigurations/ipconfig1" } }, "tags": { "tag1": "value1", "tag2": "value2" }, "type": "Microsoft.Network/publicIPAddresses" } } } } spec-0.21.0/fixtures/azure/loadBalancer.json000066400000000000000000002316621457312531500210050ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "title": "NetworkManagementClient", "description": "The Microsoft Azure Network management API provides a RESTful set of web services that interact with Microsoft Azure Networks service to manage your network resources. The API has entities that capture the relationship between an end user and the Microsoft Azure Networks service.", "version": "2020-04-01" }, "host": "management.azure.com", "schemes": [ "https" ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "security": [ { "azure_auth": [ "user_impersonation" ] } ], "securityDefinitions": { "azure_auth": { "type": "oauth2", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "flow": "implicit", "description": "Azure Active Directory OAuth2 Flow.", "scopes": { "user_impersonation": "impersonate your user account" } } }, "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}": { "delete": { "tags": [ "LoadBalancers" ], "operationId": "LoadBalancers_Delete", "description": "Deletes the specified load balancer.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "loadBalancerName", "in": "path", "required": true, "type": "string", "description": "The name of the load balancer." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "204": { "description": "Request successful. Resource does not exist." }, "202": { "description": "Accepted and the operation will complete asynchronously." }, "200": { "description": "Delete successful." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Delete load balancer": { "$ref": "./examples/LoadBalancerDelete.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } }, "get": { "tags": [ "LoadBalancers" ], "operationId": "LoadBalancers_Get", "description": "Gets the specified load balancer.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "loadBalancerName", "in": "path", "required": true, "type": "string", "description": "The name of the load balancer." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" }, { "name": "$expand", "in": "query", "required": false, "type": "string", "description": "Expands referenced resources." } ], "responses": { "200": { "description": "Request successful. The operation returns the resulting LoadBalancer resource.", "schema": { "$ref": "#/definitions/LoadBalancer" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Get load balancer": { "$ref": "./examples/LoadBalancerGet.json" } } }, "put": { "tags": [ "LoadBalancers" ], "operationId": "LoadBalancers_CreateOrUpdate", "description": "Creates or updates a load balancer.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "loadBalancerName", "in": "path", "required": true, "type": "string", "description": "The name of the load balancer." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/LoadBalancer" }, "description": "Parameters supplied to the create or update load balancer operation." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "201": { "description": "Create successful. The operation returns the resulting LoadBalancer resource.", "schema": { "$ref": "#/definitions/LoadBalancer" } }, "200": { "description": "Update successful. The operation returns the resulting LoadBalancer resource.", "schema": { "$ref": "#/definitions/LoadBalancer" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Create load balancer": { "$ref": "./examples/LoadBalancerCreate.json" }, "Create load balancer with Standard SKU": { "$ref": "./examples/LoadBalancerCreateStandardSku.json" }, "Create load balancer with Frontend IP in Zone 1": { "$ref": "./examples/LoadBalancerCreateWithZones.json" }, "Create load balancer with inbound nat pool": { "$ref": "./examples/LoadBalancerCreateWithInboundNatPool.json" }, "Create load balancer with outbound rules": { "$ref": "./examples/LoadBalancerCreateWithOutboundRules.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "azure-async-operation" } }, "patch": { "tags": [ "LoadBalancers" ], "operationId": "LoadBalancers_UpdateTags", "description": "Updates a load balancer tags.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "loadBalancerName", "in": "path", "required": true, "type": "string", "description": "The name of the load balancer." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "./network.json#/definitions/TagsObject" }, "description": "Parameters supplied to update load balancer tags." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Update successful. The operation returns the resulting LoadBalancer resource.", "schema": { "$ref": "#/definitions/LoadBalancer" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Update load balancer tags": { "$ref": "./examples/LoadBalancerUpdateTags.json" } } } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers": { "get": { "tags": [ "LoadBalancers" ], "operationId": "LoadBalancers_ListAll", "description": "Gets all the load balancers in a subscription.", "parameters": [ { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of LoadBalancer resources.", "schema": { "$ref": "#/definitions/LoadBalancerListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "List all load balancers": { "$ref": "./examples/LoadBalancerListAll.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers": { "get": { "tags": [ "LoadBalancers" ], "operationId": "LoadBalancers_List", "description": "Gets all the load balancers in a resource group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of LoadBalancer resources.", "schema": { "$ref": "#/definitions/LoadBalancerListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "List load balancers in resource group": { "$ref": "./examples/LoadBalancerList.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools": { "get": { "tags": [ "LoadBalancers" ], "operationId": "LoadBalancerBackendAddressPools_List", "description": "Gets all the load balancer backed address pools.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "loadBalancerName", "in": "path", "required": true, "type": "string", "description": "The name of the load balancer." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of LoadBalancer BackendAddressPool resources.", "schema": { "$ref": "#/definitions/LoadBalancerBackendAddressPoolListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "LoadBalancerBackendAddressPoolList": { "$ref": "./examples/LoadBalancerBackendAddressPoolList.json" }, "Load balancer with BackendAddressPool containing BackendAddresses": { "$ref": "./examples/LBBackendAddressPoolListWithBackendAddressesPoolType.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}": { "get": { "tags": [ "LoadBalancers" ], "operationId": "LoadBalancerBackendAddressPools_Get", "description": "Gets load balancer backend address pool.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "loadBalancerName", "in": "path", "required": true, "type": "string", "description": "The name of the load balancer." }, { "name": "backendAddressPoolName", "in": "path", "required": true, "type": "string", "description": "The name of the backend address pool." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns LoadBalancer BackendAddressPool resource.", "schema": { "$ref": "#/definitions/BackendAddressPool" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "LoadBalancerBackendAddressPoolGet": { "$ref": "./examples/LoadBalancerBackendAddressPoolGet.json" }, "LoadBalancer with BackendAddressPool with BackendAddresses": { "$ref": "./examples/LBBackendAddressPoolWithBackendAddressesGet.json" } } }, "put": { "tags": [ "LoadBalancers" ], "operationId": "LoadBalancerBackendAddressPools_CreateOrUpdate", "description": "Creates or updates a load balancer backend address pool.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "loadBalancerName", "in": "path", "required": true, "type": "string", "description": "The name of the load balancer." }, { "name": "backendAddressPoolName", "in": "path", "required": true, "type": "string", "description": "The name of the backend address pool." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/BackendAddressPool" }, "description": "Parameters supplied to the create or update load balancer backend address pool operation." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "201": { "description": "Create successful. The operation returns the resulting BackendAddressPool resource.", "schema": { "$ref": "#/definitions/BackendAddressPool" } }, "200": { "description": "Update successful. The operation returns the resulting BackendAddressPool resource.", "schema": { "$ref": "#/definitions/BackendAddressPool" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Update load balancer backend pool with backend addresses containing virtual network and IP address.": { "$ref": "./examples/LBBackendAddressPoolWithBackendAddressesPut.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "azure-async-operation" } }, "delete": { "tags": [ "LoadBalancers" ], "operationId": "LoadBalancerBackendAddressPools_Delete", "description": "Deletes the specified load balancer backend address pool.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "loadBalancerName", "in": "path", "required": true, "type": "string", "description": "The name of the load balancer." }, { "name": "backendAddressPoolName", "in": "path", "required": true, "type": "string", "description": "The name of the backend address pool." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "204": { "description": "Request successful. Resource does not exist." }, "202": { "description": "Accepted and the operation will complete asynchronously." }, "200": { "description": "Delete successful." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "BackendAddressPoolDelete": { "$ref": "./examples/LoadBalancerBackendAddressPoolDelete.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations": { "get": { "tags": [ "LoadBalancers" ], "operationId": "LoadBalancerFrontendIPConfigurations_List", "description": "Gets all the load balancer frontend IP configurations.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "loadBalancerName", "in": "path", "required": true, "type": "string", "description": "The name of the load balancer." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of LoadBalancer FrontendIPConfiguration resources.", "schema": { "$ref": "#/definitions/LoadBalancerFrontendIPConfigurationListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "LoadBalancerFrontendIPConfigurationList": { "$ref": "./examples/LoadBalancerFrontendIPConfigurationList.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations/{frontendIPConfigurationName}": { "get": { "tags": [ "LoadBalancers" ], "operationId": "LoadBalancerFrontendIPConfigurations_Get", "description": "Gets load balancer frontend IP configuration.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "loadBalancerName", "in": "path", "required": true, "type": "string", "description": "The name of the load balancer." }, { "name": "frontendIPConfigurationName", "in": "path", "required": true, "type": "string", "description": "The name of the frontend IP configuration." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns LoadBalancer FrontendIPConfiguration resource.", "schema": { "$ref": "#/definitions/FrontendIPConfiguration" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "LoadBalancerFrontendIPConfigurationGet": { "$ref": "./examples/LoadBalancerFrontendIPConfigurationGet.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules": { "get": { "tags": [ "LoadBalancers" ], "operationId": "InboundNatRules_List", "description": "Gets all the inbound nat rules in a load balancer.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "loadBalancerName", "in": "path", "required": true, "type": "string", "description": "The name of the load balancer." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of LoadBalancer InboundNatRule resources.", "schema": { "$ref": "#/definitions/InboundNatRuleListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" }, "x-ms-examples": { "InboundNatRuleList": { "$ref": "./examples/InboundNatRuleList.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}": { "delete": { "tags": [ "LoadBalancers" ], "operationId": "InboundNatRules_Delete", "description": "Deletes the specified load balancer inbound nat rule.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "loadBalancerName", "in": "path", "required": true, "type": "string", "description": "The name of the load balancer." }, { "name": "inboundNatRuleName", "in": "path", "required": true, "type": "string", "description": "The name of the inbound nat rule." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "204": { "description": "Request successful. Resource does not exist." }, "202": { "description": "Accepted and the operation will complete asynchronously." }, "200": { "description": "Delete successful." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "InboundNatRuleDelete": { "$ref": "./examples/InboundNatRuleDelete.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } }, "get": { "tags": [ "LoadBalancers" ], "operationId": "InboundNatRules_Get", "description": "Gets the specified load balancer inbound nat rule.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "loadBalancerName", "in": "path", "required": true, "type": "string", "description": "The name of the load balancer." }, { "name": "inboundNatRuleName", "in": "path", "required": true, "type": "string", "description": "The name of the inbound nat rule." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" }, { "name": "$expand", "in": "query", "required": false, "type": "string", "description": "Expands referenced resources." } ], "responses": { "200": { "description": "Request successful. The operation returns the resulting InboundNatRule resource.", "schema": { "$ref": "#/definitions/InboundNatRule" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "InboundNatRuleGet": { "$ref": "./examples/InboundNatRuleGet.json" } } }, "put": { "tags": [ "LoadBalancers" ], "operationId": "InboundNatRules_CreateOrUpdate", "description": "Creates or updates a load balancer inbound nat rule.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "loadBalancerName", "in": "path", "required": true, "type": "string", "description": "The name of the load balancer." }, { "name": "inboundNatRuleName", "in": "path", "required": true, "type": "string", "description": "The name of the inbound nat rule." }, { "name": "inboundNatRuleParameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/InboundNatRule" }, "description": "Parameters supplied to the create or update inbound nat rule operation." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "201": { "description": "Create successful. The operation returns the resulting InboundNatRule resource.", "schema": { "$ref": "#/definitions/InboundNatRule" } }, "200": { "description": "Update successful. The operation returns the resulting InboundNatRule resource.", "schema": { "$ref": "#/definitions/InboundNatRule" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "azure-async-operation" }, "x-ms-examples": { "InboundNatRuleCreate": { "$ref": "./examples/InboundNatRuleCreate.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules": { "get": { "tags": [ "LoadBalancers" ], "operationId": "LoadBalancerLoadBalancingRules_List", "description": "Gets all the load balancing rules in a load balancer.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "loadBalancerName", "in": "path", "required": true, "type": "string", "description": "The name of the load balancer." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of LoadBalancer LoadBalancingRule resources.", "schema": { "$ref": "#/definitions/LoadBalancerLoadBalancingRuleListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" }, "x-ms-examples": { "LoadBalancerLoadBalancingRuleList": { "$ref": "./examples/LoadBalancerLoadBalancingRuleList.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}": { "get": { "tags": [ "LoadBalancers" ], "operationId": "LoadBalancerLoadBalancingRules_Get", "description": "Gets the specified load balancer load balancing rule.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "loadBalancerName", "in": "path", "required": true, "type": "string", "description": "The name of the load balancer." }, { "name": "loadBalancingRuleName", "in": "path", "required": true, "type": "string", "description": "The name of the load balancing rule." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns the resulting LoadBalancingRule resource.", "schema": { "$ref": "#/definitions/LoadBalancingRule" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "LoadBalancerLoadBalancingRuleGet": { "$ref": "./examples/LoadBalancerLoadBalancingRuleGet.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/outboundRules": { "get": { "tags": [ "LoadBalancers" ], "operationId": "LoadBalancerOutboundRules_List", "description": "Gets all the outbound rules in a load balancer.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "loadBalancerName", "in": "path", "required": true, "type": "string", "description": "The name of the load balancer." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of LoadBalancer OutboundRule resources.", "schema": { "$ref": "#/definitions/LoadBalancerOutboundRuleListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" }, "x-ms-examples": { "LoadBalancerOutboundRuleList": { "$ref": "./examples/LoadBalancerOutboundRuleList.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/outboundRules/{outboundRuleName}": { "get": { "tags": [ "LoadBalancers" ], "operationId": "LoadBalancerOutboundRules_Get", "description": "Gets the specified load balancer outbound rule.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "loadBalancerName", "in": "path", "required": true, "type": "string", "description": "The name of the load balancer." }, { "name": "outboundRuleName", "in": "path", "required": true, "type": "string", "description": "The name of the outbound rule." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns the resulting OutboundRule resource.", "schema": { "$ref": "#/definitions/OutboundRule" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "LoadBalancerOutboundRuleGet": { "$ref": "./examples/LoadBalancerOutboundRuleGet.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/networkInterfaces": { "get": { "tags": [ "LoadBalancers" ], "operationId": "LoadBalancerNetworkInterfaces_List", "description": "Gets associated load balancer network interfaces.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "loadBalancerName", "in": "path", "required": true, "type": "string", "description": "The name of the load balancer." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of NetworkInterface resources.", "schema": { "$ref": "./networkInterface.json#/definitions/NetworkInterfaceListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "LoadBalancerNetworkInterfaceListVmss": { "$ref": "./examples/LoadBalancerNetworkInterfaceListVmss.json" }, "LoadBalancerNetworkInterfaceListSimple": { "$ref": "./examples/LoadBalancerNetworkInterfaceListSimple.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes": { "get": { "tags": [ "LoadBalancers" ], "operationId": "LoadBalancerProbes_List", "description": "Gets all the load balancer probes.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "loadBalancerName", "in": "path", "required": true, "type": "string", "description": "The name of the load balancer." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of LoadBalancer Probe resources.", "schema": { "$ref": "#/definitions/LoadBalancerProbeListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "LoadBalancerProbeList": { "$ref": "./examples/LoadBalancerProbeList.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}": { "get": { "tags": [ "LoadBalancers" ], "operationId": "LoadBalancerProbes_Get", "description": "Gets load balancer probe.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "loadBalancerName", "in": "path", "required": true, "type": "string", "description": "The name of the load balancer." }, { "name": "probeName", "in": "path", "required": true, "type": "string", "description": "The name of the probe." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns LoadBalancer Probe resource.", "schema": { "$ref": "#/definitions/Probe" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "LoadBalancerProbeGet": { "$ref": "./examples/LoadBalancerProbeGet.json" } } } } }, "definitions": { "LoadBalancerSku": { "properties": { "name": { "type": "string", "description": "Name of a load balancer SKU.", "enum": [ "Basic", "Standard" ], "x-ms-enum": { "name": "LoadBalancerSkuName", "modelAsString": true } } }, "description": "SKU of a load balancer." }, "FrontendIPConfigurationPropertiesFormat": { "properties": { "inboundNatRules": { "readOnly": true, "type": "array", "items": { "$ref": "./network.json#/definitions/SubResource" }, "description": "An array of references to inbound rules that use this frontend IP." }, "inboundNatPools": { "readOnly": true, "type": "array", "items": { "$ref": "./network.json#/definitions/SubResource" }, "description": "An array of references to inbound pools that use this frontend IP." }, "outboundRules": { "readOnly": true, "type": "array", "items": { "$ref": "./network.json#/definitions/SubResource" }, "description": "An array of references to outbound rules that use this frontend IP." }, "loadBalancingRules": { "readOnly": true, "type": "array", "items": { "$ref": "./network.json#/definitions/SubResource" }, "description": "An array of references to load balancing rules that use this frontend IP." }, "privateIPAddress": { "type": "string", "description": "The private IP address of the IP configuration." }, "privateIPAllocationMethod": { "$ref": "./network.json#/definitions/IPAllocationMethod", "description": "The Private IP allocation method." }, "privateIPAddressVersion": { "$ref": "./network.json#/definitions/IPVersion", "description": "Whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4." }, "subnet": { "$ref": "./virtualNetwork.json#/definitions/Subnet", "description": "The reference to the subnet resource." }, "publicIPAddress": { "$ref": "./publicIpAddress.json#/definitions/PublicIPAddress", "description": "The reference to the Public IP resource." }, "publicIPPrefix": { "$ref": "./network.json#/definitions/SubResource", "description": "The reference to the Public IP Prefix resource." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the frontend IP configuration resource." } }, "description": "Properties of Frontend IP Configuration of the load balancer." }, "FrontendIPConfiguration": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/FrontendIPConfigurationPropertiesFormat", "description": "Properties of the load balancer probe." }, "name": { "type": "string", "description": "The name of the resource that is unique within the set of frontend IP configurations used by the load balancer. This name can be used to access the resource." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." }, "type": { "readOnly": true, "type": "string", "description": "Type of the resource." }, "zones": { "type": "array", "items": { "type": "string" }, "description": "A list of availability zones denoting the IP allocated for the resource needs to come from." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "Frontend IP address of the load balancer." }, "LoadBalancerBackendAddressPropertiesFormat": { "properties": { "virtualNetwork": { "$ref": "./network.json#/definitions/SubResource", "description": "Reference to an existing virtual network." }, "ipAddress": { "type": "string", "description": "IP Address belonging to the referenced virtual network.", "x-ms-azure-resource": false }, "networkInterfaceIPConfiguration": { "readOnly": true, "$ref": "./network.json#/definitions/SubResource", "description": "Reference to IP address defined in network interfaces." } }, "description": "Properties of the load balancer backend addresses." }, "LoadBalancerBackendAddress": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/LoadBalancerBackendAddressPropertiesFormat", "description": "Properties of load balancer backend address pool." }, "name": { "type": "string", "description": "Name of the backend address." } }, "description": "Load balancer backend addresses." }, "BackendAddressPoolPropertiesFormat": { "properties": { "loadBalancerBackendAddresses": { "type": "array", "items": { "$ref": "#/definitions/LoadBalancerBackendAddress" }, "description": "An array of backend addresses." }, "backendIPConfigurations": { "readOnly": true, "type": "array", "items": { "$ref": "./networkInterface.json#/definitions/NetworkInterfaceIPConfiguration" }, "description": "An array of references to IP addresses defined in network interfaces." }, "loadBalancingRules": { "readOnly": true, "type": "array", "items": { "$ref": "./network.json#/definitions/SubResource" }, "description": "An array of references to load balancing rules that use this backend address pool." }, "outboundRule": { "readOnly": true, "$ref": "./network.json#/definitions/SubResource", "description": "A reference to an outbound rule that uses this backend address pool." }, "outboundRules": { "readOnly": true, "type": "array", "items": { "$ref": "./network.json#/definitions/SubResource" }, "description": "An array of references to outbound rules that use this backend address pool." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the backend address pool resource." } }, "description": "Properties of the backend address pool." }, "BackendAddressPool": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/BackendAddressPoolPropertiesFormat", "description": "Properties of load balancer backend address pool." }, "name": { "type": "string", "description": "The name of the resource that is unique within the set of backend address pools used by the load balancer. This name can be used to access the resource." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." }, "type": { "readOnly": true, "type": "string", "description": "Type of the resource." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "Pool of backend IP addresses." }, "LoadBalancingRulePropertiesFormat": { "properties": { "frontendIPConfiguration": { "$ref": "./network.json#/definitions/SubResource", "description": "A reference to frontend IP addresses." }, "backendAddressPool": { "$ref": "./network.json#/definitions/SubResource", "description": "A reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs." }, "probe": { "$ref": "./network.json#/definitions/SubResource", "description": "The reference to the load balancer probe used by the load balancing rule." }, "protocol": { "$ref": "#/definitions/TransportProtocol", "description": "The reference to the transport protocol used by the load balancing rule." }, "loadDistribution": { "type": "string", "description": "The load distribution policy for this rule.", "enum": [ "Default", "SourceIP", "SourceIPProtocol" ], "x-ms-enum": { "name": "LoadDistribution", "modelAsString": true } }, "frontendPort": { "type": "integer", "format": "int32", "description": "The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables \"Any Port\"." }, "backendPort": { "type": "integer", "format": "int32", "description": "The port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables \"Any Port\"." }, "idleTimeoutInMinutes": { "type": "integer", "format": "int32", "description": "The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP." }, "enableFloatingIP": { "type": "boolean", "description": "Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint." }, "enableTcpReset": { "type": "boolean", "description": "Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP." }, "disableOutboundSnat": { "type": "boolean", "description": "Configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the load balancing rule." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the load balancing rule resource." } }, "required": [ "protocol", "frontendPort" ], "description": "Properties of the load balancer." }, "LoadBalancingRule": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/LoadBalancingRulePropertiesFormat", "description": "Properties of load balancer load balancing rule." }, "name": { "type": "string", "description": "The name of the resource that is unique within the set of load balancing rules used by the load balancer. This name can be used to access the resource." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." }, "type": { "readOnly": true, "type": "string", "description": "Type of the resource." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "A load balancing rule for a load balancer." }, "ProbePropertiesFormat": { "properties": { "loadBalancingRules": { "readOnly": true, "type": "array", "items": { "$ref": "./network.json#/definitions/SubResource" }, "description": "The load balancer rules that use this probe." }, "protocol": { "type": "string", "description": "The protocol of the end point. If 'Tcp' is specified, a received ACK is required for the probe to be successful. If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is required for the probe to be successful.", "enum": [ "Http", "Tcp", "Https" ], "x-ms-enum": { "name": "ProbeProtocol", "modelAsString": true } }, "port": { "type": "integer", "format": "int32", "description": "The port for communicating the probe. Possible values range from 1 to 65535, inclusive." }, "intervalInSeconds": { "type": "integer", "format": "int32", "description": "The interval, in seconds, for how frequently to probe the endpoint for health status. Typically, the interval is slightly less than half the allocated timeout period (in seconds) which allows two full probes before taking the instance out of rotation. The default value is 15, the minimum value is 5." }, "numberOfProbes": { "type": "integer", "format": "int32", "description": "The number of probes where if no response, will result in stopping further traffic from being delivered to the endpoint. This values allows endpoints to be taken out of rotation faster or slower than the typical times used in Azure." }, "requestPath": { "type": "string", "description": "The URI used for requesting health status from the VM. Path is required if a protocol is set to http. Otherwise, it is not allowed. There is no default value." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the probe resource." } }, "required": [ "protocol", "port" ], "description": "Load balancer probe resource." }, "Probe": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/ProbePropertiesFormat", "description": "Properties of load balancer probe." }, "name": { "type": "string", "description": "The name of the resource that is unique within the set of probes used by the load balancer. This name can be used to access the resource." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." }, "type": { "readOnly": true, "type": "string", "description": "Type of the resource." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "A load balancer probe." }, "InboundNatRulePropertiesFormat": { "properties": { "frontendIPConfiguration": { "$ref": "./network.json#/definitions/SubResource", "description": "A reference to frontend IP addresses." }, "backendIPConfiguration": { "readOnly": true, "$ref": "./networkInterface.json#/definitions/NetworkInterfaceIPConfiguration", "description": "A reference to a private IP address defined on a network interface of a VM. Traffic sent to the frontend port of each of the frontend IP configurations is forwarded to the backend IP." }, "protocol": { "$ref": "#/definitions/TransportProtocol", "description": "The reference to the transport protocol used by the load balancing rule." }, "frontendPort": { "type": "integer", "format": "int32", "description": "The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534." }, "backendPort": { "type": "integer", "format": "int32", "description": "The port used for the internal endpoint. Acceptable values range from 1 to 65535." }, "idleTimeoutInMinutes": { "type": "integer", "format": "int32", "description": "The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP." }, "enableFloatingIP": { "type": "boolean", "description": "Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint." }, "enableTcpReset": { "type": "boolean", "description": "Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the inbound NAT rule resource." } }, "description": "Properties of the inbound NAT rule." }, "InboundNatRule": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/InboundNatRulePropertiesFormat", "description": "Properties of load balancer inbound nat rule." }, "name": { "type": "string", "description": "The name of the resource that is unique within the set of inbound NAT rules used by the load balancer. This name can be used to access the resource." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." }, "type": { "readOnly": true, "type": "string", "description": "Type of the resource." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "Inbound NAT rule of the load balancer." }, "InboundNatPoolPropertiesFormat": { "properties": { "frontendIPConfiguration": { "$ref": "./network.json#/definitions/SubResource", "description": "A reference to frontend IP addresses." }, "protocol": { "$ref": "#/definitions/TransportProtocol", "description": "The reference to the transport protocol used by the inbound NAT pool." }, "frontendPortRangeStart": { "type": "integer", "format": "int32", "description": "The first port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65534." }, "frontendPortRangeEnd": { "type": "integer", "format": "int32", "description": "The last port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65535." }, "backendPort": { "type": "integer", "format": "int32", "description": "The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535." }, "idleTimeoutInMinutes": { "type": "integer", "format": "int32", "description": "The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP." }, "enableFloatingIP": { "type": "boolean", "description": "Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint." }, "enableTcpReset": { "type": "boolean", "description": "Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the inbound NAT pool resource." } }, "required": [ "protocol", "frontendPortRangeStart", "frontendPortRangeEnd", "backendPort" ], "description": "Properties of Inbound NAT pool." }, "InboundNatPool": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/InboundNatPoolPropertiesFormat", "description": "Properties of load balancer inbound nat pool." }, "name": { "type": "string", "description": "The name of the resource that is unique within the set of inbound NAT pools used by the load balancer. This name can be used to access the resource." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." }, "type": { "readOnly": true, "type": "string", "description": "Type of the resource." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "Inbound NAT pool of the load balancer." }, "OutboundRulePropertiesFormat": { "properties": { "allocatedOutboundPorts": { "type": "integer", "format": "int32", "description": "The number of outbound ports to be used for NAT." }, "frontendIPConfigurations": { "type": "array", "items": { "$ref": "./network.json#/definitions/SubResource" }, "description": "The Frontend IP addresses of the load balancer." }, "backendAddressPool": { "$ref": "./network.json#/definitions/SubResource", "description": "A reference to a pool of DIPs. Outbound traffic is randomly load balanced across IPs in the backend IPs." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the outbound rule resource." }, "protocol": { "type": "string", "description": "The protocol for the outbound rule in load balancer.", "enum": [ "Tcp", "Udp", "All" ], "x-ms-enum": { "name": "LoadBalancerOutboundRuleProtocol", "modelAsString": true } }, "enableTcpReset": { "type": "boolean", "description": "Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP." }, "idleTimeoutInMinutes": { "type": "integer", "description": "The timeout for the TCP idle connection." } }, "required": [ "backendAddressPool", "frontendIPConfigurations", "protocol" ], "description": "Outbound rule of the load balancer." }, "OutboundRule": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/OutboundRulePropertiesFormat", "description": "Properties of load balancer outbound rule." }, "name": { "type": "string", "description": "The name of the resource that is unique within the set of outbound rules used by the load balancer. This name can be used to access the resource." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." }, "type": { "readOnly": true, "type": "string", "description": "Type of the resource." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "Outbound rule of the load balancer." }, "LoadBalancerPropertiesFormat": { "properties": { "frontendIPConfigurations": { "type": "array", "items": { "$ref": "#/definitions/FrontendIPConfiguration" }, "description": "Object representing the frontend IPs to be used for the load balancer." }, "backendAddressPools": { "type": "array", "items": { "$ref": "#/definitions/BackendAddressPool" }, "description": "Collection of backend address pools used by a load balancer." }, "loadBalancingRules": { "type": "array", "items": { "$ref": "#/definitions/LoadBalancingRule" }, "description": "Object collection representing the load balancing rules Gets the provisioning." }, "probes": { "type": "array", "items": { "$ref": "#/definitions/Probe" }, "description": "Collection of probe objects used in the load balancer." }, "inboundNatRules": { "type": "array", "items": { "$ref": "#/definitions/InboundNatRule" }, "description": "Collection of inbound NAT Rules used by a load balancer. Defining inbound NAT rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an Inbound NAT pool. They have to reference individual inbound NAT rules." }, "inboundNatPools": { "type": "array", "items": { "$ref": "#/definitions/InboundNatPool" }, "description": "Defines an external port range for inbound NAT to a single backend port on NICs associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated with the Load Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is mutually exclusive with defining inbound Nat rules. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They have to reference individual inbound NAT rules." }, "outboundRules": { "type": "array", "items": { "$ref": "#/definitions/OutboundRule" }, "description": "The outbound rules." }, "resourceGuid": { "readOnly": true, "type": "string", "description": "The resource GUID property of the load balancer resource." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the load balancer resource." } }, "description": "Properties of the load balancer." }, "LoadBalancer": { "properties": { "sku": { "$ref": "#/definitions/LoadBalancerSku", "description": "The load balancer SKU." }, "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/LoadBalancerPropertiesFormat", "description": "Properties of load balancer." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." } }, "allOf": [ { "$ref": "./network.json#/definitions/Resource" } ], "description": "LoadBalancer resource." }, "LoadBalancerListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/LoadBalancer" }, "description": "A list of load balancers in a resource group." }, "nextLink": { "readOnly": true, "type": "string", "description": "The URL to get the next set of results." } }, "description": "Response for ListLoadBalancers API service call." }, "InboundNatRuleListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/InboundNatRule" }, "description": "A list of inbound nat rules in a load balancer." }, "nextLink": { "readOnly": true, "type": "string", "description": "The URL to get the next set of results." } }, "description": "Response for ListInboundNatRule API service call." }, "LoadBalancerBackendAddressPoolListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/BackendAddressPool" }, "description": "A list of backend address pools in a load balancer." }, "nextLink": { "readOnly": true, "type": "string", "description": "The URL to get the next set of results." } }, "description": "Response for ListBackendAddressPool API service call." }, "LoadBalancerFrontendIPConfigurationListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/FrontendIPConfiguration" }, "description": "A list of frontend IP configurations in a load balancer." }, "nextLink": { "readOnly": true, "type": "string", "description": "The URL to get the next set of results." } }, "description": "Response for ListFrontendIPConfiguration API service call." }, "LoadBalancerLoadBalancingRuleListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/LoadBalancingRule" }, "description": "A list of load balancing rules in a load balancer." }, "nextLink": { "readOnly": true, "type": "string", "description": "The URL to get the next set of results." } }, "description": "Response for ListLoadBalancingRule API service call." }, "LoadBalancerOutboundRuleListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/OutboundRule" }, "description": "A list of outbound rules in a load balancer." }, "nextLink": { "readOnly": true, "type": "string", "description": "The URL to get the next set of results." } }, "description": "Response for ListOutboundRule API service call." }, "LoadBalancerProbeListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/Probe" }, "description": "A list of probes in a load balancer." }, "nextLink": { "readOnly": true, "type": "string", "description": "The URL to get the next set of results." } }, "description": "Response for ListProbe API service call." }, "TransportProtocol": { "type": "string", "description": "The transport protocol for the endpoint.", "enum": [ "Udp", "Tcp", "All" ], "x-ms-enum": { "name": "TransportProtocol", "modelAsString": true } } } } spec-0.21.0/fixtures/azure/network.json000066400000000000000000000234721457312531500201250ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "title": "NetworkManagementClient", "description": "The Microsoft Azure Network management API provides a RESTful set of web services that interact with Microsoft Azure Networks service to manage your network resources. The API has entities that capture the relationship between an end user and the Microsoft Azure Networks service.", "version": "2020-04-01" }, "host": "management.azure.com", "schemes": [ "https" ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "security": [ { "azure_auth": [ "user_impersonation" ] } ], "securityDefinitions": { "azure_auth": { "type": "oauth2", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "flow": "implicit", "description": "Azure Active Directory OAuth2 Flow.", "scopes": { "user_impersonation": "impersonate your user account" } } }, "paths": {}, "definitions": { "ErrorDetails": { "properties": { "code": { "type": "string", "description": "Error code." }, "target": { "type": "string", "description": "Error target." }, "message": { "type": "string", "description": "Error message." } }, "description": "Common error details representation." }, "Error": { "properties": { "code": { "type": "string", "description": "Error code." }, "message": { "type": "string", "description": "Error message." }, "target": { "type": "string", "description": "Error target." }, "details": { "type": "array", "items": { "$ref": "#/definitions/ErrorDetails" }, "description": "Error details." }, "innerError": { "type": "string", "description": "Inner error message." } }, "description": "Common error representation." }, "CloudError": { "x-ms-external": true, "properties": { "error": { "$ref": "#/definitions/CloudErrorBody", "description": "Cloud error body." } }, "description": "An error response from the service." }, "CloudErrorBody": { "x-ms-external": true, "properties": { "code": { "type": "string", "description": "An identifier for the error. Codes are invariant and are intended to be consumed programmatically." }, "message": { "type": "string", "description": "A message describing the error, intended to be suitable for display in a user interface." }, "target": { "type": "string", "description": "The target of the particular error. For example, the name of the property in error." }, "details": { "type": "array", "items": { "$ref": "#/definitions/CloudErrorBody" }, "description": "A list of additional details about the error." } }, "description": "An error response from the service." }, "AzureAsyncOperationResult": { "properties": { "status": { "type": "string", "description": "Status of the Azure async operation.", "enum": [ "InProgress", "Succeeded", "Failed" ], "x-ms-enum": { "name": "NetworkOperationStatus", "modelAsString": true } }, "error": { "$ref": "#/definitions/Error", "description": "Details of the error occurred during specified asynchronous operation." } }, "description": "The response body contains the status of the specified asynchronous operation, indicating whether it has succeeded, is in progress, or has failed. Note that this status is distinct from the HTTP status code returned for the Get Operation Status operation itself. If the asynchronous operation succeeded, the response body includes the HTTP status code for the successful request. If the asynchronous operation failed, the response body includes the HTTP status code for the failed request and error information regarding the failure." }, "Resource": { "properties": { "id": { "type": "string", "description": "Resource ID." }, "name": { "readOnly": true, "type": "string", "description": "Resource name." }, "type": { "readOnly": true, "type": "string", "description": "Resource type." }, "location": { "type": "string", "description": "Resource location." }, "tags": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Resource tags." } }, "description": "Common resource representation.", "x-ms-azure-resource": true }, "SubResource": { "properties": { "id": { "type": "string", "description": "Resource ID." } }, "description": "Reference to another subresource.", "x-ms-azure-resource": true }, "TagsObject": { "properties": { "tags": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Resource tags." } }, "description": "Tags object for patch operations." }, "ManagedServiceIdentity": { "properties": { "principalId": { "readOnly": true, "type": "string", "description": "The principal id of the system assigned identity. This property will only be provided for a system assigned identity." }, "tenantId": { "readOnly": true, "type": "string", "description": "The tenant id of the system assigned identity. This property will only be provided for a system assigned identity." }, "type": { "type": "string", "description": "The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine.", "enum": [ "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned", "None" ], "x-ms-enum": { "name": "ResourceIdentityType", "modelAsString": false } }, "userAssignedIdentities": { "type": "object", "additionalProperties": { "type": "object", "properties": { "principalId": { "readOnly": true, "type": "string", "description": "The principal id of user assigned identity." }, "clientId": { "readOnly": true, "type": "string", "description": "The client id of user assigned identity." } } }, "description": "The list of user identities associated with resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'." } }, "description": "Identity for the resource." }, "ProvisioningState": { "type": "string", "readOnly": true, "description": "The current provisioning state.", "enum": [ "Succeeded", "Updating", "Deleting", "Failed" ], "x-ms-enum": { "name": "ProvisioningState", "modelAsString": true } }, "Access": { "type": "string", "description": "Access to be allowed or denied.", "enum": [ "Allow", "Deny" ], "x-ms-enum": { "name": "Access", "modelAsString": true } }, "AuthenticationMethod": { "type": "string", "description": "VPN client authentication method.", "enum": [ "EAPTLS", "EAPMSCHAPv2" ], "x-ms-enum": { "name": "AuthenticationMethod", "modelAsString": true } }, "IPAllocationMethod": { "type": "string", "description": "IP address allocation method.", "enum": [ "Static", "Dynamic" ], "x-ms-enum": { "name": "IPAllocationMethod", "modelAsString": true } }, "IPVersion": { "type": "string", "description": "IP address version.", "enum": [ "IPv4", "IPv6" ], "x-ms-enum": { "name": "IPVersion", "modelAsString": true } } }, "parameters": { "SubscriptionIdParameter": { "name": "subscriptionId", "in": "path", "required": true, "type": "string", "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call." }, "ApiVersionParameter": { "name": "api-version", "in": "query", "required": true, "type": "string", "description": "Client API version." }, "ApiVersionVmssParameter": { "name": "api-version", "in": "query", "required": true, "type": "string", "enum": [ "2017-03-30" ], "x-ms-enum": { "name": "ApiVersion", "modelAsString": true }, "description": "Client API version." } } } spec-0.21.0/fixtures/azure/networkInterface.json000066400000000000000000001464361457312531500217540ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "title": "NetworkManagementClient", "description": "The Microsoft Azure Network management API provides a RESTful set of web services that interact with Microsoft Azure Networks service to manage your network resources. The API has entities that capture the relationship between an end user and the Microsoft Azure Networks service.", "version": "2020-04-01" }, "host": "management.azure.com", "schemes": [ "https" ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "security": [ { "azure_auth": [ "user_impersonation" ] } ], "securityDefinitions": { "azure_auth": { "type": "oauth2", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "flow": "implicit", "description": "Azure Active Directory OAuth2 Flow.", "scopes": { "user_impersonation": "impersonate your user account" } } }, "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}": { "delete": { "tags": [ "NetworkInterfaces" ], "operationId": "NetworkInterfaces_Delete", "description": "Deletes the specified network interface.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkInterfaceName", "in": "path", "required": true, "type": "string", "description": "The name of the network interface." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "204": { "description": "Request successful. Resource does not exist." }, "202": { "description": "Accepted and the operation will complete asynchronously." }, "200": { "description": "Delete successful." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Delete network interface": { "$ref": "./examples/NetworkInterfaceDelete.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } }, "get": { "tags": [ "NetworkInterfaces" ], "operationId": "NetworkInterfaces_Get", "description": "Gets information about the specified network interface.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkInterfaceName", "in": "path", "required": true, "type": "string", "description": "The name of the network interface." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" }, { "name": "$expand", "in": "query", "required": false, "type": "string", "description": "Expands referenced resources." } ], "responses": { "200": { "description": "Request successful. The operation returns the resulting NetworkInterface resource.", "schema": { "$ref": "#/definitions/NetworkInterface" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Get network interface": { "$ref": "./examples/NetworkInterfaceGet.json" } } }, "put": { "tags": [ "NetworkInterfaces" ], "operationId": "NetworkInterfaces_CreateOrUpdate", "description": "Creates or updates a network interface.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkInterfaceName", "in": "path", "required": true, "type": "string", "description": "The name of the network interface." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/NetworkInterface" }, "description": "Parameters supplied to the create or update network interface operation." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "201": { "description": "Create successful. The operation returns the resulting NetworkInterface resource.", "schema": { "$ref": "#/definitions/NetworkInterface" } }, "200": { "description": "Update successful. The operation returns the resulting NetworkInterface resource.", "schema": { "$ref": "#/definitions/NetworkInterface" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Create network interface": { "$ref": "./examples/NetworkInterfaceCreate.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "azure-async-operation" } }, "patch": { "tags": [ "NetworkInterfaces" ], "operationId": "NetworkInterfaces_UpdateTags", "description": "Updates a network interface tags.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkInterfaceName", "in": "path", "required": true, "type": "string", "description": "The name of the network interface." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "./network.json#/definitions/TagsObject" }, "description": "Parameters supplied to update network interface tags." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Update successful. The operation returns the resulting NetworkInterface resource.", "schema": { "$ref": "#/definitions/NetworkInterface" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Update network interface tags": { "$ref": "./examples/NetworkInterfaceUpdateTags.json" } } } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces": { "get": { "tags": [ "NetworkInterfaces" ], "operationId": "NetworkInterfaces_ListAll", "description": "Gets all network interfaces in a subscription.", "parameters": [ { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of NetworkInterface resources.", "schema": { "$ref": "#/definitions/NetworkInterfaceListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "List all network interfaces": { "$ref": "./examples/NetworkInterfaceListAll.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces": { "get": { "tags": [ "NetworkInterfaces" ], "operationId": "NetworkInterfaces_List", "description": "Gets all network interfaces in a resource group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of NetworkInterface resources.", "schema": { "$ref": "#/definitions/NetworkInterfaceListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "List network interfaces in resource group": { "$ref": "./examples/NetworkInterfaceList.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable": { "post": { "tags": [ "NetworkInterfaces" ], "operationId": "NetworkInterfaces_GetEffectiveRouteTable", "description": "Gets all route tables applied to a network interface.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkInterfaceName", "in": "path", "required": true, "type": "string", "description": "The name of the network interface." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of EffectRoute resources.", "schema": { "$ref": "#/definitions/EffectiveRouteListResult" } }, "202": { "description": "Accepted and the operation will complete asynchronously." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Show network interface effective route tables": { "$ref": "./examples/NetworkInterfaceEffectiveRouteTableList.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups": { "post": { "tags": [ "NetworkInterfaces" ], "operationId": "NetworkInterfaces_ListEffectiveNetworkSecurityGroups", "description": "Gets all network security groups applied to a network interface.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkInterfaceName", "in": "path", "required": true, "type": "string", "description": "The name of the network interface." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of NetworkSecurityGroup resources.", "schema": { "$ref": "#/definitions/EffectiveNetworkSecurityGroupListResult" } }, "202": { "description": "Accepted and the operation will complete asynchronously." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "List network interface effective network security groups": { "$ref": "./examples/NetworkInterfaceEffectiveNSGList.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations": { "get": { "tags": [ "NetworkInterfaces" ], "operationId": "NetworkInterfaceIPConfigurations_List", "description": "Get all ip configurations in a network interface.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkInterfaceName", "in": "path", "required": true, "type": "string", "description": "The name of the network interface." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of NetworkInterface IPConfiguration resources.", "schema": { "$ref": "#/definitions/NetworkInterfaceIPConfigurationListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" }, "x-ms-examples": { "NetworkInterfaceIPConfigurationList": { "$ref": "./examples/NetworkInterfaceIPConfigurationList.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}": { "get": { "tags": [ "NetworkInterfaces" ], "operationId": "NetworkInterfaceIPConfigurations_Get", "description": "Gets the specified network interface ip configuration.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkInterfaceName", "in": "path", "required": true, "type": "string", "description": "The name of the network interface." }, { "name": "ipConfigurationName", "in": "path", "required": true, "type": "string", "description": "The name of the ip configuration name." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns the resulting NetworkInterface IPConfiguration resource.", "schema": { "$ref": "#/definitions/NetworkInterfaceIPConfiguration" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "NetworkInterfaceIPConfigurationGet": { "$ref": "./examples/NetworkInterfaceIPConfigurationGet.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/loadBalancers": { "get": { "tags": [ "NetworkInterfaces" ], "operationId": "NetworkInterfaceLoadBalancers_List", "description": "List all load balancers in a network interface.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkInterfaceName", "in": "path", "required": true, "type": "string", "description": "The name of the network interface." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of NetworkInterface LoadBalancer resources.", "schema": { "$ref": "#/definitions/NetworkInterfaceLoadBalancerListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" }, "x-ms-examples": { "NetworkInterfaceLoadBalancerList": { "$ref": "./examples/NetworkInterfaceLoadBalancerList.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}": { "delete": { "tags": [ "Network Interfaces" ], "operationId": "NetworkInterfaceTapConfigurations_Delete", "description": "Deletes the specified tap configuration from the NetworkInterface.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkInterfaceName", "in": "path", "required": true, "type": "string", "description": "The name of the network interface." }, { "name": "tapConfigurationName", "in": "path", "required": true, "type": "string", "description": "The name of the tap configuration." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Delete successful." }, "202": { "description": "Accepted and the operation will complete asynchronously." }, "204": { "description": "Delete successful." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Delete tap configuration": { "$ref": "./examples/NetworkInterfaceTapConfigurationDelete.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } }, "get": { "tags": [ "NetworkInterfaces" ], "operationId": "NetworkInterfaceTapConfigurations_Get", "description": "Get the specified tap configuration on a network interface.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkInterfaceName", "in": "path", "required": true, "type": "string", "description": "The name of the network interface." }, { "name": "tapConfigurationName", "in": "path", "required": true, "type": "string", "description": "The name of the tap configuration." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a tap configuration.", "schema": { "$ref": "#/definitions/NetworkInterfaceTapConfiguration" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Get Network Interface Tap Configurations": { "$ref": "./examples/NetworkInterfaceTapConfigurationGet.json" } } }, "put": { "tags": [ "Network Interfaces" ], "operationId": "NetworkInterfaceTapConfigurations_CreateOrUpdate", "description": "Creates or updates a Tap configuration in the specified NetworkInterface.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkInterfaceName", "in": "path", "required": true, "type": "string", "description": "The name of the network interface." }, { "name": "tapConfigurationName", "in": "path", "required": true, "type": "string", "description": "The name of the tap configuration." }, { "name": "tapConfigurationParameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/NetworkInterfaceTapConfiguration" }, "description": "Parameters supplied to the create or update tap configuration operation." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Update successful. The operation returns the resulting Tap Configuration resource.", "schema": { "$ref": "#/definitions/NetworkInterfaceTapConfiguration" } }, "201": { "description": "Create successful. The operation returns the resulting Tap configuration resource.", "schema": { "$ref": "#/definitions/NetworkInterfaceTapConfiguration" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Create Network Interface Tap Configurations": { "$ref": "./examples/NetworkInterfaceTapConfigurationCreate.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "azure-async-operation" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations": { "get": { "tags": [ "NetworkInterfaces" ], "operationId": "NetworkInterfaceTapConfigurations_List", "description": "Get all Tap configurations in a network interface.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkInterfaceName", "in": "path", "required": true, "type": "string", "description": "The name of the network interface." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of NetworkInterface TapConfiguration resources.", "schema": { "$ref": "#/definitions/NetworkInterfaceTapConfigurationListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "List virtual network tap configurations": { "$ref": "./examples/NetworkInterfaceTapConfigurationList.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } } }, "definitions": { "NetworkInterfaceTapConfiguration": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/NetworkInterfaceTapConfigurationPropertiesFormat", "description": "Properties of the Virtual Network Tap configuration." }, "name": { "type": "string", "description": "The name of the resource that is unique within a resource group. This name can be used to access the resource." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." }, "type": { "readOnly": true, "type": "string", "description": "Sub Resource type." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "Tap configuration in a Network Interface." }, "NetworkInterfaceTapConfigurationPropertiesFormat": { "properties": { "virtualNetworkTap": { "$ref": "./virtualNetworkTap.json#/definitions/VirtualNetworkTap", "description": "The reference to the Virtual Network Tap resource." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the network interface tap configuration resource." } }, "description": "Properties of Virtual Network Tap configuration." }, "NetworkInterfaceIPConfigurationPropertiesFormat": { "properties": { "virtualNetworkTaps": { "type": "array", "items": { "$ref": "./virtualNetworkTap.json#/definitions/VirtualNetworkTap" }, "description": "The reference to Virtual Network Taps." }, "applicationGatewayBackendAddressPools": { "type": "array", "items": { "$ref": "./applicationGateway.json#/definitions/ApplicationGatewayBackendAddressPool" }, "description": "The reference to ApplicationGatewayBackendAddressPool resource." }, "loadBalancerBackendAddressPools": { "type": "array", "items": { "$ref": "./loadBalancer.json#/definitions/BackendAddressPool" }, "description": "The reference to LoadBalancerBackendAddressPool resource." }, "loadBalancerInboundNatRules": { "type": "array", "items": { "$ref": "./loadBalancer.json#/definitions/InboundNatRule" }, "description": "A list of references of LoadBalancerInboundNatRules." }, "privateIPAddress": { "type": "string", "description": "Private IP address of the IP configuration." }, "privateIPAllocationMethod": { "$ref": "./network.json#/definitions/IPAllocationMethod", "description": "The private IP address allocation method." }, "privateIPAddressVersion": { "$ref": "./network.json#/definitions/IPVersion", "description": "Whether the specific IP configuration is IPv4 or IPv6. Default is IPv4." }, "subnet": { "$ref": "./virtualNetwork.json#/definitions/Subnet", "description": "Subnet bound to the IP configuration." }, "primary": { "type": "boolean", "description": "Whether this is a primary customer address on the network interface." }, "publicIPAddress": { "$ref": "./publicIpAddress.json#/definitions/PublicIPAddress", "description": "Public IP address bound to the IP configuration." }, "applicationSecurityGroups": { "type": "array", "items": { "$ref": "./applicationSecurityGroup.json#/definitions/ApplicationSecurityGroup" }, "description": "Application security groups in which the IP configuration is included." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the network interface IP configuration." }, "privateLinkConnectionProperties": { "$ref": "#/definitions/NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties", "description": "PrivateLinkConnection properties for the network interface.", "readOnly": true } }, "description": "Properties of IP configuration." }, "NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties": { "properties": { "groupId": { "type": "string", "readOnly": true, "description": "The group ID for current private link connection." }, "requiredMemberName": { "type": "string", "readOnly": true, "description": "The required member name for current private link connection." }, "fqdns": { "type": "array", "items": { "type": "string" }, "readOnly": true, "description": "List of FQDNs for current private link connection." } }, "description": "PrivateLinkConnection properties for the network interface." }, "NetworkInterfaceIPConfiguration": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/NetworkInterfaceIPConfigurationPropertiesFormat", "description": "Network interface IP configuration properties." }, "name": { "type": "string", "description": "The name of the resource that is unique within a resource group. This name can be used to access the resource." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "IPConfiguration in a network interface." }, "NetworkInterfaceDnsSettings": { "properties": { "dnsServers": { "type": "array", "items": { "type": "string" }, "description": "List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in dnsServers collection." }, "appliedDnsServers": { "readOnly": true, "type": "array", "items": { "type": "string" }, "description": "If the VM that uses this NIC is part of an Availability Set, then this list will have the union of all DNS servers from all NICs that are part of the Availability Set. This property is what is configured on each of those VMs." }, "internalDnsNameLabel": { "type": "string", "description": "Relative DNS name for this NIC used for internal communications between VMs in the same virtual network." }, "internalFqdn": { "readOnly": true, "type": "string", "description": "Fully qualified DNS name supporting internal communications between VMs in the same virtual network." }, "internalDomainNameSuffix": { "readOnly": true, "type": "string", "description": "Even if internalDnsNameLabel is not specified, a DNS entry is created for the primary NIC of the VM. This DNS name can be constructed by concatenating the VM name with the value of internalDomainNameSuffix." } }, "description": "DNS settings of a network interface." }, "NetworkInterfacePropertiesFormat": { "properties": { "virtualMachine": { "$ref": "./network.json#/definitions/SubResource", "description": "The reference to a virtual machine.", "readOnly": true }, "networkSecurityGroup": { "$ref": "./networkSecurityGroup.json#/definitions/NetworkSecurityGroup", "description": "The reference to the NetworkSecurityGroup resource." }, "privateEndpoint": { "readOnly": true, "$ref": "./privateEndpoint.json#/definitions/PrivateEndpoint", "description": "A reference to the private endpoint to which the network interface is linked." }, "ipConfigurations": { "type": "array", "items": { "$ref": "#/definitions/NetworkInterfaceIPConfiguration" }, "description": "A list of IPConfigurations of the network interface." }, "tapConfigurations": { "readOnly": true, "type": "array", "items": { "$ref": "#/definitions/NetworkInterfaceTapConfiguration" }, "description": "A list of TapConfigurations of the network interface." }, "dnsSettings": { "$ref": "#/definitions/NetworkInterfaceDnsSettings", "description": "The DNS settings in network interface." }, "macAddress": { "readOnly": true, "type": "string", "description": "The MAC address of the network interface." }, "primary": { "readOnly": true, "type": "boolean", "description": "Whether this is a primary network interface on a virtual machine." }, "enableAcceleratedNetworking": { "type": "boolean", "description": "If the network interface is accelerated networking enabled." }, "enableIPForwarding": { "type": "boolean", "description": "Indicates whether IP forwarding is enabled on this network interface." }, "hostedWorkloads": { "type": "array", "items": { "type": "string" }, "readOnly": true, "description": "A list of references to linked BareMetal resources." }, "resourceGuid": { "readOnly": true, "type": "string", "description": "The resource GUID property of the network interface resource." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the network interface resource." } }, "description": "NetworkInterface properties." }, "NetworkInterface": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/NetworkInterfacePropertiesFormat", "description": "Properties of the network interface." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." } }, "allOf": [ { "$ref": "./network.json#/definitions/Resource" } ], "description": "A network interface in a resource group." }, "NetworkInterfaceListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/NetworkInterface" }, "description": "A list of network interfaces in a resource group." }, "nextLink": { "readOnly": true, "type": "string", "description": "The URL to get the next set of results." } }, "description": "Response for the ListNetworkInterface API service call." }, "NetworkInterfaceTapConfigurationListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/NetworkInterfaceTapConfiguration" }, "description": "A list of tap configurations." }, "nextLink": { "readOnly": true, "type": "string", "description": "The URL to get the next set of results." } }, "description": "Response for list tap configurations API service call." }, "NetworkInterfaceIPConfigurationListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/NetworkInterfaceIPConfiguration" }, "description": "A list of ip configurations." }, "nextLink": { "readOnly": true, "type": "string", "description": "The URL to get the next set of results." } }, "description": "Response for list ip configurations API service call." }, "NetworkInterfaceLoadBalancerListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "./loadBalancer.json#/definitions/LoadBalancer" }, "description": "A list of load balancers." }, "nextLink": { "readOnly": true, "type": "string", "description": "The URL to get the next set of results." } }, "description": "Response for list ip configurations API service call." }, "EffectiveNetworkSecurityGroup": { "properties": { "networkSecurityGroup": { "$ref": "./network.json#/definitions/SubResource", "description": "The ID of network security group that is applied." }, "association": { "$ref": "#/definitions/EffectiveNetworkSecurityGroupAssociation", "description": "Associated resources." }, "effectiveSecurityRules": { "type": "array", "items": { "$ref": "#/definitions/EffectiveNetworkSecurityRule" }, "description": "A collection of effective security rules." }, "tagMap": { "type": "string", "additionalProperties": { "type": "array", "items": { "type": "string" }, "description": "List of IP Addresses within the tag (key)." }, "description": "Mapping of tags to list of IP Addresses included within the tag." } }, "description": "Effective network security group." }, "EffectiveNetworkSecurityGroupAssociation": { "properties": { "subnet": { "$ref": "./network.json#/definitions/SubResource", "description": "The ID of the subnet if assigned." }, "networkInterface": { "$ref": "./network.json#/definitions/SubResource", "description": "The ID of the network interface if assigned." } }, "description": "The effective network security group association." }, "EffectiveNetworkSecurityRule": { "properties": { "name": { "type": "string", "description": "The name of the security rule specified by the user (if created by the user)." }, "protocol": { "type": "string", "description": "The network protocol this rule applies to.", "enum": [ "Tcp", "Udp", "All" ], "x-ms-enum": { "name": "EffectiveSecurityRuleProtocol", "modelAsString": true } }, "sourcePortRange": { "type": "string", "description": "The source port or range." }, "destinationPortRange": { "type": "string", "description": "The destination port or range." }, "sourcePortRanges": { "type": "array", "items": { "type": "string" }, "description": "The source port ranges. Expected values include a single integer between 0 and 65535, a range using '-' as separator (e.g. 100-400), or an asterisk (*)." }, "destinationPortRanges": { "type": "array", "items": { "type": "string" }, "description": "The destination port ranges. Expected values include a single integer between 0 and 65535, a range using '-' as separator (e.g. 100-400), or an asterisk (*)." }, "sourceAddressPrefix": { "type": "string", "description": "The source address prefix." }, "destinationAddressPrefix": { "type": "string", "description": "The destination address prefix." }, "sourceAddressPrefixes": { "type": "array", "items": { "type": "string" }, "description": "The source address prefixes. Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, and the asterisk (*)." }, "destinationAddressPrefixes": { "type": "array", "items": { "type": "string" }, "description": "The destination address prefixes. Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, and the asterisk (*)." }, "expandedSourceAddressPrefix": { "type": "array", "items": { "type": "string" }, "description": "The expanded source address prefix." }, "expandedDestinationAddressPrefix": { "type": "array", "items": { "type": "string" }, "description": "Expanded destination address prefix." }, "access": { "$ref": "./networkSecurityGroup.json#/definitions/SecurityRuleAccess", "description": "Whether network traffic is allowed or denied." }, "priority": { "type": "integer", "format": "int32", "description": "The priority of the rule." }, "direction": { "$ref": "./networkSecurityGroup.json#/definitions/SecurityRuleDirection", "description": "The direction of the rule." } }, "description": "Effective network security rules." }, "EffectiveNetworkSecurityGroupListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/EffectiveNetworkSecurityGroup" }, "description": "A list of effective network security groups." }, "nextLink": { "readOnly": true, "type": "string", "description": "The URL to get the next set of results." } }, "description": "Response for list effective network security groups API service call." }, "EffectiveRoute": { "properties": { "name": { "type": "string", "description": "The name of the user defined route. This is optional." }, "disableBgpRoutePropagation": { "type": "boolean", "description": "If true, on-premises routes are not propagated to the network interfaces in the subnet." }, "source": { "type": "string", "description": "Who created the route.", "enum": [ "Unknown", "User", "VirtualNetworkGateway", "Default" ], "x-ms-enum": { "name": "EffectiveRouteSource", "modelAsString": true } }, "state": { "type": "string", "description": "The value of effective route.", "enum": [ "Active", "Invalid" ], "x-ms-enum": { "name": "EffectiveRouteState", "modelAsString": true } }, "addressPrefix": { "type": "array", "items": { "type": "string" }, "description": "The address prefixes of the effective routes in CIDR notation." }, "nextHopIpAddress": { "type": "array", "items": { "type": "string" }, "description": "The IP address of the next hop of the effective route." }, "nextHopType": { "$ref": "./routeTable.json#/definitions/RouteNextHopType", "description": "The type of Azure hop the packet should be sent to." } }, "description": "Effective Route." }, "EffectiveRouteListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/EffectiveRoute" }, "description": "A list of effective routes." }, "nextLink": { "readOnly": true, "type": "string", "description": "The URL to get the next set of results." } }, "description": "Response for list effective route API service call." }, "IPConfigurationPropertiesFormat": { "properties": { "privateIPAddress": { "type": "string", "description": "The private IP address of the IP configuration." }, "privateIPAllocationMethod": { "$ref": "./network.json#/definitions/IPAllocationMethod", "description": "The private IP address allocation method." }, "subnet": { "$ref": "./virtualNetwork.json#/definitions/Subnet", "description": "The reference to the subnet resource." }, "publicIPAddress": { "$ref": "./publicIpAddress.json#/definitions/PublicIPAddress", "description": "The reference to the public IP resource." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the IP configuration resource." } }, "description": "Properties of IP configuration." }, "IPConfiguration": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/IPConfigurationPropertiesFormat", "description": "Properties of the IP configuration." }, "name": { "type": "string", "description": "The name of the resource that is unique within a resource group. This name can be used to access the resource." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "IP configuration." } } } spec-0.21.0/fixtures/azure/networkProfile.json000066400000000000000000000503401457312531500214400ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "title": "NetworkManagementClient", "description": "The Microsoft Azure Network management API provides a RESTful set of web services that interact with Microsoft Azure Networks service to manage your network resources. The API has entities that capture the relationship between an end user and the Microsoft Azure Networks service.", "version": "2020-04-01" }, "host": "management.azure.com", "schemes": [ "https" ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "security": [ { "azure_auth": [ "user_impersonation" ] } ], "securityDefinitions": { "azure_auth": { "type": "oauth2", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "flow": "implicit", "description": "Azure Active Directory OAuth2 Flow.", "scopes": { "user_impersonation": "impersonate your user account" } } }, "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}": { "delete": { "tags": [ "NetworkProfiles" ], "operationId": "NetworkProfiles_Delete", "description": "Deletes the specified network profile.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkProfileName", "in": "path", "required": true, "type": "string", "description": "The name of the NetworkProfile." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "204": { "description": "Request successful. Resource does not exist." }, "202": { "description": "Accepted and the operation will complete asynchronously." }, "200": { "description": "Delete successful." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Delete network profile": { "$ref": "./examples/NetworkProfileDelete.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } }, "get": { "tags": [ "NetworkProfiles" ], "operationId": "NetworkProfiles_Get", "description": "Gets the specified network profile in a specified resource group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkProfileName", "in": "path", "required": true, "type": "string", "description": "The name of the public IP prefix." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" }, { "name": "$expand", "in": "query", "required": false, "type": "string", "description": "Expands referenced resources." } ], "responses": { "200": { "description": "Request successful. The operation returns the resulting NetworkProfile resource.", "schema": { "$ref": "#/definitions/NetworkProfile" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Get network profile": { "$ref": "./examples/NetworkProfileGetConfigOnly.json" }, "Get network profile with container network interfaces": { "$ref": "./examples/NetworkProfileGetWithContainerNic.json" } } }, "put": { "tags": [ "NetworkProfiles" ], "operationId": "NetworkProfiles_CreateOrUpdate", "description": "Creates or updates a network profile.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkProfileName", "in": "path", "required": true, "type": "string", "description": "The name of the network profile." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/NetworkProfile" }, "description": "Parameters supplied to the create or update network profile operation." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "201": { "description": "Create successful. The operation returns the resulting NetworkProfile resource.", "schema": { "$ref": "#/definitions/NetworkProfile" } }, "200": { "description": "Update successful. The operation returns the resulting NetworkProfile resource.", "schema": { "$ref": "#/definitions/NetworkProfile" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Create network profile defaults": { "$ref": "./examples/NetworkProfileCreateConfigOnly.json" } }, "x-ms-long-running-operation": false }, "patch": { "tags": [ "NetworkProfiles" ], "operationId": "NetworkProfiles_UpdateTags", "description": "Updates network profile tags.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkProfileName", "in": "path", "required": true, "type": "string", "description": "The name of the network profile." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "./network.json#/definitions/TagsObject" }, "description": "Parameters supplied to update network profile tags." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Update successful. The operation returns the resulting NetworkProfile resource.", "schema": { "$ref": "#/definitions/NetworkProfile" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Update network profile tags": { "$ref": "./examples/NetworkProfileUpdateTags.json" } } } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkProfiles": { "get": { "tags": [ "NetworkProfiles" ], "operationId": "NetworkProfiles_ListAll", "description": "Gets all the network profiles in a subscription.", "parameters": [ { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of NetworkProfile resources.", "schema": { "$ref": "#/definitions/NetworkProfileListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "List all network profiles": { "$ref": "./examples/NetworkProfileListAll.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles": { "get": { "tags": [ "NetworkProfiles" ], "operationId": "NetworkProfiles_List", "description": "Gets all network profiles in a resource group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of NetworkProfile resources.", "schema": { "$ref": "#/definitions/NetworkProfileListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "List resource group network profiles": { "$ref": "./examples/NetworkProfileList.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } } }, "definitions": { "NetworkProfilePropertiesFormat": { "properties": { "containerNetworkInterfaces": { "readOnly": true, "type": "array", "items": { "$ref": "#/definitions/ContainerNetworkInterface" }, "description": "List of child container network interfaces." }, "containerNetworkInterfaceConfigurations": { "type": "array", "items": { "$ref": "#/definitions/ContainerNetworkInterfaceConfiguration" }, "description": "List of chid container network interface configurations." }, "resourceGuid": { "readOnly": true, "type": "string", "description": "The resource GUID property of the network profile resource." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the network profile resource." } }, "description": "Network profile properties." }, "NetworkProfile": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/NetworkProfilePropertiesFormat", "description": "Network profile properties." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." } }, "allOf": [ { "$ref": "./network.json#/definitions/Resource" } ], "description": "Network profile resource." }, "NetworkProfileListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/NetworkProfile" }, "description": "A list of network profiles that exist in a resource group." }, "nextLink": { "type": "string", "description": "The URL to get the next set of results." } }, "description": "Response for ListNetworkProfiles API service call." }, "ContainerNetworkInterfacePropertiesFormat": { "properties": { "containerNetworkInterfaceConfiguration": { "readOnly": true, "$ref": "#/definitions/ContainerNetworkInterfaceConfiguration", "description": "Container network interface configuration from which this container network interface is created." }, "container": { "$ref": "#/definitions/Container", "description": "Reference to the container to which this container network interface is attached." }, "ipConfigurations": { "readOnly": true, "type": "array", "items": { "$ref": "#/definitions/ContainerNetworkInterfaceIpConfiguration" }, "description": "Reference to the ip configuration on this container nic." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the container network interface resource." } }, "description": "Properties of container network interface." }, "ContainerNetworkInterface": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/ContainerNetworkInterfacePropertiesFormat", "description": "Container network interface properties." }, "name": { "type": "string", "description": "The name of the resource. This name can be used to access the resource." }, "type": { "readOnly": true, "type": "string", "description": "Sub Resource type." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "Container network interface child resource." }, "ContainerNetworkInterfaceConfigurationPropertiesFormat": { "properties": { "ipConfigurations": { "type": "array", "items": { "$ref": "#/definitions/IPConfigurationProfile" }, "description": "A list of ip configurations of the container network interface configuration." }, "containerNetworkInterfaces": { "type": "array", "items": { "$ref": "./network.json#/definitions/SubResource" }, "description": "A list of container network interfaces created from this container network interface configuration." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the container network interface configuration resource." } }, "description": "Container network interface configuration properties." }, "ContainerNetworkInterfaceConfiguration": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/ContainerNetworkInterfaceConfigurationPropertiesFormat", "description": "Container network interface configuration properties." }, "name": { "type": "string", "description": "The name of the resource. This name can be used to access the resource." }, "type": { "readOnly": true, "type": "string", "description": "Sub Resource type." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "Container network interface configuration child resource." }, "IPConfigurationProfilePropertiesFormat": { "properties": { "subnet": { "$ref": "./virtualNetwork.json#/definitions/Subnet", "description": "The reference to the subnet resource to create a container network interface ip configuration." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the IP configuration profile resource." } }, "description": "IP configuration profile properties." }, "IPConfigurationProfile": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/IPConfigurationProfilePropertiesFormat", "description": "Properties of the IP configuration profile." }, "name": { "type": "string", "description": "The name of the resource. This name can be used to access the resource." }, "type": { "readOnly": true, "type": "string", "description": "Sub Resource type." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "IP configuration profile child resource." }, "Container": { "properties": {}, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "Reference to container resource in remote resource provider." }, "ContainerNetworkInterfaceIpConfigurationPropertiesFormat": { "properties": { "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the container network interface IP configuration resource." } }, "description": "Properties of the container network interface IP configuration." }, "ContainerNetworkInterfaceIpConfiguration": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/ContainerNetworkInterfaceIpConfigurationPropertiesFormat", "description": "Properties of the container network interface IP configuration." }, "name": { "type": "string", "description": "The name of the resource. This name can be used to access the resource." }, "type": { "readOnly": true, "type": "string", "description": "Sub Resource type." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." } }, "description": "The ip configuration for a container network interface." } } } spec-0.21.0/fixtures/azure/networkSecurityGroup.json000066400000000000000000001001251457312531500226610ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "title": "NetworkManagementClient", "description": "The Microsoft Azure Network management API provides a RESTful set of web services that interact with Microsoft Azure Networks service to manage your network resources. The API has entities that capture the relationship between an end user and the Microsoft Azure Networks service.", "version": "2020-04-01" }, "host": "management.azure.com", "schemes": [ "https" ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "security": [ { "azure_auth": [ "user_impersonation" ] } ], "securityDefinitions": { "azure_auth": { "type": "oauth2", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "flow": "implicit", "description": "Azure Active Directory OAuth2 Flow.", "scopes": { "user_impersonation": "impersonate your user account" } } }, "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}": { "delete": { "tags": [ "NetworkSecurityGroups" ], "operationId": "NetworkSecurityGroups_Delete", "description": "Deletes the specified network security group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkSecurityGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the network security group." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "202": { "description": "Accepted and the operation will complete asynchronously." }, "200": { "description": "Delete successful." }, "204": { "description": "Request successful. Resource does not exist." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Delete network security group": { "$ref": "./examples/NetworkSecurityGroupDelete.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } }, "get": { "tags": [ "NetworkSecurityGroups" ], "operationId": "NetworkSecurityGroups_Get", "description": "Gets the specified network security group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkSecurityGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the network security group." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" }, { "name": "$expand", "in": "query", "required": false, "type": "string", "description": "Expands referenced resources." } ], "responses": { "200": { "description": "Request successful. The operation returns the resulting NetworkSecurityGroup resource.", "schema": { "$ref": "#/definitions/NetworkSecurityGroup" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Get network security group": { "$ref": "./examples/NetworkSecurityGroupGet.json" } } }, "put": { "tags": [ "NetworkSecurityGroups" ], "operationId": "NetworkSecurityGroups_CreateOrUpdate", "description": "Creates or updates a network security group in the specified resource group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkSecurityGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the network security group." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/NetworkSecurityGroup" }, "description": "Parameters supplied to the create or update network security group operation." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "201": { "description": "Create successful. The operation returns the resulting NetworkSecurityGroup resource.", "schema": { "$ref": "#/definitions/NetworkSecurityGroup" } }, "200": { "description": "Update successful. The operation returns the resulting NetworkSecurityGroup resource.", "schema": { "$ref": "#/definitions/NetworkSecurityGroup" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Create network security group": { "$ref": "./examples/NetworkSecurityGroupCreate.json" }, "Create network security group with rule": { "$ref": "./examples/NetworkSecurityGroupCreateWithRule.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "azure-async-operation" } }, "patch": { "tags": [ "NetworkSecurityGroups" ], "operationId": "NetworkSecurityGroups_UpdateTags", "description": "Updates a network security group tags.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkSecurityGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the network security group." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "./network.json#/definitions/TagsObject" }, "description": "Parameters supplied to update network security group tags." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Update successful. The operation returns the resulting NetworkSecurityGroup resource.", "schema": { "$ref": "#/definitions/NetworkSecurityGroup" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Update network security group tags": { "$ref": "./examples/NetworkSecurityGroupUpdateTags.json" } } } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups": { "get": { "tags": [ "NetworkSecurityGroups" ], "operationId": "NetworkSecurityGroups_ListAll", "description": "Gets all network security groups in a subscription.", "parameters": [ { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of NetworkSecurityGroup resources.", "schema": { "$ref": "#/definitions/NetworkSecurityGroupListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "List all network security groups": { "$ref": "./examples/NetworkSecurityGroupListAll.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups": { "get": { "tags": [ "NetworkSecurityGroups" ], "operationId": "NetworkSecurityGroups_List", "description": "Gets all network security groups in a resource group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of NetworkSecurityGroup resources.", "schema": { "$ref": "#/definitions/NetworkSecurityGroupListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "List network security groups in resource group": { "$ref": "./examples/NetworkSecurityGroupList.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}": { "delete": { "tags": [ "SecurityRules" ], "operationId": "SecurityRules_Delete", "description": "Deletes the specified network security rule.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkSecurityGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the network security group." }, { "name": "securityRuleName", "in": "path", "required": true, "type": "string", "description": "The name of the security rule." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "204": { "description": "Request successful. Resource does not exist." }, "202": { "description": "Accepted and the operation will complete asynchronously." }, "200": { "description": "Delete successful." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Delete network security rule from network security group": { "$ref": "./examples/NetworkSecurityGroupRuleDelete.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } }, "get": { "tags": [ "SecurityRules" ], "operationId": "SecurityRules_Get", "description": "Get the specified network security rule.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkSecurityGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the network security group." }, { "name": "securityRuleName", "in": "path", "required": true, "type": "string", "description": "The name of the security rule." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns the resulting SecurityRule resource.", "schema": { "$ref": "#/definitions/SecurityRule" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Get network security rule in network security group": { "$ref": "./examples/NetworkSecurityGroupRuleGet.json" } } }, "put": { "tags": [ "SecurityRules" ], "operationId": "SecurityRules_CreateOrUpdate", "description": "Creates or updates a security rule in the specified network security group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkSecurityGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the network security group." }, { "name": "securityRuleName", "in": "path", "required": true, "type": "string", "description": "The name of the security rule." }, { "name": "securityRuleParameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/SecurityRule" }, "description": "Parameters supplied to the create or update network security rule operation." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Update successful. The operation returns the resulting SecurityRule resource.", "schema": { "$ref": "#/definitions/SecurityRule" } }, "201": { "description": "Create successful. The operation returns the resulting SecurityRule resource.", "schema": { "$ref": "#/definitions/SecurityRule" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Create security rule": { "$ref": "./examples/NetworkSecurityGroupRuleCreate.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "azure-async-operation" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules": { "get": { "tags": [ "SecurityRules" ], "operationId": "SecurityRules_List", "description": "Gets all security rules in a network security group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkSecurityGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the network security group." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of SecurityRule resources.", "schema": { "$ref": "#/definitions/SecurityRuleListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "List network security rules in network security group": { "$ref": "./examples/NetworkSecurityGroupRuleList.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules": { "get": { "tags": [ "SecurityRules" ], "operationId": "DefaultSecurityRules_List", "description": "Gets all default security rules in a network security group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkSecurityGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the network security group." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of SecurityRule resources.", "schema": { "$ref": "#/definitions/SecurityRuleListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "DefaultSecurityRuleList": { "$ref": "./examples/DefaultSecurityRuleList.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}": { "get": { "tags": [ "SecurityRules" ], "operationId": "DefaultSecurityRules_Get", "description": "Get the specified default network security rule.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkSecurityGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the network security group." }, { "name": "defaultSecurityRuleName", "in": "path", "required": true, "type": "string", "description": "The name of the default security rule." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns the resulting SecurityRule resource.", "schema": { "$ref": "#/definitions/SecurityRule" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "DefaultSecurityRuleGet": { "$ref": "./examples/DefaultSecurityRuleGet.json" } } } } }, "definitions": { "SecurityRulePropertiesFormat": { "properties": { "description": { "type": "string", "description": "A description for this rule. Restricted to 140 chars." }, "protocol": { "type": "string", "description": "Network protocol this rule applies to.", "enum": [ "Tcp", "Udp", "Icmp", "Esp", "*", "Ah" ], "x-ms-enum": { "name": "SecurityRuleProtocol", "modelAsString": true } }, "sourcePortRange": { "type": "string", "description": "The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports." }, "destinationPortRange": { "type": "string", "description": "The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports." }, "sourceAddressPrefix": { "type": "string", "description": "The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from." }, "sourceAddressPrefixes": { "type": "array", "items": { "type": "string" }, "description": "The CIDR or source IP ranges." }, "sourceApplicationSecurityGroups": { "type": "array", "items": { "$ref": "./applicationSecurityGroup.json#/definitions/ApplicationSecurityGroup" }, "description": "The application security group specified as source." }, "destinationAddressPrefix": { "type": "string", "description": "The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used." }, "destinationAddressPrefixes": { "type": "array", "items": { "type": "string" }, "description": "The destination address prefixes. CIDR or destination IP ranges." }, "destinationApplicationSecurityGroups": { "type": "array", "items": { "$ref": "./applicationSecurityGroup.json#/definitions/ApplicationSecurityGroup" }, "description": "The application security group specified as destination." }, "sourcePortRanges": { "type": "array", "items": { "type": "string", "description": "The source port." }, "description": "The source port ranges." }, "destinationPortRanges": { "type": "array", "items": { "type": "string", "description": "The destination port." }, "description": "The destination port ranges." }, "access": { "$ref": "#/definitions/SecurityRuleAccess", "description": "The network traffic is allowed or denied." }, "priority": { "type": "integer", "format": "int32", "description": "The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule." }, "direction": { "$ref": "#/definitions/SecurityRuleDirection", "description": "The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the security rule resource." } }, "required": [ "protocol", "access", "direction" ], "description": "Security rule resource." }, "SecurityRule": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/SecurityRulePropertiesFormat", "description": "Properties of the security rule." }, "name": { "type": "string", "description": "The name of the resource that is unique within a resource group. This name can be used to access the resource." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "Network security rule." }, "SecurityRuleListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/SecurityRule" }, "description": "The security rules in a network security group." }, "nextLink": { "type": "string", "description": "The URL to get the next set of results." } }, "description": "Response for ListSecurityRule API service call. Retrieves all security rules that belongs to a network security group." }, "NetworkSecurityGroupPropertiesFormat": { "properties": { "securityRules": { "type": "array", "items": { "$ref": "#/definitions/SecurityRule" }, "description": "A collection of security rules of the network security group." }, "defaultSecurityRules": { "readOnly": true, "type": "array", "items": { "$ref": "#/definitions/SecurityRule" }, "description": "The default security rules of network security group." }, "networkInterfaces": { "readOnly": true, "type": "array", "items": { "$ref": "./networkInterface.json#/definitions/NetworkInterface" }, "description": "A collection of references to network interfaces." }, "subnets": { "readOnly": true, "type": "array", "items": { "$ref": "./virtualNetwork.json#/definitions/Subnet" }, "description": "A collection of references to subnets." }, "flowLogs": { "readOnly": true, "type": "array", "items": { "$ref": "./networkWatcher.json#/definitions/FlowLog" }, "description": "A collection of references to flow log resources." }, "resourceGuid": { "readOnly": true, "type": "string", "description": "The resource GUID property of the network security group resource." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the network security group resource." } }, "description": "Network Security Group resource." }, "NetworkSecurityGroup": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/NetworkSecurityGroupPropertiesFormat", "description": "Properties of the network security group." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." } }, "allOf": [ { "$ref": "./network.json#/definitions/Resource" } ], "description": "NetworkSecurityGroup resource." }, "NetworkSecurityGroupListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/NetworkSecurityGroup" }, "description": "A list of NetworkSecurityGroup resources." }, "nextLink": { "type": "string", "description": "The URL to get the next set of results." } }, "description": "Response for ListNetworkSecurityGroups API service call." }, "SecurityRuleAccess": { "type": "string", "description": "Whether network traffic is allowed or denied.", "enum": [ "Allow", "Deny" ], "x-ms-enum": { "name": "SecurityRuleAccess", "modelAsString": true } }, "SecurityRuleDirection": { "type": "string", "description": "The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.", "enum": [ "Inbound", "Outbound" ], "x-ms-enum": { "name": "SecurityRuleDirection", "modelAsString": true } } } } spec-0.21.0/fixtures/azure/networkWatcher.json000066400000000000000000004351451457312531500214470ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "title": "NetworkManagementClient", "description": "The Microsoft Azure Network management API provides a RESTful set of web services that interact with Microsoft Azure Networks service to manage your network resources. The API has entities that capture the relationship between an end user and the Microsoft Azure Networks service.", "version": "2020-04-01" }, "host": "management.azure.com", "schemes": [ "https" ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "security": [ { "azure_auth": [ "user_impersonation" ] } ], "securityDefinitions": { "azure_auth": { "type": "oauth2", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "flow": "implicit", "description": "Azure Active Directory OAuth2 Flow.", "scopes": { "user_impersonation": "impersonate your user account" } } }, "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}": { "put": { "tags": [ "NetworkWatchers" ], "operationId": "NetworkWatchers_CreateOrUpdate", "description": "Creates or updates a network watcher in the specified resource group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkWatcherName", "in": "path", "required": true, "type": "string", "description": "The name of the network watcher." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/NetworkWatcher" }, "description": "Parameters that define the network watcher resource." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Update successful. The operation returns the resulting network watcher resource.", "schema": { "$ref": "#/definitions/NetworkWatcher" } }, "201": { "description": "Create successful. The operation returns the resulting network watcher resource.", "schema": { "$ref": "#/definitions/NetworkWatcher" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Create network watcher": { "$ref": "./examples/NetworkWatcherCreate.json" } } }, "get": { "tags": [ "NetworkWatchers" ], "operationId": "NetworkWatchers_Get", "description": "Gets the specified network watcher by resource group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkWatcherName", "in": "path", "required": true, "type": "string", "description": "The name of the network watcher." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a network watcher resource.", "schema": { "$ref": "#/definitions/NetworkWatcher" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Get network watcher": { "$ref": "./examples/NetworkWatcherGet.json" } } }, "delete": { "tags": [ "NetworkWatchers" ], "operationId": "NetworkWatchers_Delete", "description": "Deletes the specified network watcher resource.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkWatcherName", "in": "path", "required": true, "type": "string", "description": "The name of the network watcher." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "202": { "description": "Accepted and the operation will complete asynchronously." }, "204": { "description": "Delete successful." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Delete network watcher": { "$ref": "./examples/NetworkWatcherDelete.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } }, "patch": { "tags": [ "NetworkWatchers" ], "operationId": "NetworkWatchers_UpdateTags", "description": "Updates a network watcher tags.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkWatcherName", "in": "path", "required": true, "type": "string", "description": "The name of the network watcher." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "./network.json#/definitions/TagsObject" }, "description": "Parameters supplied to update network watcher tags." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Update successful. The operation returns the resulting network watcher resource.", "schema": { "$ref": "#/definitions/NetworkWatcher" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Update network watcher tags": { "$ref": "./examples/NetworkWatcherUpdateTags.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers": { "get": { "tags": [ "NetworkWatchers" ], "operationId": "NetworkWatchers_List", "description": "Gets all network watchers by resource group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of network watcher resources.", "schema": { "$ref": "#/definitions/NetworkWatcherListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-pageable": { "nextLinkName": null }, "x-ms-examples": { "List network watchers": { "$ref": "./examples/NetworkWatcherList.json" } } } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers": { "get": { "tags": [ "NetworkWatchers" ], "operationId": "NetworkWatchers_ListAll", "description": "Gets all network watchers by subscription.", "parameters": [ { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of network watcher resources.", "schema": { "$ref": "#/definitions/NetworkWatcherListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-pageable": { "nextLinkName": null }, "x-ms-examples": { "List all network watchers": { "$ref": "./examples/NetworkWatcherListAll.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology": { "post": { "tags": [ "NetworkWatchers" ], "operationId": "NetworkWatchers_GetTopology", "description": "Gets the current network topology by resource group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkWatcherName", "in": "path", "required": true, "type": "string", "description": "The name of the network watcher." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/TopologyParameters" }, "description": "Parameters that define the representation of topology." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns the topology of resource group.", "schema": { "$ref": "#/definitions/Topology" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Get Topology": { "$ref": "./examples/NetworkWatcherTopologyGet.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify": { "post": { "tags": [ "NetworkWatchers" ], "operationId": "NetworkWatchers_VerifyIPFlow", "description": "Verify IP flow from the specified VM to a location given the currently configured NSG rules.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkWatcherName", "in": "path", "required": true, "type": "string", "description": "The name of the network watcher." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/VerificationIPFlowParameters" }, "description": "Parameters that define the IP flow to be verified." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns the result of IP flow verification.", "schema": { "$ref": "#/definitions/VerificationIPFlowResult" } }, "202": { "description": "Accepted and the operation will complete asynchronously.", "schema": { "$ref": "#/definitions/VerificationIPFlowResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Ip flow verify": { "$ref": "./examples/NetworkWatcherIpFlowVerify.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop": { "post": { "tags": [ "NetworkWatchers" ], "operationId": "NetworkWatchers_GetNextHop", "description": "Gets the next hop from the specified VM.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkWatcherName", "in": "path", "required": true, "type": "string", "description": "The name of the network watcher." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/NextHopParameters" }, "description": "Parameters that define the source and destination endpoint." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns the next hop from the VM.", "schema": { "$ref": "#/definitions/NextHopResult" } }, "202": { "description": "Accepted and the operation will complete asynchronously.", "schema": { "$ref": "#/definitions/NextHopResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Get next hop": { "$ref": "./examples/NetworkWatcherNextHopGet.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView": { "post": { "tags": [ "NetworkWatchers" ], "operationId": "NetworkWatchers_GetVMSecurityRules", "description": "Gets the configured and effective security group rules on the specified VM.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkWatcherName", "in": "path", "required": true, "type": "string", "description": "The name of the network watcher." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/SecurityGroupViewParameters" }, "description": "Parameters that define the VM to check security groups for." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns security group rules on the VM.", "schema": { "$ref": "#/definitions/SecurityGroupViewResult" } }, "202": { "description": "Accepted and the operation will complete asynchronously.", "schema": { "$ref": "#/definitions/SecurityGroupViewResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Get security group view": { "$ref": "./examples/NetworkWatcherSecurityGroupViewGet.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}": { "put": { "tags": [ "PacketCaptures" ], "operationId": "PacketCaptures_Create", "description": "Create and start a packet capture on the specified VM.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkWatcherName", "in": "path", "required": true, "type": "string", "description": "The name of the network watcher." }, { "name": "packetCaptureName", "in": "path", "required": true, "type": "string", "description": "The name of the packet capture session." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/PacketCapture" }, "description": "Parameters that define the create packet capture operation." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "201": { "description": "Request successful. The operation returns the resulting packet capture session.", "schema": { "$ref": "#/definitions/PacketCaptureResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Create packet capture": { "$ref": "./examples/NetworkWatcherPacketCaptureCreate.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "azure-async-operation" } }, "get": { "tags": [ "PacketCaptures" ], "operationId": "PacketCaptures_Get", "description": "Gets a packet capture session by name.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkWatcherName", "in": "path", "required": true, "type": "string", "description": "The name of the network watcher." }, { "name": "packetCaptureName", "in": "path", "required": true, "type": "string", "description": "The name of the packet capture session." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a packet capture session.", "schema": { "$ref": "#/definitions/PacketCaptureResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Get packet capture": { "$ref": "./examples/NetworkWatcherPacketCaptureGet.json" } } }, "delete": { "tags": [ "PacketCaptures" ], "operationId": "PacketCaptures_Delete", "description": "Deletes the specified packet capture session.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkWatcherName", "in": "path", "required": true, "type": "string", "description": "The name of the network watcher." }, { "name": "packetCaptureName", "in": "path", "required": true, "type": "string", "description": "The name of the packet capture session." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "204": { "description": "Delete successful." }, "202": { "description": "Accepted and the operation will complete asynchronously." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Delete packet capture": { "$ref": "./examples/NetworkWatcherPacketCaptureDelete.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop": { "post": { "tags": [ "PacketCaptures" ], "operationId": "PacketCaptures_Stop", "description": "Stops a specified packet capture session.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkWatcherName", "in": "path", "required": true, "type": "string", "description": "The name of the network watcher." }, { "name": "packetCaptureName", "in": "path", "required": true, "type": "string", "description": "The name of the packet capture session." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation stops the packet capture session." }, "202": { "description": "Accepted and the operation will complete asynchronously." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Stop packet capture": { "$ref": "./examples/NetworkWatcherPacketCaptureStop.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus": { "post": { "tags": [ "PacketCaptures" ], "operationId": "PacketCaptures_GetStatus", "description": "Query the status of a running packet capture session.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkWatcherName", "in": "path", "required": true, "type": "string", "description": "The name of the Network Watcher resource." }, { "name": "packetCaptureName", "in": "path", "required": true, "type": "string", "description": "The name given to the packet capture session." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Successful query of packet capture status.", "schema": { "$ref": "#/definitions/PacketCaptureQueryStatusResult" } }, "202": { "description": "Accepted query status of packet capture.", "schema": { "$ref": "#/definitions/PacketCaptureQueryStatusResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Query packet capture status": { "$ref": "./examples/NetworkWatcherPacketCaptureQueryStatus.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures": { "get": { "tags": [ "PacketCaptures" ], "operationId": "PacketCaptures_List", "description": "Lists all packet capture sessions within the specified resource group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkWatcherName", "in": "path", "required": true, "type": "string", "description": "The name of the Network Watcher resource." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Successful packet capture enumeration request.", "schema": { "$ref": "#/definitions/PacketCaptureListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-pageable": { "nextLinkName": null }, "x-ms-examples": { "List packet captures": { "$ref": "./examples/NetworkWatcherPacketCapturesList.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot": { "post": { "tags": [ "NetworkWatchers" ], "operationId": "NetworkWatchers_GetTroubleshooting", "description": "Initiate troubleshooting on a specified resource.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkWatcherName", "in": "path", "required": true, "type": "string", "description": "The name of the network watcher resource." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/TroubleshootingParameters" }, "description": "Parameters that define the resource to troubleshoot." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Successful troubleshooting request.", "schema": { "$ref": "#/definitions/TroubleshootingResult" } }, "202": { "description": "Accepted get troubleshooting request.", "schema": { "$ref": "#/definitions/TroubleshootingResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Get troubleshooting": { "$ref": "./examples/NetworkWatcherTroubleshootGet.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult": { "post": { "tags": [ "NetworkWatchers" ], "operationId": "NetworkWatchers_GetTroubleshootingResult", "description": "Get the last completed troubleshooting result on a specified resource.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkWatcherName", "in": "path", "required": true, "type": "string", "description": "The name of the network watcher resource." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/QueryTroubleshootingParameters" }, "description": "Parameters that define the resource to query the troubleshooting result." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Successful get troubleshooting result request.", "schema": { "$ref": "#/definitions/TroubleshootingResult" } }, "202": { "description": "Accepted get troubleshooting result request.", "schema": { "$ref": "#/definitions/TroubleshootingResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Get troubleshoot result": { "$ref": "./examples/NetworkWatcherTroubleshootResultQuery.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog": { "post": { "tags": [ "NetworkWatchers", "TrafficAnalytics" ], "operationId": "NetworkWatchers_SetFlowLogConfiguration", "description": "Configures flow log and traffic analytics (optional) on a specified resource.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the network watcher resource group." }, { "name": "networkWatcherName", "in": "path", "required": true, "type": "string", "description": "The name of the network watcher resource." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/FlowLogInformation" }, "description": "Parameters that define the configuration of flow log." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Successful request for setting flow log and traffic analytics (optional) configuration.", "schema": { "$ref": "#/definitions/FlowLogInformation" } }, "202": { "description": "Accepted and the operation will complete asynchronously.", "schema": { "$ref": "#/definitions/FlowLogInformation" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Configure flow log": { "$ref": "./examples/NetworkWatcherFlowLogConfigure.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus": { "post": { "tags": [ "NetworkWatchers", "TrafficAnalytics" ], "operationId": "NetworkWatchers_GetFlowLogStatus", "description": "Queries status of flow log and traffic analytics (optional) on a specified resource.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the network watcher resource group." }, { "name": "networkWatcherName", "in": "path", "required": true, "type": "string", "description": "The name of the network watcher resource." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/FlowLogStatusParameters" }, "description": "Parameters that define a resource to query flow log and traffic analytics (optional) status." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Successful request for query flow log and traffic analytics (optional) status.", "schema": { "$ref": "#/definitions/FlowLogInformation" } }, "202": { "description": "Accepted and the operation will complete asynchronously.", "schema": { "$ref": "#/definitions/FlowLogInformation" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Get flow log status": { "$ref": "./examples/NetworkWatcherFlowLogStatusQuery.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck": { "post": { "tags": [ "NetworkWatchers" ], "operationId": "NetworkWatchers_CheckConnectivity", "description": "Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the network watcher resource group." }, { "name": "networkWatcherName", "in": "path", "required": true, "type": "string", "description": "The name of the network watcher resource." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ConnectivityParameters" }, "description": "Parameters that determine how the connectivity check will be performed." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Successful request for checking connectivity.", "schema": { "$ref": "#/definitions/ConnectivityInformation" } }, "202": { "description": "Accepted and the operation will complete asynchronously.", "schema": { "$ref": "#/definitions/ConnectivityInformation" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Check connectivity": { "$ref": "./examples/NetworkWatcherConnectivityCheck.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/azureReachabilityReport": { "post": { "tags": [ "NetworkWatchers" ], "operationId": "NetworkWatchers_GetAzureReachabilityReport", "description": "NOTE: This feature is currently in preview and still being tested for stability. Gets the relative latency score for internet service providers from a specified location to Azure regions.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the network watcher resource group." }, { "name": "networkWatcherName", "in": "path", "required": true, "type": "string", "description": "The name of the network watcher resource." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/AzureReachabilityReportParameters" }, "description": "Parameters that determine Azure reachability report configuration." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Successful request for Azure reachability report.", "schema": { "$ref": "#/definitions/AzureReachabilityReport" } }, "202": { "description": "Accepted and the operation will complete asynchronously.", "schema": { "$ref": "#/definitions/AzureReachabilityReport" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Get Azure Reachability Report": { "$ref": "./examples/NetworkWatcherAzureReachabilityReportGet.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/availableProvidersList": { "post": { "tags": [ "NetworkWatchers" ], "operationId": "NetworkWatchers_ListAvailableProviders", "description": "NOTE: This feature is currently in preview and still being tested for stability. Lists all available internet service providers for a specified Azure region.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the network watcher resource group." }, { "name": "networkWatcherName", "in": "path", "required": true, "type": "string", "description": "The name of the network watcher resource." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/AvailableProvidersListParameters" }, "description": "Parameters that scope the list of available providers." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Successful request for list of available providers.", "schema": { "$ref": "#/definitions/AvailableProvidersList" } }, "202": { "description": "Accepted and the operation will complete asynchronously.", "schema": { "$ref": "#/definitions/AvailableProvidersList" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Get Available Providers List": { "$ref": "./examples/NetworkWatcherAvailableProvidersListGet.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/networkConfigurationDiagnostic": { "post": { "tags": [ "NetworkWatchers" ], "operationId": "NetworkWatchers_GetNetworkConfigurationDiagnostic", "description": "Gets Network Configuration Diagnostic data to help customers understand and debug network behavior. It provides detailed information on what security rules were applied to a specified traffic flow and the result of evaluating these rules. Customers must provide details of a flow like source, destination, protocol, etc. The API returns whether traffic was allowed or denied, the rules evaluated for the specified flow and the evaluation results.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkWatcherName", "in": "path", "required": true, "type": "string", "description": "The name of the network watcher." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/NetworkConfigurationDiagnosticParameters" }, "description": "Parameters to get network configuration diagnostic." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns the result of network configuration diagnostic.", "schema": { "$ref": "#/definitions/NetworkConfigurationDiagnosticResponse" } }, "202": { "description": "Accepted and the operation will complete asynchronously.", "schema": { "$ref": "#/definitions/NetworkConfigurationDiagnosticResponse" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Network configuration diagnostic": { "$ref": "./examples/NetworkWatcherNetworkConfigurationDiagnostic.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}": { "put": { "tags": [ "ConnectionMonitors" ], "operationId": "ConnectionMonitors_CreateOrUpdate", "description": "Create or update a connection monitor.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group containing Network Watcher." }, { "name": "networkWatcherName", "in": "path", "required": true, "type": "string", "description": "The name of the Network Watcher resource." }, { "name": "connectionMonitorName", "in": "path", "required": true, "type": "string", "description": "The name of the connection monitor." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ConnectionMonitor" }, "description": "Parameters that define the operation to create a connection monitor." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Update successful. The operation returns the resulting network watcher resource.", "schema": { "$ref": "#/definitions/ConnectionMonitorResult" } }, "201": { "description": "Create successful. The operation returns the resulting network watcher resource.", "schema": { "$ref": "#/definitions/ConnectionMonitorResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./networkWatcher.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Create connection monitor V1": { "$ref": "./examples/NetworkWatcherConnectionMonitorCreate.json" }, "Create connection monitor V2": { "$ref": "./examples/NetworkWatcherConnectionMonitorV2Create.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "azure-async-operation" } }, "get": { "tags": [ "ConnectionMonitors" ], "operationId": "ConnectionMonitors_Get", "description": "Gets a connection monitor by name.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group containing Network Watcher." }, { "name": "networkWatcherName", "in": "path", "required": true, "type": "string", "description": "The name of the Network Watcher resource." }, { "name": "connectionMonitorName", "in": "path", "required": true, "type": "string", "description": "The name of the connection monitor." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a connection monitor.", "schema": { "$ref": "#/definitions/ConnectionMonitorResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./networkWatcher.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Get connection monitor": { "$ref": "./examples/NetworkWatcherConnectionMonitorGet.json" } } }, "delete": { "tags": [ "ConnectionMonitors" ], "operationId": "ConnectionMonitors_Delete", "description": "Deletes the specified connection monitor.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group containing Network Watcher." }, { "name": "networkWatcherName", "in": "path", "required": true, "type": "string", "description": "The name of the Network Watcher resource." }, { "name": "connectionMonitorName", "in": "path", "required": true, "type": "string", "description": "The name of the connection monitor." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "204": { "description": "Delete successful." }, "202": { "description": "Accepted. The operation will complete asynchronously." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./networkWatcher.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Delete connection monitor": { "$ref": "./examples/NetworkWatcherConnectionMonitorDelete.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } }, "patch": { "tags": [ "ConnectionMonitors" ], "operationId": "ConnectionMonitors_UpdateTags", "description": "Update tags of the specified connection monitor.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkWatcherName", "in": "path", "required": true, "type": "string", "description": "The name of the network watcher." }, { "name": "connectionMonitorName", "in": "path", "required": true, "type": "string", "description": "The name of the connection monitor." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "./network.json#/definitions/TagsObject" }, "description": "Parameters supplied to update connection monitor tags." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns updated connection monitor.", "schema": { "$ref": "#/definitions/ConnectionMonitorResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./networkWatcher.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Update connection monitor tags": { "$ref": "./examples/NetworkWatcherConnectionMonitorUpdateTags.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/stop": { "post": { "tags": [ "ConnectionMonitors" ], "operationId": "ConnectionMonitors_Stop", "description": "Stops the specified connection monitor.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group containing Network Watcher." }, { "name": "networkWatcherName", "in": "path", "required": true, "type": "string", "description": "The name of the Network Watcher resource." }, { "name": "connectionMonitorName", "in": "path", "required": true, "type": "string", "description": "The name of the connection monitor." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation stops the connection monitor." }, "202": { "description": "Accepted. The operation will complete asynchronously." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./networkWatcher.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Stop connection monitor": { "$ref": "./examples/NetworkWatcherConnectionMonitorStop.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/start": { "post": { "tags": [ "ConnectionMonitors" ], "operationId": "ConnectionMonitors_Start", "description": "Starts the specified connection monitor.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group containing Network Watcher." }, { "name": "networkWatcherName", "in": "path", "required": true, "type": "string", "description": "The name of the Network Watcher resource." }, { "name": "connectionMonitorName", "in": "path", "required": true, "type": "string", "description": "The name of the connection monitor." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation starts the connection monitor." }, "202": { "description": "Accepted. The operation will complete asynchronously." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./networkWatcher.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Start connection monitor": { "$ref": "./examples/NetworkWatcherConnectionMonitorStart.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/query": { "post": { "tags": [ "ConnectionMonitors" ], "operationId": "ConnectionMonitors_Query", "description": "Query a snapshot of the most recent connection states.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group containing Network Watcher." }, { "name": "networkWatcherName", "in": "path", "required": true, "type": "string", "description": "The name of the Network Watcher resource." }, { "name": "connectionMonitorName", "in": "path", "required": true, "type": "string", "description": "The name given to the connection monitor." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Successful query of connection states.", "schema": { "$ref": "#/definitions/ConnectionMonitorQueryResult" } }, "202": { "description": "Accepted query of connection states.", "schema": { "$ref": "#/definitions/ConnectionMonitorQueryResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./networkWatcher.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Query connection monitor": { "$ref": "./examples/NetworkWatcherConnectionMonitorQuery.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors": { "get": { "tags": [ "ConnectionMonitors" ], "operationId": "ConnectionMonitors_List", "description": "Lists all connection monitors for the specified Network Watcher.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group containing Network Watcher." }, { "name": "networkWatcherName", "in": "path", "required": true, "type": "string", "description": "The name of the Network Watcher resource." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Successful connection monitor enumeration request.", "schema": { "$ref": "#/definitions/ConnectionMonitorListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./networkWatcher.json#/definitions/ErrorResponse" } } }, "x-ms-pageable": { "nextLinkName": null }, "x-ms-examples": { "List connection monitors": { "$ref": "./examples/NetworkWatcherConnectionMonitorList.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}": { "put": { "tags": [ "FlowLogs" ], "operationId": "FlowLogs_CreateOrUpdate", "description": "Create or update a flow log for the specified network security group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkWatcherName", "in": "path", "required": true, "type": "string", "description": "The name of the network watcher." }, { "name": "flowLogName", "in": "path", "required": true, "type": "string", "description": "The name of the flow log." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/FlowLog" }, "description": "Parameters that define the create or update flow log resource." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "201": { "description": "Request successful. The operation returns the resulting flow log resource.", "schema": { "$ref": "#/definitions/FlowLog" } }, "200": { "description": "Update successful. The operation returns the resulting flow log resource.", "schema": { "$ref": "#/definitions/FlowLog" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Create or update flow log": { "$ref": "./examples/NetworkWatcherFlowLogCreate.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "azure-async-operation" } }, "get": { "tags": [ "FlowLogs" ], "operationId": "FlowLogs_Get", "description": "Gets a flow log resource by name.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkWatcherName", "in": "path", "required": true, "type": "string", "description": "The name of the network watcher." }, { "name": "flowLogName", "in": "path", "required": true, "type": "string", "description": "The name of the flow log resource." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a flow log resource.", "schema": { "$ref": "#/definitions/FlowLog" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Get flow log": { "$ref": "./examples/NetworkWatcherFlowLogGet.json" } } }, "delete": { "tags": [ "FlowLogs" ], "operationId": "FlowLogs_Delete", "description": "Deletes the specified flow log resource.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "networkWatcherName", "in": "path", "required": true, "type": "string", "description": "The name of the network watcher." }, { "name": "flowLogName", "in": "path", "required": true, "type": "string", "description": "The name of the flow log resource." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "204": { "description": "Delete successful." }, "202": { "description": "Accepted and the operation will complete asynchronously." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Delete flow log": { "$ref": "./examples/NetworkWatcherFlowLogDelete.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs": { "get": { "tags": [ "FlowLogs" ], "operationId": "FlowLogs_List", "description": "Lists all flow log resources for the specified Network Watcher.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group containing Network Watcher." }, { "name": "networkWatcherName", "in": "path", "required": true, "type": "string", "description": "The name of the Network Watcher resource." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Successful flow log enumeration request.", "schema": { "$ref": "#/definitions/FlowLogListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./networkWatcher.json#/definitions/ErrorResponse" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" }, "x-ms-examples": { "List connection monitors": { "$ref": "./examples/NetworkWatcherFlowLogList.json" } } } } }, "definitions": { "ErrorResponse": { "description": "The error object.", "properties": { "error": { "title": "Error", "$ref": "./network.json#/definitions/ErrorDetails", "description": "The error details object." } } }, "NetworkWatcher": { "properties": { "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." }, "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/NetworkWatcherPropertiesFormat", "description": "Properties of the network watcher." } }, "allOf": [ { "$ref": "./network.json#/definitions/Resource" } ], "description": "Network watcher in a resource group." }, "NetworkWatcherPropertiesFormat": { "properties": { "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the network watcher resource." } }, "description": "The network watcher properties." }, "NetworkWatcherListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/NetworkWatcher" }, "description": "List of network watcher resources." } }, "description": "Response for ListNetworkWatchers API service call." }, "TopologyParameters": { "properties": { "targetResourceGroupName": { "type": "string", "description": "The name of the target resource group to perform topology on." }, "targetVirtualNetwork": { "$ref": "./network.json#/definitions/SubResource", "description": "The reference to the Virtual Network resource." }, "targetSubnet": { "$ref": "./network.json#/definitions/SubResource", "description": "The reference to the Subnet resource." } }, "description": "Parameters that define the representation of topology." }, "Topology": { "properties": { "id": { "readOnly": true, "type": "string", "description": "GUID representing the operation id." }, "createdDateTime": { "readOnly": true, "type": "string", "format": "date-time", "description": "The datetime when the topology was initially created for the resource group." }, "lastModified": { "readOnly": true, "type": "string", "format": "date-time", "description": "The datetime when the topology was last modified." }, "resources": { "type": "array", "items": { "$ref": "#/definitions/TopologyResource" }, "description": "A list of topology resources." } }, "description": "Topology of the specified resource group." }, "TopologyResource": { "properties": { "name": { "type": "string", "description": "Name of the resource." }, "id": { "type": "string", "description": "ID of the resource." }, "location": { "type": "string", "description": "Resource location." }, "associations": { "type": "array", "description": "Holds the associations the resource has with other resources in the resource group.", "items": { "$ref": "#/definitions/TopologyAssociation" } } }, "description": "The network resource topology information for the given resource group." }, "TopologyAssociation": { "properties": { "name": { "type": "string", "description": "The name of the resource that is associated with the parent resource." }, "resourceId": { "type": "string", "description": "The ID of the resource that is associated with the parent resource." }, "associationType": { "type": "string", "enum": [ "Associated", "Contains" ], "x-ms-enum": { "name": "AssociationType", "modelAsString": true }, "description": "The association type of the child resource to the parent resource." } }, "description": "Resources that have an association with the parent resource." }, "VerificationIPFlowParameters": { "description": "Parameters that define the IP flow to be verified.", "required": [ "targetResourceId", "direction", "protocol", "localPort", "remotePort", "localIPAddress", "remoteIPAddress" ], "properties": { "targetResourceId": { "type": "string", "description": "The ID of the target resource to perform next-hop on." }, "direction": { "$ref": "#/definitions/Direction", "description": "The direction of the packet represented as a 5-tuple." }, "protocol": { "type": "string", "enum": [ "TCP", "UDP" ], "x-ms-enum": { "name": "IpFlowProtocol", "modelAsString": true }, "description": "Protocol to be verified on." }, "localPort": { "type": "string", "description": "The local port. Acceptable values are a single integer in the range (0-65535). Support for * for the source port, which depends on the direction." }, "remotePort": { "type": "string", "description": "The remote port. Acceptable values are a single integer in the range (0-65535). Support for * for the source port, which depends on the direction." }, "localIPAddress": { "type": "string", "description": "The local IP address. Acceptable values are valid IPv4 addresses." }, "remoteIPAddress": { "type": "string", "description": "The remote IP address. Acceptable values are valid IPv4 addresses." }, "targetNicResourceId": { "type": "string", "description": "The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of them, then this parameter must be specified. Otherwise optional)." } } }, "VerificationIPFlowResult": { "description": "Results of IP flow verification on the target resource.", "properties": { "access": { "$ref": "./network.json#/definitions/Access", "description": "Indicates whether the traffic is allowed or denied." }, "ruleName": { "type": "string", "description": "Name of the rule. If input is not matched against any security rule, it is not displayed." } } }, "NextHopParameters": { "description": "Parameters that define the source and destination endpoint.", "required": [ "targetResourceId", "sourceIPAddress", "destinationIPAddress" ], "properties": { "targetResourceId": { "type": "string", "description": "The resource identifier of the target resource against which the action is to be performed." }, "sourceIPAddress": { "type": "string", "description": "The source IP address." }, "destinationIPAddress": { "type": "string", "description": "The destination IP address." }, "targetNicResourceId": { "type": "string", "description": "The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of the nics, then this parameter must be specified. Otherwise optional)." } } }, "NextHopResult": { "description": "The information about next hop from the specified VM.", "properties": { "nextHopType": { "type": "string", "enum": [ "Internet", "VirtualAppliance", "VirtualNetworkGateway", "VnetLocal", "HyperNetGateway", "None" ], "x-ms-enum": { "name": "NextHopType", "modelAsString": true }, "description": "Next hop type." }, "nextHopIpAddress": { "type": "string", "description": "Next hop IP Address." }, "routeTableId": { "type": "string", "description": "The resource identifier for the route table associated with the route being returned. If the route being returned does not correspond to any user created routes then this field will be the string 'System Route'." } } }, "SecurityGroupViewParameters": { "description": "Parameters that define the VM to check security groups for.", "required": [ "targetResourceId" ], "properties": { "targetResourceId": { "type": "string", "description": "ID of the target VM." } } }, "SecurityGroupViewResult": { "description": "The information about security rules applied to the specified VM.", "properties": { "networkInterfaces": { "type": "array", "description": "List of network interfaces on the specified VM.", "items": { "$ref": "#/definitions/SecurityGroupNetworkInterface" } } } }, "SecurityGroupNetworkInterface": { "description": "Network interface and all its associated security rules.", "properties": { "id": { "type": "string", "description": "ID of the network interface." }, "securityRuleAssociations": { "$ref": "#/definitions/SecurityRuleAssociations", "description": "All security rules associated with the network interface." } } }, "SecurityRuleAssociations": { "description": "All security rules associated with the network interface.", "properties": { "networkInterfaceAssociation": { "$ref": "#/definitions/NetworkInterfaceAssociation", "description": "Network interface and it's custom security rules." }, "subnetAssociation": { "$ref": "#/definitions/SubnetAssociation", "description": "Subnet and it's custom security rules." }, "defaultSecurityRules": { "type": "array", "items": { "$ref": "./networkSecurityGroup.json#/definitions/SecurityRule" }, "description": "Collection of default security rules of the network security group." }, "effectiveSecurityRules": { "type": "array", "items": { "$ref": "./networkInterface.json#/definitions/EffectiveNetworkSecurityRule" }, "description": "Collection of effective security rules." } } }, "NetworkInterfaceAssociation": { "description": "Network interface and its custom security rules.", "properties": { "id": { "readOnly": true, "type": "string", "description": "Network interface ID." }, "securityRules": { "type": "array", "description": "Collection of custom security rules.", "items": { "$ref": "./networkSecurityGroup.json#/definitions/SecurityRule" } } } }, "SubnetAssociation": { "description": "Subnet and it's custom security rules.", "properties": { "id": { "readOnly": true, "type": "string", "description": "Subnet ID." }, "securityRules": { "type": "array", "description": "Collection of custom security rules.", "items": { "$ref": "./networkSecurityGroup.json#/definitions/SecurityRule" } } } }, "PacketCapture": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/PacketCaptureParameters", "description": "Properties of the packet capture." } }, "required": [ "properties" ], "description": "Parameters that define the create packet capture operation." }, "PacketCaptureParameters": { "properties": { "target": { "type": "string", "description": "The ID of the targeted resource, only VM is currently supported." }, "bytesToCapturePerPacket": { "type": "integer", "default": 0, "description": "Number of bytes captured per packet, the remaining bytes are truncated." }, "totalBytesPerSession": { "type": "integer", "default": 1073741824, "description": "Maximum size of the capture output." }, "timeLimitInSeconds": { "type": "integer", "default": 18000, "description": "Maximum duration of the capture session in seconds." }, "storageLocation": { "$ref": "#/definitions/PacketCaptureStorageLocation", "description": "The storage location for a packet capture session." }, "filters": { "type": "array", "items": { "$ref": "#/definitions/PacketCaptureFilter" }, "description": "A list of packet capture filters." } }, "required": [ "target", "storageLocation" ], "description": "Parameters that define the create packet capture operation." }, "PacketCaptureStorageLocation": { "properties": { "storageId": { "type": "string", "description": "The ID of the storage account to save the packet capture session. Required if no local file path is provided." }, "storagePath": { "type": "string", "description": "The URI of the storage path to save the packet capture. Must be a well-formed URI describing the location to save the packet capture." }, "filePath": { "type": "string", "description": "A valid local path on the targeting VM. Must include the name of the capture file (*.cap). For linux virtual machine it must start with /var/captures. Required if no storage ID is provided, otherwise optional." } }, "description": "The storage location for a packet capture session." }, "PacketCaptureFilter": { "properties": { "protocol": { "type": "string", "enum": [ "TCP", "UDP", "Any" ], "x-ms-enum": { "name": "PcProtocol", "modelAsString": true }, "default": "Any", "description": "Protocol to be filtered on." }, "localIPAddress": { "type": "string", "description": "Local IP Address to be filtered on. Notation: \"127.0.0.1\" for single address entry. \"127.0.0.1-127.0.0.255\" for range. \"127.0.0.1;127.0.0.5\"? for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null." }, "remoteIPAddress": { "type": "string", "description": "Local IP Address to be filtered on. Notation: \"127.0.0.1\" for single address entry. \"127.0.0.1-127.0.0.255\" for range. \"127.0.0.1;127.0.0.5;\" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null." }, "localPort": { "type": "string", "description": "Local port to be filtered on. Notation: \"80\" for single port entry.\"80-85\" for range. \"80;443;\" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null." }, "remotePort": { "type": "string", "description": "Remote port to be filtered on. Notation: \"80\" for single port entry.\"80-85\" for range. \"80;443;\" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null." } }, "description": "Filter that is applied to packet capture request. Multiple filters can be applied." }, "PacketCaptureListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/PacketCaptureResult" }, "description": "Information about packet capture sessions." } }, "description": "List of packet capture sessions." }, "PacketCaptureResult": { "properties": { "name": { "readOnly": true, "type": "string", "description": "Name of the packet capture session." }, "id": { "readOnly": true, "type": "string", "description": "ID of the packet capture operation." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." }, "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/PacketCaptureResultProperties", "description": "Properties of the packet capture result." } }, "description": "Information about packet capture session." }, "PacketCaptureResultProperties": { "properties": { "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the packet capture session." } }, "allOf": [ { "$ref": "#/definitions/PacketCaptureParameters" } ], "description": "The properties of a packet capture session." }, "PacketCaptureQueryStatusResult": { "properties": { "name": { "type": "string", "description": "The name of the packet capture resource." }, "id": { "type": "string", "description": "The ID of the packet capture resource." }, "captureStartTime": { "type": "string", "format": "date-time", "description": "The start time of the packet capture session." }, "packetCaptureStatus": { "type": "string", "enum": [ "NotStarted", "Running", "Stopped", "Error", "Unknown" ], "x-ms-enum": { "name": "PcStatus", "modelAsString": true }, "description": "The status of the packet capture session." }, "stopReason": { "type": "string", "description": "The reason the current packet capture session was stopped." }, "packetCaptureError": { "type": "array", "description": "List of errors of packet capture session.", "items": { "type": "string", "enum": [ "InternalError", "AgentStopped", "CaptureFailed", "LocalFileFailed", "StorageFailed" ], "x-ms-enum": { "name": "PcError", "modelAsString": true } } } }, "description": "Status of packet capture session." }, "TroubleshootingParameters": { "description": "Parameters that define the resource to troubleshoot.", "required": [ "targetResourceId", "properties" ], "properties": { "targetResourceId": { "description": "The target resource to troubleshoot.", "type": "string" }, "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/TroubleshootingProperties", "description": "Properties of the troubleshooting resource." } } }, "QueryTroubleshootingParameters": { "description": "Parameters that define the resource to query the troubleshooting result.", "required": [ "targetResourceId" ], "properties": { "targetResourceId": { "description": "The target resource ID to query the troubleshooting result.", "type": "string" } } }, "TroubleshootingProperties": { "description": "Storage location provided for troubleshoot.", "required": [ "storageId", "storagePath" ], "properties": { "storageId": { "description": "The ID for the storage account to save the troubleshoot result.", "type": "string" }, "storagePath": { "description": "The path to the blob to save the troubleshoot result in.", "type": "string" } } }, "TroubleshootingResult": { "description": "Troubleshooting information gained from specified resource.", "properties": { "startTime": { "type": "string", "format": "date-time", "description": "The start time of the troubleshooting." }, "endTime": { "type": "string", "format": "date-time", "description": "The end time of the troubleshooting." }, "code": { "type": "string", "description": "The result code of the troubleshooting." }, "results": { "type": "array", "description": "Information from troubleshooting.", "items": { "$ref": "#/definitions/TroubleshootingDetails" } } } }, "TroubleshootingDetails": { "description": "Information gained from troubleshooting of specified resource.", "properties": { "id": { "type": "string", "description": "The id of the get troubleshoot operation." }, "reasonType": { "type": "string", "description": "Reason type of failure." }, "summary": { "type": "string", "description": "A summary of troubleshooting." }, "detail": { "type": "string", "description": "Details on troubleshooting results." }, "recommendedActions": { "type": "array", "description": "List of recommended actions.", "items": { "$ref": "#/definitions/TroubleshootingRecommendedActions" } } } }, "TroubleshootingRecommendedActions": { "description": "Recommended actions based on discovered issues.", "properties": { "actionId": { "description": "ID of the recommended action.", "type": "string" }, "actionText": { "description": "Description of recommended actions.", "type": "string" }, "actionUri": { "description": "The uri linking to a documentation for the recommended troubleshooting actions.", "type": "string" }, "actionUriText": { "description": "The information from the URI for the recommended troubleshooting actions.", "type": "string" } } }, "FlowLogListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/FlowLog" }, "description": "Information about flow log resource." }, "nextLink": { "readOnly": true, "type": "string", "description": "The URL to get the next set of results." } }, "description": "List of flow logs." }, "FlowLog": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/FlowLogPropertiesFormat", "description": "Properties of the flow log." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." } }, "allOf": [ { "$ref": "./network.json#/definitions/Resource" } ], "description": "A flow log resource." }, "FlowLogPropertiesFormat": { "description": "Parameters that define the configuration of flow log.", "required": [ "targetResourceId", "storageId" ], "properties": { "targetResourceId": { "description": "ID of network security group to which flow log will be applied.", "type": "string" }, "targetResourceGuid": { "readOnly": true, "description": "Guid of network security group to which flow log will be applied.", "type": "string" }, "storageId": { "description": "ID of the storage account which is used to store the flow log.", "type": "string" }, "enabled": { "description": "Flag to enable/disable flow logging.", "type": "boolean" }, "retentionPolicy": { "$ref": "#/definitions/RetentionPolicyParameters", "description": "Parameters that define the retention policy for flow log." }, "format": { "$ref": "#/definitions/FlowLogFormatParameters", "description": "Parameters that define the flow log format." }, "flowAnalyticsConfiguration": { "$ref": "#/definitions/TrafficAnalyticsProperties", "description": "Parameters that define the configuration of traffic analytics." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the flow log." } } }, "FlowLogProperties": { "description": "Parameters that define the configuration of flow log.", "required": [ "storageId", "enabled" ], "properties": { "storageId": { "description": "ID of the storage account which is used to store the flow log.", "type": "string" }, "enabled": { "description": "Flag to enable/disable flow logging.", "type": "boolean" }, "retentionPolicy": { "$ref": "#/definitions/RetentionPolicyParameters", "description": "Parameters that define the retention policy for flow log." }, "format": { "$ref": "#/definitions/FlowLogFormatParameters", "description": "Parameters that define the flow log format." } } }, "FlowLogStatusParameters": { "description": "Parameters that define a resource to query flow log and traffic analytics (optional) status.", "required": [ "targetResourceId" ], "properties": { "targetResourceId": { "description": "The target resource where getting the flow log and traffic analytics (optional) status.", "type": "string" } } }, "RetentionPolicyParameters": { "description": "Parameters that define the retention policy for flow log.", "properties": { "days": { "description": "Number of days to retain flow log records.", "type": "integer", "default": 0 }, "enabled": { "description": "Flag to enable/disable retention.", "type": "boolean", "default": false } } }, "FlowLogFormatParameters": { "description": "Parameters that define the flow log format.", "properties": { "type": { "type": "string", "description": "The file type of flow log.", "enum": [ "JSON" ], "x-ms-enum": { "name": "FlowLogFormatType", "modelAsString": true } }, "version": { "description": "The version (revision) of the flow log.", "type": "integer", "default": 0 } } }, "FlowLogInformation": { "description": "Information on the configuration of flow log and traffic analytics (optional) .", "required": [ "targetResourceId", "properties" ], "properties": { "targetResourceId": { "description": "The ID of the resource to configure for flow log and traffic analytics (optional) .", "type": "string" }, "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/FlowLogProperties", "description": "Properties of the flow log." }, "flowAnalyticsConfiguration": { "$ref": "#/definitions/TrafficAnalyticsProperties", "description": "Parameters that define the configuration of traffic analytics." } } }, "TrafficAnalyticsProperties": { "description": "Parameters that define the configuration of traffic analytics.", "properties": { "networkWatcherFlowAnalyticsConfiguration": { "$ref": "#/definitions/TrafficAnalyticsConfigurationProperties", "description": "Parameters that define the configuration of traffic analytics." } } }, "TrafficAnalyticsConfigurationProperties": { "description": "Parameters that define the configuration of traffic analytics.", "properties": { "enabled": { "description": "Flag to enable/disable traffic analytics.", "type": "boolean" }, "workspaceId": { "description": "The resource guid of the attached workspace.", "type": "string" }, "workspaceRegion": { "description": "The location of the attached workspace.", "type": "string" }, "workspaceResourceId": { "description": "Resource Id of the attached workspace.", "type": "string" }, "trafficAnalyticsInterval": { "description": "The interval in minutes which would decide how frequently TA service should do flow analytics.", "type": "integer" } } }, "ConnectivityParameters": { "description": "Parameters that determine how the connectivity check will be performed.", "required": [ "source", "destination" ], "properties": { "source": { "$ref": "#/definitions/ConnectivitySource", "description": "The source of the connection." }, "destination": { "$ref": "#/definitions/ConnectivityDestination", "description": "The destination of connection." }, "protocol": { "type": "string", "description": "Network protocol.", "enum": [ "Tcp", "Http", "Https", "Icmp" ], "x-ms-enum": { "name": "Protocol", "modelAsString": true } }, "protocolConfiguration": { "$ref": "#/definitions/ProtocolConfiguration", "description": "Configuration of the protocol." }, "preferredIPVersion": { "$ref": "./network.json#/definitions/IPVersion", "description": "Preferred IP version of the connection." } } }, "ConnectivitySource": { "description": "Parameters that define the source of the connection.", "required": [ "resourceId" ], "properties": { "resourceId": { "description": "The ID of the resource from which a connectivity check will be initiated.", "type": "string" }, "port": { "description": "The source port from which a connectivity check will be performed.", "type": "integer" } } }, "ConnectivityDestination": { "description": "Parameters that define destination of connection.", "properties": { "resourceId": { "description": "The ID of the resource to which a connection attempt will be made.", "type": "string" }, "address": { "description": "The IP address or URI the resource to which a connection attempt will be made.", "type": "string" }, "port": { "description": "Port on which check connectivity will be performed.", "type": "integer" } } }, "ConnectivityInformation": { "description": "Information on the connectivity status.", "properties": { "hops": { "readOnly": true, "type": "array", "description": "List of hops between the source and the destination.", "items": { "$ref": "#/definitions/ConnectivityHop" } }, "connectionStatus": { "readOnly": true, "type": "string", "enum": [ "Unknown", "Connected", "Disconnected", "Degraded" ], "x-ms-enum": { "name": "ConnectionStatus", "modelAsString": true }, "description": "The connection status." }, "avgLatencyInMs": { "description": "Average latency in milliseconds.", "readOnly": true, "type": "integer" }, "minLatencyInMs": { "description": "Minimum latency in milliseconds.", "readOnly": true, "type": "integer" }, "maxLatencyInMs": { "description": "Maximum latency in milliseconds.", "readOnly": true, "type": "integer" }, "probesSent": { "description": "Total number of probes sent.", "readOnly": true, "type": "integer" }, "probesFailed": { "description": "Number of failed probes.", "readOnly": true, "type": "integer" } } }, "ConnectivityHop": { "description": "Information about a hop between the source and the destination.", "properties": { "type": { "description": "The type of the hop.", "readOnly": true, "type": "string" }, "id": { "description": "The ID of the hop.", "readOnly": true, "type": "string" }, "address": { "description": "The IP address of the hop.", "readOnly": true, "type": "string" }, "resourceId": { "description": "The ID of the resource corresponding to this hop.", "readOnly": true, "type": "string" }, "nextHopIds": { "readOnly": true, "type": "array", "description": "List of next hop identifiers.", "items": { "type": "string" } }, "issues": { "readOnly": true, "type": "array", "description": "List of issues.", "items": { "$ref": "#/definitions/ConnectivityIssue" } } } }, "ConnectivityIssue": { "description": "Information about an issue encountered in the process of checking for connectivity.", "properties": { "origin": { "readOnly": true, "type": "string", "enum": [ "Local", "Inbound", "Outbound" ], "x-ms-enum": { "name": "Origin", "modelAsString": true }, "description": "The origin of the issue." }, "severity": { "readOnly": true, "type": "string", "enum": [ "Error", "Warning" ], "x-ms-enum": { "name": "Severity", "modelAsString": true }, "description": "The severity of the issue." }, "type": { "readOnly": true, "type": "string", "enum": [ "Unknown", "AgentStopped", "GuestFirewall", "DnsResolution", "SocketBind", "NetworkSecurityRule", "UserDefinedRoute", "PortThrottled", "Platform" ], "x-ms-enum": { "name": "IssueType", "modelAsString": true }, "description": "The type of issue." }, "context": { "readOnly": true, "type": "array", "description": "Provides additional context on the issue.", "items": { "$ref": "#/definitions/IssueContext" } } } }, "IssueContext": { "description": "A key-value pair that provides additional context on the issue.", "type": "object", "additionalProperties": { "type": "string" } }, "ProtocolConfiguration": { "description": "Configuration of the protocol.", "properties": { "HTTPConfiguration": { "$ref": "#/definitions/HTTPConfiguration", "description": "HTTP configuration of the connectivity check." } } }, "HTTPConfiguration": { "properties": { "method": { "type": "string", "description": "HTTP method.", "enum": [ "Get" ], "x-ms-enum": { "name": "HTTPMethod", "modelAsString": true } }, "headers": { "type": "array", "description": "List of HTTP headers.", "items": { "$ref": "#/definitions/HTTPHeader" } }, "validStatusCodes": { "type": "array", "items": { "type": "integer" }, "description": "Valid status codes." } }, "description": "HTTP configuration of the connectivity check." }, "HTTPHeader": { "properties": { "name": { "type": "string", "description": "The name in HTTP header." }, "value": { "type": "string", "description": "The value in HTTP header." } }, "description": "The HTTP header." }, "AzureReachabilityReportParameters": { "properties": { "providerLocation": { "$ref": "#/definitions/AzureReachabilityReportLocation", "description": "Parameters that define a geographic location." }, "providers": { "type": "array", "items": { "type": "string" }, "description": "List of Internet service providers." }, "azureLocations": { "type": "array", "items": { "type": "string" }, "description": "Optional Azure regions to scope the query to." }, "startTime": { "type": "string", "format": "date-time", "description": "The start time for the Azure reachability report." }, "endTime": { "type": "string", "format": "date-time", "description": "The end time for the Azure reachability report." } }, "required": [ "providerLocation", "startTime", "endTime" ], "description": "Geographic and time constraints for Azure reachability report." }, "AzureReachabilityReportLocation": { "properties": { "country": { "type": "string", "description": "The name of the country." }, "state": { "type": "string", "description": "The name of the state." }, "city": { "type": "string", "description": "The name of the city or town." } }, "required": [ "country" ], "description": "Parameters that define a geographic location." }, "AzureReachabilityReport": { "properties": { "aggregationLevel": { "type": "string", "description": "The aggregation level of Azure reachability report. Can be Country, State or City." }, "providerLocation": { "$ref": "#/definitions/AzureReachabilityReportLocation", "description": "Parameters that define a geographic location." }, "reachabilityReport": { "type": "array", "description": "List of Azure reachability report items.", "items": { "$ref": "#/definitions/AzureReachabilityReportItem" } } }, "required": [ "aggregationLevel", "providerLocation", "reachabilityReport" ], "description": "Azure reachability report details." }, "AzureReachabilityReportItem": { "properties": { "provider": { "type": "string", "description": "The Internet service provider." }, "azureLocation": { "type": "string", "description": "The Azure region." }, "latencies": { "type": "array", "description": "List of latency details for each of the time series.", "items": { "$ref": "#/definitions/AzureReachabilityReportLatencyInfo" } } }, "description": "Azure reachability report details for a given provider location." }, "AzureReachabilityReportLatencyInfo": { "properties": { "timeStamp": { "type": "string", "format": "date-time", "description": "The time stamp." }, "score": { "type": "integer", "description": "The relative latency score between 1 and 100, higher values indicating a faster connection.", "minimum": 1, "maximum": 100 } }, "description": "Details on latency for a time series." }, "AvailableProvidersListParameters": { "properties": { "azureLocations": { "type": "array", "items": { "type": "string" }, "description": "A list of Azure regions." }, "country": { "type": "string", "description": "The country for available providers list." }, "state": { "type": "string", "description": "The state for available providers list." }, "city": { "type": "string", "description": "The city or town for available providers list." } }, "description": "Constraints that determine the list of available Internet service providers." }, "AvailableProvidersList": { "properties": { "countries": { "type": "array", "description": "List of available countries.", "items": { "$ref": "#/definitions/AvailableProvidersListCountry" } } }, "required": [ "countries" ], "description": "List of available countries with details." }, "AvailableProvidersListCountry": { "properties": { "countryName": { "type": "string", "description": "The country name." }, "providers": { "type": "array", "items": { "type": "string" }, "description": "A list of Internet service providers." }, "states": { "type": "array", "description": "List of available states in the country.", "items": { "$ref": "#/definitions/AvailableProvidersListState" } } }, "description": "Country details." }, "AvailableProvidersListState": { "properties": { "stateName": { "type": "string", "description": "The state name." }, "providers": { "type": "array", "items": { "type": "string" }, "description": "A list of Internet service providers." }, "cities": { "type": "array", "description": "List of available cities or towns in the state.", "items": { "$ref": "#/definitions/AvailableProvidersListCity" } } }, "description": "State details." }, "AvailableProvidersListCity": { "properties": { "cityName": { "type": "string", "description": "The city or town name." }, "providers": { "type": "array", "items": { "type": "string" }, "description": "A list of Internet service providers." } }, "description": "City or town details." }, "NetworkConfigurationDiagnosticParameters": { "description": "Parameters to get network configuration diagnostic.", "required": [ "targetResourceId", "profiles" ], "properties": { "targetResourceId": { "type": "string", "description": "The ID of the target resource to perform network configuration diagnostic. Valid options are VM, NetworkInterface, VMSS/NetworkInterface and Application Gateway." }, "verbosityLevel": { "type": "string", "enum": [ "Normal", "Minimum", "Full" ], "x-ms-enum": { "name": "VerbosityLevel", "modelAsString": true }, "description": "Verbosity level." }, "profiles": { "type": "array", "description": "List of network configuration diagnostic profiles.", "items": { "$ref": "#/definitions/NetworkConfigurationDiagnosticProfile" } } } }, "NetworkConfigurationDiagnosticProfile": { "description": "Parameters to compare with network configuration.", "required": [ "direction", "protocol", "source", "destination", "destinationPort" ], "properties": { "direction": { "$ref": "#/definitions/Direction", "description": "The direction of the traffic." }, "protocol": { "type": "string", "description": "Protocol to be verified on. Accepted values are '*', TCP, UDP." }, "source": { "type": "string", "description": "Traffic source. Accepted values are '*', IP Address/CIDR, Service Tag." }, "destination": { "type": "string", "description": "Traffic destination. Accepted values are: '*', IP Address/CIDR, Service Tag." }, "destinationPort": { "type": "string", "description": "Traffic destination port. Accepted values are '*' and a single port in the range (0 - 65535)." } } }, "NetworkConfigurationDiagnosticResponse": { "description": "Results of network configuration diagnostic on the target resource.", "properties": { "results": { "readOnly": true, "type": "array", "description": "List of network configuration diagnostic results.", "items": { "$ref": "#/definitions/NetworkConfigurationDiagnosticResult" } } } }, "NetworkConfigurationDiagnosticResult": { "description": "Network configuration diagnostic result corresponded to provided traffic query.", "properties": { "profile": { "$ref": "#/definitions/NetworkConfigurationDiagnosticProfile", "description": "Network configuration diagnostic profile." }, "networkSecurityGroupResult": { "$ref": "#/definitions/NetworkSecurityGroupResult", "description": "Network security group result." } } }, "NetworkSecurityGroupResult": { "description": "Network configuration diagnostic result corresponded provided traffic query.", "properties": { "securityRuleAccessResult": { "$ref": "./networkSecurityGroup.json#/definitions/SecurityRuleAccess", "description": "The network traffic is allowed or denied." }, "evaluatedNetworkSecurityGroups": { "readOnly": true, "type": "array", "description": "List of results network security groups diagnostic.", "items": { "$ref": "#/definitions/EvaluatedNetworkSecurityGroup" } } } }, "EvaluatedNetworkSecurityGroup": { "description": "Results of network security group evaluation.", "properties": { "networkSecurityGroupId": { "type": "string", "description": "Network security group ID." }, "appliedTo": { "type": "string", "description": "Resource ID of nic or subnet to which network security group is applied." }, "matchedRule": { "$ref": "#/definitions/MatchedRule", "description": "Matched network security rule." }, "rulesEvaluationResult": { "readOnly": true, "type": "array", "description": "List of network security rules evaluation results.", "items": { "$ref": "#/definitions/NetworkSecurityRulesEvaluationResult" } } } }, "MatchedRule": { "description": "Matched rule.", "properties": { "ruleName": { "type": "string", "description": "Name of the matched network security rule." }, "action": { "type": "string", "description": "The network traffic is allowed or denied. Possible values are 'Allow' and 'Deny'." } } }, "NetworkSecurityRulesEvaluationResult": { "description": "Network security rules evaluation result.", "properties": { "name": { "type": "string", "description": "Name of the network security rule." }, "protocolMatched": { "type": "boolean", "description": "Value indicating whether protocol is matched." }, "sourceMatched": { "type": "boolean", "description": "Value indicating whether source is matched." }, "sourcePortMatched": { "type": "boolean", "description": "Value indicating whether source port is matched." }, "destinationMatched": { "type": "boolean", "description": "Value indicating whether destination is matched." }, "destinationPortMatched": { "type": "boolean", "description": "Value indicating whether destination port is matched." } } }, "Direction": { "type": "string", "description": "The direction of the traffic.", "enum": [ "Inbound", "Outbound" ], "x-ms-enum": { "name": "Direction", "modelAsString": true } }, "ConnectionMonitor": { "properties": { "location": { "type": "string", "description": "Connection monitor location." }, "tags": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Connection monitor tags." }, "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/ConnectionMonitorParameters", "description": "Properties of the connection monitor." } }, "required": [ "properties" ], "description": "Parameters that define the operation to create a connection monitor." }, "ConnectionMonitorParameters": { "properties": { "source": { "$ref": "#/definitions/ConnectionMonitorSource", "description": "Describes the source of connection monitor." }, "destination": { "$ref": "#/definitions/ConnectionMonitorDestination", "description": "Describes the destination of connection monitor." }, "autoStart": { "type": "boolean", "default": true, "description": "Determines if the connection monitor will start automatically once created." }, "monitoringIntervalInSeconds": { "type": "integer", "default": 60, "description": "Monitoring interval in seconds." }, "endpoints": { "type": "array", "description": "List of connection monitor endpoints.", "items": { "$ref": "#/definitions/ConnectionMonitorEndpoint" } }, "testConfigurations": { "type": "array", "description": "List of connection monitor test configurations.", "items": { "$ref": "#/definitions/ConnectionMonitorTestConfiguration" } }, "testGroups": { "type": "array", "description": "List of connection monitor test groups.", "items": { "$ref": "#/definitions/ConnectionMonitorTestGroup" } }, "outputs": { "type": "array", "description": "List of connection monitor outputs.", "items": { "$ref": "#/definitions/ConnectionMonitorOutput" } }, "notes": { "type": "string", "description": "Optional notes to be associated with the connection monitor." } }, "description": "Parameters that define the operation to create a connection monitor." }, "ConnectionMonitorSource": { "properties": { "resourceId": { "type": "string", "description": "The ID of the resource used as the source by connection monitor." }, "port": { "type": "integer", "description": "The source port used by connection monitor." } }, "required": [ "resourceId" ], "description": "Describes the source of connection monitor." }, "ConnectionMonitorDestination": { "properties": { "resourceId": { "type": "string", "description": "The ID of the resource used as the destination by connection monitor." }, "address": { "type": "string", "description": "Address of the connection monitor destination (IP or domain name)." }, "port": { "type": "integer", "description": "The destination port used by connection monitor." } }, "description": "Describes the destination of connection monitor." }, "ConnectionMonitorEndpoint": { "properties": { "name": { "type": "string", "description": "The name of the connection monitor endpoint." }, "resourceId": { "type": "string", "description": "Resource ID of the connection monitor endpoint." }, "address": { "type": "string", "description": "Address of the connection monitor endpoint (IP or domain name)." }, "filter": { "$ref": "#/definitions/ConnectionMonitorEndpointFilter", "description": "Filter for sub-items within the endpoint." } }, "required": [ "name" ], "description": "Describes the connection monitor endpoint." }, "ConnectionMonitorEndpointFilter": { "properties": { "type": { "type": "string", "enum": [ "Include" ], "x-ms-enum": { "name": "ConnectionMonitorEndpointFilterType", "modelAsString": true }, "description": "The behavior of the endpoint filter. Currently only 'Include' is supported." }, "items": { "type": "array", "description": "List of items in the filter.", "items": { "$ref": "#/definitions/ConnectionMonitorEndpointFilterItem" } } }, "description": "Describes the connection monitor endpoint filter." }, "ConnectionMonitorEndpointFilterItem": { "properties": { "type": { "type": "string", "enum": [ "AgentAddress" ], "x-ms-enum": { "name": "ConnectionMonitorEndpointFilterItemType", "modelAsString": true }, "description": "The type of item included in the filter. Currently only 'AgentAddress' is supported." }, "address": { "type": "string", "description": "The address of the filter item." } }, "description": "Describes the connection monitor endpoint filter item." }, "ConnectionMonitorTestGroup": { "properties": { "name": { "type": "string", "description": "The name of the connection monitor test group." }, "disable": { "type": "boolean", "description": "Value indicating whether test group is disabled." }, "testConfigurations": { "type": "array", "items": { "type": "string" }, "description": "List of test configuration names." }, "sources": { "type": "array", "items": { "type": "string" }, "description": "List of source endpoint names." }, "destinations": { "type": "array", "items": { "type": "string" }, "description": "List of destination endpoint names." } }, "required": [ "name", "testConfigurations", "sources", "destinations" ], "description": "Describes the connection monitor test group." }, "ConnectionMonitorTestConfiguration": { "properties": { "name": { "type": "string", "description": "The name of the connection monitor test configuration." }, "testFrequencySec": { "type": "integer", "description": "The frequency of test evaluation, in seconds." }, "protocol": { "type": "string", "enum": [ "Tcp", "Http", "Icmp" ], "x-ms-enum": { "name": "ConnectionMonitorTestConfigurationProtocol", "modelAsString": true }, "description": "The protocol to use in test evaluation." }, "preferredIPVersion": { "type": "string", "enum": [ "IPv4", "IPv6" ], "x-ms-enum": { "name": "PreferredIPVersion", "modelAsString": true }, "description": "The preferred IP version to use in test evaluation. The connection monitor may choose to use a different version depending on other parameters." }, "httpConfiguration": { "$ref": "#/definitions/ConnectionMonitorHttpConfiguration", "description": "The parameters used to perform test evaluation over HTTP." }, "tcpConfiguration": { "$ref": "#/definitions/ConnectionMonitorTcpConfiguration", "description": "The parameters used to perform test evaluation over TCP." }, "icmpConfiguration": { "$ref": "#/definitions/ConnectionMonitorIcmpConfiguration", "description": "The parameters used to perform test evaluation over ICMP." }, "successThreshold": { "$ref": "#/definitions/ConnectionMonitorSuccessThreshold", "description": "The threshold for declaring a test successful." } }, "required": [ "name", "protocol" ], "description": "Describes a connection monitor test configuration." }, "ConnectionMonitorHttpConfiguration": { "properties": { "port": { "type": "integer", "description": "The port to connect to." }, "method": { "type": "string", "description": "The HTTP method to use.", "enum": [ "Get", "Post" ], "x-ms-enum": { "name": "HTTPConfigurationMethod", "modelAsString": true } }, "path": { "type": "string", "description": "The path component of the URI. For instance, \"/dir1/dir2\"." }, "requestHeaders": { "type": "array", "description": "The HTTP headers to transmit with the request.", "items": { "$ref": "#/definitions/HTTPHeader" } }, "validStatusCodeRanges": { "type": "array", "items": { "type": "string" }, "description": "HTTP status codes to consider successful. For instance, \"2xx,301-304,418\"." }, "preferHTTPS": { "type": "boolean", "description": "Value indicating whether HTTPS is preferred over HTTP in cases where the choice is not explicit." } }, "description": "Describes the HTTP configuration." }, "ConnectionMonitorTcpConfiguration": { "properties": { "port": { "type": "integer", "description": "The port to connect to." }, "disableTraceRoute": { "type": "boolean", "description": "Value indicating whether path evaluation with trace route should be disabled." } }, "description": "Describes the TCP configuration." }, "ConnectionMonitorIcmpConfiguration": { "properties": { "disableTraceRoute": { "type": "boolean", "description": "Value indicating whether path evaluation with trace route should be disabled." } }, "description": "Describes the ICMP configuration." }, "ConnectionMonitorSuccessThreshold": { "properties": { "checksFailedPercent": { "type": "integer", "description": "The maximum percentage of failed checks permitted for a test to evaluate as successful." }, "roundTripTimeMs": { "type": "number", "description": "The maximum round-trip time in milliseconds permitted for a test to evaluate as successful." } }, "description": "Describes the threshold for declaring a test successful." }, "ConnectionMonitorOutput": { "properties": { "type": { "type": "string", "description": "Connection monitor output destination type. Currently, only \"Workspace\" is supported.", "enum": [ "Workspace" ], "x-ms-enum": { "name": "OutputType", "modelAsString": true } }, "workspaceSettings": { "$ref": "#/definitions/ConnectionMonitorWorkspaceSettings", "description": "Describes the settings for producing output into a log analytics workspace." } }, "description": "Describes a connection monitor output destination." }, "ConnectionMonitorWorkspaceSettings": { "properties": { "workspaceResourceId": { "type": "string", "description": "Log analytics workspace resource ID." } }, "description": "Describes the settings for producing output into a log analytics workspace." }, "ConnectionStateSnapshot": { "properties": { "connectionState": { "type": "string", "enum": [ "Reachable", "Unreachable", "Unknown" ], "x-ms-enum": { "name": "ConnectionState", "modelAsString": true }, "description": "The connection state." }, "startTime": { "type": "string", "format": "date-time", "description": "The start time of the connection snapshot." }, "endTime": { "type": "string", "format": "date-time", "description": "The end time of the connection snapshot." }, "evaluationState": { "type": "string", "enum": [ "NotStarted", "InProgress", "Completed" ], "x-ms-enum": { "name": "EvaluationState", "modelAsString": true }, "description": "Connectivity analysis evaluation state." }, "avgLatencyInMs": { "type": "integer", "description": "Average latency in ms." }, "minLatencyInMs": { "type": "integer", "description": "Minimum latency in ms." }, "maxLatencyInMs": { "type": "integer", "description": "Maximum latency in ms." }, "probesSent": { "type": "integer", "description": "The number of sent probes." }, "probesFailed": { "type": "integer", "description": "The number of failed probes." }, "hops": { "readOnly": true, "type": "array", "description": "List of hops between the source and the destination.", "items": { "$ref": "./networkWatcher.json#/definitions/ConnectivityHop" } } }, "description": "Connection state snapshot." }, "ConnectionMonitorListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/ConnectionMonitorResult" }, "description": "Information about connection monitors." } }, "description": "List of connection monitors." }, "ConnectionMonitorResult": { "x-ms-azure-resource": true, "properties": { "name": { "readOnly": true, "type": "string", "description": "Name of the connection monitor." }, "id": { "readOnly": true, "type": "string", "description": "ID of the connection monitor." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." }, "type": { "readOnly": true, "type": "string", "description": "Connection monitor type." }, "location": { "type": "string", "description": "Connection monitor location." }, "tags": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Connection monitor tags." }, "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/ConnectionMonitorResultProperties", "description": "Properties of the connection monitor result." } }, "description": "Information about the connection monitor." }, "ConnectionMonitorResultProperties": { "properties": { "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the connection monitor." }, "startTime": { "readOnly": true, "type": "string", "format": "date-time", "description": "The date and time when the connection monitor was started." }, "monitoringStatus": { "readOnly": true, "type": "string", "description": "The monitoring status of the connection monitor." }, "connectionMonitorType": { "readOnly": true, "type": "string", "enum": [ "MultiEndpoint", "SingleSourceDestination" ], "x-ms-enum": { "name": "ConnectionMonitorType", "modelAsString": true }, "description": "Type of connection monitor." } }, "allOf": [ { "$ref": "#/definitions/ConnectionMonitorParameters" } ], "description": "Describes the properties of a connection monitor." }, "ConnectionMonitorQueryResult": { "properties": { "sourceStatus": { "type": "string", "enum": [ "Unknown", "Active", "Inactive" ], "x-ms-enum": { "name": "ConnectionMonitorSourceStatus", "modelAsString": true }, "description": "Status of connection monitor source." }, "states": { "type": "array", "items": { "$ref": "#/definitions/ConnectionStateSnapshot" }, "description": "Information about connection states." } }, "description": "List of connection states snapshots." } } } spec-0.21.0/fixtures/azure/privateEndpoint.json000066400000000000000000000770361457312531500216140ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "title": "NetworkManagementClient", "description": "The Microsoft Azure Network management API provides a RESTful set of web services that interact with Microsoft Azure Networks service to manage your network resources. The API has entities that capture the relationship between an end user and the Microsoft Azure Networks service.", "version": "2020-04-01" }, "host": "management.azure.com", "schemes": [ "https" ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "security": [ { "azure_auth": [ "user_impersonation" ] } ], "securityDefinitions": { "azure_auth": { "type": "oauth2", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "flow": "implicit", "description": "Azure Active Directory OAuth2 Flow.", "scopes": { "user_impersonation": "impersonate your user account" } } }, "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}": { "delete": { "tags": [ "PrivateEndpoints" ], "operationId": "PrivateEndpoints_Delete", "description": "Deletes the specified private endpoint.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "privateEndpointName", "in": "path", "required": true, "type": "string", "description": "The name of the private endpoint." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "202": { "description": "Accepted and the operation will complete asynchronously." }, "204": { "description": "Delete successful." }, "200": { "description": "Delete successful." }, "default": { "description": "Error.", "schema": { "$ref": "./network.json#/definitions/Error" } } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" }, "x-ms-examples": { "Delete private endpoint": { "$ref": "./examples/PrivateEndpointDelete.json" } } }, "get": { "tags": [ "PrivateEndpoints" ], "operationId": "PrivateEndpoints_Get", "description": "Gets the specified private endpoint by resource group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "privateEndpointName", "in": "path", "required": true, "type": "string", "description": "The name of the private endpoint." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" }, { "name": "$expand", "in": "query", "required": false, "type": "string", "description": "Expands referenced resources." } ], "responses": { "200": { "description": "Request successful. The operation returns the resulting private endpoint resource.", "schema": { "$ref": "#/definitions/PrivateEndpoint" } }, "default": { "description": "Error.", "schema": { "$ref": "./network.json#/definitions/Error" } } }, "x-ms-examples": { "Get private endpoint": { "$ref": "./examples/PrivateEndpointGet.json" }, "Get private endpoint with manual approval connection": { "$ref": "./examples/PrivateEndpointGetForManualApproval.json" } } }, "put": { "tags": [ "PrivateEndpoints" ], "operationId": "PrivateEndpoints_CreateOrUpdate", "description": "Creates or updates an private endpoint in the specified resource group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "privateEndpointName", "in": "path", "required": true, "type": "string", "description": "The name of the private endpoint." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/PrivateEndpoint" }, "description": "Parameters supplied to the create or update private endpoint operation." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Update successful. The operation returns the resulting private endpoint resource.", "schema": { "$ref": "#/definitions/PrivateEndpoint" } }, "201": { "description": "Create successful. The operation returns the resulting private endpoint resource.", "schema": { "$ref": "#/definitions/PrivateEndpoint" } }, "default": { "description": "Error.", "schema": { "$ref": "./network.json#/definitions/Error" } } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "azure-async-operation" }, "x-ms-examples": { "Create private endpoint": { "$ref": "./examples/PrivateEndpointCreate.json" }, "Create private endpoint with manual approval connection": { "$ref": "./examples/PrivateEndpointCreateForManualApproval.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints": { "get": { "tags": [ "PrivateEndpoints" ], "operationId": "PrivateEndpoints_List", "description": "Gets all private endpoints in a resource group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of private endpoint resources.", "schema": { "$ref": "#/definitions/PrivateEndpointListResult" } }, "default": { "description": "Error.", "schema": { "$ref": "./network.json#/definitions/Error" } } }, "x-ms-examples": { "List private endpoints in resource group": { "$ref": "./examples/PrivateEndpointList.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Network/privateEndpoints": { "get": { "tags": [ "PrivateEndpoints" ], "operationId": "PrivateEndpoints_ListBySubscription", "description": "Gets all private endpoints in a subscription.", "parameters": [ { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of private endpoint resources.", "schema": { "$ref": "#/definitions/PrivateEndpointListResult" } }, "default": { "description": "Error.", "schema": { "$ref": "./network.json#/definitions/Error" } } }, "x-ms-examples": { "List all private endpoints": { "$ref": "./examples/PrivateEndpointListAll.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availablePrivateEndpointTypes": { "get": { "operationId": "AvailablePrivateEndpointTypes_List", "description": "Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region.", "parameters": [ { "name": "location", "in": "path", "required": true, "type": "string", "description": "The location of the domain name." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region.", "schema": { "$ref": "#/definitions/AvailablePrivateEndpointTypesResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Get available PrivateEndpoint types": { "$ref": "./examples/AvailablePrivateEndpointTypesGet.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availablePrivateEndpointTypes": { "get": { "operationId": "AvailablePrivateEndpointTypes_ListByResourceGroup", "description": "Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region.", "parameters": [ { "name": "location", "in": "path", "required": true, "type": "string", "description": "The location of the domain name." }, { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" }, { "$ref": "./network.json#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "Request successful. Returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region.", "schema": { "$ref": "#/definitions/AvailablePrivateEndpointTypesResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Get available PrivateEndpoint types in the resource group": { "$ref": "./examples/AvailablePrivateEndpointTypesResourceGroupGet.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}": { "delete": { "tags": [ "PrivateDnsZoneGroups" ], "operationId": "PrivateDnsZoneGroups_Delete", "description": "Deletes the specified private dns zone group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "privateEndpointName", "in": "path", "required": true, "type": "string", "description": "The name of the private endpoint." }, { "name": "privateDnsZoneGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the private dns zone group." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "202": { "description": "Accepted and the operation will complete asynchronously." }, "204": { "description": "Request successful. Resource does not exist." }, "200": { "description": "Delete successful." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" }, "x-ms-examples": { "Delete private dns zone group": { "$ref": "./examples/PrivateEndpointDnsZoneGroupDelete.json" } } }, "get": { "tags": [ "PrivateDnsZoneGroups" ], "operationId": "PrivateDnsZoneGroups_Get", "description": "Gets the private dns zone group resource by specified private dns zone group name.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "privateEndpointName", "in": "path", "required": true, "type": "string", "description": "The name of the private endpoint." }, { "name": "privateDnsZoneGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the private dns zone group." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns the resulting privateDnsZoneGroup resource.", "schema": { "$ref": "#/definitions/PrivateDnsZoneGroup" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Get private dns zone group": { "$ref": "./examples/PrivateEndpointDnsZoneGroupGet.json" } } }, "put": { "tags": [ "PrivateDnsZoneGroups" ], "operationId": "PrivateDnsZoneGroups_CreateOrUpdate", "description": "Creates or updates a private dns zone group in the specified private endpoint.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "privateEndpointName", "in": "path", "required": true, "type": "string", "description": "The name of the private endpoint." }, { "name": "privateDnsZoneGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the private dns zone group." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/PrivateDnsZoneGroup" }, "description": "Parameters supplied to the create or update private dns zone group operation." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Update successful. The operation returns the resulting PrivateDnsZoneGroup resource.", "schema": { "$ref": "#/definitions/PrivateDnsZoneGroup" } }, "201": { "description": "Create successful. The operation returns the resulting PrivateDnsZoneGroup resource.", "schema": { "$ref": "#/definitions/PrivateDnsZoneGroup" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "azure-async-operation" }, "x-ms-examples": { "Create private dns zone group": { "$ref": "./examples/PrivateEndpointDnsZoneGroupCreate.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups": { "get": { "tags": [ "PrivateDnsZoneGroups" ], "operationId": "PrivateDnsZoneGroups_List", "description": "Gets all private dns zone groups in a private endpoint.", "parameters": [ { "name": "privateEndpointName", "in": "path", "required": true, "type": "string", "description": "The name of the private endpoint." }, { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of private dns zone group resources.", "schema": { "$ref": "#/definitions/PrivateDnsZoneGroupListResult" } }, "default": { "description": "Error.", "schema": { "$ref": "./network.json#/definitions/Error" } } }, "x-ms-examples": { "List private endpoints in resource group": { "$ref": "./examples/PrivateEndpointDnsZoneGroupList.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } } }, "definitions": { "PrivateEndpoint": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/PrivateEndpointProperties", "description": "Properties of the private endpoint." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." } }, "allOf": [ { "$ref": "./network.json#/definitions/Resource" } ], "description": "Private endpoint resource." }, "PrivateEndpointProperties": { "properties": { "subnet": { "$ref": "./virtualNetwork.json#/definitions/Subnet", "description": "The ID of the subnet from which the private IP will be allocated." }, "networkInterfaces": { "type": "array", "readOnly": true, "items": { "$ref": "./networkInterface.json#/definitions/NetworkInterface" }, "description": "An array of references to the network interfaces created for this private endpoint." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the private endpoint resource." }, "privateLinkServiceConnections": { "type": "array", "items": { "$ref": "#/definitions/PrivateLinkServiceConnection" }, "description": "A grouping of information about the connection to the remote resource." }, "manualPrivateLinkServiceConnections": { "type": "array", "items": { "$ref": "#/definitions/PrivateLinkServiceConnection" }, "description": "A grouping of information about the connection to the remote resource. Used when the network admin does not have access to approve connections to the remote resource." }, "customDnsConfigs": { "type": "array", "items": { "$ref": "#/definitions/CustomDnsConfigPropertiesFormat" }, "description": "An array of custom dns configurations." } }, "description": "Properties of the private endpoint." }, "CustomDnsConfigPropertiesFormat": { "properties": { "fqdn": { "type": "string", "description": "Fqdn that resolves to private endpoint ip address." }, "ipAddresses": { "type": "array", "items": { "type": "string" }, "description": "A list of private ip addresses of the private endpoint." } }, "description": "Contains custom Dns resolution configuration from customer." }, "PrivateLinkServiceConnection": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/PrivateLinkServiceConnectionProperties", "description": "Properties of the private link service connection." }, "name": { "type": "string", "description": "The name of the resource that is unique within a resource group. This name can be used to access the resource." }, "type": { "readOnly": true, "type": "string", "description": "The resource type." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "PrivateLinkServiceConnection resource." }, "PrivateLinkServiceConnectionProperties": { "properties": { "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the private link service connection resource." }, "privateLinkServiceId": { "type": "string", "description": "The resource id of private link service." }, "groupIds": { "type": "array", "items": { "type": "string" }, "description": "The ID(s) of the group(s) obtained from the remote resource that this private endpoint should connect to." }, "requestMessage": { "type": "string", "description": "A message passed to the owner of the remote resource with this connection request. Restricted to 140 chars." }, "privateLinkServiceConnectionState": { "$ref": "./privateLinkService.json#/definitions/PrivateLinkServiceConnectionState", "description": "A collection of read-only information about the state of the connection to the remote resource." } }, "description": "Properties of the PrivateLinkServiceConnection." }, "PrivateEndpointListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/PrivateEndpoint" }, "description": "A list of private endpoint resources in a resource group." }, "nextLink": { "type": "string", "description": "The URL to get the next set of results.", "readOnly": true } }, "description": "Response for the ListPrivateEndpoints API service call." }, "PrivateDnsZoneGroupListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/PrivateDnsZoneGroup" }, "description": "A list of private dns zone group resources in a private endpoint." }, "nextLink": { "type": "string", "description": "The URL to get the next set of results.", "readOnly": true } }, "description": "Response for the ListPrivateDnsZoneGroups API service call." }, "AvailablePrivateEndpointTypesResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/AvailablePrivateEndpointType" }, "description": "An array of available privateEndpoint type." }, "nextLink": { "readOnly": true, "type": "string", "description": "The URL to get the next set of results." } }, "description": "An array of available PrivateEndpoint types." }, "AvailablePrivateEndpointType": { "properties": { "name": { "type": "string", "description": "The name of the service and resource." }, "id": { "type": "string", "description": "A unique identifier of the AvailablePrivateEndpoint Type resource." }, "type": { "type": "string", "description": "Resource type." }, "resourceName": { "type": "string", "description": "The name of the service and resource." } }, "description": "The information of an AvailablePrivateEndpointType." }, "PrivateDnsZoneGroup": { "properties": { "name": { "type": "string", "description": "Name of the resource that is unique within a resource group. This name can be used to access the resource." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." }, "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/PrivateDnsZoneGroupPropertiesFormat", "description": "Properties of the private dns zone group." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "Private dns zone group resource." }, "PrivateDnsZoneGroupPropertiesFormat": { "properties": { "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the private dns zone group resource." }, "privateDnsZoneConfigs": { "type": "array", "items": { "$ref": "#/definitions/PrivateDnsZoneConfig" }, "description": "A collection of private dns zone configurations of the private dns zone group." } }, "description": "Properties of the private dns zone group." }, "PrivateDnsZoneConfig": { "properties": { "name": { "type": "string", "description": "Name of the resource that is unique within a resource group. This name can be used to access the resource." }, "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/PrivateDnsZonePropertiesFormat", "description": "Properties of the private dns zone configuration." } }, "description": "PrivateDnsZoneConfig resource." }, "PrivateDnsZonePropertiesFormat": { "properties": { "privateDnsZoneId": { "type": "string", "description": "The resource id of the private dns zone." }, "recordSets": { "type": "array", "readOnly": true, "items": { "$ref": "#/definitions/RecordSet" }, "description": "A collection of information regarding a recordSet, holding information to identify private resources." } }, "description": "Properties of the private dns zone configuration resource." }, "RecordSet": { "properties": { "recordType": { "type": "string", "description": "Resource record type." }, "recordSetName": { "type": "string", "description": "Recordset name." }, "fqdn": { "type": "string", "description": "Fqdn that resolves to private endpoint ip address." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the recordset." }, "ttl": { "type": "integer", "description": "Recordset time to live." }, "ipAddresses": { "type": "array", "items": { "type": "string" }, "description": "The private ip address of the private endpoint." } }, "description": "A collective group of information about the record set information." } } } spec-0.21.0/fixtures/azure/privateLinkService.json000066400000000000000000001077301457312531500222450ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "title": "NetworkManagementClient", "description": "The Microsoft Azure Network management API provides a RESTful set of web services that interact with Microsoft Azure Networks service to manage your network resources. The API has entities that capture the relationship between an end user and the Microsoft Azure Networks service.", "version": "2020-04-01" }, "host": "management.azure.com", "schemes": [ "https" ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "security": [ { "azure_auth": [ "user_impersonation" ] } ], "securityDefinitions": { "azure_auth": { "type": "oauth2", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "flow": "implicit", "description": "Azure Active Directory OAuth2 Flow.", "scopes": { "user_impersonation": "impersonate your user account" } } }, "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}": { "delete": { "tags": [ "PrivateLinkServices" ], "operationId": "PrivateLinkServices_Delete", "description": "Deletes the specified private link service.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "serviceName", "in": "path", "required": true, "type": "string", "description": "The name of the private link service." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "202": { "description": "Accepted and the operation will complete asynchronously." }, "204": { "description": "Delete successful." }, "200": { "description": "Delete successful." }, "default": { "description": "Error.", "schema": { "$ref": "./network.json#/definitions/Error" } } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" }, "x-ms-examples": { "Delete private link service": { "$ref": "./examples/PrivateLinkServiceDelete.json" } } }, "get": { "tags": [ "PrivateLinkServices" ], "operationId": "PrivateLinkServices_Get", "description": "Gets the specified private link service by resource group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "serviceName", "in": "path", "required": true, "type": "string", "description": "The name of the private link service." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" }, { "name": "$expand", "in": "query", "required": false, "type": "string", "description": "Expands referenced resources." } ], "responses": { "200": { "description": "Request successful. The operation returns the resulting PrivateLinkService resource.", "schema": { "$ref": "#/definitions/PrivateLinkService" } }, "default": { "description": "Error.", "schema": { "$ref": "./network.json#/definitions/Error" } } }, "x-ms-examples": { "Get private link service": { "$ref": "./examples/PrivateLinkServiceGet.json" } } }, "put": { "tags": [ "PrivateLinkService" ], "operationId": "PrivateLinkServices_CreateOrUpdate", "description": "Creates or updates an private link service in the specified resource group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "serviceName", "in": "path", "required": true, "type": "string", "description": "The name of the private link service." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/PrivateLinkService" }, "description": "Parameters supplied to the create or update private link service operation." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Update successful. The operation returns the resulting privateLinkService resource.", "schema": { "$ref": "#/definitions/PrivateLinkService" } }, "201": { "description": "Create successful. The operation returns the resulting privateLinkService resource.", "schema": { "$ref": "#/definitions/PrivateLinkService" } }, "default": { "description": "Error.", "schema": { "$ref": "./network.json#/definitions/Error" } } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "azure-async-operation" }, "x-ms-examples": { "Create private link service": { "$ref": "./examples/PrivateLinkServiceCreate.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices": { "get": { "tags": [ "PrivateLinkServices" ], "operationId": "PrivateLinkServices_List", "description": "Gets all private link services in a resource group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of privateLinkService resources.", "schema": { "$ref": "#/definitions/PrivateLinkServiceListResult" } }, "default": { "description": "Error.", "schema": { "$ref": "./network.json#/definitions/Error" } } }, "x-ms-examples": { "List private link service in resource group": { "$ref": "./examples/PrivateLinkServiceList.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Network/privateLinkServices": { "get": { "tags": [ "PrivateLinkServices" ], "operationId": "PrivateLinkServices_ListBySubscription", "description": "Gets all private link service in a subscription.", "parameters": [ { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of PrivateLinkService resources.", "schema": { "$ref": "#/definitions/PrivateLinkServiceListResult" } }, "default": { "description": "Error.", "schema": { "$ref": "./network.json#/definitions/Error" } } }, "x-ms-examples": { "List all private list service": { "$ref": "./examples/PrivateLinkServiceListAll.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}": { "get": { "tags": [ "PrivateLinkServices" ], "operationId": "PrivateLinkServices_GetPrivateEndpointConnection", "description": "Get the specific private end point connection by specific private link service in the resource group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "serviceName", "in": "path", "required": true, "type": "string", "description": "The name of the private link service." }, { "name": "peConnectionName", "in": "path", "required": true, "type": "string", "description": "The name of the private end point connection." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" }, { "name": "$expand", "in": "query", "required": false, "type": "string", "description": "Expands referenced resources." } ], "responses": { "200": { "description": "Request successful. The operation returns the resulting private end point connection resource.", "schema": { "$ref": "#/definitions/PrivateEndpointConnection" } }, "default": { "description": "Error.", "schema": { "$ref": "./network.json#/definitions/Error" } } }, "x-ms-examples": { "Get private end point connection": { "$ref": "./examples/PrivateLinkServiceGetPrivateEndpointConnection.json" } } }, "put": { "tags": [ "PrivateLinkServices" ], "operationId": "PrivateLinkServices_UpdatePrivateEndpointConnection", "description": "Approve or reject private end point connection for a private link service in a subscription.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "serviceName", "in": "path", "required": true, "type": "string", "description": "The name of the private link service." }, { "name": "peConnectionName", "in": "path", "required": true, "type": "string", "description": "The name of the private end point connection." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/PrivateEndpointConnection" }, "description": "Parameters supplied to approve or reject the private end point connection." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Update successful. The operation returns the resulting PrivateEndpointConnection resource.", "schema": { "$ref": "#/definitions/PrivateEndpointConnection" } }, "default": { "description": "Error.", "schema": { "$ref": "./network.json#/definitions/Error" } } }, "x-ms-examples": { "approve or reject private end point connection for a private link service": { "$ref": "./examples/PrivateLinkServiceUpdatePrivateEndpointConnection.json" } } }, "delete": { "tags": [ "PrivateLinkServices" ], "operationId": "PrivateLinkServices_DeletePrivateEndpointConnection", "description": "Delete private end point connection for a private link service in a subscription.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "serviceName", "in": "path", "required": true, "type": "string", "description": "The name of the private link service." }, { "name": "peConnectionName", "in": "path", "required": true, "type": "string", "description": "The name of the private end point connection." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "202": { "description": "Accepted and the operation will complete asynchronously." }, "204": { "description": "Delete successful." }, "200": { "description": "Delete successful." }, "default": { "description": "Error.", "schema": { "$ref": "./network.json#/definitions/Error" } } }, "x-ms-examples": { "delete private end point connection for a private link service": { "$ref": "./examples/PrivateLinkServiceDeletePrivateEndpointConnection.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections": { "get": { "tags": [ "PrivateLinkServices" ], "operationId": "PrivateLinkServices_ListPrivateEndpointConnections", "description": "Gets all private end point connections for a specific private link service.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "serviceName", "in": "path", "required": true, "type": "string", "description": "The name of the private link service." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of private end point connection resources.", "schema": { "$ref": "#/definitions/PrivateEndpointConnectionListResult" } }, "default": { "description": "Error.", "schema": { "$ref": "./network.json#/definitions/Error" } } }, "x-ms-examples": { "List private link service in resource group": { "$ref": "./examples/PrivateLinkServiceListPrivateEndpointConnection.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility": { "post": { "tags": [ "PrivateLinkServices" ], "operationId": "PrivateLinkServices_CheckPrivateLinkServiceVisibility", "description": "Checks whether the subscription is visible to private link service.", "parameters": [ { "name": "location", "in": "path", "required": true, "type": "string", "description": "The location of the domain name." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/CheckPrivateLinkServiceVisibilityRequest" }, "description": "The request body of CheckPrivateLinkService API call." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. Returns whether the subscription is visible to private link service.", "schema": { "$ref": "#/definitions/PrivateLinkServiceVisibility" } }, "202": { "description": "Accepted and the operation will complete asynchronously." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" }, "x-ms-examples": { "Check private link service visibility": { "$ref": "./examples/CheckPrivateLinkServiceVisibility.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility": { "post": { "tags": [ "PrivateLinkServices" ], "operationId": "PrivateLinkServices_CheckPrivateLinkServiceVisibilityByResourceGroup", "description": "Checks whether the subscription is visible to private link service in the specified resource group.", "parameters": [ { "name": "location", "in": "path", "required": true, "type": "string", "description": "The location of the domain name." }, { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/CheckPrivateLinkServiceVisibilityRequest" }, "description": "The request body of CheckPrivateLinkService API call." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. Returns whether the subscription is visible to private link service.", "schema": { "$ref": "#/definitions/PrivateLinkServiceVisibility" } }, "202": { "description": "Accepted and the operation will complete asynchronously." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" }, "x-ms-examples": { "Check private link service visibility": { "$ref": "./examples/CheckPrivateLinkServiceVisibilityByResourceGroup.json" } } } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/autoApprovedPrivateLinkServices": { "get": { "tags": [ "PrivateLinkServices" ], "operationId": "PrivateLinkServices_ListAutoApprovedPrivateLinkServices", "description": "Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region.", "parameters": [ { "name": "location", "in": "path", "required": true, "type": "string", "description": "The location of the domain name." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region.", "schema": { "$ref": "#/definitions/AutoApprovedPrivateLinkServicesResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Get list of private link service id that can be linked to a private end point with auto approved": { "$ref": "./examples/AutoApprovedPrivateLinkServicesGet.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/autoApprovedPrivateLinkServices": { "get": { "tags": [ "PrivateLinkServices" ], "operationId": "PrivateLinkServices_ListAutoApprovedPrivateLinkServicesByResourceGroup", "description": "Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region.", "parameters": [ { "name": "location", "in": "path", "required": true, "type": "string", "description": "The location of the domain name." }, { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. Returns all of the private link service ids that can be linked to a Private Endpoint with auto approved in this subscription in this region.", "schema": { "$ref": "#/definitions/AutoApprovedPrivateLinkServicesResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Get list of private link service id that can be linked to a private end point with auto approved": { "$ref": "./examples/AutoApprovedPrivateLinkServicesResourceGroupGet.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } } }, "definitions": { "PrivateLinkService": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/PrivateLinkServiceProperties", "description": "Properties of the private link service." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." } }, "allOf": [ { "$ref": "./network.json#/definitions/Resource" } ], "description": "Private link service resource." }, "PrivateLinkServiceProperties": { "properties": { "loadBalancerFrontendIpConfigurations": { "type": "array", "items": { "$ref": "./loadBalancer.json#/definitions/FrontendIPConfiguration" }, "description": "An array of references to the load balancer IP configurations." }, "ipConfigurations": { "type": "array", "items": { "$ref": "#/definitions/PrivateLinkServiceIpConfiguration" }, "description": "An array of private link service IP configurations." }, "networkInterfaces": { "type": "array", "readOnly": true, "items": { "$ref": "./networkInterface.json#/definitions/NetworkInterface" }, "description": "An array of references to the network interfaces created for this private link service." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the private link service resource." }, "privateEndpointConnections": { "readOnly": true, "type": "array", "items": { "$ref": "#/definitions/PrivateEndpointConnection" }, "description": "An array of list about connections to the private endpoint." }, "visibility": { "allOf": [ { "$ref": "#/definitions/ResourceSet" } ], "description": "The visibility list of the private link service." }, "autoApproval": { "allOf": [ { "$ref": "#/definitions/ResourceSet" } ], "description": "The auto-approval list of the private link service." }, "fqdns": { "type": "array", "items": { "type": "string" }, "description": "The list of Fqdn." }, "alias": { "readOnly": true, "type": "string", "description": "The alias of the private link service." }, "enableProxyProtocol": { "type": "boolean", "description": "Whether the private link service is enabled for proxy protocol or not." } }, "description": "Properties of the private link service." }, "ResourceSet": { "properties": { "subscriptions": { "type": "array", "items": { "type": "string" }, "description": "The list of subscriptions." } }, "description": "The base resource set for visibility and auto-approval." }, "PrivateLinkServiceIpConfiguration": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/PrivateLinkServiceIpConfigurationProperties", "description": "Properties of the private link service ip configuration." }, "name": { "type": "string", "description": "The name of private link service ip configuration." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." }, "type": { "readOnly": true, "type": "string", "description": "The resource type." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "The private link service ip configuration." }, "PrivateLinkServiceIpConfigurationProperties": { "properties": { "privateIPAddress": { "type": "string", "description": "The private IP address of the IP configuration." }, "privateIPAllocationMethod": { "$ref": "./network.json#/definitions/IPAllocationMethod", "description": "The private IP address allocation method." }, "subnet": { "$ref": "./virtualNetwork.json#/definitions/Subnet", "description": "The reference to the subnet resource." }, "primary": { "type": "boolean", "description": "Whether the ip configuration is primary or not." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the private link service IP configuration resource." }, "privateIPAddressVersion": { "$ref": "./network.json#/definitions/IPVersion", "description": "Whether the specific IP configuration is IPv4 or IPv6. Default is IPv4." } }, "description": "Properties of private link service IP configuration." }, "PrivateEndpointConnection": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/PrivateEndpointConnectionProperties", "description": "Properties of the private end point connection." }, "name": { "type": "string", "description": "The name of the resource that is unique within a resource group. This name can be used to access the resource." }, "type": { "readOnly": true, "type": "string", "description": "The resource type." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "PrivateEndpointConnection resource." }, "PrivateEndpointConnectionProperties": { "properties": { "privateEndpoint": { "readOnly": true, "$ref": "./privateEndpoint.json#/definitions/PrivateEndpoint", "description": "The resource of private end point." }, "privateLinkServiceConnectionState": { "$ref": "#/definitions/PrivateLinkServiceConnectionState", "description": "A collection of information about the state of the connection between service consumer and provider." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the private endpoint connection resource." }, "linkIdentifier": { "readOnly": true, "type": "string", "description": "The consumer link id." } }, "description": "Properties of the PrivateEndpointConnectProperties." }, "PrivateLinkServiceConnectionState": { "properties": { "status": { "type": "string", "description": "Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service." }, "description": { "type": "string", "description": "The reason for approval/rejection of the connection." }, "actionsRequired": { "type": "string", "description": "A message indicating if changes on the service provider require any updates on the consumer." } }, "description": "A collection of information about the state of the connection between service consumer and provider." }, "PrivateLinkServiceListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/PrivateLinkService" }, "description": "A list of PrivateLinkService resources in a resource group." }, "nextLink": { "type": "string", "description": "The URL to get the next set of results.", "readOnly": true } }, "description": "Response for the ListPrivateLinkService API service call." }, "PrivateEndpointConnectionListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/PrivateEndpointConnection" }, "description": "A list of PrivateEndpointConnection resources for a specific private link service." }, "nextLink": { "type": "string", "description": "The URL to get the next set of results.", "readOnly": true } }, "description": "Response for the ListPrivateEndpointConnection API service call." }, "CheckPrivateLinkServiceVisibilityRequest": { "properties": { "privateLinkServiceAlias": { "type": "string", "description": "The alias of the private link service." } }, "description": "Request body of the CheckPrivateLinkServiceVisibility API service call." }, "PrivateLinkServiceVisibility": { "properties": { "visible": { "type": "boolean", "description": "Private Link Service Visibility (True/False)." } }, "description": "Response for the CheckPrivateLinkServiceVisibility API service call." }, "AutoApprovedPrivateLinkServicesResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/AutoApprovedPrivateLinkService" }, "description": "An array of auto approved private link service." }, "nextLink": { "readOnly": true, "type": "string", "description": "The URL to get the next set of results." } }, "description": "An array of private link service id that can be linked to a private end point with auto approved." }, "AutoApprovedPrivateLinkService": { "properties": { "privateLinkService": { "type": "string", "description": "The id of the private link service resource." } }, "description": "The information of an AutoApprovedPrivateLinkService." } } } spec-0.21.0/fixtures/azure/publicIpAddress.json000066400000000000000000000436121457312531500215070ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "title": "NetworkManagementClient", "description": "The Microsoft Azure Network management API provides a RESTful set of web services that interact with Microsoft Azure Networks service to manage your network resources. The API has entities that capture the relationship between an end user and the Microsoft Azure Networks service.", "version": "2020-04-01" }, "host": "management.azure.com", "schemes": [ "https" ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "security": [ { "azure_auth": [ "user_impersonation" ] } ], "securityDefinitions": { "azure_auth": { "type": "oauth2", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "flow": "implicit", "description": "Azure Active Directory OAuth2 Flow.", "scopes": { "user_impersonation": "impersonate your user account" } } }, "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}": { "delete": { "tags": [ "PublicIPAddresses" ], "operationId": "PublicIPAddresses_Delete", "description": "Deletes the specified public IP address.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "publicIpAddressName", "in": "path", "required": true, "type": "string", "description": "The name of the subnet." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "204": { "description": "Request successful. Resource does not exist." }, "202": { "description": "Accepted and the operation will complete asynchronously." }, "200": { "description": "Delete successful." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Delete public IP address": { "$ref": "./examples/PublicIpAddressDelete.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } }, "get": { "tags": [ "PublicIPAddresses" ], "operationId": "PublicIPAddresses_Get", "description": "Gets the specified public IP address in a specified resource group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "publicIpAddressName", "in": "path", "required": true, "type": "string", "description": "The name of the subnet." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" }, { "name": "$expand", "in": "query", "required": false, "type": "string", "description": "Expands referenced resources." } ], "responses": { "200": { "description": "Request successful. The operation returns the resulting PublicIPAddress resource.", "schema": { "$ref": "#/definitions/PublicIPAddress" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Get public IP address": { "$ref": "./examples/PublicIpAddressGet.json" } } }, "put": { "tags": [ "PublicIPAddresses" ], "operationId": "PublicIPAddresses_CreateOrUpdate", "description": "Creates or updates a static or dynamic public IP address.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "publicIpAddressName", "in": "path", "required": true, "type": "string", "description": "The name of the public IP address." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/PublicIPAddress" }, "description": "Parameters supplied to the create or update public IP address operation." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "201": { "description": "Create successful. The operation returns the resulting PublicIPAddress resource.", "schema": { "$ref": "#/definitions/PublicIPAddress" } }, "200": { "description": "Update successful. The operation returns the resulting PublicIPAddress resource.", "schema": { "$ref": "#/definitions/PublicIPAddress" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Create public IP address defaults": { "$ref": "./examples/PublicIpAddressCreateDefaults.json" }, "Create public IP address allocation method": { "$ref": "./examples/PublicIpAddressCreateCustomizedValues.json" }, "Create public IP address DNS": { "$ref": "./examples/PublicIpAddressCreateDns.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "azure-async-operation" } }, "patch": { "tags": [ "PublicIPAddresses" ], "operationId": "PublicIPAddresses_UpdateTags", "description": "Updates public IP address tags.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "publicIpAddressName", "in": "path", "required": true, "type": "string", "description": "The name of the public IP address." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "./network.json#/definitions/TagsObject" }, "description": "Parameters supplied to update public IP address tags." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Update successful. The operation returns the resulting PublicIPAddress resource.", "schema": { "$ref": "#/definitions/PublicIPAddress" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Update public IP address tags": { "$ref": "./examples/PublicIpAddressUpdateTags.json" } } } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses": { "get": { "tags": [ "PublicIPAddresses" ], "operationId": "PublicIPAddresses_ListAll", "description": "Gets all the public IP addresses in a subscription.", "parameters": [ { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of PublicIPAddress resources.", "schema": { "$ref": "#/definitions/PublicIPAddressListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "List all public IP addresses": { "$ref": "./examples/PublicIpAddressListAll.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses": { "get": { "tags": [ "PublicIPAddresses" ], "operationId": "PublicIPAddresses_List", "description": "Gets all public IP addresses in a resource group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of PublicIPAddress resources.", "schema": { "$ref": "#/definitions/PublicIPAddressListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "List resource group public IP addresses": { "$ref": "./examples/PublicIpAddressList.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } } }, "definitions": { "PublicIPAddressSku": { "properties": { "name": { "type": "string", "description": "Name of a public IP address SKU.", "enum": [ "Basic", "Standard" ], "x-ms-enum": { "name": "PublicIPAddressSkuName", "modelAsString": true } } }, "description": "SKU of a public IP address." }, "PublicIPAddressPropertiesFormat": { "properties": { "publicIPAllocationMethod": { "$ref": "./network.json#/definitions/IPAllocationMethod", "description": "The public IP address allocation method." }, "publicIPAddressVersion": { "$ref": "./network.json#/definitions/IPVersion", "description": "The public IP address version." }, "ipConfiguration": { "readOnly": true, "$ref": "./networkInterface.json#/definitions/IPConfiguration", "description": "The IP configuration associated with the public IP address." }, "dnsSettings": { "$ref": "#/definitions/PublicIPAddressDnsSettings", "description": "The FQDN of the DNS record associated with the public IP address." }, "ddosSettings": { "$ref": "#/definitions/DdosSettings", "description": "The DDoS protection custom policy associated with the public IP address." }, "ipTags": { "type": "array", "items": { "$ref": "#/definitions/IpTag" }, "description": "The list of tags associated with the public IP address." }, "ipAddress": { "type": "string", "description": "The IP address associated with the public IP address resource." }, "publicIPPrefix": { "$ref": "./network.json#/definitions/SubResource", "description": "The Public IP Prefix this Public IP Address should be allocated from." }, "idleTimeoutInMinutes": { "type": "integer", "format": "int32", "description": "The idle timeout of the public IP address." }, "resourceGuid": { "readOnly": true, "type": "string", "description": "The resource GUID property of the public IP address resource." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the public IP address resource." } }, "description": "Public IP address properties." }, "PublicIPAddress": { "properties": { "sku": { "$ref": "#/definitions/PublicIPAddressSku", "description": "The public IP address SKU." }, "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/PublicIPAddressPropertiesFormat", "description": "Public IP address properties." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." }, "zones": { "type": "array", "items": { "type": "string" }, "description": "A list of availability zones denoting the IP allocated for the resource needs to come from." } }, "allOf": [ { "$ref": "./network.json#/definitions/Resource" } ], "description": "Public IP address resource." }, "PublicIPAddressListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/PublicIPAddress" }, "description": "A list of public IP addresses that exists in a resource group." }, "nextLink": { "type": "string", "description": "The URL to get the next set of results." } }, "description": "Response for ListPublicIpAddresses API service call." }, "PublicIPAddressDnsSettings": { "properties": { "domainNameLabel": { "type": "string", "description": "The domain name label. The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system." }, "fqdn": { "type": "string", "description": "The Fully Qualified Domain Name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone." }, "reverseFqdn": { "type": "string", "description": "The reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN." } }, "description": "Contains FQDN of the DNS record associated with the public IP address." }, "DdosSettings": { "properties": { "ddosCustomPolicy": { "readOnly": false, "$ref": "./network.json#/definitions/SubResource", "description": "The DDoS custom policy associated with the public IP." }, "protectionCoverage": { "readOnly": false, "type": "string", "enum": [ "Basic", "Standard" ], "x-ms-enum": { "name": "DdosSettingsProtectionCoverage", "modelAsString": true }, "description": "The DDoS protection policy customizability of the public IP. Only standard coverage will have the ability to be customized." }, "protectedIP": { "readOnly": false, "type": "boolean", "description": "Enables DDoS protection on the public IP." } }, "description": "Contains the DDoS protection settings of the public IP." }, "IpTag": { "properties": { "ipTagType": { "type": "string", "description": "The IP tag type. Example: FirstPartyUsage." }, "tag": { "type": "string", "description": "The value of the IP tag associated with the public IP. Example: SQL." } }, "description": "Contains the IpTag associated with the object." } } } spec-0.21.0/fixtures/azure/routeTable.json000066400000000000000000000555511457312531500205450ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "title": "NetworkManagementClient", "description": "The Microsoft Azure Network management API provides a RESTful set of web services that interact with Microsoft Azure Networks service to manage your network resources. The API has entities that capture the relationship between an end user and the Microsoft Azure Networks service.", "version": "2020-04-01" }, "host": "management.azure.com", "schemes": [ "https" ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "security": [ { "azure_auth": [ "user_impersonation" ] } ], "securityDefinitions": { "azure_auth": { "type": "oauth2", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "flow": "implicit", "description": "Azure Active Directory OAuth2 Flow.", "scopes": { "user_impersonation": "impersonate your user account" } } }, "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}": { "delete": { "tags": [ "RouteTables" ], "operationId": "RouteTables_Delete", "description": "Deletes the specified route table.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "routeTableName", "in": "path", "required": true, "type": "string", "description": "The name of the route table." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "204": { "description": "Request successful. Resource does not exist." }, "200": { "description": "Request successful. Operation to delete was accepted." }, "202": { "description": "Accepted. If route table not found returned synchronously, otherwise if found returned asynchronously." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" }, "x-ms-examples": { "Delete route table": { "$ref": "./examples/RouteTableDelete.json" } } }, "get": { "tags": [ "RouteTables" ], "operationId": "RouteTables_Get", "description": "Gets the specified route table.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "routeTableName", "in": "path", "required": true, "type": "string", "description": "The name of the route table." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" }, { "name": "$expand", "in": "query", "required": false, "type": "string", "description": "Expands referenced resources." } ], "responses": { "200": { "description": "Request successful. The operation returns the resulting RouteTable resource.", "schema": { "$ref": "#/definitions/RouteTable" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Get route table": { "$ref": "./examples/RouteTableGet.json" } } }, "put": { "tags": [ "RouteTables" ], "operationId": "RouteTables_CreateOrUpdate", "description": "Create or updates a route table in a specified resource group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "routeTableName", "in": "path", "required": true, "type": "string", "description": "The name of the route table." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/RouteTable" }, "description": "Parameters supplied to the create or update route table operation." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns the resulting RouteTable resource.", "schema": { "$ref": "#/definitions/RouteTable" } }, "201": { "description": "Create successful. The operation returns the resulting RouteTable resource.", "schema": { "$ref": "#/definitions/RouteTable" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Create route table": { "$ref": "./examples/RouteTableCreate.json" }, "Create route table with route": { "$ref": "./examples/RouteTableCreateWithRoute.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "azure-async-operation" } }, "patch": { "tags": [ "RouteTables" ], "operationId": "RouteTables_UpdateTags", "description": "Updates a route table tags.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "routeTableName", "in": "path", "required": true, "type": "string", "description": "The name of the route table." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "./network.json#/definitions/TagsObject" }, "description": "Parameters supplied to update route table tags." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns the resulting RouteTable resource.", "schema": { "$ref": "#/definitions/RouteTable" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Update route table tags": { "$ref": "./examples/RouteTableUpdateTags.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables": { "get": { "tags": [ "RouteTables" ], "operationId": "RouteTables_List", "description": "Gets all route tables in a resource group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of RouteTable resources.", "schema": { "$ref": "#/definitions/RouteTableListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "List route tables in resource group": { "$ref": "./examples/RouteTableList.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables": { "get": { "tags": [ "RouteTables" ], "operationId": "RouteTables_ListAll", "description": "Gets all route tables in a subscription.", "parameters": [ { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of RouteTable resources.", "schema": { "$ref": "#/definitions/RouteTableListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "List all route tables": { "$ref": "./examples/RouteTableListAll.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}": { "delete": { "tags": [ "Routes" ], "operationId": "Routes_Delete", "description": "Deletes the specified route from a route table.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "routeTableName", "in": "path", "required": true, "type": "string", "description": "The name of the route table." }, { "name": "routeName", "in": "path", "required": true, "type": "string", "description": "The name of the route." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "202": { "description": "Accepted and the operation will complete asynchronously." }, "200": { "description": "Accepted." }, "204": { "description": "Route was deleted or not found." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Delete route": { "$ref": "./examples/RouteTableRouteDelete.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } }, "get": { "tags": [ "Routes" ], "operationId": "Routes_Get", "description": "Gets the specified route from a route table.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "routeTableName", "in": "path", "required": true, "type": "string", "description": "The name of the route table." }, { "name": "routeName", "in": "path", "required": true, "type": "string", "description": "The name of the route." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns the resulting Route resource.", "schema": { "$ref": "#/definitions/Route" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Get route": { "$ref": "./examples/RouteTableRouteGet.json" } } }, "put": { "tags": [ "Routes" ], "operationId": "Routes_CreateOrUpdate", "description": "Creates or updates a route in the specified route table.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "routeTableName", "in": "path", "required": true, "type": "string", "description": "The name of the route table." }, { "name": "routeName", "in": "path", "required": true, "type": "string", "description": "The name of the route." }, { "name": "routeParameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/Route" }, "description": "Parameters supplied to the create or update route operation." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Update successful. The operation returns the resulting Route resource.", "schema": { "$ref": "#/definitions/Route" } }, "201": { "description": "Create successful. The operation returns the resulting Route resource.", "schema": { "$ref": "#/definitions/Route" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Create route": { "$ref": "./examples/RouteTableRouteCreate.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "azure-async-operation" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes": { "get": { "tags": [ "Routes" ], "operationId": "Routes_List", "description": "Gets all routes in a route table.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "routeTableName", "in": "path", "required": true, "type": "string", "description": "The name of the route table." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of Route resources.", "schema": { "$ref": "#/definitions/RouteListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" }, "x-ms-examples": { "List routes": { "$ref": "./examples/RouteTableRouteList.json" } } } } }, "definitions": { "RoutePropertiesFormat": { "properties": { "addressPrefix": { "type": "string", "description": "The destination CIDR to which the route applies." }, "nextHopType": { "$ref": "#/definitions/RouteNextHopType", "description": "The type of Azure hop the packet should be sent to." }, "nextHopIpAddress": { "type": "string", "description": "The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the route resource." } }, "required": [ "nextHopType" ], "description": "Route resource." }, "Route": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/RoutePropertiesFormat", "description": "Properties of the route." }, "name": { "type": "string", "description": "The name of the resource that is unique within a resource group. This name can be used to access the resource." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "Route resource." }, "RouteTablePropertiesFormat": { "properties": { "routes": { "type": "array", "items": { "$ref": "#/definitions/Route" }, "description": "Collection of routes contained within a route table." }, "subnets": { "readOnly": true, "type": "array", "items": { "$ref": "./virtualNetwork.json#/definitions/Subnet" }, "description": "A collection of references to subnets." }, "disableBgpRoutePropagation": { "type": "boolean", "description": "Whether to disable the routes learned by BGP on that route table. True means disable." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the route table resource." } }, "description": "Route Table resource." }, "RouteTable": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/RouteTablePropertiesFormat", "description": "Properties of the route table." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." } }, "allOf": [ { "$ref": "./network.json#/definitions/Resource" } ], "description": "Route table resource." }, "RouteTableListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/RouteTable" }, "description": "A list of route tables in a resource group." }, "nextLink": { "type": "string", "description": "The URL to get the next set of results." } }, "description": "Response for the ListRouteTable API service call." }, "RouteListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/Route" }, "description": "A list of routes in a resource group." }, "nextLink": { "type": "string", "description": "The URL to get the next set of results." } }, "description": "Response for the ListRoute API service call." }, "RouteNextHopType": { "type": "string", "description": "The type of Azure hop the packet should be sent to.", "enum": [ "VirtualNetworkGateway", "VnetLocal", "Internet", "VirtualAppliance", "None" ], "x-ms-enum": { "name": "RouteNextHopType", "modelAsString": true } } } } spec-0.21.0/fixtures/azure/serviceEndpointPolicy.json000066400000000000000000000615071457312531500227560ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "title": "NetworkManagementClient", "description": "The Microsoft Azure Network management API provides a RESTful set of web services that interact with Microsoft Azure Networks service to manage your network resources. The API has entities that capture the relationship between an end user and the Microsoft Azure Networks service.", "version": "2020-04-01" }, "host": "management.azure.com", "schemes": [ "https" ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "security": [ { "azure_auth": [ "user_impersonation" ] } ], "securityDefinitions": { "azure_auth": { "type": "oauth2", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "flow": "implicit", "description": "Azure Active Directory OAuth2 Flow.", "scopes": { "user_impersonation": "impersonate your user account" } } }, "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}": { "delete": { "tags": [ "ServiceEndpointPolicies" ], "operationId": "ServiceEndpointPolicies_Delete", "description": "Deletes the specified service endpoint policy.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "serviceEndpointPolicyName", "in": "path", "required": true, "type": "string", "description": "The name of the service endpoint policy." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "202": { "description": "Accepted and the operation will complete asynchronously." }, "200": { "description": "Delete successful." }, "204": { "description": "Request successful. Resource does not exist." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Delete service endpoint policy": { "$ref": "./examples/ServiceEndpointPolicyDelete.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } }, "get": { "tags": [ "ServiceEndpointPolicies" ], "operationId": "ServiceEndpointPolicies_Get", "description": "Gets the specified service Endpoint Policies in a specified resource group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "serviceEndpointPolicyName", "in": "path", "required": true, "type": "string", "description": "The name of the service endpoint policy." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" }, { "name": "$expand", "in": "query", "required": false, "type": "string", "description": "Expands referenced resources." } ], "responses": { "200": { "description": "Request successful. The operation returns the resulting ServiceEndpointPolicy resource.", "schema": { "$ref": "#/definitions/ServiceEndpointPolicy" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Get service endPoint Policy": { "$ref": "./examples/ServiceEndpointPolicyGet.json" } } }, "put": { "tags": [ "ServiceEndpointPolicies" ], "operationId": "ServiceEndpointPolicies_CreateOrUpdate", "description": "Creates or updates a service Endpoint Policies.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "serviceEndpointPolicyName", "in": "path", "required": true, "type": "string", "description": "The name of the service endpoint policy." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ServiceEndpointPolicy" }, "description": "Parameters supplied to the create or update service endpoint policy operation." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "201": { "description": "Create successful. The operation returns the resulting ServiceEndpointPolicy resource.", "schema": { "$ref": "#/definitions/ServiceEndpointPolicy" } }, "200": { "description": "Update successful. The operation returns the resulting ServiceEndpointPolicy resource.", "schema": { "$ref": "#/definitions/ServiceEndpointPolicy" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Create service endpoint policy": { "$ref": "./examples/ServiceEndpointPolicyCreate.json" }, "Create service endpoint policy with definition": { "$ref": "./examples/ServiceEndpointPolicyCreateWithDefinition.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "azure-async-operation" } }, "patch": { "tags": [ "ServiceEndpointPolicies" ], "operationId": "ServiceEndpointPolicies_UpdateTags", "description": "Updates tags of a service endpoint policy.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "serviceEndpointPolicyName", "in": "path", "required": true, "type": "string", "description": "The name of the service endpoint policy." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "./network.json#/definitions/TagsObject" }, "description": "Parameters supplied to update service endpoint policy tags." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Update successful. The operation returns the resulting ServiceEndpointPolicy resource.", "schema": { "$ref": "#/definitions/ServiceEndpointPolicy" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Update service endpoint policy tags": { "$ref": "./examples/ServiceEndpointPolicyUpdateTags.json" } } } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Network/ServiceEndpointPolicies": { "get": { "tags": [ "ServiceEndpointPolicies" ], "operationId": "ServiceEndpointPolicies_List", "description": "Gets all the service endpoint policies in a subscription.", "parameters": [ { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of ServiceEndpointPolicy resources.", "schema": { "$ref": "#/definitions/ServiceEndpointPolicyListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "List all service endpoint policy": { "$ref": "./examples/ServiceEndpointPolicyListAll.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies": { "get": { "tags": [ "ServiceEndpointPolicies" ], "operationId": "ServiceEndpointPolicies_ListByResourceGroup", "description": "Gets all service endpoint Policies in a resource group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of ServiceEndpointPolicy resources.", "schema": { "$ref": "#/definitions/ServiceEndpointPolicyListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "List resource group service endpoint policies": { "$ref": "./examples/ServiceEndpointPolicyList.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}": { "delete": { "tags": [ "ServiceEndpointPolicyDefinitions" ], "operationId": "ServiceEndpointPolicyDefinitions_Delete", "description": "Deletes the specified ServiceEndpoint policy definitions.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "serviceEndpointPolicyName", "in": "path", "required": true, "type": "string", "description": "The name of the Service Endpoint Policy." }, { "name": "serviceEndpointPolicyDefinitionName", "in": "path", "required": true, "type": "string", "description": "The name of the service endpoint policy definition." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "204": { "description": "Request successful. Resource does not exist." }, "202": { "description": "Accepted and the operation will complete asynchronously." }, "200": { "description": "Delete successful." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Delete service endpoint policy definitions from service endpoint policy": { "$ref": "./examples/ServiceEndpointPolicyDefinitionDelete.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } }, "get": { "tags": [ "serviceEndpointPolicyDefinitions" ], "operationId": "ServiceEndpointPolicyDefinitions_Get", "description": "Get the specified service endpoint policy definitions from service endpoint policy.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "serviceEndpointPolicyName", "in": "path", "required": true, "type": "string", "description": "The name of the service endpoint policy name." }, { "name": "serviceEndpointPolicyDefinitionName", "in": "path", "required": true, "type": "string", "description": "The name of the service endpoint policy definition name." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns the resulting ServiceEndpointPolicyDefinition resource.", "schema": { "$ref": "#/definitions/ServiceEndpointPolicyDefinition" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Get service endpoint definition in service endpoint policy": { "$ref": "./examples/ServiceEndpointPolicyDefinitionGet.json" } } }, "put": { "tags": [ "serviceEndpointPolicyDefinitions" ], "operationId": "ServiceEndpointPolicyDefinitions_CreateOrUpdate", "description": "Creates or updates a service endpoint policy definition in the specified service endpoint policy.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "serviceEndpointPolicyName", "in": "path", "required": true, "type": "string", "description": "The name of the service endpoint policy." }, { "name": "serviceEndpointPolicyDefinitionName", "in": "path", "required": true, "type": "string", "description": "The name of the service endpoint policy definition name." }, { "name": "ServiceEndpointPolicyDefinitions", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ServiceEndpointPolicyDefinition" }, "description": "Parameters supplied to the create or update service endpoint policy operation." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Update successful. The operation returns the resulting ServiceEndpointPolicyDefinition resource.", "schema": { "$ref": "#/definitions/ServiceEndpointPolicyDefinition" } }, "201": { "description": "Create successful. The operation returns the resulting ServiceEndpointPolicyDefinition resource.", "schema": { "$ref": "#/definitions/ServiceEndpointPolicyDefinition" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Create service endpoint policy definition": { "$ref": "./examples/ServiceEndpointPolicyDefinitionCreate.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "azure-async-operation" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions": { "get": { "tags": [ "ServiceEndpointPolicyDefinitions" ], "operationId": "ServiceEndpointPolicyDefinitions_ListByResourceGroup", "description": "Gets all service endpoint policy definitions in a service end point policy.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "serviceEndpointPolicyName", "in": "path", "required": true, "type": "string", "description": "The name of the service endpoint policy name." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of ServiceEndpointPolicyDefinition resources.", "schema": { "$ref": "#/definitions/ServiceEndpointPolicyDefinitionListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "List service endpoint definitions in service end point policy": { "$ref": "./examples/ServiceEndpointPolicyDefinitionList.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } } }, "definitions": { "ServiceEndpointPolicyDefinitionPropertiesFormat": { "properties": { "description": { "type": "string", "description": "A description for this rule. Restricted to 140 chars." }, "service": { "type": "string", "description": "Service endpoint name." }, "serviceResources": { "type": "array", "items": { "type": "string" }, "description": "A list of service resources." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the service endpoint policy definition resource." } }, "description": "Service Endpoint policy definition resource." }, "ServiceEndpointPolicyDefinition": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/ServiceEndpointPolicyDefinitionPropertiesFormat", "description": "Properties of the service endpoint policy definition." }, "name": { "type": "string", "description": "The name of the resource that is unique within a resource group. This name can be used to access the resource." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "Service Endpoint policy definitions." }, "ServiceEndpointPolicyDefinitionListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/ServiceEndpointPolicyDefinition" }, "description": "The service endpoint policy definition in a service endpoint policy." }, "nextLink": { "type": "string", "description": "The URL to get the next set of results." } }, "description": "Response for ListServiceEndpointPolicyDefinition API service call. Retrieves all service endpoint policy definition that belongs to a service endpoint policy." }, "ServiceEndpointPolicyPropertiesFormat": { "properties": { "serviceEndpointPolicyDefinitions": { "type": "array", "items": { "$ref": "#/definitions/ServiceEndpointPolicyDefinition" }, "description": "A collection of service endpoint policy definitions of the service endpoint policy." }, "subnets": { "readOnly": true, "type": "array", "items": { "$ref": "./virtualNetwork.json#/definitions/Subnet" }, "description": "A collection of references to subnets." }, "resourceGuid": { "type": "string", "readOnly": true, "description": "The resource GUID property of the service endpoint policy resource." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the service endpoint policy resource." } }, "description": "Service Endpoint Policy resource." }, "ServiceEndpointPolicy": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/ServiceEndpointPolicyPropertiesFormat", "description": "Properties of the service end point policy." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." } }, "allOf": [ { "$ref": "./network.json#/definitions/Resource" } ], "description": "Service End point policy resource." }, "ServiceEndpointPolicyListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/ServiceEndpointPolicy" }, "description": "A list of ServiceEndpointPolicy resources." }, "nextLink": { "readOnly": true, "type": "string", "description": "The URL to get the next set of results." } }, "description": "Response for ListServiceEndpointPolicies API service call." } } } spec-0.21.0/fixtures/azure/virtualNetwork.json000066400000000000000000002016431457312531500214720ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "title": "NetworkManagementClient", "description": "The Microsoft Azure Network management API provides a RESTful set of web services that interact with Microsoft Azure Networks service to manage your network resources. The API has entities that capture the relationship between an end user and the Microsoft Azure Networks service.", "version": "2020-04-01" }, "host": "management.azure.com", "schemes": [ "https" ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "security": [ { "azure_auth": [ "user_impersonation" ] } ], "securityDefinitions": { "azure_auth": { "type": "oauth2", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "flow": "implicit", "description": "Azure Active Directory OAuth2 Flow.", "scopes": { "user_impersonation": "impersonate your user account" } } }, "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}": { "delete": { "tags": [ "VirtualNetworks" ], "operationId": "VirtualNetworks_Delete", "description": "Deletes the specified virtual network.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "virtualNetworkName", "in": "path", "required": true, "type": "string", "description": "The name of the virtual network." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "202": { "description": "Accepted and the operation will complete asynchronously." }, "204": { "description": "Delete successful." }, "200": { "description": "Delete successful." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" }, "x-ms-examples": { "Delete virtual network": { "$ref": "./examples/VirtualNetworkDelete.json" } } }, "get": { "tags": [ "VirtualNetworks" ], "operationId": "VirtualNetworks_Get", "description": "Gets the specified virtual network by resource group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "virtualNetworkName", "in": "path", "required": true, "type": "string", "description": "The name of the virtual network." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" }, { "name": "$expand", "in": "query", "required": false, "type": "string", "description": "Expands referenced resources." } ], "responses": { "200": { "description": "Request successful. The operation returns the resulting VirtualNetwork resource.", "schema": { "$ref": "#/definitions/VirtualNetwork" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Get virtual network": { "$ref": "./examples/VirtualNetworkGet.json" }, "Get virtual network with a delegated subnet": { "$ref": "./examples/VirtualNetworkGetWithSubnetDelegation.json" }, "Get virtual network with service association links": { "$ref": "./examples/VirtualNetworkGetWithServiceAssociationLink.json" } } }, "put": { "tags": [ "VirtualNetworks" ], "operationId": "VirtualNetworks_CreateOrUpdate", "description": "Creates or updates a virtual network in the specified resource group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "virtualNetworkName", "in": "path", "required": true, "type": "string", "description": "The name of the virtual network." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/VirtualNetwork" }, "description": "Parameters supplied to the create or update virtual network operation." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Update successful. The operation returns the resulting VirtualNetwork resource.", "schema": { "$ref": "#/definitions/VirtualNetwork" } }, "201": { "description": "Create successful. The operation returns the resulting VirtualNetwork resource.", "schema": { "$ref": "#/definitions/VirtualNetwork" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "azure-async-operation" }, "x-ms-examples": { "Create virtual network": { "$ref": "./examples/VirtualNetworkCreate.json" }, "Create virtual network with subnet": { "$ref": "./examples/VirtualNetworkCreateSubnet.json" }, "Create virtual network with subnet containing address prefixes": { "$ref": "./examples/VirtualNetworkCreateSubnetWithAddressPrefixes.json" }, "Create virtual network with Bgp Communities": { "$ref": "./examples/VirtualNetworkCreateWithBgpCommunities.json" }, "Create virtual network with service endpoints": { "$ref": "./examples/VirtualNetworkCreateServiceEndpoints.json" }, "Create virtual network with service endpoints and service endpoint policy": { "$ref": "./examples/VirtualNetworkCreateServiceEndpointPolicy.json" }, "Create virtual network with delegated subnets": { "$ref": "./examples/VirtualNetworkCreateSubnetWithDelegation.json" } } }, "patch": { "tags": [ "VirtualNetworks" ], "operationId": "VirtualNetworks_UpdateTags", "description": "Updates a virtual network tags.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "virtualNetworkName", "in": "path", "required": true, "type": "string", "description": "The name of the virtual network." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "./network.json#/definitions/TagsObject" }, "description": "Parameters supplied to update virtual network tags." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Update successful. The operation returns the resulting VirtualNetwork resource.", "schema": { "$ref": "#/definitions/VirtualNetwork" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Update virtual network tags": { "$ref": "./examples/VirtualNetworkUpdateTags.json" } } } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks": { "get": { "tags": [ "VirtualNetworks" ], "operationId": "VirtualNetworks_ListAll", "description": "Gets all virtual networks in a subscription.", "parameters": [ { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of VirtualNetwork resources.", "schema": { "$ref": "#/definitions/VirtualNetworkListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "List all virtual networks": { "$ref": "./examples/VirtualNetworkListAll.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks": { "get": { "tags": [ "VirtualNetworks" ], "operationId": "VirtualNetworks_List", "description": "Gets all virtual networks in a resource group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of VirtualNetwork resources.", "schema": { "$ref": "#/definitions/VirtualNetworkListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "List virtual networks in resource group": { "$ref": "./examples/VirtualNetworkList.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}": { "delete": { "tags": [ "Subnets" ], "operationId": "Subnets_Delete", "description": "Deletes the specified subnet.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "virtualNetworkName", "in": "path", "required": true, "type": "string", "description": "The name of the virtual network." }, { "name": "subnetName", "in": "path", "required": true, "type": "string", "description": "The name of the subnet." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Delete successful." }, "204": { "description": "Request successful. Resource does not exist." }, "202": { "description": "Accepted and the operation will complete asynchronously." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Delete subnet": { "$ref": "./examples/SubnetDelete.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } }, "get": { "tags": [ "Subnets" ], "operationId": "Subnets_Get", "description": "Gets the specified subnet by virtual network and resource group.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "virtualNetworkName", "in": "path", "required": true, "type": "string", "description": "The name of the virtual network." }, { "name": "subnetName", "in": "path", "required": true, "type": "string", "description": "The name of the subnet." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" }, { "name": "$expand", "in": "query", "required": false, "type": "string", "description": "Expands referenced resources." } ], "responses": { "200": { "description": "Request successful. The operation returns the resulting Subnet resource.", "schema": { "$ref": "#/definitions/Subnet" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Get subnet": { "$ref": "./examples/SubnetGet.json" }, "Get subnet with a delegation": { "$ref": "./examples/SubnetGetWithDelegation.json" } } }, "put": { "tags": [ "Subnets" ], "operationId": "Subnets_CreateOrUpdate", "description": "Creates or updates a subnet in the specified virtual network.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "virtualNetworkName", "in": "path", "required": true, "type": "string", "description": "The name of the virtual network." }, { "name": "subnetName", "in": "path", "required": true, "type": "string", "description": "The name of the subnet." }, { "name": "subnetParameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/Subnet" }, "description": "Parameters supplied to the create or update subnet operation." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Update successful. The operation returns the resulting Subnet resource.", "schema": { "$ref": "#/definitions/Subnet" } }, "201": { "description": "Create successful. The operation returns the resulting Subnet resource.", "schema": { "$ref": "#/definitions/Subnet" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "azure-async-operation" }, "x-ms-examples": { "Create subnet": { "$ref": "./examples/SubnetCreate.json" }, "Create subnet with service endpoints": { "$ref": "./examples/SubnetCreateServiceEndpoint.json" }, "Create subnet with a delegation": { "$ref": "./examples/SubnetCreateWithDelegation.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/PrepareNetworkPolicies": { "post": { "operationId": "Subnets_PrepareNetworkPolicies", "description": "Prepares a subnet by applying network intent policies.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "virtualNetworkName", "in": "path", "required": true, "type": "string", "description": "The name of the virtual network." }, { "name": "subnetName", "in": "path", "required": true, "type": "string", "description": "The name of the subnet." }, { "name": "prepareNetworkPoliciesRequestParameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/PrepareNetworkPoliciesRequest" }, "description": "Parameters supplied to prepare subnet by applying network intent policies." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Preparing subnet by applying network intent policies is successful." }, "202": { "description": "Accepted and the operation will complete asynchronously." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" }, "x-ms-examples": { "Prepare Network Policies": { "$ref": "./examples/SubnetPrepareNetworkPolicies.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/UnprepareNetworkPolicies": { "post": { "operationId": "Subnets_UnprepareNetworkPolicies", "description": "Unprepares a subnet by removing network intent policies.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "virtualNetworkName", "in": "path", "required": true, "type": "string", "description": "The name of the virtual network." }, { "name": "subnetName", "in": "path", "required": true, "type": "string", "description": "The name of the subnet." }, { "name": "unprepareNetworkPoliciesRequestParameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/UnprepareNetworkPoliciesRequest" }, "description": "Parameters supplied to unprepare subnet to remove network intent policies." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Unpreparing subnet by removing network intent policies is successful." }, "202": { "description": "Accepted and the operation will complete asynchronously." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" }, "x-ms-examples": { "Unprepare Network Policies": { "$ref": "./examples/SubnetUnprepareNetworkPolicies.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/ResourceNavigationLinks": { "get": { "operationId": "ResourceNavigationLinks_List", "description": "Gets a list of resource navigation links for a subnet.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "virtualNetworkName", "in": "path", "required": true, "type": "string", "description": "The name of the virtual network." }, { "name": "subnetName", "in": "path", "required": true, "type": "string", "description": "The name of the subnet." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of resource navigation links for the subnet.", "schema": { "$ref": "#/definitions/ResourceNavigationLinksListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Get Resource Navigation Links": { "$ref": "./examples/VirtualNetworkGetResourceNavigationLinks.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/ServiceAssociationLinks": { "get": { "operationId": "ServiceAssociationLinks_List", "description": "Gets a list of service association links for a subnet.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "virtualNetworkName", "in": "path", "required": true, "type": "string", "description": "The name of the virtual network." }, { "name": "subnetName", "in": "path", "required": true, "type": "string", "description": "The name of the subnet." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of service association links for the subnet.", "schema": { "$ref": "#/definitions/ServiceAssociationLinksListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Get Service Association Links": { "$ref": "./examples/VirtualNetworkGetServiceAssociationLinks.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets": { "get": { "tags": [ "Subnets" ], "operationId": "Subnets_List", "description": "Gets all subnets in a virtual network.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "virtualNetworkName", "in": "path", "required": true, "type": "string", "description": "The name of the virtual network." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of Subnet resources.", "schema": { "$ref": "#/definitions/SubnetListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" }, "x-ms-examples": { "List subnets": { "$ref": "./examples/SubnetList.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}": { "delete": { "tags": [ "VirtualNetworkPeerings" ], "operationId": "VirtualNetworkPeerings_Delete", "description": "Deletes the specified virtual network peering.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "virtualNetworkName", "in": "path", "required": true, "type": "string", "description": "The name of the virtual network." }, { "name": "virtualNetworkPeeringName", "in": "path", "required": true, "type": "string", "description": "The name of the virtual network peering." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Delete successful." }, "204": { "description": "Delete successful." }, "202": { "description": "Accepted and the operation will complete asynchronously." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Delete peering": { "$ref": "./examples/VirtualNetworkPeeringDelete.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } }, "get": { "tags": [ "VirtualNetworkPeerings" ], "operationId": "VirtualNetworkPeerings_Get", "description": "Gets the specified virtual network peering.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "virtualNetworkName", "in": "path", "required": true, "type": "string", "description": "The name of the virtual network." }, { "name": "virtualNetworkPeeringName", "in": "path", "required": true, "type": "string", "description": "The name of the virtual network peering." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns the resulting VirtualNetworkPeering resource.", "schema": { "$ref": "#/definitions/VirtualNetworkPeering" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Get peering": { "$ref": "./examples/VirtualNetworkPeeringGet.json" } } }, "put": { "tags": [ "VirtualNetworkPeerings" ], "operationId": "VirtualNetworkPeerings_CreateOrUpdate", "description": "Creates or updates a peering in the specified virtual network.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "virtualNetworkName", "in": "path", "required": true, "type": "string", "description": "The name of the virtual network." }, { "name": "virtualNetworkPeeringName", "in": "path", "required": true, "type": "string", "description": "The name of the peering." }, { "name": "VirtualNetworkPeeringParameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/VirtualNetworkPeering" }, "description": "Parameters supplied to the create or update virtual network peering operation." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Update successful. The operation returns the resulting VirtualNetworkPeering resource.", "schema": { "$ref": "#/definitions/VirtualNetworkPeering" } }, "201": { "description": "Create successful. The operation returns the resulting VirtualNetworkPeering resource.", "schema": { "$ref": "#/definitions/VirtualNetworkPeering" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Create peering": { "$ref": "./examples/VirtualNetworkPeeringCreate.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "azure-async-operation" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings": { "get": { "tags": [ "VirtualNetworkPeerings" ], "operationId": "VirtualNetworkPeerings_List", "description": "Gets all virtual network peerings in a virtual network.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "virtualNetworkName", "in": "path", "required": true, "type": "string", "description": "The name of the virtual network." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of VirtualNetworkPeering resources.", "schema": { "$ref": "#/definitions/VirtualNetworkPeeringListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" }, "x-ms-examples": { "List peerings": { "$ref": "./examples/VirtualNetworkPeeringList.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability": { "get": { "operationId": "VirtualNetworks_CheckIPAddressAvailability", "description": "Checks whether a private IP address is available for use.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "virtualNetworkName", "in": "path", "required": true, "type": "string", "description": "The name of the virtual network." }, { "name": "ipAddress", "in": "query", "required": true, "type": "string", "description": "The private IP address to be verified." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Private IP address availability and list of other free addresses if the requested one is not available.", "schema": { "$ref": "#/definitions/IPAddressAvailabilityResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Check IP address availability": { "$ref": "./examples/VirtualNetworkCheckIPAddressAvailability.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/usages": { "get": { "operationId": "VirtualNetworks_ListUsage", "description": "Lists usage stats.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "virtualNetworkName", "in": "path", "required": true, "type": "string", "description": "The name of the virtual network." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Usage stats for vnet.", "schema": { "$ref": "#/definitions/VirtualNetworkListUsageResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "VnetGetUsage": { "$ref": "./examples/VirtualNetworkListUsage.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } } }, "definitions": { "ServiceAssociationLinkPropertiesFormat": { "properties": { "linkedResourceType": { "type": "string", "description": "Resource type of the linked resource." }, "link": { "type": "string", "description": "Link to the external resource." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the service association link resource." }, "allowDelete": { "type": "boolean", "description": "If true, the resource can be deleted." }, "locations": { "type": "array", "items": { "type": "string" }, "description": "A list of locations." } }, "description": "Properties of ServiceAssociationLink." }, "ServiceAssociationLink": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/ServiceAssociationLinkPropertiesFormat", "description": "Resource navigation link properties format." }, "name": { "type": "string", "description": "Name of the resource that is unique within a resource group. This name can be used to access the resource." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." }, "type": { "readOnly": true, "type": "string", "description": "Resource type." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "ServiceAssociationLink resource." }, "ResourceNavigationLinkFormat": { "properties": { "linkedResourceType": { "type": "string", "description": "Resource type of the linked resource." }, "link": { "type": "string", "description": "Link to the external resource." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the resource navigation link resource." } }, "description": "Properties of ResourceNavigationLink." }, "ResourceNavigationLink": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/ResourceNavigationLinkFormat", "description": "Resource navigation link properties format." }, "name": { "type": "string", "description": "Name of the resource that is unique within a resource group. This name can be used to access the resource." }, "id": { "type": "string", "readOnly": true, "description": "Resource navigation link identifier." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." }, "type": { "readOnly": true, "type": "string", "description": "Resource type." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "ResourceNavigationLink resource." }, "ServiceDelegationPropertiesFormat": { "properties": { "serviceName": { "type": "string", "description": "The name of the service to whom the subnet should be delegated (e.g. Microsoft.Sql/servers)." }, "actions": { "readOnly": true, "type": "array", "items": { "type": "string" }, "description": "The actions permitted to the service upon delegation." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the service delegation resource." } }, "description": "Properties of a service delegation." }, "Delegation": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/ServiceDelegationPropertiesFormat", "description": "Properties of the subnet." }, "name": { "type": "string", "description": "The name of the resource that is unique within a subnet. This name can be used to access the resource." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "Details the service to which the subnet is delegated." }, "SubnetPropertiesFormat": { "properties": { "addressPrefix": { "type": "string", "description": "The address prefix for the subnet." }, "addressPrefixes": { "type": "array", "items": { "type": "string" }, "description": "List of address prefixes for the subnet." }, "networkSecurityGroup": { "$ref": "./networkSecurityGroup.json#/definitions/NetworkSecurityGroup", "description": "The reference to the NetworkSecurityGroup resource." }, "routeTable": { "$ref": "./routeTable.json#/definitions/RouteTable", "description": "The reference to the RouteTable resource." }, "natGateway": { "$ref": "./network.json#/definitions/SubResource", "description": "Nat gateway associated with this subnet." }, "serviceEndpoints": { "type": "array", "items": { "$ref": "#/definitions/ServiceEndpointPropertiesFormat" }, "description": "An array of service endpoints." }, "serviceEndpointPolicies": { "type": "array", "items": { "$ref": "./serviceEndpointPolicy.json#/definitions/ServiceEndpointPolicy" }, "description": "An array of service endpoint policies." }, "privateEndpoints": { "readOnly": true, "type": "array", "items": { "$ref": "./privateEndpoint.json#/definitions/PrivateEndpoint" }, "description": "An array of references to private endpoints." }, "ipConfigurations": { "readOnly": true, "type": "array", "items": { "$ref": "./networkInterface.json#/definitions/IPConfiguration" }, "description": "An array of references to the network interface IP configurations using subnet." }, "ipConfigurationProfiles": { "readOnly": true, "type": "array", "items": { "$ref": "./networkProfile.json#/definitions/IPConfigurationProfile" }, "description": "Array of IP configuration profiles which reference this subnet." }, "ipAllocations": { "type": "array", "items": { "$ref": "./network.json#/definitions/SubResource" }, "description": "Array of IpAllocation which reference this subnet." }, "resourceNavigationLinks": { "readOnly": true, "type": "array", "items": { "$ref": "#/definitions/ResourceNavigationLink" }, "description": "An array of references to the external resources using subnet." }, "serviceAssociationLinks": { "readOnly": true, "type": "array", "items": { "$ref": "#/definitions/ServiceAssociationLink" }, "description": "An array of references to services injecting into this subnet." }, "delegations": { "type": "array", "items": { "$ref": "#/definitions/Delegation" }, "description": "An array of references to the delegations on the subnet." }, "purpose": { "type": "string", "readOnly": true, "description": "A read-only string identifying the intention of use for this subnet based on delegations and other user-defined properties." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the subnet resource." }, "privateEndpointNetworkPolicies": { "type": "string", "description": "Enable or Disable apply network policies on private end point in the subnet." }, "privateLinkServiceNetworkPolicies": { "type": "string", "description": "Enable or Disable apply network policies on private link service in the subnet." } }, "description": "Properties of the subnet." }, "ServiceEndpointPropertiesFormat": { "properties": { "service": { "type": "string", "description": "The type of the endpoint service." }, "locations": { "type": "array", "items": { "type": "string" }, "description": "A list of locations." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the service endpoint resource." } }, "description": "The service endpoint properties." }, "VirtualNetworkPeeringPropertiesFormat": { "properties": { "allowVirtualNetworkAccess": { "type": "boolean", "description": "Whether the VMs in the local virtual network space would be able to access the VMs in remote virtual network space." }, "allowForwardedTraffic": { "type": "boolean", "description": "Whether the forwarded traffic from the VMs in the local virtual network will be allowed/disallowed in remote virtual network." }, "allowGatewayTransit": { "type": "boolean", "description": "If gateway links can be used in remote virtual networking to link to this virtual network." }, "useRemoteGateways": { "type": "boolean", "description": "If remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway." }, "remoteVirtualNetwork": { "$ref": "./network.json#/definitions/SubResource", "description": "The reference to the remote virtual network. The remote virtual network can be in the same or different region (preview). See here to register for the preview and learn more (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering)." }, "remoteAddressSpace": { "$ref": "#/definitions/AddressSpace", "description": "The reference to the remote virtual network address space." }, "peeringState": { "type": "string", "description": "The status of the virtual network peering.", "enum": [ "Initiated", "Connected", "Disconnected" ], "x-ms-enum": { "name": "VirtualNetworkPeeringState", "modelAsString": true } }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the virtual network peering resource." } }, "description": "Properties of the virtual network peering." }, "Subnet": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/SubnetPropertiesFormat", "description": "Properties of the subnet." }, "name": { "type": "string", "description": "The name of the resource that is unique within a resource group. This name can be used to access the resource." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "Subnet in a virtual network resource." }, "VirtualNetworkPeering": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/VirtualNetworkPeeringPropertiesFormat", "description": "Properties of the virtual network peering." }, "name": { "type": "string", "description": "The name of the resource that is unique within a resource group. This name can be used to access the resource." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." } }, "allOf": [ { "$ref": "./network.json#/definitions/SubResource" } ], "description": "Peerings in a virtual network resource." }, "SubnetListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/Subnet" }, "description": "The subnets in a virtual network." }, "nextLink": { "type": "string", "description": "The URL to get the next set of results." } }, "description": "Response for ListSubnets API service callRetrieves all subnet that belongs to a virtual network." }, "ResourceNavigationLinksListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/ResourceNavigationLink" }, "description": "The resource navigation links in a subnet." }, "nextLink": { "type": "string", "readOnly": true, "description": "The URL to get the next set of results." } }, "description": "Response for ResourceNavigationLinks_List operation." }, "ServiceAssociationLinksListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/ServiceAssociationLink" }, "description": "The service association links in a subnet." }, "nextLink": { "type": "string", "readOnly": true, "description": "The URL to get the next set of results." } }, "description": "Response for ServiceAssociationLinks_List operation." }, "VirtualNetworkPeeringListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/VirtualNetworkPeering" }, "description": "The peerings in a virtual network." }, "nextLink": { "type": "string", "description": "The URL to get the next set of results." } }, "description": "Response for ListSubnets API service call. Retrieves all subnets that belong to a virtual network." }, "VirtualNetworkPropertiesFormat": { "properties": { "addressSpace": { "$ref": "#/definitions/AddressSpace", "description": "The AddressSpace that contains an array of IP address ranges that can be used by subnets." }, "dhcpOptions": { "$ref": "#/definitions/DhcpOptions", "description": "The dhcpOptions that contains an array of DNS servers available to VMs deployed in the virtual network." }, "subnets": { "type": "array", "items": { "$ref": "#/definitions/Subnet" }, "description": "A list of subnets in a Virtual Network." }, "virtualNetworkPeerings": { "type": "array", "items": { "$ref": "#/definitions/VirtualNetworkPeering" }, "description": "A list of peerings in a Virtual Network." }, "resourceGuid": { "readOnly": true, "type": "string", "description": "The resourceGuid property of the Virtual Network resource." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the virtual network resource." }, "enableDdosProtection": { "type": "boolean", "default": false, "description": "Indicates if DDoS protection is enabled for all the protected resources in the virtual network. It requires a DDoS protection plan associated with the resource." }, "enableVmProtection": { "type": "boolean", "default": false, "description": "Indicates if VM protection is enabled for all the subnets in the virtual network." }, "ddosProtectionPlan": { "$ref": "./network.json#/definitions/SubResource", "default": null, "description": "The DDoS protection plan associated with the virtual network." }, "bgpCommunities": { "$ref": "#/definitions/VirtualNetworkBgpCommunities", "default": null, "description": "Bgp Communities sent over ExpressRoute with each route corresponding to a prefix in this VNET." }, "ipAllocations": { "type": "array", "items": { "$ref": "./network.json#/definitions/SubResource" }, "description": "Array of IpAllocation which reference this VNET." } }, "description": "Properties of the virtual network." }, "VirtualNetwork": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/VirtualNetworkPropertiesFormat", "description": "Properties of the virtual network." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." } }, "allOf": [ { "$ref": "./network.json#/definitions/Resource" } ], "description": "Virtual Network resource." }, "VirtualNetworkListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/VirtualNetwork" }, "description": "A list of VirtualNetwork resources in a resource group." }, "nextLink": { "type": "string", "description": "The URL to get the next set of results." } }, "description": "Response for the ListVirtualNetworks API service call." }, "AddressSpace": { "properties": { "addressPrefixes": { "type": "array", "items": { "type": "string" }, "description": "A list of address blocks reserved for this virtual network in CIDR notation." } }, "description": "AddressSpace contains an array of IP address ranges that can be used by subnets of the virtual network." }, "DhcpOptions": { "properties": { "dnsServers": { "type": "array", "items": { "type": "string" }, "description": "The list of DNS servers IP addresses." } }, "description": "DhcpOptions contains an array of DNS servers available to VMs deployed in the virtual network. Standard DHCP option for a subnet overrides VNET DHCP options." }, "VirtualNetworkBgpCommunities": { "properties": { "virtualNetworkCommunity": { "type": "string", "description": "The BGP community associated with the virtual network." }, "regionalCommunity": { "type": "string", "readOnly": true, "description": "The BGP community associated with the region of the virtual network." } }, "required": [ "virtualNetworkCommunity" ], "description": "Bgp Communities sent over ExpressRoute with each route corresponding to a prefix in this VNET." }, "IPAddressAvailabilityResult": { "properties": { "available": { "type": "boolean", "description": "Private IP address availability." }, "availableIPAddresses": { "type": "array", "items": { "type": "string" }, "description": "Contains other available private IP addresses if the asked for address is taken." } }, "description": "Response for CheckIPAddressAvailability API service call." }, "VirtualNetworkListUsageResult": { "properties": { "value": { "type": "array", "readOnly": true, "items": { "$ref": "#/definitions/VirtualNetworkUsage" }, "description": "VirtualNetwork usage stats." }, "nextLink": { "type": "string", "description": "The URL to get the next set of results." } }, "description": "Response for the virtual networks GetUsage API service call." }, "VirtualNetworkUsage": { "properties": { "currentValue": { "type": "number", "format": "double", "readOnly": true, "description": "Indicates number of IPs used from the Subnet." }, "id": { "type": "string", "readOnly": true, "description": "Subnet identifier." }, "limit": { "type": "number", "format": "double", "readOnly": true, "description": "Indicates the size of the subnet." }, "name": { "$ref": "#/definitions/VirtualNetworkUsageName", "readOnly": true, "description": "The name containing common and localized value for usage." }, "unit": { "type": "string", "readOnly": true, "description": "Usage units. Returns 'Count'." } }, "description": "Usage details for subnet." }, "VirtualNetworkUsageName": { "properties": { "localizedValue": { "type": "string", "readOnly": true, "description": "Localized subnet size and usage string." }, "value": { "type": "string", "readOnly": true, "description": "Subnet size and usage string." } }, "description": "Usage strings container." }, "PrepareNetworkPoliciesRequest": { "properties": { "serviceName": { "type": "string", "description": "The name of the service for which subnet is being prepared for." }, "networkIntentPolicyConfigurations": { "type": "array", "items": { "$ref": "#/definitions/NetworkIntentPolicyConfiguration" }, "description": "A list of NetworkIntentPolicyConfiguration." } }, "description": "Details of PrepareNetworkPolicies for Subnet." }, "UnprepareNetworkPoliciesRequest": { "properties": { "serviceName": { "type": "string", "description": "The name of the service for which subnet is being unprepared for." } }, "description": "Details of UnprepareNetworkPolicies for Subnet." }, "NetworkIntentPolicyConfiguration": { "properties": { "networkIntentPolicyName": { "type": "string", "description": "The name of the Network Intent Policy for storing in target subscription." }, "sourceNetworkIntentPolicy": { "$ref": "#/definitions/NetworkIntentPolicy", "description": "Source network intent policy." } }, "description": "Details of NetworkIntentPolicyConfiguration for PrepareNetworkPoliciesRequest." }, "NetworkIntentPolicy": { "properties": { "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." } }, "allOf": [ { "$ref": "./network.json#/definitions/Resource" } ], "description": "Network Intent Policy resource." } } } spec-0.21.0/fixtures/azure/virtualNetworkTap.json000066400000000000000000000334271457312531500221420ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "title": "NetworkManagementClient", "description": "The Microsoft Azure Network management API provides a RESTful set of web services that interact with Microsoft Azure Networks service to manage your network resources. The API has entities that capture the relationship between an end user and the Microsoft Azure Networks service.", "version": "2020-04-01" }, "host": "management.azure.com", "schemes": [ "https" ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "security": [ { "azure_auth": [ "user_impersonation" ] } ], "securityDefinitions": { "azure_auth": { "type": "oauth2", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "flow": "implicit", "description": "Azure Active Directory OAuth2 Flow.", "scopes": { "user_impersonation": "impersonate your user account" } } }, "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}": { "delete": { "tags": [ "VirtualNetworkTap" ], "operationId": "VirtualNetworkTaps_Delete", "description": "Deletes the specified virtual network tap.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "tapName", "in": "path", "required": true, "type": "string", "description": "The name of the virtual network tap." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Delete successful." }, "202": { "description": "Accepted. Sets 'Deleting' provisioningState until the operation completes. Returns an operation URI that can be queried to find the current state of the operation." }, "204": { "description": "Request successful. Resource does not exist." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Delete Virtual Network Tap resource": { "$ref": "./examples/VirtualNetworkTapDelete.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "location" } }, "get": { "tags": [ "VirtualNetworkTap" ], "operationId": "VirtualNetworkTaps_Get", "description": "Gets information about the specified virtual network tap.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "tapName", "in": "path", "required": true, "type": "string", "description": "The name of virtual network tap." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns the resulting VirtualNetworkTap resource.", "schema": { "$ref": "#/definitions/VirtualNetworkTap" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Get Virtual Network Tap": { "$ref": "./examples/VirtualNetworkTapGet.json" } } }, "put": { "tags": [ "VirtualNetworkTap" ], "operationId": "VirtualNetworkTaps_CreateOrUpdate", "description": "Creates or updates a Virtual Network Tap.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "tapName", "in": "path", "required": true, "type": "string", "description": "The name of the virtual network tap." }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/VirtualNetworkTap" }, "description": "Parameters supplied to the create or update virtual network tap operation." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Update successful. The operation returns the resulting VirtualNetworkTap resource.", "schema": { "$ref": "#/definitions/VirtualNetworkTap" } }, "201": { "description": "Create successful. The operation returns the resulting VirtualNetworkTap resource.", "schema": { "$ref": "#/definitions/VirtualNetworkTap" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Create Virtual Network Tap": { "$ref": "./examples/VirtualNetworkTapCreate.json" } }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { "final-state-via": "azure-async-operation" } }, "patch": { "tags": [ "VirtualNetworkTap" ], "operationId": "VirtualNetworkTaps_UpdateTags", "description": "Updates an VirtualNetworkTap tags.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "name": "tapName", "in": "path", "required": true, "type": "string", "description": "The name of the tap." }, { "name": "tapParameters", "in": "body", "required": true, "schema": { "$ref": "./network.json#/definitions/TagsObject" }, "description": "Parameters supplied to update VirtualNetworkTap tags." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Update successful. The operation returns the resulting VirtualNetworkTap resource.", "schema": { "$ref": "#/definitions/VirtualNetworkTap" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "Update virtual network tap tags": { "$ref": "./examples/VirtualNetworkTapUpdateTags.json" } } } }, "/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworkTaps": { "get": { "tags": [ "VirtualNetworkTaps" ], "operationId": "VirtualNetworkTaps_ListAll", "description": "Gets all the VirtualNetworkTaps in a subscription.", "parameters": [ { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of Virtual Network Tap resources.", "schema": { "$ref": "#/definitions/VirtualNetworkTapListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "List all virtual network taps": { "$ref": "./examples/VirtualNetworkTapListAll.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps": { "get": { "tags": [ "VirtualNetworkTaps" ], "operationId": "VirtualNetworkTaps_ListByResourceGroup", "description": "Gets all the VirtualNetworkTaps in a subscription.", "parameters": [ { "name": "resourceGroupName", "in": "path", "required": true, "type": "string", "description": "The name of the resource group." }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, { "$ref": "./network.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Request successful. The operation returns a list of Virtual Network Tap resources.", "schema": { "$ref": "#/definitions/VirtualNetworkTapListResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } }, "x-ms-examples": { "List virtual network taps in resource group": { "$ref": "./examples/VirtualNetworkTapList.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } } }, "definitions": { "VirtualNetworkTap": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/VirtualNetworkTapPropertiesFormat", "description": "Virtual Network Tap Properties." }, "etag": { "readOnly": true, "type": "string", "description": "A unique read-only string that changes whenever the resource is updated." } }, "allOf": [ { "$ref": "./network.json#/definitions/Resource" } ], "description": "Virtual Network Tap resource." }, "VirtualNetworkTapPropertiesFormat": { "description": "Virtual Network Tap properties.", "properties": { "networkInterfaceTapConfigurations": { "readOnly": true, "type": "array", "items": { "$ref": "./networkInterface.json#/definitions/NetworkInterfaceTapConfiguration", "description": "The reference to the Network Interface." }, "description": "Specifies the list of resource IDs for the network interface IP configuration that needs to be tapped." }, "resourceGuid": { "type": "string", "readOnly": true, "description": "The resource GUID property of the virtual network tap resource." }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState", "description": "The provisioning state of the virtual network tap resource." }, "destinationNetworkInterfaceIPConfiguration": { "$ref": "./networkInterface.json#/definitions/NetworkInterfaceIPConfiguration", "description": "The reference to the private IP Address of the collector nic that will receive the tap." }, "destinationLoadBalancerFrontEndIPConfiguration": { "$ref": "./loadBalancer.json#/definitions/FrontendIPConfiguration", "description": "The reference to the private IP address on the internal Load Balancer that will receive the tap." }, "destinationPort": { "type": "integer", "description": "The VXLAN destination port that will receive the tapped traffic." } } }, "VirtualNetworkTapListResult": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/VirtualNetworkTap" }, "description": "A list of VirtualNetworkTaps in a resource group." }, "nextLink": { "type": "string", "description": "The URL to get the next set of results." } }, "description": "Response for ListVirtualNetworkTap API service call." } } } spec-0.21.0/fixtures/bugs/000077500000000000000000000000001457312531500153435ustar00rootroot00000000000000spec-0.21.0/fixtures/bugs/102/000077500000000000000000000000001457312531500156455ustar00rootroot00000000000000spec-0.21.0/fixtures/bugs/102/fixture-102.json000066400000000000000000000025031457312531500205260ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "description": "My API", "version": "1.0.0", "title": "my api", "contact": { "email": "me@myorg.com" }, "license": { "name": "my org" } }, "host": "127.0.0.1", "basePath": "/", "tags": [], "schemes": [ "https" ], "paths": { "/api/v1/endpoint": { "post": { "summary": "my endpoint", "description": "Accessible to . ", "operationId": "ep1", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ ], "responses": { "200": { "description": "Operation successful", "schema": { "$ref": "#/definitions/Error" } } }, "security": [] } } }, "definitions": { "Error": { "type": "object", "properties": { "errorCode": { "type": "string", "format": "string" }, "errorMessage": { "type": "string", "format": "string" }, "warning": { "type": "string" }, "child-errors": { "type": "array", "items": { "$ref": "#/definitions/Error" } } } } } } spec-0.21.0/fixtures/bugs/1429/000077500000000000000000000000001457312531500157425ustar00rootroot00000000000000spec-0.21.0/fixtures/bugs/1429/remote/000077500000000000000000000000001457312531500172355ustar00rootroot00000000000000spec-0.21.0/fixtures/bugs/1429/remote/farther/000077500000000000000000000000001457312531500206705ustar00rootroot00000000000000spec-0.21.0/fixtures/bugs/1429/remote/farther/farther.yaml000066400000000000000000000001211457312531500232010ustar00rootroot00000000000000farFarAway: type: object properties: farFarAwayProp: type: integer spec-0.21.0/fixtures/bugs/1429/remote/remote.yaml000066400000000000000000000003511457312531500214130ustar00rootroot00000000000000aRemotePlace: type: object properties: remoteProp: type: integer fartherProp: $ref: './farther/farther.yaml#/farFarAway' moreRemoteThanYouCanThink: #$ref: './remote/remote.yaml#/farFarAway' type: integer spec-0.21.0/fixtures/bugs/1429/remote/remote/000077500000000000000000000000001457312531500205305ustar00rootroot00000000000000spec-0.21.0/fixtures/bugs/1429/remote/remote/remote.yaml000066400000000000000000000001211457312531500227010ustar00rootroot00000000000000farFarAway: type: object properties: farFarAwayProp: type: integer spec-0.21.0/fixtures/bugs/1429/responses.yaml000066400000000000000000000041621457312531500206520ustar00rootroot00000000000000swagger: '2.0' info: title: Responses version: 0.1.0 definitions: Error: type: object description: | Contains all the properties any error response from the API will contain. Some properties are optional so might be empty most of the time required: - code - message properties: code: description: the error code, this is not necessarily the http status code type: integer format: int32 message: description: a human readable version of the error type: string helpUrl: description: an optional url for getting more help about this error type: string format: uri myArray: type: array items: $ref: '#/definitions/myItems' myItems: type: object properties: propItems1: type: integer propItems2: $ref: 'remote/remote.yaml#/aRemotePlace' otherPlace: Error: type: object properties: message: type: string parameters: BadRequest: name: badRequest in: body schema: $ref: '#/definitions/Error' GoodRequest: name: goodRequest in: body schema: $ref: '#/otherPlace/Error' PlainRequest: name: plainRequest in: body schema: type: integer StrangeRequest: name: stangeRequest in: body schema: $ref: 'responses.yaml#/otherPlace/Error' RemoteRequest: name: remoteRequest in: body schema: $ref: './remote/remote.yaml#/moreRemoteThanYouCanThink' responses: BadRequest: description: Bad request schema: $ref: '#/definitions/Error' GoodRequest: description: good request schema: $ref: '#/otherPlace/Error' PlainRequest: description: plain request schema: type: integer StrangeRequest: description: strange request schema: $ref: 'responses.yaml#/otherPlace/Error' RemoteRequest: description: remote request schema: $ref: './remote/remote.yaml#/moreRemoteThanYouCanThink' paths: /: get: summary: GET operationId: getAll responses: 200: description: Ok spec-0.21.0/fixtures/bugs/1429/swagger.yaml000066400000000000000000000021151457312531500202640ustar00rootroot00000000000000swagger: '2.0' info: title: Object version: 0.1.0 paths: /: get: summary: GET operationId: getAll parameters: - $ref: 'responses.yaml#/parameters/BadRequest' - $ref: 'responses.yaml#/parameters/GoodRequest' - $ref: 'responses.yaml#/parameters/PlainRequest' - $ref: 'responses.yaml#/parameters/StrangeRequest' - $ref: 'responses.yaml#/parameters/RemoteRequest' - name: nestedBody in: body schema: $ref: '#/definitions/nestedRefDefinition' responses: 200: description: Ok 400: $ref: 'responses.yaml#/responses/BadRequest' 403: $ref: 'responses.yaml#/responses/GoodRequest' 404: $ref: 'responses.yaml#/responses/PlainRequest' 304: $ref: 'responses.yaml#/responses/StrangeRequest' 204: $ref: 'responses.yaml#/responses/RemoteRequest' definitions: badDefinition: $ref: 'responses.yaml#/definitions/Error' nestedRefDefinition: $ref: 'responses.yaml#/definitions/myArray' spec-0.21.0/fixtures/bugs/145/000077500000000000000000000000001457312531500156545ustar00rootroot00000000000000spec-0.21.0/fixtures/bugs/145/Program Files (x86)/000077500000000000000000000000001457312531500210355ustar00rootroot00000000000000spec-0.21.0/fixtures/bugs/145/Program Files (x86)/AppName/000077500000000000000000000000001457312531500223565ustar00rootroot00000000000000spec-0.21.0/fixtures/bugs/145/Program Files (x86)/AppName/ref.json000066400000000000000000000004621457312531500240270ustar00rootroot00000000000000{ "definitions": { "todo-partial": { "title": "Todo Partial", "type": "object", "properties": { "name": { "type": "string" }, "completed": { "type": ["boolean", "null"] } }, "required": ["name", "completed"] } } } spec-0.21.0/fixtures/bugs/145/Program Files (x86)/AppName/todos.common.json000066400000000000000000000045471457312531500257020ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "version": "1.0", "title": "To-do Demo", "description": "### Notes:\n\nThis OAS2 (Swagger 2) specification defines common models and responses, that other specifications may reference.\n\nFor example, check out the user poperty in the main.oas2 todo-partial model - it references the user model in this specification!\n\nLikewise, the main.oas2 operations reference the shared error responses in this common specification.", "contact": { "name": "Stoplight", "url": "https://stoplight.io" }, "license": { "name": "MIT" } }, "host": "example.com", "securityDefinitions": {}, "paths": {}, "responses": { "401": { "description": "", "schema": { "$ref": "#/definitions/error-response" }, "examples": { "application/json": { "status": "401", "error": "Not Authorized" } } }, "403": { "description": "", "schema": { "$ref": "#/definitions/error-response" }, "examples": { "application/json": { "status": "403", "error": "Forbbiden" } } }, "404": { "description": "", "schema": { "$ref": "#/definitions/error-response" }, "examples": { "application/json": { "status": "404", "error": "Not Found" } } }, "500": { "description": "", "schema": { "$ref": "#/definitions/error-response" }, "examples": { "application/json": { "status": "500", "error": "Server Error" } } } }, "definitions": { "user": { "title": "User", "type": "object", "properties": { "name": { "type": "string", "description": "The user's full name." }, "age": { "type": "number", "minimum": 0, "maximum": 150 }, "error": { "$ref": "#/definitions/error-response" } }, "required": ["name", "age"] }, "error-response": { "type": "object", "title": "Error Response", "properties": { "status": { "type": "string" }, "error": { "type": "string" } }, "required": ["status", "error"] } } } spec-0.21.0/fixtures/bugs/145/Program Files (x86)/AppName/todos.json000066400000000000000000000212431457312531500244030ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "version": "1.0", "title": "To-do Demo", "description": "This OAS2 (Swagger 2) file represents a real API that lives at http://todos.stoplight.io.\n\nFor authentication information, click the apikey security scheme in the editor sidebar.", "contact": { "name": "Stoplight", "url": "https://stoplight.io" }, "license": { "name": "MIT" } }, "host": "todos.stoplight.io", "schemes": ["http"], "consumes": ["application/json"], "produces": ["application/json"], "securityDefinitions": { "Basic": { "type": "basic" }, "API Key": { "type": "apiKey", "name": "apikey", "in": "query" } }, "paths": { "/todos/{todoId}": { "parameters": [{ "name": "todoId", "in": "path", "required": true, "type": "string" }], "get": { "operationId": "GET_todo", "summary": "Get Todo", "tags": ["Todos"], "responses": { "200": { "description": "", "schema": { "$ref": "#/definitions/todo-full" }, "examples": { "application/json": { "id": 1, "name": "get food", "completed": false, "completed_at": "1955-04-23T13:22:52.685Z", "created_at": "1994-11-05T03:26:51.471Z", "updated_at": "1989-07-29T11:30:06.701Z" }, "/todos/foobar": "{\n\t\"foo\": \"bar\"\n}\n", "/todos/chores": { "id": 9000, "name": "Do Chores", "completed": false, "created_at": "2014-08-28T14:14:28.494Z", "updated_at": "2014-08-28T14:14:28.494Z" }, "new": { "name": "esse qui proident labore", "completed": null, "id": 920778, "completed_at": "2014-01-07T07:49:55.123Z", "created_at": "1948-04-21T12:04:21.282Z", "updated_at": "1951-12-19T11:10:34.039Z", "user": { "name": "irure deserunt fugiat", "age": 121.45395681110494 }, "float": -47990796.228164576 } } }, "404": { "$ref": "./todos.common.json#/responses/404" }, "500": { "$ref": "./todos.common.json#/responses/500" } }, "parameters": [{ "in": "query", "name": "", "type": "string" }] }, "put": { "operationId": "PUT_todos", "summary": "Update Todo", "tags": ["Todos"], "parameters": [{ "name": "body", "in": "body", "schema": { "$ref": "#/definitions/todo-partial", "example": { "name": "my todo's new name", "completed": false } } }], "responses": { "200": { "description": "", "schema": { "$ref": "#/definitions/todo-full" }, "examples": { "application/json": { "id": 9000, "name": "It's Over 9000!!!", "completed": true, "completed_at": null, "created_at": "2014-08-28T14:14:28.494Z", "updated_at": "2015-08-28T14:14:28.494Z" } } }, "401": { "$ref": "./todos.common.json#/responses/401" }, "404": { "$ref": "./todos.common.json#/responses/404" }, "500": { "$ref": "./todos.common.json#/responses/500" } }, "security": [{ "Basic": [] }, { "API Key": [] } ] }, "delete": { "operationId": "DELETE_todo", "summary": "Delete Todo", "tags": ["Todos"], "responses": { "204": { "description": "" }, "401": { "$ref": "./todos.common.json#/responses/401" }, "404": { "$ref": "./todos.common.json#/responses/404" }, "500": { "$ref": "./todos.common.json#/responses/500" } }, "security": [{ "Basic": [] }, { "API Key": [] } ] } }, "/todos": { "post": { "operationId": "POST_todos", "summary": "Create Todo", "tags": ["Todos"], "parameters": [{ "name": "body", "in": "body", "schema": { "$ref": "#/definitions/todo-partial", "example": { "name": "my todo's name", "completed": false } } }], "responses": { "201": { "description": "", "schema": { "$ref": "#/definitions/todo-full" }, "examples": { "application/json": { "id": 9000, "name": "It's Over 9000!!!", "completed": null, "completed_at": null, "created_at": "2014-08-28T14:14:28.494Z", "updated_at": "2014-08-28T14:14:28.494Z" }, "/todos/chores": { "id": 9000, "name": "Do Chores", "completed": false, "created_at": "2014-08-28T14:14:28.494Z", "updated_at": "2014-08-28T14:14:28.494Z" } } }, "401": { "$ref": "./todos.common.json#/responses/401" }, "500": { "$ref": "./todos.common.json#/responses/500" } }, "security": [{ "API Key": [] }, { "Basic": [] } ], "description": "This creates a Todo object.\n\nTesting `inline code`." }, "get": { "operationId": "GET_todos", "summary": "List Todos", "tags": ["Todos"], "parameters": [{ "$ref": "#/parameters/limit" }, { "$ref": "#/parameters/skip" } ], "responses": { "200": { "description": "", "schema": { "type": "array", "items": { "$ref": "#/definitions/todo-full" } }, "examples": { "application/json": [{ "id": 1, "name": "design the thingz", "completed": true }, { "id": 2, "name": "mock the thingz", "completed": true }, { "id": 3, "name": "code the thingz", "completed": false } ], "empty": [] }, "headers": { "foo": { "type": "string", "default": "bar" } } }, "500": { "$ref": "./todos.common.json#/responses/500" } }, "description": "​" } } }, "parameters": { "limit": { "name": "limit", "in": "query", "description": "This is how it works.", "required": false, "type": "integer", "maximum": 100 }, "skip": { "name": "skip", "in": "query", "required": false, "type": "string" } }, "definitions": { "todo-partial": { "$ref": "ref.json#/definitions/todo-partial" }, "todo-full": { "title": "Todo Full", "allOf": [{ "$ref": "#/definitions/todo-partial" }, { "type": "object", "properties": { "id": { "type": "integer", "minimum": 0, "maximum": 1000000 }, "completed_at": { "type": ["string", "null"], "format": "date-time" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "user": { "$ref": "./todos.common.json#/definitions/user" } }, "required": ["id", "user"] } ] } }, "tags": [{ "name": "Todos" }] } spec-0.21.0/fixtures/bugs/1614/000077500000000000000000000000001457312531500157365ustar00rootroot00000000000000spec-0.21.0/fixtures/bugs/1614/gitea.json000066400000000000000000005725061457312531500177410ustar00rootroot00000000000000{ "consumes": [ "application/json", "text/plain" ], "produces": [ "application/json", "text/html" ], "schemes": [ "http", "https" ], "swagger": "2.0", "info": { "description": "This documentation describes the Gitea API.", "title": "Gitea API.", "license": { "name": "MIT", "url": "http://opensource.org/licenses/MIT" }, "version": "1.1.1" }, "basePath": "/api/v1", "paths": { "/admin/users": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "Create a user", "operationId": "adminCreateUser", "parameters": [ { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/CreateUserOption" } } ], "responses": { "201": { "$ref": "#/responses/User" }, "403": { "$ref": "#/responses/forbidden" }, "422": { "$ref": "#/responses/validationError" } } } }, "/admin/users/{username}": { "delete": { "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "Delete a user", "operationId": "adminDeleteUser", "parameters": [ { "type": "string", "description": "username of user to delete", "name": "username", "in": "path", "required": true } ], "responses": { "204": { "$ref": "#/responses/empty" }, "403": { "$ref": "#/responses/forbidden" }, "422": { "$ref": "#/responses/validationError" } } }, "patch": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "Edit an existing user", "operationId": "adminEditUser", "parameters": [ { "type": "string", "description": "username of user to edit", "name": "username", "in": "path", "required": true }, { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/EditUserOption" } } ], "responses": { "200": { "$ref": "#/responses/User" }, "403": { "$ref": "#/responses/forbidden" }, "422": { "$ref": "#/responses/validationError" } } } }, "/admin/users/{username}/keys": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "Add a public key on behalf of a user", "operationId": "adminCreatePublicKey", "parameters": [ { "type": "string", "description": "username of the user", "name": "username", "in": "path", "required": true } ], "responses": { "201": { "$ref": "#/responses/PublicKey" }, "403": { "$ref": "#/responses/forbidden" }, "422": { "$ref": "#/responses/validationError" } } } }, "/admin/users/{username}/keys/{id}": { "delete": { "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "Delete a user's public key", "operationId": "adminDeleteUserPublicKey", "parameters": [ { "type": "string", "description": "username of user", "name": "username", "in": "path", "required": true }, { "type": "integer", "description": "id of the key to delete", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "$ref": "#/responses/empty" }, "403": { "$ref": "#/responses/forbidden" }, "404": { "$ref": "#/responses/notFound" } } } }, "/admin/users/{username}/orgs": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "Create an organization", "operationId": "adminCreateOrg", "parameters": [ { "type": "string", "description": "username of the user that will own the created organization", "name": "username", "in": "path", "required": true } ], "responses": { "201": { "$ref": "#/responses/Organization" }, "403": { "$ref": "#/responses/forbidden" }, "422": { "$ref": "#/responses/validationError" } } } }, "/admin/users/{username}/repos": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admin" ], "summary": "Create a repository on behalf a user", "operationId": "adminCreateRepo", "parameters": [ { "type": "string", "description": "username of the user. This user will own the created repository", "name": "username", "in": "path", "required": true } ], "responses": { "201": { "$ref": "#/responses/Repository" }, "403": { "$ref": "#/responses/forbidden" }, "422": { "$ref": "#/responses/validationError" } } } }, "/markdown": { "post": { "consumes": [ "application/json" ], "produces": [ "text/html" ], "tags": [ "miscellaneous" ], "summary": "Render a markdown document as HTML", "operationId": "renderMarkdown", "parameters": [ { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/MarkdownOption" } } ], "responses": { "200": { "$ref": "#/responses/MarkdownRender" }, "422": { "$ref": "#/responses/validationError" } } } }, "/markdown/raw": { "post": { "consumes": [ "text/plain" ], "produces": [ "text/html" ], "tags": [ "miscellaneous" ], "summary": "Render raw markdown as HTML", "operationId": "renderMarkdownRaw", "parameters": [ { "description": "Request body to render", "name": "body", "in": "body", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "$ref": "#/responses/MarkdownRender" }, "422": { "$ref": "#/responses/validationError" } } } }, "/org/{org}/repos": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "organization" ], "summary": "Create a repository in an organization", "operationId": "createOrgRepo", "parameters": [ { "type": "string", "description": "name of organization", "name": "org", "in": "path", "required": true }, { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/CreateRepoOption" } } ], "responses": { "201": { "$ref": "#/responses/Repository" }, "403": { "$ref": "#/responses/forbidden" }, "422": { "$ref": "#/responses/validationError" } } } }, "/orgs/{org}": { "get": { "produces": [ "application/json" ], "tags": [ "organization" ], "summary": "Get an organization", "operationId": "orgGet", "parameters": [ { "type": "string", "description": "name of the organization to get", "name": "org", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/Organization" } } }, "patch": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "organization" ], "summary": "Edit an organization", "operationId": "orgEdit", "parameters": [ { "type": "string", "description": "name of the organization to edit", "name": "org", "in": "path", "required": true }, { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/EditOrgOption" } } ], "responses": { "200": { "$ref": "#/responses/Organization" } } } }, "/orgs/{org}/hooks": { "get": { "produces": [ "application/json" ], "tags": [ "organization" ], "summary": "List an organization's webhooks", "operationId": "orgListHooks", "parameters": [ { "type": "string", "description": "name of the organization", "name": "org", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/HookList" } } } }, "/orgs/{org}/hooks/": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "organization" ], "summary": "Create a hook", "operationId": "orgCreateHook", "parameters": [ { "type": "string", "description": "name of the organization", "name": "org", "in": "path", "required": true } ], "responses": { "201": { "$ref": "#/responses/Hook" } } } }, "/orgs/{org}/hooks/{id}": { "get": { "produces": [ "application/json" ], "tags": [ "organization" ], "summary": "Get a hook", "operationId": "orgGetHook", "parameters": [ { "type": "string", "description": "name of the organization", "name": "org", "in": "path", "required": true }, { "type": "integer", "description": "id of the hook to get", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/Hook" } } }, "delete": { "produces": [ "application/json" ], "tags": [ "organization" ], "summary": "Delete a hook", "operationId": "orgDeleteHook", "parameters": [ { "type": "string", "description": "name of the organization", "name": "org", "in": "path", "required": true }, { "type": "integer", "description": "id of the hook to delete", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "$ref": "#/responses/empty" } } }, "patch": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "organization" ], "summary": "Update a hook", "operationId": "orgEditHook", "parameters": [ { "type": "string", "description": "name of the organization", "name": "org", "in": "path", "required": true }, { "type": "integer", "description": "id of the hook to update", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/Hook" } } } }, "/orgs/{org}/members": { "get": { "produces": [ "application/json" ], "tags": [ "organization" ], "summary": "List an organization's members", "operationId": "orgListMembers", "parameters": [ { "type": "string", "description": "name of the organization", "name": "org", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/UserList" } } } }, "/orgs/{org}/members/{username}": { "get": { "tags": [ "organization" ], "summary": "Check if a user is a member of an organization", "operationId": "orgIsMember", "parameters": [ { "type": "string", "description": "name of the organization", "name": "org", "in": "path", "required": true }, { "type": "string", "description": "username of the user", "name": "username", "in": "path", "required": true } ], "responses": { "204": { "description": "user is a member", "schema": { "$ref": "#/responses/empty" } }, "404": { "description": "user is not a member", "schema": { "$ref": "#/responses/empty" } } } }, "delete": { "produces": [ "application/json" ], "tags": [ "organization" ], "summary": "Remove a member from an organization", "operationId": "orgDeleteMember", "parameters": [ { "type": "string", "description": "name of the organization", "name": "org", "in": "path", "required": true }, { "type": "string", "description": "username of the user", "name": "username", "in": "path", "required": true } ], "responses": { "204": { "description": "member removed", "schema": { "$ref": "#/responses/empty" } } } } }, "/orgs/{org}/public_members": { "get": { "produces": [ "application/json" ], "tags": [ "organization" ], "summary": "List an organization's public members", "operationId": "orgListPublicMembers", "parameters": [ { "type": "string", "description": "name of the organization", "name": "org", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/UserList" } } } }, "/orgs/{org}/public_members/{username}": { "get": { "tags": [ "organization" ], "summary": "Check if a user is a public member of an organization", "operationId": "orgIsPublicMember", "parameters": [ { "type": "string", "description": "name of the organization", "name": "org", "in": "path", "required": true }, { "type": "string", "description": "username of the user", "name": "username", "in": "path", "required": true } ], "responses": { "204": { "description": "user is a public member", "schema": { "$ref": "#/responses/empty" } }, "404": { "description": "user is not a public member", "schema": { "$ref": "#/responses/empty" } } } }, "put": { "produces": [ "application/json" ], "tags": [ "organization" ], "summary": "Publicize a user's membership", "operationId": "orgPublicizeMember", "parameters": [ { "type": "string", "description": "name of the organization", "name": "org", "in": "path", "required": true }, { "type": "string", "description": "username of the user", "name": "username", "in": "path", "required": true } ], "responses": { "204": { "description": "membership publicized", "schema": { "$ref": "#/responses/empty" } } } }, "delete": { "produces": [ "application/json" ], "tags": [ "organization" ], "summary": "Conceal a user's membership", "operationId": "orgConcealMember", "parameters": [ { "type": "string", "description": "name of the organization", "name": "org", "in": "path", "required": true }, { "type": "string", "description": "username of the user", "name": "username", "in": "path", "required": true } ], "responses": { "204": { "$ref": "#/responses/empty" } } } }, "/orgs/{org}/repos": { "get": { "produces": [ "application/json" ], "tags": [ "organization" ], "summary": "List an organization's repos", "operationId": "orgListRepos", "parameters": [ { "type": "string", "description": "name of the organization", "name": "org", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/RepositoryList" } } } }, "/orgs/{org}/teams": { "get": { "produces": [ "application/json" ], "tags": [ "organization" ], "summary": "List an organization's teams", "operationId": "orgListTeams", "parameters": [ { "type": "string", "description": "name of the organization", "name": "org", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/TeamList" } } }, "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "organization" ], "summary": "Create a team", "operationId": "orgCreateTeam", "parameters": [ { "type": "string", "description": "name of the organization", "name": "org", "in": "path", "required": true }, { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/CreateTeamOption" } } ], "responses": { "201": { "$ref": "#/responses/Team" } } } }, "/repos/migrate": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "Migrate a remote git repository", "operationId": "repoMigrate", "parameters": [ { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/MigrateRepoForm" } } ], "responses": { "201": { "$ref": "#/responses/Repository" } } } }, "/repos/search": { "get": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "Search for repositories", "operationId": "repoSearch", "parameters": [ { "type": "string", "description": "keyword", "name": "q", "in": "query" }, { "type": "integer", "description": "search only for repos that the user with the given id owns or contributes to", "name": "uid", "in": "query" }, { "type": "integer", "description": "page number of results to return (1-based)", "name": "page", "in": "query" }, { "type": "integer", "description": "page size of results, maximum page size is 50", "name": "limit", "in": "query" }, { "type": "string", "description": "type of repository to search for. Supported values are \"fork\", \"source\", \"mirror\" and \"collaborative\"", "name": "mode", "in": "query" }, { "type": "boolean", "description": "if `uid` is given, search only for repos that the user owns", "name": "exclusive", "in": "query" } ], "responses": { "200": { "$ref": "#/responses/SearchResults" }, "422": { "$ref": "#/responses/validationError" } } } }, "/repos/{owner}/{repo}": { "get": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "Get a repository", "operationId": "repoGet", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/Repository" } } }, "delete": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "Delete a repository", "operationId": "repoDelete", "parameters": [ { "type": "string", "description": "owner of the repo to delete", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo to delete", "name": "repo", "in": "path", "required": true } ], "responses": { "204": { "$ref": "#/responses/empty" }, "403": { "$ref": "#/responses/forbidden" } } } }, "/repos/{owner}/{repo}/archive/{archive}": { "get": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "Get an archive of a repository", "operationId": "repoGetArchive", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "string", "description": "archive to download, consisting of a git reference and archive", "name": "archive", "in": "path", "required": true } ], "responses": { "200": { "description": "success" } } } }, "/repos/{owner}/{repo}/branches": { "get": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "List a repository's branches", "operationId": "repoListBranches", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/BranchList" } } } }, "/repos/{owner}/{repo}/branches/{branch}": { "get": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "List a repository's branches", "operationId": "repoGetBranch", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "string", "description": "branch to get", "name": "branch", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/Branch" } } } }, "/repos/{owner}/{repo}/collaborators": { "get": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "List a repository's collaborators", "operationId": "repoListCollaborators", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/UserList" } } } }, "/repos/{owner}/{repo}/collaborators/{collaborator}": { "get": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "Check if a user is a collaborator of a repository", "operationId": "repoCheckCollaborator", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "string", "description": "username of the collaborator", "name": "collaborator", "in": "path", "required": true } ], "responses": { "204": { "$ref": "#/responses/empty" }, "404": { "$ref": "#/responses/empty" } } }, "put": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "Add a collaborator to a repository", "operationId": "repoAddCollaborator", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "string", "description": "username of the collaborator to add", "name": "collaborator", "in": "path", "required": true }, { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/AddCollaboratorOption" } } ], "responses": { "204": { "$ref": "#/responses/empty" } } }, "delete": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "Delete a collaborator from a repository", "operationId": "repoDeleteCollaborator", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "string", "description": "username of the collaborator to delete", "name": "collaborator", "in": "path", "required": true } ], "responses": { "204": { "$ref": "#/responses/empty" } } } }, "/repos/{owner}/{repo}/commits/{ref}/statuses": { "get": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "Get a commit's combined status, by branch/tag/commit reference", "operationId": "repoGetCombinedStatusByRef", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "string", "description": "name of branch/tag/commit", "name": "ref", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/Status" } } } }, "/repos/{owner}/{repo}/editorconfig/{filepath}": { "get": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "Get the EditorConfig definitions of a file in a repository", "operationId": "repoGetEditorConfig", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "string", "description": "filepath of file to get", "name": "filepath", "in": "path", "required": true } ], "responses": { "200": { "description": "success" } } } }, "/repos/{owner}/{repo}/forks": { "get": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "List a repository's forks", "operationId": "listForks", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/RepositoryList" } } }, "post": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "Fork a repository", "operationId": "createFork", "parameters": [ { "type": "string", "description": "owner of the repo to fork", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo to fork", "name": "repo", "in": "path", "required": true }, { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/CreateForkOption" } } ], "responses": { "202": { "$ref": "#/responses/Repository" } } } }, "/repos/{owner}/{repo}/hooks": { "get": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "List the hooks in a repository", "operationId": "repoListHooks", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/HookList" } } }, "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "Create a hook", "operationId": "repoCreateHook", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/CreateHookOption" } } ], "responses": { "201": { "$ref": "#/responses/Hook" } } } }, "/repos/{owner}/{repo}/hooks/{id}": { "get": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "Get a hook", "operationId": "repoGetHook", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "id of the hook to get", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/Hook" } } }, "delete": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "Delete a hook in a repository", "operationId": "repoDeleteHook", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "id of the hook to delete", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "$ref": "#/responses/empty" }, "404": { "$ref": "#/responses/notFound" } } }, "patch": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "Edit a hook in a repository", "operationId": "repoEditHook", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "index of the hook", "name": "id", "in": "path", "required": true }, { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/EditHookOption" } } ], "responses": { "200": { "$ref": "#/responses/Hook" } } } }, "/repos/{owner}/{repo}/hooks/{id}/tests": { "post": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "Test a push webhook", "operationId": "repoTestHook", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "id of the hook to test", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "$ref": "#/responses/empty" } } } }, "/repos/{owner}/{repo}/issues": { "get": { "produces": [ "application/json" ], "tags": [ "issue" ], "summary": "List a repository's issues", "operationId": "issueListIssues", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "string", "description": "whether issue is open or closed", "name": "state", "in": "query" }, { "type": "integer", "description": "page number of requested issues", "name": "page", "in": "query" }, { "type": "string", "description": "search string", "name": "q", "in": "query" } ], "responses": { "200": { "$ref": "#/responses/IssueList" } } }, "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "issue" ], "summary": "Create an issue", "operationId": "issueCreateIssue", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/CreateIssueOption" } } ], "responses": { "201": { "$ref": "#/responses/Issue" } } } }, "/repos/{owner}/{repo}/issues/comments": { "get": { "produces": [ "application/json" ], "tags": [ "issue" ], "summary": "List all comments in a repository", "operationId": "issueGetRepoComments", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "string", "description": "if provided, only comments updated since the provided time are returned.", "name": "string", "in": "query" } ], "responses": { "200": { "$ref": "#/responses/CommentList" } } } }, "/repos/{owner}/{repo}/issues/comments/{id}": { "delete": { "tags": [ "issue" ], "summary": "Delete a comment", "operationId": "issueDeleteComment", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "id of comment to delete", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "$ref": "#/responses/empty" } } }, "patch": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "issue" ], "summary": "Edit a comment", "operationId": "issueEditComment", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "id of the comment to edit", "name": "id", "in": "path", "required": true }, { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/EditIssueCommentOption" } } ], "responses": { "200": { "$ref": "#/responses/Comment" } } } }, "/repos/{owner}/{repo}/issues/{id}/times": { "get": { "produces": [ "application/json" ], "tags": [ "issue" ], "summary": "List an issue's tracked times", "operationId": "issueTrackedTimes", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "index of the issue", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/TrackedTimeList" } } }, "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "issue" ], "summary": "Add a tracked time to a issue", "operationId": "issueAddTime", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "index of the issue to add tracked time to", "name": "id", "in": "path", "required": true }, { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/AddTimeOption" } } ], "responses": { "200": { "$ref": "#/responses/TrackedTime" }, "400": { "$ref": "#/responses/error" }, "403": { "$ref": "#/responses/error" } } } }, "/repos/{owner}/{repo}/issues/{index}": { "get": { "produces": [ "application/json" ], "tags": [ "issue" ], "summary": "Get an issue", "operationId": "issueGetIssue", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "index of the issue to get", "name": "index", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/Issue" } } }, "patch": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "issue" ], "summary": "Edit an issue", "operationId": "issueEditIssue", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "index of the issue to edit", "name": "index", "in": "path", "required": true }, { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/EditIssueOption" } } ], "responses": { "201": { "$ref": "#/responses/Issue" } } } }, "/repos/{owner}/{repo}/issues/{index}/comments": { "get": { "produces": [ "application/json" ], "tags": [ "issue" ], "summary": "List all comments on an issue", "operationId": "issueGetComments", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "index of the issue", "name": "index", "in": "path", "required": true }, { "type": "string", "description": "if provided, only comments updated since the specified time are returned.", "name": "string", "in": "query" } ], "responses": { "200": { "$ref": "#/responses/CommentList" } } }, "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "issue" ], "summary": "Add a comment to an issue", "operationId": "issueCreateComment", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "index of the issue", "name": "index", "in": "path", "required": true }, { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/CreateIssueCommentOption" } } ], "responses": { "201": { "$ref": "#/responses/Comment" } } } }, "/repos/{owner}/{repo}/issues/{index}/comments/{id}": { "delete": { "tags": [ "issue" ], "summary": "Delete a comment", "operationId": "issueDeleteCommentDeprecated", "deprecated": true, "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "this parameter is ignored", "name": "index", "in": "path", "required": true }, { "type": "integer", "description": "id of comment to delete", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "$ref": "#/responses/empty" } } }, "patch": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "issue" ], "summary": "Edit a comment", "operationId": "issueEditCommentDeprecated", "deprecated": true, "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "this parameter is ignored", "name": "index", "in": "path", "required": true }, { "type": "integer", "description": "id of the comment to edit", "name": "id", "in": "path", "required": true }, { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/EditIssueCommentOption" } } ], "responses": { "200": { "$ref": "#/responses/Comment" } } } }, "/repos/{owner}/{repo}/issues/{index}/labels": { "get": { "produces": [ "application/json" ], "tags": [ "issue" ], "summary": "Get an issue's labels", "operationId": "issueGetLabels", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "index of the issue", "name": "index", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/LabelList" }, "404": { "$ref": "#/responses/notFound" } } }, "put": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "issue" ], "summary": "Replace an issue's labels", "operationId": "issueReplaceLabels", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "index of the issue", "name": "index", "in": "path", "required": true }, { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/IssueLabelsOption" } } ], "responses": { "200": { "$ref": "#/responses/LabelList" } } }, "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "issue" ], "summary": "Add a label to an issue", "operationId": "issueAddLabel", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "index of the issue", "name": "index", "in": "path", "required": true }, { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/IssueLabelsOption" } } ], "responses": { "200": { "$ref": "#/responses/LabelList" } } }, "delete": { "produces": [ "application/json" ], "tags": [ "issue" ], "summary": "Remove all labels from an issue", "operationId": "issueClearLabels", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "index of the issue", "name": "index", "in": "path", "required": true } ], "responses": { "204": { "$ref": "#/responses/empty" } } } }, "/repos/{owner}/{repo}/issues/{index}/labels/{id}": { "delete": { "produces": [ "application/json" ], "tags": [ "issue" ], "summary": "Remove a label from an issue", "operationId": "issueRemoveLabel", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "index of the issue", "name": "index", "in": "path", "required": true }, { "type": "integer", "description": "id of the label to remove", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "$ref": "#/responses/empty" } } } }, "/repos/{owner}/{repo}/keys": { "get": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "List a repository's keys", "operationId": "repoListKeys", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/DeployKeyList" } } }, "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "Add a key to a repository", "operationId": "repoCreateKey", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/CreateKeyOption" } } ], "responses": { "201": { "$ref": "#/responses/DeployKey" } } } }, "/repos/{owner}/{repo}/keys/{id}": { "get": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "Get a repository's key by id", "operationId": "repoGetKey", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "id of the key to get", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/DeployKey" } } }, "delete": { "tags": [ "repository" ], "summary": "Delete a key from a repository", "operationId": "repoDeleteKey", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "id of the key to delete", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "$ref": "#/responses/empty" } } } }, "/repos/{owner}/{repo}/labels": { "get": { "produces": [ "application/json" ], "tags": [ "issue" ], "summary": "Get all of a repository's labels", "operationId": "issueListLabels", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/LabelList" } } }, "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "issue" ], "summary": "Create a label", "operationId": "issueCreateLabel", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/CreateLabelOption" } } ], "responses": { "201": { "$ref": "#/responses/Label" } } } }, "/repos/{owner}/{repo}/labels/{id}": { "get": { "produces": [ "application/json" ], "tags": [ "issue" ], "summary": "Get a single label", "operationId": "issueGetLabel", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "id of the label to get", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/Label" } } }, "delete": { "tags": [ "issue" ], "summary": "Delete a label", "operationId": "issueDeleteLabel", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "id of the label to delete", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "$ref": "#/responses/empty" } } }, "patch": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "issue" ], "summary": "Update a label", "operationId": "issueEditLabel", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "id of the label to edit", "name": "id", "in": "path", "required": true }, { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/EditLabelOption" } } ], "responses": { "200": { "$ref": "#/responses/Label" } } } }, "/repos/{owner}/{repo}/milestones": { "get": { "produces": [ "application/json" ], "tags": [ "issue" ], "summary": "Get all of a repository's milestones", "operationId": "issueGetMilestonesList", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/MilestoneList" } } }, "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "issue" ], "summary": "Create a milestone", "operationId": "issueCreateMilestone", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/CreateMilestoneOption" } } ], "responses": { "201": { "$ref": "#/responses/Milestone" } } } }, "/repos/{owner}/{repo}/milestones/{id}": { "get": { "produces": [ "application/json" ], "tags": [ "issue" ], "summary": "Get a milestone", "operationId": "issueGetMilestone", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "id of the milestone", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/Milestone" } } }, "delete": { "tags": [ "issue" ], "summary": "Delete a milestone", "operationId": "issueDeleteMilestone", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "id of the milestone to delete", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "$ref": "#/responses/empty" } } }, "patch": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "issue" ], "summary": "Update a milestone", "operationId": "issueEditMilestone", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "id of the milestone", "name": "id", "in": "path", "required": true }, { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/EditMilestoneOption" } } ], "responses": { "200": { "$ref": "#/responses/Milestone" } } } }, "/repos/{owner}/{repo}/mirror-sync": { "post": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "Sync a mirrored repository", "operationId": "repoMirrorSync", "parameters": [ { "type": "string", "description": "owner of the repo to sync", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo to sync", "name": "repo", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/empty" } } } }, "/repos/{owner}/{repo}/pulls": { "get": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "List a repo's pull requests", "operationId": "repoListPullRequests", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/PullRequestList" } } }, "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "Create a pull request", "operationId": "repoCreatePullRequest", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/CreatePullRequestOption" } } ], "responses": { "201": { "$ref": "#/responses/PullRequest" } } } }, "/repos/{owner}/{repo}/pulls/{index}": { "get": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "Get a pull request", "operationId": "repoGetPullRequest", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "index of the pull request to get", "name": "index", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/PullRequest" } } }, "patch": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "Update a pull request", "operationId": "repoEditPullRequest", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "index of the pull request to edit", "name": "index", "in": "path", "required": true }, { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/EditPullRequestOption" } } ], "responses": { "201": { "$ref": "#/responses/PullRequest" } } } }, "/repos/{owner}/{repo}/pulls/{index}/merge": { "get": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "Check if a pull request has been merged", "operationId": "repoPullRequestIsMerged", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "index of the pull request", "name": "index", "in": "path", "required": true } ], "responses": { "204": { "description": "pull request has been merged", "schema": { "$ref": "#/responses/empty" } }, "404": { "description": "pull request has not been merged", "schema": { "$ref": "#/responses/empty" } } } }, "post": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "Merge a pull request", "operationId": "repoMergePullRequest", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "index of the pull request to merge", "name": "index", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/empty" }, "405": { "$ref": "#/responses/empty" } } } }, "/repos/{owner}/{repo}/raw/{filepath}": { "get": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "Get a file from a repository", "operationId": "repoGetRawFile", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "string", "description": "filepath of the file to get", "name": "filepath", "in": "path", "required": true } ], "responses": { "200": { "description": "success" } } } }, "/repos/{owner}/{repo}/releases": { "get": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "List a repo's releases", "operationId": "repoListReleases", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/ReleaseList" } } }, "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "Create a release", "operationId": "repoCreateRelease", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/CreateReleaseOption" } } ], "responses": { "201": { "$ref": "#/responses/Release" } } } }, "/repos/{owner}/{repo}/releases/{id}": { "get": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "Get a release", "operationId": "repoGetRelease", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "id of the release to get", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/Release" } } }, "delete": { "tags": [ "repository" ], "summary": "Delete a release", "operationId": "repoDeleteRelease", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "id of the release to delete", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "$ref": "#/responses/empty" } } }, "patch": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "Update a release", "operationId": "repoEditRelease", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "id of the release to edit", "name": "id", "in": "path", "required": true }, { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/EditReleaseOption" } } ], "responses": { "200": { "$ref": "#/responses/Release" } } } }, "/repos/{owner}/{repo}/releases/{id}/assets": { "get": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "List release's attachments", "operationId": "repoListReleaseAttachments", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "id of the release", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/AttachmentList" } } }, "post": { "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "Create a release attachment", "operationId": "repoCreateReleaseAttachment", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "id of the release", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "name of the attachment", "name": "name", "in": "query" }, { "type": "file", "description": "attachment to upload", "name": "attachment", "in": "formData", "required": true } ], "responses": { "201": { "$ref": "#/responses/Attachment" } } } }, "/repos/{owner}/{repo}/releases/{id}/assets/{attachment_id}": { "get": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "Get a release attachment", "operationId": "repoGetReleaseAttachment", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "id of the release", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "id of the attachment to get", "name": "attachment_id", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/Attachment" } } }, "delete": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "Delete a release attachment", "operationId": "repoDeleteReleaseAttachment", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "id of the release", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "id of the attachment to delete", "name": "attachment_id", "in": "path", "required": true } ], "responses": { "204": { "$ref": "#/responses/empty" } } }, "patch": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "Edit a release attachment", "operationId": "repoEditReleaseAttachment", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "integer", "description": "id of the release", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "id of the attachment to edit", "name": "attachment_id", "in": "path", "required": true }, { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/EditAttachmentOptions" } } ], "responses": { "201": { "$ref": "#/responses/Attachment" } } } }, "/repos/{owner}/{repo}/stargazers": { "get": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "List a repo's stargazers", "operationId": "repoListStargazers", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/UserList" } } } }, "/repos/{owner}/{repo}/statuses/{sha}": { "get": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "Get a commit's statuses", "operationId": "repoListStatuses", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "string", "description": "sha of the commit", "name": "sha", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/StatusList" } } }, "post": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "Create a commit status", "operationId": "repoCreateStatus", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "string", "description": "sha of the commit", "name": "sha", "in": "path", "required": true }, { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/CreateStatusOption" } } ], "responses": { "200": { "$ref": "#/responses/StatusList" } } } }, "/repos/{owner}/{repo}/subscribers": { "get": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "List a repo's watchers", "operationId": "repoListSubscribers", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/UserList" } } } }, "/repos/{owner}/{repo}/subscription": { "get": { "tags": [ "repository" ], "summary": "Check if the current user is watching a repo", "operationId": "userCurrentCheckSubscription", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/WatchInfo" } } }, "put": { "tags": [ "repository" ], "summary": "Watch a repo", "operationId": "userCurrentPutSubscription", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/WatchInfo" } } }, "delete": { "tags": [ "repository" ], "summary": "Unwatch a repo", "operationId": "userCurrentDeleteSubscription", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true } ], "responses": { "204": { "$ref": "#/responses/empty" } } } }, "/repos/{owner}/{repo}/times": { "get": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "List a repo's tracked times", "operationId": "repoTrackedTimes", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/TrackedTimeList" } } } }, "/repos/{owner}/{repo}/times/{user}": { "get": { "produces": [ "application/json" ], "tags": [ "user" ], "summary": "List a user's tracked times in a repo", "operationId": "userTrackedTimes", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true }, { "type": "string", "description": "username of user", "name": "user", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/TrackedTimeList" } } } }, "/repositories/{id}": { "get": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "Get a repository by id", "operationId": "repoGetByID", "parameters": [ { "type": "integer", "description": "id of the repo to get", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/Repository" } } } }, "/teams/{id}": { "get": { "produces": [ "application/json" ], "tags": [ "organization" ], "summary": "Get a team", "operationId": "orgGetTeam", "parameters": [ { "type": "integer", "description": "id of the team to get", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/Team" } } }, "delete": { "tags": [ "organization" ], "summary": "Delete a team", "operationId": "orgDeleteTeam", "parameters": [ { "type": "integer", "description": "id of the team to delete", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "team deleted", "schema": { "$ref": "#/responses/empty" } } } }, "patch": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "organization" ], "summary": "Edit a team", "operationId": "orgEditTeam", "parameters": [ { "type": "integer", "description": "id of the team to edit", "name": "id", "in": "path", "required": true }, { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/EditTeamOption" } } ], "responses": { "200": { "$ref": "#/responses/Team" } } } }, "/teams/{id}/members": { "get": { "produces": [ "application/json" ], "tags": [ "organization" ], "summary": "List a team's members", "operationId": "orgListTeamMembers", "parameters": [ { "type": "integer", "description": "id of the team", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/UserList" } } } }, "/teams/{id}/members/{username}": { "put": { "produces": [ "application/json" ], "tags": [ "organization" ], "summary": "Add a team member", "operationId": "orgAddTeamMember", "parameters": [ { "type": "integer", "description": "id of the team", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "username of the user to add", "name": "username", "in": "path", "required": true } ], "responses": { "204": { "$ref": "#/responses/empty" } } }, "delete": { "produces": [ "application/json" ], "tags": [ "organization" ], "summary": "Remove a team member", "operationId": "orgRemoveTeamMember", "parameters": [ { "type": "integer", "description": "id of the team", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "username of the user to remove", "name": "username", "in": "path", "required": true } ], "responses": { "204": { "$ref": "#/responses/empty" } } } }, "/teams/{id}/repos": { "get": { "produces": [ "application/json" ], "tags": [ "organization" ], "summary": "List a team's repos", "operationId": "orgListTeamRepos", "parameters": [ { "type": "integer", "description": "id of the team", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/RepositoryList" } } } }, "/teams/{id}/repos/{org}/{repo}": { "put": { "produces": [ "application/json" ], "tags": [ "organization" ], "summary": "Add a repository to a team", "operationId": "orgAddTeamRepository", "parameters": [ { "type": "integer", "description": "id of the team", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "organization that owns the repo to add", "name": "org", "in": "path", "required": true }, { "type": "string", "description": "name of the repo to add", "name": "repo", "in": "path", "required": true } ], "responses": { "204": { "$ref": "#/responses/empty" } } }, "delete": { "description": "This does not delete the repository, it only removes the repository from the team.", "produces": [ "application/json" ], "tags": [ "organization" ], "summary": "Remove a repository from a team", "operationId": "orgRemoveTeamRepository", "parameters": [ { "type": "integer", "description": "id of the team", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "organization that owns the repo to remove", "name": "org", "in": "path", "required": true }, { "type": "string", "description": "name of the repo to remove", "name": "repo", "in": "path", "required": true } ], "responses": { "204": { "$ref": "#/responses/empty" } } } }, "/topics/search": { "get": { "produces": [ "application/json" ], "tags": [ "repository" ], "summary": "search topics via keyword", "operationId": "topicSearch", "parameters": [ { "type": "string", "description": "keywords to search", "name": "q", "in": "query", "required": true } ], "responses": { "200": { "$ref": "#/responses/Repository" } } } }, "/user": { "get": { "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Get the authenticated user", "operationId": "userGetCurrent", "responses": { "200": { "$ref": "#/responses/User" } } } }, "/user/emails": { "get": { "produces": [ "application/json" ], "tags": [ "user" ], "summary": "List the authenticated user's email addresses", "operationId": "userListEmails", "responses": { "200": { "$ref": "#/responses/EmailList" } } }, "post": { "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Add email addresses", "operationId": "userAddEmail", "parameters": [ { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/CreateEmailOption" } } ], "responses": { "201": { "$ref": "#/responses/EmailList" } } }, "delete": { "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Delete email addresses", "operationId": "userDeleteEmail", "parameters": [ { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/DeleteEmailOption" } } ], "responses": { "204": { "$ref": "#/responses/empty" } } } }, "/user/followers": { "get": { "produces": [ "application/json" ], "tags": [ "user" ], "summary": "List the authenticated user's followers", "operationId": "userCurrentListFollowers", "responses": { "200": { "$ref": "#/responses/UserList" } } } }, "/user/following": { "get": { "produces": [ "application/json" ], "tags": [ "user" ], "summary": "List the users that the authenticated user is following", "operationId": "userCurrentListFollowing", "responses": { "200": { "$ref": "#/responses/UserList" } } } }, "/user/following/{username}": { "get": { "tags": [ "user" ], "summary": "Check whether a user is followed by the authenticated user", "operationId": "userCurrentCheckFollowing", "parameters": [ { "type": "string", "description": "username of followed user", "name": "username", "in": "path", "required": true } ], "responses": { "204": { "$ref": "#/responses/empty" }, "404": { "$ref": "#/responses/notFound" } } }, "put": { "tags": [ "user" ], "summary": "Follow a user", "operationId": "userCurrentPutFollow", "parameters": [ { "type": "string", "description": "username of user to follow", "name": "username", "in": "path", "required": true } ], "responses": { "204": { "$ref": "#/responses/empty" } } }, "delete": { "tags": [ "user" ], "summary": "Unfollow a user", "operationId": "userCurrentDeleteFollow", "parameters": [ { "type": "string", "description": "username of user to unfollow", "name": "username", "in": "path", "required": true } ], "responses": { "204": { "$ref": "#/responses/empty" } } } }, "/user/gpg_keys": { "get": { "produces": [ "application/json" ], "tags": [ "user" ], "summary": "List the authenticated user's GPG keys", "operationId": "userCurrentListGPGKeys", "responses": { "200": { "$ref": "#/responses/GPGKeyList" } } }, "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Create a GPG key", "operationId": "userCurrentPostGPGKey", "parameters": [ { "name": "Form", "in": "body", "schema": { "$ref": "#/definitions/CreateGPGKeyOption" } } ], "responses": { "201": { "$ref": "#/responses/GPGKey" }, "422": { "$ref": "#/responses/validationError" } } } }, "/user/gpg_keys/{id}": { "get": { "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Get a GPG key", "operationId": "userCurrentGetGPGKey", "parameters": [ { "type": "integer", "description": "id of key to get", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/GPGKey" }, "404": { "$ref": "#/responses/notFound" } } }, "delete": { "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Remove a GPG key", "operationId": "userCurrentDeleteGPGKey", "parameters": [ { "type": "integer", "description": "id of key to delete", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "$ref": "#/responses/empty" }, "403": { "$ref": "#/responses/forbidden" } } } }, "/user/keys": { "get": { "produces": [ "application/json" ], "tags": [ "user" ], "summary": "List the authenticated user's public keys", "operationId": "userCurrentListKeys", "responses": { "200": { "$ref": "#/responses/PublicKeyList" } } }, "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Create a public key", "operationId": "userCurrentPostKey", "parameters": [ { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/CreateKeyOption" } } ], "responses": { "201": { "$ref": "#/responses/PublicKey" }, "422": { "$ref": "#/responses/validationError" } } } }, "/user/keys/{id}": { "get": { "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Get a public key", "operationId": "userCurrentGetKey", "parameters": [ { "type": "integer", "description": "id of key to get", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/PublicKey" }, "404": { "$ref": "#/responses/notFound" } } }, "delete": { "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Delete a public key", "operationId": "userCurrentDeleteKey", "parameters": [ { "type": "integer", "description": "id of key to delete", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "$ref": "#/responses/empty" }, "403": { "$ref": "#/responses/forbidden" }, "404": { "$ref": "#/responses/notFound" } } } }, "/user/orgs": { "get": { "produces": [ "application/json" ], "tags": [ "organization" ], "summary": "List the current user's organizations", "operationId": "orgListCurrentUserOrgs", "responses": { "200": { "$ref": "#/responses/OrganizationList" } } } }, "/user/repos": { "get": { "produces": [ "application/json" ], "tags": [ "user" ], "summary": "List the repos that the authenticated user owns or has access to", "operationId": "userCurrentListRepos", "responses": { "200": { "$ref": "#/responses/RepositoryList" } } }, "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "repository", "user" ], "summary": "Create a repository", "operationId": "createCurrentUserRepo", "parameters": [ { "name": "body", "in": "body", "schema": { "$ref": "#/definitions/CreateRepoOption" } } ], "responses": { "201": { "$ref": "#/responses/Repository" } } } }, "/user/starred": { "get": { "produces": [ "application/json" ], "tags": [ "user" ], "summary": "The repos that the authenticated user has starred", "operationId": "userCurrentListStarred", "responses": { "200": { "$ref": "#/responses/RepositoryList" } } } }, "/user/starred/{owner}/{repo}": { "get": { "tags": [ "user" ], "summary": "Whether the authenticated is starring the repo", "operationId": "userCurrentCheckStarring", "parameters": [ { "type": "string", "description": "owner of the repo", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo", "name": "repo", "in": "path", "required": true } ], "responses": { "204": { "$ref": "#/responses/empty" }, "404": { "$ref": "#/responses/notFound" } } }, "put": { "tags": [ "user" ], "summary": "Star the given repo", "operationId": "userCurrentPutStar", "parameters": [ { "type": "string", "description": "owner of the repo to star", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo to star", "name": "repo", "in": "path", "required": true } ], "responses": { "204": { "$ref": "#/responses/empty" } } }, "delete": { "tags": [ "user" ], "summary": "Unstar the given repo", "operationId": "userCurrentDeleteStar", "parameters": [ { "type": "string", "description": "owner of the repo to unstar", "name": "owner", "in": "path", "required": true }, { "type": "string", "description": "name of the repo to unstar", "name": "repo", "in": "path", "required": true } ], "responses": { "204": { "$ref": "#/responses/empty" } } } }, "/user/subscriptions": { "get": { "produces": [ "application/json" ], "tags": [ "user" ], "summary": "List repositories watched by the authenticated user", "operationId": "userCurrentListSubscriptions", "responses": { "200": { "$ref": "#/responses/RepositoryList" } } } }, "/user/times": { "get": { "produces": [ "application/json" ], "tags": [ "user" ], "summary": "List the current user's tracked times", "operationId": "userCurrentTrackedTimes", "responses": { "200": { "$ref": "#/responses/TrackedTimeList" } } } }, "/user/{username}/orgs": { "get": { "produces": [ "application/json" ], "tags": [ "organization" ], "summary": "List a user's organizations", "operationId": "orgListUserOrgs", "parameters": [ { "type": "string", "description": "username of user", "name": "username", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/OrganizationList" } } } }, "/users/search": { "get": { "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Search for users", "operationId": "userSearch", "parameters": [ { "type": "string", "description": "keyword", "name": "q", "in": "query" }, { "type": "integer", "description": "maximum number of users to return", "name": "limit", "in": "query" } ], "responses": { "200": { "$ref": "#/responses/UserList" } } } }, "/users/{follower}/following/{followee}": { "get": { "tags": [ "user" ], "summary": "Check if one user is following another user", "operationId": "userCheckFollowing", "parameters": [ { "type": "string", "description": "username of following user", "name": "follower", "in": "path", "required": true }, { "type": "string", "description": "username of followed user", "name": "followee", "in": "path", "required": true } ], "responses": { "204": { "$ref": "#/responses/empty" }, "404": { "$ref": "#/responses/notFound" } } } }, "/users/{username}": { "get": { "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Get a user", "operationId": "userGet", "parameters": [ { "type": "string", "description": "username of user to get", "name": "username", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/User" }, "404": { "$ref": "#/responses/notFound" } } } }, "/users/{username}/followers": { "get": { "produces": [ "application/json" ], "tags": [ "user" ], "summary": "List the given user's followers", "operationId": "userListFollowers", "parameters": [ { "type": "string", "description": "username of user", "name": "username", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/UserList" } } } }, "/users/{username}/following": { "get": { "produces": [ "application/json" ], "tags": [ "user" ], "summary": "List the users that the given user is following", "operationId": "userListFollowing", "parameters": [ { "type": "string", "description": "username of user", "name": "username", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/UserList" } } } }, "/users/{username}/gpg_keys": { "get": { "produces": [ "application/json" ], "tags": [ "user" ], "summary": "List the given user's GPG keys", "operationId": "userListGPGKeys", "parameters": [ { "type": "string", "description": "username of user", "name": "username", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/GPGKeyList" } } } }, "/users/{username}/keys": { "get": { "produces": [ "application/json" ], "tags": [ "user" ], "summary": "List the given user's public keys", "operationId": "userListKeys", "parameters": [ { "type": "string", "description": "username of user", "name": "username", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/PublicKeyList" } } } }, "/users/{username}/repos": { "get": { "produces": [ "application/json" ], "tags": [ "user" ], "summary": "List the repos owned by the given user", "operationId": "userListRepos", "parameters": [ { "type": "string", "description": "username of user", "name": "username", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/RepositoryList" } } } }, "/users/{username}/starred": { "get": { "produces": [ "application/json" ], "tags": [ "user" ], "summary": "The repos that the given user has starred", "operationId": "userListStarred", "parameters": [ { "type": "string", "description": "username of user", "name": "username", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/RepositoryList" } } } }, "/users/{username}/subscriptions": { "get": { "produces": [ "application/json" ], "tags": [ "user" ], "summary": "List the repositories watched by a user", "operationId": "userListSubscriptions", "parameters": [ { "type": "string", "description": "username of the user", "name": "username", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/RepositoryList" } } } }, "/users/{username}/tokens": { "get": { "produces": [ "application/json" ], "tags": [ "user" ], "summary": "List the authenticated user's access tokens", "operationId": "userGetTokens", "parameters": [ { "type": "string", "description": "username of user", "name": "username", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/AccessTokenList" } } }, "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Create an access token", "operationId": "userCreateToken", "parameters": [ { "type": "string", "x-go-name": "Name", "description": "username of user", "name": "username", "in": "path", "required": true } ], "responses": { "200": { "$ref": "#/responses/AccessToken" } } } }, "/users/{username}/tokens/{token}": { "delete": { "produces": [ "application/json" ], "tags": [ "user" ], "summary": "delete an access token", "operationId": "userDeleteAccessToken", "parameters": [ { "type": "string", "description": "username of user", "name": "username", "in": "path", "required": true }, { "type": "integer", "description": "token to be deleted", "name": "token", "in": "path", "required": true } ], "responses": { "204": { "$ref": "#/responses/empty" } } } }, "/version": { "get": { "produces": [ "application/json" ], "tags": [ "miscellaneous" ], "summary": "Returns the version of the Gitea application", "operationId": "getVersion", "responses": { "200": { "$ref": "#/responses/ServerVersion" } } } } }, "definitions": { "AddCollaboratorOption": { "description": "AddCollaboratorOption options when adding a user as a collaborator of a repository", "type": "object", "properties": { "permission": { "type": "string", "x-go-name": "Permission" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "AddTimeOption": { "description": "AddTimeOption options for adding time to an issue", "type": "object", "required": [ "time" ], "properties": { "time": { "description": "time in seconds", "type": "integer", "format": "int64", "x-go-name": "Time" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "Attachment": { "description": "Attachment a generic attachment", "type": "object", "properties": { "browser_download_url": { "type": "string", "x-go-name": "DownloadURL" }, "created_at": { "type": "string", "format": "date-time", "x-go-name": "Created" }, "download_count": { "type": "integer", "format": "int64", "x-go-name": "DownloadCount" }, "id": { "type": "integer", "format": "int64", "x-go-name": "ID" }, "name": { "type": "string", "x-go-name": "Name" }, "size": { "type": "integer", "format": "int64", "x-go-name": "Size" }, "uuid": { "type": "string", "x-go-name": "UUID" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "Branch": { "description": "Branch represents a repository branch", "type": "object", "properties": { "commit": { "$ref": "#/definitions/PayloadCommit" }, "name": { "type": "string", "x-go-name": "Name" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "Comment": { "description": "Comment represents a comment on a commit or issue", "type": "object", "properties": { "body": { "type": "string", "x-go-name": "Body" }, "created_at": { "type": "string", "format": "date-time", "x-go-name": "Created" }, "html_url": { "type": "string", "x-go-name": "HTMLURL" }, "id": { "type": "integer", "format": "int64", "x-go-name": "ID" }, "issue_url": { "type": "string", "x-go-name": "IssueURL" }, "pull_request_url": { "type": "string", "x-go-name": "PRURL" }, "updated_at": { "type": "string", "format": "date-time", "x-go-name": "Updated" }, "user": { "$ref": "#/definitions/User" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "CreateEmailOption": { "description": "CreateEmailOption options when creating email addresses", "type": "object", "properties": { "emails": { "description": "email addresses to add", "type": "array", "items": { "type": "string" }, "x-go-name": "Emails" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "CreateForkOption": { "description": "CreateForkOption options for creating a fork", "type": "object", "properties": { "organization": { "description": "organization name, if forking into an organization", "type": "string", "x-go-name": "Organization" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "CreateGPGKeyOption": { "description": "CreateGPGKeyOption options create user GPG key", "type": "object", "required": [ "armored_public_key" ], "properties": { "armored_public_key": { "description": "An armored GPG key to add", "type": "string", "uniqueItems": true, "x-go-name": "ArmoredKey" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "CreateHookOption": { "description": "CreateHookOption options when create a hook", "type": "object", "required": [ "type", "config" ], "properties": { "active": { "type": "boolean", "default": false, "x-go-name": "Active" }, "config": { "type": "object", "additionalProperties": { "type": "string" }, "x-go-name": "Config" }, "events": { "type": "array", "items": { "type": "string" }, "x-go-name": "Events" }, "type": { "type": "string", "enum": [ "gitea", "gogs", "slack", "discord" ], "x-go-name": "Type" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "CreateIssueCommentOption": { "description": "CreateIssueCommentOption options for creating a comment on an issue", "type": "object", "required": [ "body" ], "properties": { "body": { "type": "string", "x-go-name": "Body" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "CreateIssueOption": { "description": "CreateIssueOption options to create one issue", "type": "object", "required": [ "title" ], "properties": { "assignee": { "description": "username of assignee", "type": "string", "x-go-name": "Assignee" }, "assignees": { "type": "array", "items": { "type": "string" }, "x-go-name": "Assignees" }, "body": { "type": "string", "x-go-name": "Body" }, "closed": { "type": "boolean", "x-go-name": "Closed" }, "due_date": { "type": "string", "format": "date-time", "x-go-name": "Deadline" }, "labels": { "description": "list of label ids", "type": "array", "items": { "type": "integer", "format": "int64" }, "x-go-name": "Labels" }, "milestone": { "description": "milestone id", "type": "integer", "format": "int64", "x-go-name": "Milestone" }, "title": { "type": "string", "x-go-name": "Title" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "CreateKeyOption": { "description": "CreateKeyOption options when creating a key", "type": "object", "required": [ "title", "key" ], "properties": { "key": { "description": "An armored SSH key to add", "type": "string", "uniqueItems": true, "x-go-name": "Key" }, "read_only": { "description": "Describe if the key has only read access or read/write", "type": "boolean", "x-go-name": "ReadOnly" }, "title": { "description": "Title of the key to add", "type": "string", "uniqueItems": true, "x-go-name": "Title" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "CreateLabelOption": { "description": "CreateLabelOption options for creating a label", "type": "object", "required": [ "name", "color" ], "properties": { "color": { "type": "string", "x-go-name": "Color", "example": "#00aabb" }, "name": { "type": "string", "x-go-name": "Name" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "CreateMilestoneOption": { "description": "CreateMilestoneOption options for creating a milestone", "type": "object", "properties": { "description": { "type": "string", "x-go-name": "Description" }, "due_on": { "type": "string", "format": "date-time", "x-go-name": "Deadline" }, "title": { "type": "string", "x-go-name": "Title" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "CreateOrgOption": { "description": "CreateOrgOption options for creating an organization", "type": "object", "required": [ "username" ], "properties": { "description": { "type": "string", "x-go-name": "Description" }, "full_name": { "type": "string", "x-go-name": "FullName" }, "location": { "type": "string", "x-go-name": "Location" }, "username": { "type": "string", "x-go-name": "UserName" }, "website": { "type": "string", "x-go-name": "Website" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "CreatePullRequestOption": { "description": "CreatePullRequestOption options when creating a pull request", "type": "object", "properties": { "assignee": { "type": "string", "x-go-name": "Assignee" }, "assignees": { "type": "array", "items": { "type": "string" }, "x-go-name": "Assignees" }, "base": { "type": "string", "x-go-name": "Base" }, "body": { "type": "string", "x-go-name": "Body" }, "due_date": { "type": "string", "format": "date-time", "x-go-name": "Deadline" }, "head": { "type": "string", "x-go-name": "Head" }, "labels": { "type": "array", "items": { "type": "integer", "format": "int64" }, "x-go-name": "Labels" }, "milestone": { "type": "integer", "format": "int64", "x-go-name": "Milestone" }, "title": { "type": "string", "x-go-name": "Title" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "CreateReleaseOption": { "description": "CreateReleaseOption options when creating a release", "type": "object", "required": [ "tag_name" ], "properties": { "body": { "type": "string", "x-go-name": "Note" }, "draft": { "type": "boolean", "x-go-name": "IsDraft" }, "name": { "type": "string", "x-go-name": "Title" }, "prerelease": { "type": "boolean", "x-go-name": "IsPrerelease" }, "tag_name": { "type": "string", "x-go-name": "TagName" }, "target_commitish": { "type": "string", "x-go-name": "Target" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "CreateRepoOption": { "description": "CreateRepoOption options when creating repository", "type": "object", "required": [ "name" ], "properties": { "auto_init": { "description": "Whether the repository should be auto-intialized?", "type": "boolean", "x-go-name": "AutoInit" }, "description": { "description": "Description of the repository to create", "type": "string", "x-go-name": "Description" }, "gitignores": { "description": "Gitignores to use", "type": "string", "x-go-name": "Gitignores" }, "license": { "description": "License to use", "type": "string", "x-go-name": "License" }, "name": { "description": "Name of the repository to create", "type": "string", "uniqueItems": true, "x-go-name": "Name" }, "private": { "description": "Whether the repository is private", "type": "boolean", "x-go-name": "Private" }, "readme": { "description": "Readme of the repository to create", "type": "string", "x-go-name": "Readme" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "CreateStatusOption": { "description": "CreateStatusOption holds the information needed to create a new Status for a Commit", "type": "object", "properties": { "context": { "type": "string", "x-go-name": "Context" }, "description": { "type": "string", "x-go-name": "Description" }, "state": { "$ref": "#/definitions/StatusState" }, "target_url": { "type": "string", "x-go-name": "TargetURL" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "CreateTeamOption": { "description": "CreateTeamOption options for creating a team", "type": "object", "required": [ "name" ], "properties": { "description": { "type": "string", "x-go-name": "Description" }, "name": { "type": "string", "x-go-name": "Name" }, "permission": { "type": "string", "enum": [ "read", "write", "admin" ], "x-go-name": "Permission" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "CreateUserOption": { "description": "CreateUserOption create user options", "type": "object", "required": [ "username", "email", "password" ], "properties": { "email": { "type": "string", "format": "email", "x-go-name": "Email" }, "full_name": { "type": "string", "x-go-name": "FullName" }, "login_name": { "type": "string", "x-go-name": "LoginName" }, "password": { "type": "string", "x-go-name": "Password" }, "send_notify": { "type": "boolean", "x-go-name": "SendNotify" }, "source_id": { "type": "integer", "format": "int64", "x-go-name": "SourceID" }, "username": { "type": "string", "x-go-name": "Username" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "DeleteEmailOption": { "description": "DeleteEmailOption options when deleting email addresses", "type": "object", "properties": { "emails": { "description": "email addresses to delete", "type": "array", "items": { "type": "string" }, "x-go-name": "Emails" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "DeployKey": { "description": "DeployKey a deploy key", "type": "object", "properties": { "created_at": { "type": "string", "format": "date-time", "x-go-name": "Created" }, "id": { "type": "integer", "format": "int64", "x-go-name": "ID" }, "key": { "type": "string", "x-go-name": "Key" }, "read_only": { "type": "boolean", "x-go-name": "ReadOnly" }, "title": { "type": "string", "x-go-name": "Title" }, "url": { "type": "string", "x-go-name": "URL" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "EditAttachmentOptions": { "description": "EditAttachmentOptions options for editing attachments", "type": "object", "properties": { "name": { "type": "string", "x-go-name": "Name" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "EditHookOption": { "description": "EditHookOption options when modify one hook", "type": "object", "properties": { "active": { "type": "boolean", "x-go-name": "Active" }, "config": { "type": "object", "additionalProperties": { "type": "string" }, "x-go-name": "Config" }, "events": { "type": "array", "items": { "type": "string" }, "x-go-name": "Events" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "EditIssueCommentOption": { "description": "EditIssueCommentOption options for editing a comment", "type": "object", "required": [ "body" ], "properties": { "body": { "type": "string", "x-go-name": "Body" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "EditIssueOption": { "description": "EditIssueOption options for editing an issue", "type": "object", "properties": { "assignee": { "type": "string", "x-go-name": "Assignee" }, "assignees": { "type": "array", "items": { "type": "string" }, "x-go-name": "Assignees" }, "body": { "type": "string", "x-go-name": "Body" }, "due_date": { "type": "string", "format": "date-time", "x-go-name": "Deadline" }, "milestone": { "type": "integer", "format": "int64", "x-go-name": "Milestone" }, "state": { "type": "string", "x-go-name": "State" }, "title": { "type": "string", "x-go-name": "Title" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "EditLabelOption": { "description": "EditLabelOption options for editing a label", "type": "object", "properties": { "color": { "type": "string", "x-go-name": "Color" }, "name": { "type": "string", "x-go-name": "Name" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "EditMilestoneOption": { "description": "EditMilestoneOption options for editing a milestone", "type": "object", "properties": { "description": { "type": "string", "x-go-name": "Description" }, "due_on": { "type": "string", "format": "date-time", "x-go-name": "Deadline" }, "state": { "type": "string", "x-go-name": "State" }, "title": { "type": "string", "x-go-name": "Title" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "EditOrgOption": { "description": "EditOrgOption options for editing an organization", "type": "object", "properties": { "description": { "type": "string", "x-go-name": "Description" }, "full_name": { "type": "string", "x-go-name": "FullName" }, "location": { "type": "string", "x-go-name": "Location" }, "website": { "type": "string", "x-go-name": "Website" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "EditPullRequestOption": { "description": "EditPullRequestOption options when modify pull request", "type": "object", "properties": { "assignee": { "type": "string", "x-go-name": "Assignee" }, "assignees": { "type": "array", "items": { "type": "string" }, "x-go-name": "Assignees" }, "body": { "type": "string", "x-go-name": "Body" }, "due_date": { "type": "string", "format": "date-time", "x-go-name": "Deadline" }, "labels": { "type": "array", "items": { "type": "integer", "format": "int64" }, "x-go-name": "Labels" }, "milestone": { "type": "integer", "format": "int64", "x-go-name": "Milestone" }, "state": { "type": "string", "x-go-name": "State" }, "title": { "type": "string", "x-go-name": "Title" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "EditReleaseOption": { "description": "EditReleaseOption options when editing a release", "type": "object", "properties": { "body": { "type": "string", "x-go-name": "Note" }, "draft": { "type": "boolean", "x-go-name": "IsDraft" }, "name": { "type": "string", "x-go-name": "Title" }, "prerelease": { "type": "boolean", "x-go-name": "IsPrerelease" }, "tag_name": { "type": "string", "x-go-name": "TagName" }, "target_commitish": { "type": "string", "x-go-name": "Target" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "EditTeamOption": { "description": "EditTeamOption options for editing a team", "type": "object", "required": [ "name" ], "properties": { "description": { "type": "string", "x-go-name": "Description" }, "name": { "type": "string", "x-go-name": "Name" }, "permission": { "type": "string", "enum": [ "read", "write", "admin" ], "x-go-name": "Permission" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "EditUserOption": { "description": "EditUserOption edit user options", "type": "object", "required": [ "email" ], "properties": { "active": { "type": "boolean", "x-go-name": "Active" }, "admin": { "type": "boolean", "x-go-name": "Admin" }, "allow_git_hook": { "type": "boolean", "x-go-name": "AllowGitHook" }, "allow_import_local": { "type": "boolean", "x-go-name": "AllowImportLocal" }, "email": { "type": "string", "format": "email", "x-go-name": "Email" }, "full_name": { "type": "string", "x-go-name": "FullName" }, "location": { "type": "string", "x-go-name": "Location" }, "login_name": { "type": "string", "x-go-name": "LoginName" }, "max_repo_creation": { "type": "integer", "format": "int64", "x-go-name": "MaxRepoCreation" }, "password": { "type": "string", "x-go-name": "Password" }, "source_id": { "type": "integer", "format": "int64", "x-go-name": "SourceID" }, "website": { "type": "string", "x-go-name": "Website" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "Email": { "description": "Email an email address belonging to a user", "type": "object", "properties": { "email": { "type": "string", "format": "email", "x-go-name": "Email" }, "primary": { "type": "boolean", "x-go-name": "Primary" }, "verified": { "type": "boolean", "x-go-name": "Verified" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "GPGKey": { "description": "GPGKey a user GPG key to sign commit and tag in repository", "type": "object", "properties": { "can_certify": { "type": "boolean", "x-go-name": "CanCertify" }, "can_encrypt_comms": { "type": "boolean", "x-go-name": "CanEncryptComms" }, "can_encrypt_storage": { "type": "boolean", "x-go-name": "CanEncryptStorage" }, "can_sign": { "type": "boolean", "x-go-name": "CanSign" }, "created_at": { "type": "string", "format": "date-time", "x-go-name": "Created" }, "emails": { "type": "array", "items": { "$ref": "#/definitions/GPGKeyEmail" }, "x-go-name": "Emails" }, "expires_at": { "type": "string", "format": "date-time", "x-go-name": "Expires" }, "id": { "type": "integer", "format": "int64", "x-go-name": "ID" }, "key_id": { "type": "string", "x-go-name": "KeyID" }, "primary_key_id": { "type": "string", "x-go-name": "PrimaryKeyID" }, "public_key": { "type": "string", "x-go-name": "PublicKey" }, "subkeys": { "type": "array", "items": { "$ref": "#/definitions/GPGKey" }, "x-go-name": "SubsKey" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "GPGKeyEmail": { "description": "GPGKeyEmail an email attached to a GPGKey", "type": "object", "properties": { "email": { "type": "string", "x-go-name": "Email" }, "verified": { "type": "boolean", "x-go-name": "Verified" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "Issue": { "description": "Issue represents an issue in a repository", "type": "object", "properties": { "assignee": { "$ref": "#/definitions/User" }, "assignees": { "type": "array", "items": { "$ref": "#/definitions/User" }, "x-go-name": "Assignees" }, "body": { "type": "string", "x-go-name": "Body" }, "closed_at": { "type": "string", "format": "date-time", "x-go-name": "Closed" }, "comments": { "type": "integer", "format": "int64", "x-go-name": "Comments" }, "created_at": { "type": "string", "format": "date-time", "x-go-name": "Created" }, "due_date": { "type": "string", "format": "date-time", "x-go-name": "Deadline" }, "id": { "type": "integer", "format": "int64", "x-go-name": "ID" }, "labels": { "type": "array", "items": { "$ref": "#/definitions/Label" }, "x-go-name": "Labels" }, "milestone": { "$ref": "#/definitions/Milestone" }, "number": { "type": "integer", "format": "int64", "x-go-name": "Index" }, "pull_request": { "$ref": "#/definitions/PullRequestMeta" }, "state": { "$ref": "#/definitions/StateType" }, "title": { "type": "string", "x-go-name": "Title" }, "updated_at": { "type": "string", "format": "date-time", "x-go-name": "Updated" }, "url": { "type": "string", "x-go-name": "URL" }, "user": { "$ref": "#/definitions/User" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "IssueLabelsOption": { "description": "IssueLabelsOption a collection of labels", "type": "object", "properties": { "labels": { "description": "list of label IDs", "type": "array", "items": { "type": "integer", "format": "int64" }, "x-go-name": "Labels" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "Label": { "description": "Label a label to an issue or a pr", "type": "object", "properties": { "color": { "type": "string", "x-go-name": "Color", "example": "00aabb" }, "id": { "type": "integer", "format": "int64", "x-go-name": "ID" }, "name": { "type": "string", "x-go-name": "Name" }, "url": { "type": "string", "x-go-name": "URL" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "MarkdownOption": { "description": "MarkdownOption markdown options", "type": "object", "properties": { "Context": { "description": "Context to render\n\nin: body", "type": "string" }, "Mode": { "description": "Mode to render\n\nin: body", "type": "string" }, "Text": { "description": "Text markdown to render\n\nin: body", "type": "string" }, "Wiki": { "description": "Is it a wiki page ?\n\nin: body", "type": "boolean" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "MigrateRepoForm": { "description": "MigrateRepoForm form for migrating repository", "type": "object", "required": [ "clone_addr", "uid", "repo_name" ], "properties": { "auth_password": { "type": "string", "x-go-name": "AuthPassword" }, "auth_username": { "type": "string", "x-go-name": "AuthUsername" }, "clone_addr": { "type": "string", "x-go-name": "CloneAddr" }, "description": { "type": "string", "x-go-name": "Description" }, "mirror": { "type": "boolean", "x-go-name": "Mirror" }, "private": { "type": "boolean", "x-go-name": "Private" }, "repo_name": { "type": "string", "x-go-name": "RepoName" }, "uid": { "type": "integer", "format": "int64", "x-go-name": "UID" } }, "x-go-package": "code.gitea.io/gitea/modules/auth" }, "Milestone": { "description": "Milestone milestone is a collection of issues on one repository", "type": "object", "properties": { "closed_at": { "type": "string", "format": "date-time", "x-go-name": "Closed" }, "closed_issues": { "type": "integer", "format": "int64", "x-go-name": "ClosedIssues" }, "description": { "type": "string", "x-go-name": "Description" }, "due_on": { "type": "string", "format": "date-time", "x-go-name": "Deadline" }, "id": { "type": "integer", "format": "int64", "x-go-name": "ID" }, "open_issues": { "type": "integer", "format": "int64", "x-go-name": "OpenIssues" }, "state": { "$ref": "#/definitions/StateType" }, "title": { "type": "string", "x-go-name": "Title" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "Organization": { "description": "Organization represents an organization", "type": "object", "properties": { "avatar_url": { "type": "string", "x-go-name": "AvatarURL" }, "description": { "type": "string", "x-go-name": "Description" }, "full_name": { "type": "string", "x-go-name": "FullName" }, "id": { "type": "integer", "format": "int64", "x-go-name": "ID" }, "location": { "type": "string", "x-go-name": "Location" }, "username": { "type": "string", "x-go-name": "UserName" }, "website": { "type": "string", "x-go-name": "Website" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "PRBranchInfo": { "description": "PRBranchInfo information about a branch", "type": "object", "properties": { "label": { "type": "string", "x-go-name": "Name" }, "ref": { "type": "string", "x-go-name": "Ref" }, "repo": { "$ref": "#/definitions/Repository" }, "repo_id": { "type": "integer", "format": "int64", "x-go-name": "RepoID" }, "sha": { "type": "string", "x-go-name": "Sha" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "PayloadCommit": { "description": "PayloadCommit represents a commit", "type": "object", "properties": { "author": { "$ref": "#/definitions/PayloadUser" }, "committer": { "$ref": "#/definitions/PayloadUser" }, "id": { "description": "sha1 hash of the commit", "type": "string", "x-go-name": "ID" }, "message": { "type": "string", "x-go-name": "Message" }, "timestamp": { "type": "string", "format": "date-time", "x-go-name": "Timestamp" }, "url": { "type": "string", "x-go-name": "URL" }, "verification": { "$ref": "#/definitions/PayloadCommitVerification" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "PayloadCommitVerification": { "description": "PayloadCommitVerification represents the GPG verification of a commit", "type": "object", "properties": { "payload": { "type": "string", "x-go-name": "Payload" }, "reason": { "type": "string", "x-go-name": "Reason" }, "signature": { "type": "string", "x-go-name": "Signature" }, "verified": { "type": "boolean", "x-go-name": "Verified" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "PayloadUser": { "description": "PayloadUser represents the author or committer of a commit", "type": "object", "properties": { "email": { "type": "string", "format": "email", "x-go-name": "Email" }, "name": { "description": "Full name of the commit author", "type": "string", "x-go-name": "Name" }, "username": { "type": "string", "x-go-name": "UserName" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "Permission": { "description": "Permission represents a set of permissions", "type": "object", "properties": { "admin": { "type": "boolean", "x-go-name": "Admin" }, "pull": { "type": "boolean", "x-go-name": "Pull" }, "push": { "type": "boolean", "x-go-name": "Push" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "PublicKey": { "description": "PublicKey publickey is a user key to push code to repository", "type": "object", "properties": { "created_at": { "type": "string", "format": "date-time", "x-go-name": "Created" }, "fingerprint": { "type": "string", "x-go-name": "Fingerprint" }, "id": { "type": "integer", "format": "int64", "x-go-name": "ID" }, "key": { "type": "string", "x-go-name": "Key" }, "title": { "type": "string", "x-go-name": "Title" }, "url": { "type": "string", "x-go-name": "URL" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "PullRequest": { "description": "PullRequest represents a pull request", "type": "object", "properties": { "assignee": { "$ref": "#/definitions/User" }, "assignees": { "type": "array", "items": { "$ref": "#/definitions/User" }, "x-go-name": "Assignees" }, "base": { "$ref": "#/definitions/PRBranchInfo" }, "body": { "type": "string", "x-go-name": "Body" }, "closed_at": { "type": "string", "format": "date-time", "x-go-name": "Closed" }, "comments": { "type": "integer", "format": "int64", "x-go-name": "Comments" }, "created_at": { "type": "string", "format": "date-time", "x-go-name": "Created" }, "diff_url": { "type": "string", "x-go-name": "DiffURL" }, "due_date": { "type": "string", "format": "date-time", "x-go-name": "Deadline" }, "head": { "$ref": "#/definitions/PRBranchInfo" }, "html_url": { "type": "string", "x-go-name": "HTMLURL" }, "id": { "type": "integer", "format": "int64", "x-go-name": "ID" }, "labels": { "type": "array", "items": { "$ref": "#/definitions/Label" }, "x-go-name": "Labels" }, "merge_base": { "type": "string", "x-go-name": "MergeBase" }, "merge_commit_sha": { "type": "string", "x-go-name": "MergedCommitID" }, "mergeable": { "type": "boolean", "x-go-name": "Mergeable" }, "merged": { "type": "boolean", "x-go-name": "HasMerged" }, "merged_at": { "type": "string", "format": "date-time", "x-go-name": "Merged" }, "merged_by": { "$ref": "#/definitions/User" }, "milestone": { "$ref": "#/definitions/Milestone" }, "number": { "type": "integer", "format": "int64", "x-go-name": "Index" }, "patch_url": { "type": "string", "x-go-name": "PatchURL" }, "state": { "$ref": "#/definitions/StateType" }, "title": { "type": "string", "x-go-name": "Title" }, "updated_at": { "type": "string", "format": "date-time", "x-go-name": "Updated" }, "url": { "type": "string", "x-go-name": "URL" }, "user": { "$ref": "#/definitions/User" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "PullRequestMeta": { "description": "PullRequestMeta PR info if an issue is a PR", "type": "object", "properties": { "merged": { "type": "boolean", "x-go-name": "HasMerged" }, "merged_at": { "type": "string", "format": "date-time", "x-go-name": "Merged" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "Release": { "description": "Release represents a repository release", "type": "object", "properties": { "assets": { "type": "array", "items": { "$ref": "#/definitions/Attachment" }, "x-go-name": "Attachments" }, "author": { "$ref": "#/definitions/User" }, "body": { "type": "string", "x-go-name": "Note" }, "created_at": { "type": "string", "format": "date-time", "x-go-name": "CreatedAt" }, "draft": { "type": "boolean", "x-go-name": "IsDraft" }, "id": { "type": "integer", "format": "int64", "x-go-name": "ID" }, "name": { "type": "string", "x-go-name": "Title" }, "prerelease": { "type": "boolean", "x-go-name": "IsPrerelease" }, "published_at": { "type": "string", "format": "date-time", "x-go-name": "PublishedAt" }, "tag_name": { "type": "string", "x-go-name": "TagName" }, "tarball_url": { "type": "string", "x-go-name": "TarURL" }, "target_commitish": { "type": "string", "x-go-name": "Target" }, "url": { "type": "string", "x-go-name": "URL" }, "zipball_url": { "type": "string", "x-go-name": "ZipURL" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "Repository": { "description": "Repository represents a repository", "type": "object", "properties": { "clone_url": { "type": "string", "x-go-name": "CloneURL" }, "created_at": { "type": "string", "format": "date-time", "x-go-name": "Created" }, "default_branch": { "type": "string", "x-go-name": "DefaultBranch" }, "description": { "type": "string", "x-go-name": "Description" }, "empty": { "type": "boolean", "x-go-name": "Empty" }, "fork": { "type": "boolean", "x-go-name": "Fork" }, "forks_count": { "type": "integer", "format": "int64", "x-go-name": "Forks" }, "full_name": { "type": "string", "x-go-name": "FullName" }, "html_url": { "type": "string", "x-go-name": "HTMLURL" }, "id": { "type": "integer", "format": "int64", "x-go-name": "ID" }, "mirror": { "type": "boolean", "x-go-name": "Mirror" }, "name": { "type": "string", "x-go-name": "Name" }, "open_issues_count": { "type": "integer", "format": "int64", "x-go-name": "OpenIssues" }, "owner": { "$ref": "#/definitions/User" }, "parent": { "$ref": "#/definitions/Repository" }, "permissions": { "$ref": "#/definitions/Permission" }, "private": { "type": "boolean", "x-go-name": "Private" }, "size": { "type": "integer", "format": "int64", "x-go-name": "Size" }, "ssh_url": { "type": "string", "x-go-name": "SSHURL" }, "stars_count": { "type": "integer", "format": "int64", "x-go-name": "Stars" }, "updated_at": { "type": "string", "format": "date-time", "x-go-name": "Updated" }, "watchers_count": { "type": "integer", "format": "int64", "x-go-name": "Watchers" }, "website": { "type": "string", "x-go-name": "Website" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "SearchResults": { "description": "SearchResults results of a successful search", "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/Repository" }, "x-go-name": "Data" }, "ok": { "type": "boolean", "x-go-name": "OK" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "ServerVersion": { "description": "ServerVersion wraps the version of the server", "type": "object", "properties": { "version": { "type": "string", "x-go-name": "Version" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "StateType": { "description": "StateType issue state type", "type": "string", "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "Status": { "description": "Status holds a single Status of a single Commit", "type": "object", "properties": { "context": { "type": "string", "x-go-name": "Context" }, "created_at": { "type": "string", "format": "date-time", "x-go-name": "Created" }, "creator": { "$ref": "#/definitions/User" }, "description": { "type": "string", "x-go-name": "Description" }, "id": { "type": "integer", "format": "int64", "x-go-name": "ID" }, "status": { "$ref": "#/definitions/StatusState" }, "target_url": { "type": "string", "x-go-name": "TargetURL" }, "updated_at": { "type": "string", "format": "date-time", "x-go-name": "Updated" }, "url": { "type": "string", "x-go-name": "URL" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "StatusState": { "description": "StatusState holds the state of a Status\nIt can be \"pending\", \"success\", \"error\", \"failure\", and \"warning\"", "type": "string", "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "Team": { "description": "Team represents a team in an organization", "type": "object", "properties": { "description": { "type": "string", "x-go-name": "Description" }, "id": { "type": "integer", "format": "int64", "x-go-name": "ID" }, "name": { "type": "string", "x-go-name": "Name" }, "permission": { "type": "string", "enum": [ "none", "read", "write", "admin", "owner" ], "x-go-name": "Permission" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "TrackedTime": { "description": "TrackedTime worked time for an issue / pr", "type": "object", "properties": { "created": { "type": "string", "format": "date-time", "x-go-name": "Created" }, "id": { "type": "integer", "format": "int64", "x-go-name": "ID" }, "issue_id": { "type": "integer", "format": "int64", "x-go-name": "IssueID" }, "time": { "description": "Time in seconds", "type": "integer", "format": "int64", "x-go-name": "Time" }, "user_id": { "type": "integer", "format": "int64", "x-go-name": "UserID" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "User": { "description": "User represents a user", "type": "object", "properties": { "avatar_url": { "description": "URL to the user's avatar", "type": "string", "x-go-name": "AvatarURL" }, "email": { "type": "string", "format": "email", "x-go-name": "Email" }, "full_name": { "description": "the user's full name", "type": "string", "x-go-name": "FullName" }, "id": { "description": "the user's id", "type": "integer", "format": "int64", "x-go-name": "ID" }, "language": { "description": "User locale", "type": "string", "x-go-name": "Language" }, "login": { "description": "the user's username", "type": "string", "x-go-name": "UserName" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" }, "WatchInfo": { "description": "WatchInfo represents an API watch status of one repository", "type": "object", "properties": { "created_at": { "type": "string", "format": "date-time", "x-go-name": "CreatedAt" }, "ignored": { "type": "boolean", "x-go-name": "Ignored" }, "reason": { "type": "object", "x-go-name": "Reason" }, "repository_url": { "type": "string", "x-go-name": "RepositoryURL" }, "subscribed": { "type": "boolean", "x-go-name": "Subscribed" }, "url": { "type": "string", "x-go-name": "URL" } }, "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea" } }, "responses": { "AccessToken": { "description": "AccessToken represents a API access token.", "headers": { "id": { "type": "integer", "format": "int64" }, "name": { "type": "string" }, "sha1": { "type": "string" } } }, "AccessTokenList": { "description": "AccessTokenList represents a list of API access token." }, "Attachment": { "description": "Attachment", "schema": { "$ref": "#/definitions/Attachment" } }, "AttachmentList": { "description": "AttachmentList", "schema": { "type": "array", "items": { "$ref": "#/definitions/Attachment" } } }, "Branch": { "description": "Branch", "schema": { "$ref": "#/definitions/Branch" } }, "BranchList": { "description": "BranchList", "schema": { "type": "array", "items": { "$ref": "#/definitions/Branch" } } }, "Comment": { "description": "Comment", "schema": { "$ref": "#/definitions/Comment" } }, "CommentList": { "description": "CommentList", "schema": { "type": "array", "items": { "$ref": "#/definitions/Comment" } } }, "DeployKey": { "description": "DeployKey", "schema": { "$ref": "#/definitions/DeployKey" } }, "DeployKeyList": { "description": "DeployKeyList", "schema": { "type": "array", "items": { "$ref": "#/definitions/DeployKey" } } }, "EmailList": { "description": "EmailList", "schema": { "type": "array", "items": { "$ref": "#/definitions/Email" } } }, "GPGKey": { "description": "GPGKey", "schema": { "$ref": "#/definitions/GPGKey" } }, "GPGKeyList": { "description": "GPGKeyList", "schema": { "type": "array", "items": { "$ref": "#/definitions/GPGKey" } } }, "Hook": { "description": "Hook", "schema": { "type": "array", "items": { "$ref": "#/definitions/Branch" } } }, "HookList": { "description": "HookList", "schema": { "type": "array", "items": { "$ref": "#/definitions/Branch" } } }, "Issue": { "description": "Issue", "schema": { "$ref": "#/definitions/Issue" } }, "IssueList": { "description": "IssueList", "schema": { "type": "array", "items": { "$ref": "#/definitions/Issue" } } }, "Label": { "description": "Label", "schema": { "$ref": "#/definitions/Label" } }, "LabelList": { "description": "LabelList", "schema": { "type": "array", "items": { "$ref": "#/definitions/Label" } } }, "MarkdownRender": { "description": "MarkdownRender is a rendered markdown document" }, "Milestone": { "description": "Milestone", "schema": { "$ref": "#/definitions/Milestone" } }, "MilestoneList": { "description": "MilestoneList", "schema": { "type": "array", "items": { "$ref": "#/definitions/Milestone" } } }, "Organization": { "description": "Organization", "schema": { "$ref": "#/definitions/Organization" } }, "OrganizationList": { "description": "OrganizationList", "schema": { "type": "array", "items": { "$ref": "#/definitions/Organization" } } }, "PublicKey": { "description": "PublicKey", "schema": { "$ref": "#/definitions/PublicKey" } }, "PublicKeyList": { "description": "PublicKeyList", "schema": { "type": "array", "items": { "$ref": "#/definitions/PublicKey" } } }, "PullRequest": { "description": "PullRequest", "schema": { "$ref": "#/definitions/PullRequest" } }, "PullRequestList": { "description": "PullRequestList", "schema": { "type": "array", "items": { "$ref": "#/definitions/PullRequest" } } }, "Release": { "description": "Release", "schema": { "$ref": "#/definitions/Release" } }, "ReleaseList": { "description": "ReleaseList", "schema": { "type": "array", "items": { "$ref": "#/definitions/Release" } } }, "Repository": { "description": "Repository", "schema": { "$ref": "#/definitions/Repository" } }, "RepositoryList": { "description": "RepositoryList", "schema": { "type": "array", "items": { "$ref": "#/definitions/Repository" } } }, "SearchResults": { "description": "SearchResults", "schema": { "$ref": "#/definitions/SearchResults" } }, "ServerVersion": { "description": "ServerVersion", "schema": { "$ref": "#/definitions/ServerVersion" } }, "Status": { "description": "Status", "schema": { "$ref": "#/definitions/Status" } }, "StatusList": { "description": "StatusList", "schema": { "type": "array", "items": { "$ref": "#/definitions/Status" } } }, "Team": { "description": "Team", "schema": { "$ref": "#/definitions/Team" } }, "TeamList": { "description": "TeamList", "schema": { "type": "array", "items": { "$ref": "#/definitions/Team" } } }, "TrackedTime": { "description": "TrackedTime", "schema": { "$ref": "#/definitions/TrackedTime" } }, "TrackedTimeList": { "description": "TrackedTimeList", "schema": { "type": "array", "items": { "$ref": "#/definitions/TrackedTime" } } }, "User": { "description": "User", "schema": { "$ref": "#/definitions/User" } }, "UserList": { "description": "UserList", "schema": { "type": "array", "items": { "$ref": "#/definitions/User" } } }, "WatchInfo": { "description": "WatchInfo", "schema": { "$ref": "#/definitions/WatchInfo" } }, "empty": { "description": "APIEmpty is an empty response" }, "error": { "description": "APIError is error format response", "headers": { "message": { "type": "string" }, "url": { "type": "string" } } }, "forbidden": { "description": "APIForbiddenError is a forbidden error response", "headers": { "message": { "type": "string" }, "url": { "type": "string" } } }, "notFound": { "description": "APINotFound is a not found empty response" }, "parameterBodies": { "description": "parameterBodies", "schema": { "$ref": "#/definitions/EditAttachmentOptions" } }, "redirect": { "description": "APIRedirect is a redirect response" }, "validationError": { "description": "APIValidationError is error format response related to input validation", "headers": { "message": { "type": "string" }, "url": { "type": "string" } } } }, "securityDefinitions": { "AccessToken": { "type": "apiKey", "name": "access_token", "in": "query" }, "AuthorizationHeaderToken": { "type": "apiKey", "name": "Authorization", "in": "header" }, "BasicAuth": { "type": "basic" }, "Token": { "type": "apiKey", "name": "token", "in": "query" } }, "security": [ { "BasicAuth": [] }, { "Token": [] }, { "AccessToken": [] }, { "AuthorizationHeaderToken": [] } ] } spec-0.21.0/fixtures/bugs/1621/000077500000000000000000000000001457312531500157345ustar00rootroot00000000000000spec-0.21.0/fixtures/bugs/1621/definitions.yaml000066400000000000000000000465761457312531500211550ustar00rootroot00000000000000definitions: # Generic response model V4GenericResponse: type: object properties: message: type: string description: A human readable message code: type: string description: | A machine readable [response code](https://github.com/giantswarm/api-spec/blob/master/details/RESPONSE_CODES.md) like e. g. `INVALID_CREDENTIALS` # Info resposne V4InfoResponse: type: object properties: general: description: General information type: object properties: installation_name: description: Unique name of the installation type: string provider: description: The technical provider used in this installation. Either "kvm", "aws", or "azure". type: string datacenter: description: Identifier of the datacenter or cloud provider region, e. g. "eu-west-1" type: string workers: description: Information related to worker nodes type: object properties: count_per_cluster: description: Number of workers per cluster type: object properties: max: description: Maximum number of worker a cluster can have type: number default: description: Default number of workers in a new cluster will have, if not specifiec otherwise type: number instance_type: description: Instance types to be used for worker nodes. Only available for AWS clusters. type: object properties: options: description: List of available instance types type: array items: type: string default: description: The instance type used in new cluster, if not specified type: string vm_size: description: Azure Virtual Machine size to be used for worker nodes. Only available for Azure clusters. type: object properties: options: description: List of available instance types type: array items: type: string default: description: The instance type used in new cluster, if not specified type: string # Request to create a new cluster V4AddClusterRequest: type: object required: - owner description: Request model for creating a new cluster properties: owner: type: string description: Name of the organization owning the cluster name: type: string description: Cluster name release_version: type: string description: | The [release](https://docs.giantswarm.io/api/#tag/releases) version to use in the new cluster kubernetes_version: type: string description: | Kubernetes version number (deprecated). Doesn't have any effect. This attribute is going to be removed in future API versions. workers: type: array items: $ref: '#/definitions/V4NodeDefinition' V4ModifyClusterRequest: type: object required: [] description: Request body for cluster modification properties: name: type: string description: Name for the cluster owner: type: string description: Name of the organization owning the cluster release_version: type: string description: Release version to use after an upgrade workers: type: array description: Worker node array items: $ref: '#/definitions/V4NodeDefinition' # Details on existing cluster V4ClusterDetailsResponse: type: object description: Response model showing details of a cluster properties: id: type: string description: Unique cluster identifier api_endpoint: type: string description: URI of the Kubernetes API endpoint create_date: type: string description: Date/time of cluster creation owner: type: string description: Name of the organization owning the cluster name: type: string description: Cluster name release_version: type: string description: | The [release](https://docs.giantswarm.io/api/#tag/releases) version currently running this cluster. kubernetes_version: type: string description: Deprecated. Will be removed in a future API version. workers: type: array items: $ref: '#/definitions/V4NodeDefinition' kvm: type: object description: Attributes specific to clusters running on KVM (on-prem) installations. properties: port_mappings: type: array description: | Reveals the ports on the host cluster that are mapped to this guest cluster's ingress and which protocol that port supports. Only shown and relevant on our on-prem KVM clusters. items: type: object properties: port: description: | The port on the host cluster that will forward traffic to the guest cluster type: integer protocol: description: | The protocol this port mapping is made for. type: string # Definition of a cluster node V4NodeDefinition: type: object properties: aws: type: object description: | Attributes specific to nodes running on Amazon Web Services (AWS) properties: instance_type: type: string description: | EC2 instance type name. Must be the same for all worker nodes of a cluster. azure: type: object description: | Attributes specific to nodes running on Microsoft Azure properties: vm_size: type: string description: | Azure Virtual Machine size. Must be the same for all worker nodes of a cluster. memory: type: object properties: size_gb: type: number description: RAM size in GB. Can be an integer or float. storage: type: object properties: size_gb: type: number description: Node storage size in GB. Can be an integer or float. cpu: type: object properties: cores: type: integer description: Number of CPU cores labels: type: object additionalProperties: true # List of key pairs V4GetKeyPairsResponse: type: array description: Array of sparse key pair objects items: type: object properties: id: type: string description: Unique identifier of the key pair description: type: string description: Free text information about the key pair ttl_hours: type: integer description: Expiration time (from creation) in hours create_date: type: string description: Date/time of creation common_name: type: string description: The common name of the certificate subject. certificate_organizations: type: string description: The certificate subject's `organization` fields. # Add key pair request V4AddKeyPairRequest: type: object required: - description properties: description: type: string description: Free text information about the key pair ttl_hours: type: integer format: int32 description: Expiration time (from creation) in hours cn_prefix: type: string description: The common name prefix of the certificate subject. This only allows characters that are usable in domain names (`a-z`, `0-9`, and `.-`, where `.-` must not occur at either the start or the end). certificate_organizations: type: string description: | This will set the certificate subject's `organization` fields. Use a comma seperated list of values. V4AddKeyPairResponse: type: object properties: id: type: string description: Unique identifier of the key pair description: type: string description: Free text information about the key pair ttl_hours: type: integer description: Expiration time (from creation) in hours create_date: type: string description: Date/time of creation certificate_authority_data: type: string description: PEM-encoded CA certificate of the cluster client_key_data: type: string description: PEM-encoded RSA private key client_certificate_data: type: string description: PEM-encoded certificate # cluster metrics V4GetClusterMetricsResponse: description: Response for the getClusterMetrics operation type: object properties: workers: description: Group of metrics regarding workers type: array items: $ref: '#/definitions/V4NodeMetrics' V4NodeMetrics: type: object properties: id: description: String identifying the node type: string metrics: description: Container object for all metrics available for the node type: object properties: container_count: type: object properties: timestamp: description: Time when the given value has been recorded type: string value: description: The value for the metric. Can be an integer or float. type: number pod_count: type: object properties: timestamp: description: Time when the given value has been recorded type: string value: description: The value for the metric. Can be an integer or float. type: number cpu_used: type: object properties: timestamp: description: Time when the given value has been recorded type: string value: description: The value for the metric. Can be an integer or float. type: number ram_free: type: object properties: timestamp: description: Time when the given value has been recorded type: string value: description: The value for the metric. Can be an integer or float. type: number ram_available: type: object properties: timestamp: description: Time when the given value has been recorded type: string value: description: The value for the metric. Can be an integer or float. type: number ram_cached: type: object properties: timestamp: description: Time when the given value has been recorded type: string value: description: The value for the metric. Can be an integer or float. type: number ram_buffers: type: object properties: timestamp: description: Time when the given value has been recorded type: string value: description: The value for the metric. Can be an integer or float. type: number ram_mapped: type: object properties: timestamp: description: Time when the given value has been recorded type: string value: description: The value for the metric. Can be an integer or float. type: number node_storage_used: type: object properties: timestamp: description: Time when the given value has been recorded type: string value: description: The value for the metric. Can be an integer or float. type: number network_rx: type: object properties: timestamp: description: Time when the given value has been recorded type: string value: description: The value for the metric. Can be an integer or float. type: number network_tx: type: object properties: timestamp: description: Time when the given value has been recorded type: string value: description: The value for the metric. Can be an integer or float. type: number resource_cpu_requests: type: object properties: timestamp: description: Time when the given value has been recorded type: string value: description: The value for the metric. Can be an integer or float. type: number resource_cpu_limits: type: object properties: timestamp: description: Time when the given value has been recorded type: string value: description: The value for the metric. Can be an integer or float. type: number resource_ram_requests: type: object properties: timestamp: description: Time when the given value has been recorded type: string value: description: The value for the metric. Can be an integer or float. type: number resource_ram_limits: type: object properties: timestamp: description: Time when the given value has been recorded type: string value: description: The value for the metric. Can be an integer or float. type: number # a complete organization object V4Organization: type: object properties: id: type: string description: Unique name/identifier of the organization members: type: array description: List of members that belong to this organization items: $ref: '#/definitions/V4OrganizationMember' # An organization as returned by getOrganizations as an array item V4OrganizationListItem: type: object properties: id: type: string description: Unique name/identifier of the organization # A user that belongs to an organization V4OrganizationMember: type: object properties: email: type: string description: Email address of the user # One of the users in the array as returned by getUsers V4UserListItem: type: object properties: email: type: string description: Email address of the user created: type: string description: The date and time that this account was created expiry: type: string description: The date and time when this account will expire # A cluster array item, as return by getClusters V4ClusterListItem: type: object properties: id: type: string description: Unique cluster identifier create_date: type: string description: Date/time of cluster creation name: type: string description: Cluster name owner: type: string description: Name of the organization owning the cluster release_version: type: string description: The semantic version number of this cluster # A cluster array item, as return by getClusters V4ReleaseListItem: type: object required: ["version", "timestamp", "changelog", "components"] properties: version: type: string description: The semantic version number timestamp: type: string description: Date and time of the release creation active: type: boolean description: | If true, the version is available for new clusters and cluster upgrades. Older versions become unavailable and thus have the value `false` here. changelog: description: | Structured list of changes in this release, in comparison to the previous version, with respect to the contained components. type: array items: type: object properties: component: type: string description: | If the changed item was a component, this attribute is the name of the component. description: type: string description: Human-friendly description of the change components: description: | List of components and their version contained in the release type: array items: type: object required: ["name", "version"] properties: name: type: string description: Name of the component version: type: string description: Version number of the component V4CreateUserRequest: type: object required: - password description: Request model for creating a new user properties: password: type: string description: A Base64 encoded password expiry: type: string description: The date and time when this account will expire V4AddCredentialsRequest: type: object required: - provider description: Request model for adding a set of credentials properties: provider: type: string aws: type: object description: Credentials specific to an AWS account required: - roles properties: roles: type: object description: IAM roles to assume by certain entities required: - awsoperator - admin properties: admin: type: string description: ARN of the IAM role to assume by Giant Swarm support staff awsoperator: type: string description: ARN of the IAM role to assume by the software operating clusters # A request for an auth token V4CreateAuthTokenRequest: type: object properties: email: type: string description: Your email address password_base64: type: string description: Your password as a base64 encoded string # A response to a successful auth token request V4CreateAuthTokenResponse: type: object properties: auth_token: type: string description: The newly created API token spec-0.21.0/fixtures/bugs/1621/fixture-1621.yaml000066400000000000000000001462511457312531500207060ustar00rootroot00000000000000swagger: "2.0" info: title: The Giant Swarm API v4 description: | This is the documentation for the Giant Swarm API starting at version `v4`. For an introduction to Giant Swarm, refer to the [documentation site](https://docs.giantswarm.io/). The Giant Swarm API attempts to behave in a __restful__ way. As a developer, you access resources using the `GET` method and, for example, delete them using the same path and the `DELETE` method. Accessing resources via GET usually returns all information available about a resource, while collections, like for example the list of all clusters you have access to, only contain a selected few attributes of each member item. Some requests, like for example the request to create a new cluster, don't return the resource itself. Instead, the response delivers a standard message body, showing a `code` and a `message` part. The `message` contains information for you or a client's end user. The `code` attribute contains some string (example: `RESOURCE_CREATED`) that is supposed to give you details on the state of the operation, in addition to standard HTTP status codes. This message format is also used in the case of errors. We provide a [list of all response codes](https://github.com/giantswarm/api-spec/blob/master/details/RESPONSE_CODES.md) outside this documentation. Feedback on the API as well as this documentation is welcome via `support@giantswarm.io` or on IRC channel [#giantswarm](irc://irc.freenode.org:6667/#giantswarm) on freenode. ## Source The source of this documentation is available on [GitHub](https://github.com/giantswarm/api-spec). termsOfService: https://giantswarm.io/terms/ version: 4.0.0 license: name: Apache 2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html consumes: - application/json produces: - application/json tags: - name: auth tokens description: | Auth Tokens are your way of authenticating against this API. You can create one by passing your email and base64 encoded password to the create auth token endpoint. The auth token never expires, in case you want to invalidate it you need to delete it (logout). - name: clusters description: | Clusters are a central resource of the Giant Swarm API. As a user or team using Giant Swarm, you set up Kubernetes clusters to run your own workloads. The API currently provides operations to create and delete clusters, as well as list all available clusters and get details on specific clusters. - name: info description: Information about the Giant Swarm installation - name: key pairs description: A key pair is a unique combination of a X.509 certificate and a private key. Key pairs are used to access the Kubernetes API of a cluster, both using `kubectl` and any standard web browser. externalDocs: url: https://docs.giantswarm.io/guides/accessing-services-from-the-outside/ description: "User guide: Accessing Pods and Services from the Outside" - name: organizations description: Organizations are groups of users who own resources like clusters. - name: users description: A user represents a person that should have access to the Giant Swarm API. Users can belong to many groups, and are identified by email address. - name: releases description: | A release is a software bundle that constitutes a cluster. Releases are identified by their [semantic version number](http://semver.org/) in the `MAJOR.MINOR.PATCH` format. A release provides _components_, like for example Kubernetes. For each release the contained components are listed. Changes in components are detailed in the _changelog_ of a release. securityDefinitions: AuthorizationHeaderToken: description: | Clients authenticate by passing an auth token via the `Authorization` header with a value of the format `giantswarm `. Auth tokens can be obtained using the [createAuthToken](#operation/createAuthToken) operation. type: apiKey name: Authorization in: header security: - AuthorizationHeaderToken: [] paths: /v4/info/: get: operationId: getInfo tags: - info summary: Get information on the installation description: | Returns a set of details on the installation. The output varies based on the provider used in the installation. This information is useful for example when creating new cluster, to prevent creating clusters with more worker nodes than possible. ### Example for an AWS-based installation ```json { "general": { "installation_name": "shire", "provider": "aws", "datacenter": "eu-central-1" }, "workers": { "count_per_cluster": { "max": 20, "default": 3 }, "instance_type": { "options": [ "m3.medium", "m3.large", "m3.xlarge" ], "default": "m3.large" } } } ``` ### Example for a KVM-based installation ```json { "general": { "installation_name": "isengard", "provider": "kvm", "datacenter": "string" }, "workers": { "count_per_cluster": { "max": 8, "default": 3 }, } } ``` parameters: - $ref: './parameters.yaml#/parameters/RequiredGiantSwarmAuthorizationHeader' - $ref: './parameters.yaml#/parameters/XRequestIDHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmActivityHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmCmdLineHeader' responses: "200": description: Information schema: $ref: "./definitions.yaml#/definitions/V4InfoResponse" examples: application/json: { "general": { "installation_name": "shire", "provider": "aws", "datacenter": "eu-central-1" }, "workers": { "count_per_cluster": { "max": 20, "default": 3 }, "instance_type": { "options": [ "m3.medium", "m3.large", "m3.xlarge" ], "default": "m3.large" } } } "401": $ref: "./responses.yaml#/responses/V4Generic401Response" default: description: Error schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" /v4/auth-tokens/: post: operationId: createAuthToken tags: - auth tokens summary: Create Auth Token (Login) description: | Creates a Auth Token for a given user. Must authenticate with email and password. parameters: - $ref: './parameters.yaml#/parameters/XRequestIDHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmActivityHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmCmdLineHeader' - name: body in: body required: true description: Create Auth Token Request schema: $ref: 'definitions.yaml#/definitions/V4CreateAuthTokenRequest' x-examples: application/json: { "email": "developer@example.com", "password_base64": "cGFzc3dvcmQ=" } responses: "200": description: Success schema: $ref: "./definitions.yaml#/definitions/V4CreateAuthTokenResponse" examples: application/json: { "auth_token": "e5239484-2299-41df-b901-d0568db7e3f9" } "401": $ref: "./responses.yaml#/responses/V4Generic401Response" delete: operationId: deleteAuthToken tags: - auth tokens summary: Delete Auth Token (Logout) description: | Deletes the authentication token provided in the Authorization header. This effectively logs you out. parameters: - $ref: './parameters.yaml#/parameters/RequiredGiantSwarmAuthorizationHeader' - $ref: './parameters.yaml#/parameters/XRequestIDHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmActivityHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmCmdLineHeader' responses: "200": description: Success schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" examples: application/json: { "code": "RESOURCE_DELETED", "message": "The authentication token has been succesfully deleted." } "401": $ref: "./responses.yaml#/responses/V4Generic401Response" /v4/users/: get: operationId: getUsers tags: - users summary: Get users description: | Returns a list of all users in the system. Currently this endpoint is only available to users with admin permissions. parameters: - $ref: './parameters.yaml#/parameters/RequiredGiantSwarmAuthorizationHeader' - $ref: './parameters.yaml#/parameters/XRequestIDHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmActivityHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmCmdLineHeader' responses: "200": description: Success schema: type: array items: $ref: "./definitions.yaml#/definitions/V4UserListItem" examples: application/json: [ {"email": "andy@example.com", "created": "2017-01-15T12:00:00Z", "expiry": "2019-01-15T00:00:00Z"}, {"email": "bob@example.com", "created": "2017-02-15T12:30:00Z", "expiry": "2020-01-15T00:00:00Z"}, {"email": "charles@example.com", "created": "2017-03-15T13:00:00Z", "expiry": "2021-01-15T00:00:00Z"} ] "401": $ref: "./responses.yaml#/responses/V4Generic401Response" default: description: Error schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" /v4/user/: get: operationId: getCurrentUser tags: - users summary: Get current user description: | Returns details about the currently authenticated user parameters: - $ref: './parameters.yaml#/parameters/RequiredGiantSwarmAuthorizationHeader' - $ref: './parameters.yaml#/parameters/XRequestIDHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmActivityHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmCmdLineHeader' responses: "200": description: Success schema: $ref: "./definitions.yaml#/definitions/V4UserListItem" examples: application/json: {"email": "andy@example.com", "created": "2017-01-15T12:00:00Z", "expiry": "2019-01-15T00:00:00Z"} "401": $ref: "./responses.yaml#/responses/V4Generic401Response" default: description: Error schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" /v4/users/{email}/: get: operationId: getUser parameters: - $ref: './parameters.yaml#/parameters/RequiredGiantSwarmAuthorizationHeader' - $ref: './parameters.yaml#/parameters/XRequestIDHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmActivityHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmCmdLineHeader' - $ref: "./parameters.yaml#/parameters/UserEmailPathParameter" tags: - users summary: Get user description: | Returns details about a specific user responses: "200": description: Success schema: $ref: "./definitions.yaml#/definitions/V4UserListItem" examples: application/json: {"email": "andy@example.com", "created": "2017-01-15T12:00:00Z", "expiry": "2019-01-15T00:00:00Z"} "401": $ref: "./responses.yaml#/responses/V4Generic401Response" "404": description: User not found schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" examples: application/json: { "code": "RESOURCE_NOT_FOUND", "message": "The user could not be found. (not found: user with email 'bob@example.com' could not be found)" } default: description: Error schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" put: operationId: createUser parameters: - $ref: './parameters.yaml#/parameters/RequiredGiantSwarmAuthorizationHeader' - $ref: './parameters.yaml#/parameters/XRequestIDHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmActivityHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmCmdLineHeader' - $ref: "./parameters.yaml#/parameters/UserEmailPathParameter" - name: body in: body required: true description: User account details schema: $ref: "./definitions.yaml#/definitions/V4CreateUserRequest" x-examples: application/json: { "password": "cGFzc3dvcmQ=", "expiry": "2020-01-01T12:00:00.000Z" } tags: - users summary: Create user description: | Creates a users in the system. Currently this endpoint is only available to users with admin permissions. responses: "201": description: User created schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" examples: application/json: { "code": "RESOURCE_CREATED", "message": "The user with email 'bob@example.com' has been created." } "400": description: User already exists schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" examples: application/json: { "code": "RESOURCE_ALREADY_EXISTS", "message": "The user could not be created. (invalid input: email 'bob@example.com' already exists)" } "401": $ref: "./responses.yaml#/responses/V4Generic401Response" default: description: Error schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" delete: operationId: deleteUser parameters: - $ref: './parameters.yaml#/parameters/RequiredGiantSwarmAuthorizationHeader' - $ref: './parameters.yaml#/parameters/XRequestIDHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmActivityHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmCmdLineHeader' - $ref: "./parameters.yaml#/parameters/UserEmailPathParameter" tags: - users summary: Delete user description: | Deletes a users in the system. Currently this endpoint is only available to users with admin permissions. responses: "200": description: User deleted schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" examples: application/json: { "code": "RESOURCE_DELETED", "message": "The user with email 'bob@example.com' has been deleted." } "401": $ref: "./responses.yaml#/responses/V4Generic401Response" "404": description: User not found schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" examples: application/json: { "code": "RESOURCE_NOT_FOUND", "message": "The user could not be deleted. (not found: user with email 'bob@example.com' could not be found)" } default: description: Error schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" /v4/clusters/: get: operationId: getClusters tags: - clusters summary: Get clusters description: | This operation fetches a list of clusters. The result depends on the permissions of the user. A normal user will get all the clusters the user has access to, via organization membership. A user with admin permission will receive a list of all existing clusters. The result array items are sparse representations of the cluster objects. To fetch more details on a cluster, use the [getCluster](#operation/getCluster) operation. parameters: - $ref: './parameters.yaml#/parameters/RequiredGiantSwarmAuthorizationHeader' - $ref: './parameters.yaml#/parameters/XRequestIDHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmActivityHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmCmdLineHeader' responses: "200": description: Success schema: type: array items: $ref: "./definitions.yaml#/definitions/V4ClusterListItem" examples: application/json: [ { "id": "g8s3o", "create_date": "2017-06-08T12:31:47.215Z", "name": "Staging Cluster", "owner": "acme" }, { "id": "3dkr6", "create_date": "2017-05-22T13:58:02.024Z", "name": "Test Cluster", "owner": "testorg" } ] "401": $ref: "./responses.yaml#/responses/V4Generic401Response" default: description: Error schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" post: operationId: addCluster tags: - clusters summary: Create cluster description: | This operation is used to create a new Kubernetes cluster for an organization. The desired configuration can be specified using the __cluster definition format__ (see [external documentation](https://github.com/giantswarm/api-spec/blob/master/details/CLUSTER_DEFINITION.md) for details). The cluster definition format allows to set a number of optional configuration details, like memory size and number of CPU cores. However, one attribute is __mandatory__ upon creation: The `owner` attribute must carry the name of the organization the cluster will belong to. Note that the acting user must be a member of that organization in order to create a cluster. It is *recommended* to also specify the `name` attribute to give the cluster a friendly name, like e. g. "Development Cluster". Additional definition attributes can be used. Where attributes are omitted, default configuration values will be applied. For example, if no `release_version` is specified, the most recent version is used. The `workers` attribute, if present, must contain an array of node definition objects. The number of objects given determines the number of workers created. For example, requesting three worker nodes with default configuration can be achieved by submitting an array of three empty objects: ```"workers": [{}, {}, {}]``` For clusters on AWS, note that all worker nodes must use the same instance type. parameters: - $ref: './parameters.yaml#/parameters/RequiredGiantSwarmAuthorizationHeader' - $ref: './parameters.yaml#/parameters/XRequestIDHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmActivityHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmCmdLineHeader' - name: body in: body required: true description: New cluster definition schema: $ref: "./definitions.yaml#/definitions/V4AddClusterRequest" x-examples: application/json: { "owner": "myteam", "release_version": "1.4.2", "name": "Example cluster with 3 default worker nodes", "workers": [{}, {}, {}] } responses: "201": description: Cluster created headers: Location: type: string description: URI to obtain details on the new cluster using the [getCluster](#operation/getCluster) operation schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" examples: application/json: { "code": "RESOURCE_CREATED", "message": "A new cluster has been created with ID 'wqtlq'" } "401": $ref: "./responses.yaml#/responses/V4Generic401Response" default: description: error schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" /v4/clusters/{cluster_id}/: get: operationId: getCluster tags: - clusters parameters: - $ref: './parameters.yaml#/parameters/RequiredGiantSwarmAuthorizationHeader' - $ref: './parameters.yaml#/parameters/XRequestIDHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmActivityHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmCmdLineHeader' - $ref: "./parameters.yaml#/parameters/ClusterIdPathParameter" summary: Get cluster details description: | This operation allows to obtain all available details on a particular cluster. responses: "200": description: Cluster details schema: $ref: "./definitions.yaml#/definitions/V4ClusterDetailsResponse" examples: application/json: { "id": "wqtlq", "create_date": "2017-03-03T10:50:45.949270905Z", "api_endpoint": "https://api.wqtlq.example.com", "name": "Just a Standard Cluster", "release_version": "2.5.16", "kubernetes_version": "", "owner": "acme", "workers": [ { "memory": {"size_gb": 2.0}, "storage": {"size_gb": 20.0}, "cpu": {"cores": 4}, "labels": { "beta.kubernetes.io/arch": "amd64", "beta.kubernetes.io/os": "linux", "ip": "10.3.11.2", "kubernetes.io/hostname": "worker-1.x882ofna.k8s.gigantic.io", "nodetype": "hicpu" } }, { "memory": {"size_gb": 8.0}, "storage": {"size_gb": 20.0}, "cpu": {"cores": 2}, "labels": { "beta.kubernetes.io/arch": "amd64", "beta.kubernetes.io/os": "linux", "ip": "10.3.62.2", "kubernetes.io/hostname": "worker-2.x882ofna.k8s.gigantic.io", "nodetype": "hiram" } } ], "kvm": { "port_mappings": [ { "port": 30020, "protocol": "http" }, { "port": 30021, "protocol": "https" }, ] } } "401": $ref: "./responses.yaml#/responses/V4Generic401Response" "404": description: Cluster not found schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" examples: application/json: { "code": "RESOURCE_NOT_FOUND", "message": "The cluster with ID 'wqtlq' could not be found, or perhaps you do not have access to it. Please make sure the cluster ID is correct, and that you are a member of the organization that it belongs to." } default: description: error schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" patch: operationId: modifyCluster tags: - clusters parameters: - $ref: './parameters.yaml#/parameters/RequiredGiantSwarmAuthorizationHeader' - $ref: './parameters.yaml#/parameters/XRequestIDHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmActivityHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmCmdLineHeader' - name: body in: body required: true description: Merge-patch body schema: $ref: "./definitions.yaml#/definitions/V4ModifyClusterRequest" x-examples: application/merge-patch+json: { "name": "New cluster name" } - $ref: "./parameters.yaml#/parameters/ClusterIdPathParameter" summary: Modify cluster description: | This operation allows to modify an existing cluster. A cluster modification is performed by submitting a `PATCH` request to the cluster resource (as described in the [addCluster](#operation/addCluster) and [getCluster](#operation/getCluster)) in form of a [JSON Patch Merge (RFC 7386)](https://tools.ietf.org/html/rfc7386). This means, only the attributes to be modified have to be contained in the request body. The following attributes can be modified: - `name`: Rename the cluster to something more fitting. - `owner`: Changing the owner organization name means to change cluster ownership from one organization to another. The user performing the request has to be a member of both organizations. - `release_version`: By changing this attribute you can upgrade a cluster to a newer [release](https://docs.giantswarm.io/api/#tag/releases). - `workers`: By modifying the array of workers, nodes can be added to increase the cluster's capacity. See details below. ### Adding and Removing Worker Nodes (Scaling) Adding worker nodes to a cluster or removing worker nodes from a cluster works by submitting the `workers` attribute, which contains a (sparse) array of worker node defintions. _Sparse_ here means that all configuration details are optional. In the case that worker nodes are added to a cluster, wherever a configuration detail is missing, defaults will be applied. See [Creating a cluster](#operation/addCluster) for details. When modifying the cluster resource, you describe the desired state. For scaling, this means that the worker node array submitted must contain as many elements as the cluster should have worker nodes. If your cluster currently has five nodes and you submit a workers array with four elements, this means that one worker node will be removed. If your submitted workers array has six elements, this means one will be added. As an example, this request body could be used to scale a cluster to three worker nodes: ```json { "workers": [{}, {}, {}] } ``` If the scaled cluster had four worker nodes before, one would be removed. If it had two worker nodes before, one with default settings would be added. ### Limitations - As of now, existing worker nodes cannot be modified. - When removing nodes (scaling down), it is not possible to determine which nodes will be removed. - On AWS based clusters, all worker nodes must use the same EC2 instance type (`instance_type` node attribute). By not setting an `instance_type` when submitting a PATCH request, you ensure that the right instance type is used automatically. responses: "200": description: Cluster modified schema: $ref: "./definitions.yaml#/definitions/V4ClusterDetailsResponse" "401": $ref: "./responses.yaml#/responses/V4Generic401Response" "404": description: Cluster not found schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" examples: application/json: { "code": "RESOURCE_NOT_FOUND", "message": "The cluster with ID 'wqtlq' could not be found, or perhaps you do not have access to it. Please make sure the cluster ID is correct, and that you are a member of the organization that it belongs to." } default: description: error schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" delete: operationId: deleteCluster tags: - clusters parameters: - $ref: './parameters.yaml#/parameters/RequiredGiantSwarmAuthorizationHeader' - $ref: './parameters.yaml#/parameters/XRequestIDHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmActivityHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmCmdLineHeader' - $ref: "./parameters.yaml#/parameters/ClusterIdPathParameter" summary: Delete cluster description: | This operation allows to delete a cluster. __Caution:__ Deleting a cluster causes the termination of all workloads running on the cluster. Data stored on the worker nodes will be lost. There is no way to undo this operation. The response is sent as soon as the request is validated. At that point, workloads might still be running on the cluster and may be accessible for a little wile, until the cluster is actually deleted. responses: "202": description: Deleting cluster schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" examples: application/json: { "code": "RESOURCE_DELETION_STARTED", "message": "The cluster with ID 'wqtlq' is being deleted." } "401": $ref: "./responses.yaml#/responses/V4Generic401Response" "404": description: Cluster not found schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" examples: application/json: { "code": "RESOURCE_NOT_FOUND", "message": "The cluster with ID 'wqtlq' could not be found, or perhaps you do not have access to it. Please make sure the cluster ID is correct, and that you are a member of the organization that it belongs to." } default: description: error schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" /v4/clusters/{cluster_id}/key-pairs/: get: operationId: getKeyPairs tags: - key pairs summary: Get key pairs description: | Returns a list of information on all key pairs of a cluster as an array. The individual array items contain metadata on the key pairs, but neither the key nor the certificate. These can only be obtained upon creation, using the [addKeypair](#operation/addKeyPair) operation. parameters: - $ref: './parameters.yaml#/parameters/RequiredGiantSwarmAuthorizationHeader' - $ref: './parameters.yaml#/parameters/XRequestIDHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmActivityHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmCmdLineHeader' - $ref: "./parameters.yaml#/parameters/ClusterIdPathParameter" responses: "200": description: Key pairs schema: $ref: "./definitions.yaml#/definitions/V4GetKeyPairsResponse" "401": $ref: "./responses.yaml#/responses/V4Generic401Response" default: description: error schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" post: operationId: addKeyPair tags: - key pairs summary: Create key pair parameters: - $ref: './parameters.yaml#/parameters/RequiredGiantSwarmAuthorizationHeader' - $ref: './parameters.yaml#/parameters/XRequestIDHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmActivityHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmCmdLineHeader' - $ref: "./parameters.yaml#/parameters/ClusterIdPathParameter" - name: body in: body required: true description: | While the `ttl_hours` attribute is optional and will be set to a default value when omitted, the `description` is mandatory. schema: $ref: "./definitions.yaml#/definitions/V4AddKeyPairRequest" x-examples: application/json: { "description": "Admin key pair lasting twelve hours", "ttl_hours": 12, "certificate_organizations": "system:masters" } description: | This operation allows to create a new key pair for accessing a specific cluster. A key pair consists of an unencrypted private RSA key and an X.509 certificate. In addition, when obtaining a key pair for a cluster, the cluster's certificate authority file (CA certificate) is delivered, which is required by TLS clients to establish trust to the cluster. In addition to the credentials itself, a key pair has some metadata like a unique ID, a creation timestamp and a free text `description` that you can use at will, for example to note for whom a key pair has been issued. ### Customizing the certificate's subject for K8s RBAC It is possible to set the Common Name and Organization fields of the generated certificate's subject. - `cn_prefix`: The certificate's common name uses this format: `.user.`. `clusterdomain` is specific to your cluster and is not editable. The `cn_prefix` however is editable. When left blank it will default to the email address of the Giant Swarm user that is performing the create key pair request. The common name is used as the username for requests to the Kubernetes API. This allows you to set up role-based access controls. - `certificate_organizations`: This will set the certificate's `organization` fields. Use a comma separated list of values. The Kubernetes API will use these values as group memberships. __Note:__ The actual credentials coming with the key pair (key, certificate) can only be accessed once, as the result of the `POST` request that triggers their creation. This restriction exists to minimize the risk of credentials being leaked. If you fail to capture the credentials upon creation, you'll have to repeat the creation request. responses: "200": description: Success schema: $ref: "./definitions.yaml#/definitions/V4AddKeyPairResponse" examples: application/json: { "certificate_authority_data": "-----BEGIN CERTIFICATE-----...-----END CERTIFICATE-----", "client_key_data": "-----BEGIN RSA PRIVATE KEY-----...-----END RSA PRIVATE KEY-----", "client_certificate_data": "-----BEGIN CERTIFICATE-----...-----END CERTIFICATE-----", "create_date": "2016-06-01T12:00:00.000Z", "description": "Key pair description", "id": "02:cc:da:f9:fb:ce:c3:e5:e1:f6:27:d8:43:48:0d:37:4a:ee:b9:67", "ttl_hours": 8640 } "401": $ref: "./responses.yaml#/responses/V4Generic401Response" /v4/organizations/: get: operationId: getOrganizations tags: - organizations summary: Get organizations description: | This operation allows to fetch a list of organizations the user is a member of. In the case of an admin user, the result includes all existing organizations. parameters: - $ref: './parameters.yaml#/parameters/RequiredGiantSwarmAuthorizationHeader' - $ref: './parameters.yaml#/parameters/XRequestIDHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmActivityHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmCmdLineHeader' responses: "200": description: Success schema: type: array items: $ref: "./definitions.yaml#/definitions/V4OrganizationListItem" examples: application/json: [ {"id": "acme"}, {"id": "giantswarm"}, {"id": "testorg"} ] "401": $ref: "./responses.yaml#/responses/V4Generic401Response" default: description: Error schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" /v4/organizations/{organization_id}/: get: operationId: getOrganization tags: - organizations summary: Get organization details description: | This operation fetches organization details. parameters: - $ref: './parameters.yaml#/parameters/RequiredGiantSwarmAuthorizationHeader' - $ref: './parameters.yaml#/parameters/XRequestIDHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmActivityHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmCmdLineHeader' - $ref: "./parameters.yaml#/parameters/OrganizationIdPathParameter" responses: "200": description: Organization details schema: $ref: "./definitions.yaml#/definitions/V4Organization" examples: application/json: { "id": "acme", "members": [ {"email": "user1@example.com"}, {"email": "user2@example.com"} ] } "401": $ref: "./responses.yaml#/responses/V4Generic401Response" "404": description: Organization not found schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" examples: application/json: { "code": "RESOURCE_NOT_FOUND", "message": "The organization could not be found. (not found: the organization with id 'acme' could not be found)" } default: description: Error schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" put: operationId: addOrganization tags: - organizations summary: Create an organization description: | This operation allows a user to create an organization. parameters: - $ref: './parameters.yaml#/parameters/RequiredGiantSwarmAuthorizationHeader' - $ref: './parameters.yaml#/parameters/XRequestIDHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmActivityHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmCmdLineHeader' - $ref: "./parameters.yaml#/parameters/OrganizationIdPathParameter" - name: body in: body required: true schema: $ref: "./definitions.yaml#/definitions/V4Organization" x-examples: application/json: { "id": "string", "members": [ {"email": "myself@example.com"}, {"email": "colleague@example.com"} ] } responses: "201": description: Organization created schema: $ref: "./definitions.yaml#/definitions/V4Organization" examples: application/json: { "id": "acme", "members": [ {"email": "user1@example.com"}, {"email": "user2@example.com"} ] } "401": $ref: "./responses.yaml#/responses/V4Generic401Response" "409": description: Organization already exists schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" examples: application/json: { "code": "RESOURCE_ALREADY_EXISTS", "message": "The organization could not be created. (org already exists)" } default: description: Error schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" patch: operationId: modifyOrganization tags: - organizations parameters: - $ref: './parameters.yaml#/parameters/RequiredGiantSwarmAuthorizationHeader' - $ref: './parameters.yaml#/parameters/XRequestIDHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmActivityHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmCmdLineHeader' - $ref: "./parameters.yaml#/parameters/OrganizationIdPathParameter" - name: body in: body required: true schema: type: object properties: members: type: array description: List of members that belong to this organization items: $ref: "./definitions.yaml#/definitions/V4OrganizationMember" x-examples: application/merge-patch+json: { "members": [{"email": "myself@example.com"}] } summary: Modify organization description: | This operation allows you to modify an existing organization. You must be a member of the organization or an admin in order to use this endpoint. The following attributes can be modified: - `members`: By modifying the array of members, members can be added to or removed from the organization The request body must conform with the [JSON Patch Merge (RFC 7386)](https://tools.ietf.org/html/rfc7386) standard. Requests have to be sent with the `Content-Type: application/merge-patch+json` header. The full request must be valid before it will be executed, currently this means every member you attempt to add to the organization must actually exist in the system. If any member you attempt to add is invalid, the entire patch operation will fail, no members will be added or removed, and an error message will explain which members in your request are invalid. responses: "200": description: Organization modified schema: $ref: "./definitions.yaml#/definitions/V4Organization" "400": description: Invalid input schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" examples: application/json: { "code": "INVALID_INPUT", "message": "The organization could not be modified. (invalid input: user 'invalid-email' does not exist or is invalid)" } "401": $ref: "./responses.yaml#/responses/V4Generic401Response" "404": description: Organization not found schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" examples: application/json: { "code": "RESOURCE_NOT_FOUND", "message": "The organization could not be modified. (not found: the organization with id 'acme' could not be found)" } default: description: error schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" delete: operationId: deleteOrganization tags: - organizations summary: Delete an organization description: | This operation allows a user to delete an organization that they are a member of. Admin users can delete any organization. parameters: - $ref: './parameters.yaml#/parameters/RequiredGiantSwarmAuthorizationHeader' - $ref: './parameters.yaml#/parameters/XRequestIDHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmActivityHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmCmdLineHeader' - $ref: "./parameters.yaml#/parameters/OrganizationIdPathParameter" responses: "200": description: Organization deleted schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" examples: application/json: { "code": "RESOURCE_DELETED", "message": "The organization with ID 'acme' has been deleted." } "401": $ref: "./responses.yaml#/responses/V4Generic401Response" "404": description: Organization not found schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" examples: application/json: { "code": "RESOURCE_NOT_FOUND", "message": "The organization could not be deleted. (not found: the organization with id 'acme' could not be found)" } default: description: Error schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" /v4/organizations/{organization_id}/credentials/: post: operationId: addCredentials tags: - organizations summary: Set credentials description: | Add a set of credentials to the organization allowing the creation and operation of clusters within a cloud provider account/subscription. The actual type of these credentials depends on the cloud provider the installation is running on. Currently, only AWS is supported, with support for Azure being planned for the near future. Credentials in an organization are immutable. Each organization can only have one set of credentials. Once credentials have been set for an organization, they are used for every new cluster that will be created for the organization. ### Example request body for AWS ```json { "provider": "aws", "aws": { "roles": { "admin": "arn:aws:iam::123456789012:role/GiantSwarmAdmin", "awsoperator": "arn:aws:iam::123456789012:role/GiantSwarmAWSOperator" } } } ``` parameters: - $ref: './parameters.yaml#/parameters/RequiredGiantSwarmAuthorizationHeader' - $ref: './parameters.yaml#/parameters/XRequestIDHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmActivityHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmCmdLineHeader' - $ref: "./parameters.yaml#/parameters/OrganizationIdPathParameter" - name: body in: body required: true schema: $ref: "./definitions.yaml#/definitions/V4AddCredentialsRequest" x-examples: application/json: { "provider": "aws", "aws": { "roles": { "admin": "arn:aws:iam::123456789012:role/GiantSwarmAdmin", "awsoperator": "arn:aws:iam::123456789012:role/GiantSwarmAWSOperator" } } } responses: "201": description: Credentials created headers: Location: type: string description: URI of the new credentials resource schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" examples: application/json: { "code": "RESOURCE_CREATED", "message": "A new set of credentials has been created with ID '5d9h4'" } "401": $ref: "./responses.yaml#/responses/V4Generic401Response" "409": description: Conflict schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" examples: application/json: { "code": "RESOURCE_ALREADY_EXISTS", "message": "The organisation already has a set of credentials" } default: description: error schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" /v4/releases/: get: operationId: getReleases tags: - releases summary: Get releases description: | Lists all releases available for new clusters or for upgrading existing clusters. Might also serve as an archive to obtain details on older releases. parameters: - $ref: './parameters.yaml#/parameters/RequiredGiantSwarmAuthorizationHeader' - $ref: './parameters.yaml#/parameters/XRequestIDHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmActivityHeader' - $ref: './parameters.yaml#/parameters/XGiantSwarmCmdLineHeader' responses: "200": description: Releases list schema: type: array items: $ref: "./definitions.yaml#/definitions/V4ReleaseListItem" examples: application/json: [ { "version": "1.14.9", "timestamp": "2017-09-21T08:14:03.37759Z", "changelog": [ { "component": "kubernetes", "description": "Security fixes" }, { "component": "calico", "description": "Security fixes" } ], "components": [ { "name": "kubernetes", "version": "1.5.8" }, { "name": "calico", "version": "0.9.1" } ], "active": false }, { "version": "2.8.4", "timestamp": "2017-11-11T12:24:56.59969Z", "changelog": [ { "component": "calico", "description": "Bugfix" } ], "components": [ { "name": "kubernetes", "version": "1.7.3" }, { "name": "calico", "version": "1.1.1" } ], "active": true } ] "401": $ref: "./responses.yaml#/responses/V4Generic401Response" spec-0.21.0/fixtures/bugs/1621/parameters.yaml000066400000000000000000000027031457312531500207650ustar00rootroot00000000000000parameters: RequiredGiantSwarmAuthorizationHeader: name: Authorization type: string in: header required: true description: As described in the [authentication](#section/Authentication) section ClusterIdPathParameter: name: cluster_id in: path required: true type: string description: Cluster ID UserEmailPathParameter: name: email in: path required: true type: string description: The user's email address OrganizationIdPathParameter: name: organization_id in: path required: true type: string description: | An ID for the organization. This ID must be unique and match this regular expression: ^[a-z0-9_]{4,30}$ XRequestIDHeader: name: X-Request-ID in: header type: string required: false description: | A randomly generated key that can be used to track a request throughout services of Giant Swarm. XGiantSwarmActivityHeader: name: X-Giant-Swarm-Activity in: header type: string required: false description: | Name of an activity to track, like "list-clusters". This allows to analyze several API requests sent in context and gives an idea on the purpose. XGiantSwarmCmdLineHeader: name: X-Giant-Swarm-CmdLine in: header type: string required: false description: | If activity has been issued by a CLI, this header can contain the command line spec-0.21.0/fixtures/bugs/1621/responses.yaml000066400000000000000000000005411457312531500206410ustar00rootroot00000000000000responses: V4Generic401Response: description: Permission denied schema: $ref: "./definitions.yaml#/definitions/V4GenericResponse" examples: application/json: { "code": "PERMISSION_DENIED", "message": "The requested resource cannot be accessed using the provided authentication details." } spec-0.21.0/fixtures/bugs/2113/000077500000000000000000000000001457312531500157315ustar00rootroot00000000000000spec-0.21.0/fixtures/bugs/2113/base.yaml000066400000000000000000000003021457312531500175220ustar00rootroot00000000000000swagger: "2.0" info: version: "1" title: "nested $ref fixture" paths: /dummy: $ref: ./schemas/api/api.yaml#/paths/~1dummy /example: $ref: ./schemas/api/api.yaml#/paths/~1example spec-0.21.0/fixtures/bugs/2113/schemas/000077500000000000000000000000001457312531500173545ustar00rootroot00000000000000spec-0.21.0/fixtures/bugs/2113/schemas/api/000077500000000000000000000000001457312531500201255ustar00rootroot00000000000000spec-0.21.0/fixtures/bugs/2113/schemas/api/api.yaml000066400000000000000000000005121457312531500215600ustar00rootroot00000000000000swagger: "2.0" info: version: "1" title: "sub api" paths: /dummy: get: responses: 200: description: OK schema: $ref: ../dummy/dummy.yaml /example: get: responses: 200: description: OK schema: $ref: ../example/example.yaml spec-0.21.0/fixtures/bugs/2113/schemas/dummy/000077500000000000000000000000001457312531500205075ustar00rootroot00000000000000spec-0.21.0/fixtures/bugs/2113/schemas/dummy/dummy.yaml000066400000000000000000000001101457312531500225160ustar00rootroot00000000000000required: - dummyPayload properties: dummyPayload: type: string spec-0.21.0/fixtures/bugs/2113/schemas/example/000077500000000000000000000000001457312531500210075ustar00rootroot00000000000000spec-0.21.0/fixtures/bugs/2113/schemas/example/example.yaml000066400000000000000000000001571457312531500233310ustar00rootroot00000000000000$schema: http://json-schema.org/draft-07/schema# required: - payload properties: payload: type: string spec-0.21.0/fixtures/bugs/2743/000077500000000000000000000000001457312531500157425ustar00rootroot00000000000000spec-0.21.0/fixtures/bugs/2743/not-working/000077500000000000000000000000001457312531500202205ustar00rootroot00000000000000spec-0.21.0/fixtures/bugs/2743/not-working/minimal.yaml000066400000000000000000000001531457312531500225310ustar00rootroot00000000000000swagger: '2.0' info: version: 0.0.0 title: Simple API paths: /bar: $ref: 'swagger/paths/bar.yml' spec-0.21.0/fixtures/bugs/2743/not-working/spec.yaml000066400000000000000000000003171457312531500220370ustar00rootroot00000000000000swagger: '2.0' info: version: 0.0.0 title: Simple API paths: /foo: $ref: 'swagger/paths/foo.yml' /bar: $ref: 'swagger/paths/bar.yml' /nested: $ref: 'swagger/paths/nested.yml#/response' spec-0.21.0/fixtures/bugs/2743/not-working/swagger/000077500000000000000000000000001457312531500216575ustar00rootroot00000000000000spec-0.21.0/fixtures/bugs/2743/not-working/swagger/definitions.yml000066400000000000000000000002441457312531500247150ustar00rootroot00000000000000ErrorPayload: title: Error Payload required: - errors properties: errors: type: array items: $ref: './items.yml#/ErrorDetailsItem'spec-0.21.0/fixtures/bugs/2743/not-working/swagger/items.yml000066400000000000000000000004441457312531500235250ustar00rootroot00000000000000ErrorDetailsItem: title: Error details item description: Represents an item of the list of details of an error. required: - message - code properties: message: type: string code: type: string details: type: array items: type: stringspec-0.21.0/fixtures/bugs/2743/not-working/swagger/paths/000077500000000000000000000000001457312531500227765ustar00rootroot00000000000000spec-0.21.0/fixtures/bugs/2743/not-working/swagger/paths/bar.yml000066400000000000000000000002401457312531500242610ustar00rootroot00000000000000get: responses: 200: description: OK schema: type: array items: $ref: '../user/index.yml#/User' ## this doesn't workspec-0.21.0/fixtures/bugs/2743/not-working/swagger/paths/foo.yml000066400000000000000000000002171457312531500243040ustar00rootroot00000000000000get: responses: 200: description: OK 500: description: OK schema: $ref: '../definitions.yml#/ErrorPayload' spec-0.21.0/fixtures/bugs/2743/not-working/swagger/paths/index.yml000066400000000000000000000001301457312531500246220ustar00rootroot00000000000000/foo: $ref: ./foo.yml /bar: $ref: ./bar.yml /nested: $ref: ./nested.yml#/response spec-0.21.0/fixtures/bugs/2743/not-working/swagger/paths/nested.yml000066400000000000000000000003521457312531500250030ustar00rootroot00000000000000response: get: responses: 200: description: OK schema: $ref: '#/definitions/SameFileReference' definitions: SameFileReference: type: object properties: name: type: string spec-0.21.0/fixtures/bugs/2743/not-working/swagger/user/000077500000000000000000000000001457312531500226355ustar00rootroot00000000000000spec-0.21.0/fixtures/bugs/2743/not-working/swagger/user/index.yml000066400000000000000000000000341457312531500244640ustar00rootroot00000000000000User: $ref: './model.yml' spec-0.21.0/fixtures/bugs/2743/not-working/swagger/user/model.yml000066400000000000000000000000621457312531500244560ustar00rootroot00000000000000type: object properties: name: type: string spec-0.21.0/fixtures/bugs/2743/working/000077500000000000000000000000001457312531500174225ustar00rootroot00000000000000spec-0.21.0/fixtures/bugs/2743/working/spec.yaml000066400000000000000000000003171457312531500212410ustar00rootroot00000000000000swagger: '2.0' info: version: 0.0.0 title: Simple API paths: /foo: $ref: 'swagger/paths/foo.yml' /bar: $ref: 'swagger/paths/bar.yml' /nested: $ref: 'swagger/paths/nested.yml#/response' spec-0.21.0/fixtures/bugs/2743/working/swagger/000077500000000000000000000000001457312531500210615ustar00rootroot00000000000000spec-0.21.0/fixtures/bugs/2743/working/swagger/definitions.yml000066400000000000000000000002441457312531500241170ustar00rootroot00000000000000ErrorPayload: title: Error Payload required: - errors properties: errors: type: array items: $ref: './items.yml#/ErrorDetailsItem'spec-0.21.0/fixtures/bugs/2743/working/swagger/items.yml000066400000000000000000000004441457312531500227270ustar00rootroot00000000000000ErrorDetailsItem: title: Error details item description: Represents an item of the list of details of an error. required: - message - code properties: message: type: string code: type: string details: type: array items: type: stringspec-0.21.0/fixtures/bugs/2743/working/swagger/paths/000077500000000000000000000000001457312531500222005ustar00rootroot00000000000000spec-0.21.0/fixtures/bugs/2743/working/swagger/paths/bar.yml000066400000000000000000000002401457312531500234630ustar00rootroot00000000000000get: responses: 200: description: OK schema: type: array items: $ref: './swagger/user/index.yml#/User' ## this worksspec-0.21.0/fixtures/bugs/2743/working/swagger/paths/foo.yml000066400000000000000000000002171457312531500235060ustar00rootroot00000000000000get: responses: 200: description: OK 500: description: OK schema: $ref: '../definitions.yml#/ErrorPayload' spec-0.21.0/fixtures/bugs/2743/working/swagger/paths/index.yml000066400000000000000000000001301457312531500240240ustar00rootroot00000000000000/foo: $ref: ./foo.yml /bar: $ref: ./bar.yml /nested: $ref: ./nested.yml#/response spec-0.21.0/fixtures/bugs/2743/working/swagger/paths/nested.yml000066400000000000000000000003521457312531500242050ustar00rootroot00000000000000response: get: responses: 200: description: OK schema: $ref: '#/definitions/SameFileReference' definitions: SameFileReference: type: object properties: name: type: string spec-0.21.0/fixtures/bugs/2743/working/swagger/user/000077500000000000000000000000001457312531500220375ustar00rootroot00000000000000spec-0.21.0/fixtures/bugs/2743/working/swagger/user/index.yml000066400000000000000000000000341457312531500236660ustar00rootroot00000000000000User: $ref: './model.yml' spec-0.21.0/fixtures/bugs/2743/working/swagger/user/model.yml000066400000000000000000000000621457312531500236600ustar00rootroot00000000000000type: object properties: name: type: string spec-0.21.0/fixtures/bugs/69/000077500000000000000000000000001457312531500156015ustar00rootroot00000000000000spec-0.21.0/fixtures/bugs/69/dapperbox.json000066400000000000000000035754441457312531500205060ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "version": "V2", "title": "Payroll" }, "host": "localhost:9333", "schemes": [ "http" ], "paths": { "/api/v2/business/{businessId}/aba": { "get": { "tags": [ "AbaSettings" ], "summary": "List ABA Settings", "description": "Retrieves all the ABA settings associated with the business.\n\nThis operation supports OData queries.", "operationId": "ABA_GetAbaDetails", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/BusinessAbaModel" }, "xml": { "name": "BusinessAbaModel", "wrapped": true }, "title": "IEnumerable" } } } }, "post": { "tags": [ "AbaSettings" ], "summary": "Create ABA Settings Record", "description": "Creates a new ABA settings record for the business.", "operationId": "ABA_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "abaDetails", "in": "body", "required": true, "schema": { "$ref": "#/definitions/BusinessAbaModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/aba/{id}": { "get": { "tags": [ "AbaSettings" ], "summary": "Get ABA Settings Record by ID", "description": "Gets the details for the ABA settings record with the specified ID.", "operationId": "ABA_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/BusinessAbaModel" } } } }, "put": { "tags": [ "AbaSettings" ], "summary": "Update ABA Settings Record", "description": "Updates the ABA settings record with the specified ID.", "operationId": "ABA_Put", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "abaDetails", "in": "body", "required": true, "schema": { "$ref": "#/definitions/BusinessAbaModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "AbaSettings" ], "summary": "Delete ABA Settings Record", "description": "Deletes the ABA settings record with the specified ID.", "operationId": "ABA_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/oauth/token": { "post": { "tags": [ "Authentication" ], "summary": "OAuth Token", "description": "See the guide on OAuth2 authentication for more details.", "operationId": "Token_Post", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "request", "in": "query", "required": true, "type": "object", "title": "HttpRequestMessage" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/singlesignon": { "post": { "tags": [ "Authentication" ], "summary": "Single Sign On", "description": "can either be called via /api/v2/singlesignon or /api/v2/business/singlesignon (which goes to the business controller)", "operationId": "SingleSignOn_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/SingleSignOnRequestModel" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/SingleSignOnResponseModel" } } } } }, "/api/v2/business/{businessId}/singlesignon": { "post": { "tags": [ "Authentication" ], "summary": "Single Sign On", "description": "can either be called via /api/v2/singlesignon or /api/v2/business/singlesignon (which goes to the business controller)", "operationId": "SingleSignOn_PostApiV2BusinessByBusinessIdSinglesignon", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/SingleSignOnRequestModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/SingleSignOnResponseModel" } } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/singlesignon": { "post": { "tags": [ "Authentication" ], "summary": "Single Sign On", "description": "can either be called via /api/v2/singlesignon or /api/v2/business/singlesignon (which goes to the business controller)", "operationId": "SingleSignOn_PostApiV2BusinessByBusinessIdEmployeeByEmployeeIdSinglesignon", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/SingleSignOnRequestModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/SingleSignOnResponseModel" } } } } }, "/api/v2/business/{businessId}/roundingrules": { "get": { "tags": [ "Business" ], "summary": "Get Rounding Rules", "description": "Gets the rounding rules for the business.", "operationId": "RoundingRules_GetRoundingRules", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/TimesheetRoundingRulesModel" } } } }, "post": { "tags": [ "Business" ], "summary": "Set Rounding Rules", "description": "Sets the rounding rules for the business.", "operationId": "RoundingRules_SetRoundingRules", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "roundingRules", "in": "body", "required": true, "schema": { "$ref": "#/definitions/TimesheetRoundingRulesModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/ato": { "get": { "tags": [ "Business" ], "summary": "Get ATO Details", "description": "Gets the ATO details for the business.", "operationId": "ATO_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/BusinessAtoSupplierModel" } } } }, "post": { "tags": [ "Business" ], "summary": "Set ATO Details", "description": "Sets the ATO details for the business.", "operationId": "ATO_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/BusinessAtoSupplierModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/entitlements": { "get": { "tags": [ "Business" ], "summary": "List Entitlements", "description": "Lists all of the entitlements for the business.", "operationId": "Entitlements_GetEntitlements", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EntitlementsModel" } } } } }, "/api/v2/business/{businessId}/document": { "get": { "tags": [ "Business" ], "summary": "List Business Document Details", "description": "Lists the details for all of the documents in the business.", "operationId": "Document_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/DocumentModel" }, "xml": { "name": "DocumentModel", "wrapped": true }, "title": "List" } } } }, "post": { "tags": [ "Business" ], "summary": "Create Business Document", "description": "Uploads new document(s) for business. The request should be a MIME multipart file upload request.", "operationId": "Document_Post", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "visibleToAll", "in": "query", "required": false, "type": "boolean", "default": false, "title": "Boolean" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/DocumentModel" }, "xml": { "name": "DocumentModel", "wrapped": true }, "title": "List" } } } } }, "/api/v2/business/{businessId}/document/{id}": { "get": { "tags": [ "Business" ], "summary": "Get Business Document Details", "description": "Gets the details for the specified business document.", "operationId": "Document_GetApiV2BusinessByBusinessIdDocumentById", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/DocumentModel" } } } }, "put": { "tags": [ "Business" ], "summary": "Update Business Document Permissions", "description": "Updates permissions for the business document with the specified ID.", "operationId": "Document_Put", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/UpdateDocumentPermissionsModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/DocumentModel" } } } }, "delete": { "tags": [ "Business" ], "summary": "Delete Business Document", "description": "Deletes the business document with the specified ID.", "operationId": "Document_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/document/{id}/content": { "get": { "tags": [ "Business" ], "summary": "Get Business Document Content", "description": "Gets the file content for the business document with the specified ID.", "operationId": "Document_Content", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/DocumentFile" } } } } }, "/api/v2/business": { "get": { "tags": [ "Business" ], "summary": "List Businesses", "description": "Lists all the businesses associated with the current user.\n\nThis operation supports OData queries.", "operationId": "Business_GetBusinesses", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/BusinessModel" }, "xml": { "name": "BusinessModel", "wrapped": true }, "title": "IEnumerable" } } } }, "post": { "tags": [ "Business" ], "summary": "Create New Business", "description": "Creates a new business.", "operationId": "Business_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/BusinessModel" } }, { "name": "setupDefaultData", "in": "query", "required": false, "type": "boolean", "default": true, "title": "Boolean" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}": { "get": { "tags": [ "Business" ], "summary": "Get Business Details", "description": "Retrieves the details of the business with the specified ID.", "operationId": "Business_GetBusiness", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/BusinessModel" } } } } }, "/api/v2/business/externalid": { "get": { "tags": [ "Business" ], "summary": "Get Business Details by External ID", "description": "Retrieves the details of the business with the specified external ID.", "operationId": "Business_GetBusinessByExternalId", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "externalId", "in": "query", "required": true, "type": "string", "title": "String" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/BusinessModel" } } } } }, "/api/v2/business/{businessId}/access": { "get": { "tags": [ "Business" ], "summary": "List All Business Access Users", "description": "Lists all of the users with access to this business, as well as the types of access they each have.\n\nThis operation supports OData queries.", "operationId": "BusinessAccess_GetAll", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/BusinessAccessModel" }, "xml": { "name": "BusinessAccessModel", "wrapped": true }, "title": "IQueryable" } } } }, "put": { "tags": [ "Business" ], "summary": "Update Business Access", "description": "Updates a user's access to this business.", "operationId": "BusinessAccess_Put", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "email", "in": "query", "required": true, "type": "string", "title": "String" }, { "name": "viewModel", "in": "body", "required": true, "schema": { "$ref": "#/definitions/AccessModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "post": { "tags": [ "Business" ], "summary": "Assign Business Access", "description": "Assigns business access to a name/email.", "operationId": "BusinessAccess_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "viewModel", "in": "body", "required": true, "schema": { "$ref": "#/definitions/CreateBusinessAccessModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "Business" ], "summary": "Revoke Business Access", "description": "Revokes a user's access to the business.", "operationId": "BusinessAccess_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "email", "in": "query", "required": true, "type": "string", "title": "String" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/access/user": { "get": { "tags": [ "Business" ], "summary": "Get User Business Access", "description": "Returns the business access assigned to the user with the specified email address.", "operationId": "BusinessAccess_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "email", "in": "query", "required": true, "type": "string", "title": "String" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/BusinessAccessModel" } } } } }, "/api/v2/business/{businessId}/deductioncategory": { "get": { "tags": [ "DeductionCategories" ], "summary": "List Deduction Categories", "description": "Lists all the deduction categories for the business.\n\nThis operation supports OData queries.", "operationId": "DeductionCategory_GetDeductionCategories", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/DeductionCategoryModel" }, "xml": { "name": "DeductionCategoryModel", "wrapped": true }, "title": "IEnumerable" } } } }, "post": { "tags": [ "DeductionCategories" ], "summary": "Create Deduction Category", "description": "Creates a deduction category for the business.", "operationId": "DeductionCategory_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "deductionCategory", "in": "body", "required": true, "schema": { "$ref": "#/definitions/DeductionCategoryModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/deductioncategory/{id}": { "get": { "tags": [ "DeductionCategories" ], "summary": "Get Deduction Category By ID", "description": "Gets the deduction category with the specified ID.", "operationId": "DeductionCategory_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/DeductionCategoryModel" } } } }, "put": { "tags": [ "DeductionCategories" ], "summary": "Update Deduction Category", "description": "Updates the deduction category with the specified ID.", "operationId": "DeductionCategory_Put", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "deductionCategory", "in": "body", "required": true, "schema": { "$ref": "#/definitions/DeductionCategoryModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "DeductionCategories" ], "summary": "Delete Deduction Category", "description": "Deletes the deduction category with the specified ID.", "operationId": "DeductionCategory_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/worktype": { "get": { "tags": [ "Employee" ], "summary": "Get Employee Work Types", "description": "Lists all the work types for the employee.\n\nThis operation supports OData queries.", "operationId": "EmployeeWorkType_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/WorkTypeModel" }, "xml": { "name": "WorkTypeModel", "wrapped": true }, "title": "IQueryable" } } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/image": { "get": { "tags": [ "Employee" ], "summary": "Get Employee Profile Image", "description": "Returns the file content for the employee's current profile image.", "operationId": "EmployeeProfileImage_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "post": { "tags": [ "Employee" ], "summary": "Set Employee Profile Image", "description": "Uploads a new employee profile image. The request should be a MIME multipart file upload request.", "operationId": "EmployeeProfileImage_Post", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/ProfileImageMetadata" } } } }, "delete": { "tags": [ "Employee" ], "summary": "Delete Employee Profile Image", "description": "Delete's the employee's profile image.", "operationId": "EmployeeProfileImage_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employee/details": { "get": { "tags": [ "Employee" ], "summary": "List basic details for employees", "description": "This endpoint returns a list of employees. The details are a subset of the 'unstructured' employee endpoint.\r\nThis data can be filtered much more efficiently though so if you only need the basic employee details, this endpoint is preferred.\n\nThis operation supports OData queries.", "operationId": "EmployeeDetails_GetEmployees", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EmployeeDetailsModel" } } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/details": { "get": { "tags": [ "Employee" ], "summary": "Get Employee basic details by ID", "description": "returns the basic employee details for the specified employee", "operationId": "EmployeeDetails_GetEmployee", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EmployeeDetailsModel" } } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/shiftcondition": { "get": { "tags": [ "Employee" ], "summary": "Get Employee Shift Conditions", "description": "Lists all the shift conditions for this employee.\n\nThis operation supports OData queries.", "operationId": "EmployeeShiftCondition_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/WorkTypeModel" }, "xml": { "name": "WorkTypeModel", "wrapped": true }, "title": "IQueryable" } } } } }, "/api/v2/business/{businessId}/employee/unstructured": { "get": { "tags": [ "Employee" ], "summary": "List Employees", "description": "This endpoint returns the unstructured employee details for all matching employees.\r\n

\r\nSee also: List basic details for employees (which is much more efficient if that is all the information that is required)\r\n

\n\nThis operation supports OData queries.", "operationId": "Employee_GetEmployees", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "filter.payScheduleId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" }, { "name": "filter.locationId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/UnstructuredEmployeeModel" } } } }, "post": { "tags": [ "Employee" ], "summary": "Create or Update Employee", "description": "If the employee with the specified ID already exists, update it. Otherwise, create a new employee.", "operationId": "Employee_PostEmployee", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/UnstructuredEmployeeModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employee/unstructured/{employeeId}": { "get": { "tags": [ "Employee" ], "summary": "Get Employee By ID", "description": "Gets the employee with the specified ID.", "operationId": "Employee_GetEmployeeById", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/UnstructuredEmployeeModel" } } } }, "put": { "tags": [ "Employee" ], "summary": "Update Employee", "description": "Updates the employee with the specified ID.", "operationId": "Employee_PutEmployee", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/UnstructuredEmployeeModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employee/unstructured/externalid": { "get": { "tags": [ "Employee" ], "summary": "Get Employee By External ID", "description": "Gets the employee with the specified external ID.", "operationId": "Employee_GetEmployeeByExternalId", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "externalId", "in": "query", "required": true, "type": "string", "title": "String" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/UnstructuredEmployeeModel" } } } } }, "/api/v2/business/{businessId}/employee/unstructured/externalreferenceid": { "get": { "tags": [ "Employee" ], "summary": "Get Employee By External Reference ID", "description": "Gets the employee with the specified external reference ID.", "operationId": "Employee_GetByExternalReferenceId", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "externalReferenceId", "in": "query", "required": true, "type": "string", "title": "String" }, { "name": "source", "in": "query", "required": true, "type": "string", "enum": [ "None", "Saasu", "Xero", "MYOB", "Deputy", "EmployeeTimePunch", "ClickSuper", "IntegratedTimesheets", "FileImport", "FileExport", "QuickBooks", "Harmony", "AwardStore", "Attache", "IntegratedRostering", "ReckonAccounts", "API", "MicroPower", "RosterLive", "NetSuite", "Kounta", "TimeAndAttendanceKiosk", "DetailedFileExport", "JonasPremier", "WageEasy", "Maestrano", "WorkZone", "EmployeePortal", "RosterTemplate", "Onboarding", "Admin", "WorkZoneClockOnOff" ], "title": "ExternalService" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/UnstructuredEmployeeModel" } } } } }, "/api/v2/business/{businessId}/employee/{employeeId}": { "delete": { "tags": [ "Employee" ], "summary": "Delete Employee", "description": "Deletes the employee with the specified ID.", "operationId": "Employee_DeleteEmployee", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/synctoqbo": { "post": { "tags": [ "Employee" ], "summary": "Sync Employee to QBO", "description": "Syncs an employee record to QBO.", "operationId": "Employee_SyncEmployeeToQBO", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employee/activate/{employeeId}": { "post": { "tags": [ "Employee" ], "summary": "Activate Employee", "description": "Activates the employee with the specified ID.", "operationId": "EmployeeActivate_PostActivate", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/leavebalances": { "get": { "tags": [ "Employee" ], "summary": "Get Leave Balances", "description": "Gets leave balances for this employee.", "operationId": "LeaveBalances_GetLeaveBalances", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "asAtDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "Nullable" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/LeaveBalanceModel" }, "xml": { "name": "LeaveBalanceModel", "wrapped": true }, "title": "IList" } } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/notes": { "get": { "tags": [ "Employee" ], "summary": "Get Employee Notes", "description": "Gets the notes for the specified employee.", "operationId": "Notes_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/EmployeeNoteModel" }, "xml": { "name": "EmployeeNoteModel", "wrapped": true }, "title": "IList" } } } }, "post": { "tags": [ "Employee" ], "summary": "Set Employee Notes", "description": "Sets the notes for the specified employee.", "operationId": "Notes_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/CreateEmployeeNoteModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/payrate": { "get": { "tags": [ "Employee" ], "summary": "Get Pay Rates", "description": "Gets the pay rates for this employee.", "operationId": "EmployeePayRates_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/EmployeePayRateModel" }, "xml": { "name": "EmployeePayRateModel", "wrapped": true }, "title": "IList" } } } } }, "/api/v2/business/{businessId}/employee/grantkioskaccess/{employeeId}": { "post": { "tags": [ "Employee" ], "summary": "Grant Kiosk Access", "description": "Grants kiosk access to the specified employee.", "operationId": "EmployeeKioskAccess_PostGrantKioskAccess", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employee/revokekioskaccess/{employeeId}": { "post": { "tags": [ "Employee" ], "summary": "Revoke Kiosk Access", "description": "Revokes kiosk access from the specified employee.", "operationId": "EmployeeKioskAccess_PostRevokeKioskAccess", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/OpeningBalances": { "get": { "tags": [ "Employee" ], "summary": "Get Opening Balances", "description": "Gets the opening balances for this employee.", "operationId": "OpeningBalances_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/OpeningBalancesEditModel" } } } }, "post": { "tags": [ "Employee" ], "summary": "Set Opening Balances", "description": "Sets the opening balances for this employee.", "operationId": "OpeningBalances_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/OpeningBalancesEditModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/access": { "get": { "tags": [ "EmployeeAccess" ], "summary": "Get Users With Access to Employee", "description": "Gets a list of all users with access to this employee.\n\nThis operation supports OData queries.", "operationId": "EmployeeAccess_GetAll", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/EmployeeAccessModel" }, "xml": { "name": "EmployeeAccessModel", "wrapped": true }, "title": "IQueryable" } } } }, "put": { "tags": [ "EmployeeAccess" ], "summary": "Update Employee Access Record", "description": "Updates the employee access record for the specified user.", "operationId": "EmployeeAccess_UpdateUserAccess", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "email", "in": "query", "required": true, "type": "string", "title": "String" }, { "name": "viewModel", "in": "body", "required": true, "schema": { "$ref": "#/definitions/AccessModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "post": { "tags": [ "EmployeeAccess" ], "summary": "Grant Employee Access", "description": "Grants a user access to the employee.", "operationId": "EmployeeAccess_AddEmployeeAccess", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "viewModel", "in": "body", "required": true, "schema": { "$ref": "#/definitions/CreateEmployeeAccessModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "EmployeeAccess" ], "summary": "Revoke Employee Access", "description": "Revoke a user's access to the employee.", "operationId": "EmployeeAccess_DeleteEmployeeAccess", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "email", "in": "query", "required": true, "type": "string", "title": "String" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/access/email": { "get": { "tags": [ "EmployeeAccess" ], "summary": "Get Employee Access for User", "description": "Gets a list of all employees to which the user (specified by email) has access.", "operationId": "EmployeeAccess_ListEmployeeAccess", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "email", "in": "query", "required": true, "type": "string", "title": "String" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EmployeeAccessModel" } } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/bankaccount": { "get": { "tags": [ "EmployeeBankAccount" ], "summary": "List Bank Accounts", "description": "Lists all of the bank accounts for this employee.", "operationId": "EmployeeBankAccount_List", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/BankAccountModel" }, "xml": { "name": "BankAccountModel", "wrapped": true }, "title": "IEnumerable" } } } }, "post": { "tags": [ "EmployeeBankAccount" ], "summary": "Create Bank Account", "description": "Creates a new bank account for the employee.", "operationId": "EmployeeBankAccount_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/BankAccountModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/SaveBankAccountResponseModel" } } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/bankaccount/{bankAccountId}": { "get": { "tags": [ "EmployeeBankAccount" ], "summary": "Get Bank Account by ID", "description": "Gets the bank account for this employee with the specified ID.", "operationId": "EmployeeBankAccount_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "bankAccountId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/BankAccountModel" } } } }, "delete": { "tags": [ "EmployeeBankAccount" ], "summary": "Delete Bank Account", "description": "Deletes the employee's bank account with the specified ID.", "operationId": "EmployeeBankAccount_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "bankAccountId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/SaveBankAccountResponseModel" } } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/bankaccount/{id}": { "put": { "tags": [ "EmployeeBankAccount" ], "summary": "Update Bank Account", "description": "Updates the employee's bank account with the specified ID.", "operationId": "EmployeeBankAccount_Put", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/BankAccountModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/SaveBankAccountResponseModel" } } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/document/{documentId}/timesheet/{id}": { "post": { "tags": [ "EmployeeDocument" ], "summary": "Link Employee Document to Timesheet", "description": "Takes the specified employee document and adds it as an attachment to the timesheet with the specified ID.", "operationId": "EmployeeDocumentTimesheetLink_CreateLink", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "documentId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "EmployeeDocument" ], "summary": "Unlink Employee Document from Timesheet", "description": "If the specified employee document is attached to the specified timesheet, unattach it.", "operationId": "EmployeeDocumentTimesheetLink_RemoveLink", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "documentId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/document": { "get": { "tags": [ "EmployeeDocument" ], "summary": "List Employee Documents", "description": "Lists all the documents for this employee.", "operationId": "EmployeeDocument_List", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/EmployeeDocumentModel" }, "xml": { "name": "EmployeeDocumentModel", "wrapped": true }, "title": "List" } } } }, "put": { "tags": [ "EmployeeDocument" ], "summary": "Update Employee Document Permissions", "description": "Updates permissions for the employee document with the specified ID.", "operationId": "EmployeeDocument_UpdatePermissions", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/UpdateEmployeeDocumentPermissionsModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EmployeeDocumentModel" } } } }, "post": { "tags": [ "EmployeeDocument" ], "summary": "Create Employee Document", "description": "Uploads new document(s) for this employee. The request should be a MIME multipart file upload request.", "operationId": "EmployeeDocument_Upload", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "visible", "in": "query", "required": false, "type": "boolean", "default": false, "title": "Boolean" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/EmployeeDocumentModel" }, "xml": { "name": "EmployeeDocumentModel", "wrapped": true }, "title": "List" } } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/document/{id}": { "get": { "tags": [ "EmployeeDocument" ], "summary": "Get Employee Document Details", "description": "Gets the details for the employee document with the specified ID.", "operationId": "EmployeeDocument_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EmployeeDocumentModel" } } } }, "delete": { "tags": [ "EmployeeDocument" ], "summary": "Delete Employee Document", "description": "Deletes the employee document with the specified ID.", "operationId": "EmployeeDocument_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/document/{id}/content": { "get": { "tags": [ "EmployeeDocument" ], "summary": "Get Employee Document Content", "description": "Get the file content for the employee document with the specified ID.", "operationId": "EmployeeDocument_Content", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/DocumentFile" } } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/document/{documentId}/leave/{id}": { "post": { "tags": [ "EmployeeDocument" ], "summary": "Link Employee Document to Leave Request", "description": "Takes the specified employee document and adds it as an attachment to the leave request with the specified ID.", "operationId": "EmployeeDocumentLeaveLink_CreateLink", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "documentId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "EmployeeDocument" ], "summary": "Unlink Employee Document from Leave Request", "description": "If the specified employee document is attached to the specified leave request, unattach it.", "operationId": "EmployeeDocumentLeaveLink_RemoveLink", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "documentId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employeeexpensecategory": { "get": { "tags": [ "EmployeeExpenseCategories" ], "summary": "List Employee Expense Categories", "description": "Lists all the employee expense categories for the business.\n\nThis operation supports OData queries.", "operationId": "EmployeeExpenseCategory_GetEmployeeExpenseCategories", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/EmployeeExpenseCategoryModel" }, "xml": { "name": "EmployeeExpenseCategoryModel", "wrapped": true }, "title": "IEnumerable" } } } }, "post": { "tags": [ "EmployeeExpenseCategories" ], "summary": "Create Employee Expense Category", "description": "Creates an employee expense category for the business.", "operationId": "EmployeeExpenseCategory_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeExpenseCategory", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EmployeeExpenseCategoryModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employeeexpensecategory/{id}": { "get": { "tags": [ "EmployeeExpenseCategories" ], "summary": "Get Employee Expense Category by ID", "description": "Gets the employee expense category with the specified ID.", "operationId": "EmployeeExpenseCategory_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EmployeeExpenseCategoryModel" } } } }, "put": { "tags": [ "EmployeeExpenseCategories" ], "summary": "Update Employee Expense Category", "description": "Updates the employee expense category with the specified ID.", "operationId": "EmployeeExpenseCategory_Put", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeExpenseCategory", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EmployeeExpenseCategoryModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "EmployeeExpenseCategories" ], "summary": "Delete Employee Expense Category", "description": "Deletes the employee expense category with the specified ID.", "operationId": "EmployeeExpenseCategory_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employeeexpensecategory/taxcodes": { "get": { "tags": [ "EmployeeExpenseCategories" ], "summary": "Get Tax Codes", "description": "Gets a list of the business' tax codes.", "operationId": "EmployeeExpenseCategory_TaxCodes", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/JournalServiceTaxCode" }, "xml": { "name": "JournalServiceTaxCode", "wrapped": true }, "title": "IList" } } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/expenserequest": { "get": { "tags": [ "EmployeeExpenseRequest" ], "summary": "List Expense Requests", "description": "Lists all of the expense requests for this employee.\n\nThis operation supports OData queries.", "operationId": "ExpenseRequest_GetExpenseRequests", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/ExpenseRequestResponseModel" }, "xml": { "name": "ExpenseRequestResponseModel", "wrapped": true }, "title": "IEnumerable" } } } }, "post": { "tags": [ "EmployeeExpenseRequest" ], "summary": "Create Expense Request", "description": "Creates a new expense request for this employee.", "operationId": "ExpenseRequest_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ExpenseRequestEditModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/expenserequest/{expenseRequestId}": { "get": { "tags": [ "EmployeeExpenseRequest" ], "summary": "Get Expense Request by ID", "description": "Gets the expense request with the specified ID.", "operationId": "ExpenseRequest_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "expenseRequestId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/ExpenseRequestResponseModel" } } } }, "put": { "tags": [ "EmployeeExpenseRequest" ], "summary": "Update Expense Request", "description": "Updates the expense request with the specified ID.", "operationId": "ExpenseRequest_Put", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "expenseRequestId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ExpenseRequestEditModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "EmployeeExpenseRequest" ], "summary": "Delete Expense Request", "description": "Deletes the expense request with the specified ID.", "operationId": "ExpenseRequest_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "expenseRequestId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/expenserequest/{expenseRequestId}/approve": { "post": { "tags": [ "EmployeeExpenseRequest" ], "summary": "Approve Expense Request", "description": "Approves the expense request with the specified ID.", "operationId": "ExpenseRequest_Approve", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "expenseRequestId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/expenserequest/{expenseRequestId}/decline": { "post": { "tags": [ "EmployeeExpenseRequest" ], "summary": "Decline Expense Request", "description": "Declines the expense request with the specified ID.", "operationId": "ExpenseRequest_Decline", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "expenseRequestId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "reason", "in": "body", "required": true, "schema": { "type": "string", "title": "String" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/expenserequest/{expenseRequestId}/attachment": { "put": { "tags": [ "EmployeeExpenseRequest" ], "summary": "Upload Attachment to Expense Request", "description": "Uploads an attachment to the expense request with the specified ID. \r\nThe request should be a MIME multipart file upload request.", "operationId": "ExpenseRequest_UploadAttachment", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "expenseRequestId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "title": "IHttpActionResult" } } } } }, "/api/v2/business/{businessId}/employeegroup": { "get": { "tags": [ "EmployeeGroups" ], "summary": "List Employee Groups", "description": "Lists all the employee groups for the business.\n\nThis operation supports OData queries.", "operationId": "EmployeeGroup_GetGroups", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/EmployeeGroupModel" }, "xml": { "name": "EmployeeGroupModel", "wrapped": true }, "title": "IQueryable" } } } }, "post": { "tags": [ "EmployeeGroups" ], "summary": "Create Employee Group", "description": "Creates a new employee group for the business.", "operationId": "EmployeeGroup_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeGroup", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EmployeeGroupModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employeegroup/{id}": { "get": { "tags": [ "EmployeeGroups" ], "summary": "Get Employee Group by ID", "description": "Gets the employee group with the specified ID.", "operationId": "EmployeeGroup_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/DetailedEmployeeGroupModel" } } } }, "put": { "tags": [ "EmployeeGroups" ], "summary": "Update Employee Group", "description": "Updates the specified employee group.", "operationId": "EmployeeGroup_Put", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeGroup", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EmployeeGroupModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "EmployeeGroups" ], "summary": "Delete Employee Group", "description": "Deletes the employee group with the specified ID.", "operationId": "EmployeeGroup_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/qualification/{qualificationId}/document": { "get": { "tags": [ "EmployeeQualifications" ], "summary": "List Documents for Employee Qualification", "description": "Lists all the documents associated with a specific employee qualification.", "operationId": "EmployeeQualificationDocument_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "qualificationId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/EmployeeQualificationDocumentModel" }, "xml": { "name": "EmployeeQualificationDocumentModel", "wrapped": true }, "title": "List" } } } }, "post": { "tags": [ "EmployeeQualifications" ], "summary": "Create Employee Qualification Document", "description": "Uploads an employee qualification document. Note: the request should be a MIME multipart file upload request.", "operationId": "EmployeeQualificationDocument_Post", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "qualificationId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "visible", "in": "query", "required": false, "type": "boolean", "default": false, "title": "Boolean" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/EmployeeQualificationDocumentModel" }, "xml": { "name": "EmployeeQualificationDocumentModel", "wrapped": true }, "title": "List" } } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/qualification/{qualificationId}/document/{id}": { "get": { "tags": [ "EmployeeQualifications" ], "summary": "Get Qualification Document by ID", "description": "Gets the details for a qualification document by ID.", "operationId": "EmployeeQualificationDocument_GetApiV2BusinessByBusinessIdEmployeeByEmployeeIdQualificationByQualificationIdDocumentById", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "qualificationId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EmployeeQualificationDocumentModel" } } } }, "delete": { "tags": [ "EmployeeQualifications" ], "summary": "Delete Employee Qualification Document", "description": "Deletes a specific employee qualification document.", "operationId": "EmployeeQualificationDocument_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "qualificationId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/qualification/{qualificationId}/document/{id}/content": { "get": { "tags": [ "EmployeeQualifications" ], "summary": "Get Qualification Document File", "description": "Gets the file for an employee qualification document by ID.", "operationId": "EmployeeQualificationDocument_Content", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "qualificationId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/DocumentFile" } } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/qualification": { "get": { "tags": [ "EmployeeQualifications" ], "summary": "Get Qualifications for Employee", "description": "Retrieves the qualification details for a single employee.", "operationId": "EmployeeQualification_GetQualifications", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/EmployeeQualificationModel" }, "xml": { "name": "EmployeeQualificationModel", "wrapped": true }, "title": "IQueryable" } } } }, "post": { "tags": [ "EmployeeQualifications" ], "summary": "Add/Update Employee Qualification", "description": "Adds or updates a qualification for an employee.", "operationId": "EmployeeQualification_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "qualification", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EmployeeQualificationModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "EmployeeQualifications" ], "summary": "Delete Employee Qualification", "description": "Deletes an employee qualification. Denotes that the employee is no longer qualified for the specified qualification.", "operationId": "EmployeeQualification_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "query", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/qualification/{id}": { "get": { "tags": [ "EmployeeQualifications" ], "summary": "Get Qualification Details", "description": "Gets the details for the qualification with a specific ID.", "operationId": "EmployeeQualification_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EmployeeQualificationModel" } } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/taxadjustment": { "get": { "tags": [ "EmployeeRecurringTransactions" ], "summary": "List Employee Tax Adjustments", "description": "Lists all the recurring employee tax adjustments for the employee", "operationId": "EmployeeRecurringTaxAdjustment_List", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/EmployeeRecurringTaxAdjustmentModel" }, "xml": { "name": "EmployeeRecurringTaxAdjustmentModel", "wrapped": true }, "title": "IEnumerable" } } } }, "post": { "tags": [ "EmployeeRecurringTransactions" ], "summary": "Create Employee Tax Adjustment", "description": "Creates a new recurring tax adjustment for the employee.", "operationId": "EmployeeRecurringTaxAdjustment_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EmployeeRecurringTaxAdjustmentModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EmployeeRecurringTaxAdjustmentModel" } } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/taxadjustment/{id}": { "get": { "tags": [ "EmployeeRecurringTransactions" ], "summary": "Get Employee Tax Adjustment by ID", "description": "Gets the employee's recurring tax adjustment with the specified ID.", "operationId": "EmployeeRecurringTaxAdjustment_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EmployeeRecurringTaxAdjustmentModel" } } } }, "put": { "tags": [ "EmployeeRecurringTransactions" ], "summary": "Update Employee Tax Adjustment", "description": "Updates the employee's recurring tax adjustment with the specified ID.", "operationId": "EmployeeRecurringTaxAdjustment_Put", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EmployeeRecurringTaxAdjustmentModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EmployeeRecurringTaxAdjustmentModel" } } } }, "delete": { "tags": [ "EmployeeRecurringTransactions" ], "summary": "Delete Employee Tax Adjustment", "description": "Deletes the employee recurring tax adjustment with the specified ID.", "operationId": "EmployeeRecurringTaxAdjustment_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/superadjustment": { "get": { "tags": [ "EmployeeRecurringTransactions" ], "summary": "List Employee Super Adjustments", "description": "Lists all the recurring employee super adjustments for the employee", "operationId": "EmployeeRecurringSuperAdjustment_List", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/EmployeeRecurringSuperAdjustmentModel" }, "xml": { "name": "EmployeeRecurringSuperAdjustmentModel", "wrapped": true }, "title": "IEnumerable" } } } }, "post": { "tags": [ "EmployeeRecurringTransactions" ], "summary": "Create Employee Super Adjustment", "description": "Creates a new recurring super adjustment for the employee.", "operationId": "EmployeeRecurringSuperAdjustment_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EmployeeRecurringSuperAdjustmentModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EmployeeRecurringSuperAdjustmentModel" } } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/superadjustment/{id}": { "get": { "tags": [ "EmployeeRecurringTransactions" ], "summary": "Get Employee Super Adjustment by ID", "description": "Gets the employee's recurring super adjustment with the specified ID.", "operationId": "EmployeeRecurringSuperAdjustment_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EmployeeRecurringSuperAdjustmentModel" } } } }, "put": { "tags": [ "EmployeeRecurringTransactions" ], "summary": "Update Employee Super Adjustment", "description": "Updates the employee's recurring super adjustment with the specified ID.", "operationId": "EmployeeRecurringSuperAdjustment_Put", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EmployeeRecurringSuperAdjustmentModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EmployeeRecurringSuperAdjustmentModel" } } } }, "delete": { "tags": [ "EmployeeRecurringTransactions" ], "summary": "Delete Employee Super Adjustment", "description": "Deletes the employee recurring super adjustment with the specified ID.", "operationId": "EmployeeRecurringSuperAdjustment_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/employerliability": { "get": { "tags": [ "EmployeeRecurringTransactions" ], "summary": "List Employer liabilities", "description": "Lists all the recurring employer liabilities for the employee", "operationId": "Employerrecurringliability_List", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/EmployerRecurringLiabilityModel" }, "xml": { "name": "EmployerRecurringLiabilityModel", "wrapped": true }, "title": "IEnumerable" } } } }, "post": { "tags": [ "EmployeeRecurringTransactions" ], "summary": "Create Employer liability", "description": "Creates a new recurring employer liability for the employee.", "operationId": "Employerrecurringliability_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EmployerRecurringLiabilityModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EmployerRecurringLiabilityModel" } } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/employerliability/{id}": { "get": { "tags": [ "EmployeeRecurringTransactions" ], "summary": "Get Employer liability by ID", "description": "Gets the employee's recurring employer liabilities with the specified ID.", "operationId": "Employerrecurringliability_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EmployerRecurringLiabilityModel" } } } }, "put": { "tags": [ "EmployeeRecurringTransactions" ], "summary": "Update Employer liability", "description": "Updates the employee's recurring employer liability with the specified ID.", "operationId": "Employerrecurringliability_Put", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EmployerRecurringLiabilityModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EmployerRecurringLiabilityModel" } } } }, "delete": { "tags": [ "EmployeeRecurringTransactions" ], "summary": "Delete Employer liability", "description": "Deletes the recurring employer liability with the specified ID.", "operationId": "Employerrecurringliability_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/deduction": { "get": { "tags": [ "EmployeeRecurringTransactions" ], "summary": "List Employee Deductions", "description": "Lists all the recurring employee deductions for the employee", "operationId": "EmployeeRecurringDeduction_List", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/EmployeeRecurringDeductionModel" }, "xml": { "name": "EmployeeRecurringDeductionModel", "wrapped": true }, "title": "IEnumerable" } } } }, "post": { "tags": [ "EmployeeRecurringTransactions" ], "summary": "Create Employee Deduction", "description": "Creates a new recurring deduction for the employee.", "operationId": "EmployeeRecurringDeduction_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EmployeeRecurringDeductionModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EmployeeRecurringDeductionModel" } } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/deduction/{id}": { "get": { "tags": [ "EmployeeRecurringTransactions" ], "summary": "Get Employee Deduction by ID", "description": "Gets the employee's recurring deduction with the specified ID.", "operationId": "EmployeeRecurringDeduction_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EmployeeRecurringDeductionModel" } } } }, "put": { "tags": [ "EmployeeRecurringTransactions" ], "summary": "Update Employee Deduction", "description": "Updates the employee's recurring deduction with the specified ID.", "operationId": "EmployeeRecurringDeduction_Put", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EmployeeRecurringDeductionModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EmployeeRecurringDeductionModel" } } } }, "delete": { "tags": [ "EmployeeRecurringTransactions" ], "summary": "Delete Employee Deduction", "description": "Deletes the employee recurring deduction with the specified ID.", "operationId": "EmployeeRecurringDeduction_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/expense": { "get": { "tags": [ "EmployeeRecurringTransactions" ], "summary": "List Employee Expenses", "description": "Lists all the recurring employee expenses for the employee", "operationId": "EmployeeRecurringExpense_List", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/EmployeeRecurringExpenseModel" }, "xml": { "name": "EmployeeRecurringExpenseModel", "wrapped": true }, "title": "IEnumerable" } } } }, "post": { "tags": [ "EmployeeRecurringTransactions" ], "summary": "Create Employee Expense", "description": "Creates a new recurring expense for the employee.", "operationId": "EmployeeRecurringExpense_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EmployeeRecurringExpenseModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EmployeeRecurringExpenseModel" } } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/expense/{id}": { "get": { "tags": [ "EmployeeRecurringTransactions" ], "summary": "Get Employee Expense by ID", "description": "Gets the employee's recurring expense with the specified ID.", "operationId": "EmployeeRecurringExpense_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EmployeeRecurringExpenseModel" } } } }, "put": { "tags": [ "EmployeeRecurringTransactions" ], "summary": "Update Employee Expense", "description": "Updates the employee's recurring expense with the specified ID.", "operationId": "EmployeeRecurringExpense_Put", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EmployeeRecurringExpenseModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EmployeeRecurringExpenseModel" } } } }, "delete": { "tags": [ "EmployeeRecurringTransactions" ], "summary": "Delete Employee Expense", "description": "Deletes the employee recurring expense with the specified ID.", "operationId": "EmployeeRecurringExpense_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/superfund": { "get": { "tags": [ "EmployeeSuperFund" ], "summary": "List Super Funds", "description": "Lists all of the super funds for this employee.", "operationId": "EmployeeSuperFund_List", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/SuperFundModel" }, "xml": { "name": "SuperFundModel", "wrapped": true }, "title": "IEnumerable" } } } }, "post": { "tags": [ "EmployeeSuperFund" ], "summary": "Create Super Fund", "description": "Creates a new super fund for the employee.", "operationId": "EmployeeSuperFund_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/SaveSuperFundModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/SaveSuperFundResponseModel" } } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/superfund/{superFundId}": { "get": { "tags": [ "EmployeeSuperFund" ], "summary": "Get Super Fund by ID", "description": "Gets the super fund for this employee with the specified ID.", "operationId": "EmployeeSuperFund_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "superFundId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/SuperFundModel" } } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/superfund/{id}": { "put": { "tags": [ "EmployeeSuperFund" ], "summary": "Update Super Fund", "description": "Updates the employee's super fund with the specified ID.", "operationId": "EmployeeSuperFund_Put", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/SaveSuperFundModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/SaveSuperFundResponseModel" } } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/superfund/{superfundId}": { "delete": { "tags": [ "EmployeeSuperFund" ], "summary": "Delete Super Fund", "description": "Deletes the employee's super fund with the specified ID.", "operationId": "EmployeeSuperFund_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "superfundId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/SaveSuperFundResponseModel" } } } } }, "/api/v2/business/{businessId}/employerliabilitycategory": { "get": { "tags": [ "EmployerLiabilityCategories" ], "summary": "List Employer Liability Categories", "description": "Lists all the employer liability categories for this business.\n\nThis operation supports OData queries.", "operationId": "EmployerLiabilityCategory_GetEmployerLiabilityCategories", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/EmployerLiabilityCategoryModel" }, "xml": { "name": "EmployerLiabilityCategoryModel", "wrapped": true }, "title": "IEnumerable" } } } }, "post": { "tags": [ "EmployerLiabilityCategories" ], "summary": "Create Employer Liability Category", "description": "Creates an employer liability category for the business.", "operationId": "EmployerLiabilityCategory_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employerLiabilityCategory", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EmployerLiabilityCategoryModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employerliabilitycategory/{id}": { "get": { "tags": [ "EmployerLiabilityCategories" ], "summary": "Get Employer Liability Category", "description": "Gets the employer liability category with the specified ID.", "operationId": "EmployerLiabilityCategory_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EmployerLiabilityCategoryModel" } } } }, "put": { "tags": [ "EmployerLiabilityCategories" ], "summary": "Update Employer Liability Category", "description": "Updates the employer liability category with the specified ID.", "operationId": "EmployerLiabilityCategory_Put", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employerLiabilityCategory", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EmployerLiabilityCategoryModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "EmployerLiabilityCategories" ], "summary": "Delete Employer Liability Category", "description": "Deletes the employer liability category with the specified ID.", "operationId": "EmployerLiabilityCategory_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employingentity": { "get": { "tags": [ "EmployingEntities" ], "summary": "List Employing Entities", "description": "Lists all the employing entities for the business.\n\nThis operation supports OData queries.", "operationId": "EmployingEntity_GetEmployingEntities", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/EmployingEntityModel" }, "xml": { "name": "EmployingEntityModel", "wrapped": true }, "title": "IEnumerable" } } } }, "post": { "tags": [ "EmployingEntities" ], "summary": "Create Employing Entity", "description": "Creates a new employing entity for the business.", "operationId": "EmployingEntity_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employingEntity", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EmployingEntityModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employingentity/{id}": { "get": { "tags": [ "EmployingEntities" ], "summary": "Get Employing Entity By ID", "description": "Gets the employing entity with the specified ID.", "operationId": "EmployingEntity_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EmployingEntityModel" } } } }, "put": { "tags": [ "EmployingEntities" ], "summary": "Update Employing Entity", "description": "Updates the employing entity with the specified ID.", "operationId": "EmployingEntity_Put", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employingEntity", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EmployingEntityModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "EmployingEntities" ], "summary": "Delete Employing Entity", "description": "Deletes the employing entity with the specified ID.", "operationId": "EmployingEntity_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employmentagreement": { "get": { "tags": [ "EmploymentAgreement" ], "summary": "List Employment Agreements", "description": "Lists all of the employment agreements for the business.\n\nThis operation supports OData queries.", "operationId": "EmploymentAgreement_GetAll", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/BasicEmploymentAgreementModel" }, "xml": { "name": "BasicEmploymentAgreementModel", "wrapped": true }, "title": "IQueryable" } } } } }, "/api/v2/business/{businessId}/employmentagreement/{id}": { "get": { "tags": [ "EmploymentAgreement" ], "summary": "Get Employment Agreement by ID", "description": "Gets the employment agreement with the specified ID.", "operationId": "EmploymentAgreement_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EmploymentAgreementModel" } } } } }, "/api/v2/business/{businessId}/employmentagreement/{id}/shiftperiods": { "post": { "tags": [ "EmploymentAgreement" ], "summary": "Get Shift Periods", "description": "Gets all the shift periods for the employment agreement with the specified ID.", "operationId": "EmploymentAgreement_ShiftPeriods", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/GetShiftPeriodsModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/ShiftPeriodModel" }, "xml": { "name": "ShiftPeriodModel", "wrapped": true }, "title": "IList" } } } } }, "/api/v2/business/{businessId}/employmentagreement/{id}/shiftcosting": { "post": { "tags": [ "EmploymentAgreement" ], "summary": "Evaluate Shift Costings", "description": "Evaluates shift costings for the employment agreement with the specified ID.", "operationId": "EmploymentAgreement_Evaluate", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ShiftCostingsRequestModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/ShiftCostingsResponseModel" } } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/timesheet/shiftperiods": { "post": { "tags": [ "EmploymentAgreement" ], "summary": "Get Shift Periods for Employee", "description": "Gets the shift periods for the specified employee.", "operationId": "EmploymentAgreement_EmployeeShiftPeriods", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/GetShiftPeriodsModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/ShiftPeriodModel" }, "xml": { "name": "ShiftPeriodModel", "wrapped": true }, "title": "IList" } } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/timesheet/shiftcosting": { "post": { "tags": [ "EmploymentAgreement" ], "summary": "Get Shift Costings for Employee", "description": "Gets the shift costings for the specified employee.", "operationId": "EmploymentAgreement_EvaluateEmployee", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ShiftCostingsRequestModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/ShiftCostingsResponseModel" } } } } }, "/api/v2/ess/{employeeId}/leave": { "get": { "tags": [ "Ess" ], "summary": "List Leave Requests", "description": "Lists all leave requests for this employee, with optional filters", "operationId": "EssLeave_LeaveRequests", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "string" }, { "name": "filter.showOtherEmployees", "in": "query", "required": false, "type": "boolean", "title": "Boolean" }, { "name": "filter.fromDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "Nullable" }, { "name": "filter.toDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "Nullable" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/EssLeaveRequestModel" }, "xml": { "name": "EssLeaveRequestModel", "wrapped": true }, "title": "List" } } } }, "post": { "tags": [ "Ess" ], "summary": "Create Leave Request", "description": "Creates a new leave request for the employee.", "operationId": "EssLeave_ApplyForLeave", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "leaveApplication", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EssLeaveApplicationModel" } }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/{employeeId}/leave/{leaveRequestId}": { "get": { "tags": [ "Ess" ], "summary": "Get Leave Request by ID", "description": "Gets the details for a leave request with the specified ID.", "operationId": "EssLeave_LeaveRequest", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "leaveRequestId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EssLeaveRequestModel" } } } }, "post": { "tags": [ "Ess" ], "summary": "Update Leave Request", "description": "Updates the leave request with the specified ID.", "operationId": "EssLeave_EditLeave", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "leaveRequestId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "leaveApplication", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EssLeaveApplicationModel" } }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "Ess" ], "summary": "Delete Leave Request", "description": "Deletes the leave request with the specified ID.", "operationId": "EssLeave_Cancel", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "leaveRequestId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/{employeeId}/leave/{leaveRequestId}/attachment": { "put": { "tags": [ "Ess" ], "summary": "Upload Attachment to Leave Request", "description": "Uploads a file as a new employee document, and attaches it to the leave request with the specified ID. \r\nThe request should be a MIME multipart file upload request.", "operationId": "EssLeave_Upload", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "leaveRequestId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "title": "IHttpActionResult" } } } }, "delete": { "tags": [ "Ess" ], "summary": "Delete Attachment from Leave Request", "description": "Deletes the attachment on the leave request with the specified ID.", "operationId": "EssLeave_DeleteAttachment", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "leaveRequestId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/{employeeId}/leave/balances": { "get": { "tags": [ "Ess" ], "summary": "Get Leave Balances", "description": "Gets the leave balances for the employee.", "operationId": "EssLeave_Balances", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "asAtDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "Nullable" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/LeaveBalanceModel" }, "xml": { "name": "LeaveBalanceModel", "wrapped": true }, "title": "IList" } } } } }, "/api/v2/ess/{employeeId}/leave/leavecategories": { "get": { "tags": [ "Ess" ], "summary": "Get Leave Categories", "description": "Gets the available leave categories for the employee.", "operationId": "EssLeave_LeaveCategories", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/EssLeaveCategoryModel" }, "xml": { "name": "EssLeaveCategoryModel", "wrapped": true }, "title": "IList" } } } } }, "/api/v2/ess/{employeeId}/leave/estimate": { "get": { "tags": [ "Ess" ], "summary": "Estimate Leave Hours", "description": "Estimates the number of hours of leave required based on date and leave category.", "operationId": "EssLeave_Estimate", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "string" }, { "name": "filter.leaveCategoryId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "filter.fromDate", "in": "query", "required": true, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "filter.toDate", "in": "query", "required": true, "type": "string", "format": "date-time", "title": "DateTime" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EssLeaveEstimate" } } } } }, "/api/v2/ess/{employeeId}/profileimage": { "get": { "tags": [ "Ess" ], "summary": "Get Employee Profile Image", "description": "Returns the file content for the employee's current profile image.", "operationId": "EssProfileImage_GetImage", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "post": { "tags": [ "Ess" ], "summary": "Set Employee Profile Image", "description": "Uploads a new employee profile image. The request should be a MIME multipart file upload request.", "operationId": "EssProfileImage_Post", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/ProfileImageMetadata" } } } }, "delete": { "tags": [ "Ess" ], "summary": "Delete Employee Profile Image", "description": "Delete's the employee's profile image.", "operationId": "EssProfileImage_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/{employeeId}/details": { "get": { "tags": [ "Ess" ], "summary": "Get Details", "description": "Gets ESS details for the specified employee.", "operationId": "EssEmployee_GetDetails", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EssEmployeeDetailsModel" } } } }, "post": { "tags": [ "Ess" ], "summary": "Save Details", "description": "Saves any employee details that the employee is allowed to set.", "operationId": "EssEmployee_SaveDetails", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EmployeePartialEditModel" } }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/{employeeId}/emergencycontacts": { "get": { "tags": [ "Ess" ], "summary": "Get Emergency Contacts", "description": "Gets emergency contacts for the specified employee.", "operationId": "EssEmployee_GetEmergencyContacts", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EmployeeEmergencyContactsEditModel" } } } }, "post": { "tags": [ "Ess" ], "summary": "Save Emergency Contacts", "description": "Saves the employee's emergency contact details.", "operationId": "EssEmployee_SaveEmergencyContacts", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EmployeeEmergencyContactsEditModel" } }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/{employeeId}/security/features": { "get": { "tags": [ "Ess" ], "summary": "Get Enabled Features", "description": "Gets details as to which ESS features are enabled for the business.", "operationId": "EssEmployee_Features", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/FeaturesModel" } } } } }, "/api/v2/ess/{employeeId}/dashboard": { "get": { "tags": [ "Ess" ], "summary": "Get Dashboard", "description": "Gets a set of useful information that the employee may need for self service tasks.", "operationId": "EssEmployee_GetDashboard", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/DashboardModel" } } } } }, "/api/v2/ess/{employeeId}/location": { "get": { "tags": [ "Ess" ], "summary": "Get Locations", "description": "Gets all the locations for the employee.", "operationId": "EssEmployee_Locations", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/LocationModel" }, "xml": { "name": "LocationModel", "wrapped": true }, "title": "List" } } } } }, "/api/v2/ess/{employeeId}/satisfaction": { "get": { "tags": [ "Ess" ], "summary": "Get Satisfaction Survey Results", "description": "Gets satisfaction survey results for the employee", "operationId": "EssEmployee_GetSatisfactionSurveys", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "fromDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "Nullable" }, { "name": "toDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "Nullable" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/EssSatisfactionSurvey" }, "xml": { "name": "EssSatisfactionSurvey", "wrapped": true }, "title": "IList" } } } }, "post": { "tags": [ "Ess" ], "summary": "Submit Satisfaction Survey", "description": "Submit a satisfaction survey for this employee.", "operationId": "EssEmployee_SaveSatisfaction", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "survey", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EssSatisfactionSurvey" } }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/{employeeId}/timesheet": { "get": { "tags": [ "Ess" ], "summary": "List Timesheets", "description": "Lists timesheets for the employee.", "operationId": "EssTimesheet_List", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "string" }, { "name": "filter.fromDate", "in": "query", "required": true, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "filter.toDate", "in": "query", "required": true, "type": "string", "format": "date-time", "title": "DateTime" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/EssTimesheetModel" }, "xml": { "name": "EssTimesheetModel", "wrapped": true }, "title": "IList" } } } }, "post": { "tags": [ "Ess" ], "summary": "Submit or Update Timesheet", "description": "If no ID is specified, create a new timesheet for the employee. \r\nOtherwise, update the timesheet with the specified ID.", "operationId": "EssTimesheet_Save", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "timesheet", "in": "body", "required": true, "schema": { "$ref": "#/definitions/TimesheetLineViewModel" } }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/{employeeId}/timesheet/{timesheetId}": { "post": { "tags": [ "Ess" ], "summary": "Edit Timesheet", "description": "Edits the timesheet with the specified ID.", "operationId": "EssTimesheet_Edit", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "timesheetId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "timesheet", "in": "body", "required": true, "schema": { "$ref": "#/definitions/TimesheetLineViewModel" } }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "Ess" ], "summary": "Delete Timesheet", "description": "Deletes the timesheet with the specified ID.", "operationId": "EssTimesheet_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "timesheetId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/{employeeId}/lookup/title": { "get": { "tags": [ "Ess" ], "summary": "Get Business Titles", "description": "Gets all the titles for the business.", "operationId": "EssLookup_Title", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/TitleViewModel" }, "xml": { "name": "TitleViewModel", "wrapped": true }, "title": "List" } } } } }, "/api/v2/ess/{employeeId}/lookup/worktype": { "get": { "tags": [ "Ess" ], "summary": "Get Work Types", "description": "Gets all the work types for the employee.", "operationId": "EssLookup_WorkType", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/WorkTypeModel" }, "xml": { "name": "WorkTypeModel", "wrapped": true }, "title": "List" } } } } }, "/api/v2/ess/{employeeId}/lookup/shiftcondition": { "get": { "tags": [ "Ess" ], "summary": "Get Shift Conditions", "description": "Gets all the shift conditions for the employee.", "operationId": "EssLookup_ShiftCondition", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/WorkTypeModel" }, "xml": { "name": "WorkTypeModel", "wrapped": true }, "title": "List" } } } } }, "/api/v2/ess/{employeeId}/lookup/location": { "get": { "tags": [ "Ess" ], "summary": "Get Locations", "description": "Gets all the locations for the employee.", "operationId": "EssLookup_Location", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/LocationModel" }, "xml": { "name": "LocationModel", "wrapped": true }, "title": "List" } } } } }, "/api/v2/ess/devicetoken/register": { "post": { "tags": [ "Ess" ], "summary": "Register Device Token", "description": "Registers a device token.", "operationId": "EssDeviceToken_Register", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/DeviceTokenModel" } } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/devicetoken/unregister": { "post": { "tags": [ "Ess" ], "summary": "Unregister Device Token", "description": "Unregisters a device token.", "operationId": "EssDeviceToken_Unregister", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/DeviceTokenModel" } } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/{employeeId}/timeandattendance/lookupdata": { "get": { "tags": [ "Ess" ], "summary": "Get Lookup Data", "description": "Gets relevant lookup data for the employee in relation to a kiosk.", "operationId": "EssTimeAndAttendance_GetLookupData", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/TimeAndAttendanceLookupDataModel" } } } } }, "/api/v2/ess/{employeeId}/timeandattendance/clockon": { "post": { "tags": [ "Ess" ], "summary": "Clock In Employee", "description": "Clocks in an employee for a new shift.", "operationId": "EssTimeAndAttendance_ClockOn", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ClockOnModel" } } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/{employeeId}/timeandattendance/clockoff": { "post": { "tags": [ "Ess" ], "summary": "Clock Out Employee", "description": "Clocks out the employee from their existing shift. \r\nIf they are on a break, it will be ended automatically.", "operationId": "EssTimeAndAttendance_ClockOff", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ClockOffModel" } } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/{employeeId}/timeandattendance/startbreak": { "post": { "tags": [ "Ess" ], "summary": "Start Break", "description": "Starts a break for the employee who is clocked on for a shift.", "operationId": "EssTimeAndAttendance_StartBreak", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/StartBreakModel" } } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/{employeeId}/timeandattendance/endbreak": { "post": { "tags": [ "Ess" ], "summary": "End Break", "description": "Ends the employee's current break.", "operationId": "EssTimeAndAttendance_EndBreak", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EndBreakModel" } } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/{employeeId}/timeandattendance/discard": { "post": { "tags": [ "Ess" ], "summary": "Discard current shift", "description": "Discards the current shift for an employee. \r\nIf they are on a break, it will be ended automatically.", "operationId": "EssTimeAndAttendance_DiscardShift", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ClockOffModel" } } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/{employeeId}/timeandattendance/shifts": { "post": { "tags": [ "Ess" ], "summary": "Shifts", "description": "Gets shifts based on certain optional criteria.", "operationId": "EssTimeAndAttendance_Shifts", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/GetShiftsModel" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/TimeAndAttendanceShiftModel" }, "xml": { "name": "TimeAndAttendanceShiftModel", "wrapped": true }, "title": "IList" } } } } }, "/api/v2/ess/{employeeId}/timeandattendance/shift/{shiftId}/notes": { "get": { "tags": [ "Ess" ], "summary": "Get Shift Notes", "description": "Gets shifts based on certain optional criteria.", "operationId": "EssTimeAndAttendance_GetShiftNotes", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "shiftId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "model.employeeId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "model.isAdminInitiated", "in": "query", "required": false, "type": "boolean", "title": "Boolean" }, { "name": "model.type", "in": "query", "required": false, "type": "string", "enum": [ "Shift", "ClockOn", "ClockOff" ], "title": "Nullable" }, { "name": "model.visibility", "in": "query", "required": false, "type": "string", "enum": [ "Hidden", "Visible" ], "title": "Nullable" } ], "responses": { "200": { "description": "OK" } } }, "post": { "tags": [ "Ess" ], "summary": "Add Note to Shift", "description": "Adds a note to an existing shift.", "operationId": "EssTimeAndAttendance_AddNote", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "shiftId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/AddNoteModel" } } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/{employeeId}/timeandattendance/shift/{shiftId}/notes/read-state": { "post": { "tags": [ "Ess" ], "summary": "Mark Shift Notes Read", "description": "Marks some shift notes as either read or unread.", "operationId": "EssTimeAndAttendance_MarkNotesRead", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/MarkNotesReadViewModel" } }, { "name": "shiftId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/{employeeId}/superfunds": { "get": { "tags": [ "Ess" ], "summary": "List Super Funds", "description": "Lists all of the super funds for this employee.", "operationId": "EssSuperFund_List", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/SuperFundModel" }, "xml": { "name": "SuperFundModel", "wrapped": true }, "title": "IEnumerable" } } } }, "post": { "tags": [ "Ess" ], "summary": "Create Super Fund", "description": "Creates a new super fund for the employee.", "operationId": "EssSuperFund_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/SaveSuperFundModel" } }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/SaveSuperFundResponseModel" } } } } }, "/api/v2/ess/{employeeId}/superfunds/{superFundId}": { "get": { "tags": [ "Ess" ], "summary": "Get Super Fund by ID", "description": "Gets the super fund for this employee with the specified ID.", "operationId": "EssSuperFund_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "superFundId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/SuperFundModel" } } } } }, "/api/v2/ess/{employeeId}/superfunds/{id}": { "put": { "tags": [ "Ess" ], "summary": "Update Super Fund", "description": "Updates the employee's super fund with the specified ID.", "operationId": "EssSuperFund_Put", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/SaveSuperFundModel" } }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/SaveSuperFundResponseModel" } } } } }, "/api/v2/ess/{employeeId}/superfunds/{superfundId}": { "delete": { "tags": [ "Ess" ], "summary": "Delete Super Fund", "description": "Deletes the employee's super fund with the specified ID.", "operationId": "EssSuperFund_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "superfundId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/SaveSuperFundResponseModel" } } } } }, "/api/v2/ess/{employeeId}/document/payslip": { "get": { "tags": [ "Ess" ], "summary": "List Pay Slips", "description": "Lists all pay slips for the employee.", "operationId": "EssDocument_Payslips", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/EssPayslipModel" }, "xml": { "name": "EssPayslipModel", "wrapped": true }, "title": "List" } } } } }, "/api/v2/ess/{employeeId}/document/payslip/{payrunId}": { "get": { "tags": [ "Ess" ], "summary": "Get Pay Slip by Pay Run ID", "description": "Gets the pay slip for the pay run with the specified ID.", "operationId": "EssDocument_Payslip", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payrunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/{employeeId}/document/paymentsummaries": { "get": { "tags": [ "Ess" ], "summary": "Get Payment Summaries", "description": "List all the employee's payment summaries.", "operationId": "EssDocument_PaymentSummaries", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/EssPaymentSummaryModel" }, "xml": { "name": "EssPaymentSummaryModel", "wrapped": true }, "title": "List" } } } } }, "/api/v2/ess/{employeeId}/document/paymentsummary/{documentId}": { "get": { "tags": [ "Ess" ], "summary": "Get Payment Summary PDF", "description": "Gets the PDF for the payment summary with the specified ID.", "operationId": "EssDocument_PaymentSummary", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "documentId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/{employeeId}/document": { "get": { "tags": [ "Ess" ], "summary": "List all Documents", "description": "Lists all documents visible to this employee, including both business and employee documents.", "operationId": "EssDocument_List", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/EssDocumentModel" }, "xml": { "name": "EssDocumentModel", "wrapped": true }, "title": "List" } } } } }, "/api/v2/ess/{employeeId}/document/{documentId}": { "get": { "tags": [ "Ess" ], "summary": "Get Document Details by ID", "description": "Gets details for the specified document which is visible to the employee.", "operationId": "EssDocument_GetDocument", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "documentId", "in": "path", "required": true, "type": "string", "title": "String" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/{employeeId}/document/download/{documentId}": { "get": { "tags": [ "Ess" ], "summary": "Download Document", "description": "Downloads the document with the specified ID so long as it is visible to the employee.", "operationId": "EssDocument_Download", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "documentId", "in": "path", "required": true, "type": "string", "title": "String" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/{employeeId}/unavailability": { "get": { "tags": [ "Ess" ], "summary": "List Unavailabilities", "description": "Lists all of the unavailabilities for this employee, with optional filters.", "operationId": "EssUnavailability_List", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "string" }, { "name": "filter.fromDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "Nullable" }, { "name": "filter.toDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "Nullable" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/EssUnavailabilityModel" }, "xml": { "name": "EssUnavailabilityModel", "wrapped": true }, "title": "IList" } } } }, "post": { "tags": [ "Ess" ], "summary": "Create Unavailability", "description": "Creates a new unavailability for the employee.", "operationId": "EssUnavailability_Create", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "unavailability", "in": "body", "required": true, "schema": { "$ref": "#/definitions/UnavailabilityEditModel" } }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EssUnavailabilityModel" } } } } }, "/api/v2/ess/{employeeId}/unavailability/{unavailabilityId}": { "get": { "tags": [ "Ess" ], "summary": "Get unavailability by ID", "description": "Gets the unavailability with the specified ID (so long as the unavailability is from the specified employee).", "operationId": "EssUnavailability_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "unavailabilityId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EssUnavailabilityModel" } } } }, "put": { "tags": [ "Ess" ], "summary": "Update Unavailability", "description": "Updates the unavailability with the specified ID.", "operationId": "EssUnavailability_Save", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "unavailabilityId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "unavailability", "in": "body", "required": true, "schema": { "$ref": "#/definitions/UnavailabilityEditModel" } }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "Ess" ], "summary": "Delete Unavailability", "description": "Deletes the unavailability with the specified ID.", "operationId": "EssUnavailability_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "unavailabilityId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/{employeeId}/bankaccounts": { "get": { "tags": [ "Ess" ], "summary": "List Bank Accounts", "description": "Lists all of the bank accounts for this employee.", "operationId": "EssBankAccount_List", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/BankAccountModel" }, "xml": { "name": "BankAccountModel", "wrapped": true }, "title": "IEnumerable" } } } }, "post": { "tags": [ "Ess" ], "summary": "Create Bank Account", "description": "Creates a new bank account for the employee.", "operationId": "EssBankAccount_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/BankAccountModel" } }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/SaveBankAccountResponseModel" } } } } }, "/api/v2/ess/{employeeId}/bankaccounts/{bankAccountId}": { "get": { "tags": [ "Ess" ], "summary": "Get Bank Account by ID", "description": "Gets the bank account for this employee with the specified ID.", "operationId": "EssBankAccount_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "bankAccountId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/BankAccountModel" } } } }, "delete": { "tags": [ "Ess" ], "summary": "Delete Bank Account", "description": "Deletes the employee's bank account with the specified ID.", "operationId": "EssBankAccount_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "bankAccountId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/SaveBankAccountResponseModel" } } } } }, "/api/v2/ess/{employeeId}/bankaccounts/{id}": { "put": { "tags": [ "Ess" ], "summary": "Update Bank Account", "description": "Updates the employee's bank account with the specified ID.", "operationId": "EssBankAccount_Put", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/BankAccountModel" } }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/SaveBankAccountResponseModel" } } } } }, "/api/v2/ess/security/employees": { "get": { "tags": [ "Ess" ], "summary": "Get Employees", "description": "Returns all the employees the user can access.", "operationId": "EssSecurity_Employees", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/AvailableEmployeeModel" }, "xml": { "name": "AvailableEmployeeModel", "wrapped": true }, "title": "List" } } } } }, "/api/v2/ess/security/forgottenpassword": { "post": { "tags": [ "Ess" ], "summary": "Recover Forgotten Password", "description": "Sends an email so that the user can reset their password", "operationId": "EssSecurity_ForgottenPassword", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/RecoverPasswordModel" } } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/{employeeId}/expense/summary": { "get": { "tags": [ "Ess" ], "summary": "Get Expense Payment Summary", "description": "Gets a summary of the employee's expense payments.", "operationId": "EssExpense_Summary", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/EmployeeExpensePaymentSummaryModel" }, "xml": { "name": "EmployeeExpensePaymentSummaryModel", "wrapped": true }, "title": "IList" } } } } }, "/api/v2/ess/{employeeId}/expense/categories": { "get": { "tags": [ "Ess" ], "summary": "Get Expense Categories", "description": "Gets all the expense categories for the employee.", "operationId": "EssExpense_ExpenseCategories", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/ExpenseCategoryResponseModel" }, "xml": { "name": "ExpenseCategoryResponseModel", "wrapped": true }, "title": "IList" } } } } }, "/api/v2/ess/{employeeId}/expense/taxcodes": { "get": { "tags": [ "Ess" ], "summary": "Get Tax Codes", "description": "Gets all the tax codes for the employee.", "operationId": "EssExpense_TaxCodes", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/JournalServiceTaxCode" }, "xml": { "name": "JournalServiceTaxCode", "wrapped": true }, "title": "IList" } } } } }, "/api/v2/ess/{employeeId}/expense": { "get": { "tags": [ "Ess" ], "summary": "Get Expense Requests", "description": "Gets a paged view of expense requests for this employee.", "operationId": "EssExpense_GetExpenseRequests", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "currentPage", "in": "query", "required": false, "type": "integer", "format": "int32", "default": 1, "title": "Int32" }, { "name": "pageSize", "in": "query", "required": false, "type": "integer", "format": "int32", "default": 100, "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/EssExpenseRequestResponseModel" }, "xml": { "name": "EssExpenseRequestResponseModel", "wrapped": true }, "title": "IList" } } } }, "post": { "tags": [ "Ess" ], "summary": "Create Expense Request", "description": "Creates a new expense request for the employee.", "operationId": "EssExpense_CreateExpenseRequest", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ExpenseRequestEditModel" } }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/{employeeId}/expense/{expenseRequestId}": { "get": { "tags": [ "Ess" ], "summary": "Get Expense Request by ID", "description": "Gets the expense request with the specified ID.", "operationId": "EssExpense_GetExpenseRequest", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "expenseRequestId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EssExpenseRequestResponseModel" } } } }, "put": { "tags": [ "Ess" ], "summary": "Update Expense Request", "description": "Updates the expense request with the specified ID.", "operationId": "EssExpense_UpdateExpenseRequest", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "expenseRequestId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ExpenseRequestEditModel" } }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "Ess" ], "summary": "Delete Expense Request", "description": "Deletes the expense request with the specified ID.", "operationId": "EssExpense_CancelExpenseRequest", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "expenseRequestId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EssExpenseRequestResponseModel" } } } } }, "/api/v2/ess/{employeeId}/expense/{expenseRequestId}/attachment": { "put": { "tags": [ "Ess" ], "summary": "Upload Attachment to Expense Request", "description": "Uploads an attachment to the expense request with the specified ID. \r\nThe request should be a MIME multipart file upload request.", "operationId": "EssExpense_UploadAttachment", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "expenseRequestId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "title": "IHttpActionResult" } } } } }, "/api/v2/business/{businessId}/leaveallowances": { "get": { "tags": [ "LeaveAllowance" ], "summary": "Get Leave Allowances", "description": "Creates a deduction category for the business.", "operationId": "LeaveAllowances_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "array", "items": { "$ref": "#/definitions/LeaveAllowanceModel" }, "xml": { "name": "LeaveAllowanceModel", "wrapped": true }, "title": "List" }, "title": "Dictionary" } } } }, "post": { "tags": [ "LeaveAllowance" ], "summary": "Create Leave Allowances", "description": "Create leave allowances for specific employees (dictionary keyed by employee ID).", "operationId": "LeaveAllowances_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/SubmitEmployeeLeaveAllowancesRequest" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/leaveallowancetemplate": { "get": { "tags": [ "LeaveAllowance" ], "summary": "List Leave Allowance Templates", "description": "Lists all the leave allowance templates for this business.\n\nThis operation supports OData queries.", "operationId": "LeaveAllowanceTemplate_GetLeaveAllowanceTemplates", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/LeaveAllowanceTemplateModel" }, "xml": { "name": "LeaveAllowanceTemplateModel", "wrapped": true }, "title": "IEnumerable" } } } }, "post": { "tags": [ "LeaveAllowance" ], "summary": "Create Leave Allowance Template", "description": "Creates a new leave allowance template for the business.", "operationId": "LeaveAllowanceTemplate_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "leaveAllowanceTemplate", "in": "body", "required": true, "schema": { "$ref": "#/definitions/LeaveAllowanceTemplateModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/leaveallowancetemplate/{id}": { "get": { "tags": [ "LeaveAllowance" ], "summary": "Get Leave Allowance Template by ID", "description": "Gets the details for the leave allowance template with the specified ID.", "operationId": "LeaveAllowanceTemplate_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/LeaveAllowanceTemplateModel" } } } }, "put": { "tags": [ "LeaveAllowance" ], "summary": "Update Leave Allowance Template", "description": "Updates the leave allowance template with the specified ID.", "operationId": "LeaveAllowanceTemplate_Put", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "leaveAllowanceTemplate", "in": "body", "required": true, "schema": { "$ref": "#/definitions/LeaveAllowanceTemplateModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "LeaveAllowance" ], "summary": "Delete Leave Allowance Template", "description": "Deletes the leave allowance template with the specified ID.", "operationId": "LeaveAllowanceTemplate_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/leavecategory": { "get": { "tags": [ "LeaveCategories" ], "summary": "List Leave Categories", "description": "Lists all of the leave categories for the business.\n\nThis operation supports OData queries.", "operationId": "LeaveCategory_GetLeaveCategories", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/LeaveCategoryModel" }, "xml": { "name": "LeaveCategoryModel", "wrapped": true }, "title": "IEnumerable" } } } }, "post": { "tags": [ "LeaveCategories" ], "summary": "Create Leave Category", "description": "Creates a new leave category for the business.", "operationId": "LeaveCategory_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "leaveCategory", "in": "body", "required": true, "schema": { "$ref": "#/definitions/LeaveCategoryModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/leavecategory/{id}": { "get": { "tags": [ "LeaveCategories" ], "summary": "Get Leave Category by ID", "description": "Gets the leave category with the specified ID.", "operationId": "LeaveCategory_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/LeaveCategoryModel" } } } }, "put": { "tags": [ "LeaveCategories" ], "summary": "Update Leave Category", "description": "Updates the leave category with the specified ID.", "operationId": "LeaveCategory_Put", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "leaveCategory", "in": "body", "required": true, "schema": { "$ref": "#/definitions/LeaveCategoryModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "LeaveCategories" ], "summary": "Delete Leave Category", "description": "Deletes the leave category with the specified ID.", "operationId": "LeaveCategory_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/leaverequest": { "get": { "tags": [ "LeaveRequests" ], "summary": "List Leave Requests", "description": "Lists all the leave requests for the business.", "operationId": "BusinessLeaveRequest_ListLeaveRequests", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "filter.status", "in": "query", "required": false, "type": "string", "enum": [ "Pending", "Approved", "Cancelled", "Rejected" ], "title": "Nullable" }, { "name": "filter.fromDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "Nullable" }, { "name": "filter.toDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "Nullable" }, { "name": "filter.leaveCategoryId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" }, { "name": "filter.locationId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" }, { "name": "filter.employeeId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" }, { "name": "filter.groupBy", "in": "query", "required": false, "type": "string", "enum": [ "Employee", "LeaveType" ], "title": "LeaveRequestGroupBy" }, { "name": "filter.restrictOverlappingLeave", "in": "query", "required": false, "type": "boolean", "title": "Boolean" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/LeaveRequestResponseModel" }, "xml": { "name": "LeaveRequestResponseModel", "wrapped": true }, "title": "IEnumerable" } } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/leaverequest": { "get": { "tags": [ "LeaveRequests" ], "summary": "Get Leave Requests for Employee", "description": "Returns all leave requests for this employee, optionally filtered by OData parameters.\n\nThis operation supports OData queries.", "operationId": "LeaveRequest_GetLeaveRequests", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/LeaveRequestResponseModel" }, "xml": { "name": "LeaveRequestResponseModel", "wrapped": true }, "title": "IEnumerable" } } } }, "post": { "tags": [ "LeaveRequests" ], "summary": "Create Leave Request", "description": "Creates a new leave request for an employee.", "operationId": "LeaveRequest_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ApiLeaveApplicationModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/leaverequest/{leaveRequestId}": { "get": { "tags": [ "LeaveRequests" ], "summary": "Get Leave Request by ID", "description": "Gets the details for a leave request with the specified ID.", "operationId": "LeaveRequest_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "leaveRequestId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/LeaveRequestResponseModel" } } } }, "put": { "tags": [ "LeaveRequests" ], "summary": "Update Leave Request", "description": "Updates the leave request with the specified ID.", "operationId": "LeaveRequest_Put", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "leaveRequestId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ApiLeaveApplicationModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "LeaveRequests" ], "summary": "Delete Leave Request", "description": "Deletes the leave request with the specified ID.", "operationId": "LeaveRequest_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "leaveRequestId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/leaverequest/{leaveRequestId}/approve": { "post": { "tags": [ "LeaveRequests" ], "summary": "Approve Leave Request", "description": "Approves the leave request with the specified ID.", "operationId": "LeaveRequest_Approve", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "leaveRequestId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/leaverequest/{leaveRequestId}/decline": { "post": { "tags": [ "LeaveRequests" ], "summary": "Decline Leave Request", "description": "Declines the leave request with the specified ID.", "operationId": "LeaveRequest_Decline", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "leaveRequestId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "decline", "in": "body", "required": true, "schema": { "$ref": "#/definitions/DeclineLeaveRequest" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/leaverequest/estimate": { "get": { "tags": [ "LeaveRequests" ], "summary": "Estimate Leave Hours", "description": "Estimates the leave hours required for a leave request between fromDate and toDate.", "operationId": "LeaveRequest_Estimate", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "fromDate", "in": "query", "required": true, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "toDate", "in": "query", "required": true, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/LeaveEstimate" } } } } }, "/api/v2/business/{businessId}/location": { "get": { "tags": [ "Location" ], "summary": "List Business Locations", "description": "Lists all the locations for a business.\n\nThis operation supports OData queries.", "operationId": "Location_GetLocations", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/LocationModel" }, "xml": { "name": "LocationModel", "wrapped": true }, "title": "IEnumerable" } } } }, "post": { "tags": [ "Location" ], "summary": "Create Location", "description": "Creates a business location.", "operationId": "Location_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "location", "in": "body", "required": true, "schema": { "$ref": "#/definitions/LocationModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/location": { "get": { "tags": [ "Location" ], "summary": "List Business Locations", "description": "Lists all the locations for a business.\n\nThis operation supports OData queries.", "operationId": "Location_GetApiV2BusinessByBusinessIdEmployeeByEmployeeIdLocation", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/LocationModel" }, "xml": { "name": "LocationModel", "wrapped": true }, "title": "IEnumerable" } } } } }, "/api/v2/business/{businessId}/location/{id}": { "get": { "tags": [ "Location" ], "summary": "Get Location By Id", "description": "Retrieves the details of the location with the specified ID.", "operationId": "Location_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/LocationModel" } } } }, "put": { "tags": [ "Location" ], "summary": "Update Location", "description": "Updates the business location with the specified ID.", "operationId": "Location_Put", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "location", "in": "body", "required": true, "schema": { "$ref": "#/definitions/LocationModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "Location" ], "summary": "Delete Location", "description": "Deletes the location with the specified ID.", "operationId": "Location_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/lookupdata/reports": { "get": { "tags": [ "LookupData" ], "summary": "List Report Types", "description": "Lists all of the report types.", "operationId": "LookupData_Reports", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/NameIdPair" }, "xml": { "name": "NameIdPair", "wrapped": true }, "title": "List" } } } } }, "/api/v2/business/{businessId}/lookupdata/employeegrouppermissions": { "get": { "tags": [ "LookupData" ], "summary": "List Employee Group Permission Types", "description": "Lists all of the employee group permission types.", "operationId": "LookupData_EmployeeGroupPermissions", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/NameIdPair" }, "xml": { "name": "NameIdPair", "wrapped": true }, "title": "List" } } } } }, "/api/v2/business/{businessId}/lookupdata/timezones": { "get": { "tags": [ "LookupData" ], "summary": "List Time Zone Types", "description": "Lists all of the time zone types.", "operationId": "LookupData_TimeZones", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/NameIdPair" }, "xml": { "name": "NameIdPair", "wrapped": true }, "title": "List" } } } } }, "/api/v2/ess/{employeeId}/shift": { "get": { "tags": [ "Other" ], "summary": "List Roster Shifts", "description": "Gets the employee's roster shifts within the date range.", "operationId": "EssShift_Shifts", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "fromDate", "in": "query", "required": true, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "toDate", "in": "query", "required": true, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/EssRosterShiftModel" }, "xml": { "name": "EssRosterShiftModel", "wrapped": true }, "title": "List" } } } } }, "/api/v2/ess/{employeeId}/shift/{shiftId}": { "get": { "tags": [ "Other" ], "summary": "Get Roster Shift by ID", "description": "Gets the roster shift with the specified ID (as long as it is assigned to this employee).", "operationId": "EssShift_Shift", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "shiftId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/EssRosterShiftModel" } } } } }, "/api/v2/ess/{employeeId}/shift/{shiftId}/decline": { "post": { "tags": [ "Other" ], "summary": "Decline Roster Shift", "description": "Declines the roster shift with the specified ID.", "operationId": "EssShift_DeclineShift", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "shiftId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EssDeclineRosterShiftModel" } }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/{employeeId}/shift/{shiftId}/accept": { "post": { "tags": [ "Other" ], "summary": "Accept Roster Shift", "description": "Accepts the roster shift with the specified ID.", "operationId": "EssShift_AcceptShift", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "shiftId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/{employeeId}/shift/accept": { "post": { "tags": [ "Other" ], "summary": "Bulk Accept Roster Shifts", "description": "Accepts a number of roster shifts by ID.", "operationId": "EssShift_AcceptShifts", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EssBulkAcceptRosterShiftsModel" } }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/{employeeId}/shift/decline": { "post": { "tags": [ "Other" ], "summary": "Bulk Decline Roster Shifts", "description": "Declines a number of roster shifts by ID.", "operationId": "EssShift_DeclineShifts", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EssBulkDeclineRosterShiftsModel" } }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/{employeeId}/shift/nearby": { "get": { "tags": [ "Other" ], "summary": "Find Nearby Roster Shifts", "description": "Finds any of the employee's roster shifts that are nearby to the specified local time.", "operationId": "EssShift_NearbyRosterShifts", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "localTime", "in": "query", "required": true, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/EssRosterShiftModel" }, "xml": { "name": "EssRosterShiftModel", "wrapped": true }, "title": "IList" } } } } }, "/api/v2/ess/{employeeId}/shift/matchingclockon": { "get": { "tags": [ "Other" ], "summary": "Find Matching Clock On Roster Shift", "description": "If a roster shift exists that could match for this employee to clock on at this time \r\ngiven ESS settings for shift matching, returns that shift.\r\nOtherwise, the Shift result will be null.\r\nNote that if the time matches a shift exactly, the Shift result will also be null.", "operationId": "EssShift_MatchingClockOnRosterShift", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "localTime", "in": "query", "required": true, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/RosterShiftMatchingResultModel" } } } } }, "/api/v2/ess/{employeeId}/shift/matchingclockoff": { "get": { "tags": [ "Other" ], "summary": "Find Matching Clock Off Roster Shift", "description": "If a roster shift exists that could match for this employee to clock off at this time \r\ngiven ESS settings for shift matching, returns that shift.\r\nOtherwise, the Shift result will be null.\r\nNote that if the time matches a shift exactly, the Shift result will also be null.", "operationId": "EssShift_MatchingClockOffRosterShift", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "localTime", "in": "query", "required": true, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/RosterShiftMatchingResultModel" } } } } }, "/api/v2/ess/{employeeId}/shift/{shiftId}/swap/candidates": { "get": { "tags": [ "Other" ], "operationId": "EssShift_EmployeesEligibleForSwap", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "shiftId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/{employeeId}/shift/swap/propose": { "post": { "tags": [ "Other" ], "operationId": "EssShift_ProposeShiftSwap", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/SwapShiftModel" } }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/{employeeId}/shift/{shiftId}/swap/cancel": { "post": { "tags": [ "Other" ], "operationId": "EssShift_CancelShiftSwap", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "shiftId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/{employeeId}/shift/{shiftId}/swap/accept": { "post": { "tags": [ "Other" ], "operationId": "EssShift_AcceptShiftSwap", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "shiftId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/{employeeId}/shift/{shiftId}/swap/decline": { "post": { "tags": [ "Other" ], "operationId": "EssShift_DeclineShiftSwap", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "shiftId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/{employeeId}/shift/swap/accept": { "post": { "tags": [ "Other" ], "summary": "Bulk Accept Roster Shift Swaps", "description": "Accepts a number of roster shift swaps by shift ID.", "operationId": "EssShift_AcceptShiftSwaps", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EssBulkRosterShiftSwapModel" } }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/{employeeId}/shift/swap/decline": { "post": { "tags": [ "Other" ], "summary": "Bulk Decline Roster Shift Swaps", "description": "Declines a number of roster shift swaps by shift ID.", "operationId": "EssShift_DeclineShiftSwaps", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EssBulkRosterShiftSwapModel" } }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/ess/{employeeId}/shift/swap/cancel": { "post": { "tags": [ "Other" ], "summary": "Bulk Cancel Roster Shift Swaps", "description": "Cancels a number of roster shift swaps by shift ID.", "operationId": "EssShift_CancelShiftSwaps", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EssBulkRosterShiftSwapModel" } }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/report/tasks": { "get": { "tags": [ "Other" ], "operationId": "ReportsTasksReport_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "request.employeeId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request.payRunId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request.fromDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "Nullable" }, { "name": "request.toDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "Nullable" }, { "name": "request.payScheduleId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request.status", "in": "query", "required": false, "type": "string", "enum": [ "All", "Completed", "NotCompleted" ], "title": "TasksReportStatusEnum" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/TasksReportExportModel" }, "xml": { "name": "TasksReportExportModel", "wrapped": true }, "title": "IList" } } } } }, "/api/v2/business/{businessId}/report/shiftswapping": { "get": { "tags": [ "Other" ], "operationId": "ReportsShiftSwapping_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "request.fromEmployeeId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" }, { "name": "request.toEmployeeId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" }, { "name": "request.includeCosts", "in": "query", "required": false, "type": "boolean", "title": "Boolean" }, { "name": "request.statuses", "in": "query", "required": false, "type": "array", "items": { "type": "string", "enum": [ "Created", "Cancelled", "Accepted", "Declined", "AwaitingManagerApproval", "ApprovedByManager", "RejectedByManager" ], "title": "RosterShiftSwapStatusEnum" }, "collectionFormat": "multi", "title": "IList" }, { "name": "request.fromDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "request.toDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "request.locationId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request.employingEntityId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/ShiftSwappingReportExportModel" }, "xml": { "name": "ShiftSwappingReportExportModel", "wrapped": true }, "title": "IList" } } } } }, "/api/v2/business/{businessId}/paycategory": { "get": { "tags": [ "PayCategory" ], "summary": "List Pay Categories", "description": "Lists all the pay categories for the business\n\nThis operation supports OData queries.", "operationId": "PayCategory_GetPayCategories", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/PayCategoryModel" }, "xml": { "name": "PayCategoryModel", "wrapped": true }, "title": "IEnumerable" } } } }, "post": { "tags": [ "PayCategory" ], "summary": "Create Pay Category", "description": "Creates a new pay category for the business.", "operationId": "PayCategory_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payCategory", "in": "body", "required": true, "schema": { "$ref": "#/definitions/PayCategoryModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/paycategory/{id}": { "get": { "tags": [ "PayCategory" ], "summary": "Get Pay Category by ID", "description": "Gets the pay category with the specified ID.", "operationId": "PayCategory_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/PayCategoryModel" } } } }, "put": { "tags": [ "PayCategory" ], "summary": "Update Pay Category", "description": "Updates the pay category with the specified ID.", "operationId": "PayCategory_Put", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "payCategory", "in": "body", "required": true, "schema": { "$ref": "#/definitions/PayCategoryModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "PayCategory" ], "summary": "Delete Pay Category", "description": "Deletes the pay category with the specified ID.", "operationId": "PayCategory_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/paymentsummary/{financialYearEnding}": { "get": { "tags": [ "PaymentSummary" ], "summary": "List Payment Summaries", "description": "Lists all the payment summaries for the specified financial year.\n\nThis operation supports OData queries.", "operationId": "PaymentSummary_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "financialYearEnding", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/PaygPaymentSummaryModel" }, "xml": { "name": "PaygPaymentSummaryModel", "wrapped": true }, "title": "IEnumerable" } } } }, "put": { "tags": [ "PaymentSummary" ], "summary": "Generate Payment Summaries", "description": "Generates (or regenerates) payment summaries for the specified financial year/business. Only unpublished payment summaries will be regenerated.", "operationId": "PaymentSummary_Put", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "financialYearEnding", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" }, { "name": "employingEntityId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" }, { "name": "locationId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "post": { "tags": [ "PaymentSummary" ], "summary": "Publish Payment Summaries", "description": "Publish payment summaries for the specified financial year.", "operationId": "PaymentSummary_Post", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "financialYearEnding", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" }, { "name": "employingEntityId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" }, { "name": "locationId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "PaymentSummary" ], "summary": "Unpublish Payment Summaries", "description": "Unpublish payment summaries for the specified financial year.", "operationId": "PaymentSummary_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "financialYearEnding", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" }, { "name": "employingEntityId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" }, { "name": "locationId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/payratetemplate": { "get": { "tags": [ "PayRateTemplate" ], "summary": "List Pay Rate Templates", "description": "Lists all the pay rate templates for the business.\n\nThis operation supports OData queries.", "operationId": "PayRateTemplate_GetPayRateTemplates", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/PayRateTemplateModel" }, "xml": { "name": "PayRateTemplateModel", "wrapped": true }, "title": "IEnumerable" } } } }, "post": { "tags": [ "PayRateTemplate" ], "summary": "Create Pay Rate Template", "description": "Creates a new pay rate template for the business.", "operationId": "PayRateTemplate_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRateTemplate", "in": "body", "required": true, "schema": { "$ref": "#/definitions/PayRateTemplateModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/payratetemplate/{id}": { "get": { "tags": [ "PayRateTemplate" ], "summary": "Get Pay Rate Template by ID", "description": "Gets the pay rate template with the specified ID.", "operationId": "PayRateTemplate_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/PayRateTemplateModel" } } } }, "put": { "tags": [ "PayRateTemplate" ], "summary": "Update Pay Rate Template", "description": "Updates the pay rate template with the specified ID.", "operationId": "PayRateTemplate_Put", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "payRateTemplate", "in": "body", "required": true, "schema": { "$ref": "#/definitions/PayRateTemplateModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "PayRateTemplate" ], "summary": "Delete Pay Rate Template", "description": "Deletes the pay rate template with the specified ID.", "operationId": "PayRateTemplate_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/payrun/{payRunId}/EmployeeExpenses": { "get": { "tags": [ "PayRun" ], "summary": "List Employee Expenses", "description": "Lists all the employee expenses for a pay run.", "operationId": "PayRunEmployeeExpenses_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/PayRunEmployeeExpenseResponse" } } } }, "post": { "tags": [ "PayRun" ], "summary": "Create Employee Expenses", "description": "Add employee expenses to the specified pay run.", "operationId": "PayRunEmployeeExpenses_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/SubmitPayRunEmployeeExpenseRequest" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "PayRun" ], "summary": "Delete Employee Expense", "description": "Deletes the employee expense with the specified ID from the pay run.", "operationId": "PayRunEmployeeExpenses_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "id", "in": "query", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/payrun/{payRunId}/EmployeeExpenses/{employeeId}": { "get": { "tags": [ "PayRun" ], "summary": "Get Employee Expenses by Employee ID", "description": "Gets all the employee expenses for a specific employee in a pay run.", "operationId": "PayRunEmployeeExpenses_GetApiV2BusinessByBusinessIdPayrunByPayRunIdEmployeeExpensesByEmployeeId", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/PayRunEmployeeExpenseResponse" } } } } }, "/api/v2/business/{businessId}/payrun/{payRunId}/details": { "get": { "tags": [ "PayRun" ], "summary": "Get Pay Run Details", "description": "Gets the details for the specified pay run.", "operationId": "PayRunDetails_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/PayRunDetailsModel" } } } } }, "/api/v2/business/{businessId}/payrun/{payRunId}/terminate": { "post": { "tags": [ "PayRun" ], "summary": "Terminate Employee in Pay Run", "description": "Terminates an employee in the specified pay run.", "operationId": "PayRunTerminate_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/TerminateEmployeeRequest" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/payrun/{payRunId}/payslips": { "get": { "tags": [ "PayRun" ], "summary": "List Pay Slip Data", "description": "Lists all the pay slips for the specified pay run.", "operationId": "PayRunPaySlip_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "showAllData", "in": "query", "required": false, "type": "boolean", "default": false, "title": "Boolean" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "$ref": "#/definitions/ApiPaySlipModel" }, "title": "Dictionary" } } } } }, "/api/v2/business/{businessId}/payrun/{payRunId}/payslips/{employeeId}": { "get": { "tags": [ "PayRun" ], "summary": "Get Pay Slip Data by Employee ID", "description": "Gets the pay slip data for an employee in a payrun.", "operationId": "PayRunPaySlip_GetApiV2BusinessByBusinessIdPayrunByPayRunIdPayslipsByEmployeeId", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "showAllData", "in": "query", "required": false, "type": "boolean", "default": false, "title": "Boolean" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/ApiPaySlipModel" } } } } }, "/api/v2/business/{businessId}/payrun/{payRunId}/earningslines": { "get": { "tags": [ "PayRun" ], "summary": "List Earnings Lines", "description": "Lists all the earnings lines for a pay run.", "operationId": "PayRunEarningsLine_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/PayRunEarningsLineResponse" } } } }, "post": { "tags": [ "PayRun" ], "summary": "Create Earnings Lines", "description": "Adds earnings lines to the specified pay run.", "operationId": "PayRunEarningsLine_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/SubmitPayRunEarningsLineRequest" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "PayRun" ], "summary": "Delete Earnings Line", "description": "Deletes the earnings with the specified ID from the pay run.", "operationId": "PayRunEarningsLine_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "id", "in": "query", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/payrun/{payRunId}/earningslines/{employeeId}": { "get": { "tags": [ "PayRun" ], "summary": "Get Earnings Lines by Employee ID", "description": "Gets all the earnings lines for a specific employee in a pay run.", "operationId": "PayRunEarningsLine_GetApiV2BusinessByBusinessIdPayrunByPayRunIdEarningslinesByEmployeeId", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/PayRunEarningsLineResponse" } } } } }, "/api/v2/business/{businessId}/employee/{employeeId}/payruntotals": { "get": { "tags": [ "PayRun" ], "summary": "List Pay Run Totals for Employee", "description": "Lists all the pay run totals for the employee with the specified ID.", "operationId": "EmployeePayRunTotal_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/PayRunTotalModel" }, "xml": { "name": "PayRunTotalModel", "wrapped": true }, "title": "IList" } } } } }, "/api/v2/business/{businessId}/payrun/{payRunId}/leaveaccrued": { "get": { "tags": [ "PayRun" ], "summary": "Get Leave Accruals", "description": "Lists all the leave accruals for the pay run.", "operationId": "PayRunLeaveAccrued_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "includeLeaveTaken", "in": "query", "required": false, "type": "boolean", "default": false, "title": "Boolean" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/LeaveAccrualResponse" } } } }, "post": { "tags": [ "PayRun" ], "summary": "Save Leave Accruals", "description": "Saves a set of leave accruals for the pay run.", "operationId": "PayRunLeaveAccrued_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/SubmitLeaveAccrualsModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "PayRun" ], "summary": "Delete Leave Accrual", "description": "Deletes the manually added leave accrual, leave taken or leave adjustment with the specified ID from the pay run.", "operationId": "PayRunLeaveAccrued_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "id", "in": "query", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/payrun/{payRunId}/leaveaccrued/{employeeId}": { "get": { "tags": [ "PayRun" ], "summary": "Get Leave Accruals for Employee", "description": "Gets the leave accruals for the specified employee in the pay run.", "operationId": "PayRunLeaveAccrued_GetApiV2BusinessByBusinessIdPayrunByPayRunIdLeaveaccruedByEmployeeId", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "includeLeaveTaken", "in": "query", "required": false, "type": "boolean", "default": false, "title": "Boolean" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/LeaveAccrualResponse" } } } } }, "/api/v2/business/{businessId}/payrun/{payRunId}/paygadjustments": { "get": { "tags": [ "PayRun" ], "summary": "List PAYG Adjustments", "description": "Lists all the PAYG adjustments for a pay run.", "operationId": "PayRunPaygAdjustments_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/PayRunPaygAdjustmentResponse" } } } }, "post": { "tags": [ "PayRun" ], "summary": "Create PAYG Adjustments", "description": "Adds PAYG adjustments to the specified pay run.", "operationId": "PayRunPaygAdjustments_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/SubmitPayRunPaygAdjustmentRequest" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "PayRun" ], "summary": "Delete PAYG Adjustment", "description": "Deletes the PAYG adjustment with the specified ID from the pay run.", "operationId": "PayRunPaygAdjustments_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "id", "in": "query", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/payrun/{payRunId}/paygadjustments/{employeeId}": { "get": { "tags": [ "PayRun" ], "summary": "Get PAYG Adjustments by Employee ID", "description": "Gets all the PAYG adjustments for a specific employee in a pay run.", "operationId": "PayRunPaygAdjustments_GetApiV2BusinessByBusinessIdPayrunByPayRunIdPaygadjustmentsByEmployeeId", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/PayRunPaygAdjustmentResponse" } } } } }, "/api/v2/business/{businessId}/payrun/{payRunId}/superadjustments": { "get": { "tags": [ "PayRun" ], "summary": "List Super Adjustments", "description": "Lists all the super adjustments for a pay run.", "operationId": "PayRunSuperAdjustments_GetAll", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/PayRunSuperAdjustmentResponse" } } } }, "post": { "tags": [ "PayRun" ], "summary": "Create Super Adjustments", "description": "Adds super adjustments to the specified pay run.", "operationId": "PayRunSuperAdjustments_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/SubmitPayRunSuperAdjustmentRequest" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "PayRun" ], "summary": "Delete Super Adjustment", "description": "Deletes the super adjustment with the specified ID from the pay run.", "operationId": "PayRunSuperAdjustments_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "id", "in": "query", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/payrun/{payRunId}/superadjustments/{employeeId}": { "get": { "tags": [ "PayRun" ], "summary": "Get Super Adjustments by Employee ID", "description": "Gets all super adjustments for a specific employee in a pay run.", "operationId": "PayRunSuperAdjustments_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/PayRunSuperAdjustmentResponse" } } } } }, "/api/v2/business/{businessId}/payrun/{payRunId}/unlock": { "post": { "tags": [ "PayRun" ], "summary": "Unlock Pay Run", "description": "Unlocks the specified pay run.", "operationId": "PayRunUnlock_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/PayRunUnlockRequest" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/payrun": { "get": { "tags": [ "PayRun" ], "summary": "List Pay Runs", "description": "Get a list of pay runs associated with the business.\n\nThis operation supports OData queries.", "operationId": "PayRun_GetPayRuns", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/PayRunModel" }, "xml": { "name": "PayRunModel", "wrapped": true }, "title": "IEnumerable" } } } }, "post": { "tags": [ "PayRun" ], "summary": "Create Pay Run", "description": "Creates a new pay run for this business.", "operationId": "PayRun_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/PayRunCreateRequest" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/payrun/{payRunId}": { "get": { "tags": [ "PayRun" ], "summary": "Get Pay Run", "description": "Gets the pay run with the specified ID.", "operationId": "PayRun_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/PayRunModel" } } } }, "delete": { "tags": [ "PayRun" ], "summary": "Delete Pay Run", "description": "Deletes the pay run with the specified ID.", "operationId": "PayRun_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/payrun/async": { "post": { "tags": [ "PayRun" ], "summary": "Create Pay Run (Async)", "description": "Creates a new pay run for this business asynchronously (the request will return before the pay run is created).", "operationId": "PayRun_Async", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/PayRunCreateRequest" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/payrun/creationstatus/{jobId}": { "get": { "tags": [ "PayRun" ], "summary": "Get Creation Status", "description": "Gets the creation status of a pay run that was created asynchronously.", "operationId": "PayRun_CreationStatus", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "jobId", "in": "path", "required": true, "type": "string", "format": "uuid", "title": "Guid" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/payrun/{payRunId}/file/aba/{abaId}": { "get": { "tags": [ "PayRun" ], "summary": "Get ABA File", "description": "Gets an ABA file associated with a pay run.", "operationId": "PayRun_AbaFile", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "abaId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/payrun/{payRunId}/file/payslip/{employeeId}": { "get": { "tags": [ "PayRun" ], "summary": "Get Pay Slip File", "description": "Gets the pay slip for an employee in a pay run.", "operationId": "PayRun_PaySlipFile", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/payrun/{payRunId}/recalculate": { "post": { "tags": [ "PayRun" ], "summary": "Recalculate", "description": "Recalculates a pay run.", "operationId": "PayRun_Recalculate", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/payrun/{payRunId}/notation": { "post": { "tags": [ "PayRun" ], "summary": "Set Pay Run Notation", "description": "Sets the notation for this pay run. The pay run notation is the message that is shown on all pay slips for this pay run.", "operationId": "PayRun_Notation", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/PayRunNotationModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "PayRun" ], "summary": "Delete Pay Run Notation", "description": "Deletes the notation for this pay run. The pay run notation is the message that is shown on all pay slips for this pay run.", "operationId": "PayRun_DeleteApiV2BusinessByBusinessIdPayrunByPayRunIdNotation", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/payrun/{payRunId}/employerliabilities": { "get": { "tags": [ "PayRun" ], "summary": "List Employer Liabilities", "description": "Lists all the employer liabilities for a pay run.", "operationId": "PayRunEmployerLiabilities_GetAll", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/PayRunEmployerLiabilityResponse" } } } }, "post": { "tags": [ "PayRun" ], "summary": "Create Employer Liabilities", "description": "Add employer liabilities to the specified pay run.", "operationId": "PayRunEmployerLiabilities_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/SubmitPayRunEmployerLiabilityRequest" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "PayRun" ], "summary": "Delete Employer Liability", "description": "Deletes the employer liability with the specified ID from the pay run.", "operationId": "PayRunEmployerLiabilities_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "id", "in": "query", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/payrun/{payRunId}/employerliabilities/{employeeId}": { "get": { "tags": [ "PayRun" ], "summary": "Get Employer Liabilities by Employee ID", "description": "Gets all the employer liabilities for a specific employee in a pay run.", "operationId": "PayRunEmployerLiabilities_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/PayRunEmployerLiabilityResponse" } } } } }, "/api/v2/business/{businessId}/payrun/{payRunId}/finalise": { "post": { "tags": [ "PayRun" ], "summary": "Finalise Pay Run", "description": "Finalises the specified pay run. A pay run can only be finalised if there are no calculations in progress.", "operationId": "PayRunFinalise_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "options", "in": "body", "required": true, "schema": { "$ref": "#/definitions/FinalisePayRunOptions" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/PayRunFinaliseResult" } } } } }, "/api/v2/business/{businessId}/journal/{payRunId}": { "get": { "tags": [ "PayRun" ], "summary": "Get Journal Details", "description": "Gets the journal details for this pay run.", "operationId": "Journal_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/JournalItemResponse" }, "xml": { "name": "JournalItemResponse", "wrapped": true }, "title": "IEnumerable" } } } } }, "/api/v2/business/{businessId}/payrun/{payRunId}/setuiunlockstate": { "post": { "tags": [ "PayRun" ], "summary": "Set UI Unlock enabled", "description": "Sets whether a pay run can be unlocked by the UI or not. Only applies to finalized pay runs.", "operationId": "PayRunUnlockState_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/SetPayRunUIUnlockStateRequest" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/payrun/{payRunId}/totals": { "get": { "tags": [ "PayRun" ], "summary": "List Pay Run Totals", "description": "Lists all of the pay run totals in a pay run.", "operationId": "PayRunTotals_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/PayRunTotalResponse" } } } } }, "/api/v2/business/{businessId}/payrun/{payRunId}/totals/{employeeId}": { "get": { "tags": [ "PayRun" ], "summary": "Get Pay Slip Data by Employee ID", "description": "Gets the pay run totals for a specific employee in a pay run.", "operationId": "PayRunTotals_GetApiV2BusinessByBusinessIdPayrunByPayRunIdTotalsByEmployeeId", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/PayRunTotalResponse" } } } } }, "/api/v2/business/{businessId}/payrun/{payRunId}/notation/{employeeId}": { "post": { "tags": [ "PayRun" ], "summary": "Create Note for Employee", "description": "Creates a note for an employee record in a pay run.", "operationId": "PayRunTotals_Notation", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/PayRunTotalNotationModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "PayRun" ], "summary": "Delete Note for Employee", "description": "Deletes the note for an employee record in a pay run.", "operationId": "PayRunTotals_DeleteApiV2BusinessByBusinessIdPayrunByPayRunIdNotationByEmployeeId", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/payrun/{payRunId}/deductions": { "get": { "tags": [ "PayRun" ], "summary": "List Deductions", "description": "Gets all the deductions for a pay run.", "operationId": "PayRunDeductions_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/PayRunDeductionResponse" } } } }, "post": { "tags": [ "PayRun" ], "summary": "Create Deductions", "description": "Add deductions to the specified pay run.", "operationId": "PayRunDeductions_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/SubmitPayRunDeductionRequest" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "PayRun" ], "summary": "Delete Deduction", "description": "Deletes the deduction with the specified ID from the pay run.", "operationId": "PayRunDeductions_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "id", "in": "query", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/payrun/{payRunId}/deductions/{employeeId}": { "get": { "tags": [ "PayRun" ], "summary": "Get Deductions by Employee ID", "description": "Gets all the deductions for a specific employee in a pay run.", "operationId": "PayRunDeductions_GetApiV2BusinessByBusinessIdPayrunByPayRunIdDeductionsByEmployeeId", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "payRunId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/PayRunDeductionResponse" } } } } }, "/api/v2/business/{businessId}/payschedule": { "get": { "tags": [ "PaySchedule" ], "summary": "List Pay Schedules", "description": "Lists all the pay schedules for the business.\n\nThis operation supports OData queries.", "operationId": "PaySchedule_GetPaySchedules", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/PayScheduleModel" }, "xml": { "name": "PayScheduleModel", "wrapped": true }, "title": "IEnumerable" } } } }, "post": { "tags": [ "PaySchedule" ], "summary": "Create Pay Schedule", "description": "Creates a new pay schedule for the business.", "operationId": "PaySchedule_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "paySchedule", "in": "body", "required": true, "schema": { "$ref": "#/definitions/PayScheduleModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/payschedule/{id}": { "get": { "tags": [ "PaySchedule" ], "summary": "Get Pay Schedule by ID", "description": "Gets the pay schedule with the specified ID.", "operationId": "PaySchedule_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/PayScheduleModel" } } } }, "put": { "tags": [ "PaySchedule" ], "summary": "Update Pay Schedule", "description": "Updates the pay schedule with the specified ID.", "operationId": "PaySchedule_Put", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "paySchedule", "in": "body", "required": true, "schema": { "$ref": "#/definitions/PayScheduleModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "PaySchedule" ], "summary": "Delete Pay Schedule", "description": "Deletes the pay schedule with the specified ID.", "operationId": "PaySchedule_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/publicholiday": { "get": { "tags": [ "PublicHoliday" ], "summary": "Get Public Holidays for Year", "description": "Retrieves all the public holidays for a specific year.", "operationId": "PublicHoliday_GetPublicHolidays", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "year", "in": "query", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/PublicHolidayModel" }, "xml": { "name": "PublicHolidayModel", "wrapped": true }, "title": "IEnumerable" } } } }, "post": { "tags": [ "PublicHoliday" ], "summary": "Add a public holiday", "description": "Adds a new public holiday.", "operationId": "PublicHoliday_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "publicHoliday", "in": "body", "required": true, "schema": { "$ref": "#/definitions/PublicHolidayModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "PublicHoliday" ], "summary": "Delete Public Holiday by Date", "description": "Deletes all the public holidays on a specific date.", "operationId": "PublicHoliday_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "date", "in": "query", "required": true, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/publicholiday/{id}": { "get": { "tags": [ "PublicHoliday" ], "summary": "Get Public Holiday Details", "description": "Gets the details for a public holiday with a specific ID", "operationId": "PublicHoliday_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/PublicHolidayModel" } } } }, "put": { "tags": [ "PublicHoliday" ], "summary": "Update Public Holiday", "description": "Updates the public holiday with the specific ID.", "operationId": "PublicHoliday_Put", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "publicHoliday", "in": "body", "required": true, "schema": { "$ref": "#/definitions/PublicHolidayModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "PublicHoliday" ], "summary": "Delete Public Holiday", "description": "Deletes the public holiday with the specified ID.", "operationId": "PublicHoliday_DeleteApiV2BusinessByBusinessIdPublicholidayById", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/qualification": { "get": { "tags": [ "Qualifications" ], "summary": "List Qualifications", "description": "Lists all of the qualifications for the business.\n\nThis operation supports OData queries.", "operationId": "Qualification_GetQualifications", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/QualificationModel" }, "xml": { "name": "QualificationModel", "wrapped": true }, "title": "IEnumerable" } } } }, "post": { "tags": [ "Qualifications" ], "summary": "Create Qualification", "description": "Creates a new employee qualification for the business.", "operationId": "Qualification_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "qualification", "in": "body", "required": true, "schema": { "$ref": "#/definitions/QualificationModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/qualification/{id}": { "get": { "tags": [ "Qualifications" ], "summary": "Get Qualification by ID", "description": "Gets the qualification with the specified ID.", "operationId": "Qualification_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/QualificationModel" } } } }, "put": { "tags": [ "Qualifications" ], "summary": "Update Qualification", "description": "Updates the qualification with the specified ID.", "operationId": "Qualification_Put", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "qualification", "in": "body", "required": true, "schema": { "$ref": "#/definitions/QualificationModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "Qualifications" ], "summary": "Delete Qualification", "description": "Deletes the qualification with the specified ID.", "operationId": "Qualification_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/report/supercontributions/byemployee": { "get": { "tags": [ "Reporting" ], "summary": "Super Contribution Report (By Employee)", "description": "Generates a super contribution report by employee.", "operationId": "ReportsSuperContributions_ByEmployee", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "request.payScheduleId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request.fromDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "request.toDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "request.locationId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request.employingEntityId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/SuperAccrualExportModel" }, "xml": { "name": "SuperAccrualExportModel", "wrapped": true }, "title": "IEnumerable" } } } } }, "/api/v2/business/{businessId}/report/supercontributions/bysuperfund": { "get": { "tags": [ "Reporting" ], "summary": "Super Contribution Report (By Super Fund)", "description": "Generates a super contribution report by super fund.", "operationId": "ReportsSuperContributions_BySuperFund", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "request.payScheduleId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request.fromDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "request.toDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "request.locationId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request.employingEntityId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/SuperContributionsReportExportModel" }, "xml": { "name": "SuperContributionsReportExportModel", "wrapped": true }, "title": "IEnumerable" } } } } }, "/api/v2/business/{businessId}/report/leavebalances": { "get": { "tags": [ "Reporting" ], "summary": "Leave Balances Report", "description": "Generates a leave balances report.", "operationId": "ReportsLeaveBalances_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "request.locationId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request.leaveTypeId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request.groupBy", "in": "query", "required": false, "type": "string", "enum": [ "AccrualLocation", "DefaultLocation" ], "title": "LeaveReportDisplayEnum" }, { "name": "request.employingEntityId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" }, { "name": "request.asAtDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "Nullable" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/LeaveBalancesReportExportModel" }, "xml": { "name": "LeaveBalancesReportExportModel", "wrapped": true }, "title": "IEnumerable" } } } } }, "/api/v2/business/{businessId}/report/deductions": { "get": { "tags": [ "Reporting" ], "summary": "Deductions Report", "description": "Generates a deductions report.", "operationId": "ReportsDeductions_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "request.employeeId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request.deductionCategoryId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request.disableRollupReporting", "in": "query", "required": false, "type": "boolean", "title": "Boolean" }, { "name": "request.payScheduleId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request.fromDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "request.toDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "request.locationId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request.employingEntityId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/DeductionsReportExportModel" }, "xml": { "name": "DeductionsReportExportModel", "wrapped": true }, "title": "IList" } } } } }, "/api/v2/business/{businessId}/report/payrunactivity": { "get": { "tags": [ "Reporting" ], "summary": "Pay Run Activity Report", "description": "Generates a pay run activity report.", "operationId": "ReportsPayRunActivity_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "fromDate", "in": "query", "required": true, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "toDate", "in": "query", "required": true, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "payScheduleId", "in": "query", "required": false, "type": "integer", "format": "int32", "default": 0, "title": "Int32" }, { "name": "locationId", "in": "query", "required": false, "type": "integer", "format": "int32", "default": 0, "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/ActivityReportExportModel" }, "xml": { "name": "ActivityReportExportModel", "wrapped": true }, "title": "IEnumerable" } } } } }, "/api/v2/business/{businessId}/report/employeedetails": { "get": { "tags": [ "Reporting" ], "summary": "Employee Details Report", "description": "Generates an employee details report.", "operationId": "ReportsEmployeeDetails_Get", "consumes": [], "produces": [ "application/json", "text/json" ], "parameters": [ { "name": "selectedColumns", "in": "query", "required": false, "type": "array", "items": { "type": "string", "title": "String" }, "collectionFormat": "multi", "title": "List" }, { "name": "locationId", "in": "query", "required": false, "type": "integer", "format": "int32", "default": 0, "title": "Int32" }, { "name": "employingEntityId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" }, { "name": "includeActive", "in": "query", "required": false, "type": "boolean", "default": true, "title": "Boolean" }, { "name": "includeInactive", "in": "query", "required": false, "type": "boolean", "default": true, "title": "Boolean" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "object", "title": "JObject" }, "xml": { "name": "JObject", "wrapped": true }, "title": "IEnumerable" } } } } }, "/api/v2/business/{businessId}/report/leavehistory": { "get": { "tags": [ "Reporting" ], "summary": "Leave History Report", "description": "Generates a leave history report.", "operationId": "ReportsLeaveHistoryReport_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "model.fromDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "model.toDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "model.payScheduleId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "model.locationId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "model.employeeId", "in": "query", "required": false, "type": "array", "items": { "type": "string", "title": "String" }, "collectionFormat": "multi", "title": "IList" }, { "name": "model.leaveCategoryId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Int32" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/LeaveHistoryReportGroupModel" }, "xml": { "name": "LeaveHistoryReportGroupModel", "wrapped": true }, "title": "IEnumerable" } } } } }, "/api/v2/business/{businessId}/report/employeedetails/fields": { "get": { "tags": [ "Reporting" ], "summary": "Get Employee Details Report Fields", "description": "Gets the fields for the Employee Details Report.", "operationId": "ReportsEmployeeDetailsFields_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/EmployeeDetailsReportField" }, "xml": { "name": "EmployeeDetailsReportField", "wrapped": true }, "title": "List" } } } } }, "/api/v2/business/{businessId}/report/paycategories": { "get": { "tags": [ "Reporting" ], "summary": "Pay Categories Report", "description": "Generates a pay categories report.", "operationId": "ReportsPayCategories_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "request.payScheduleId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request.employeeId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request.groupByEarningsLocation", "in": "query", "required": false, "type": "boolean", "title": "Boolean" }, { "name": "request.fromDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "request.toDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "request.locationId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request.employingEntityId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/PayCategoriesReportExportModel" }, "xml": { "name": "PayCategoriesReportExportModel", "wrapped": true }, "title": "IEnumerable" } } } } }, "/api/v2/business/{businessId}/report/payg": { "get": { "tags": [ "Reporting" ], "summary": "PAYG Report", "description": "Generates a PAYG report.", "operationId": "ReportsPayg_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "request.state", "in": "query", "required": false, "type": "string", "title": "String" }, { "name": "request.fromDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "request.toDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "request.locationId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request.employingEntityId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/PaygReportExportModel" }, "xml": { "name": "PaygReportExportModel", "wrapped": true }, "title": "IList" } } } } }, "/api/v2/business/{businessId}/report/detailedactivity": { "get": { "tags": [ "Reporting" ], "summary": "Detailed Activity Report", "description": "Generates a detailed activity report.", "operationId": "ReportsDetailedActivity_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "request.payScheduleId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request.fromDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "request.toDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "request.locationId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request.employingEntityId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/DetailedActivityReportExportModel" }, "xml": { "name": "DetailedActivityReportExportModel", "wrapped": true }, "title": "IEnumerable" } } } } }, "/api/v2/business/{businessId}/report/payrolltax": { "get": { "tags": [ "Reporting" ], "summary": "Payroll Tax Report", "description": "Generates a payroll tax report.", "operationId": "ReportsPayrollTax_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "request.groupBy", "in": "query", "required": false, "type": "string", "enum": [ "EarningsLocation", "DefaultLocation" ], "title": "PayrollTaxGroupByEnum" }, { "name": "request.fromDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "request.toDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "request.locationId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request.employingEntityId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/PayrollTaxReportExportModel" }, "xml": { "name": "PayrollTaxReportExportModel", "wrapped": true }, "title": "IList" } } } } }, "/api/v2/business/{businessId}/report/timesheet": { "get": { "tags": [ "Reporting" ], "summary": "Timesheet report", "description": "Generates a timesheet report.", "operationId": "ReportsTimesheet_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "request.employeeId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" }, { "name": "request.includeCosts", "in": "query", "required": false, "type": "boolean", "title": "Boolean" }, { "name": "request.statuses", "in": "query", "required": false, "type": "array", "items": { "type": "string", "enum": [ "Missing", "Submitted", "Approved", "Rejected", "Processed" ], "title": "TimesheetLineStatusType" }, "collectionFormat": "multi", "title": "IList" }, { "name": "request.workTypeId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" }, { "name": "request.payScheduleId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request.fromDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "request.toDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "request.locationId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request.employingEntityId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/TimesheetReportExportModel" }, "xml": { "name": "TimesheetReportExportModel", "wrapped": true }, "title": "IList" } } } } }, "/api/v2/business/{businessId}/report/paymenthistory": { "get": { "tags": [ "Reporting" ], "summary": "Employee Payment History Report", "description": "Generates an employee payment history report.", "operationId": "ReportsEmployeePaymentHistory_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "request.employeeId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" }, { "name": "request.fromDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "request.toDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "request.locationId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request.employingEntityId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/PaymentHistoryReportExportModel" }, "xml": { "name": "PaymentHistoryReportExportModel", "wrapped": true }, "title": "IEnumerable" } } } } }, "/api/v2/business/{businessId}/report/birthday": { "get": { "tags": [ "Reporting" ], "summary": "Birthday Report", "description": "Generates a birthday report.", "operationId": "ReportsBirthday_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "fromDate", "in": "query", "required": true, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "toDate", "in": "query", "required": true, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "locationId", "in": "query", "required": false, "type": "integer", "format": "int32", "default": 0, "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/BirthdayReportExportModel" }, "xml": { "name": "BirthdayReportExportModel", "wrapped": true }, "title": "IEnumerable" } } } } }, "/api/v2/business/{businessId}/report/grosstonet": { "get": { "tags": [ "Reporting" ], "summary": "Gross To Net Report", "description": "Generates a Gross To Net Report.", "operationId": "ReportsGrossToNet_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "request.employeeId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request.payCategoryIds", "in": "query", "required": false, "type": "array", "items": { "type": "integer", "format": "int32", "title": "Int32" }, "collectionFormat": "multi", "title": "List" }, { "name": "request.payScheduleId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request.fromDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "request.toDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "request.locationId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request.employingEntityId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/GrossToNetReportLineItem" }, "xml": { "name": "GrossToNetReportLineItem", "wrapped": true }, "title": "IEnumerable" } } } } }, "/api/v2/business/{businessId}/report/leaveliability": { "get": { "tags": [ "Reporting" ], "summary": "Leave Liability Report", "description": "Generates a leave liability report.", "operationId": "ReportsLeaveLiability_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "model.locationId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "model.leaveTypeId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "model.includeApprovedLeave", "in": "query", "required": false, "type": "boolean", "title": "Boolean" }, { "name": "model.asAtDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "Nullable" }, { "name": "model.employingEntityId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/LeaveLiabilityReportExportModel" }, "xml": { "name": "LeaveLiabilityReportExportModel", "wrapped": true }, "title": "IEnumerable" } } } } }, "/api/v2/business/{businessId}/rostershift": { "get": { "tags": [ "RosterShift" ], "summary": "Get Roster Shifts", "description": "Gets roster shifts, optionally filtered by a number of parameters.", "operationId": "RosterShift_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "filter.fromDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "filter.toDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "filter.resourceView", "in": "query", "required": false, "type": "string", "enum": [ "Employee", "Location" ], "title": "ResourceViewEnum" }, { "name": "filter.shiftStatus", "in": "query", "required": false, "type": "string", "enum": [ "All", "Published", "Unpublished", "Accepted" ], "title": "RosterShiftStatus" }, { "name": "filter.shiftStatuses", "in": "query", "required": false, "type": "array", "items": { "type": "string", "enum": [ "All", "Published", "Unpublished", "Accepted" ], "title": "RosterShiftStatus" }, "collectionFormat": "multi", "title": "IList" }, { "name": "filter.selectedLocations", "in": "query", "required": false, "type": "array", "items": { "type": "string", "title": "String" }, "collectionFormat": "multi", "title": "IList" }, { "name": "filter.selectedEmployees", "in": "query", "required": false, "type": "array", "items": { "type": "string", "title": "String" }, "collectionFormat": "multi", "title": "IList" }, { "name": "filter.selectedRoles", "in": "query", "required": false, "type": "array", "items": { "type": "string", "title": "String" }, "collectionFormat": "multi", "title": "IList" }, { "name": "filter.includeSublocations", "in": "query", "required": false, "type": "boolean", "title": "Boolean" }, { "name": "filter.currentView", "in": "query", "required": false, "type": "string", "enum": [ "resourceDay", "resourceWeek", "resourceNextWeeks" ], "title": "RosterViewMode" }, { "name": "filter.budgetWarningPercent", "in": "query", "required": false, "type": "number", "format": "double", "title": "Decimal" }, { "name": "filter.employeeId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" }, { "name": "filter.locationId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" }, { "name": "filter.employeeGroupId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" }, { "name": "filter.unassignedShiftsOnly", "in": "query", "required": false, "type": "boolean", "title": "Boolean" }, { "name": "filter.showCosts", "in": "query", "required": false, "type": "boolean", "title": "Boolean" }, { "name": "filter.groupBy", "in": "query", "required": false, "type": "string", "enum": [ "Business", "Location" ], "title": "RosterGroupByEnum" }, { "name": "filter.groupByThen", "in": "query", "required": false, "type": "string", "enum": [ "Employee", "Role", "StartingTime" ], "title": "RosterGroupByThenEnum" }, { "name": "filter.excludeUnassignedEmployees", "in": "query", "required": false, "type": "boolean", "title": "Boolean" }, { "name": "filter.selectAllRoles", "in": "query", "required": false, "type": "boolean", "title": "Boolean" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/RosterShiftGenerateTimesheetModel" }, "xml": { "name": "RosterShiftGenerateTimesheetModel", "wrapped": true }, "title": "List" } } } } }, "/api/v2/business/{businessId}/rostershift/{rosterShiftId}/stub": { "post": { "tags": [ "RosterShift" ], "summary": "Stub Shift Timesheets", "description": "Generates timesheets for the roster shift with the specified ID.", "operationId": "RosterShift_StubShiftTimesheets", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [], "parameters": [ { "name": "rosterShiftId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/StubRosterShiftViewModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "204": { "description": "No Content" } } } }, "/api/v2/business/{businessId}/rostershift/{employeeId}/nearby": { "get": { "tags": [ "RosterShift" ], "summary": "Find Nearby Roster Shifts", "description": "Finds any of the employee's roster shifts that are nearby to the specified local time.", "operationId": "RosterShift_NearbyRosterShifts", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "localTime", "in": "query", "required": true, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/EssRosterShiftModel" }, "xml": { "name": "EssRosterShiftModel", "wrapped": true }, "title": "IList" } } } } }, "/api/v2/business/{businessId}/rostershift/{employeeId}/matchingclockon": { "get": { "tags": [ "RosterShift" ], "summary": "Find Matching Clock On Roster Shift", "description": "If a roster shift exists that could match for this employee to clock on at this time \r\ngiven kiosk settings for shift matching, returns that shift.\r\nOtherwise, the Shift result will be null.\r\nNote that if the time matches a shift exactly, the Shift result will also be null.", "operationId": "RosterShift_MatchingClockOnRosterShift", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "kioskId", "in": "query", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "dateUtc", "in": "query", "required": true, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/RosterShiftMatchingResultModel" } } } } }, "/api/v2/business/{businessId}/rostershift/{employeeId}/matchingclockoff": { "get": { "tags": [ "RosterShift" ], "summary": "Find Matching Clock Off Roster Shift", "description": "If a roster shift exists that could match for this employee to clock off at this time \r\ngiven kiosk settings for shift matching, returns that shift.\r\nOtherwise, the Shift result will be null.\r\nNote that if the time matches a shift exactly, the Shift result will also be null.", "operationId": "RosterShift_MatchingClockOffRosterShift", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "kioskId", "in": "query", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "dateUtc", "in": "query", "required": true, "type": "string", "format": "date-time", "title": "DateTime" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/RosterShiftMatchingResultModel" } } } } }, "/api/v2/business/{businessId}/selfmanagedsuperfund": { "get": { "tags": [ "SuperFund" ], "summary": "List Self Managed Super Funds", "description": "Lists all the self managed super funds for the business.\n\nThis operation supports OData queries.", "operationId": "SelfManagedSuperFund_GetFunds", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/SelfManagedSuperFundModel" }, "xml": { "name": "SelfManagedSuperFundModel", "wrapped": true }, "title": "IEnumerable" } } } }, "post": { "tags": [ "SuperFund" ], "summary": "Create Self Managed Super Fund", "description": "Creates a new self managed super fund for the business.", "operationId": "SelfManagedSuperFund_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "fund", "in": "body", "required": true, "schema": { "$ref": "#/definitions/SelfManagedSuperFundModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/selfmanagedsuperfund/{id}": { "get": { "tags": [ "SuperFund" ], "summary": "Get Self Managed Super Fund by ID", "description": "Gets the self managed super fund with the specified ID.", "operationId": "SelfManagedSuperFund_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/SelfManagedSuperFundModel" } } } }, "put": { "tags": [ "SuperFund" ], "summary": "Update Self Managed Super Fund", "description": "Updates .", "operationId": "SelfManagedSuperFund_Put", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "fund", "in": "body", "required": true, "schema": { "$ref": "#/definitions/SelfManagedSuperFundModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/superfund/productsearch": { "get": { "tags": [ "SuperFund" ], "summary": "Search Super Funds", "description": "Search for super funds based on a string.", "operationId": "SuperFund_ProductSearch", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "term", "in": "query", "required": true, "type": "string", "title": "String" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/SuperProductEditModel" }, "xml": { "name": "SuperProductEditModel", "wrapped": true }, "title": "List" } } } } }, "/api/v2/business/{businessId}/kiosk/hasaccess/{employeeId}": { "get": { "tags": [ "TimeAndAttendance" ], "summary": "Employee Has Access", "description": "Check if an employee has access to a kiosk.", "operationId": "TimeAndAttendance_GetHasAccess", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "employeeId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/kiosk/{kioskId}/staff": { "get": { "tags": [ "TimeAndAttendance" ], "summary": "List Kiosk Staff", "description": "Lists all the staff associated with a kiosk.", "operationId": "TimeAndAttendance_GetStaff", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "kioskId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/BasicKioskEmployeeModel" }, "xml": { "name": "BasicKioskEmployeeModel", "wrapped": true }, "title": "List" } } } }, "post": { "tags": [ "TimeAndAttendance" ], "summary": "Add an Employee", "description": "Quickly add an employee with minimal details and kiosk enabled. If the employee already exists, the kiosk will be enabled for that employee.", "operationId": "TimeAndAttendance_PostStaff", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "kioskId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/KioskCreateEmployeeModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/kiosk/{kioskId}/checkid": { "post": { "tags": [ "TimeAndAttendance" ], "summary": "Check Employee", "description": "If the specified employee has kiosk access, returns details about the employee and their current shift.", "operationId": "TimeAndAttendance_CheckId", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/CheckKioskEmployeeIdModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "kioskId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/kiosk/{kioskId}/checkpin": { "post": { "tags": [ "TimeAndAttendance" ], "summary": "Verify Kiosk PIN", "description": "Verifies the employee's kiosk PIN. Returns error code 400 if the PIN is incorrect.", "operationId": "TimeAndAttendance_CheckPin", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/CheckKioskPinModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "kioskId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/kiosk/{kioskId}/clockon": { "post": { "tags": [ "TimeAndAttendance" ], "summary": "Clock In Employee", "description": "Clocks in an employee for a new shift.", "operationId": "TimeAndAttendance_ClockOn", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "kioskId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ClockOnModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/kiosk/{kioskId}/clockoff": { "post": { "tags": [ "TimeAndAttendance" ], "summary": "Clock Out Employee", "description": "Clocks out an employee from their existing shift. \r\nIf they are on a break, it will be ended automatically.", "operationId": "TimeAndAttendance_ClockOff", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "kioskId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ClockOffModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/kiosk/{kioskId}/startbreak": { "post": { "tags": [ "TimeAndAttendance" ], "summary": "Start Break", "description": "Starts a break for an employee who is clocked on for a shift.", "operationId": "TimeAndAttendance_StartBreak", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "kioskId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/StartBreakModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/kiosk/{kioskId}/endbreak": { "post": { "tags": [ "TimeAndAttendance" ], "summary": "End Break", "description": "Ends the employee's current break.", "operationId": "TimeAndAttendance_EndBreak", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "kioskId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/EndBreakModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/kiosk/shifts": { "post": { "tags": [ "TimeAndAttendance" ], "summary": "Shifts", "description": "Gets shifts based on certain optional criteria.", "operationId": "TimeAndAttendance_Shifts", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/GetShiftsModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/TimeAndAttendanceShiftModel" }, "xml": { "name": "TimeAndAttendanceShiftModel", "wrapped": true }, "title": "IList" } } } } }, "/api/v2/business/{businessId}/kiosk/{kioskId}/changepin": { "post": { "tags": [ "TimeAndAttendance" ], "summary": "Change PIN", "description": "Changes the kiosk PIN for an employee, given their old PIN.", "operationId": "TimeAndAttendance_ChangePin", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "kioskId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ChangeKioskPinModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/kiosk/{kioskId}/emailreset": { "post": { "tags": [ "TimeAndAttendance" ], "summary": "Send PIN Reset Email", "description": "Sends kiosk PIN reset instructions to an employee by email.", "operationId": "TimeAndAttendance_EmailReset", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/PinResetModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "kioskId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/kiosk/{kioskId}/smsreset": { "post": { "tags": [ "TimeAndAttendance" ], "summary": "Send PIN Reset SMS", "description": "Sends kiosk PIN reset instructions to an employee by SMS. Note that the current business must have SMS notifications enabled.", "operationId": "TimeAndAttendance_SmsReset", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/PinResetModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "kioskId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/kiosk/{kioskId}/discard": { "post": { "tags": [ "TimeAndAttendance" ], "summary": "Discard current shift", "description": "Discards the current shift for an employee. \r\nIf they are on a break, it will be ended automatically.", "operationId": "TimeAndAttendance_DiscardShift", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "kioskId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ClockOffModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/kiosk/{kioskId}/lookupdata/{employeeId}": { "get": { "tags": [ "TimeAndAttendance" ], "summary": "Get Employee Lookup Data", "description": "Gets relevant lookup data for an employee in relation to a kiosk.", "operationId": "TimeAndAttendance_GetLookupData", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "kioskId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "employeeId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/TimeAndAttendanceLookupDataModel" } } } } }, "/api/v2/business/{businessId}/kiosk/{kioskId}/shift/{shiftId}/notes": { "get": { "tags": [ "TimeAndAttendance" ], "summary": "Get Shift Notes", "description": "Gets all the notes for a specific shift.", "operationId": "TimeAndAttendance_GetShiftNotes", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "kioskId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "shiftId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "model.employeeId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "model.isAdminInitiated", "in": "query", "required": false, "type": "boolean", "title": "Boolean" }, { "name": "model.type", "in": "query", "required": false, "type": "string", "enum": [ "Shift", "ClockOn", "ClockOff" ], "title": "Nullable" }, { "name": "model.visibility", "in": "query", "required": false, "type": "string", "enum": [ "Hidden", "Visible" ], "title": "Nullable" } ], "responses": { "200": { "description": "OK" } } }, "post": { "tags": [ "TimeAndAttendance" ], "summary": "Add Note to Shift", "description": "Adds a note to an existing shift.", "operationId": "TimeAndAttendance_AddNote", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "kioskId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "shiftId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/AddNoteModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/kiosk/{kioskId}/shift/{shiftId}/notes/{noteId}": { "delete": { "tags": [ "TimeAndAttendance" ], "summary": "Delete Note from Shift", "description": "Deletes a note from an existing shift.", "operationId": "TimeAndAttendance_DeleteNote", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "kioskId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "shiftId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "noteId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/kiosk/{kioskId}/shift/{shiftId}/notes/read-state": { "post": { "tags": [ "TimeAndAttendance" ], "summary": "Mark Shift Notes Read", "description": "Marks some shift notes as either read or unread.", "operationId": "TimeAndAttendance_MarkNotesRead", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/MarkNotesReadViewModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "kioskId", "in": "path", "required": true, "type": "string" }, { "name": "shiftId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/kiosk": { "get": { "tags": [ "TimeAndAttendance" ], "summary": "List Kiosks", "description": "Lists all kiosks for the specified business.\n\nThis operation supports OData queries.", "operationId": "Kiosk_GetAll", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/TimeAndAttendanceKioskModel" }, "xml": { "name": "TimeAndAttendanceKioskModel", "wrapped": true }, "title": "IQueryable" } } } }, "post": { "tags": [ "TimeAndAttendance" ], "summary": "Create Kiosk", "description": "Creates a new kiosk for the business.", "operationId": "Kiosk_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "kiosk", "in": "body", "required": true, "schema": { "$ref": "#/definitions/TimeAndAttendanceKioskModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/kiosk/{id}": { "get": { "tags": [ "TimeAndAttendance" ], "summary": "Get Kiosk by ID", "description": "Gets the kiosk with the specified ID.", "operationId": "Kiosk_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/TimeAndAttendanceKioskModel" } } } }, "put": { "tags": [ "TimeAndAttendance" ], "summary": "Update Kiosk", "description": "Updates the kiosk with the specified ID.", "operationId": "Kiosk_Put", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "kiosk", "in": "body", "required": true, "schema": { "$ref": "#/definitions/TimeAndAttendanceKioskModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "TimeAndAttendance" ], "summary": "Delete Kiosk", "description": "Deletes the kiosk with the specified ID.", "operationId": "Kiosk_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/timesheet": { "get": { "tags": [ "Timesheets" ], "summary": "Get Business Timesheets", "description": "Retrieves all timesheets for the specified business.\n\nThis operation supports OData queries.", "operationId": "Timesheet_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/TimesheetLineModel" }, "xml": { "name": "TimesheetLineModel", "wrapped": true }, "title": "IEnumerable" } } } } }, "/api/v2/business/{businessId}/timesheet/bulk": { "put": { "tags": [ "Timesheets" ], "summary": "Update/Replace timesheets", "description": "Performs the same action as 'Bulk Insert Timesheets', but any existing timesheets \r\nfor the specified employees within the specified time period \r\n(StartTime - EndTime) will be replaced with the timesheets specified.", "operationId": "Timesheet_Put", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/SubmitTimesheetsRequest" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "post": { "tags": [ "Timesheets" ], "summary": "Bulk Insert Timesheets", "description": "Adds timesheets for the specified business. This will not replace any existing timesheets.", "operationId": "Timesheet_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/SubmitTimesheetsRequest" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/unavailability": { "get": { "tags": [ "Unavailability" ], "summary": "List Unavailabilities", "description": "Lists all of the unavailabilities for this business, with optional filters.", "operationId": "Unavailability_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" }, { "name": "filter.fromDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "Nullable" }, { "name": "filter.toDate", "in": "query", "required": false, "type": "string", "format": "date-time", "title": "Nullable" }, { "name": "filter.employeeId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" }, { "name": "filter.defaultLocationId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/UnavailabilityModel" }, "xml": { "name": "UnavailabilityModel", "wrapped": true }, "title": "IEnumerable" } } } }, "post": { "tags": [ "Unavailability" ], "summary": "Create Unavailability", "description": "Creates a new unavailability for the employee.", "operationId": "Unavailability_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "unavailabilityModel", "in": "body", "required": true, "schema": { "$ref": "#/definitions/UnavailabilityModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/UnavailabilityModel" } } } } }, "/api/v2/business/{businessId}/unavailability/{id}": { "get": { "tags": [ "Unavailability" ], "summary": "Get unavailability by ID", "description": "Gets the unavailability with the specified ID.", "operationId": "Unavailability_GetApiV2BusinessByBusinessIdUnavailabilityById", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/UnavailabilityModel" } } } }, "put": { "tags": [ "Unavailability" ], "summary": "Update Unavailability", "description": "Updates the unavailability with the specified ID.", "operationId": "Unavailability_Put", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "unavailabilityModel", "in": "body", "required": true, "schema": { "$ref": "#/definitions/UnavailabilityModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "Unavailability" ], "summary": "Delete Unavailability", "description": "Deletes the unavailability with the specified ID.", "operationId": "Unavailability_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/user": { "get": { "tags": [ "User" ], "summary": "Get User Details", "description": "Gets details about the user.", "operationId": "User_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/UserModel" } } } }, "post": { "tags": [ "User" ], "summary": "Create New User", "description": "Creates a new user.", "operationId": "User_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "model", "in": "body", "required": true, "schema": { "$ref": "#/definitions/NewUserModel" } } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/webhookregistrations": { "get": { "tags": [ "Webhook" ], "summary": "List Web Hook Registrations", "description": "Returns a collection containing the registered web hook instances for the user.", "operationId": "WebHookRegistrations_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/WebHook" }, "xml": { "name": "WebHook", "wrapped": true }, "title": "IEnumerable" } } } }, "post": { "tags": [ "Webhook" ], "summary": "Register Web Hook", "description": "Registers a new web hook.", "operationId": "WebHookRegistrations_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "webHook", "in": "body", "required": true, "schema": { "$ref": "#/definitions/WebHook" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/WebHook" } } } }, "delete": { "tags": [ "Webhook" ], "summary": "Delete all Web Hook Registrations", "description": "Deletes all the web hook registrations.", "operationId": "WebHookRegistrations_DeleteAll", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "title": "IHttpActionResult" } } } } }, "/api/v2/business/{businessId}/webhookregistrations/{id}": { "get": { "tags": [ "Webhook" ], "summary": "Get Web Hook Registration by ID", "description": "Gets the registered web hook instance with the specified ID.", "operationId": "WebHookRegistrations_Lookup", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "string", "title": "String" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/WebHook" } } } }, "put": { "tags": [ "Webhook" ], "summary": "Update Web Hook Registration", "description": "Updates the web hook registration with the specified ID.", "operationId": "WebHookRegistrations_Put", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "string", "title": "String" }, { "name": "webHook", "in": "body", "required": true, "schema": { "$ref": "#/definitions/WebHook" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "title": "IHttpActionResult" } } } }, "delete": { "tags": [ "Webhook" ], "summary": "Delete Web Hook Registration", "description": "Deletes the web hook registration with the specified ID.", "operationId": "WebHookRegistrations_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "string", "title": "String" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "title": "IHttpActionResult" } } } } }, "/api/v2/business/{businessId}/webhookregistrations/{id}/test": { "get": { "tags": [ "Webhook" ], "summary": "Test Web Hook", "description": "Tests a web hook given a registration ID and a filter string.", "operationId": "WebHookRegistrations_Test", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "string", "title": "String" }, { "name": "filter", "in": "query", "required": true, "type": "string", "title": "String" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "title": "IHttpActionResult" } } } } }, "/api/v2/whitelabel": { "get": { "tags": [ "WhiteLabel" ], "summary": "List White Labels", "description": "Lists all the white labels to which you have access.", "operationId": "WhiteLabel_GetWhiteLabels", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/WhiteLabelModel" }, "xml": { "name": "WhiteLabelModel", "wrapped": true }, "title": "IEnumerable" } } } } }, "/api/v2/whitelabel/{id}": { "get": { "tags": [ "WhiteLabel" ], "summary": "Get White Label by ID", "description": "Gets the white label with the specified ID.", "operationId": "WhiteLabel_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/WhiteLabelModel" } } } } }, "/api/v2/whitelabel/{whiteLabelId}/Invoice": { "get": { "tags": [ "WhiteLabel" ], "summary": "Get Invoices", "description": "Get invoices for the specified business or white label.", "operationId": "Invoice_GetInvoices", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" }, { "name": "whiteLabelId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Nullable" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/InvoiceModel" }, "xml": { "name": "InvoiceModel", "wrapped": true }, "title": "IList" } } } } }, "/api/v2/business/{businessId}/Invoice": { "get": { "tags": [ "WhiteLabel" ], "summary": "Get Invoices", "description": "Get invoices for the specified business or white label.", "operationId": "Invoice_GetApiV2BusinessByBusinessIdInvoice", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Nullable" }, { "name": "whiteLabelId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/InvoiceModel" }, "xml": { "name": "InvoiceModel", "wrapped": true }, "title": "IList" } } } } }, "/api/v2/whitelabel/{whiteLabelId}/Invoice/{id}": { "get": { "tags": [ "WhiteLabel" ], "summary": "Get Invoice By ID", "description": "Gets the invoice with the specified ID.", "operationId": "Invoice_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" }, { "name": "whiteLabelId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Nullable" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/InvoiceModel" } } } } }, "/api/v2/business/{businessId}/Invoice/{id}": { "get": { "tags": [ "WhiteLabel" ], "summary": "Get Invoice By ID", "description": "Gets the invoice with the specified ID.", "operationId": "Invoice_GetApiV2BusinessByBusinessIdInvoiceById", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Nullable" }, { "name": "whiteLabelId", "in": "query", "required": false, "type": "integer", "format": "int32", "title": "Nullable" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/InvoiceModel" } } } } }, "/api/v2/business/{businessId}/worktype": { "get": { "tags": [ "WorkType" ], "summary": "List Work Types", "description": "Lists all the work types for the business.\n\nThis operation supports OData queries.", "operationId": "WorkType_GetWorkTypes", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/WorkTypeModel" }, "xml": { "name": "WorkTypeModel", "wrapped": true }, "title": "IEnumerable" } } } }, "post": { "tags": [ "WorkType" ], "summary": "Create Work Type", "description": "Creates a new work type for the business.", "operationId": "WorkType_Post", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "workType", "in": "body", "required": true, "schema": { "$ref": "#/definitions/WorkTypeModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } }, "/api/v2/business/{businessId}/worktype/{id}": { "get": { "tags": [ "WorkType" ], "summary": "Get Work Type by ID", "description": "Gets the work type with the specified ID.", "operationId": "WorkType_Get", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/WorkTypeModel" } } } }, "put": { "tags": [ "WorkType" ], "summary": "Update Work Type", "description": "Updates the work type with the specified ID.", "operationId": "WorkType_Put", "consumes": [ "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" ], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "workType", "in": "body", "required": true, "schema": { "$ref": "#/definitions/WorkTypeModel" } }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } }, "delete": { "tags": [ "WorkType" ], "summary": "Delete Work Type", "description": "Deletes the work type with the specified ID.", "operationId": "WorkType_Delete", "consumes": [], "produces": [ "application/json", "text/json", "application/xml", "text/xml" ], "parameters": [ { "name": "id", "in": "path", "required": true, "type": "integer", "format": "int32", "title": "Int32" }, { "name": "businessId", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK" } } } } }, "definitions": { "ODataQueryOptions[AbaDetails]": { "type": "object", "properties": { "ifMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "ifNoneMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "context": { "$ref": "#/definitions/ODataQueryContext", "readOnly": true }, "request": { "type": "object", "readOnly": true, "title": "HttpRequestMessage" }, "rawValues": { "$ref": "#/definitions/ODataRawQueryOptions", "readOnly": true }, "selectExpand": { "$ref": "#/definitions/SelectExpandQueryOption", "readOnly": true }, "filter": { "$ref": "#/definitions/FilterQueryOption", "readOnly": true }, "orderBy": { "$ref": "#/definitions/OrderByQueryOption", "readOnly": true }, "skip": { "$ref": "#/definitions/SkipQueryOption", "readOnly": true }, "top": { "$ref": "#/definitions/TopQueryOption", "readOnly": true }, "inlineCount": { "$ref": "#/definitions/InlineCountQueryOption", "readOnly": true }, "validator": { "$ref": "#/definitions/ODataQueryValidator" } }, "xml": { "name": "ODataQueryOptions`1" }, "title": "ODataQueryOptions" }, "ODataQueryContext": { "type": "object", "properties": { "model": { "$ref": "#/definitions/IEdmModel", "readOnly": true }, "elementType": { "$ref": "#/definitions/IEdmType", "readOnly": true }, "elementClrType": { "type": "string", "readOnly": true, "title": "Type" } }, "xml": { "name": "ODataQueryContext" }, "title": "ODataQueryContext" }, "ODataRawQueryOptions": { "type": "object", "properties": { "filter": { "type": "string", "readOnly": true, "title": "String" }, "orderBy": { "type": "string", "readOnly": true, "title": "String" }, "top": { "type": "string", "readOnly": true, "title": "String" }, "skip": { "type": "string", "readOnly": true, "title": "String" }, "select": { "type": "string", "readOnly": true, "title": "String" }, "expand": { "type": "string", "readOnly": true, "title": "String" }, "inlineCount": { "type": "string", "readOnly": true, "title": "String" }, "format": { "type": "string", "readOnly": true, "title": "String" }, "skipToken": { "type": "string", "readOnly": true, "title": "String" } }, "xml": { "name": "ODataRawQueryOptions" }, "title": "ODataRawQueryOptions" }, "SelectExpandQueryOption": { "type": "object", "properties": { "context": { "$ref": "#/definitions/ODataQueryContext", "readOnly": true }, "rawSelect": { "type": "string", "readOnly": true, "title": "String" }, "rawExpand": { "type": "string", "readOnly": true, "title": "String" }, "validator": { "$ref": "#/definitions/SelectExpandQueryValidator" }, "selectExpandClause": { "$ref": "#/definitions/SelectExpandClause", "readOnly": true } }, "xml": { "name": "SelectExpandQueryOption" }, "title": "SelectExpandQueryOption" }, "FilterQueryOption": { "type": "object", "properties": { "context": { "$ref": "#/definitions/ODataQueryContext", "readOnly": true }, "validator": { "$ref": "#/definitions/FilterQueryValidator" }, "filterClause": { "$ref": "#/definitions/FilterClause", "readOnly": true }, "rawValue": { "type": "string", "readOnly": true, "title": "String" } }, "xml": { "name": "FilterQueryOption" }, "title": "FilterQueryOption" }, "OrderByQueryOption": { "type": "object", "properties": { "context": { "$ref": "#/definitions/ODataQueryContext", "readOnly": true }, "orderByNodes": { "type": "array", "items": { "$ref": "#/definitions/OrderByNode" }, "readOnly": true, "xml": { "name": "OrderByNode", "wrapped": true }, "title": "IList" }, "rawValue": { "type": "string", "readOnly": true, "title": "String" }, "validator": { "$ref": "#/definitions/OrderByQueryValidator" }, "orderByClause": { "$ref": "#/definitions/OrderByClause", "readOnly": true } }, "xml": { "name": "OrderByQueryOption" }, "title": "OrderByQueryOption" }, "SkipQueryOption": { "type": "object", "properties": { "context": { "$ref": "#/definitions/ODataQueryContext", "readOnly": true }, "rawValue": { "type": "string", "readOnly": true, "title": "String" }, "value": { "format": "int32", "type": "integer", "readOnly": true, "title": "Int32" }, "validator": { "$ref": "#/definitions/SkipQueryValidator" } }, "xml": { "name": "SkipQueryOption" }, "title": "SkipQueryOption" }, "TopQueryOption": { "type": "object", "properties": { "context": { "$ref": "#/definitions/ODataQueryContext", "readOnly": true }, "rawValue": { "type": "string", "readOnly": true, "title": "String" }, "value": { "format": "int32", "type": "integer", "readOnly": true, "title": "Int32" }, "validator": { "$ref": "#/definitions/TopQueryValidator" } }, "xml": { "name": "TopQueryOption" }, "title": "TopQueryOption" }, "InlineCountQueryOption": { "type": "object", "properties": { "context": { "$ref": "#/definitions/ODataQueryContext", "readOnly": true }, "rawValue": { "type": "string", "readOnly": true, "title": "String" }, "value": { "enum": [ "None", "AllPages" ], "type": "string", "readOnly": true, "title": "InlineCountValue" } }, "xml": { "name": "InlineCountQueryOption" }, "title": "InlineCountQueryOption" }, "ODataQueryValidator": { "type": "object", "properties": {}, "xml": { "name": "ODataQueryValidator" }, "title": "ODataQueryValidator" }, "IEdmModel": { "type": "object", "properties": { "schemaElements": { "type": "array", "items": { "$ref": "#/definitions/IEdmSchemaElement" }, "readOnly": true, "xml": { "name": "IEdmSchemaElement", "wrapped": true }, "title": "IEnumerable" }, "vocabularyAnnotations": { "type": "array", "items": { "$ref": "#/definitions/IEdmVocabularyAnnotation" }, "readOnly": true, "xml": { "name": "IEdmVocabularyAnnotation", "wrapped": true }, "title": "IEnumerable" }, "referencedModels": { "type": "array", "items": { "$ref": "#/definitions/IEdmModel" }, "readOnly": true, "xml": { "name": "IEdmModel", "wrapped": true }, "title": "IEnumerable" }, "directValueAnnotationsManager": { "$ref": "#/definitions/IEdmDirectValueAnnotationsManager", "readOnly": true } }, "xml": { "name": "IEdmModel" }, "title": "IEdmModel" }, "IEdmType": { "type": "object", "properties": { "typeKind": { "enum": [ "None", "Primitive", "Entity", "Complex", "Row", "Collection", "EntityReference", "Enum" ], "type": "string", "readOnly": true, "title": "EdmTypeKind" } }, "xml": { "name": "IEdmType" }, "title": "IEdmType" }, "SelectExpandQueryValidator": { "type": "object", "properties": {}, "xml": { "name": "SelectExpandQueryValidator" }, "title": "SelectExpandQueryValidator" }, "SelectExpandClause": { "type": "object", "properties": { "selectedItems": { "type": "array", "items": { "$ref": "#/definitions/SelectItem" }, "readOnly": true, "xml": { "name": "SelectItem", "wrapped": true }, "title": "IEnumerable" }, "allSelected": { "type": "boolean", "readOnly": true, "title": "Boolean" } }, "xml": { "name": "SelectExpandClause" }, "title": "SelectExpandClause" }, "FilterQueryValidator": { "type": "object", "properties": {}, "xml": { "name": "FilterQueryValidator" }, "title": "FilterQueryValidator" }, "FilterClause": { "type": "object", "properties": { "expression": { "$ref": "#/definitions/SingleValueNode", "readOnly": true }, "rangeVariable": { "$ref": "#/definitions/RangeVariable", "readOnly": true }, "itemType": { "$ref": "#/definitions/IEdmTypeReference", "readOnly": true } }, "xml": { "name": "FilterClause" }, "title": "FilterClause" }, "OrderByNode": { "type": "object", "properties": { "direction": { "enum": [ "Ascending", "Descending" ], "type": "string", "readOnly": true, "title": "OrderByDirection" } }, "xml": { "name": "OrderByNode" }, "title": "OrderByNode" }, "OrderByQueryValidator": { "type": "object", "properties": {}, "xml": { "name": "OrderByQueryValidator" }, "title": "OrderByQueryValidator" }, "OrderByClause": { "type": "object", "properties": { "thenBy": { "$ref": "#/definitions/OrderByClause", "readOnly": true }, "expression": { "$ref": "#/definitions/SingleValueNode", "readOnly": true }, "direction": { "enum": [ "Ascending", "Descending" ], "type": "string", "readOnly": true, "title": "OrderByDirection" }, "rangeVariable": { "$ref": "#/definitions/RangeVariable", "readOnly": true }, "itemType": { "$ref": "#/definitions/IEdmTypeReference", "readOnly": true } }, "xml": { "name": "OrderByClause" }, "title": "OrderByClause" }, "SkipQueryValidator": { "type": "object", "properties": {}, "xml": { "name": "SkipQueryValidator" }, "title": "SkipQueryValidator" }, "TopQueryValidator": { "type": "object", "properties": {}, "xml": { "name": "TopQueryValidator" }, "title": "TopQueryValidator" }, "IEdmSchemaElement": { "type": "object", "properties": { "schemaElementKind": { "enum": [ "None", "TypeDefinition", "Function", "ValueTerm", "EntityContainer" ], "type": "string", "readOnly": true, "title": "EdmSchemaElementKind" }, "namespace": { "type": "string", "readOnly": true, "title": "String" }, "name": { "type": "string", "readOnly": true, "title": "String" } }, "xml": { "name": "IEdmSchemaElement" }, "title": "IEdmSchemaElement" }, "IEdmVocabularyAnnotation": { "type": "object", "properties": { "qualifier": { "type": "string", "readOnly": true, "title": "String" }, "term": { "$ref": "#/definitions/IEdmTerm", "readOnly": true }, "target": { "$ref": "#/definitions/IEdmVocabularyAnnotatable", "readOnly": true } }, "xml": { "name": "IEdmVocabularyAnnotation" }, "title": "IEdmVocabularyAnnotation" }, "IEdmDirectValueAnnotationsManager": { "type": "object", "properties": {}, "xml": { "name": "IEdmDirectValueAnnotationsManager" }, "title": "IEdmDirectValueAnnotationsManager" }, "SelectItem": { "type": "object", "properties": {}, "xml": { "name": "SelectItem" }, "title": "SelectItem" }, "SingleValueNode": { "type": "object", "properties": { "typeReference": { "$ref": "#/definitions/IEdmTypeReference", "readOnly": true }, "kind": { "enum": [ "None", "Constant", "Convert", "NonentityRangeVariableReference", "BinaryOperator", "UnaryOperator", "SingleValuePropertyAccess", "CollectionPropertyAccess", "SingleValueFunctionCall", "Any", "CollectionNavigationNode", "SingleNavigationNode", "SingleValueOpenPropertyAccess", "SingleEntityCast", "All", "EntityCollectionCast", "EntityRangeVariableReference", "SingleEntityFunctionCall", "CollectionFunctionCall", "EntityCollectionFunctionCall", "NamedFunctionParameter" ], "type": "string", "readOnly": true, "title": "QueryNodeKind" } }, "xml": { "name": "SingleValueNode" }, "title": "SingleValueNode" }, "RangeVariable": { "type": "object", "properties": { "name": { "type": "string", "readOnly": true, "title": "String" }, "typeReference": { "$ref": "#/definitions/IEdmTypeReference", "readOnly": true }, "kind": { "format": "int32", "type": "integer", "readOnly": true, "title": "Int32" } }, "xml": { "name": "RangeVariable" }, "title": "RangeVariable" }, "IEdmTypeReference": { "type": "object", "properties": { "isNullable": { "type": "boolean", "readOnly": true, "title": "Boolean" }, "definition": { "$ref": "#/definitions/IEdmType", "readOnly": true } }, "xml": { "name": "IEdmTypeReference" }, "title": "IEdmTypeReference" }, "IEdmTerm": { "type": "object", "properties": { "termKind": { "enum": [ "None", "Type", "Value" ], "type": "string", "readOnly": true, "title": "EdmTermKind" }, "schemaElementKind": { "enum": [ "None", "TypeDefinition", "Function", "ValueTerm", "EntityContainer" ], "type": "string", "readOnly": true, "title": "EdmSchemaElementKind" }, "namespace": { "type": "string", "readOnly": true, "title": "String" }, "name": { "type": "string", "readOnly": true, "title": "String" } }, "xml": { "name": "IEdmTerm" }, "title": "IEdmTerm" }, "IEdmVocabularyAnnotatable": { "type": "object", "properties": {}, "xml": { "name": "IEdmVocabularyAnnotatable" }, "title": "IEdmVocabularyAnnotatable" }, "BusinessAbaModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "bsb": { "type": "string", "title": "String" }, "accountNumber": { "type": "string", "title": "String" }, "accountName": { "type": "string", "title": "String" }, "financialInstitutionCode": { "type": "string", "title": "String" }, "lodgementReference": { "type": "string", "title": "String" }, "userName": { "type": "string", "title": "String" }, "userId": { "type": "string", "title": "String" }, "includeSelfBalancingTransaction": { "type": "boolean", "title": "Boolean" }, "mergeMultipleAccountPayments": { "type": "boolean", "title": "Boolean" }, "balanceLodgementReference": { "type": "string", "title": "String" }, "paymentAdditionalContent": { "enum": [ "None", "PeriodEndingDate", "PaymentDate", "EmployeeId" ], "type": "string", "title": "Nullable" }, "balanceAdditionalContent": { "enum": [ "None", "PeriodEndingDate", "PaymentDate", "PayRunId" ], "type": "string", "title": "Nullable" } }, "xml": { "name": "BusinessAbaModel" }, "title": "BusinessAbaModel" }, "SingleSignOnRequestModel": { "type": "object", "properties": { "businessId": { "format": "int32", "type": "integer", "title": "Nullable" }, "userName": { "type": "string", "title": "String" }, "url": { "type": "string", "title": "String" }, "navigation": { "enum": [ "Full", "Primary", "Secondary", "None" ], "type": "string", "title": "NavigationDisplayEnum" }, "hostName": { "type": "string", "title": "String" } }, "xml": { "name": "SingleSignOnRequestModel" }, "title": "SingleSignOnRequestModel" }, "SingleSignOnResponseModel": { "type": "object", "properties": { "url": { "type": "string", "title": "String" } }, "xml": { "name": "SingleSignOnResponseModel" }, "title": "SingleSignOnResponseModel" }, "TimesheetRoundingRulesModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "shiftStartRoundingDirection": { "enum": [ "None", "Up", "Down", "ToTheNearest" ], "type": "string", "title": "RoundingDirectionEnum" }, "shiftStartRoundingInterval": { "format": "int32", "type": "integer", "title": "Int32" }, "shiftEndRoundingDirection": { "enum": [ "None", "Up", "Down", "ToTheNearest" ], "type": "string", "title": "RoundingDirectionEnum" }, "shiftEndRoundingInterval": { "format": "int32", "type": "integer", "title": "Int32" }, "breakStartRoundingDirection": { "enum": [ "None", "Up", "Down", "ToTheNearest" ], "type": "string", "title": "RoundingDirectionEnum" }, "breakStartRoundingInterval": { "format": "int32", "type": "integer", "title": "Int32" }, "breakEndRoundingDirection": { "enum": [ "None", "Up", "Down", "ToTheNearest" ], "type": "string", "title": "RoundingDirectionEnum" }, "breakEndRoundingInterval": { "format": "int32", "type": "integer", "title": "Int32" }, "roundUpToShiftStartTimeRoundingInterval": { "format": "int32", "type": "integer", "title": "Nullable" }, "roundDownToShiftStartTimeRoundingInterval": { "format": "int32", "type": "integer", "title": "Nullable" }, "roundUpToShiftEndTimeRoundingInterval": { "format": "int32", "type": "integer", "title": "Nullable" }, "roundDownToShiftEndTimeRoundingInterval": { "format": "int32", "type": "integer", "title": "Nullable" } }, "xml": { "name": "TimesheetRoundingRulesModel" }, "title": "TimesheetRoundingRulesModel" }, "BusinessAtoSupplierModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "abn": { "type": "string", "title": "String" }, "name": { "type": "string", "title": "String" }, "addressLine1": { "type": "string", "title": "String" }, "addressLine2": { "type": "string", "title": "String" }, "suburb": { "type": "string", "title": "String" }, "state": { "type": "string", "title": "String" }, "postCode": { "type": "string", "title": "String" }, "contactName": { "type": "string", "title": "String" }, "signatoryName": { "type": "string", "title": "String" }, "phoneNumber": { "type": "string", "title": "String" }, "faxNumber": { "type": "string", "title": "String" }, "country": { "type": "string", "title": "String" }, "branch": { "type": "string", "title": "String" } }, "xml": { "name": "BusinessAtoSupplierModel" }, "title": "BusinessAtoSupplierModel" }, "EntitlementsModel": { "type": "object", "properties": { "planName": { "type": "string", "title": "String" }, "trialExpiryDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "features": { "type": "array", "items": { "$ref": "#/definitions/EntitlementFeatureModel" }, "xml": { "name": "EntitlementFeatureModel", "wrapped": true }, "title": "IList" } }, "xml": { "name": "EntitlementsModel" }, "title": "EntitlementsModel" }, "EntitlementFeatureModel": { "type": "object", "properties": { "name": { "type": "string", "title": "String" } }, "xml": { "name": "EntitlementFeatureModel" }, "title": "EntitlementFeatureModel" }, "DocumentModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "friendlyName": { "type": "string", "title": "String" }, "dateCreated": { "format": "date-time", "type": "string", "title": "DateTime" }, "visibleToAllEmployees": { "type": "boolean", "title": "Boolean" }, "selectedGroups": { "type": "array", "items": { "$ref": "#/definitions/EmployeeGroupItemModel" }, "xml": { "name": "EmployeeGroupItemModel", "wrapped": true }, "title": "List" } }, "xml": { "name": "DocumentModel" }, "title": "DocumentModel" }, "EmployeeGroupItemModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "name": { "type": "string", "title": "String" } }, "xml": { "name": "EmployeeGroupItemModel" }, "title": "EmployeeGroupItemModel" }, "UpdateDocumentPermissionsModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "visibleToAll": { "type": "boolean", "title": "Boolean" }, "employeeGroups": { "type": "array", "items": { "format": "int32", "type": "integer", "title": "Int32" }, "title": "List" } }, "xml": { "name": "UpdateDocumentPermissionsModel" }, "title": "UpdateDocumentPermissionsModel" }, "DocumentFile": { "type": "object", "properties": { "contentLength": { "format": "int64", "type": "integer", "title": "Int64" }, "contentType": { "type": "string", "title": "String" }, "bytes": { "format": "byte", "type": "string", "title": "Byte[]" }, "filename": { "type": "string", "title": "String" } }, "xml": { "name": "DocumentFile" }, "title": "DocumentFile" }, "ODataQueryOptions[Business]": { "type": "object", "properties": { "ifMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "ifNoneMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "context": { "$ref": "#/definitions/ODataQueryContext", "readOnly": true }, "request": { "type": "object", "readOnly": true, "title": "HttpRequestMessage" }, "rawValues": { "$ref": "#/definitions/ODataRawQueryOptions", "readOnly": true }, "selectExpand": { "$ref": "#/definitions/SelectExpandQueryOption", "readOnly": true }, "filter": { "$ref": "#/definitions/FilterQueryOption", "readOnly": true }, "orderBy": { "$ref": "#/definitions/OrderByQueryOption", "readOnly": true }, "skip": { "$ref": "#/definitions/SkipQueryOption", "readOnly": true }, "top": { "$ref": "#/definitions/TopQueryOption", "readOnly": true }, "inlineCount": { "$ref": "#/definitions/InlineCountQueryOption", "readOnly": true }, "validator": { "$ref": "#/definitions/ODataQueryValidator" } }, "xml": { "name": "ODataQueryOptions`1" }, "title": "ODataQueryOptions" }, "BusinessModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "name": { "type": "string", "title": "String" }, "abn": { "type": "string", "title": "String" }, "registrationNumber": { "type": "string", "title": "String" }, "legalName": { "type": "string", "title": "String" }, "contactName": { "type": "string", "title": "String" }, "contactEmailAddress": { "type": "string", "title": "String" }, "contactPhoneNumber": { "type": "string", "title": "String" }, "contactFaxNumber": { "type": "string", "title": "String" }, "externalId": { "type": "string", "title": "String" }, "standardHoursPerDay": { "format": "double", "type": "number", "title": "Decimal" }, "integratedTimesheetsEnabled": { "type": "boolean", "title": "Boolean" }, "journalService": { "type": "string", "title": "String" }, "endOfWeek": { "enum": [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], "type": "string", "title": "DayOfWeek" }, "initialFinancialYearStart": { "format": "int32", "type": "integer", "title": "Nullable" }, "managersCanEditRosterBudgets": { "type": "boolean", "title": "Nullable" }, "budgetWarningPercent": { "format": "double", "type": "number", "title": "Nullable" }, "budgetEntryMethod": { "enum": [ "PercentageOfSales", "Direct" ], "type": "string", "title": "BudgetEntryMethodEnum" }, "addressLine1": { "type": "string", "title": "String" }, "addressLine2": { "type": "string", "title": "String" }, "suburb": { "type": "string", "title": "String" }, "postCode": { "type": "string", "title": "String" }, "state": { "type": "string", "title": "String" }, "whiteLabelName": { "type": "string", "title": "String" }, "dateCreated": { "format": "date-time", "type": "string", "title": "DateTime" }, "city": { "type": "string", "title": "String" }, "county": { "type": "string", "title": "String" } }, "xml": { "name": "BusinessModel" }, "title": "BusinessModel" }, "BusinessAccessModel": { "type": "object", "properties": { "accessType": { "enum": [ "Unrestricted", "Restricted" ], "type": "string", "title": "RelatedUserType" }, "employeeGroups": { "type": "array", "items": { "$ref": "#/definitions/EmployeeGroupAccessModel" }, "xml": { "name": "EmployeeGroupAccessModel", "wrapped": true }, "title": "IList" }, "locationAccess": { "type": "array", "items": { "$ref": "#/definitions/LocationAccessModel" }, "xml": { "name": "LocationAccessModel", "wrapped": true }, "title": "IList" }, "reports": { "$ref": "#/definitions/ReportAccessModel" }, "name": { "type": "string", "title": "String" }, "email": { "type": "string", "title": "String" } }, "xml": { "name": "BusinessAccessModel" }, "title": "BusinessAccessModel" }, "EmployeeGroupAccessModel": { "type": "object", "properties": { "employeeGroupId": { "format": "int32", "type": "integer", "title": "Int32" }, "permissions": { "enum": [ "ApproveTimesheets", "ApproveLeaveRequests", "CreateTimesheets", "CreateLeaveRequests", "ViewLeaveRequests", "ManageRosters", "ViewRosters", "ViewShiftCosts", "ViewExpenses", "CreateExpenses", "ApproveExpenses", "CreateTasks" ], "type": "string", "title": "UserPermission" } }, "xml": { "name": "EmployeeGroupAccessModel" }, "title": "EmployeeGroupAccessModel" }, "LocationAccessModel": { "type": "object", "properties": { "filterType": { "enum": [ "Location", "LocationOrParents" ], "type": "string", "title": "LocationRestrictionFilterTypeEnum" }, "locationIds": { "type": "array", "items": { "format": "int32", "type": "integer", "title": "Int32" }, "title": "List" }, "permissions": { "enum": [ "ApproveTimesheets", "ApproveLeaveRequests", "CreateTimesheets", "CreateLeaveRequests", "ViewLeaveRequests", "ManageRosters", "ViewRosters", "ViewShiftCosts", "ViewExpenses", "CreateExpenses", "ApproveExpenses", "CreateTasks" ], "type": "string", "title": "UserPermission" } }, "xml": { "name": "LocationAccessModel" }, "title": "LocationAccessModel" }, "ReportAccessModel": { "type": "object", "properties": { "accessType": { "enum": [ "None", "AllReports", "SpecificReports" ], "type": "string", "title": "ReportAccessType" }, "specificReports": { "enum": [ "DetailedActivityReport", "PayRunComparisonReport", "SuperContributionsReport", "OrdinaryTimeEarningsReport", "DeductionsReport", "PayrollTaxReport", "PaygReport", "PayCategoriesReport", "PayRunAuditReport", "CostingReport", "TimesheetReport", "ExpensesReport", "PaymentHistoryReport", "LeaveBalancesReport", "LeaveLiabilityReport", "LeaveHistoryReport", "BirthdayReport", "EmployeeDetailsReport", "UnpaidEmployeesReport", "QualificationsReport", "EmployeeSatisfactionReport", "AttendanceReport", "EmergencyContactsReport", "EmployerLiabilitiesReport", "PayRunVarianceReport", "EmployeeDetailsAuditReport", "GrossToNetReport", "LiveView", "TasksReport", "ShiftSwappingReport" ], "type": "string", "title": "ReportEnum" } }, "xml": { "name": "ReportAccessModel" }, "title": "ReportAccessModel" }, "CreateBusinessAccessModel": { "type": "object", "properties": { "suppressNotificationEmails": { "type": "boolean", "title": "Boolean" }, "accessType": { "enum": [ "Unrestricted", "Restricted" ], "type": "string", "title": "RelatedUserType" }, "employeeGroups": { "type": "array", "items": { "$ref": "#/definitions/EmployeeGroupAccessModel" }, "xml": { "name": "EmployeeGroupAccessModel", "wrapped": true }, "title": "IList" }, "locationAccess": { "type": "array", "items": { "$ref": "#/definitions/LocationAccessModel" }, "xml": { "name": "LocationAccessModel", "wrapped": true }, "title": "IList" }, "reports": { "$ref": "#/definitions/ReportAccessModel" }, "name": { "type": "string", "title": "String" }, "email": { "type": "string", "title": "String" } }, "xml": { "name": "CreateBusinessAccessModel" }, "title": "CreateBusinessAccessModel" }, "AccessModel": { "type": "object", "properties": { "name": { "type": "string", "title": "String" }, "email": { "type": "string", "title": "String" } }, "xml": { "name": "AccessModel" }, "title": "AccessModel" }, "ODataQueryOptions[DeductionCategory]": { "type": "object", "properties": { "ifMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "ifNoneMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "context": { "$ref": "#/definitions/ODataQueryContext", "readOnly": true }, "request": { "type": "object", "readOnly": true, "title": "HttpRequestMessage" }, "rawValues": { "$ref": "#/definitions/ODataRawQueryOptions", "readOnly": true }, "selectExpand": { "$ref": "#/definitions/SelectExpandQueryOption", "readOnly": true }, "filter": { "$ref": "#/definitions/FilterQueryOption", "readOnly": true }, "orderBy": { "$ref": "#/definitions/OrderByQueryOption", "readOnly": true }, "skip": { "$ref": "#/definitions/SkipQueryOption", "readOnly": true }, "top": { "$ref": "#/definitions/TopQueryOption", "readOnly": true }, "inlineCount": { "$ref": "#/definitions/InlineCountQueryOption", "readOnly": true }, "validator": { "$ref": "#/definitions/ODataQueryValidator" } }, "xml": { "name": "ODataQueryOptions`1" }, "title": "ODataQueryOptions" }, "DeductionCategoryModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "name": { "type": "string", "title": "String" }, "taxExempt": { "type": "boolean", "title": "Boolean" }, "source": { "type": "string", "title": "String" }, "externalId": { "type": "string", "title": "String" }, "sgcCalculationImpact": { "enum": [ "None", "ReducesOTE", "ReducesOTEAndSGC" ], "type": "string", "title": "SGCCalculationImpactEnum" }, "paymentSummaryClassification": { "enum": [ "Default", "UnionOrProfessionalAssociationFees", "WorkplaceGiving" ], "type": "string", "title": "DeductionCategoryPaymentSummaryClassification" }, "expenseGeneralLedgerMappingCode": { "type": "string", "title": "String" }, "liabilityGeneralLedgerMappingCode": { "type": "string", "title": "String" } }, "xml": { "name": "DeductionCategoryModel" }, "title": "DeductionCategoryModel" }, "WorkTypeModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "name": { "type": "string", "title": "String" }, "payCategoryId": { "format": "int32", "type": "integer", "title": "Nullable" }, "leaveCategoryId": { "format": "int32", "type": "integer", "title": "Nullable" }, "externalId": { "type": "string", "title": "String" }, "source": { "type": "string", "title": "String" }, "accruesLeave": { "type": "boolean", "title": "Boolean" }, "employmentTypes": { "type": "array", "items": { "enum": [ "Unknown", "FullTime", "PartTime", "LabourHire", "SuperannuationIncomeStream", "Casual" ], "type": "string", "title": "EmploymentTypeEnum" }, "xml": { "name": "EmploymentTypeEnum", "wrapped": true }, "title": "IList" }, "mappingType": { "enum": [ "PayCategory", "LeaveCategory", "PrimaryPayCategory", "ShiftCondition" ], "type": "string", "title": "Nullable" }, "shortCode": { "type": "string", "title": "String" } }, "xml": { "name": "WorkTypeModel" }, "title": "WorkTypeModel" }, "ProfileImageMetadata": { "type": "object", "properties": { "contentType": { "type": "string", "title": "String" }, "extension": { "type": "string", "title": "String" }, "width": { "format": "int32", "type": "integer", "title": "Nullable" }, "height": { "format": "int32", "type": "integer", "title": "Nullable" } }, "xml": { "name": "ProfileImageMetadata" }, "title": "ProfileImageMetadata" }, "ODataQueryOptions[Employee]": { "type": "object", "properties": { "ifMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "ifNoneMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "context": { "$ref": "#/definitions/ODataQueryContext", "readOnly": true }, "request": { "type": "object", "readOnly": true, "title": "HttpRequestMessage" }, "rawValues": { "$ref": "#/definitions/ODataRawQueryOptions", "readOnly": true }, "selectExpand": { "$ref": "#/definitions/SelectExpandQueryOption", "readOnly": true }, "filter": { "$ref": "#/definitions/FilterQueryOption", "readOnly": true }, "orderBy": { "$ref": "#/definitions/OrderByQueryOption", "readOnly": true }, "skip": { "$ref": "#/definitions/SkipQueryOption", "readOnly": true }, "top": { "$ref": "#/definitions/TopQueryOption", "readOnly": true }, "inlineCount": { "$ref": "#/definitions/InlineCountQueryOption", "readOnly": true }, "validator": { "$ref": "#/definitions/ODataQueryValidator" } }, "xml": { "name": "ODataQueryOptions`1" }, "title": "ODataQueryOptions" }, "EmployeeDetailsModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "title": { "type": "string", "title": "String" }, "firstName": { "type": "string", "title": "String" }, "preferredName": { "type": "string", "title": "String" }, "middleName": { "type": "string", "title": "String" }, "surname": { "type": "string", "title": "String" }, "gender": { "type": "string", "title": "String" }, "dateOfBirth": { "format": "date-time", "type": "string", "title": "Nullable" }, "anniversaryDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "externalId": { "type": "string", "title": "String" }, "residentialStreetAddress": { "type": "string", "title": "String" }, "residentialAddressLine2": { "type": "string", "title": "String" }, "residentialSuburb": { "type": "string", "title": "String" }, "residentialState": { "type": "string", "title": "String" }, "residentialPostCode": { "type": "string", "title": "String" }, "postalStreetAddress": { "type": "string", "title": "String" }, "postalAddressLine2": { "type": "string", "title": "String" }, "postalSuburb": { "type": "string", "title": "String" }, "postalState": { "type": "string", "title": "String" }, "postalPostCode": { "type": "string", "title": "String" }, "emailAddress": { "type": "string", "title": "String" }, "homePhone": { "type": "string", "title": "String" }, "workPhone": { "type": "string", "title": "String" }, "mobilePhone": { "type": "string", "title": "String" }, "startDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "endDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "residentialCity": { "type": "string", "title": "String" }, "residentialCounty": { "type": "string", "title": "String" }, "postalCity": { "type": "string", "title": "String" }, "postalCounty": { "type": "string", "title": "String" } }, "xml": { "name": "EmployeeDetailsModel" }, "title": "EmployeeDetailsModel" }, "EmployeesFilter": { "type": "object", "properties": { "payScheduleId": { "format": "int32", "type": "integer", "title": "Nullable" }, "locationId": { "format": "int32", "type": "integer", "title": "Nullable" } }, "xml": { "name": "EmployeesFilter" }, "title": "EmployeesFilter" }, "ODataQueryOptions[UnstructuredEmployeeModel]": { "type": "object", "properties": { "ifMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "ifNoneMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "context": { "$ref": "#/definitions/ODataQueryContext", "readOnly": true }, "request": { "type": "object", "readOnly": true, "title": "HttpRequestMessage" }, "rawValues": { "$ref": "#/definitions/ODataRawQueryOptions", "readOnly": true }, "selectExpand": { "$ref": "#/definitions/SelectExpandQueryOption", "readOnly": true }, "filter": { "$ref": "#/definitions/FilterQueryOption", "readOnly": true }, "orderBy": { "$ref": "#/definitions/OrderByQueryOption", "readOnly": true }, "skip": { "$ref": "#/definitions/SkipQueryOption", "readOnly": true }, "top": { "$ref": "#/definitions/TopQueryOption", "readOnly": true }, "inlineCount": { "$ref": "#/definitions/InlineCountQueryOption", "readOnly": true }, "validator": { "$ref": "#/definitions/ODataQueryValidator" } }, "xml": { "name": "ODataQueryOptions`1" }, "title": "ODataQueryOptions" }, "UnstructuredEmployeeModel": { "type": "object", "properties": { "status": { "enum": [ "Active", "Terminated", "Incomplete" ], "type": "string", "title": "EmployeeStatusEnum" }, "dateCreated": { "format": "date-time", "type": "string", "title": "DateTime" }, "residentialCity": { "type": "string", "title": "String" }, "residentialCounty": { "type": "string", "title": "String" }, "postalCity": { "type": "string", "title": "String" }, "postalCounty": { "type": "string", "title": "String" }, "id": { "format": "int32", "type": "integer", "title": "Int32" }, "taxFileNumber": { "type": "string", "title": "String" }, "title": { "type": "string", "title": "String" }, "preferredName": { "type": "string", "title": "String" }, "firstName": { "type": "string", "title": "String" }, "middleName": { "type": "string", "title": "String" }, "surname": { "type": "string", "title": "String" }, "dateOfBirth": { "format": "date-time", "type": "string", "title": "Nullable" }, "gender": { "type": "string", "title": "String" }, "externalId": { "type": "string", "title": "String" }, "residentialStreetAddress": { "type": "string", "title": "String" }, "residentialAddressLine2": { "type": "string", "title": "String" }, "residentialSuburb": { "type": "string", "title": "String" }, "residentialState": { "type": "string", "title": "String" }, "residentialPostCode": { "type": "string", "title": "String" }, "postalStreetAddress": { "type": "string", "title": "String" }, "postalAddressLine2": { "type": "string", "title": "String" }, "postalSuburb": { "type": "string", "title": "String" }, "postalState": { "type": "string", "title": "String" }, "postalPostCode": { "type": "string", "title": "String" }, "emailAddress": { "type": "string", "title": "String" }, "homePhone": { "type": "string", "title": "String" }, "workPhone": { "type": "string", "title": "String" }, "mobilePhone": { "type": "string", "title": "String" }, "startDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "endDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "anniversaryDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "tags": { "type": "string", "title": "String" }, "employingEntityABN": { "type": "string", "title": "String" }, "employmentType": { "type": "string", "title": "String" }, "previousSurname": { "type": "string", "title": "String" }, "australianResident": { "type": "string", "title": "String" }, "claimTaxFreeThreshold": { "type": "string", "title": "String" }, "seniorsTaxOffset": { "type": "string", "title": "String" }, "otherTaxOffset": { "type": "string", "title": "String" }, "helpDebt": { "type": "string", "title": "String" }, "afsDebt": { "type": "string", "title": "String" }, "isExemptFromFloodLevy": { "type": "string", "title": "String" }, "hasApprovedWorkingHolidayVisa": { "type": "string", "title": "String" }, "hasWithholdingVariation": { "type": "string", "title": "String" }, "taxVariation": { "type": "string", "title": "String" }, "dateTaxFileDeclarationSigned": { "format": "date-time", "type": "string", "title": "Nullable" }, "dateTaxFileDeclarationReported": { "format": "date-time", "type": "string", "title": "Nullable" }, "jobTitle": { "type": "string", "title": "String" }, "paySchedule": { "type": "string", "title": "String" }, "primaryPayCategory": { "type": "string", "title": "String" }, "primaryLocation": { "type": "string", "title": "String" }, "paySlipNotificationType": { "type": "string", "title": "String" }, "rate": { "format": "double", "type": "number", "title": "Nullable" }, "overrideTemplateRate": { "type": "string", "title": "String" }, "rateUnit": { "type": "string", "title": "String" }, "hoursPerWeek": { "format": "double", "type": "number", "title": "Nullable" }, "automaticallyPayEmployee": { "type": "string", "title": "String" }, "leaveTemplate": { "type": "string", "title": "String" }, "payRateTemplate": { "type": "string", "title": "String" }, "payConditionRuleSet": { "type": "string", "title": "String" }, "employmentAgreement": { "type": "string", "title": "String" }, "isEnabledForTimesheets": { "type": "string", "title": "String" }, "isExemptFromPayrollTax": { "type": "string", "title": "String" }, "locations": { "type": "string", "title": "String" }, "workTypes": { "type": "string", "title": "String" }, "emergencyContact1_Name": { "type": "string", "title": "String" }, "emergencyContact1_Relationship": { "type": "string", "title": "String" }, "emergencyContact1_Address": { "type": "string", "title": "String" }, "emergencyContact1_ContactNumber": { "type": "string", "title": "String" }, "emergencyContact1_AlternateContactNumber": { "type": "string", "title": "String" }, "emergencyContact2_Name": { "type": "string", "title": "String" }, "emergencyContact2_Relationship": { "type": "string", "title": "String" }, "emergencyContact2_Address": { "type": "string", "title": "String" }, "emergencyContact2_ContactNumber": { "type": "string", "title": "String" }, "emergencyContact2_AlternateContactNumber": { "type": "string", "title": "String" }, "bankAccount1_BSB": { "type": "string", "title": "String" }, "bankAccount1_AccountNumber": { "type": "string", "title": "String" }, "bankAccount1_AccountName": { "type": "string", "title": "String" }, "bankAccount1_AllocatedPercentage": { "format": "double", "type": "number", "title": "Nullable" }, "bankAccount1_FixedAmount": { "format": "double", "type": "number", "title": "Nullable" }, "bankAccount2_BSB": { "type": "string", "title": "String" }, "bankAccount2_AccountNumber": { "type": "string", "title": "String" }, "bankAccount2_AccountName": { "type": "string", "title": "String" }, "bankAccount2_AllocatedPercentage": { "format": "double", "type": "number", "title": "Nullable" }, "bankAccount2_FixedAmount": { "format": "double", "type": "number", "title": "Nullable" }, "bankAccount3_BSB": { "type": "string", "title": "String" }, "bankAccount3_AccountNumber": { "type": "string", "title": "String" }, "bankAccount3_AccountName": { "type": "string", "title": "String" }, "bankAccount3_AllocatedPercentage": { "format": "double", "type": "number", "title": "Nullable" }, "bankAccount3_FixedAmount": { "format": "double", "type": "number", "title": "Nullable" }, "superFund1_ProductCode": { "type": "string", "title": "String" }, "superFund1_FundName": { "type": "string", "title": "String" }, "superFund1_MemberNumber": { "type": "string", "title": "String" }, "superFund1_AllocatedPercentage": { "format": "double", "type": "number", "title": "Nullable" }, "superFund1_FixedAmount": { "format": "double", "type": "number", "title": "Nullable" }, "superFund2_ProductCode": { "type": "string", "title": "String" }, "superFund2_FundName": { "type": "string", "title": "String" }, "superFund2_MemberNumber": { "type": "string", "title": "String" }, "superFund2_AllocatedPercentage": { "format": "double", "type": "number", "title": "Nullable" }, "superFund2_FixedAmount": { "format": "double", "type": "number", "title": "Nullable" }, "superFund3_ProductCode": { "type": "string", "title": "String" }, "superFund3_FundName": { "type": "string", "title": "String" }, "superFund3_MemberNumber": { "type": "string", "title": "String" }, "superFund3_AllocatedPercentage": { "format": "double", "type": "number", "title": "Nullable" }, "superFund3_FixedAmount": { "format": "double", "type": "number", "title": "Nullable" }, "superThresholdAmount": { "format": "double", "type": "number", "title": "Nullable" }, "maximumQuarterlySuperContributionsBase": { "format": "double", "type": "number", "title": "Nullable" }, "rosteringNotificationChoices": { "type": "string", "title": "String" }, "medicareLevyExemption": { "type": "string", "title": "String" } }, "xml": { "name": "UnstructuredEmployeeModel" }, "title": "UnstructuredEmployeeModel" }, "LeaveBalanceModel": { "type": "object", "properties": { "leaveCategoryId": { "format": "int32", "type": "integer", "title": "Int32" }, "leaveCategoryName": { "type": "string", "title": "String" }, "accruedAmount": { "format": "double", "type": "number", "title": "Decimal" } }, "xml": { "name": "LeaveBalanceModel" }, "title": "LeaveBalanceModel" }, "EmployeeNoteModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "user": { "type": "string", "title": "String" }, "dateTime": { "format": "date-time", "type": "string", "title": "DateTime" }, "note": { "type": "string", "title": "String" } }, "xml": { "name": "EmployeeNoteModel" }, "title": "EmployeeNoteModel" }, "CreateEmployeeNoteModel": { "type": "object", "properties": { "note": { "type": "string", "title": "String" } }, "xml": { "name": "CreateEmployeeNoteModel" }, "title": "CreateEmployeeNoteModel" }, "EmployeePayRateModel": { "type": "object", "properties": { "payCategoryId": { "format": "int32", "type": "integer", "title": "Int32" }, "payCategoryName": { "type": "string", "title": "String" }, "isPrimaryPayCategory": { "type": "boolean", "title": "Boolean" }, "accruesLeave": { "type": "boolean", "title": "Boolean" }, "rateUnit": { "type": "string", "title": "String" }, "rate": { "format": "double", "type": "number", "title": "Decimal" }, "calculatedRate": { "format": "double", "type": "number", "title": "Decimal" }, "hasSuperRateOverride": { "type": "boolean", "title": "Boolean" }, "superRate": { "format": "double", "type": "number", "title": "Nullable" } }, "xml": { "name": "EmployeePayRateModel" }, "title": "EmployeePayRateModel" }, "OpeningBalancesEditModel": { "type": "object", "properties": { "employeeId": { "format": "int32", "type": "integer", "title": "Nullable" }, "totalHours": { "format": "double", "type": "number", "title": "Nullable" }, "grossEarnings": { "format": "double", "type": "number", "title": "Nullable" }, "paygWithholdingAmount": { "format": "double", "type": "number", "title": "Nullable" }, "sfssAmount": { "format": "double", "type": "number", "title": "Nullable" }, "helpAmount": { "format": "double", "type": "number", "title": "Nullable" }, "superContribution": { "format": "double", "type": "number", "title": "Nullable" }, "employerContribution": { "format": "double", "type": "number", "title": "Nullable" }, "leaveBalances": { "type": "array", "items": { "$ref": "#/definitions/InitialLeaveBalanceModel" }, "xml": { "name": "InitialLeaveBalanceModel", "wrapped": true }, "title": "IList" }, "earningsLines": { "type": "array", "items": { "$ref": "#/definitions/InitialEarningsModel" }, "xml": { "name": "InitialEarningsModel", "wrapped": true }, "title": "IList" }, "deductions": { "type": "array", "items": { "$ref": "#/definitions/InitialDeductionModel" }, "xml": { "name": "InitialDeductionModel", "wrapped": true }, "title": "List" }, "employerLiabilities": { "type": "array", "items": { "$ref": "#/definitions/InitialEmployerLiabilityModel" }, "xml": { "name": "InitialEmployerLiabilityModel", "wrapped": true }, "title": "List" }, "etpTypeR": { "$ref": "#/definitions/OpeningBalancesEtpModel" }, "etpTypeO": { "$ref": "#/definitions/OpeningBalancesEtpModel" }, "financialYearStartingYear": { "format": "int32", "type": "integer", "title": "Nullable" }, "locationName": { "type": "string", "title": "String" } }, "xml": { "name": "OpeningBalancesEditModel" }, "title": "OpeningBalancesEditModel" }, "InitialLeaveBalanceModel": { "type": "object", "properties": { "leaveCategoryId": { "format": "int32", "type": "integer", "title": "Int32" }, "name": { "type": "string", "title": "String" }, "amount": { "format": "double", "type": "number", "title": "Decimal" } }, "xml": { "name": "InitialLeaveBalanceModel" }, "title": "InitialLeaveBalanceModel" }, "InitialEarningsModel": { "type": "object", "properties": { "payCategoryId": { "format": "int32", "type": "integer", "title": "Int32" }, "isStandardPayCategory": { "type": "boolean", "title": "Boolean" }, "payCategoryType": { "enum": [ "Standard", "LeaveLoading", "GenuineRedundancyLeavePayment", "OpeningBalanceAllowances", "EtpTypeRTaxable", "EtpTypeRTaxFree", "EtpTypeOTaxable", "EtpTypeOTaxFree", "EtpLumpSumD" ], "type": "string", "title": "PayCategoryType" }, "name": { "type": "string", "title": "String" }, "amount": { "format": "double", "type": "number", "title": "Decimal" } }, "xml": { "name": "InitialEarningsModel" }, "title": "InitialEarningsModel" }, "InitialDeductionModel": { "type": "object", "properties": { "deductionCategoryId": { "format": "int32", "type": "integer", "title": "Int32" }, "name": { "type": "string", "title": "String" }, "amount": { "format": "double", "type": "number", "title": "Decimal" }, "isRESC": { "type": "boolean", "title": "Boolean" }, "taxExempt": { "type": "boolean", "title": "Boolean" }, "isMemberVoluntary": { "type": "boolean", "title": "Boolean" } }, "xml": { "name": "InitialDeductionModel" }, "title": "InitialDeductionModel" }, "InitialEmployerLiabilityModel": { "type": "object", "properties": { "employerLiabilityCategoryId": { "format": "int32", "type": "integer", "title": "Int32" }, "name": { "type": "string", "title": "String" }, "amount": { "format": "double", "type": "number", "title": "Decimal" } }, "xml": { "name": "InitialEmployerLiabilityModel" }, "title": "InitialEmployerLiabilityModel" }, "OpeningBalancesEtpModel": { "type": "object", "properties": { "taxFreeComponent": { "format": "double", "type": "number", "title": "Nullable" }, "taxableComponent": { "format": "double", "type": "number", "title": "Nullable" }, "taxWithheld": { "format": "double", "type": "number", "title": "Nullable" }, "lumpSumD": { "format": "double", "type": "number", "title": "Nullable" }, "isAmended": { "type": "boolean", "title": "Boolean" }, "paymentDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "generatePaymentSummary": { "type": "boolean", "title": "Boolean" } }, "xml": { "name": "OpeningBalancesEtpModel" }, "title": "OpeningBalancesEtpModel" }, "EmployeeAccessModel": { "type": "object", "properties": { "name": { "type": "string", "title": "String" }, "email": { "type": "string", "title": "String" } }, "xml": { "name": "EmployeeAccessModel" }, "title": "EmployeeAccessModel" }, "CreateEmployeeAccessModel": { "type": "object", "properties": { "suppressNotificationEmails": { "type": "boolean", "title": "Boolean" }, "name": { "type": "string", "title": "String" }, "email": { "type": "string", "title": "String" } }, "xml": { "name": "CreateEmployeeAccessModel" }, "title": "CreateEmployeeAccessModel" }, "BankAccountModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "bsb": { "type": "string", "title": "String" }, "accountName": { "type": "string", "title": "String" }, "accountNumber": { "type": "string", "title": "String" }, "allocatedPercentage": { "format": "double", "type": "number", "title": "Nullable" }, "fixedAmount": { "format": "double", "type": "number", "title": "Nullable" }, "allocateBalance": { "type": "boolean", "title": "Boolean" }, "isEmployeeEditable": { "type": "boolean", "title": "Boolean" }, "canBeDeleted": { "type": "boolean", "title": "Boolean" }, "accountType": { "enum": [ "Electronic", "ManualDeposit", "CashOrCheque", "Bpay" ], "type": "string", "title": "BankAccountTypeEnum" }, "externalReferenceId": { "type": "string", "title": "String" } }, "xml": { "name": "BankAccountModel" }, "title": "BankAccountModel" }, "SaveBankAccountResponseModel": { "type": "object", "properties": { "validationWarning": { "type": "string", "title": "String" }, "result": { "$ref": "#/definitions/BankAccountModel" } }, "xml": { "name": "SaveBankAccountResponseModel" }, "title": "SaveBankAccountResponseModel" }, "EmployeeDocumentModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "friendlyName": { "type": "string", "title": "String" }, "dateCreated": { "format": "date-time", "type": "string", "title": "DateTime" }, "visible": { "type": "boolean", "title": "Boolean" }, "leaveRequestId": { "format": "int32", "type": "integer", "title": "Nullable" }, "timesheetLineId": { "format": "int32", "type": "integer", "title": "Nullable" } }, "xml": { "name": "EmployeeDocumentModel" }, "title": "EmployeeDocumentModel" }, "UpdateEmployeeDocumentPermissionsModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "visible": { "type": "boolean", "title": "Boolean" } }, "xml": { "name": "UpdateEmployeeDocumentPermissionsModel" }, "title": "UpdateEmployeeDocumentPermissionsModel" }, "ODataQueryOptions[EmployeeExpenseCategory]": { "type": "object", "properties": { "ifMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "ifNoneMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "context": { "$ref": "#/definitions/ODataQueryContext", "readOnly": true }, "request": { "type": "object", "readOnly": true, "title": "HttpRequestMessage" }, "rawValues": { "$ref": "#/definitions/ODataRawQueryOptions", "readOnly": true }, "selectExpand": { "$ref": "#/definitions/SelectExpandQueryOption", "readOnly": true }, "filter": { "$ref": "#/definitions/FilterQueryOption", "readOnly": true }, "orderBy": { "$ref": "#/definitions/OrderByQueryOption", "readOnly": true }, "skip": { "$ref": "#/definitions/SkipQueryOption", "readOnly": true }, "top": { "$ref": "#/definitions/TopQueryOption", "readOnly": true }, "inlineCount": { "$ref": "#/definitions/InlineCountQueryOption", "readOnly": true }, "validator": { "$ref": "#/definitions/ODataQueryValidator" } }, "xml": { "name": "ODataQueryOptions`1" }, "title": "ODataQueryOptions" }, "EmployeeExpenseCategoryModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "name": { "type": "string", "title": "String" }, "externalId": { "type": "string", "title": "String" }, "generalLedgerMappingCode": { "type": "string", "title": "String" }, "description": { "type": "string", "title": "String" }, "externalReferenceId": { "type": "string", "title": "String" }, "externalTaxCodeId": { "type": "string", "title": "String" }, "taxCode": { "type": "string", "title": "String" }, "taxRate": { "format": "double", "type": "number", "title": "Nullable" } }, "xml": { "name": "EmployeeExpenseCategoryModel" }, "title": "EmployeeExpenseCategoryModel" }, "JournalServiceTaxCode": { "type": "object", "properties": { "id": { "type": "string", "title": "String" }, "name": { "type": "string", "title": "String" }, "taxRate": { "format": "double", "type": "number", "title": "Decimal" } }, "xml": { "name": "JournalServiceTaxCode" }, "title": "JournalServiceTaxCode" }, "ODataQueryOptions[EmployeeExpenseRequest]": { "type": "object", "properties": { "ifMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "ifNoneMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "context": { "$ref": "#/definitions/ODataQueryContext", "readOnly": true }, "request": { "type": "object", "readOnly": true, "title": "HttpRequestMessage" }, "rawValues": { "$ref": "#/definitions/ODataRawQueryOptions", "readOnly": true }, "selectExpand": { "$ref": "#/definitions/SelectExpandQueryOption", "readOnly": true }, "filter": { "$ref": "#/definitions/FilterQueryOption", "readOnly": true }, "orderBy": { "$ref": "#/definitions/OrderByQueryOption", "readOnly": true }, "skip": { "$ref": "#/definitions/SkipQueryOption", "readOnly": true }, "top": { "$ref": "#/definitions/TopQueryOption", "readOnly": true }, "inlineCount": { "$ref": "#/definitions/InlineCountQueryOption", "readOnly": true }, "validator": { "$ref": "#/definitions/ODataQueryValidator" } }, "xml": { "name": "ODataQueryOptions`1" }, "title": "ODataQueryOptions" }, "ExpenseRequestResponseModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "employeeName": { "type": "string", "title": "String" }, "status": { "type": "string", "title": "String" }, "description": { "type": "string", "title": "String" }, "lineItems": { "type": "array", "items": { "$ref": "#/definitions/ExpenseRequestLineItemModel" }, "xml": { "name": "ExpenseRequestLineItemModel", "wrapped": true }, "title": "List" }, "attachments": { "type": "array", "items": { "$ref": "#/definitions/AttachmentModel" }, "xml": { "name": "AttachmentModel", "wrapped": true }, "title": "List" }, "statusUpdatedByUser": { "type": "string", "title": "String" }, "statusUpdateNotes": { "type": "string", "title": "String" }, "dateStatusUpdated": { "format": "date-time", "type": "string", "title": "DateTime" } }, "xml": { "name": "ExpenseRequestResponseModel" }, "title": "ExpenseRequestResponseModel" }, "ExpenseRequestLineItemModel": { "type": "object", "properties": { "expenseCategoryName": { "type": "string", "title": "String" }, "locationName": { "type": "string", "title": "String" }, "id": { "format": "int32", "type": "integer", "title": "Nullable" }, "expenseCategoryId": { "format": "int32", "type": "integer", "title": "Int32" }, "locationId": { "format": "int32", "type": "integer", "title": "Nullable" }, "notes": { "type": "string", "title": "String" }, "taxCode": { "type": "string", "title": "String" }, "taxCodeDisplayName": { "type": "string", "title": "String" }, "taxRate": { "format": "double", "type": "number", "title": "Nullable" }, "amount": { "format": "double", "type": "number", "title": "Decimal" }, "dateIncurred": { "format": "date-time", "type": "string", "title": "DateTime" } }, "xml": { "name": "ExpenseRequestLineItemModel" }, "title": "ExpenseRequestLineItemModel" }, "AttachmentModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Nullable" }, "friendlyName": { "type": "string", "title": "String" }, "dateCreated": { "format": "date-time", "type": "string", "title": "Nullable" }, "url": { "type": "string", "title": "String" } }, "xml": { "name": "AttachmentModel" }, "title": "AttachmentModel" }, "ExpenseRequestEditModel": { "required": [ "employeeId" ], "type": "object", "properties": { "attachments": { "type": "array", "items": { "$ref": "#/definitions/AttachmentModel" }, "xml": { "name": "AttachmentModel", "wrapped": true }, "title": "List" }, "id": { "format": "int32", "type": "integer", "title": "Int32" }, "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "description": { "maxLength": 255, "type": "string", "title": "String" }, "lineItems": { "type": "array", "items": { "$ref": "#/definitions/ExpenseRequestEditLineItemModel" }, "xml": { "name": "ExpenseRequestEditLineItemModel", "wrapped": true }, "title": "List" } }, "xml": { "name": "ExpenseRequestEditModel" }, "title": "ExpenseRequestEditModel" }, "ExpenseRequestEditLineItemModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Nullable" }, "expenseCategoryId": { "format": "int32", "type": "integer", "title": "Int32" }, "locationId": { "format": "int32", "type": "integer", "title": "Nullable" }, "notes": { "type": "string", "title": "String" }, "taxCode": { "type": "string", "title": "String" }, "taxCodeDisplayName": { "type": "string", "title": "String" }, "taxRate": { "format": "double", "type": "number", "title": "Nullable" }, "amount": { "format": "double", "type": "number", "title": "Decimal" }, "dateIncurred": { "format": "date-time", "type": "string", "title": "DateTime" } }, "xml": { "name": "ExpenseRequestEditLineItemModel" }, "title": "ExpenseRequestEditLineItemModel" }, "EmployeeGroupModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "name": { "type": "string", "title": "String" }, "filterCombinationStrategy": { "enum": [ "Or", "And" ], "type": "string", "title": "FilterCombinationStrategyEnum" }, "filters": { "type": "array", "items": { "$ref": "#/definitions/EmployeeFilterModel" }, "xml": { "name": "EmployeeFilterModel", "wrapped": true }, "title": "IList" } }, "xml": { "name": "EmployeeGroupModel" }, "title": "EmployeeGroupModel" }, "EmployeeFilterModel": { "type": "object", "properties": { "filterType": { "enum": [ "Location", "LocationOrParents", "Employee", "PaySchedule", "EmploymentType", "EmployingEntity", "Tag" ], "type": "string", "title": "FilterTypeEnum" }, "operator": { "enum": [ "In", "NotIn" ], "type": "string", "title": "FilterOperatorEnum" }, "value": { "type": "string", "title": "String" } }, "xml": { "name": "EmployeeFilterModel" }, "title": "EmployeeFilterModel" }, "DetailedEmployeeGroupModel": { "type": "object", "properties": { "matchingEmployees": { "type": "array", "items": { "$ref": "#/definitions/MatchingEmployeeModel" }, "xml": { "name": "MatchingEmployeeModel", "wrapped": true }, "title": "IList" }, "id": { "format": "int32", "type": "integer", "title": "Int32" }, "name": { "type": "string", "title": "String" }, "filterCombinationStrategy": { "enum": [ "Or", "And" ], "type": "string", "title": "FilterCombinationStrategyEnum" }, "filters": { "type": "array", "items": { "$ref": "#/definitions/EmployeeFilterModel" }, "xml": { "name": "EmployeeFilterModel", "wrapped": true }, "title": "IList" } }, "xml": { "name": "DetailedEmployeeGroupModel" }, "title": "DetailedEmployeeGroupModel" }, "MatchingEmployeeModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "externalId": { "type": "string", "title": "String" }, "name": { "type": "string", "title": "String" } }, "xml": { "name": "MatchingEmployeeModel" }, "title": "MatchingEmployeeModel" }, "EmployeeQualificationDocumentModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "name": { "type": "string", "title": "String" }, "dateCreated": { "format": "date-time", "type": "string", "title": "DateTime" }, "visible": { "type": "boolean", "title": "Boolean" } }, "xml": { "name": "EmployeeQualificationDocumentModel" }, "title": "EmployeeQualificationDocumentModel" }, "EmployeeQualificationModel": { "type": "object", "properties": { "qualificationId": { "format": "int32", "type": "integer", "title": "Int32" }, "name": { "type": "string", "title": "String" }, "expiryDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "documents": { "type": "array", "items": { "$ref": "#/definitions/EmployeeQualificationDocumentModel" }, "xml": { "name": "EmployeeQualificationDocumentModel", "wrapped": true }, "title": "IList" }, "referenceNumber": { "type": "string", "title": "String" } }, "xml": { "name": "EmployeeQualificationModel" }, "title": "EmployeeQualificationModel" }, "EmployeeRecurringTaxAdjustmentModel": { "type": "object", "properties": { "adjustmentType": { "enum": [ "Fixed", "PercentageGross", "PercentageTaxableEarnings" ], "type": "string", "title": "TaxAdjustmentTypeEnum" }, "id": { "format": "int32", "type": "integer", "title": "Nullable" }, "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "amount": { "format": "double", "type": "number", "title": "Decimal" }, "expiryDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "fromDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "maximumAmountPaid": { "format": "double", "type": "number", "title": "Nullable" }, "totalAmountPaid": { "format": "double", "type": "number", "title": "Decimal" }, "isActive": { "type": "boolean", "title": "Boolean" }, "notes": { "type": "string", "title": "String" } }, "xml": { "name": "EmployeeRecurringTaxAdjustmentModel" }, "title": "EmployeeRecurringTaxAdjustmentModel" }, "EmployeeRecurringSuperAdjustmentModel": { "type": "object", "properties": { "contributionType": { "enum": [ "SuperGuarantee", "SalarySacrifice", "MemberVoluntary", "EmployerContribution" ], "type": "string", "title": "SuperContributionType" }, "adjustmentType": { "enum": [ "Fixed", "PercentageGross", "PercentageOTE", "PercentageTaxableEarnings" ], "type": "string", "title": "SuperAdjustmentTypeEnum" }, "id": { "format": "int32", "type": "integer", "title": "Nullable" }, "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "amount": { "format": "double", "type": "number", "title": "Decimal" }, "expiryDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "fromDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "maximumAmountPaid": { "format": "double", "type": "number", "title": "Nullable" }, "totalAmountPaid": { "format": "double", "type": "number", "title": "Decimal" }, "isActive": { "type": "boolean", "title": "Boolean" }, "notes": { "type": "string", "title": "String" } }, "xml": { "name": "EmployeeRecurringSuperAdjustmentModel" }, "title": "EmployeeRecurringSuperAdjustmentModel" }, "EmployerRecurringLiabilityModel": { "type": "object", "properties": { "employerLiabilityCategoryName": { "type": "string", "title": "String" }, "employerLiabilityCategoryId": { "format": "int32", "type": "integer", "title": "Int32" }, "liabilityType": { "enum": [ "Fixed", "PercentageGross", "PercentageOTE" ], "type": "string", "title": "EmployerRecurringLiabilityTypeEnum" }, "externalReferenceId": { "type": "string", "title": "String" }, "source": { "enum": [ "None", "Saasu", "Xero", "MYOB", "Deputy", "EmployeeTimePunch", "ClickSuper", "IntegratedTimesheets", "FileImport", "FileExport", "QuickBooks", "Harmony", "AwardStore", "Attache", "IntegratedRostering", "ReckonAccounts", "API", "MicroPower", "RosterLive", "NetSuite", "Kounta", "TimeAndAttendanceKiosk", "DetailedFileExport", "JonasPremier", "WageEasy", "Maestrano", "WorkZone", "EmployeePortal", "RosterTemplate", "Onboarding", "Admin", "WorkZoneClockOnOff" ], "type": "string", "title": "ExternalService" }, "id": { "format": "int32", "type": "integer", "title": "Nullable" }, "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "amount": { "format": "double", "type": "number", "title": "Decimal" }, "expiryDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "fromDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "maximumAmountPaid": { "format": "double", "type": "number", "title": "Nullable" }, "totalAmountPaid": { "format": "double", "type": "number", "title": "Decimal" }, "isActive": { "type": "boolean", "title": "Boolean" }, "notes": { "type": "string", "title": "String" } }, "xml": { "name": "EmployerRecurringLiabilityModel" }, "title": "EmployerRecurringLiabilityModel" }, "EmployeeRecurringDeductionModel": { "type": "object", "properties": { "name": { "type": "string", "title": "String" }, "deductionCategoryId": { "format": "int32", "type": "integer", "title": "Int32" }, "paidTo": { "enum": [ "Manual", "BankAccount", "SuperFund", "Bpay" ], "type": "string", "title": "EmployeeRecurringDeductionPaidToEnum" }, "paidToAccountId": { "format": "int32", "type": "integer", "title": "Int32" }, "externalReferenceId": { "type": "string", "title": "String" }, "preservedEarningsAmountNotReachedAction": { "enum": [ "DoNotPay", "PayToLimit" ], "type": "string", "title": "DeductionAmountNotReachedEnum" }, "carryForwardUnpaidDeductions": { "type": "boolean", "title": "Boolean" }, "carryForwardAmount": { "format": "double", "type": "number", "title": "Decimal" }, "paymentReference": { "type": "string", "title": "String" }, "deductionType": { "enum": [ "NotSet", "Fixed", "PercentageGross", "PercentageOTE" ], "type": "string", "title": "DeductionTypeEnum" }, "preservedEarnings": { "type": "boolean", "title": "Boolean" }, "preservedEarningsAmount": { "format": "double", "type": "number", "title": "Decimal" }, "id": { "format": "int32", "type": "integer", "title": "Nullable" }, "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "amount": { "format": "double", "type": "number", "title": "Decimal" }, "expiryDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "fromDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "maximumAmountPaid": { "format": "double", "type": "number", "title": "Nullable" }, "totalAmountPaid": { "format": "double", "type": "number", "title": "Decimal" }, "isActive": { "type": "boolean", "title": "Boolean" }, "notes": { "type": "string", "title": "String" } }, "xml": { "name": "EmployeeRecurringDeductionModel" }, "title": "EmployeeRecurringDeductionModel" }, "EmployeeRecurringExpenseModel": { "type": "object", "properties": { "name": { "type": "string", "title": "String" }, "expenseCategoryId": { "format": "int32", "type": "integer", "title": "Int32" }, "locationId": { "format": "int32", "type": "integer", "title": "Int32" }, "taxCode": { "type": "string", "title": "String" }, "taxCodeDisplayName": { "type": "string", "title": "String" }, "taxRate": { "format": "double", "type": "number", "title": "Nullable" }, "id": { "format": "int32", "type": "integer", "title": "Nullable" }, "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "amount": { "format": "double", "type": "number", "title": "Decimal" }, "expiryDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "fromDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "maximumAmountPaid": { "format": "double", "type": "number", "title": "Nullable" }, "totalAmountPaid": { "format": "double", "type": "number", "title": "Decimal" }, "isActive": { "type": "boolean", "title": "Boolean" }, "notes": { "type": "string", "title": "String" } }, "xml": { "name": "EmployeeRecurringExpenseModel" }, "title": "EmployeeRecurringExpenseModel" }, "SuperFundModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "name": { "type": "string", "title": "String" }, "memberNumber": { "type": "string", "title": "String" }, "allocatedPercentage": { "format": "double", "type": "number", "title": "Nullable" }, "fixedAmount": { "format": "double", "type": "number", "title": "Nullable" }, "superProduct": { "$ref": "#/definitions/SuperProductModel" }, "allocateBalance": { "type": "boolean", "title": "Boolean" }, "canBeDeleted": { "type": "boolean", "title": "Boolean" } }, "xml": { "name": "SuperFundModel" }, "title": "SuperFundModel" }, "SuperProductModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "abn": { "type": "string", "title": "String" }, "productCode": { "type": "string", "title": "String" }, "productType": { "type": "string", "title": "String" }, "businessName": { "type": "string", "title": "String" }, "displayName": { "type": "string", "title": "String" }, "productName": { "type": "string", "title": "String" }, "accountNumber": { "type": "string", "title": "String" }, "bsb": { "type": "string", "title": "String" }, "accountName": { "type": "string", "title": "String" }, "source": { "enum": [ "None", "Saasu", "Xero", "MYOB", "Deputy", "EmployeeTimePunch", "ClickSuper", "IntegratedTimesheets", "FileImport", "FileExport", "QuickBooks", "Harmony", "AwardStore", "Attache", "IntegratedRostering", "ReckonAccounts", "API", "MicroPower", "RosterLive", "NetSuite", "Kounta", "TimeAndAttendanceKiosk", "DetailedFileExport", "JonasPremier", "WageEasy", "Maestrano", "WorkZone", "EmployeePortal", "RosterTemplate", "Onboarding", "Admin", "WorkZoneClockOnOff" ], "type": "string", "title": "ExternalService" }, "electronicServiceAddress": { "type": "string", "title": "String" }, "email": { "type": "string", "title": "String" }, "externalReferenceId": { "type": "string", "title": "String" } }, "xml": { "name": "SuperProductModel" }, "title": "SuperProductModel" }, "SaveSuperFundModel": { "type": "object", "properties": { "memberNumber": { "type": "string", "title": "String" }, "allocatedPercentage": { "format": "double", "type": "number", "title": "Nullable" }, "fixedAmount": { "format": "double", "type": "number", "title": "Nullable" }, "productCode": { "type": "string", "title": "String" }, "fundName": { "type": "string", "title": "String" }, "allocateBalance": { "type": "boolean", "title": "Boolean" } }, "xml": { "name": "SaveSuperFundModel" }, "title": "SaveSuperFundModel" }, "SaveSuperFundResponseModel": { "type": "object", "properties": { "validationWarning": { "type": "string", "title": "String" }, "result": { "$ref": "#/definitions/SuperFundModel" } }, "xml": { "name": "SaveSuperFundResponseModel" }, "title": "SaveSuperFundResponseModel" }, "ODataQueryOptions[EmployerLiabilityCategory]": { "type": "object", "properties": { "ifMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "ifNoneMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "context": { "$ref": "#/definitions/ODataQueryContext", "readOnly": true }, "request": { "type": "object", "readOnly": true, "title": "HttpRequestMessage" }, "rawValues": { "$ref": "#/definitions/ODataRawQueryOptions", "readOnly": true }, "selectExpand": { "$ref": "#/definitions/SelectExpandQueryOption", "readOnly": true }, "filter": { "$ref": "#/definitions/FilterQueryOption", "readOnly": true }, "orderBy": { "$ref": "#/definitions/OrderByQueryOption", "readOnly": true }, "skip": { "$ref": "#/definitions/SkipQueryOption", "readOnly": true }, "top": { "$ref": "#/definitions/TopQueryOption", "readOnly": true }, "inlineCount": { "$ref": "#/definitions/InlineCountQueryOption", "readOnly": true }, "validator": { "$ref": "#/definitions/ODataQueryValidator" } }, "xml": { "name": "ODataQueryOptions`1" }, "title": "ODataQueryOptions" }, "EmployerLiabilityCategoryModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "name": { "type": "string", "title": "String" }, "externalReferenceId": { "type": "string", "title": "String" }, "canBeDeleted": { "type": "boolean", "title": "Boolean" }, "hideFromPaySlips": { "type": "boolean", "title": "Boolean" }, "showTotalPayments": { "type": "boolean", "title": "Boolean" }, "includeInShiftCosts": { "type": "boolean", "title": "Boolean" } }, "xml": { "name": "EmployerLiabilityCategoryModel" }, "title": "EmployerLiabilityCategoryModel" }, "ODataQueryOptions[EmployingEntity]": { "type": "object", "properties": { "ifMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "ifNoneMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "context": { "$ref": "#/definitions/ODataQueryContext", "readOnly": true }, "request": { "type": "object", "readOnly": true, "title": "HttpRequestMessage" }, "rawValues": { "$ref": "#/definitions/ODataRawQueryOptions", "readOnly": true }, "selectExpand": { "$ref": "#/definitions/SelectExpandQueryOption", "readOnly": true }, "filter": { "$ref": "#/definitions/FilterQueryOption", "readOnly": true }, "orderBy": { "$ref": "#/definitions/OrderByQueryOption", "readOnly": true }, "skip": { "$ref": "#/definitions/SkipQueryOption", "readOnly": true }, "top": { "$ref": "#/definitions/TopQueryOption", "readOnly": true }, "inlineCount": { "$ref": "#/definitions/InlineCountQueryOption", "readOnly": true }, "validator": { "$ref": "#/definitions/ODataQueryValidator" } }, "xml": { "name": "ODataQueryOptions`1" }, "title": "ODataQueryOptions" }, "EmployingEntityModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "name": { "type": "string", "title": "String" }, "abn": { "type": "string", "title": "String" }, "contactName": { "type": "string", "title": "String" }, "signatoryName": { "type": "string", "title": "String" }, "contactEmailAddress": { "type": "string", "title": "String" }, "contactPhoneNumber": { "type": "string", "title": "String" }, "contactFaxNumber": { "type": "string", "title": "String" }, "addressLine1": { "type": "string", "title": "String" }, "addressLine2": { "type": "string", "title": "String" }, "suburb": { "type": "string", "title": "String" }, "state": { "type": "string", "title": "String" }, "postcode": { "type": "string", "title": "String" }, "externalReferenceId": { "type": "string", "title": "String" }, "isExemptFromFringeBenefitsTax": { "type": "boolean", "title": "Boolean" } }, "xml": { "name": "EmployingEntityModel" }, "title": "EmployingEntityModel" }, "ODataQueryOptions[EmploymentAgreement]": { "type": "object", "properties": { "ifMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "ifNoneMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "context": { "$ref": "#/definitions/ODataQueryContext", "readOnly": true }, "request": { "type": "object", "readOnly": true, "title": "HttpRequestMessage" }, "rawValues": { "$ref": "#/definitions/ODataRawQueryOptions", "readOnly": true }, "selectExpand": { "$ref": "#/definitions/SelectExpandQueryOption", "readOnly": true }, "filter": { "$ref": "#/definitions/FilterQueryOption", "readOnly": true }, "orderBy": { "$ref": "#/definitions/OrderByQueryOption", "readOnly": true }, "skip": { "$ref": "#/definitions/SkipQueryOption", "readOnly": true }, "top": { "$ref": "#/definitions/TopQueryOption", "readOnly": true }, "inlineCount": { "$ref": "#/definitions/InlineCountQueryOption", "readOnly": true }, "validator": { "$ref": "#/definitions/ODataQueryValidator" } }, "xml": { "name": "ODataQueryOptions`1" }, "title": "ODataQueryOptions" }, "BasicEmploymentAgreementModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "classification": { "type": "string", "title": "String" }, "employmentType": { "enum": [ "Unknown", "FullTime", "PartTime", "LabourHire", "SuperannuationIncomeStream", "Casual" ], "type": "string", "title": "EmploymentTypeEnum" }, "name": { "type": "string", "title": "String" }, "awardName": { "type": "string", "title": "String" }, "rank": { "format": "int32", "type": "integer", "title": "Int32" } }, "xml": { "name": "BasicEmploymentAgreementModel" }, "title": "BasicEmploymentAgreementModel" }, "EmploymentAgreementModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "classification": { "type": "string", "title": "String" }, "employmentType": { "enum": [ "Unknown", "FullTime", "PartTime", "LabourHire", "SuperannuationIncomeStream", "Casual" ], "type": "string", "title": "EmploymentTypeEnum" }, "payRateTemplateType": { "enum": [ "DateOfBirth", "Anniversary", "AnniversaryInMonths", "DateOfBirthAndAnniversaryInMonths" ], "type": "string", "title": "PayRateTemplateTypeEnum" }, "payConditionRuleSetId": { "format": "int32", "description": "in older serialised versions, the whole ruleset was included. in newer versions, only the ID is included", "type": "integer", "title": "Nullable" }, "payConditionRuleSet": { "$ref": "#/definitions/PayConditionRuleSetModel" }, "leaveAllowanceTemplates": { "type": "array", "items": { "$ref": "#/definitions/LeaveAllowanceTemplateModel" }, "xml": { "name": "LeaveAllowanceTemplateModel", "wrapped": true }, "title": "IList" }, "leaveAllowanceTemplateIds": { "type": "array", "items": { "format": "int32", "type": "integer", "title": "Int32" }, "title": "IList" }, "agePayRateTemplates": { "type": "array", "items": { "$ref": "#/definitions/EmploymentAgreementPayRateTemplateModel" }, "xml": { "name": "EmploymentAgreementPayRateTemplateModel", "wrapped": true }, "title": "IList" }, "externalId": { "type": "string", "title": "String" }, "source": { "enum": [ "None", "Saasu", "Xero", "MYOB", "Deputy", "EmployeeTimePunch", "ClickSuper", "IntegratedTimesheets", "FileImport", "FileExport", "QuickBooks", "Harmony", "AwardStore", "Attache", "IntegratedRostering", "ReckonAccounts", "API", "MicroPower", "RosterLive", "NetSuite", "Kounta", "TimeAndAttendanceKiosk", "DetailedFileExport", "JonasPremier", "WageEasy", "Maestrano", "WorkZone", "EmployeePortal", "RosterTemplate", "Onboarding", "Admin", "WorkZoneClockOnOff" ], "type": "string", "title": "ExternalService" }, "rank": { "format": "int32", "type": "integer", "title": "Int32" } }, "xml": { "name": "EmploymentAgreementModel" }, "title": "EmploymentAgreementModel" }, "PayConditionRuleSetModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "name": { "type": "string", "title": "String" }, "description": { "type": "string", "title": "String" }, "periodType": { "enum": [ "Weekly", "Fortnightly", "Monthly", "CalendarMonth", "FourWeekly", "SixWeekly", "ThreeWeekly" ], "type": "string", "title": "RuleSetPeriodType" }, "dayOfWeekEnding": { "format": "int32", "type": "integer", "title": "Nullable" }, "dayOfMonthEnding": { "format": "int32", "type": "integer", "title": "Nullable" }, "periodEnding": { "format": "date-time", "type": "string", "title": "Nullable" }, "shiftConsolidationOption": { "enum": [ "None", "Duration", "SameDay" ], "type": "string", "title": "Nullable" }, "shiftConsolidationThreshold": { "type": "string", "title": "Nullable" }, "rulesJson": { "type": "string", "title": "String" } }, "xml": { "name": "PayConditionRuleSetModel" }, "title": "PayConditionRuleSetModel" }, "LeaveAllowanceTemplateModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "name": { "type": "string", "title": "String" }, "leaveCategories": { "type": "array", "items": { "$ref": "#/definitions/LeaveAllowanceTemplateLeaveCategoryModel" }, "xml": { "name": "LeaveAllowanceTemplateLeaveCategoryModel", "wrapped": true }, "title": "IList" }, "externalId": { "type": "string", "title": "String" }, "source": { "enum": [ "None", "Saasu", "Xero", "MYOB", "Deputy", "EmployeeTimePunch", "ClickSuper", "IntegratedTimesheets", "FileImport", "FileExport", "QuickBooks", "Harmony", "AwardStore", "Attache", "IntegratedRostering", "ReckonAccounts", "API", "MicroPower", "RosterLive", "NetSuite", "Kounta", "TimeAndAttendanceKiosk", "DetailedFileExport", "JonasPremier", "WageEasy", "Maestrano", "WorkZone", "EmployeePortal", "RosterTemplate", "Onboarding", "Admin", "WorkZoneClockOnOff" ], "type": "string", "title": "ExternalService" } }, "xml": { "name": "LeaveAllowanceTemplateModel" }, "title": "LeaveAllowanceTemplateModel" }, "EmploymentAgreementPayRateTemplateModel": { "type": "object", "properties": { "payRateTemplateId": { "format": "int32", "type": "integer", "title": "Nullable" }, "payRateTemplate": { "$ref": "#/definitions/PayRateTemplateModel" }, "minAge": { "format": "int32", "type": "integer", "title": "Nullable" }, "maxAge": { "format": "int32", "type": "integer", "title": "Nullable" }, "minAnniversaryMonths": { "format": "int32", "type": "integer", "title": "Nullable" }, "maxAnniversaryMonths": { "format": "int32", "type": "integer", "title": "Nullable" } }, "xml": { "name": "EmploymentAgreementPayRateTemplateModel" }, "title": "EmploymentAgreementPayRateTemplateModel" }, "LeaveAllowanceTemplateLeaveCategoryModel": { "type": "object", "properties": { "leaveCategoryId": { "format": "int32", "type": "integer", "title": "Int32" }, "units": { "format": "double", "type": "number", "title": "Nullable" }, "unitType": { "enum": [ "Days", "Weeks", "HoursPerHourWorked", "HoursPerPayRun" ], "type": "string", "title": "Nullable" }, "leaveLoading": { "format": "double", "type": "number", "title": "Nullable" }, "canApplyForLeave": { "type": "boolean", "title": "Boolean" }, "contingentPeriod": { "format": "double", "type": "number", "title": "Nullable" }, "entitlementPeriod": { "format": "double", "type": "number", "title": "Nullable" } }, "xml": { "name": "LeaveAllowanceTemplateLeaveCategoryModel" }, "title": "LeaveAllowanceTemplateLeaveCategoryModel" }, "PayRateTemplateModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "name": { "type": "string", "title": "String" }, "primaryPayCategoryId": { "format": "int32", "type": "integer", "title": "Int32" }, "superThresholdAmount": { "format": "double", "type": "number", "title": "Nullable" }, "payCategories": { "type": "array", "items": { "$ref": "#/definitions/PayRateTemplatePayCategoryModel" }, "xml": { "name": "PayRateTemplatePayCategoryModel", "wrapped": true }, "title": "List" }, "externalId": { "type": "string", "title": "String" }, "source": { "type": "string", "title": "String" }, "maximumQuarterlySuperContributionsBase": { "format": "double", "type": "number", "title": "Nullable" } }, "xml": { "name": "PayRateTemplateModel" }, "title": "PayRateTemplateModel" }, "PayRateTemplatePayCategoryModel": { "description": "TODO: Can we get away with not having UserSuppliedRate and CalculatedRate? can we just have 'Rate' and work \r\n(which is interpreted as UserSuppliedRate) and determine calculated rate from there?", "type": "object", "properties": { "payCategoryId": { "format": "int32", "type": "integer", "title": "Int32" }, "userSuppliedRate": { "format": "double", "type": "number", "title": "Decimal" }, "calculatedRate": { "format": "double", "type": "number", "title": "Decimal" }, "standardWeeklyHours": { "format": "double", "type": "number", "title": "Decimal" }, "superRate": { "format": "double", "type": "number", "title": "Nullable" } }, "xml": { "name": "PayRateTemplatePayCategoryModel" }, "title": "PayRateTemplatePayCategoryModel" }, "GetShiftPeriodsModel": { "type": "object", "properties": { "firstShiftStartTime": { "format": "date-time", "type": "string", "title": "Nullable" }, "lastShiftStartTime": { "format": "date-time", "type": "string", "title": "Nullable" } }, "xml": { "name": "GetShiftPeriodsModel" }, "title": "GetShiftPeriodsModel" }, "ShiftPeriodModel": { "type": "object", "properties": { "fromDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "toDate": { "format": "date-time", "type": "string", "title": "DateTime" } }, "xml": { "name": "ShiftPeriodModel" }, "title": "ShiftPeriodModel" }, "ShiftCostingsRequestModel": { "type": "object", "properties": { "transactionExternalId": { "type": "string", "title": "String" }, "locationIdType": { "enum": [ "Standard", "External" ], "type": "string", "title": "IdType" }, "workTypeIdType": { "enum": [ "Standard", "External" ], "type": "string", "title": "IdType" }, "includeEvaluationResults": { "type": "boolean", "title": "Boolean" }, "employee": { "$ref": "#/definitions/ShiftCostingsEmployeeModel" }, "shifts": { "type": "array", "items": { "$ref": "#/definitions/ShiftCostingsRequestShiftModel" }, "xml": { "name": "ShiftCostingsRequestShiftModel", "wrapped": true }, "title": "IList" } }, "xml": { "name": "ShiftCostingsRequestModel" }, "title": "ShiftCostingsRequestModel" }, "ShiftCostingsEmployeeModel": { "type": "object", "properties": { "dateOfBirth": { "format": "date-time", "type": "string", "title": "Nullable" }, "anniversaryDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "standardHoursPerWeek": { "format": "double", "type": "number", "title": "Nullable" }, "tags": { "type": "array", "items": { "type": "string", "title": "String" }, "title": "IList" } }, "xml": { "name": "ShiftCostingsEmployeeModel" }, "title": "ShiftCostingsEmployeeModel" }, "ShiftCostingsRequestShiftModel": { "type": "object", "properties": { "state": { "type": "string", "title": "String" }, "id": { "format": "int32", "type": "integer", "title": "Int32" }, "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "startTime": { "format": "date-time", "type": "string", "title": "Nullable" }, "endTime": { "format": "date-time", "type": "string", "title": "Nullable" }, "units": { "format": "double", "type": "number", "title": "Nullable" }, "workTypeId": { "type": "string", "title": "String" }, "locationId": { "type": "string", "title": "String" }, "comments": { "type": "string", "title": "String" }, "breaks": { "type": "array", "items": { "$ref": "#/definitions/TimesheetBreakModel" }, "xml": { "name": "TimesheetBreakModel", "wrapped": true }, "title": "IList" }, "status": { "type": "string", "title": "String" }, "rate": { "format": "double", "type": "number", "title": "Nullable" }, "leaveCategoryId": { "type": "string", "title": "String" }, "payCategoryId": { "type": "string", "title": "String" }, "classificationId": { "type": "string", "title": "String" }, "externalId": { "type": "string", "title": "String" }, "source": { "enum": [ "None", "Saasu", "Xero", "MYOB", "Deputy", "EmployeeTimePunch", "ClickSuper", "IntegratedTimesheets", "FileImport", "FileExport", "QuickBooks", "Harmony", "AwardStore", "Attache", "IntegratedRostering", "ReckonAccounts", "API", "MicroPower", "RosterLive", "NetSuite", "Kounta", "TimeAndAttendanceKiosk", "DetailedFileExport", "JonasPremier", "WageEasy", "Maestrano", "WorkZone", "EmployeePortal", "RosterTemplate", "Onboarding", "Admin", "WorkZoneClockOnOff" ], "type": "string", "title": "ExternalService" }, "attachmentId": { "format": "int32", "type": "integer", "title": "Nullable" }, "shiftConditionIds": { "type": "array", "items": { "type": "string", "title": "String" }, "title": "IList" } }, "xml": { "name": "ShiftCostingsRequestShiftModel" }, "title": "ShiftCostingsRequestShiftModel" }, "TimesheetBreakModel": { "type": "object", "properties": { "startTime": { "format": "date-time", "type": "string", "title": "Nullable" }, "endTime": { "format": "date-time", "type": "string", "title": "Nullable" } }, "xml": { "name": "TimesheetBreakModel" }, "title": "TimesheetBreakModel" }, "ShiftCostingsResponseModel": { "type": "object", "properties": { "transactionId": { "format": "uuid", "type": "string", "example": "00000000-0000-0000-0000-000000000000", "title": "Guid" }, "transactionExternalId": { "type": "string", "title": "String" }, "employmentAgreementId": { "format": "int32", "type": "integer", "title": "Int32" }, "employmentAgreementName": { "type": "string", "title": "String" }, "payConditionRuleSetId": { "format": "int32", "type": "integer", "title": "Int32" }, "payConditionRuleSetName": { "type": "string", "title": "String" }, "shifts": { "type": "array", "items": { "$ref": "#/definitions/ShiftCostingsResponseShiftModel" }, "xml": { "name": "ShiftCostingsResponseShiftModel", "wrapped": true }, "title": "List" } }, "xml": { "name": "ShiftCostingsResponseModel" }, "title": "ShiftCostingsResponseModel" }, "ShiftCostingsResponseShiftModel": { "type": "object", "properties": { "externalId": { "type": "string", "title": "String" }, "startTime": { "format": "date-time", "type": "string", "title": "DateTime" }, "endTime": { "format": "date-time", "type": "string", "title": "DateTime" }, "cost": { "format": "double", "type": "number", "readOnly": true, "title": "Decimal" }, "evaluationResults": { "type": "array", "items": { "$ref": "#/definitions/RuleEvaluationResult" }, "xml": { "name": "RuleEvaluationResult", "wrapped": true }, "title": "IList" }, "consolidatedShifts": { "type": "array", "items": { "type": "string", "title": "String" }, "title": "List" }, "costBreakdown": { "type": "array", "items": { "$ref": "#/definitions/ShiftCostingBreakdownModel" }, "xml": { "name": "ShiftCostingBreakdownModel", "wrapped": true }, "title": "List" } }, "xml": { "name": "ShiftCostingsResponseShiftModel" }, "title": "ShiftCostingsResponseShiftModel" }, "RuleEvaluationResult": { "type": "object", "properties": { "ruleName": { "type": "string", "title": "String" }, "matchResult": { "enum": [ "NoMatch", "Match", "DisabledForRuleSet", "DisabledForEmployee" ], "type": "string", "title": "RuleMatchResult" } }, "xml": { "name": "RuleEvaluationResult" }, "title": "RuleEvaluationResult" }, "ShiftCostingBreakdownModel": { "type": "object", "properties": { "startTime": { "format": "date-time", "type": "string", "title": "Nullable" }, "endTime": { "format": "date-time", "type": "string", "title": "Nullable" }, "payCategoryId": { "format": "int32", "type": "integer", "title": "Nullable" }, "payCategoryName": { "type": "string", "title": "String" }, "units": { "format": "double", "type": "number", "title": "Decimal" }, "rate": { "format": "double", "type": "number", "title": "Decimal" }, "cost": { "format": "double", "type": "number", "title": "Decimal" }, "type": { "type": "string", "title": "String" }, "liabilityCategoryId": { "format": "int32", "type": "integer", "title": "Nullable" }, "liabilityCategoryName": { "type": "string", "title": "String" } }, "xml": { "name": "ShiftCostingBreakdownModel" }, "title": "ShiftCostingBreakdownModel" }, "EmployeeLeaveRequestFilter": { "type": "object", "properties": { "showOtherEmployees": { "type": "boolean", "title": "Boolean" }, "fromDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "toDate": { "format": "date-time", "type": "string", "title": "Nullable" } }, "xml": { "name": "EmployeeLeaveRequestFilter" }, "title": "EmployeeLeaveRequestFilter" }, "EssLeaveRequestModel": { "type": "object", "properties": { "leaveCategoryId": { "format": "int32", "type": "integer", "title": "Int32" }, "isApproved": { "type": "boolean", "title": "Boolean" }, "isDeclined": { "type": "boolean", "title": "Boolean" }, "isCancelled": { "type": "boolean", "title": "Boolean" }, "isPending": { "type": "boolean", "title": "Boolean" }, "id": { "format": "int32", "type": "integer", "title": "Int32" }, "fromDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "toDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "requestedDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "leaveCategoryName": { "type": "string", "title": "String" }, "hoursPerDay": { "format": "double", "type": "number", "title": "Decimal" }, "totalHours": { "format": "double", "type": "number", "title": "Decimal" }, "notes": { "type": "string", "title": "String" }, "totalDays": { "format": "double", "type": "number", "readOnly": true, "title": "Decimal" }, "amount": { "type": "string", "readOnly": true, "title": "String" }, "status": { "type": "string", "title": "String" }, "statusUpdateNotes": { "type": "string", "title": "String" }, "canCancel": { "type": "boolean", "title": "Boolean" }, "canModify": { "type": "boolean", "title": "Boolean" }, "requireNotesForLeaveRequests": { "type": "boolean", "title": "Boolean" }, "attachment": { "$ref": "#/definitions/AttachmentModel" } }, "xml": { "name": "EssLeaveRequestModel" }, "title": "EssLeaveRequestModel" }, "EssLeaveApplicationModel": { "required": [ "fromDate", "toDate", "hours", "leaveCategoryId" ], "type": "object", "properties": { "attachment": { "format": "byte", "type": "string", "title": "Byte[]" }, "attachmentId": { "format": "int32", "type": "integer", "title": "Nullable" }, "id": { "format": "int32", "type": "integer", "title": "Int32" }, "fromDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "toDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "hours": { "format": "double", "maximum": 2000, "type": "number", "title": "Decimal" }, "leaveCategoryId": { "format": "int32", "type": "integer", "title": "Nullable" }, "notes": { "maxLength": 255, "type": "string", "title": "String" } }, "xml": { "name": "EssLeaveApplicationModel" }, "title": "EssLeaveApplicationModel" }, "EssLeaveCategoryModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "name": { "type": "string", "title": "String" } }, "xml": { "name": "EssLeaveCategoryModel" }, "title": "EssLeaveCategoryModel" }, "LeaveHoursEstimateFilter": { "required": [ "fromDate", "toDate" ], "type": "object", "properties": { "leaveCategoryId": { "format": "int32", "type": "integer", "title": "Int32" }, "fromDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "toDate": { "format": "date-time", "type": "string", "title": "DateTime" } }, "xml": { "name": "LeaveHoursEstimateFilter" }, "title": "LeaveHoursEstimateFilter" }, "EssLeaveEstimate": { "type": "object", "properties": { "leaveBalance": { "format": "double", "type": "number", "title": "Nullable" }, "approvedLeave": { "format": "double", "type": "number", "title": "Nullable" }, "availableBalance": { "format": "double", "type": "number", "title": "Nullable" }, "leaveRequired": { "$ref": "#/definitions/LeaveEstimate" } }, "xml": { "name": "EssLeaveEstimate" }, "title": "EssLeaveEstimate" }, "LeaveEstimate": { "type": "object", "properties": { "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "hours": { "format": "double", "type": "number", "title": "Nullable" }, "details": { "type": "array", "items": { "type": "string", "title": "String" }, "title": "IList" } }, "xml": { "name": "LeaveEstimate" }, "title": "LeaveEstimate" }, "EssEmployeeDetailsModel": { "description": "this exists to give it a separate name from the API EmployeeeDetailsModel. As an aside, we should have had an api specific model for this", "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "titleId": { "format": "int32", "type": "integer", "title": "Int32" }, "firstName": { "type": "string", "title": "String" }, "otherName": { "type": "string", "title": "String" }, "middleName": { "type": "string", "title": "String" }, "surname": { "type": "string", "title": "String" }, "gender": { "type": "string", "title": "String" }, "dateOfBirth": { "format": "date-time", "type": "string", "title": "Nullable" }, "anniversaryDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "externalId": { "type": "string", "title": "String" }, "residentialStreetAddress": { "type": "string", "title": "String" }, "residentialAddressLine2": { "type": "string", "title": "String" }, "residentialSuburbId": { "format": "int32", "type": "integer", "title": "Nullable" }, "residentialSuburb": { "type": "string", "title": "String" }, "residentialState": { "type": "string", "title": "String" }, "residentialPostcode": { "type": "string", "title": "String" }, "residentialCountry": { "type": "string", "title": "String" }, "postalStreetAddress": { "type": "string", "title": "String" }, "postalAddressLine2": { "type": "string", "title": "String" }, "postalSuburbId": { "format": "int32", "type": "integer", "title": "Nullable" }, "postalSuburb": { "type": "string", "title": "String" }, "postalState": { "type": "string", "title": "String" }, "postalPostcode": { "type": "string", "title": "String" }, "postalCountry": { "type": "string", "title": "String" }, "email": { "type": "string", "title": "String" }, "homePhone": { "type": "string", "title": "String" }, "workPhone": { "type": "string", "title": "String" }, "mobilePhone": { "type": "string", "title": "String" }, "startDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "endDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "isTerminated": { "type": "boolean", "title": "Boolean" }, "externalReferenceId": { "type": "string", "title": "String" }, "source": { "format": "int32", "type": "integer", "title": "Int32" }, "isPostalAddressSameAsResidential": { "type": "boolean", "title": "Boolean" }, "titles": { "type": "array", "items": { "$ref": "#/definitions/TitleViewModel" }, "xml": { "name": "TitleViewModel", "wrapped": true }, "title": "IList" }, "editMode": { "enum": [ "EmployeePortal", "EmployeePortalReadOnly", "BusinessPortal" ], "type": "string", "title": "EmployeeDetailsEditMode" }, "canEdit": { "type": "boolean", "readOnly": true, "title": "Boolean" }, "tagsString": { "type": "string", "title": "String" }, "allTags": { "type": "array", "items": { "type": "string", "title": "String" }, "title": "IList" }, "timesheetSetting": { "enum": [ "Disabled", "Enabled", "EnabledForExceptions" ], "type": "string", "title": "EmployeeTimesheetSetting" }, "canDelete": { "type": "boolean", "title": "Boolean" }, "hasProfileImage": { "type": "boolean", "title": "Boolean" }, "canEditProfileImage": { "type": "boolean", "title": "Boolean" }, "bouncedEmail": { "type": "boolean", "title": "Boolean" } }, "xml": { "name": "EssEmployeeDetailsModel" }, "title": "EssEmployeeDetailsModel" }, "TitleViewModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "description": { "type": "string", "title": "String" } }, "xml": { "name": "TitleViewModel" }, "title": "TitleViewModel" }, "EmployeePartialEditModel": { "required": [ "firstName", "surname", "startDate" ], "type": "object", "properties": { "titleId": { "format": "int32", "type": "integer", "title": "Nullable" }, "firstName": { "maxLength": 50, "minLength": 0, "type": "string", "title": "String" }, "otherName": { "maxLength": 50, "minLength": 0, "type": "string", "title": "String" }, "middleName": { "maxLength": 50, "minLength": 0, "type": "string", "title": "String" }, "surname": { "maxLength": 50, "minLength": 0, "type": "string", "title": "String" }, "dateOfBirth": { "format": "date-time", "type": "string", "title": "Nullable" }, "anniversaryDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "gender": { "type": "string", "title": "String" }, "externalId": { "type": "string", "title": "String" }, "residentialStreetAddress": { "maxLength": 100, "minLength": 0, "type": "string", "title": "String" }, "residentialAddressLine2": { "type": "string", "title": "String" }, "residentialSuburbId": { "format": "int32", "type": "integer", "title": "Nullable" }, "residentialSuburb": { "type": "string", "title": "String" }, "residentialState": { "type": "string", "title": "String" }, "residentialPostcode": { "type": "string", "title": "String" }, "residentialCountry": { "type": "string", "title": "String" }, "postalStreetAddress": { "maxLength": 100, "minLength": 0, "type": "string", "title": "String" }, "postalAddressLine2": { "type": "string", "title": "String" }, "postalSuburb": { "type": "string", "title": "String" }, "postalState": { "type": "string", "title": "String" }, "postalPostcode": { "type": "string", "title": "String" }, "postalCountry": { "type": "string", "title": "String" }, "postalSuburbId": { "format": "int32", "type": "integer", "title": "Nullable" }, "email": { "maxLength": 100, "minLength": 0, "type": "string", "title": "String" }, "homePhone": { "maxLength": 50, "minLength": 0, "type": "string", "title": "String" }, "workPhone": { "maxLength": 50, "minLength": 0, "type": "string", "title": "String" }, "mobilePhone": { "maxLength": 50, "minLength": 0, "type": "string", "title": "String" }, "startDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "endDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "businessId": { "format": "int32", "type": "integer", "title": "Int32" }, "taxFileNumber": { "type": "string", "title": "String" }, "taxFileNumberMasked": { "type": "string", "title": "String" }, "isPostalAddressSameAsResidential": { "type": "boolean", "title": "Boolean" }, "bankAccounts": { "type": "array", "items": { "$ref": "#/definitions/BankAccountEditModel" }, "xml": { "name": "BankAccountEditModel", "wrapped": true }, "title": "IList" }, "externalReferenceId": { "type": "string", "title": "String" }, "source": { "enum": [ "None", "Saasu", "Xero", "MYOB", "Deputy", "EmployeeTimePunch", "ClickSuper", "IntegratedTimesheets", "FileImport", "FileExport", "QuickBooks", "Harmony", "AwardStore", "Attache", "IntegratedRostering", "ReckonAccounts", "API", "MicroPower", "RosterLive", "NetSuite", "Kounta", "TimeAndAttendanceKiosk", "DetailedFileExport", "JonasPremier", "WageEasy", "Maestrano", "WorkZone", "EmployeePortal", "RosterTemplate", "Onboarding", "Admin", "WorkZoneClockOnOff" ], "type": "string", "title": "ExternalService" }, "tagsString": { "type": "string", "title": "String" }, "timesheetSetting": { "enum": [ "Disabled", "Enabled", "EnabledForExceptions" ], "type": "string", "title": "EmployeeTimesheetSetting" } }, "xml": { "name": "EmployeePartialEditModel" }, "title": "EmployeePartialEditModel" }, "BankAccountEditModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "bsb": { "type": "string", "title": "String" }, "accountName": { "type": "string", "title": "String" }, "accountNumber": { "type": "string", "title": "String" }, "allocatedPercentage": { "format": "double", "type": "number", "title": "Nullable" }, "fixedAmount": { "format": "double", "type": "number", "title": "Nullable" }, "externalReferenceId": { "type": "string", "title": "String" }, "source": { "enum": [ "None", "Saasu", "Xero", "MYOB", "Deputy", "EmployeeTimePunch", "ClickSuper", "IntegratedTimesheets", "FileImport", "FileExport", "QuickBooks", "Harmony", "AwardStore", "Attache", "IntegratedRostering", "ReckonAccounts", "API", "MicroPower", "RosterLive", "NetSuite", "Kounta", "TimeAndAttendanceKiosk", "DetailedFileExport", "JonasPremier", "WageEasy", "Maestrano", "WorkZone", "EmployeePortal", "RosterTemplate", "Onboarding", "Admin", "WorkZoneClockOnOff" ], "type": "string", "title": "ExternalService" }, "allocateBalance": { "type": "boolean", "title": "Boolean" }, "isEmployeeEditable": { "type": "boolean", "title": "Boolean" }, "canBeDeleted": { "type": "boolean", "title": "Boolean" }, "accountType": { "enum": [ "Electronic", "ManualDeposit", "CashOrCheque", "Bpay" ], "type": "string", "title": "BankAccountTypeEnum" } }, "xml": { "name": "BankAccountEditModel" }, "title": "BankAccountEditModel" }, "EmployeeEmergencyContactsEditModel": { "type": "object", "properties": { "primaryEmergencyContact": { "$ref": "#/definitions/EmergencyContactEditModel" }, "secondaryEmergencyContact": { "$ref": "#/definitions/EmergencyContactEditModel" }, "canEdit": { "type": "boolean", "title": "Boolean" } }, "xml": { "name": "EmployeeEmergencyContactsEditModel" }, "title": "EmployeeEmergencyContactsEditModel" }, "EmergencyContactEditModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "name": { "type": "string", "title": "String" }, "relationship": { "type": "string", "title": "String" }, "address": { "type": "string", "title": "String" }, "contactNumber": { "type": "string", "title": "String" }, "alternateContactNumber": { "type": "string", "title": "String" } }, "xml": { "name": "EmergencyContactEditModel" }, "title": "EmergencyContactEditModel" }, "FeaturesModel": { "type": "object", "properties": { "allowEmployeeLeaveSelfService": { "type": "boolean", "title": "Boolean" }, "allowEmployeeSelfEditing": { "type": "boolean", "title": "Boolean" }, "allowEmployeeTimesheetsSelfService": { "type": "boolean", "title": "Boolean" }, "allowEmployeeToSetUnavailability": { "type": "boolean", "title": "Boolean" }, "allowEmployeeToDeclineShifts": { "type": "boolean", "title": "Boolean" }, "allowEmployeeSuperFundSelfService": { "type": "boolean", "title": "Boolean" }, "allowEmployeeBankAccountSelfService": { "type": "boolean", "title": "Boolean" }, "allowEmployeeSatisfactionSurvey": { "type": "boolean", "title": "Boolean" }, "allowEmployeesToViewAllApprovedLeave": { "type": "boolean", "title": "Boolean" }, "unavailabilityCutOff": { "format": "int32", "type": "integer", "title": "Int32" }, "allowEmployeesToUploadProfilePicture": { "type": "boolean", "title": "Boolean" }, "allowEmployeeRosteringSelfService": { "type": "boolean", "title": "Boolean" }, "allowEmployeeExpensesSelfService": { "type": "boolean", "title": "Boolean" }, "allowEmployeeOverrideTaxCodes": { "type": "boolean", "title": "Boolean" }, "allowEmployeesToEditKioskTimesheets": { "type": "boolean", "title": "Boolean" }, "essTimesheetSetting": { "enum": [ "Disabled", "ReadOnly", "ReadWrite", "EditKiosk", "EditWorkZoneClockOnOff" ], "type": "string", "title": "ESSTimesheetSetting" }, "employeeMustAcceptShifts": { "type": "boolean", "title": "Boolean" }, "allowEmployeeTimesheetsWithoutStartStopTimes": { "type": "boolean", "title": "Boolean" }, "allowEmployeeToSwapShifts": { "type": "boolean", "title": "Boolean" }, "clockOnCanSpecifyHigherClassification": { "type": "boolean", "title": "Boolean" }, "clockOnRequirePhoto": { "type": "boolean", "title": "Boolean" }, "clockOnAllowEmployeeShiftSelection": { "type": "boolean", "title": "Boolean" }, "clockOnWindowMinutes": { "format": "int32", "type": "integer", "title": "Nullable" }, "clockOffWindowMinutes": { "format": "int32", "type": "integer", "title": "Nullable" }, "timesheetsRequireLocation": { "type": "boolean", "title": "Boolean" }, "timesheetsRequireWorkType": { "type": "boolean", "title": "Boolean" }, "enableWorkZoneClockOn": { "type": "boolean", "title": "Boolean" } }, "xml": { "name": "FeaturesModel" }, "title": "FeaturesModel" }, "DashboardModel": { "type": "object", "properties": { "latestPayslip": { "$ref": "#/definitions/EssPayslipModel" }, "nextShift": { "$ref": "#/definitions/EssRosterShiftModel" }, "leaveBalances": { "type": "array", "items": { "$ref": "#/definitions/LeaveBalanceModel" }, "xml": { "name": "LeaveBalanceModel", "wrapped": true }, "title": "IList" }, "features": { "$ref": "#/definitions/FeaturesModel" }, "titles": { "type": "array", "items": { "$ref": "#/definitions/TitleViewModel" }, "xml": { "name": "TitleViewModel", "wrapped": true }, "title": "List" }, "workTypes": { "type": "array", "items": { "$ref": "#/definitions/EssWorkTypeModel" }, "xml": { "name": "EssWorkTypeModel", "wrapped": true }, "title": "List" }, "shiftConditions": { "type": "array", "items": { "$ref": "#/definitions/EssWorkTypeModel" }, "xml": { "name": "EssWorkTypeModel", "wrapped": true }, "title": "List" }, "locations": { "type": "array", "items": { "$ref": "#/definitions/LocationModel" }, "xml": { "name": "LocationModel", "wrapped": true }, "title": "List" }, "classifications": { "type": "array", "items": { "$ref": "#/definitions/ClassificationSelectModel" }, "readOnly": true, "xml": { "name": "ClassificationSelectModel", "wrapped": true }, "title": "IList" }, "leaveCategories": { "type": "array", "items": { "$ref": "#/definitions/EssLeaveCategoryModel" }, "xml": { "name": "EssLeaveCategoryModel", "wrapped": true }, "title": "IList" }, "currentWeekSatisfactionSurvey": { "$ref": "#/definitions/EssSatisfactionSurvey" }, "timesheets": { "$ref": "#/definitions/EssCurrentTimesheetsModel" }, "timesheetEntryPeriodEnd": { "format": "date-time", "type": "string", "title": "DateTime" }, "expenseCategories": { "type": "array", "items": { "$ref": "#/definitions/ExpenseCategoryResponseModel" }, "xml": { "name": "ExpenseCategoryResponseModel", "wrapped": true }, "title": "IList" }, "taxCodes": { "type": "array", "items": { "$ref": "#/definitions/JournalServiceTaxCode" }, "xml": { "name": "JournalServiceTaxCode", "wrapped": true }, "title": "IList" }, "expenses": { "$ref": "#/definitions/EssCurrentExpensesModel" }, "pendingShiftCount": { "format": "int32", "type": "integer", "title": "Int32" }, "proposedSwapCount": { "format": "int32", "type": "integer", "title": "Int32" }, "currentShift": { "$ref": "#/definitions/EssCurrentShiftModel" } }, "xml": { "name": "DashboardModel" }, "title": "DashboardModel" }, "EssPayslipModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "paySchedule": { "type": "string", "title": "String" }, "datePaid": { "format": "date-time", "type": "string", "title": "DateTime" }, "payPeriodStart": { "format": "date-time", "type": "string", "title": "DateTime" }, "payPeriodEnd": { "format": "date-time", "type": "string", "title": "DateTime" }, "netPay": { "format": "double", "type": "number", "title": "Decimal" }, "payerName": { "type": "string", "title": "String" }, "payerAbn": { "type": "string", "title": "String" } }, "xml": { "name": "EssPayslipModel" }, "title": "EssPayslipModel" }, "EssRosterShiftModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "token": { "type": "string", "title": "String" }, "qualifications": { "type": "array", "items": { "$ref": "#/definitions/EssQualificationModel" }, "xml": { "name": "EssQualificationModel", "wrapped": true }, "title": "IList" }, "breaks": { "type": "array", "items": { "$ref": "#/definitions/EssRosterShiftBreakModel" }, "xml": { "name": "EssRosterShiftBreakModel", "wrapped": true }, "title": "IList" }, "employeeId": { "format": "int32", "type": "integer", "title": "Nullable" }, "employeeName": { "type": "string", "title": "String" }, "locationId": { "format": "int32", "type": "integer", "title": "Nullable" }, "locationName": { "type": "string", "title": "String" }, "classificationId": { "format": "int32", "type": "integer", "title": "Nullable" }, "classificationName": { "type": "string", "title": "String" }, "workTypeId": { "format": "int32", "type": "integer", "title": "Nullable" }, "workTypeName": { "type": "string", "title": "String" }, "startTime": { "format": "date-time", "type": "string", "title": "DateTime" }, "endTime": { "format": "date-time", "type": "string", "title": "DateTime" }, "notes": { "type": "string", "title": "String" }, "published": { "type": "boolean", "title": "Boolean" }, "accepted": { "type": "boolean", "title": "Boolean" }, "pendingSwap": { "$ref": "#/definitions/EssRosterShiftSwapModel" }, "datePublished": { "format": "date-time", "type": "string", "title": "Nullable" } }, "xml": { "name": "EssRosterShiftModel" }, "title": "EssRosterShiftModel" }, "EssWorkTypeModel": { "type": "object", "properties": { "isUnitBasedWorkType": { "type": "boolean", "title": "Boolean" }, "unitType": { "type": "string", "title": "String" }, "id": { "format": "int32", "type": "integer", "title": "Int32" }, "name": { "type": "string", "title": "String" }, "payCategoryId": { "format": "int32", "type": "integer", "title": "Nullable" }, "leaveCategoryId": { "format": "int32", "type": "integer", "title": "Nullable" }, "externalId": { "type": "string", "title": "String" }, "source": { "type": "string", "title": "String" }, "accruesLeave": { "type": "boolean", "title": "Boolean" }, "employmentTypes": { "type": "array", "items": { "enum": [ "Unknown", "FullTime", "PartTime", "LabourHire", "SuperannuationIncomeStream", "Casual" ], "type": "string", "title": "EmploymentTypeEnum" }, "xml": { "name": "EmploymentTypeEnum", "wrapped": true }, "title": "IList" }, "mappingType": { "enum": [ "PayCategory", "LeaveCategory", "PrimaryPayCategory", "ShiftCondition" ], "type": "string", "title": "Nullable" }, "shortCode": { "type": "string", "title": "String" } }, "xml": { "name": "EssWorkTypeModel" }, "title": "EssWorkTypeModel" }, "LocationModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "parentId": { "format": "int32", "type": "integer", "title": "Nullable" }, "name": { "type": "string", "title": "String" }, "externalId": { "type": "string", "title": "String" }, "source": { "type": "string", "title": "String" }, "fullyQualifiedName": { "type": "string", "title": "String" }, "state": { "type": "string", "title": "String" }, "isGlobal": { "type": "boolean", "title": "Boolean" }, "isRollupReportingLocation": { "type": "boolean", "title": "Boolean" }, "generalLedgerMappingCode": { "type": "string", "title": "String" }, "defaultShiftConditionIds": { "type": "array", "items": { "format": "int32", "type": "integer", "title": "Int32" }, "title": "IList" } }, "xml": { "name": "LocationModel" }, "title": "LocationModel" }, "ClassificationSelectModel": { "type": "object", "properties": { "name": { "type": "string", "title": "String" }, "id": { "format": "int32", "type": "integer", "title": "Int32" } }, "xml": { "name": "ClassificationSelectModel" }, "title": "ClassificationSelectModel" }, "EssSatisfactionSurvey": { "type": "object", "properties": { "value": { "enum": [ "NotSet", "Happy", "Neutral", "Sad" ], "type": "string", "title": "EmployeeSatisfactionValue" }, "weekStartDate": { "format": "date-time", "type": "string", "title": "DateTime" } }, "xml": { "name": "EssSatisfactionSurvey" }, "title": "EssSatisfactionSurvey" }, "EssCurrentTimesheetsModel": { "type": "object", "properties": { "periodStarting": { "format": "date-time", "type": "string", "title": "DateTime" }, "periodEnding": { "format": "date-time", "type": "string", "title": "DateTime" }, "submittedCount": { "format": "int32", "type": "integer", "title": "Int32" }, "approvedCount": { "format": "int32", "type": "integer", "title": "Int32" }, "rejectedCount": { "format": "int32", "type": "integer", "title": "Int32" }, "processedCount": { "format": "int32", "type": "integer", "title": "Int32" }, "durationInMinutes": { "format": "double", "type": "number", "title": "Decimal" } }, "xml": { "name": "EssCurrentTimesheetsModel" }, "title": "EssCurrentTimesheetsModel" }, "ExpenseCategoryResponseModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "name": { "type": "string", "title": "String" }, "externalTaxCodeId": { "type": "string", "title": "String" }, "taxCode": { "type": "string", "title": "String" }, "taxRate": { "format": "double", "type": "number", "title": "Nullable" } }, "xml": { "name": "ExpenseCategoryResponseModel" }, "title": "ExpenseCategoryResponseModel" }, "EssCurrentExpensesModel": { "type": "object", "properties": { "periodStarting": { "format": "date-time", "type": "string", "title": "DateTime" }, "periodEnding": { "format": "date-time", "type": "string", "title": "DateTime" }, "submittedCount": { "format": "int32", "type": "integer", "title": "Int32" }, "approvedCount": { "format": "int32", "type": "integer", "title": "Int32" }, "rejectedCount": { "format": "int32", "type": "integer", "title": "Int32" }, "processedCount": { "format": "int32", "type": "integer", "title": "Int32" } }, "xml": { "name": "EssCurrentExpensesModel" }, "title": "EssCurrentExpensesModel" }, "EssCurrentShiftModel": { "type": "object", "properties": { "shiftId": { "format": "int32", "type": "integer", "title": "Int32" }, "clockOnTimeUtc": { "format": "date-time", "type": "string", "title": "Nullable" }, "breakStartTimeUtc": { "format": "date-time", "type": "string", "title": "Nullable" }, "status": { "enum": [ "NotClockedOn", "ClockedOn", "OnBreak", "ClockedOff" ], "type": "string", "title": "TimeAttendanceStatus" }, "longShift": { "type": "boolean", "title": "Boolean" } }, "xml": { "name": "EssCurrentShiftModel" }, "title": "EssCurrentShiftModel" }, "EssQualificationModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "name": { "type": "string", "title": "String" } }, "xml": { "name": "EssQualificationModel" }, "title": "EssQualificationModel" }, "EssRosterShiftBreakModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "startTime": { "format": "date-time", "type": "string", "title": "DateTime" }, "endTime": { "format": "date-time", "type": "string", "title": "DateTime" } }, "xml": { "name": "EssRosterShiftBreakModel" }, "title": "EssRosterShiftBreakModel" }, "EssRosterShiftSwapModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "fromEmployee": { "type": "string", "title": "String" }, "toEmployee": { "type": "string", "title": "String" }, "fromEmployeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "toEmployeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "dateCreated": { "format": "date-time", "type": "string", "title": "DateTime" }, "note": { "type": "string", "title": "String" }, "rejectedReason": { "type": "string", "title": "String" }, "status": { "format": "int32", "type": "integer", "title": "Int32" }, "statusDescription": { "type": "string", "title": "String" } }, "xml": { "name": "EssRosterShiftSwapModel" }, "title": "EssRosterShiftSwapModel" }, "EmployeeTimesheetFilter": { "required": [ "fromDate", "toDate" ], "type": "object", "properties": { "fromDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "toDate": { "format": "date-time", "type": "string", "title": "DateTime" } }, "xml": { "name": "EmployeeTimesheetFilter" }, "title": "EmployeeTimesheetFilter" }, "EssTimesheetModel": { "type": "object", "properties": { "canDelete": { "type": "boolean", "readOnly": true, "title": "Boolean" }, "canEdit": { "type": "boolean", "readOnly": true, "title": "Boolean" }, "statusId": { "format": "int32", "type": "integer", "title": "Int32" }, "employeeName": { "type": "string", "title": "String" }, "id": { "format": "int32", "type": "integer", "title": "Int32" }, "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "locationId": { "format": "int32", "type": "integer", "title": "Nullable" }, "workTypeId": { "format": "int32", "type": "integer", "title": "Nullable" }, "classificationId": { "format": "int32", "type": "integer", "title": "Nullable" }, "classificationName": { "type": "string", "title": "String" }, "workTypeName": { "type": "string", "title": "String" }, "locationName": { "type": "string", "title": "String" }, "unitType": { "type": "string", "title": "String" }, "isUnitBasedWorkType": { "type": "boolean", "title": "Boolean" }, "payRunId": { "format": "int32", "type": "integer", "title": "Nullable" }, "start": { "format": "date-time", "type": "string", "title": "Nullable" }, "end": { "format": "date-time", "type": "string", "title": "Nullable" }, "submittedStart": { "format": "date-time", "type": "string", "title": "Nullable" }, "submittedEnd": { "format": "date-time", "type": "string", "title": "Nullable" }, "units": { "format": "double", "type": "number", "title": "Nullable" }, "status": { "enum": [ "Missing", "Submitted", "Approved", "Rejected", "Processed" ], "type": "string", "title": "TimesheetLineStatusType" }, "paySlipUrl": { "type": "string", "title": "String" }, "breaks": { "type": "array", "items": { "$ref": "#/definitions/TimesheetBreakViewModel" }, "xml": { "name": "TimesheetBreakViewModel", "wrapped": true }, "title": "IList" }, "comments": { "type": "string", "title": "String" }, "rate": { "format": "double", "type": "number", "title": "Nullable" }, "externalReferenceId": { "type": "string", "title": "String" }, "source": { "enum": [ "None", "Saasu", "Xero", "MYOB", "Deputy", "EmployeeTimePunch", "ClickSuper", "IntegratedTimesheets", "FileImport", "FileExport", "QuickBooks", "Harmony", "AwardStore", "Attache", "IntegratedRostering", "ReckonAccounts", "API", "MicroPower", "RosterLive", "NetSuite", "Kounta", "TimeAndAttendanceKiosk", "DetailedFileExport", "JonasPremier", "WageEasy", "Maestrano", "WorkZone", "EmployeePortal", "RosterTemplate", "Onboarding", "Admin", "WorkZoneClockOnOff" ], "type": "string", "title": "ExternalService" }, "payCategoryId": { "format": "int32", "type": "integer", "title": "Nullable" }, "leaveCategoryId": { "format": "int32", "type": "integer", "title": "Nullable" }, "leaveRequestId": { "format": "int32", "type": "integer", "title": "Nullable" }, "isLocked": { "type": "boolean", "title": "Boolean" }, "cost": { "format": "double", "type": "number", "title": "Nullable" }, "costingData": { "$ref": "#/definitions/ShiftCostingData" }, "discard": { "type": "boolean", "title": "Boolean" }, "attachment": { "$ref": "#/definitions/AttachmentModel" }, "shiftConditionIds": { "type": "array", "items": { "format": "int32", "type": "integer", "title": "Int32" }, "title": "IList" }, "isOverlapping": { "type": "boolean", "title": "Boolean" }, "overdrawsLeave": { "type": "boolean", "title": "Boolean" }, "reviewedBy": { "type": "string", "title": "String" }, "durationOverride": { "type": "string", "title": "Nullable" }, "workDurationInMinutes": { "format": "double", "type": "number", "readOnly": true, "title": "Double" }, "breaksDurationInMinutes": { "format": "double", "type": "number", "readOnly": true, "title": "Double" }, "totalDurationInMinutes": { "format": "double", "type": "number", "readOnly": true, "title": "Double" } }, "xml": { "name": "EssTimesheetModel" }, "title": "EssTimesheetModel" }, "TimesheetBreakViewModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "start": { "format": "date-time", "type": "string", "title": "Nullable" }, "end": { "format": "date-time", "type": "string", "title": "Nullable" }, "submittedStart": { "format": "date-time", "type": "string", "title": "Nullable" }, "submittedEnd": { "format": "date-time", "type": "string", "title": "Nullable" }, "formattedStart": { "type": "string", "readOnly": true, "title": "String" }, "formattedEnd": { "type": "string", "readOnly": true, "title": "String" } }, "xml": { "name": "TimesheetBreakViewModel" }, "title": "TimesheetBreakViewModel" }, "ShiftCostingData": { "type": "object", "properties": { "shiftParts": { "type": "array", "items": { "$ref": "#/definitions/ShiftPartModel" }, "xml": { "name": "ShiftPartModel", "wrapped": true }, "title": "IList" }, "allowances": { "type": "array", "items": { "$ref": "#/definitions/ShiftAllowanceModel" }, "xml": { "name": "ShiftAllowanceModel", "wrapped": true }, "title": "IList" }, "liabilities": { "type": "array", "items": { "$ref": "#/definitions/ShiftLiabilityModel" }, "xml": { "name": "ShiftLiabilityModel", "wrapped": true }, "title": "IList" }, "isConsolidated": { "type": "boolean", "title": "Boolean" } }, "xml": { "name": "ShiftCostingData" }, "title": "ShiftCostingData" }, "ShiftPartModel": { "type": "object", "properties": { "isBreak": { "type": "boolean", "title": "Boolean" }, "startTime": { "format": "date-time", "type": "string", "title": "DateTime" }, "endTime": { "format": "date-time", "type": "string", "title": "DateTime" }, "effectiveDuration": { "type": "string", "title": "TimeSpan" }, "actualDuration": { "type": "string", "title": "TimeSpan" }, "payCategory": { "type": "string", "title": "String" }, "payCategoryId": { "format": "int32", "type": "integer", "title": "Int32" }, "cost": { "format": "double", "type": "number", "title": "Decimal" }, "rateMultiplier": { "format": "double", "type": "number", "title": "Nullable" }, "baseRate": { "format": "double", "type": "number", "title": "Decimal" }, "calculatedRate": { "format": "double", "type": "number", "title": "Decimal" }, "displayDuration": { "type": "string", "readOnly": true, "title": "String" }, "workType": { "$ref": "#/definitions/NominalWorkType" }, "classification": { "$ref": "#/definitions/NominalClassification" }, "leaveCategory": { "$ref": "#/definitions/NominalLeaveCategory" } }, "xml": { "name": "ShiftPartModel" }, "title": "ShiftPartModel" }, "ShiftAllowanceModel": { "type": "object", "properties": { "payCategory": { "type": "string", "title": "String" }, "payCategoryId": { "format": "int32", "type": "integer", "title": "Int32" }, "units": { "format": "double", "type": "number", "title": "Decimal" }, "cost": { "format": "double", "type": "number", "title": "Decimal" }, "rateMultiplier": { "format": "double", "type": "number", "title": "Decimal" }, "option": { "enum": [ "Fixed", "PerHourWorked", "PercentageOfShiftCost", "PerShiftUnit" ], "type": "string", "title": "ShiftAllowanceOption" }, "type": { "enum": [ "Standard", "AllPurpose" ], "type": "string", "title": "ShiftAllowanceType" } }, "xml": { "name": "ShiftAllowanceModel" }, "title": "ShiftAllowanceModel" }, "ShiftLiabilityModel": { "type": "object", "properties": { "liabilityCategoryName": { "type": "string", "title": "String" }, "liabilityCategoryId": { "format": "int32", "type": "integer", "title": "Int32" }, "includeInShiftCost": { "type": "boolean", "title": "Boolean" }, "amount": { "format": "double", "type": "number", "title": "Decimal" }, "option": { "enum": [ "Fixed", "PerHourWorked", "PercentageOfShiftCost", "PerShiftUnit" ], "type": "string", "title": "ShiftAllowanceOption" }, "cost": { "format": "double", "type": "number", "title": "Decimal" } }, "xml": { "name": "ShiftLiabilityModel" }, "title": "ShiftLiabilityModel" }, "NominalWorkType": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "name": { "type": "string", "title": "String" }, "linkType": { "enum": [ "PayCategory", "LeaveCategory", "ShiftCondition" ], "type": "string", "title": "WorkTypeLinkTypeRestriction" } }, "xml": { "name": "NominalWorkType" }, "title": "NominalWorkType" }, "NominalClassification": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "rank": { "format": "int32", "type": "integer", "title": "Int32" }, "name": { "type": "string", "title": "String" } }, "xml": { "name": "NominalClassification" }, "title": "NominalClassification" }, "NominalLeaveCategory": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "name": { "type": "string", "title": "String" } }, "xml": { "name": "NominalLeaveCategory" }, "title": "NominalLeaveCategory" }, "TimesheetLineViewModel": { "type": "object", "properties": { "employeeName": { "type": "string", "title": "String" }, "id": { "format": "int32", "type": "integer", "title": "Int32" }, "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "locationId": { "format": "int32", "type": "integer", "title": "Nullable" }, "workTypeId": { "format": "int32", "type": "integer", "title": "Nullable" }, "classificationId": { "format": "int32", "type": "integer", "title": "Nullable" }, "classificationName": { "type": "string", "title": "String" }, "workTypeName": { "type": "string", "title": "String" }, "locationName": { "type": "string", "title": "String" }, "unitType": { "type": "string", "title": "String" }, "isUnitBasedWorkType": { "type": "boolean", "title": "Boolean" }, "payRunId": { "format": "int32", "type": "integer", "title": "Nullable" }, "start": { "format": "date-time", "type": "string", "title": "Nullable" }, "end": { "format": "date-time", "type": "string", "title": "Nullable" }, "submittedStart": { "format": "date-time", "type": "string", "title": "Nullable" }, "submittedEnd": { "format": "date-time", "type": "string", "title": "Nullable" }, "units": { "format": "double", "type": "number", "title": "Nullable" }, "status": { "enum": [ "Missing", "Submitted", "Approved", "Rejected", "Processed" ], "type": "string", "title": "TimesheetLineStatusType" }, "paySlipUrl": { "type": "string", "title": "String" }, "breaks": { "type": "array", "items": { "$ref": "#/definitions/TimesheetBreakViewModel" }, "xml": { "name": "TimesheetBreakViewModel", "wrapped": true }, "title": "IList" }, "comments": { "type": "string", "title": "String" }, "rate": { "format": "double", "type": "number", "title": "Nullable" }, "externalReferenceId": { "type": "string", "title": "String" }, "source": { "enum": [ "None", "Saasu", "Xero", "MYOB", "Deputy", "EmployeeTimePunch", "ClickSuper", "IntegratedTimesheets", "FileImport", "FileExport", "QuickBooks", "Harmony", "AwardStore", "Attache", "IntegratedRostering", "ReckonAccounts", "API", "MicroPower", "RosterLive", "NetSuite", "Kounta", "TimeAndAttendanceKiosk", "DetailedFileExport", "JonasPremier", "WageEasy", "Maestrano", "WorkZone", "EmployeePortal", "RosterTemplate", "Onboarding", "Admin", "WorkZoneClockOnOff" ], "type": "string", "title": "ExternalService" }, "payCategoryId": { "format": "int32", "type": "integer", "title": "Nullable" }, "leaveCategoryId": { "format": "int32", "type": "integer", "title": "Nullable" }, "leaveRequestId": { "format": "int32", "type": "integer", "title": "Nullable" }, "isLocked": { "type": "boolean", "title": "Boolean" }, "cost": { "format": "double", "type": "number", "title": "Nullable" }, "costingData": { "$ref": "#/definitions/ShiftCostingData" }, "discard": { "type": "boolean", "title": "Boolean" }, "attachment": { "$ref": "#/definitions/AttachmentModel" }, "shiftConditionIds": { "type": "array", "items": { "format": "int32", "type": "integer", "title": "Int32" }, "title": "IList" }, "isOverlapping": { "type": "boolean", "title": "Boolean" }, "overdrawsLeave": { "type": "boolean", "title": "Boolean" }, "reviewedBy": { "type": "string", "title": "String" }, "durationOverride": { "type": "string", "title": "Nullable" }, "workDurationInMinutes": { "format": "double", "type": "number", "readOnly": true, "title": "Double" }, "breaksDurationInMinutes": { "format": "double", "type": "number", "readOnly": true, "title": "Double" }, "totalDurationInMinutes": { "format": "double", "type": "number", "readOnly": true, "title": "Double" } }, "xml": { "name": "TimesheetLineViewModel" }, "title": "TimesheetLineViewModel" }, "DeviceTokenModel": { "type": "object", "properties": { "token": { "type": "string", "title": "String" }, "platform": { "enum": [ "iOS", "Android" ], "type": "string", "title": "MobilePlatform" } }, "xml": { "name": "DeviceTokenModel" }, "title": "DeviceTokenModel" }, "TimeAndAttendanceLookupDataModel": { "type": "object", "properties": { "locations": { "type": "array", "items": { "$ref": "#/definitions/LocationSelectModel" }, "xml": { "name": "LocationSelectModel", "wrapped": true }, "title": "IList" }, "workTypes": { "type": "array", "items": { "$ref": "#/definitions/WorkTypeSelectModel" }, "xml": { "name": "WorkTypeSelectModel", "wrapped": true }, "title": "IList" }, "classifications": { "type": "array", "items": { "$ref": "#/definitions/ClassificationLookupModel" }, "xml": { "name": "ClassificationLookupModel", "wrapped": true }, "title": "IList" }, "defaultLocation": { "$ref": "#/definitions/LocationSelectModel" }, "shiftConditions": { "type": "array", "items": { "$ref": "#/definitions/ShiftConditionSelectModel" }, "xml": { "name": "ShiftConditionSelectModel", "wrapped": true }, "title": "IList" }, "locationShiftConditions": { "type": "array", "items": { "$ref": "#/definitions/LocationShiftConditionsModel" }, "xml": { "name": "LocationShiftConditionsModel", "wrapped": true }, "title": "IList" } }, "xml": { "name": "TimeAndAttendanceLookupDataModel" }, "title": "TimeAndAttendanceLookupDataModel" }, "LocationSelectModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "description": { "type": "string", "title": "String" } }, "xml": { "name": "LocationSelectModel" }, "title": "LocationSelectModel" }, "WorkTypeSelectModel": { "type": "object", "properties": { "isUnitBased": { "type": "boolean", "title": "Boolean" }, "isLeaveType": { "type": "boolean", "title": "Boolean" }, "unitType": { "type": "string", "title": "String" }, "id": { "format": "int32", "type": "integer", "title": "Int32" }, "description": { "type": "string", "title": "String" } }, "xml": { "name": "WorkTypeSelectModel" }, "title": "WorkTypeSelectModel" }, "ClassificationLookupModel": { "description": "temporary class until ClassificationSelectModel uses the same base class as the other two", "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "description": { "type": "string", "title": "String" } }, "xml": { "name": "ClassificationLookupModel" }, "title": "ClassificationLookupModel" }, "ShiftConditionSelectModel": { "type": "object", "properties": { "shortCode": { "type": "string", "title": "String" }, "id": { "format": "int32", "type": "integer", "title": "Int32" }, "description": { "type": "string", "title": "String" } }, "xml": { "name": "ShiftConditionSelectModel" }, "title": "ShiftConditionSelectModel" }, "LocationShiftConditionsModel": { "type": "object", "properties": { "locationId": { "format": "int32", "type": "integer", "title": "Int32" }, "shiftConditionIds": { "type": "array", "items": { "format": "int32", "type": "integer", "title": "Int32" }, "title": "IList" } }, "xml": { "name": "LocationShiftConditionsModel" }, "title": "LocationShiftConditionsModel" }, "ClockOnModel": { "type": "object", "properties": { "locationId": { "format": "int32", "type": "integer", "title": "Nullable" }, "classificationId": { "format": "int32", "type": "integer", "title": "Nullable" }, "workTypeId": { "format": "int32", "type": "integer", "title": "Nullable" }, "shiftConditionIds": { "type": "array", "items": { "format": "int32", "type": "integer", "title": "Int32" }, "title": "IList" }, "note": { "type": "string", "title": "String" }, "employeeId": { "format": "int32", "type": "integer", "title": "Nullable" }, "latitude": { "format": "double", "type": "number", "title": "Nullable" }, "longitude": { "format": "double", "type": "number", "title": "Nullable" }, "kioskId": { "format": "int32", "type": "integer", "title": "Nullable" }, "ipAddress": { "type": "string", "title": "String" }, "image": { "format": "byte", "type": "string", "title": "Byte[]" }, "isAdminInitiated": { "type": "boolean", "title": "Boolean" }, "recordedTimeUtc": { "format": "date-time", "type": "string", "title": "Nullable" }, "utcOffset": { "type": "string", "title": "Nullable" }, "noteVisibility": { "enum": [ "Hidden", "Visible" ], "type": "string", "title": "Nullable" } }, "xml": { "name": "ClockOnModel" }, "title": "ClockOnModel" }, "ClockOffModel": { "type": "object", "properties": { "note": { "type": "string", "title": "String" }, "employeeId": { "format": "int32", "type": "integer", "title": "Nullable" }, "latitude": { "format": "double", "type": "number", "title": "Nullable" }, "longitude": { "format": "double", "type": "number", "title": "Nullable" }, "kioskId": { "format": "int32", "type": "integer", "title": "Nullable" }, "ipAddress": { "type": "string", "title": "String" }, "image": { "format": "byte", "type": "string", "title": "Byte[]" }, "isAdminInitiated": { "type": "boolean", "title": "Boolean" }, "recordedTimeUtc": { "format": "date-time", "type": "string", "title": "Nullable" }, "utcOffset": { "type": "string", "title": "Nullable" }, "noteVisibility": { "enum": [ "Hidden", "Visible" ], "type": "string", "title": "Nullable" } }, "xml": { "name": "ClockOffModel" }, "title": "ClockOffModel" }, "StartBreakModel": { "type": "object", "properties": { "employeeId": { "format": "int32", "type": "integer", "title": "Nullable" }, "latitude": { "format": "double", "type": "number", "title": "Nullable" }, "longitude": { "format": "double", "type": "number", "title": "Nullable" }, "kioskId": { "format": "int32", "type": "integer", "title": "Nullable" }, "ipAddress": { "type": "string", "title": "String" }, "image": { "format": "byte", "type": "string", "title": "Byte[]" }, "isAdminInitiated": { "type": "boolean", "title": "Boolean" }, "recordedTimeUtc": { "format": "date-time", "type": "string", "title": "Nullable" }, "utcOffset": { "type": "string", "title": "Nullable" }, "noteVisibility": { "enum": [ "Hidden", "Visible" ], "type": "string", "title": "Nullable" } }, "xml": { "name": "StartBreakModel" }, "title": "StartBreakModel" }, "EndBreakModel": { "type": "object", "properties": { "employeeId": { "format": "int32", "type": "integer", "title": "Nullable" }, "latitude": { "format": "double", "type": "number", "title": "Nullable" }, "longitude": { "format": "double", "type": "number", "title": "Nullable" }, "kioskId": { "format": "int32", "type": "integer", "title": "Nullable" }, "ipAddress": { "type": "string", "title": "String" }, "image": { "format": "byte", "type": "string", "title": "Byte[]" }, "isAdminInitiated": { "type": "boolean", "title": "Boolean" }, "recordedTimeUtc": { "format": "date-time", "type": "string", "title": "Nullable" }, "utcOffset": { "type": "string", "title": "Nullable" }, "noteVisibility": { "enum": [ "Hidden", "Visible" ], "type": "string", "title": "Nullable" } }, "xml": { "name": "EndBreakModel" }, "title": "EndBreakModel" }, "GetShiftsModel": { "type": "object", "properties": { "kioskId": { "format": "int32", "type": "integer", "title": "Nullable" }, "locationId": { "format": "int32", "type": "integer", "title": "Nullable" }, "employeeId": { "format": "int32", "type": "integer", "title": "Nullable" }, "fromDateUtc": { "format": "date-time", "type": "string", "title": "Nullable" }, "toDateUtc": { "format": "date-time", "type": "string", "title": "Nullable" } }, "xml": { "name": "GetShiftsModel" }, "title": "GetShiftsModel" }, "TimeAndAttendanceShiftModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "startTimeLocal": { "format": "date-time", "type": "string", "title": "DateTime" }, "startTimeUtc": { "format": "date-time", "type": "string", "title": "DateTime" }, "endTimeUtc": { "format": "date-time", "type": "string", "title": "Nullable" }, "endTimeLocal": { "format": "date-time", "type": "string", "title": "Nullable" }, "classificationId": { "format": "int32", "type": "integer", "title": "Nullable" }, "classificationName": { "type": "string", "title": "String" }, "locationId": { "format": "int32", "type": "integer", "title": "Int32" }, "locationFullyQualifiedName": { "type": "string", "title": "String" }, "workTypeId": { "format": "int32", "type": "integer", "title": "Nullable" }, "workTypeName": { "type": "string", "title": "String" }, "kioskId": { "format": "int32", "type": "integer", "title": "Int32" }, "kioskName": { "type": "string", "title": "String" }, "timesheetLineId": { "format": "int32", "type": "integer", "title": "Nullable" }, "employee": { "$ref": "#/definitions/BasicKioskEmployeeModel" }, "breaks": { "type": "array", "items": { "$ref": "#/definitions/TimeAndAttendanceBreakModel" }, "xml": { "name": "TimeAndAttendanceBreakModel", "wrapped": true }, "title": "IList" }, "shiftConditions": { "type": "array", "items": { "$ref": "#/definitions/ShiftConditionModel" }, "xml": { "name": "ShiftConditionModel", "wrapped": true }, "title": "IList" } }, "xml": { "name": "TimeAndAttendanceShiftModel" }, "title": "TimeAndAttendanceShiftModel" }, "BasicKioskEmployeeModel": { "type": "object", "properties": { "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "firstName": { "type": "string", "title": "String" }, "surname": { "type": "string", "title": "String" }, "name": { "type": "string", "title": "String" }, "hasEmail": { "type": "boolean", "title": "Boolean" }, "profileImageUrl": { "type": "string", "title": "String" }, "hasProfileImage": { "type": "boolean", "title": "Boolean" }, "mobileNumber": { "type": "string", "title": "String" }, "status": { "enum": [ "NotClockedOn", "ClockedOn", "OnBreak", "ClockedOff" ], "type": "string", "title": "TimeAttendanceStatus" }, "longShift": { "type": "boolean", "title": "Boolean" }, "clockOnTimeUtc": { "format": "date-time", "type": "string", "title": "Nullable" }, "breakStartTimeUtc": { "format": "date-time", "type": "string", "title": "Nullable" }, "recordedTimeUtc": { "format": "date-time", "type": "string", "title": "Nullable" }, "currentShiftId": { "format": "int32", "type": "integer", "title": "Nullable" } }, "xml": { "name": "BasicKioskEmployeeModel" }, "title": "BasicKioskEmployeeModel" }, "TimeAndAttendanceBreakModel": { "type": "object", "properties": { "startTimeUtc": { "format": "date-time", "type": "string", "title": "DateTime" }, "startTimeLocal": { "format": "date-time", "type": "string", "title": "DateTime" }, "endTimeUtc": { "format": "date-time", "type": "string", "title": "Nullable" }, "endTimeLocal": { "format": "date-time", "type": "string", "title": "Nullable" } }, "xml": { "name": "TimeAndAttendanceBreakModel" }, "title": "TimeAndAttendanceBreakModel" }, "ShiftConditionModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "name": { "type": "string", "title": "String" } }, "xml": { "name": "ShiftConditionModel" }, "title": "ShiftConditionModel" }, "AddNoteModel": { "type": "object", "properties": { "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "type": { "enum": [ "Shift", "ClockOn", "ClockOff" ], "type": "string", "title": "TimeAttendanceShiftNoteType" }, "visibility": { "enum": [ "Hidden", "Visible" ], "type": "string", "title": "TimeAttendanceShiftNoteVisibility" }, "note": { "type": "string", "title": "String" }, "isAdminInitiated": { "type": "boolean", "title": "Boolean" } }, "xml": { "name": "AddNoteModel" }, "title": "AddNoteModel" }, "GetShiftNotesModel": { "type": "object", "properties": { "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "isAdminInitiated": { "type": "boolean", "title": "Boolean" }, "type": { "enum": [ "Shift", "ClockOn", "ClockOff" ], "type": "string", "title": "Nullable" }, "visibility": { "enum": [ "Hidden", "Visible" ], "type": "string", "title": "Nullable" } }, "xml": { "name": "GetShiftNotesModel" }, "title": "GetShiftNotesModel" }, "MarkNotesReadViewModel": { "type": "object", "properties": { "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "noteIds": { "type": "array", "items": { "format": "int32", "type": "integer", "title": "Int32" }, "title": "Int32[]" }, "read": { "type": "boolean", "title": "Boolean" } }, "xml": { "name": "MarkNotesReadViewModel" }, "title": "MarkNotesReadViewModel" }, "EssPaymentSummaryModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "period": { "type": "string", "title": "String" }, "isEtp": { "type": "boolean", "title": "Boolean" }, "etpCode": { "type": "string", "title": "String" } }, "xml": { "name": "EssPaymentSummaryModel" }, "title": "EssPaymentSummaryModel" }, "EssDocumentModel": { "type": "object", "properties": { "id": { "type": "string", "title": "String" }, "friendlyName": { "type": "string", "title": "String" }, "dateCreated": { "format": "date-time", "type": "string", "title": "DateTime" } }, "xml": { "name": "EssDocumentModel" }, "title": "EssDocumentModel" }, "EmployeeUnavailabilityFilter": { "type": "object", "properties": { "fromDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "toDate": { "format": "date-time", "type": "string", "title": "Nullable" } }, "xml": { "name": "EmployeeUnavailabilityFilter" }, "title": "EmployeeUnavailabilityFilter" }, "EssUnavailabilityModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "fromDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "toDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "endDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "reason": { "type": "string", "title": "String" }, "recurring": { "type": "boolean", "title": "Boolean" }, "recurringDay": { "enum": [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], "type": "string", "title": "Nullable" }, "isAllDay": { "type": "boolean", "readOnly": true, "title": "Boolean" }, "viewOnly": { "type": "boolean", "title": "Boolean" } }, "xml": { "name": "EssUnavailabilityModel" }, "title": "EssUnavailabilityModel" }, "UnavailabilityEditModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "fromDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "toDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "endDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "reason": { "type": "string", "title": "String" }, "recurring": { "type": "boolean", "title": "Boolean" }, "recurringDay": { "enum": [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], "type": "string", "title": "Nullable" }, "isAllDay": { "type": "boolean", "readOnly": true, "title": "Boolean" }, "viewOnly": { "type": "boolean", "title": "Boolean" } }, "xml": { "name": "UnavailabilityEditModel" }, "title": "UnavailabilityEditModel" }, "AvailableEmployeeModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "name": { "type": "string", "title": "String" }, "businessId": { "format": "int32", "type": "integer", "title": "Int32" }, "businessName": { "type": "string", "title": "String" }, "jobTitle": { "type": "string", "title": "String" }, "hasProfileImage": { "type": "boolean", "title": "Boolean" }, "branding": { "$ref": "#/definitions/WhiteLabelBrandingModel" }, "defaultLocationId": { "format": "int32", "type": "integer", "title": "Int32" }, "profileImageUrl": { "type": "string", "title": "String" } }, "xml": { "name": "AvailableEmployeeModel" }, "title": "AvailableEmployeeModel" }, "WhiteLabelBrandingModel": { "type": "object", "properties": { "logoUrl": { "type": "string", "title": "String" }, "backgroundImageUrl": { "type": "string", "title": "String" }, "backgroundColour": { "type": "string", "title": "String" }, "textColour": { "type": "string", "title": "String" }, "textHoverColour": { "type": "string", "title": "String" }, "textSecondaryColour": { "type": "string", "title": "String" } }, "xml": { "name": "WhiteLabelBrandingModel" }, "title": "WhiteLabelBrandingModel" }, "RecoverPasswordModel": { "required": [ "username" ], "type": "object", "properties": { "username": { "type": "string", "title": "String" }, "messageType": { "enum": [ "NewPaySlipAvailable", "NewUser", "RecoverPassword", "EmployeeAccess", "BusinessAccess", "CancelAccount", "Invoice", "InvoicePaymentSuccessNotification", "AutomatedPassword", "LeaveRequestNotification", "RestrictedAccess", "ResendPayslip", "PaymentSummaryAvailable", "SuperPaymentsUpdateResults", "InvoicePaymentFailedNotification", "NewShiftsPublished", "ShiftsUnpublished", "ShiftDeclined", "KioskAccessGranted", "DailyNotifications", "BsbDataImported", "InvoiceeCardDetailsRemoved", "WhiteLabelManagerAccess", "ResellerAccess", "DirectDepositReminder", "DataIntegrityCheckFailed", "ExpenseRequestNotification", "UnavailabilityNotification", "ReportPackGenerated", "ReportPackError", "SystemPublicHolidayImport", "TimesheetRejected", "ShiftRepublished", "PendingShiftsReminder", "EmployeeShiftActionTimeout", "InitiateEmployeeOnboarding", "FollowUpEmployeeOnboarding", "CompleteEmployeeOnboarding", "NewShiftsPreAccepted", "PayRunTaskNotification", "ShiftSwapCancelled", "BulkShiftSwapsCancelled", "ShiftSwapAwaitingApproval", "ShiftSwapProposed", "ShiftSwapAccepted", "ShiftSwapDeclined", "ShiftSwapRejected", "ShiftSwapApproved" ], "type": "string", "title": "MessageTypeEnum" } }, "xml": { "name": "RecoverPasswordModel" }, "title": "RecoverPasswordModel" }, "EmployeeExpensePaymentSummaryModel": { "type": "object", "properties": { "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "expenseCategoryId": { "format": "int32", "type": "integer", "title": "Int32" }, "expenseCategoryName": { "type": "string", "title": "String" }, "ytdAmount": { "format": "double", "type": "number", "title": "Decimal" }, "totalAmount": { "format": "double", "type": "number", "title": "Decimal" } }, "xml": { "name": "EmployeeExpensePaymentSummaryModel" }, "title": "EmployeeExpensePaymentSummaryModel" }, "EssExpenseRequestResponseModel": { "type": "object", "properties": { "canCancel": { "type": "boolean", "readOnly": true, "title": "Boolean" }, "canModify": { "type": "boolean", "readOnly": true, "title": "Boolean" }, "id": { "format": "int32", "type": "integer", "title": "Int32" }, "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "employeeName": { "type": "string", "title": "String" }, "status": { "type": "string", "title": "String" }, "description": { "type": "string", "title": "String" }, "lineItems": { "type": "array", "items": { "$ref": "#/definitions/ExpenseRequestLineItemModel" }, "xml": { "name": "ExpenseRequestLineItemModel", "wrapped": true }, "title": "List" }, "attachments": { "type": "array", "items": { "$ref": "#/definitions/AttachmentModel" }, "xml": { "name": "AttachmentModel", "wrapped": true }, "title": "List" }, "statusUpdatedByUser": { "type": "string", "title": "String" }, "statusUpdateNotes": { "type": "string", "title": "String" }, "dateStatusUpdated": { "format": "date-time", "type": "string", "title": "DateTime" } }, "xml": { "name": "EssExpenseRequestResponseModel" }, "title": "EssExpenseRequestResponseModel" }, "LeaveAllowanceModel": { "type": "object", "properties": { "leaveCategoryId": { "type": "string", "title": "String" }, "leaveCategoryName": { "type": "string", "title": "String" }, "units": { "format": "double", "type": "number", "title": "Nullable" }, "unitType": { "type": "string", "title": "String" }, "hoursPerYear": { "format": "double", "type": "number", "title": "Decimal" }, "automaticallyAccrues": { "type": "boolean", "title": "Boolean" }, "leaveLoading": { "format": "double", "type": "number", "title": "Decimal" } }, "xml": { "name": "LeaveAllowanceModel" }, "title": "LeaveAllowanceModel" }, "SubmitEmployeeLeaveAllowancesRequest": { "type": "object", "properties": { "employeeIdType": { "enum": [ "Standard", "External" ], "type": "string", "title": "IdType" }, "leaveCategoryIdType": { "enum": [ "Standard", "External" ], "type": "string", "title": "IdType" }, "leaveAllowances": { "type": "object", "additionalProperties": { "type": "array", "items": { "$ref": "#/definitions/LeaveAllowanceModel" }, "xml": { "name": "LeaveAllowanceModel", "wrapped": true }, "title": "List" }, "title": "Dictionary" } }, "xml": { "name": "SubmitEmployeeLeaveAllowancesRequest" }, "title": "SubmitEmployeeLeaveAllowancesRequest" }, "ODataQueryOptions[LeaveAllowanceTemplate]": { "type": "object", "properties": { "ifMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "ifNoneMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "context": { "$ref": "#/definitions/ODataQueryContext", "readOnly": true }, "request": { "type": "object", "readOnly": true, "title": "HttpRequestMessage" }, "rawValues": { "$ref": "#/definitions/ODataRawQueryOptions", "readOnly": true }, "selectExpand": { "$ref": "#/definitions/SelectExpandQueryOption", "readOnly": true }, "filter": { "$ref": "#/definitions/FilterQueryOption", "readOnly": true }, "orderBy": { "$ref": "#/definitions/OrderByQueryOption", "readOnly": true }, "skip": { "$ref": "#/definitions/SkipQueryOption", "readOnly": true }, "top": { "$ref": "#/definitions/TopQueryOption", "readOnly": true }, "inlineCount": { "$ref": "#/definitions/InlineCountQueryOption", "readOnly": true }, "validator": { "$ref": "#/definitions/ODataQueryValidator" } }, "xml": { "name": "ODataQueryOptions`1" }, "title": "ODataQueryOptions" }, "ODataQueryOptions[LeaveCategory]": { "type": "object", "properties": { "ifMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "ifNoneMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "context": { "$ref": "#/definitions/ODataQueryContext", "readOnly": true }, "request": { "type": "object", "readOnly": true, "title": "HttpRequestMessage" }, "rawValues": { "$ref": "#/definitions/ODataRawQueryOptions", "readOnly": true }, "selectExpand": { "$ref": "#/definitions/SelectExpandQueryOption", "readOnly": true }, "filter": { "$ref": "#/definitions/FilterQueryOption", "readOnly": true }, "orderBy": { "$ref": "#/definitions/OrderByQueryOption", "readOnly": true }, "skip": { "$ref": "#/definitions/SkipQueryOption", "readOnly": true }, "top": { "$ref": "#/definitions/TopQueryOption", "readOnly": true }, "inlineCount": { "$ref": "#/definitions/InlineCountQueryOption", "readOnly": true }, "validator": { "$ref": "#/definitions/ODataQueryValidator" } }, "xml": { "name": "ODataQueryOptions`1" }, "title": "ODataQueryOptions" }, "LeaveCategoryModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "name": { "type": "string", "title": "String" }, "unitType": { "enum": [ "Days", "Weeks", "HoursPerHourWorked", "HoursPerPayRun" ], "type": "string", "title": "LeaveAllowanceUnitEnum" }, "units": { "format": "double", "type": "number", "title": "Decimal" }, "automaticallyAccrues": { "type": "boolean", "title": "Boolean" }, "isPrivate": { "type": "boolean", "title": "Boolean" }, "excludeFromTerminationPayout": { "type": "boolean", "title": "Boolean" }, "externalId": { "type": "string", "title": "String" }, "source": { "type": "string", "title": "String" }, "leaveLoading": { "format": "double", "type": "number", "title": "Decimal" }, "contingentPeriod": { "format": "double", "type": "number", "title": "Nullable" }, "entitlementPeriod": { "format": "double", "type": "number", "title": "Nullable" }, "isBalanceUntracked": { "type": "boolean", "title": "Boolean" }, "leaveCategoryType": { "enum": [ "Standard", "LongServiceLeave" ], "type": "string", "title": "LeaveCategoryTypeEnum" }, "deductFromPrimaryPayCategory": { "type": "boolean", "title": "Boolean" }, "deductFromPayCategoryId": { "format": "int32", "type": "integer", "title": "Nullable" }, "transferToPayCategoryId": { "format": "int32", "type": "integer", "title": "Nullable" }, "hideAccrualsOnPayslip": { "type": "boolean", "title": "Boolean" }, "useDeductFromPayCategoryRate": { "type": "boolean", "title": "Boolean" } }, "xml": { "name": "LeaveCategoryModel" }, "title": "LeaveCategoryModel" }, "LeaveRequestFilterModel": { "type": "object", "properties": { "status": { "enum": [ "Pending", "Approved", "Cancelled", "Rejected" ], "type": "string", "title": "Nullable" }, "fromDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "toDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "leaveCategoryId": { "format": "int32", "type": "integer", "title": "Nullable" }, "locationId": { "format": "int32", "type": "integer", "title": "Nullable" }, "employeeId": { "format": "int32", "type": "integer", "title": "Nullable" }, "groupBy": { "enum": [ "Employee", "LeaveType" ], "type": "string", "title": "LeaveRequestGroupBy" }, "restrictOverlappingLeave": { "type": "boolean", "title": "Boolean" } }, "xml": { "name": "LeaveRequestFilterModel" }, "title": "LeaveRequestFilterModel" }, "LeaveRequestResponseModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "leaveCategoryId": { "format": "int32", "type": "integer", "title": "Int32" }, "employee": { "type": "string", "title": "String" }, "leaveCategory": { "type": "string", "title": "String" }, "fromDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "toDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "totalHours": { "format": "double", "type": "number", "title": "Decimal" }, "hoursApplied": { "format": "double", "type": "number", "title": "Decimal" }, "notes": { "type": "string", "title": "String" }, "status": { "type": "string", "title": "String" }, "attachmentId": { "format": "int32", "type": "integer", "title": "Nullable" } }, "xml": { "name": "LeaveRequestResponseModel" }, "title": "LeaveRequestResponseModel" }, "ODataQueryOptions[LeaveRequest]": { "type": "object", "properties": { "ifMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "ifNoneMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "context": { "$ref": "#/definitions/ODataQueryContext", "readOnly": true }, "request": { "type": "object", "readOnly": true, "title": "HttpRequestMessage" }, "rawValues": { "$ref": "#/definitions/ODataRawQueryOptions", "readOnly": true }, "selectExpand": { "$ref": "#/definitions/SelectExpandQueryOption", "readOnly": true }, "filter": { "$ref": "#/definitions/FilterQueryOption", "readOnly": true }, "orderBy": { "$ref": "#/definitions/OrderByQueryOption", "readOnly": true }, "skip": { "$ref": "#/definitions/SkipQueryOption", "readOnly": true }, "top": { "$ref": "#/definitions/TopQueryOption", "readOnly": true }, "inlineCount": { "$ref": "#/definitions/InlineCountQueryOption", "readOnly": true }, "validator": { "$ref": "#/definitions/ODataQueryValidator" } }, "xml": { "name": "ODataQueryOptions`1" }, "title": "ODataQueryOptions" }, "ApiLeaveApplicationModel": { "required": [ "fromDate", "toDate", "hours", "leaveCategoryId" ], "type": "object", "properties": { "automaticallyApprove": { "type": "boolean", "title": "Boolean" }, "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "requireNotesForLeaveRequests": { "type": "boolean", "title": "Boolean" }, "attachment": { "$ref": "#/definitions/AttachmentModel" }, "id": { "format": "int32", "type": "integer", "title": "Int32" }, "fromDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "toDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "hours": { "format": "double", "maximum": 2000, "type": "number", "title": "Decimal" }, "leaveCategoryId": { "format": "int32", "type": "integer", "title": "Nullable" }, "notes": { "maxLength": 255, "type": "string", "title": "String" } }, "xml": { "name": "ApiLeaveApplicationModel" }, "title": "ApiLeaveApplicationModel" }, "DeclineLeaveRequest": { "type": "object", "properties": { "reason": { "type": "string", "title": "String" } }, "xml": { "name": "DeclineLeaveRequest" }, "title": "DeclineLeaveRequest" }, "ODataQueryOptions[Location]": { "type": "object", "properties": { "ifMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "ifNoneMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "context": { "$ref": "#/definitions/ODataQueryContext", "readOnly": true }, "request": { "type": "object", "readOnly": true, "title": "HttpRequestMessage" }, "rawValues": { "$ref": "#/definitions/ODataRawQueryOptions", "readOnly": true }, "selectExpand": { "$ref": "#/definitions/SelectExpandQueryOption", "readOnly": true }, "filter": { "$ref": "#/definitions/FilterQueryOption", "readOnly": true }, "orderBy": { "$ref": "#/definitions/OrderByQueryOption", "readOnly": true }, "skip": { "$ref": "#/definitions/SkipQueryOption", "readOnly": true }, "top": { "$ref": "#/definitions/TopQueryOption", "readOnly": true }, "inlineCount": { "$ref": "#/definitions/InlineCountQueryOption", "readOnly": true }, "validator": { "$ref": "#/definitions/ODataQueryValidator" } }, "xml": { "name": "ODataQueryOptions`1" }, "title": "ODataQueryOptions" }, "NameIdPair": { "type": "object", "properties": { "id": { "type": "string", "title": "String" }, "name": { "type": "string", "title": "String" } }, "xml": { "name": "NameIdPair" }, "title": "NameIdPair" }, "EssDeclineRosterShiftModel": { "required": [ "reason" ], "type": "object", "properties": { "reason": { "type": "string", "title": "String" } }, "xml": { "name": "EssDeclineRosterShiftModel" }, "title": "EssDeclineRosterShiftModel" }, "EssBulkAcceptRosterShiftsModel": { "type": "object", "properties": { "shifts": { "type": "array", "items": { "format": "int32", "type": "integer", "title": "Int32" }, "title": "IList" } }, "xml": { "name": "EssBulkAcceptRosterShiftsModel" }, "title": "EssBulkAcceptRosterShiftsModel" }, "EssBulkDeclineRosterShiftsModel": { "required": [ "reason" ], "type": "object", "properties": { "reason": { "type": "string", "title": "String" }, "shifts": { "type": "array", "items": { "format": "int32", "type": "integer", "title": "Int32" }, "title": "IList" } }, "xml": { "name": "EssBulkDeclineRosterShiftsModel" }, "title": "EssBulkDeclineRosterShiftsModel" }, "RosterShiftMatchingResultModel": { "type": "object", "properties": { "shift": { "$ref": "#/definitions/EssRosterShiftModel" } }, "xml": { "name": "RosterShiftMatchingResultModel" }, "title": "RosterShiftMatchingResultModel" }, "SwapShiftModel": { "type": "object", "properties": { "rosterShiftId": { "format": "int32", "type": "integer", "title": "Int32" }, "fromEmployeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "toEmployeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "note": { "type": "string", "title": "String" }, "dateCreated": { "format": "date-time", "type": "string", "title": "Nullable" }, "createdByUserId": { "format": "int32", "type": "integer", "title": "Nullable" }, "token": { "type": "string", "title": "String" } }, "xml": { "name": "SwapShiftModel" }, "title": "SwapShiftModel" }, "EssBulkRosterShiftSwapModel": { "type": "object", "properties": { "shifts": { "type": "array", "items": { "format": "int32", "type": "integer", "title": "Int32" }, "title": "IList" } }, "xml": { "name": "EssBulkRosterShiftSwapModel" }, "title": "EssBulkRosterShiftSwapModel" }, "TasksReportRequestModel": { "type": "object", "properties": { "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "payRunId": { "format": "int32", "type": "integer", "title": "Int32" }, "fromDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "toDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "payScheduleId": { "format": "int32", "type": "integer", "title": "Int32" }, "status": { "enum": [ "All", "Completed", "NotCompleted" ], "type": "string", "title": "TasksReportStatusEnum" } }, "xml": { "name": "TasksReportRequestModel" }, "title": "TasksReportRequestModel" }, "TasksReportExportModel": { "type": "object", "properties": { "payRunTaskId": { "format": "int32", "type": "integer", "title": "Int32" }, "employeeName": { "type": "string", "title": "String" }, "employeeId": { "format": "int32", "type": "integer", "title": "Nullable" }, "externalId": { "type": "string", "title": "String" }, "taskDescription": { "type": "string", "title": "String" }, "createdBy": { "type": "string", "title": "String" }, "createdDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "dueDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "completed": { "type": "boolean", "title": "Boolean" }, "notes": { "type": "array", "items": { "$ref": "#/definitions/TasksReportNoteModel" }, "xml": { "name": "TasksReportNoteModel", "wrapped": true }, "title": "List" }, "completedBy": { "type": "string", "title": "String" }, "completedDate": { "format": "date-time", "type": "string", "title": "Nullable" } }, "xml": { "name": "TasksReportExportModel" }, "title": "TasksReportExportModel" }, "TasksReportNoteModel": { "type": "object", "properties": { "username": { "type": "string", "title": "String" }, "dateCreated": { "format": "date-time", "type": "string", "title": "DateTime" }, "note": { "type": "string", "title": "String" }, "isVisibleToManager": { "type": "boolean", "title": "Boolean" } }, "xml": { "name": "TasksReportNoteModel" }, "title": "TasksReportNoteModel" }, "ShiftSwappingReportRequestModel": { "type": "object", "properties": { "fromEmployeeId": { "format": "int32", "type": "integer", "title": "Nullable" }, "toEmployeeId": { "format": "int32", "type": "integer", "title": "Nullable" }, "includeCosts": { "type": "boolean", "title": "Boolean" }, "statuses": { "type": "array", "items": { "enum": [ "Created", "Cancelled", "Accepted", "Declined", "AwaitingManagerApproval", "ApprovedByManager", "RejectedByManager" ], "type": "string", "title": "RosterShiftSwapStatusEnum" }, "xml": { "name": "RosterShiftSwapStatusEnum", "wrapped": true }, "title": "IList" }, "fromDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "toDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "locationId": { "format": "int32", "type": "integer", "title": "Int32" }, "employingEntityId": { "format": "int32", "type": "integer", "title": "Nullable" } }, "xml": { "name": "ShiftSwappingReportRequestModel" }, "title": "ShiftSwappingReportRequestModel" }, "ShiftSwappingReportExportModel": { "type": "object", "properties": { "fromEmployeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "fromEmployeeName": { "type": "string", "title": "String" }, "toEmployeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "toEmployeeName": { "type": "string", "title": "String" }, "start": { "format": "date-time", "type": "string", "title": "DateTime" }, "startTime": { "type": "string", "title": "TimeSpan" }, "end": { "format": "date-time", "type": "string", "title": "DateTime" }, "endTime": { "type": "string", "title": "TimeSpan" }, "locationId": { "type": "string", "title": "String" }, "location": { "type": "string", "title": "String" }, "workTypeId": { "type": "string", "title": "String" }, "workType": { "type": "string", "title": "String" }, "status": { "type": "string", "title": "String" }, "oldCost": { "format": "double", "type": "number", "title": "Nullable" }, "newCost": { "format": "double", "type": "number", "title": "Nullable" } }, "xml": { "name": "ShiftSwappingReportExportModel" }, "title": "ShiftSwappingReportExportModel" }, "ODataQueryOptions[PayCategory]": { "type": "object", "properties": { "ifMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "ifNoneMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "context": { "$ref": "#/definitions/ODataQueryContext", "readOnly": true }, "request": { "type": "object", "readOnly": true, "title": "HttpRequestMessage" }, "rawValues": { "$ref": "#/definitions/ODataRawQueryOptions", "readOnly": true }, "selectExpand": { "$ref": "#/definitions/SelectExpandQueryOption", "readOnly": true }, "filter": { "$ref": "#/definitions/FilterQueryOption", "readOnly": true }, "orderBy": { "$ref": "#/definitions/OrderByQueryOption", "readOnly": true }, "skip": { "$ref": "#/definitions/SkipQueryOption", "readOnly": true }, "top": { "$ref": "#/definitions/TopQueryOption", "readOnly": true }, "inlineCount": { "$ref": "#/definitions/InlineCountQueryOption", "readOnly": true }, "validator": { "$ref": "#/definitions/ODataQueryValidator" } }, "xml": { "name": "ODataQueryOptions`1" }, "title": "ODataQueryOptions" }, "PayCategoryModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "parentId": { "format": "int32", "type": "integer", "title": "Nullable" }, "name": { "type": "string", "title": "String" }, "rateUnit": { "enum": [ "Hourly", "Annually", "Fixed", "Daily" ], "type": "string", "title": "RateUnitEnum" }, "accruesLeave": { "type": "boolean", "title": "Boolean" }, "defaultSuperRate": { "format": "double", "type": "number", "title": "Decimal" }, "rateLoadingPercent": { "format": "double", "type": "number", "title": "Decimal" }, "penaltyLoadingPercent": { "format": "double", "type": "number", "title": "Decimal" }, "isTaxExempt": { "type": "boolean", "title": "Boolean" }, "isPayrollTaxExempt": { "type": "boolean", "title": "Boolean" }, "externalId": { "type": "string", "title": "String" }, "source": { "type": "string", "title": "String" }, "generalLedgerMappingCode": { "type": "string", "title": "String" }, "superExpenseMappingCode": { "type": "string", "title": "String" }, "superLiabilityMappingCode": { "type": "string", "title": "String" }, "isSystemPayCategory": { "type": "boolean", "title": "Boolean" }, "numberOfDecimalPlaces": { "format": "int32", "type": "integer", "title": "Nullable" }, "paymentSummaryClassification": { "enum": [ "Default", "Allowance", "LumpSumATypeR", "LumpSumATypeT", "LumpSumB", "LumpSumD", "LumpSumE", "Exclude", "Cdep", "ExemptForeignEmploymentIncome" ], "type": "string", "title": "Nullable" } }, "xml": { "name": "PayCategoryModel" }, "title": "PayCategoryModel" }, "ODataQueryOptions[PaygPaymentSummarySnapshot]": { "type": "object", "properties": { "ifMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "ifNoneMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "context": { "$ref": "#/definitions/ODataQueryContext", "readOnly": true }, "request": { "type": "object", "readOnly": true, "title": "HttpRequestMessage" }, "rawValues": { "$ref": "#/definitions/ODataRawQueryOptions", "readOnly": true }, "selectExpand": { "$ref": "#/definitions/SelectExpandQueryOption", "readOnly": true }, "filter": { "$ref": "#/definitions/FilterQueryOption", "readOnly": true }, "orderBy": { "$ref": "#/definitions/OrderByQueryOption", "readOnly": true }, "skip": { "$ref": "#/definitions/SkipQueryOption", "readOnly": true }, "top": { "$ref": "#/definitions/TopQueryOption", "readOnly": true }, "inlineCount": { "$ref": "#/definitions/InlineCountQueryOption", "readOnly": true }, "validator": { "$ref": "#/definitions/ODataQueryValidator" } }, "xml": { "name": "ODataQueryOptions`1" }, "title": "ODataQueryOptions" }, "PaygPaymentSummaryModel": { "type": "object", "properties": { "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "employingEntityId": { "format": "int32", "type": "integer", "title": "Nullable" }, "dateGenerated": { "format": "date-time", "type": "string", "title": "DateTime" }, "paymentSummaryType": { "enum": [ "BusinessAndPersonalServicesIncome", "EmployeeTerminationPayment", "ForeignEmployment", "IndividualNonBusiness", "SuperannuationIncomeStream", "SuperannuationLumpSum" ], "type": "string", "title": "PaygPaymentSummaryTypeEnum" }, "status": { "enum": [ "Generated", "Published", "Unpublished" ], "type": "string", "title": "PaygPaymentSummaryStatus" }, "etpCode": { "type": "string", "title": "String" }, "isAmended": { "type": "boolean", "title": "Boolean" }, "payeeName": { "type": "string", "title": "String" }, "payeeAddress": { "type": "string", "title": "String" }, "payeeAddressLine2": { "type": "string", "title": "String" }, "payeeSuburb": { "type": "string", "title": "String" }, "payeePostCode": { "type": "string", "title": "String" }, "payeeState": { "type": "string", "title": "String" }, "paymentPeriodStart": { "format": "date-time", "type": "string", "title": "DateTime" }, "paymentPeriodEnd": { "format": "date-time", "type": "string", "title": "DateTime" }, "financialYearStart": { "format": "date-time", "type": "string", "title": "DateTime" }, "financialYearEnd": { "format": "date-time", "type": "string", "title": "DateTime" }, "payeeTaxFileNumber": { "type": "string", "title": "String" }, "totalTaxWithheld": { "format": "int32", "type": "integer", "title": "Int32" }, "grossPayments": { "format": "int32", "type": "integer", "title": "Int32" }, "cdepPayments": { "format": "int32", "type": "integer", "title": "Int32" }, "fringeBenefits": { "format": "int32", "type": "integer", "title": "Int32" }, "isExemptFromFringeBenefitsTax": { "type": "boolean", "title": "Nullable" }, "employerSuperContributions": { "format": "int32", "type": "integer", "title": "Int32" }, "totalAllowances": { "format": "int32", "type": "integer", "title": "Int32" }, "lumpSumA": { "format": "int32", "type": "integer", "title": "Int32" }, "lumpSumB": { "format": "int32", "type": "integer", "title": "Int32" }, "lumpSumD": { "format": "int32", "type": "integer", "title": "Int32" }, "lumpSumE": { "format": "int32", "type": "integer", "title": "Int32" }, "lumpSumAType": { "type": "string", "title": "String" }, "notReportedAmount": { "format": "int32", "type": "integer", "title": "Int32" }, "allowances": { "type": "object", "additionalProperties": { "format": "int32", "type": "integer", "title": "Int32" }, "title": "Dictionary" }, "unionFeeDeductions": { "type": "object", "additionalProperties": { "format": "int32", "type": "integer", "title": "Int32" }, "title": "Dictionary" }, "workplaceGiving": { "format": "int32", "type": "integer", "title": "Int32" }, "exemptForeignEmploymentIncome": { "format": "int32", "type": "integer", "title": "Int32" }, "deductibleAmountOfUndeductedAnnuityPrice": { "format": "int32", "type": "integer", "title": "Int32" }, "otherAmounts": { "type": "array", "items": { "$ref": "#/definitions/OtherAmounts" }, "xml": { "name": "OtherAmounts", "wrapped": true }, "title": "IList" }, "payerABN": { "type": "string", "title": "String" }, "payerName": { "type": "string", "title": "String" }, "payerBranch": { "type": "string", "title": "String" }, "payerSignatory": { "type": "string", "title": "String" }, "paymentDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "isTransitionalTerminationPayment": { "type": "boolean", "title": "Boolean" }, "isPartOfEarlierPayment": { "type": "boolean", "title": "Boolean" }, "taxableComponent": { "format": "int32", "type": "integer", "title": "Int32" }, "taxFreeComponent": { "format": "int32", "type": "integer", "title": "Int32" }, "payeeABN": { "type": "string", "title": "String" }, "paymentType": { "type": "string", "title": "String" }, "grossPaymentType": { "type": "string", "title": "String" }, "foreignTaxPaid": { "format": "int32", "type": "integer", "title": "Int32" }, "taxableComponentTaxedElement": { "format": "int32", "type": "integer", "title": "Int32" }, "taxableComponentUntaxedElement": { "format": "int32", "type": "integer", "title": "Int32" }, "taxableComponentTaxFreeComponent": { "format": "int32", "type": "integer", "title": "Int32" }, "taxableComponentTaxOffsetAmount": { "format": "int32", "type": "integer", "title": "Int32" }, "lumpSumInArrearsTaxedElement": { "format": "int32", "type": "integer", "title": "Int32" }, "lumpSumInArrearsUntaxedElement": { "format": "int32", "type": "integer", "title": "Int32" }, "lumpSumInArrearsTaxFreeComponent": { "format": "int32", "type": "integer", "title": "Int32" }, "isDeathBenefit": { "type": "boolean", "title": "Boolean" }, "deathBenefitType": { "type": "string", "title": "String" }, "inputGrossEarnings": { "format": "double", "type": "number", "title": "Nullable" }, "inputPreTaxDeductionAmount": { "format": "double", "type": "number", "title": "Nullable" }, "totalDeductions": { "format": "double", "type": "number", "readOnly": true, "title": "Decimal" } }, "xml": { "name": "PaygPaymentSummaryModel" }, "title": "PaygPaymentSummaryModel" }, "OtherAmounts": { "type": "object", "properties": { "workPlaceGiving": { "format": "double", "type": "number", "title": "Decimal" }, "exemptForeignExemptIncome": { "format": "double", "type": "number", "title": "Decimal" }, "deductibleAmountOfUndeductedAnnuityPrice": { "format": "double", "type": "number", "title": "Decimal" } }, "xml": { "name": "OtherAmounts" }, "title": "OtherAmounts" }, "ODataQueryOptions[PayRateTemplate]": { "type": "object", "properties": { "ifMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "ifNoneMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "context": { "$ref": "#/definitions/ODataQueryContext", "readOnly": true }, "request": { "type": "object", "readOnly": true, "title": "HttpRequestMessage" }, "rawValues": { "$ref": "#/definitions/ODataRawQueryOptions", "readOnly": true }, "selectExpand": { "$ref": "#/definitions/SelectExpandQueryOption", "readOnly": true }, "filter": { "$ref": "#/definitions/FilterQueryOption", "readOnly": true }, "orderBy": { "$ref": "#/definitions/OrderByQueryOption", "readOnly": true }, "skip": { "$ref": "#/definitions/SkipQueryOption", "readOnly": true }, "top": { "$ref": "#/definitions/TopQueryOption", "readOnly": true }, "inlineCount": { "$ref": "#/definitions/InlineCountQueryOption", "readOnly": true }, "validator": { "$ref": "#/definitions/ODataQueryValidator" } }, "xml": { "name": "ODataQueryOptions`1" }, "title": "ODataQueryOptions" }, "PayRunEmployeeExpenseResponse": { "type": "object", "properties": { "employeeExpenses": { "type": "object", "additionalProperties": { "type": "array", "items": { "$ref": "#/definitions/EmployeeExpenseModel" }, "xml": { "name": "EmployeeExpenseModel", "wrapped": true }, "title": "List" }, "readOnly": true, "title": "Dictionary" }, "payRunId": { "format": "int32", "type": "integer", "title": "Int32" } }, "xml": { "name": "PayRunEmployeeExpenseResponse" }, "example": { "employeeExpenses": { "12345": [ { "employeeExpenseCategoryId": "98", "employeeExpenseCategoryName": "My expense category", "notes": "Some notes", "amount": 12.34, "taxCode": "42rty", "taxRate": 0.5, "taxCodeDisplayName": "Tax Code Display", "id": 0, "externalId": null, "locationId": "39", "locationName": "My Location", "employeeId": "12345", "employeeName": "Bob Bobberson", "employeeExternalId": "EMP01" } ] }, "payRunId": 999 }, "title": "PayRunEmployeeExpenseResponse" }, "EmployeeExpenseModel": { "type": "object", "properties": { "employeeExpenseCategoryId": { "type": "string", "title": "String" }, "employeeExpenseCategoryName": { "type": "string", "title": "String" }, "notes": { "type": "string", "title": "String" }, "amount": { "format": "double", "type": "number", "title": "Decimal" }, "taxCode": { "type": "string", "title": "String" }, "taxRate": { "format": "double", "type": "number", "title": "Nullable" }, "taxCodeDisplayName": { "type": "string", "title": "String" }, "id": { "format": "int32", "type": "integer", "title": "Int32" }, "externalId": { "type": "string", "title": "String" }, "locationId": { "type": "string", "title": "String" }, "locationName": { "type": "string", "title": "String" }, "employeeId": { "type": "string", "title": "String" }, "employeeName": { "type": "string", "title": "String" }, "employeeExternalId": { "type": "string", "title": "String" } }, "xml": { "name": "EmployeeExpenseModel" }, "title": "EmployeeExpenseModel" }, "SubmitPayRunEmployeeExpenseRequest": { "type": "object", "properties": { "locationIdType": { "enum": [ "Standard", "External" ], "type": "string", "title": "IdType" }, "employeeExpenseCategoryIdType": { "enum": [ "Standard", "External" ], "type": "string", "title": "IdType" }, "expenses": { "type": "object", "additionalProperties": { "type": "array", "items": { "$ref": "#/definitions/EmployeeExpenseModel" }, "xml": { "name": "EmployeeExpenseModel", "wrapped": true }, "title": "List" }, "title": "Dictionary" }, "payRunId": { "format": "int32", "type": "integer", "title": "Int32" }, "employeeIdType": { "enum": [ "Standard", "External" ], "type": "string", "title": "IdType" }, "replaceExisting": { "type": "boolean", "title": "Boolean" }, "suppressCalculations": { "type": "boolean", "title": "Boolean" } }, "xml": { "name": "SubmitPayRunEmployeeExpenseRequest" }, "title": "SubmitPayRunEmployeeExpenseRequest" }, "PayRunDetailsModel": { "type": "object", "properties": { "payRun": { "$ref": "#/definitions/PayRunModel" }, "payRunTotals": { "type": "array", "items": { "$ref": "#/definitions/PayRunTotalGridModel" }, "xml": { "name": "PayRunTotalGridModel", "wrapped": true }, "title": "IList" }, "grandTotal": { "$ref": "#/definitions/PayRunGrandTotalModel" } }, "xml": { "name": "PayRunDetailsModel" }, "title": "PayRunDetailsModel" }, "PayRunModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "dateFinalised": { "format": "date-time", "type": "string", "title": "Nullable" }, "payScheduleId": { "format": "int32", "type": "integer", "title": "Int32" }, "payPeriodStarting": { "format": "date-time", "type": "string", "title": "DateTime" }, "payPeriodEnding": { "format": "date-time", "type": "string", "title": "DateTime" }, "datePaid": { "format": "date-time", "type": "string", "title": "DateTime" }, "isFinalised": { "type": "boolean", "title": "Boolean" }, "paySlipsPublished": { "type": "boolean", "title": "Boolean" }, "notation": { "type": "string", "title": "String" }, "externalId": { "type": "string", "title": "String" } }, "xml": { "name": "PayRunModel" }, "title": "PayRunModel" }, "PayRunTotalGridModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "employeeName": { "type": "string", "title": "String" }, "totalHours": { "format": "double", "type": "number", "title": "Decimal" }, "grossEarnings": { "format": "double", "type": "number", "title": "Decimal" }, "netEarnings": { "format": "double", "type": "number", "title": "Decimal" }, "paygWithholdingAmount": { "format": "double", "type": "number", "title": "Decimal" }, "paygWithholdingPercent": { "format": "double", "type": "number", "readOnly": true, "title": "Decimal" }, "sfssAmount": { "format": "double", "type": "number", "title": "Decimal" }, "helpAmount": { "format": "double", "type": "number", "title": "Decimal" }, "superContribution": { "format": "double", "type": "number", "title": "Decimal" }, "employerContribution": { "format": "double", "type": "number", "title": "Decimal" }, "superContributionMinusSuperAdjustments": { "format": "double", "type": "number", "readOnly": true, "title": "Decimal" }, "allSuperContributionsTotal": { "format": "double", "type": "number", "readOnly": true, "title": "Decimal" }, "taxableEarnings": { "format": "double", "type": "number", "title": "Decimal" }, "postTaxDeductionAmount": { "format": "double", "type": "number", "title": "Decimal" }, "preTaxDeductionAmount": { "format": "double", "type": "number", "title": "Decimal" }, "grossPlusSuper": { "format": "double", "type": "number", "readOnly": true, "title": "Decimal" }, "payConditionRuleSetName": { "type": "string", "title": "String" }, "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "isTermination": { "type": "boolean", "title": "Boolean" }, "notation": { "type": "string", "title": "String" }, "employeeStartDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "employeeExternalReferenceId": { "type": "string", "title": "String" }, "isExcluded": { "type": "boolean", "title": "Boolean" }, "employeeExternalId": { "type": "string", "title": "String" }, "superAdjustmentsAmount": { "format": "double", "type": "number", "title": "Decimal" }, "salarySacrificeSuperAmount": { "format": "double", "type": "number", "title": "Decimal" }, "memberVoluntarySuperAmount": { "format": "double", "type": "number", "title": "Decimal" }, "nonSuperDeductionTotal": { "format": "double", "type": "number", "title": "Decimal" }, "superPaymentsTotal": { "format": "double", "type": "number", "title": "Decimal" }, "bankPaymentsTotal": { "format": "double", "type": "number", "title": "Decimal" }, "terminationDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "earliestTerminationDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "previousTerminationDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "employeeExpensesTotal": { "format": "double", "type": "number", "title": "Decimal" }, "employerLiabilitiesTotal": { "format": "double", "type": "number", "title": "Decimal" }, "isEmployeeUnder18": { "type": "boolean", "title": "Boolean" }, "employerContributionAdjustmentsAmount": { "format": "double", "type": "number", "title": "Decimal" }, "paygAdjustmentsAmount": { "format": "double", "type": "number", "title": "Decimal" }, "superContributionsCapApplied": { "type": "boolean", "title": "Boolean" }, "isComplete": { "type": "boolean", "title": "Boolean" }, "paygPaymentTotal": { "format": "double", "type": "number", "title": "Decimal" } }, "xml": { "name": "PayRunTotalGridModel" }, "title": "PayRunTotalGridModel" }, "PayRunGrandTotalModel": { "type": "object", "properties": { "numberOfEmployees": { "format": "int32", "type": "integer", "title": "Int32" }, "totalHours": { "format": "double", "type": "number", "title": "Decimal" }, "taxableEarnings": { "format": "double", "type": "number", "title": "Decimal" }, "grossEarnings": { "format": "double", "type": "number", "title": "Decimal" }, "netEarnings": { "format": "double", "type": "number", "title": "Decimal" }, "paygWithholdingAmount": { "format": "double", "type": "number", "title": "Decimal" }, "sfssAmount": { "format": "double", "type": "number", "title": "Decimal" }, "helpAmount": { "format": "double", "type": "number", "title": "Decimal" }, "superContribution": { "format": "double", "type": "number", "title": "Decimal" }, "preTaxDeductionAmount": { "format": "double", "type": "number", "title": "Decimal" }, "postTaxDeductionAmount": { "format": "double", "type": "number", "title": "Decimal" }, "employerContribution": { "format": "double", "type": "number", "title": "Decimal" }, "employeeExpensesTotal": { "format": "double", "type": "number", "title": "Decimal" }, "employerLiabilitiesTotal": { "format": "double", "type": "number", "title": "Decimal" } }, "xml": { "name": "PayRunGrandTotalModel" }, "title": "PayRunGrandTotalModel" }, "TerminateEmployeeRequest": { "type": "object", "properties": { "employeeId": { "format": "int32", "type": "integer", "title": "Int32" } }, "xml": { "name": "TerminateEmployeeRequest" }, "title": "TerminateEmployeeRequest" }, "ApiPaySlipModel": { "type": "object", "properties": { "totalAccruedLeave": { "type": "array", "items": { "$ref": "#/definitions/ApiPaySlipLeaveModel" }, "xml": { "name": "ApiPaySlipLeaveModel", "wrapped": true }, "title": "IList" }, "accruedLeave": { "type": "array", "items": { "$ref": "#/definitions/ApiPaySlipLeaveModel" }, "xml": { "name": "ApiPaySlipLeaveModel", "wrapped": true }, "title": "IList" }, "leaveTaken": { "type": "array", "items": { "$ref": "#/definitions/ApiPaySlipLeaveModel" }, "xml": { "name": "ApiPaySlipLeaveModel", "wrapped": true }, "title": "IList" }, "paygAdjustments": { "type": "array", "items": { "$ref": "#/definitions/ApiPaySlipPaygAdjustmentModel" }, "xml": { "name": "ApiPaySlipPaygAdjustmentModel", "wrapped": true }, "title": "IList" }, "superAdjustments": { "type": "array", "items": { "$ref": "#/definitions/ApiPaySlipSuperAdjustmentModel" }, "xml": { "name": "ApiPaySlipSuperAdjustmentModel", "wrapped": true }, "title": "IList" }, "earningsLines": { "type": "array", "items": { "$ref": "#/definitions/ApiPaySlipEarningsLineModel" }, "xml": { "name": "ApiPaySlipEarningsLineModel", "wrapped": true }, "title": "IList" }, "deductions": { "type": "array", "items": { "$ref": "#/definitions/ApiPaySlipDeductionModel" }, "xml": { "name": "ApiPaySlipDeductionModel", "wrapped": true }, "title": "IList" }, "superPayments": { "type": "array", "items": { "$ref": "#/definitions/ApiPaySlipSuperPaymentModel" }, "xml": { "name": "ApiPaySlipSuperPaymentModel", "wrapped": true }, "title": "IList" }, "bankPayments": { "type": "array", "items": { "$ref": "#/definitions/ApiPaySlipBankPaymentModel" }, "xml": { "name": "ApiPaySlipBankPaymentModel", "wrapped": true }, "title": "IList" }, "grossYTDDetails": { "type": "array", "items": { "$ref": "#/definitions/ApiYearToDateEarningsBreakdownModel" }, "xml": { "name": "ApiYearToDateEarningsBreakdownModel", "wrapped": true }, "title": "IList" }, "employeeExpenses": { "type": "array", "items": { "$ref": "#/definitions/ApiEmployeeExpenseGridModel" }, "xml": { "name": "ApiEmployeeExpenseGridModel", "wrapped": true }, "title": "IList" }, "totalHours": { "format": "double", "type": "number", "title": "Decimal" }, "grossEarnings": { "format": "double", "type": "number", "title": "Decimal" }, "netEarnings": { "format": "double", "type": "number", "title": "Decimal" }, "paygWithholdingAmount": { "format": "double", "type": "number", "title": "Decimal" }, "sfssAmount": { "format": "double", "type": "number", "title": "Decimal" }, "helpAmount": { "format": "double", "type": "number", "title": "Decimal" }, "superContribution": { "format": "double", "type": "number", "title": "Decimal" }, "taxableEarnings": { "format": "double", "type": "number", "title": "Decimal" }, "postTaxDeductionAmount": { "format": "double", "type": "number", "title": "Decimal" }, "preTaxDeductionAmount": { "format": "double", "type": "number", "title": "Decimal" }, "id": { "format": "int32", "type": "integer", "title": "Int32" }, "businessName": { "type": "string", "title": "String" }, "businessAddress": { "type": "string", "title": "String" }, "abn": { "type": "string", "title": "String" }, "contactName": { "type": "string", "title": "String" }, "payPeriodStarting": { "type": "string", "title": "String" }, "payPeriodEnding": { "type": "string", "title": "String" }, "message": { "type": "string", "title": "String" }, "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "employeeExternalId": { "type": "string", "title": "String" }, "employeeName": { "type": "string", "title": "String" }, "employeeFirstName": { "type": "string", "title": "String" }, "employeeSurname": { "type": "string", "title": "String" }, "employeePostalStreetAddress": { "type": "string", "title": "String" }, "employeePostalAddressLine2": { "type": "string", "title": "String" }, "employeePostalSuburbName": { "type": "string", "title": "String" }, "employeePostalSuburbPostcode": { "type": "string", "title": "String" }, "employeePostalSuburbState": { "type": "string", "title": "String" }, "notation": { "type": "string", "title": "String" }, "isPublished": { "type": "boolean", "title": "Boolean" }, "grossYTD": { "format": "double", "type": "number", "title": "Decimal" }, "netYTD": { "format": "double", "type": "number", "title": "Decimal" }, "paygYTD": { "format": "double", "type": "number", "title": "Decimal" }, "superYTD": { "format": "double", "type": "number", "title": "Decimal" }, "taxableEarningsYTD": { "format": "double", "type": "number", "title": "Decimal" }, "basePayRate": { "type": "string", "title": "String" }, "baseRate": { "type": "string", "readOnly": true, "title": "String" }, "hourlyRate": { "format": "double", "type": "number", "title": "Decimal" }, "preTaxDeductionsYTD": { "format": "double", "type": "number", "title": "Decimal" }, "postTaxDeductionsYTD": { "format": "double", "type": "number", "title": "Decimal" }, "sfssYTD": { "format": "double", "type": "number", "title": "Decimal" }, "helpYTD": { "format": "double", "type": "number", "title": "Decimal" }, "employeeBaseRate": { "format": "double", "type": "number", "title": "Decimal" }, "employeeBaseRateUnit": { "enum": [ "Hourly", "Annually", "Fixed", "Daily" ], "type": "string", "title": "RateUnitEnum" } }, "xml": { "name": "ApiPaySlipModel" }, "title": "ApiPaySlipModel" }, "ApiPaySlipLeaveModel": { "type": "object", "properties": { "leaveCategory": { "type": "string", "title": "String" }, "amount": { "format": "double", "type": "number", "title": "Decimal" }, "notes": { "type": "string", "title": "String" } }, "xml": { "name": "ApiPaySlipLeaveModel" }, "title": "ApiPaySlipLeaveModel" }, "ApiPaySlipPaygAdjustmentModel": { "type": "object", "properties": { "notes": { "type": "string", "title": "String" }, "amount": { "format": "double", "type": "number", "title": "Decimal" } }, "xml": { "name": "ApiPaySlipPaygAdjustmentModel" }, "title": "ApiPaySlipPaygAdjustmentModel" }, "ApiPaySlipSuperAdjustmentModel": { "type": "object", "properties": { "notes": { "type": "string", "title": "String" }, "amount": { "format": "double", "type": "number", "title": "Decimal" } }, "xml": { "name": "ApiPaySlipSuperAdjustmentModel" }, "title": "ApiPaySlipSuperAdjustmentModel" }, "ApiPaySlipEarningsLineModel": { "type": "object", "properties": { "payCategoryName": { "type": "string", "title": "String" }, "units": { "format": "double", "type": "number", "title": "Decimal" }, "isFixed": { "type": "boolean", "title": "Boolean" }, "isTaxExempt": { "type": "boolean", "title": "Boolean" }, "rate": { "format": "double", "type": "number", "title": "Decimal" }, "superContribution": { "format": "double", "type": "number", "title": "Decimal" }, "notes": { "type": "string", "title": "String" }, "grossEarnings": { "format": "double", "type": "number", "title": "Decimal" }, "taxableEarnings": { "format": "double", "type": "number", "title": "Decimal" }, "locationName": { "type": "string", "title": "String" } }, "xml": { "name": "ApiPaySlipEarningsLineModel" }, "title": "ApiPaySlipEarningsLineModel" }, "ApiPaySlipDeductionModel": { "type": "object", "properties": { "notes": { "type": "string", "title": "String" }, "amount": { "format": "double", "type": "number", "title": "Decimal" }, "taxStatus": { "type": "string", "title": "String" }, "name": { "type": "string", "title": "String" } }, "xml": { "name": "ApiPaySlipDeductionModel" }, "title": "ApiPaySlipDeductionModel" }, "ApiPaySlipSuperPaymentModel": { "type": "object", "properties": { "fundName": { "type": "string", "title": "String" }, "memberNumber": { "type": "string", "title": "String" }, "amount": { "format": "double", "type": "number", "title": "Decimal" } }, "xml": { "name": "ApiPaySlipSuperPaymentModel" }, "title": "ApiPaySlipSuperPaymentModel" }, "ApiPaySlipBankPaymentModel": { "type": "object", "properties": { "accountName": { "type": "string", "title": "String" }, "accountNumber": { "type": "string", "title": "String" }, "lodgementReference": { "type": "string", "title": "String" }, "bsb": { "type": "string", "title": "String" }, "amount": { "format": "double", "type": "number", "title": "Decimal" } }, "xml": { "name": "ApiPaySlipBankPaymentModel" }, "title": "ApiPaySlipBankPaymentModel" }, "ApiYearToDateEarningsBreakdownModel": { "type": "object", "properties": { "payCategoryName": { "type": "string", "title": "String" }, "grossEarnings": { "format": "double", "type": "number", "title": "Decimal" } }, "xml": { "name": "ApiYearToDateEarningsBreakdownModel" }, "title": "ApiYearToDateEarningsBreakdownModel" }, "ApiEmployeeExpenseGridModel": { "type": "object", "properties": { "notes": { "type": "string", "title": "String" }, "amount": { "format": "double", "type": "number", "title": "Decimal" }, "locationName": { "type": "string", "title": "String" }, "employeeExpenseCategoryName": { "type": "string", "title": "String" } }, "xml": { "name": "ApiEmployeeExpenseGridModel" }, "title": "ApiEmployeeExpenseGridModel" }, "PayRunEarningsLineResponse": { "type": "object", "properties": { "earningsLines": { "type": "object", "additionalProperties": { "type": "array", "items": { "$ref": "#/definitions/EarningsLineModel" }, "xml": { "name": "EarningsLineModel", "wrapped": true }, "title": "List" }, "readOnly": true, "title": "Dictionary" }, "payRunId": { "format": "int32", "type": "integer", "title": "Int32" } }, "xml": { "name": "PayRunEarningsLineResponse" }, "example": { "earningsLines": { "12345": [ { "payCategoryId": "1", "payCategoryName": "Full Time - Standard", "units": 40.0, "notes": "Some notes", "rate": 31.25, "earnings": 1250.0, "super": 0.0, "sfss": 0.0, "help": 65.12, "payg": 263.0, "lumpSumNumberOfPayPeriods": 0.0, "timesheetLineId": null, "id": 0, "externalId": null, "locationId": "39", "locationName": "My Location", "employeeId": "12345", "employeeName": "Bob Bobberson", "employeeExternalId": "EMP01" }, { "payCategoryId": "3", "payCategoryName": "Bonus", "units": 1.0, "notes": "Some notes", "rate": 1000.0, "earnings": 1000.0, "super": 106.38, "sfss": 0.0, "help": 0.0, "payg": 229.0, "lumpSumNumberOfPayPeriods": 1.0, "timesheetLineId": null, "id": 0, "externalId": null, "locationId": "39", "locationName": "My Location", "employeeId": "12345", "employeeName": "Bob Bobberson", "employeeExternalId": "EMP01" } ] }, "payRunId": 999 }, "title": "PayRunEarningsLineResponse" }, "EarningsLineModel": { "type": "object", "properties": { "payCategoryId": { "type": "string", "title": "String" }, "payCategoryName": { "type": "string", "title": "String" }, "units": { "format": "double", "type": "number", "title": "Decimal" }, "notes": { "type": "string", "title": "String" }, "rate": { "format": "double", "type": "number", "title": "Nullable" }, "earnings": { "format": "double", "type": "number", "title": "Decimal" }, "super": { "format": "double", "type": "number", "title": "Decimal" }, "sfss": { "format": "double", "type": "number", "title": "Decimal" }, "help": { "format": "double", "type": "number", "title": "Decimal" }, "payg": { "format": "double", "type": "number", "title": "Decimal" }, "lumpSumNumberOfPayPeriods": { "format": "double", "type": "number", "title": "Decimal" }, "timesheetLineId": { "format": "int32", "type": "integer", "title": "Nullable" }, "id": { "format": "int32", "type": "integer", "title": "Int32" }, "externalId": { "type": "string", "title": "String" }, "locationId": { "type": "string", "title": "String" }, "locationName": { "type": "string", "title": "String" }, "employeeId": { "type": "string", "title": "String" }, "employeeName": { "type": "string", "title": "String" }, "employeeExternalId": { "type": "string", "title": "String" } }, "xml": { "name": "EarningsLineModel" }, "title": "EarningsLineModel" }, "SubmitPayRunEarningsLineRequest": { "type": "object", "properties": { "locationIdType": { "enum": [ "Standard", "External" ], "type": "string", "title": "IdType" }, "payCategoryIdType": { "enum": [ "Standard", "External" ], "type": "string", "title": "IdType" }, "earningsLines": { "type": "object", "additionalProperties": { "type": "array", "items": { "$ref": "#/definitions/EarningsLineModel" }, "xml": { "name": "EarningsLineModel", "wrapped": true }, "title": "List" }, "title": "Dictionary" }, "payRunId": { "format": "int32", "type": "integer", "title": "Int32" }, "employeeIdType": { "enum": [ "Standard", "External" ], "type": "string", "title": "IdType" }, "replaceExisting": { "type": "boolean", "title": "Boolean" }, "suppressCalculations": { "type": "boolean", "title": "Boolean" } }, "xml": { "name": "SubmitPayRunEarningsLineRequest" }, "title": "SubmitPayRunEarningsLineRequest" }, "PayRunTotalModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "totalHours": { "format": "double", "type": "number", "title": "Decimal" }, "grossEarnings": { "format": "double", "type": "number", "title": "Decimal" }, "preTaxDeductions": { "format": "double", "type": "number", "title": "Decimal" }, "taxableEarnings": { "format": "double", "type": "number", "title": "Decimal" }, "postTaxDeductions": { "format": "double", "type": "number", "title": "Decimal" }, "paygWithheld": { "format": "double", "type": "number", "title": "Decimal" }, "sfssWithheld": { "format": "double", "type": "number", "title": "Decimal" }, "helpWithheld": { "format": "double", "type": "number", "title": "Decimal" }, "superContribution": { "format": "double", "type": "number", "title": "Decimal" }, "employerContribution": { "format": "double", "type": "number", "title": "Decimal" }, "netEarnings": { "format": "double", "type": "number", "title": "Decimal" }, "totalEmployeeExpenses": { "format": "double", "type": "number", "title": "Decimal" }, "totalEmployerLiabilities": { "format": "double", "type": "number", "title": "Decimal" }, "isPublished": { "type": "boolean", "title": "Boolean" }, "payRunId": { "format": "int32", "type": "integer", "title": "Int32" }, "notes": { "type": "string", "title": "String" }, "notation": { "type": "string", "title": "String" } }, "xml": { "name": "PayRunTotalModel" }, "title": "PayRunTotalModel" }, "LeaveAccrualResponse": { "type": "object", "properties": { "payRunId": { "format": "int32", "type": "integer", "title": "Int32" }, "leave": { "type": "object", "additionalProperties": { "type": "array", "items": { "$ref": "#/definitions/LeaveAccrualModel" }, "xml": { "name": "LeaveAccrualModel", "wrapped": true }, "title": "List" }, "title": "Dictionary" } }, "xml": { "name": "LeaveAccrualResponse" }, "example": { "payRunId": 999, "leave": { "12345": [ { "id": 1234, "leaveCategoryName": "Annual Leave", "leaveCategoryId": "123", "amount": 3.07654, "notes": null, "accrualType": "AutomaticallyAccrued" }, { "id": 1235, "leaveCategoryName": "Sick Leave", "leaveCategoryId": "124", "amount": 1.0345, "notes": "Some notes", "accrualType": "AutomaticallyAccrued" } ] } }, "title": "LeaveAccrualResponse" }, "LeaveAccrualModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "leaveCategoryName": { "type": "string", "title": "String" }, "leaveCategoryId": { "type": "string", "title": "String" }, "amount": { "format": "double", "type": "number", "title": "Decimal" }, "notes": { "type": "string", "title": "String" }, "accrualType": { "type": "string", "title": "String" } }, "xml": { "name": "LeaveAccrualModel" }, "title": "LeaveAccrualModel" }, "SubmitLeaveAccrualsModel": { "type": "object", "properties": { "replaceExisting": { "type": "boolean", "title": "Boolean" }, "employeeIdType": { "enum": [ "Standard", "External" ], "type": "string", "title": "IdType" }, "suppressCalculations": { "type": "boolean", "title": "Boolean" }, "leave": { "type": "object", "additionalProperties": { "type": "array", "items": { "$ref": "#/definitions/SaveLeaveAccrualModel" }, "xml": { "name": "SaveLeaveAccrualModel", "wrapped": true }, "title": "List" }, "title": "Dictionary" } }, "xml": { "name": "SubmitLeaveAccrualsModel" }, "title": "SubmitLeaveAccrualsModel" }, "SaveLeaveAccrualModel": { "type": "object", "properties": { "accrualType": { "enum": [ "LeaveAccrued", "LeaveTaken", "LeaveAdjustment" ], "type": "string", "title": "SaveLeaveAccrualTypeEnum" }, "notes": { "type": "string", "title": "String" }, "amount": { "format": "double", "type": "number", "title": "Decimal" }, "leaveCategoryId": { "format": "int32", "type": "integer", "title": "Int32" }, "applyLeaveLoading": { "type": "boolean", "title": "Boolean" }, "adjustEarnings": { "type": "boolean", "title": "Boolean" }, "externalReferenceId": { "type": "string", "title": "String" } }, "xml": { "name": "SaveLeaveAccrualModel" }, "title": "SaveLeaveAccrualModel" }, "PayRunPaygAdjustmentResponse": { "type": "object", "properties": { "paygAdjustments": { "type": "object", "additionalProperties": { "type": "array", "items": { "$ref": "#/definitions/PaygAdjustmentModel" }, "xml": { "name": "PaygAdjustmentModel", "wrapped": true }, "title": "List" }, "readOnly": true, "title": "Dictionary" }, "payRunId": { "format": "int32", "type": "integer", "title": "Int32" } }, "xml": { "name": "PayRunPaygAdjustmentResponse" }, "example": { "paygAdjustments": { "12345": [ { "notes": "Some notes", "amount": 12.34, "id": 0, "externalId": "Axb34", "locationId": "34456", "locationName": "My Location", "employeeId": "12345", "employeeName": "Bob Bobberson", "employeeExternalId": "EMP01" } ] }, "payRunId": 999 }, "title": "PayRunPaygAdjustmentResponse" }, "PaygAdjustmentModel": { "type": "object", "properties": { "notes": { "type": "string", "title": "String" }, "amount": { "format": "double", "type": "number", "title": "Decimal" }, "id": { "format": "int32", "type": "integer", "title": "Int32" }, "externalId": { "type": "string", "title": "String" }, "locationId": { "type": "string", "title": "String" }, "locationName": { "type": "string", "title": "String" }, "employeeId": { "type": "string", "title": "String" }, "employeeName": { "type": "string", "title": "String" }, "employeeExternalId": { "type": "string", "title": "String" } }, "xml": { "name": "PaygAdjustmentModel" }, "title": "PaygAdjustmentModel" }, "SubmitPayRunPaygAdjustmentRequest": { "type": "object", "properties": { "paygAdjustments": { "type": "object", "additionalProperties": { "type": "array", "items": { "$ref": "#/definitions/PaygAdjustmentModel" }, "xml": { "name": "PaygAdjustmentModel", "wrapped": true }, "title": "List" }, "title": "Dictionary" }, "payRunId": { "format": "int32", "type": "integer", "title": "Int32" }, "employeeIdType": { "enum": [ "Standard", "External" ], "type": "string", "title": "IdType" }, "replaceExisting": { "type": "boolean", "title": "Boolean" }, "suppressCalculations": { "type": "boolean", "title": "Boolean" } }, "xml": { "name": "SubmitPayRunPaygAdjustmentRequest" }, "title": "SubmitPayRunPaygAdjustmentRequest" }, "PayRunSuperAdjustmentResponse": { "type": "object", "properties": { "superAdjustments": { "type": "object", "additionalProperties": { "type": "array", "items": { "$ref": "#/definitions/SuperAdjustmentModel" }, "xml": { "name": "SuperAdjustmentModel", "wrapped": true }, "title": "List" }, "readOnly": true, "title": "Dictionary" }, "payRunId": { "format": "int32", "type": "integer", "title": "Int32" } }, "xml": { "name": "PayRunSuperAdjustmentResponse" }, "example": { "superAdjustments": { "12345": [ { "notes": "Some notes", "amount": 12.34, "contributionType": "Employer Contribution", "id": 0, "externalId": "Axb34", "locationId": "34456", "locationName": "My Location", "employeeId": "12345", "employeeName": "Bob Bobberson", "employeeExternalId": "EMP01" } ] }, "payRunId": 999 }, "title": "PayRunSuperAdjustmentResponse" }, "SuperAdjustmentModel": { "type": "object", "properties": { "notes": { "type": "string", "title": "String" }, "amount": { "format": "double", "type": "number", "title": "Decimal" }, "contributionType": { "type": "string", "title": "String" }, "id": { "format": "int32", "type": "integer", "title": "Int32" }, "externalId": { "type": "string", "title": "String" }, "locationId": { "type": "string", "title": "String" }, "locationName": { "type": "string", "title": "String" }, "employeeId": { "type": "string", "title": "String" }, "employeeName": { "type": "string", "title": "String" }, "employeeExternalId": { "type": "string", "title": "String" } }, "xml": { "name": "SuperAdjustmentModel" }, "title": "SuperAdjustmentModel" }, "SubmitPayRunSuperAdjustmentRequest": { "type": "object", "properties": { "superAdjustments": { "type": "object", "additionalProperties": { "type": "array", "items": { "$ref": "#/definitions/SuperAdjustmentModel" }, "xml": { "name": "SuperAdjustmentModel", "wrapped": true }, "title": "List" }, "title": "Dictionary" }, "payRunId": { "format": "int32", "type": "integer", "title": "Int32" }, "employeeIdType": { "enum": [ "Standard", "External" ], "type": "string", "title": "IdType" }, "replaceExisting": { "type": "boolean", "title": "Boolean" }, "suppressCalculations": { "type": "boolean", "title": "Boolean" } }, "xml": { "name": "SubmitPayRunSuperAdjustmentRequest" }, "title": "SubmitPayRunSuperAdjustmentRequest" }, "PayRunUnlockRequest": { "type": "object", "properties": { "comments": { "type": "string", "title": "String" } }, "xml": { "name": "PayRunUnlockRequest" }, "title": "PayRunUnlockRequest" }, "ODataQueryOptions[PayRun]": { "type": "object", "properties": { "ifMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "ifNoneMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "context": { "$ref": "#/definitions/ODataQueryContext", "readOnly": true }, "request": { "type": "object", "readOnly": true, "title": "HttpRequestMessage" }, "rawValues": { "$ref": "#/definitions/ODataRawQueryOptions", "readOnly": true }, "selectExpand": { "$ref": "#/definitions/SelectExpandQueryOption", "readOnly": true }, "filter": { "$ref": "#/definitions/FilterQueryOption", "readOnly": true }, "orderBy": { "$ref": "#/definitions/OrderByQueryOption", "readOnly": true }, "skip": { "$ref": "#/definitions/SkipQueryOption", "readOnly": true }, "top": { "$ref": "#/definitions/TopQueryOption", "readOnly": true }, "inlineCount": { "$ref": "#/definitions/InlineCountQueryOption", "readOnly": true }, "validator": { "$ref": "#/definitions/ODataQueryValidator" } }, "xml": { "name": "ODataQueryOptions`1" }, "title": "ODataQueryOptions" }, "PayRunCreateRequest": { "type": "object", "properties": { "payScheduleId": { "format": "int32", "type": "integer", "title": "Int32" }, "payPeriodEnding": { "format": "date-time", "type": "string", "title": "DateTime" }, "datePaid": { "format": "date-time", "type": "string", "title": "DateTime" }, "timesheetImportOption": { "enum": [ "None", "ThisPayPeriod", "AllOutstanding" ], "type": "string", "title": "Nullable" }, "externalId": { "type": "string", "title": "String" }, "callbackUrl": { "type": "string", "title": "String" } }, "xml": { "name": "PayRunCreateRequest" }, "title": "PayRunCreateRequest" }, "PayRunNotationModel": { "type": "object", "properties": { "notation": { "type": "string", "title": "String" } }, "xml": { "name": "PayRunNotationModel" }, "title": "PayRunNotationModel" }, "PayRunEmployerLiabilityResponse": { "type": "object", "properties": { "employerLiabilities": { "type": "object", "additionalProperties": { "type": "array", "items": { "$ref": "#/definitions/EmployerLiabilityModel" }, "xml": { "name": "EmployerLiabilityModel", "wrapped": true }, "title": "List" }, "readOnly": true, "title": "Dictionary" }, "payRunId": { "format": "int32", "type": "integer", "title": "Int32" } }, "xml": { "name": "PayRunEmployerLiabilityResponse" }, "example": { "employerLiabilities": { "12345": [ { "employerLiabilityCategoryId": "98", "employerLiabilityCategoryName": "My employer liability category", "notes": "Some notes", "amount": 12.34, "id": 0, "externalId": "Axb34", "locationId": "34456", "locationName": "My Location", "employeeId": "12345", "employeeName": "Bob Bobberson", "employeeExternalId": "EMP01" } ] }, "payRunId": 999 }, "title": "PayRunEmployerLiabilityResponse" }, "EmployerLiabilityModel": { "type": "object", "properties": { "employerLiabilityCategoryId": { "type": "string", "title": "String" }, "employerLiabilityCategoryName": { "type": "string", "title": "String" }, "notes": { "type": "string", "title": "String" }, "amount": { "format": "double", "type": "number", "title": "Decimal" }, "id": { "format": "int32", "type": "integer", "title": "Int32" }, "externalId": { "type": "string", "title": "String" }, "locationId": { "type": "string", "title": "String" }, "locationName": { "type": "string", "title": "String" }, "employeeId": { "type": "string", "title": "String" }, "employeeName": { "type": "string", "title": "String" }, "employeeExternalId": { "type": "string", "title": "String" } }, "xml": { "name": "EmployerLiabilityModel" }, "title": "EmployerLiabilityModel" }, "SubmitPayRunEmployerLiabilityRequest": { "type": "object", "properties": { "employerLiabilityCategoryIdType": { "enum": [ "Standard", "External" ], "type": "string", "title": "IdType" }, "employerLiabilities": { "type": "object", "additionalProperties": { "type": "array", "items": { "$ref": "#/definitions/EmployerLiabilityModel" }, "xml": { "name": "EmployerLiabilityModel", "wrapped": true }, "title": "List" }, "title": "Dictionary" }, "payRunId": { "format": "int32", "type": "integer", "title": "Int32" }, "employeeIdType": { "enum": [ "Standard", "External" ], "type": "string", "title": "IdType" }, "replaceExisting": { "type": "boolean", "title": "Boolean" }, "suppressCalculations": { "type": "boolean", "title": "Boolean" } }, "xml": { "name": "SubmitPayRunEmployerLiabilityRequest" }, "title": "SubmitPayRunEmployerLiabilityRequest" }, "FinalisePayRunOptions": { "type": "object", "properties": { "payRunId": { "format": "int32", "type": "integer", "title": "Int32" }, "datePaid": { "format": "date-time", "type": "string", "title": "Nullable" }, "exportJournals": { "type": "boolean", "title": "Boolean" }, "publishPaySlips": { "enum": [ "Manual", "Immediate", "Scheduled" ], "type": "string", "title": "PublishPaySlipsPreference" }, "publishPaySlipsDateTime": { "format": "date-time", "type": "string", "title": "Nullable" }, "suppressNotifications": { "type": "boolean", "title": "Boolean" } }, "xml": { "name": "FinalisePayRunOptions" }, "title": "FinalisePayRunOptions" }, "PayRunFinaliseResult": { "type": "object", "properties": { "journalExportResult": { "$ref": "#/definitions/JournalExportResult" }, "journalExportFailedMessage": { "type": "string", "title": "String" }, "removedEmployees": { "type": "array", "items": { "format": "int32", "type": "integer", "title": "Int32" }, "title": "IList" }, "notifications": { "$ref": "#/definitions/PaySlipNotificationResponse" }, "paySlipsPublished": { "type": "boolean", "title": "Boolean" }, "publishPreference": { "enum": [ "Manual", "Immediate", "Scheduled" ], "type": "string", "title": "PublishPaySlipsPreference" }, "datePaid": { "format": "date-time", "type": "string", "title": "Nullable" }, "exportJournalsPreference": { "type": "boolean", "title": "Boolean" }, "publishPaySlipsScheduledDateTimeUtc": { "format": "date-time", "type": "string", "title": "Nullable" }, "publishPreferenceTimeOfDay": { "type": "string", "title": "Nullable" } }, "xml": { "name": "PayRunFinaliseResult" }, "title": "PayRunFinaliseResult" }, "JournalExportResult": { "type": "object", "properties": { "status": { "enum": [ "NotExported", "Success", "FailureUnknownError", "FailureAccountsNotConfigured", "FailureInvalidAccounts", "FailureAccountPeriodClosed", "FailureNotAuthenticated", "FailureAlreadyExported", "FailureFunctionDisabled", "FailureCannotUseAccountsPayableAccount", "FailureVendorMessage" ], "type": "string", "title": "JournalExportStatus" }, "message": { "type": "string", "title": "String" } }, "xml": { "name": "JournalExportResult" }, "title": "JournalExportResult" }, "PaySlipNotificationResponse": { "type": "object", "properties": { "totalEmailNotificationsSent": { "format": "int32", "type": "integer", "title": "Int32" }, "totalSmsNotificationsSent": { "format": "int32", "type": "integer", "title": "Int32" }, "errors": { "$ref": "#/definitions/PayRunWarningResult" }, "hasPartiallySentNotifications": { "type": "boolean", "title": "Boolean" } }, "xml": { "name": "PaySlipNotificationResponse" }, "title": "PaySlipNotificationResponse" }, "PayRunWarningResult": { "type": "object", "properties": { "warningMessage": { "type": "string", "title": "String" }, "warnings": { "type": "array", "items": { "$ref": "#/definitions/PayRunWarning" }, "xml": { "name": "PayRunWarning", "wrapped": true }, "title": "List" }, "templateName": { "type": "string", "title": "String" } }, "xml": { "name": "PayRunWarningResult" }, "title": "PayRunWarningResult" }, "PayRunWarning": { "type": "object", "properties": { "warningType": { "enum": [ "Aba", "MoreLeaveThanAccrued", "UnpaidEarnings", "Birthday", "Anniversary", "NegativeEarnings", "PreviouslyTerminated", "TerminatedWithExpenseReimbursements", "ExpiredQualification", "DuplicateEarningsLines", "TaxCodeMissing", "Bpay" ], "type": "string", "title": "PayRunWarningType" }, "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "warning": { "type": "string", "title": "String" }, "employeeName": { "type": "string", "title": "String" }, "payRunTotalId": { "format": "int32", "type": "integer", "title": "Int32" } }, "xml": { "name": "PayRunWarning" }, "title": "PayRunWarning" }, "JournalItemResponse": { "type": "object", "properties": { "externalAccountReferenceId": { "type": "string", "title": "String" }, "amount": { "format": "double", "type": "number", "title": "Decimal" }, "amountUnrounded": { "format": "double", "type": "number", "title": "Decimal" }, "reference": { "type": "string", "title": "String" }, "journalItemType": { "enum": [ "Asset", "PaygExpense", "PaygLiability", "SuperExpense", "SuperLiability", "DefaultExpense", "WagesExpense", "DefaultSalarySacrificeExpense", "DefaultSalarySacrificeLiability", "DefaultDeductionExpense", "DefaultDeductionLiability", "DefaultEmployerLiabilityExpense", "DefaultEmployerLiabilityLiability", "DeductionExpense", "DeductionLiability", "DeductionAsset", "DefaultEmployeeExpense", "EmployeeExpense", "PreTaxDeductionLiability", "PostTaxDeductionLiability", "EmployerLiabilityExpense", "EmployerLiabilityLiability", "W1ExemptWagesExpense", "PreTaxDeductionAsset" ], "type": "string", "title": "JournalItemType" }, "taxCode": { "type": "string", "title": "String" }, "accountCode": { "type": "string", "title": "String" }, "accountName": { "type": "string", "title": "String" }, "details": { "type": "string", "title": "String" }, "location": { "type": "string", "title": "String" }, "isCredit": { "type": "boolean", "title": "Boolean" }, "isDebit": { "type": "boolean", "title": "Boolean" } }, "xml": { "name": "JournalItemResponse" }, "title": "JournalItemResponse" }, "SetPayRunUIUnlockStateRequest": { "type": "object", "properties": { "enableUIUnlock": { "type": "boolean", "title": "Boolean" } }, "xml": { "name": "SetPayRunUIUnlockStateRequest" }, "title": "SetPayRunUIUnlockStateRequest" }, "PayRunTotalResponse": { "type": "object", "properties": { "payRunId": { "format": "int32", "type": "integer", "title": "Int32" }, "payRunTotals": { "type": "object", "additionalProperties": { "$ref": "#/definitions/PayRunTotalModel" }, "title": "Dictionary" } }, "xml": { "name": "PayRunTotalResponse" }, "title": "PayRunTotalResponse" }, "PayRunTotalNotationModel": { "type": "object", "properties": { "notation": { "type": "string", "title": "String" } }, "xml": { "name": "PayRunTotalNotationModel" }, "title": "PayRunTotalNotationModel" }, "PayRunDeductionResponse": { "type": "object", "properties": { "deductions": { "type": "object", "additionalProperties": { "type": "array", "items": { "$ref": "#/definitions/DeductionModel" }, "xml": { "name": "DeductionModel", "wrapped": true }, "title": "List" }, "readOnly": true, "title": "Dictionary" }, "payRunId": { "format": "int32", "type": "integer", "title": "Int32" } }, "xml": { "name": "PayRunDeductionResponse" }, "example": { "deductions": { "12345": [ { "deductionCategoryId": "98", "deductionCategoryName": "My deduction category", "amount": 12.34, "notes": "Some notes", "paymentReference": "Payment Reference", "payToBankAccountBSB": null, "payToBankAccountNumber": null, "payToSuperFundName": "My Super Account", "payToSuperFundMemberNumber": "100000", "payTo": "SuperFund", "id": 0, "externalId": null, "locationId": "39", "locationName": "My Location", "employeeId": "12345", "employeeName": "Bob Bobberson", "employeeExternalId": "EMP01" }, { "deductionCategoryId": "98", "deductionCategoryName": "My deduction category", "amount": 16.12, "notes": "Some notes", "paymentReference": "Payment Reference", "payToBankAccountBSB": "100000", "payToBankAccountNumber": "987654321", "payToSuperFundName": null, "payToSuperFundMemberNumber": null, "payTo": "BankAccount", "id": 0, "externalId": null, "locationId": "39", "locationName": "My Location", "employeeId": "12345", "employeeName": "Bob Bobberson", "employeeExternalId": "EMP01" } ] }, "payRunId": 999 }, "title": "PayRunDeductionResponse" }, "DeductionModel": { "type": "object", "properties": { "deductionCategoryId": { "type": "string", "title": "String" }, "deductionCategoryName": { "type": "string", "title": "String" }, "amount": { "format": "double", "type": "number", "title": "Decimal" }, "notes": { "type": "string", "title": "String" }, "paymentReference": { "type": "string", "title": "String" }, "note": { "type": "string", "title": "String" }, "payToBankAccountBSB": { "type": "string", "title": "String" }, "payToBankAccountNumber": { "type": "string", "title": "String" }, "payToSuperFundName": { "type": "string", "title": "String" }, "payToSuperFundMemberNumber": { "type": "string", "title": "String" }, "payTo": { "type": "string", "title": "String" }, "id": { "format": "int32", "type": "integer", "title": "Int32" }, "externalId": { "type": "string", "title": "String" }, "locationId": { "type": "string", "title": "String" }, "locationName": { "type": "string", "title": "String" }, "employeeId": { "type": "string", "title": "String" }, "employeeName": { "type": "string", "title": "String" }, "employeeExternalId": { "type": "string", "title": "String" } }, "xml": { "name": "DeductionModel" }, "title": "DeductionModel" }, "SubmitPayRunDeductionRequest": { "type": "object", "properties": { "deductionCategoryIdType": { "enum": [ "Standard", "External" ], "type": "string", "title": "IdType" }, "deductions": { "type": "object", "additionalProperties": { "type": "array", "items": { "$ref": "#/definitions/DeductionModel" }, "xml": { "name": "DeductionModel", "wrapped": true }, "title": "List" }, "title": "Dictionary" }, "payRunId": { "format": "int32", "type": "integer", "title": "Int32" }, "employeeIdType": { "enum": [ "Standard", "External" ], "type": "string", "title": "IdType" }, "replaceExisting": { "type": "boolean", "title": "Boolean" }, "suppressCalculations": { "type": "boolean", "title": "Boolean" } }, "xml": { "name": "SubmitPayRunDeductionRequest" }, "title": "SubmitPayRunDeductionRequest" }, "ODataQueryOptions[PayCycle]": { "type": "object", "properties": { "ifMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "ifNoneMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "context": { "$ref": "#/definitions/ODataQueryContext", "readOnly": true }, "request": { "type": "object", "readOnly": true, "title": "HttpRequestMessage" }, "rawValues": { "$ref": "#/definitions/ODataRawQueryOptions", "readOnly": true }, "selectExpand": { "$ref": "#/definitions/SelectExpandQueryOption", "readOnly": true }, "filter": { "$ref": "#/definitions/FilterQueryOption", "readOnly": true }, "orderBy": { "$ref": "#/definitions/OrderByQueryOption", "readOnly": true }, "skip": { "$ref": "#/definitions/SkipQueryOption", "readOnly": true }, "top": { "$ref": "#/definitions/TopQueryOption", "readOnly": true }, "inlineCount": { "$ref": "#/definitions/InlineCountQueryOption", "readOnly": true }, "validator": { "$ref": "#/definitions/ODataQueryValidator" } }, "xml": { "name": "ODataQueryOptions`1" }, "title": "ODataQueryOptions" }, "PayScheduleModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "name": { "type": "string", "title": "String" }, "frequency": { "enum": [ "Weekly", "Fortnightly", "Monthly", "AdHoc", "Initial" ], "type": "string", "title": "PayCycleFrequencyEnum" }, "employeeSelectionStrategy": { "enum": [ "None", "PayRunDefault", "TimesheetLocations" ], "type": "string", "title": "Nullable" }, "lastDatePaid": { "format": "date-time", "type": "string", "title": "Nullable" }, "lastPayRun": { "format": "date-time", "type": "string", "title": "Nullable" }, "externalId": { "type": "string", "title": "String" }, "source": { "type": "string", "title": "String" }, "abaDetailsId": { "format": "int32", "type": "integer", "title": "Nullable" }, "locations": { "type": "array", "items": { "format": "int32", "type": "integer", "title": "Int32" }, "title": "List" } }, "xml": { "name": "PayScheduleModel" }, "title": "PayScheduleModel" }, "PublicHolidayModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Nullable" }, "date": { "format": "date-time", "type": "string", "title": "Nullable" }, "states": { "type": "array", "items": { "type": "string", "title": "String" }, "title": "IList" }, "locationIds": { "type": "array", "items": { "format": "int32", "type": "integer", "title": "Int32" }, "title": "ICollection" }, "description": { "type": "string", "title": "String" }, "note": { "type": "string", "title": "String" }, "isSystem": { "type": "boolean", "title": "Boolean" }, "notAPublicHoliday": { "type": "boolean", "title": "Boolean" } }, "xml": { "name": "PublicHolidayModel" }, "title": "PublicHolidayModel" }, "ODataQueryOptions[Qualification]": { "type": "object", "properties": { "ifMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "ifNoneMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "context": { "$ref": "#/definitions/ODataQueryContext", "readOnly": true }, "request": { "type": "object", "readOnly": true, "title": "HttpRequestMessage" }, "rawValues": { "$ref": "#/definitions/ODataRawQueryOptions", "readOnly": true }, "selectExpand": { "$ref": "#/definitions/SelectExpandQueryOption", "readOnly": true }, "filter": { "$ref": "#/definitions/FilterQueryOption", "readOnly": true }, "orderBy": { "$ref": "#/definitions/OrderByQueryOption", "readOnly": true }, "skip": { "$ref": "#/definitions/SkipQueryOption", "readOnly": true }, "top": { "$ref": "#/definitions/TopQueryOption", "readOnly": true }, "inlineCount": { "$ref": "#/definitions/InlineCountQueryOption", "readOnly": true }, "validator": { "$ref": "#/definitions/ODataQueryValidator" } }, "xml": { "name": "ODataQueryOptions`1" }, "title": "ODataQueryOptions" }, "QualificationModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "name": { "type": "string", "title": "String" } }, "xml": { "name": "QualificationModel" }, "title": "QualificationModel" }, "ReportRequestWithPayScheduleModel": { "type": "object", "properties": { "payScheduleId": { "format": "int32", "type": "integer", "title": "Int32" }, "fromDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "toDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "locationId": { "format": "int32", "type": "integer", "title": "Int32" }, "employingEntityId": { "format": "int32", "type": "integer", "title": "Nullable" } }, "xml": { "name": "ReportRequestWithPayScheduleModel" }, "title": "ReportRequestWithPayScheduleModel" }, "SuperAccrualExportModel": { "type": "object", "properties": { "locationId": { "format": "int32", "type": "integer", "title": "Int32" }, "locationName": { "type": "string", "title": "String" }, "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "firstName": { "type": "string", "title": "String" }, "surname": { "type": "string", "title": "String" }, "externalId": { "type": "string", "title": "String" }, "accrualDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "accrualType": { "type": "string", "title": "String" }, "accrualAmount": { "format": "double", "type": "number", "title": "Decimal" } }, "xml": { "name": "SuperAccrualExportModel" }, "title": "SuperAccrualExportModel" }, "SuperContributionsReportExportModel": { "type": "object", "properties": { "locationName": { "type": "string", "title": "String" }, "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "firstName": { "type": "string", "title": "String" }, "surname": { "type": "string", "title": "String" }, "externalId": { "type": "string", "title": "String" }, "superFundName": { "type": "string", "title": "String" }, "superFundNumber": { "type": "string", "title": "String" }, "paymentType": { "type": "string", "title": "String" }, "amount": { "format": "double", "type": "number", "title": "Decimal" } }, "xml": { "name": "SuperContributionsReportExportModel" }, "title": "SuperContributionsReportExportModel" }, "LeaveBalancesReportRequestModel": { "type": "object", "properties": { "locationId": { "format": "int32", "type": "integer", "title": "Int32" }, "leaveTypeId": { "format": "int32", "type": "integer", "title": "Int32" }, "groupBy": { "enum": [ "AccrualLocation", "DefaultLocation" ], "type": "string", "title": "LeaveReportDisplayEnum" }, "employingEntityId": { "format": "int32", "type": "integer", "title": "Nullable" }, "asAtDate": { "format": "date-time", "type": "string", "title": "Nullable" } }, "xml": { "name": "LeaveBalancesReportRequestModel" }, "title": "LeaveBalancesReportRequestModel" }, "LeaveBalancesReportExportModel": { "type": "object", "properties": { "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "externalId": { "type": "string", "title": "String" }, "firstName": { "type": "string", "title": "String" }, "surname": { "type": "string", "title": "String" }, "location": { "type": "string", "title": "String" }, "leaveCategoryName": { "type": "string", "title": "String" }, "accruedAmount": { "format": "double", "type": "number", "title": "Decimal" }, "accruedAmountInDays": { "format": "double", "type": "number", "title": "Decimal" }, "leaveValue": { "format": "double", "type": "number", "title": "Decimal" }, "loadingValue": { "format": "double", "type": "number", "title": "Decimal" }, "leavePlusLoading": { "format": "double", "type": "number", "readOnly": true, "title": "Decimal" } }, "xml": { "name": "LeaveBalancesReportExportModel" }, "title": "LeaveBalancesReportExportModel" }, "DeductionsReportRequestModel": { "type": "object", "properties": { "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "deductionCategoryId": { "format": "int32", "type": "integer", "title": "Int32" }, "disableRollupReporting": { "type": "boolean", "title": "Boolean" }, "payScheduleId": { "format": "int32", "type": "integer", "title": "Int32" }, "fromDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "toDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "locationId": { "format": "int32", "type": "integer", "title": "Int32" }, "employingEntityId": { "format": "int32", "type": "integer", "title": "Nullable" } }, "xml": { "name": "DeductionsReportRequestModel" }, "title": "DeductionsReportRequestModel" }, "DeductionsReportExportModel": { "type": "object", "properties": { "payRun": { "type": "string", "title": "String" }, "datePaid": { "format": "date-time", "type": "string", "title": "DateTime" }, "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "firstName": { "type": "string", "title": "String" }, "surname": { "type": "string", "title": "String" }, "externalId": { "type": "string", "title": "String" }, "location": { "type": "string", "title": "String" }, "amounts": { "type": "array", "items": { "$ref": "#/definitions/DeductionsReportDeductionAmountModel" }, "xml": { "name": "DeductionsReportDeductionAmountModel", "wrapped": true }, "title": "List" } }, "xml": { "name": "DeductionsReportExportModel" }, "title": "DeductionsReportExportModel" }, "DeductionsReportDeductionAmountModel": { "type": "object", "properties": { "deductionCategoryId": { "format": "int32", "type": "integer", "title": "Int32" }, "deductionCategoryName": { "type": "string", "title": "String" }, "amount": { "format": "double", "type": "number", "title": "Decimal" } }, "xml": { "name": "DeductionsReportDeductionAmountModel" }, "title": "DeductionsReportDeductionAmountModel" }, "ActivityReportExportModel": { "type": "object", "properties": { "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "locationId": { "format": "int32", "type": "integer", "title": "Int32" }, "location": { "type": "string", "title": "String" }, "firstName": { "type": "string", "title": "String" }, "surname": { "type": "string", "title": "String" }, "totalHours": { "format": "double", "type": "number", "title": "Decimal" }, "grossEarnings": { "format": "double", "type": "number", "title": "Decimal" }, "taxableEarnings": { "format": "double", "type": "number", "title": "Decimal" }, "paygWithholding": { "format": "double", "type": "number", "title": "Decimal" }, "superContributions": { "format": "double", "type": "number", "title": "Decimal" }, "netEarnings": { "format": "double", "type": "number", "title": "Decimal" } }, "xml": { "name": "ActivityReportExportModel" }, "title": "ActivityReportExportModel" }, "LeaveHistoryApiReportModel": { "type": "object", "properties": { "fromDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "toDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "payScheduleId": { "format": "int32", "type": "integer", "title": "Int32" }, "locationId": { "format": "int32", "type": "integer", "title": "Int32" }, "employeeId": { "type": "array", "items": { "type": "string", "title": "String" }, "title": "IList" }, "leaveCategoryId": { "format": "int32", "type": "integer", "title": "Int32" } }, "xml": { "name": "LeaveHistoryApiReportModel" }, "title": "LeaveHistoryApiReportModel" }, "LeaveHistoryReportGroupModel": { "type": "object", "properties": { "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "employeeExternalId": { "type": "string", "title": "String" }, "firstName": { "type": "string", "title": "String" }, "surname": { "type": "string", "title": "String" }, "leaveCategoryType": { "type": "string", "title": "String" }, "openingBalance": { "format": "double", "type": "number", "title": "Decimal" }, "closingBalance": { "format": "double", "type": "number", "title": "Decimal" }, "leaveHistoryDetails": { "type": "array", "items": { "$ref": "#/definitions/LeaveHistoryReportDetailModel" }, "xml": { "name": "LeaveHistoryReportDetailModel", "wrapped": true }, "title": "List" } }, "xml": { "name": "LeaveHistoryReportGroupModel" }, "title": "LeaveHistoryReportGroupModel" }, "LeaveHistoryReportDetailModel": { "type": "object", "properties": { "payPeriod": { "type": "string", "title": "String" }, "notes": { "type": "string", "title": "String" }, "leaveAccrued": { "format": "double", "type": "number", "title": "Decimal" }, "leaveTaken": { "format": "double", "type": "number", "title": "Decimal" } }, "xml": { "name": "LeaveHistoryReportDetailModel" }, "title": "LeaveHistoryReportDetailModel" }, "EmployeeDetailsReportField": { "type": "object", "properties": { "value": { "type": "string", "title": "String" }, "displayText": { "type": "string", "title": "String" } }, "xml": { "name": "EmployeeDetailsReportField" }, "title": "EmployeeDetailsReportField" }, "PayCategoriesReportRequestModel": { "type": "object", "properties": { "payScheduleId": { "format": "int32", "type": "integer", "title": "Int32" }, "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "groupByEarningsLocation": { "type": "boolean", "title": "Boolean" }, "fromDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "toDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "locationId": { "format": "int32", "type": "integer", "title": "Int32" }, "employingEntityId": { "format": "int32", "type": "integer", "title": "Nullable" } }, "xml": { "name": "PayCategoriesReportRequestModel" }, "title": "PayCategoriesReportRequestModel" }, "PayCategoriesReportExportModel": { "type": "object", "properties": { "payCategory": { "type": "string", "title": "String" }, "payRun": { "type": "string", "title": "String" }, "datePaid": { "format": "date-time", "type": "string", "title": "DateTime" }, "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "firstName": { "type": "string", "title": "String" }, "surname": { "type": "string", "title": "String" }, "externalId": { "type": "string", "title": "String" }, "location": { "type": "string", "title": "String" }, "units": { "format": "double", "type": "number", "title": "Decimal" }, "rate": { "format": "double", "type": "number", "title": "Decimal" }, "amount": { "format": "double", "type": "number", "title": "Decimal" }, "superAmount": { "format": "double", "type": "number", "title": "Decimal" } }, "xml": { "name": "PayCategoriesReportExportModel" }, "title": "PayCategoriesReportExportModel" }, "PaygReportRequestModel": { "type": "object", "properties": { "state": { "type": "string", "title": "String" }, "fromDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "toDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "locationId": { "format": "int32", "type": "integer", "title": "Int32" }, "employingEntityId": { "format": "int32", "type": "integer", "title": "Nullable" } }, "xml": { "name": "PaygReportRequestModel" }, "title": "PaygReportRequestModel" }, "PaygReportExportModel": { "type": "object", "properties": { "location": { "type": "string", "title": "String" }, "month": { "type": "string", "title": "String" }, "grossEarnings": { "format": "double", "type": "number", "title": "Decimal" }, "preTaxDeductions": { "format": "double", "type": "number", "title": "Decimal" }, "grossEarningsLessPreTaxDeductions": { "format": "double", "type": "number", "title": "Decimal" }, "payg": { "format": "double", "type": "number", "title": "Decimal" } }, "xml": { "name": "PaygReportExportModel" }, "title": "PaygReportExportModel" }, "DetailedActivityReportExportModel": { "type": "object", "properties": { "location": { "type": "string", "title": "String" }, "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "firstName": { "type": "string", "title": "String" }, "surname": { "type": "string", "title": "String" }, "externalId": { "type": "string", "title": "String" }, "hours": { "format": "double", "type": "number", "title": "Decimal" }, "grossEarnings": { "format": "double", "type": "number", "title": "Decimal" }, "preTaxDeductions": { "format": "double", "type": "number", "title": "Decimal" }, "postTaxDedutions": { "type": "object", "title": "Object" }, "taxExemptEarnings": { "format": "double", "type": "number", "title": "Decimal" }, "taxableEarnings": { "format": "double", "type": "number", "title": "Decimal" }, "payg": { "format": "double", "type": "number", "title": "Decimal" }, "sfss": { "format": "double", "type": "number", "title": "Decimal" }, "help": { "format": "double", "type": "number", "title": "Decimal" }, "super": { "format": "double", "type": "number", "title": "Decimal" }, "netEarnings": { "format": "double", "type": "number", "title": "Decimal" }, "employerLiabilities": { "format": "double", "type": "number", "title": "Decimal" }, "grossPlusSuper": { "format": "double", "type": "number", "title": "Decimal" } }, "xml": { "name": "DetailedActivityReportExportModel" }, "title": "DetailedActivityReportExportModel" }, "PayrollTaxReportRequestModel": { "type": "object", "properties": { "groupBy": { "enum": [ "EarningsLocation", "DefaultLocation" ], "type": "string", "title": "PayrollTaxGroupByEnum" }, "fromDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "toDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "locationId": { "format": "int32", "type": "integer", "title": "Int32" }, "employingEntityId": { "format": "int32", "type": "integer", "title": "Nullable" } }, "xml": { "name": "PayrollTaxReportRequestModel" }, "title": "PayrollTaxReportRequestModel" }, "PayrollTaxReportExportModel": { "type": "object", "properties": { "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "firstName": { "type": "string", "title": "String" }, "surname": { "type": "string", "title": "String" }, "externalId": { "type": "string", "title": "String" }, "location": { "type": "string", "title": "String" }, "type": { "type": "string", "title": "String" }, "state": { "type": "string", "title": "String" }, "amount": { "format": "double", "type": "number", "title": "Decimal" }, "employeePayrollTaxExempt": { "type": "boolean", "title": "Boolean" }, "payCategoryPayrollTaxExempt": { "type": "boolean", "title": "Boolean" }, "terminationPayment": { "type": "boolean", "title": "Boolean" }, "allowance": { "type": "boolean", "title": "Boolean" }, "etp": { "type": "boolean", "title": "Boolean" }, "genuineRedundancy": { "type": "boolean", "title": "Boolean" }, "lumpSumD": { "type": "boolean", "title": "Boolean" } }, "xml": { "name": "PayrollTaxReportExportModel" }, "title": "PayrollTaxReportExportModel" }, "TimesheetReportRequestModel": { "type": "object", "properties": { "employeeId": { "format": "int32", "type": "integer", "title": "Nullable" }, "includeCosts": { "type": "boolean", "title": "Boolean" }, "statuses": { "type": "array", "items": { "enum": [ "Missing", "Submitted", "Approved", "Rejected", "Processed" ], "type": "string", "title": "TimesheetLineStatusType" }, "xml": { "name": "TimesheetLineStatusType", "wrapped": true }, "title": "IList" }, "workTypeId": { "format": "int32", "type": "integer", "title": "Nullable" }, "payScheduleId": { "format": "int32", "type": "integer", "title": "Int32" }, "fromDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "toDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "locationId": { "format": "int32", "type": "integer", "title": "Int32" }, "employingEntityId": { "format": "int32", "type": "integer", "title": "Nullable" } }, "xml": { "name": "TimesheetReportRequestModel" }, "title": "TimesheetReportRequestModel" }, "TimesheetReportExportModel": { "type": "object", "properties": { "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "firstName": { "type": "string", "title": "String" }, "surname": { "type": "string", "title": "String" }, "employeeExternalId": { "type": "string", "title": "String" }, "id": { "format": "int32", "type": "integer", "title": "Int32" }, "status": { "type": "string", "title": "String" }, "location": { "type": "string", "title": "String" }, "start": { "format": "date-time", "type": "string", "title": "DateTime" }, "startTime": { "type": "string", "title": "TimeSpan" }, "end": { "format": "date-time", "type": "string", "title": "DateTime" }, "endTime": { "type": "string", "title": "TimeSpan" }, "duration": { "type": "string", "readOnly": true, "title": "TimeSpan" }, "units": { "format": "double", "type": "number", "title": "Decimal" }, "unitType": { "type": "string", "title": "String" }, "workType": { "type": "string", "title": "String" }, "shiftConditions": { "type": "string", "readOnly": true, "title": "String" }, "classification": { "type": "string", "title": "String" }, "numberOfBreaks": { "format": "int32", "type": "integer", "title": "Int32" }, "breakDuration": { "type": "string", "title": "TimeSpan" }, "comments": { "type": "string", "title": "String" }, "consolidatedWithTimesheetLineId": { "format": "int32", "type": "integer", "title": "Nullable" }, "reviewedBy": { "type": "string", "title": "String" }, "gross": { "format": "double", "type": "number", "title": "Nullable" }, "netEarnings": { "format": "double", "type": "number", "title": "Nullable" }, "super": { "format": "double", "type": "number", "title": "Nullable" }, "payg": { "format": "double", "type": "number", "title": "Nullable" }, "employerLiabilities": { "format": "double", "type": "number", "title": "Nullable" }, "totalCost": { "format": "double", "type": "number", "title": "Nullable" }, "dateCreated": { "format": "date-time", "type": "string", "title": "DateTime" }, "dateReviewed": { "format": "date-time", "type": "string", "title": "Nullable" }, "shiftConditionShortCodes": { "type": "array", "items": { "type": "string", "title": "String" }, "title": "IList" }, "breaks": { "type": "array", "items": { "$ref": "#/definitions/TimesheetBreakModel" }, "xml": { "name": "TimesheetBreakModel", "wrapped": true }, "title": "IList" } }, "xml": { "name": "TimesheetReportExportModel" }, "title": "TimesheetReportExportModel" }, "PaymentHistoryReportRequestModel": { "type": "object", "properties": { "employeeId": { "format": "int32", "type": "integer", "title": "Nullable" }, "fromDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "toDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "locationId": { "format": "int32", "type": "integer", "title": "Int32" }, "employingEntityId": { "format": "int32", "type": "integer", "title": "Nullable" } }, "xml": { "name": "PaymentHistoryReportRequestModel" }, "title": "PaymentHistoryReportRequestModel" }, "PaymentHistoryReportExportModel": { "type": "object", "properties": { "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "firstName": { "type": "string", "title": "String" }, "surname": { "type": "string", "title": "String" }, "externalId": { "type": "string", "title": "String" }, "datePaid": { "format": "date-time", "type": "string", "title": "DateTime" }, "locationName": { "type": "string", "title": "String" }, "accountName": { "type": "string", "title": "String" }, "bsb": { "type": "string", "title": "String" }, "accountNumber": { "type": "string", "title": "String" }, "accountType": { "type": "string", "title": "String" }, "taxableEarnings": { "format": "double", "type": "number", "title": "Decimal" }, "netEarnings": { "format": "double", "type": "number", "title": "Decimal" }, "totalAllowances": { "format": "double", "type": "number", "title": "Decimal" }, "totalDeductions": { "format": "double", "type": "number", "title": "Decimal" }, "amount": { "format": "double", "type": "number", "title": "Decimal" } }, "xml": { "name": "PaymentHistoryReportExportModel" }, "title": "PaymentHistoryReportExportModel" }, "BirthdayReportExportModel": { "type": "object", "properties": { "location": { "type": "string", "title": "String" }, "dateOfBirth": { "format": "date-time", "type": "string", "title": "DateTime" }, "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "firstName": { "type": "string", "title": "String" }, "surname": { "type": "string", "title": "String" }, "externalId": { "type": "string", "title": "String" }, "employmentStatus": { "type": "string", "title": "String" }, "age": { "format": "int32", "type": "integer", "title": "Int32" } }, "xml": { "name": "BirthdayReportExportModel" }, "title": "BirthdayReportExportModel" }, "GrossToNetReportRequest": { "type": "object", "properties": { "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "payCategoryIds": { "type": "array", "items": { "format": "int32", "type": "integer", "title": "Int32" }, "title": "List" }, "payScheduleId": { "format": "int32", "type": "integer", "title": "Int32" }, "fromDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "toDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "locationId": { "format": "int32", "type": "integer", "title": "Int32" }, "employingEntityId": { "format": "int32", "type": "integer", "title": "Nullable" } }, "xml": { "name": "GrossToNetReportRequest" }, "title": "GrossToNetReportRequest" }, "GrossToNetReportLineItem": { "type": "object", "properties": { "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "firstName": { "type": "string", "title": "String" }, "surname": { "type": "string", "title": "String" }, "primaryLocationId": { "format": "int32", "type": "integer", "title": "Int32" }, "primaryLocation": { "type": "string", "title": "String" }, "externalId": { "type": "string", "title": "String" }, "totalHours": { "format": "double", "type": "number", "title": "Decimal" }, "grossEarnings": { "type": "object", "additionalProperties": { "format": "double", "type": "number", "title": "Decimal" }, "title": "Dictionary" }, "totalGrossEarnings": { "format": "double", "type": "number", "readOnly": true, "title": "Decimal" }, "totalTaxExemptEarnings": { "format": "double", "type": "number", "title": "Decimal" }, "preTaxDeductions": { "type": "object", "additionalProperties": { "format": "double", "type": "number", "title": "Decimal" }, "title": "Dictionary" }, "totalPreTaxDeductions": { "format": "double", "type": "number", "readOnly": true, "title": "Decimal" }, "taxableEarnings": { "format": "double", "type": "number", "readOnly": true, "title": "Decimal" }, "payg": { "format": "double", "type": "number", "title": "Decimal" }, "sfss": { "format": "double", "type": "number", "title": "Decimal" }, "help": { "format": "double", "type": "number", "title": "Decimal" }, "postTaxDeductions": { "type": "object", "additionalProperties": { "format": "double", "type": "number", "title": "Decimal" }, "title": "Dictionary" }, "totalPostTaxDeductions": { "format": "double", "type": "number", "readOnly": true, "title": "Decimal" }, "netEarnings": { "format": "double", "type": "number", "readOnly": true, "title": "Decimal" }, "expenses": { "type": "object", "additionalProperties": { "format": "double", "type": "number", "title": "Decimal" }, "title": "Dictionary" }, "totalExpenses": { "format": "double", "type": "number", "readOnly": true, "title": "Decimal" }, "bankPayments": { "format": "double", "type": "number", "readOnly": true, "title": "Decimal" }, "sgc": { "format": "double", "type": "number", "title": "Decimal" }, "employerContribution": { "format": "double", "type": "number", "title": "Decimal" }, "totalGrossPlusSuper": { "format": "double", "type": "number", "readOnly": true, "title": "Decimal" } }, "xml": { "name": "GrossToNetReportLineItem" }, "title": "GrossToNetReportLineItem" }, "ReportLeaveLiabilityRequestModel": { "type": "object", "properties": { "locationId": { "format": "int32", "type": "integer", "title": "Int32" }, "leaveTypeId": { "format": "int32", "type": "integer", "title": "Int32" }, "includeApprovedLeave": { "type": "boolean", "title": "Boolean" }, "asAtDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "employingEntityId": { "format": "int32", "type": "integer", "title": "Nullable" } }, "xml": { "name": "ReportLeaveLiabilityRequestModel" }, "title": "ReportLeaveLiabilityRequestModel" }, "LeaveLiabilityReportExportModel": { "type": "object", "properties": { "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "firstName": { "type": "string", "title": "String" }, "surname": { "type": "string", "title": "String" }, "externalId": { "type": "string", "title": "String" }, "startDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "lastPaidDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "calculatedWeeks": { "format": "double", "type": "number", "title": "Decimal" }, "location": { "type": "string", "title": "String" }, "leaveCategoryName": { "type": "string", "title": "String" }, "approvedLeaveAmount": { "format": "double", "type": "number", "title": "Nullable" }, "accruedAmount": { "format": "double", "type": "number", "title": "Decimal" }, "accruedAmountInDays": { "format": "double", "type": "number", "title": "Decimal" }, "leaveValue": { "format": "double", "type": "number", "title": "Decimal" }, "leaveLoadingDollarValue": { "format": "double", "type": "number", "title": "Decimal" } }, "xml": { "name": "LeaveLiabilityReportExportModel" }, "title": "LeaveLiabilityReportExportModel" }, "RosterShiftFilterModel": { "type": "object", "properties": { "fromDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "toDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "resourceView": { "enum": [ "Employee", "Location" ], "type": "string", "title": "ResourceViewEnum" }, "shiftStatus": { "enum": [ "All", "Published", "Unpublished", "Accepted" ], "type": "string", "title": "RosterShiftStatus" }, "shiftStatuses": { "type": "array", "items": { "enum": [ "All", "Published", "Unpublished", "Accepted" ], "type": "string", "title": "RosterShiftStatus" }, "xml": { "name": "RosterShiftStatus", "wrapped": true }, "title": "IList" }, "selectedLocations": { "type": "array", "items": { "type": "string", "title": "String" }, "title": "IList" }, "selectedEmployees": { "type": "array", "items": { "type": "string", "title": "String" }, "title": "IList" }, "selectedRoles": { "type": "array", "items": { "type": "string", "title": "String" }, "title": "IList" }, "includeSublocations": { "type": "boolean", "title": "Boolean" }, "currentView": { "enum": [ "resourceDay", "resourceWeek", "resourceNextWeeks" ], "type": "string", "title": "RosterViewMode" }, "budgetWarningPercent": { "format": "double", "type": "number", "title": "Decimal" }, "employeeId": { "format": "int32", "type": "integer", "title": "Nullable" }, "locationId": { "format": "int32", "type": "integer", "title": "Nullable" }, "employeeGroupId": { "format": "int32", "type": "integer", "title": "Nullable" }, "unassignedShiftsOnly": { "type": "boolean", "title": "Boolean" }, "showCosts": { "type": "boolean", "title": "Boolean" }, "groupBy": { "enum": [ "Business", "Location" ], "type": "string", "title": "RosterGroupByEnum" }, "groupByThen": { "enum": [ "Employee", "Role", "StartingTime" ], "type": "string", "title": "RosterGroupByThenEnum" }, "excludeUnassignedEmployees": { "type": "boolean", "title": "Boolean" }, "selectAllRoles": { "type": "boolean", "title": "Boolean" } }, "xml": { "name": "RosterShiftFilterModel" }, "title": "RosterShiftFilterModel" }, "RosterShiftGenerateTimesheetModel": { "type": "object", "properties": { "description": { "type": "string", "readOnly": true, "title": "String" }, "isDifferent": { "type": "boolean", "title": "Boolean" }, "fullyQualifiedLocationName": { "type": "string", "title": "String" }, "id": { "format": "int32", "type": "integer", "title": "Int32" }, "employeeId": { "format": "int32", "type": "integer", "title": "Nullable" }, "startTime": { "format": "date-time", "type": "string", "title": "DateTime" }, "endTime": { "format": "date-time", "type": "string", "title": "DateTime" }, "noteAuthor": { "type": "string", "title": "String" }, "notes": { "type": "string", "title": "String" }, "locationId": { "format": "int32", "type": "integer", "title": "Int32" }, "employeeName": { "type": "string", "title": "String" }, "initials": { "type": "string", "title": "String" }, "locationName": { "type": "string", "title": "String" }, "published": { "type": "boolean", "title": "Boolean" }, "isAccepted": { "type": "boolean", "title": "Boolean" }, "selectedQualifications": { "type": "array", "items": { "format": "int32", "type": "integer", "title": "Int32" }, "title": "IList" }, "breaks": { "type": "array", "items": { "$ref": "#/definitions/RosterShiftBreakModel" }, "xml": { "name": "RosterShiftBreakModel", "wrapped": true }, "title": "IList" }, "workTypeId": { "format": "int32", "type": "integer", "title": "Nullable" }, "classificationId": { "format": "int32", "type": "integer", "title": "Nullable" }, "classification": { "type": "string", "title": "String" }, "workType": { "type": "string", "title": "String" }, "shiftConditionIds": { "type": "array", "items": { "format": "int32", "type": "integer", "title": "Int32" }, "title": "IList" }, "roleId": { "format": "int32", "type": "integer", "title": "Nullable" }, "datePublished": { "format": "date-time", "type": "string", "title": "Nullable" }, "resourceId": { "format": "int32", "type": "integer", "title": "Nullable" } }, "xml": { "name": "RosterShiftGenerateTimesheetModel" }, "title": "RosterShiftGenerateTimesheetModel" }, "RosterShiftBreakModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "startTime": { "format": "date-time", "type": "string", "readOnly": true, "title": "DateTime" }, "endTime": { "format": "date-time", "type": "string", "readOnly": true, "title": "DateTime" }, "startDateTime": { "format": "date-time", "type": "string", "title": "DateTime" }, "endDateTime": { "format": "date-time", "type": "string", "title": "DateTime" } }, "xml": { "name": "RosterShiftBreakModel" }, "title": "RosterShiftBreakModel" }, "StubRosterShiftViewModel": { "type": "object", "properties": { "note": { "type": "string", "title": "String" } }, "xml": { "name": "StubRosterShiftViewModel" }, "title": "StubRosterShiftViewModel" }, "ODataQueryOptions[SuperFundProduct]": { "type": "object", "properties": { "ifMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "ifNoneMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "context": { "$ref": "#/definitions/ODataQueryContext", "readOnly": true }, "request": { "type": "object", "readOnly": true, "title": "HttpRequestMessage" }, "rawValues": { "$ref": "#/definitions/ODataRawQueryOptions", "readOnly": true }, "selectExpand": { "$ref": "#/definitions/SelectExpandQueryOption", "readOnly": true }, "filter": { "$ref": "#/definitions/FilterQueryOption", "readOnly": true }, "orderBy": { "$ref": "#/definitions/OrderByQueryOption", "readOnly": true }, "skip": { "$ref": "#/definitions/SkipQueryOption", "readOnly": true }, "top": { "$ref": "#/definitions/TopQueryOption", "readOnly": true }, "inlineCount": { "$ref": "#/definitions/InlineCountQueryOption", "readOnly": true }, "validator": { "$ref": "#/definitions/ODataQueryValidator" } }, "xml": { "name": "ODataQueryOptions`1" }, "title": "ODataQueryOptions" }, "SelfManagedSuperFundModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "abn": { "type": "string", "title": "String" }, "fundName": { "type": "string", "title": "String" }, "accountName": { "type": "string", "title": "String" }, "accountNumber": { "type": "string", "title": "String" }, "bsb": { "type": "string", "title": "String" }, "electronicServiceAddress": { "type": "string", "title": "String" }, "email": { "type": "string", "title": "String" } }, "xml": { "name": "SelfManagedSuperFundModel" }, "title": "SelfManagedSuperFundModel" }, "SuperProductEditModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "abn": { "type": "string", "title": "String" }, "productCode": { "type": "string", "title": "String" }, "productType": { "type": "string", "title": "String" }, "businessName": { "type": "string", "title": "String" }, "displayName": { "type": "string", "readOnly": true, "title": "String" }, "productName": { "type": "string", "title": "String" }, "accountNumber": { "type": "string", "title": "String" }, "bsb": { "type": "string", "title": "String" }, "accountName": { "type": "string", "title": "String" }, "source": { "enum": [ "None", "Saasu", "Xero", "MYOB", "Deputy", "EmployeeTimePunch", "ClickSuper", "IntegratedTimesheets", "FileImport", "FileExport", "QuickBooks", "Harmony", "AwardStore", "Attache", "IntegratedRostering", "ReckonAccounts", "API", "MicroPower", "RosterLive", "NetSuite", "Kounta", "TimeAndAttendanceKiosk", "DetailedFileExport", "JonasPremier", "WageEasy", "Maestrano", "WorkZone", "EmployeePortal", "RosterTemplate", "Onboarding", "Admin", "WorkZoneClockOnOff" ], "type": "string", "title": "ExternalService" }, "electronicServiceAddress": { "type": "string", "title": "String" }, "email": { "type": "string", "title": "String" }, "externalReferenceId": { "type": "string", "title": "String" } }, "xml": { "name": "SuperProductEditModel" }, "title": "SuperProductEditModel" }, "KioskCreateEmployeeModel": { "type": "object", "properties": { "firstName": { "type": "string", "title": "String" }, "surname": { "type": "string", "title": "String" }, "email": { "type": "string", "title": "String" }, "mobileNumber": { "type": "string", "title": "String" }, "pin": { "type": "string", "title": "String" } }, "xml": { "name": "KioskCreateEmployeeModel" }, "title": "KioskCreateEmployeeModel" }, "CheckKioskEmployeeIdModel": { "type": "object", "properties": { "employeeId": { "format": "int32", "type": "integer", "title": "Nullable" } }, "xml": { "name": "CheckKioskEmployeeIdModel" }, "title": "CheckKioskEmployeeIdModel" }, "CheckKioskPinModel": { "type": "object", "properties": { "employeeId": { "format": "int32", "type": "integer", "title": "Nullable" }, "pin": { "type": "string", "title": "String" } }, "xml": { "name": "CheckKioskPinModel" }, "title": "CheckKioskPinModel" }, "ChangeKioskPinModel": { "type": "object", "properties": { "employeeId": { "format": "int32", "type": "integer", "title": "Nullable" }, "oldPin": { "type": "string", "title": "String" }, "newPin": { "type": "string", "title": "String" } }, "xml": { "name": "ChangeKioskPinModel" }, "title": "ChangeKioskPinModel" }, "PinResetModel": { "type": "object", "properties": { "employeeId": { "format": "int32", "type": "integer", "title": "Int32" } }, "xml": { "name": "PinResetModel" }, "title": "PinResetModel" }, "TimeAndAttendanceKioskModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "externalId": { "type": "string", "title": "String" }, "locationId": { "format": "int32", "type": "integer", "title": "Nullable" }, "name": { "type": "string", "title": "String" }, "timeZone": { "type": "string", "title": "String" }, "allowHigherClassificationSelection": { "type": "boolean", "title": "Boolean" }, "branding": { "$ref": "#/definitions/WhiteLabelBrandingModel" }, "isLocationRequired": { "type": "boolean", "title": "Boolean" }, "isWorkTypeRequired": { "type": "boolean", "title": "Boolean" }, "restrictLocationsForEmployees": { "type": "boolean", "title": "Boolean" }, "allowEmployeeShiftSelection": { "type": "boolean", "title": "Nullable" }, "clockOnWindowMinutes": { "format": "int32", "type": "integer", "title": "Nullable" }, "clockOffWindowMinutes": { "format": "int32", "type": "integer", "title": "Nullable" }, "ianaTimeZone": { "type": "string", "readOnly": true, "title": "String" }, "isPhotoRequired": { "type": "boolean", "title": "Nullable" } }, "xml": { "name": "TimeAndAttendanceKioskModel" }, "title": "TimeAndAttendanceKioskModel" }, "ODataQueryOptions[TimesheetLine]": { "type": "object", "properties": { "ifMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "ifNoneMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "context": { "$ref": "#/definitions/ODataQueryContext", "readOnly": true }, "request": { "type": "object", "readOnly": true, "title": "HttpRequestMessage" }, "rawValues": { "$ref": "#/definitions/ODataRawQueryOptions", "readOnly": true }, "selectExpand": { "$ref": "#/definitions/SelectExpandQueryOption", "readOnly": true }, "filter": { "$ref": "#/definitions/FilterQueryOption", "readOnly": true }, "orderBy": { "$ref": "#/definitions/OrderByQueryOption", "readOnly": true }, "skip": { "$ref": "#/definitions/SkipQueryOption", "readOnly": true }, "top": { "$ref": "#/definitions/TopQueryOption", "readOnly": true }, "inlineCount": { "$ref": "#/definitions/InlineCountQueryOption", "readOnly": true }, "validator": { "$ref": "#/definitions/ODataQueryValidator" } }, "xml": { "name": "ODataQueryOptions`1" }, "title": "ODataQueryOptions" }, "TimesheetLineModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "startTime": { "format": "date-time", "type": "string", "title": "Nullable" }, "endTime": { "format": "date-time", "type": "string", "title": "Nullable" }, "units": { "format": "double", "type": "number", "title": "Nullable" }, "workTypeId": { "type": "string", "title": "String" }, "locationId": { "type": "string", "title": "String" }, "comments": { "type": "string", "title": "String" }, "breaks": { "type": "array", "items": { "$ref": "#/definitions/TimesheetBreakModel" }, "xml": { "name": "TimesheetBreakModel", "wrapped": true }, "title": "IList" }, "status": { "type": "string", "title": "String" }, "rate": { "format": "double", "type": "number", "title": "Nullable" }, "leaveCategoryId": { "type": "string", "title": "String" }, "payCategoryId": { "type": "string", "title": "String" }, "classificationId": { "type": "string", "title": "String" }, "externalId": { "type": "string", "title": "String" }, "source": { "enum": [ "None", "Saasu", "Xero", "MYOB", "Deputy", "EmployeeTimePunch", "ClickSuper", "IntegratedTimesheets", "FileImport", "FileExport", "QuickBooks", "Harmony", "AwardStore", "Attache", "IntegratedRostering", "ReckonAccounts", "API", "MicroPower", "RosterLive", "NetSuite", "Kounta", "TimeAndAttendanceKiosk", "DetailedFileExport", "JonasPremier", "WageEasy", "Maestrano", "WorkZone", "EmployeePortal", "RosterTemplate", "Onboarding", "Admin", "WorkZoneClockOnOff" ], "type": "string", "title": "ExternalService" }, "attachmentId": { "format": "int32", "type": "integer", "title": "Nullable" }, "shiftConditionIds": { "type": "array", "items": { "type": "string", "title": "String" }, "title": "IList" } }, "xml": { "name": "TimesheetLineModel" }, "title": "TimesheetLineModel" }, "SubmitTimesheetsRequest": { "type": "object", "properties": { "fromDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "toDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "replaceExisting": { "type": "boolean", "title": "Boolean" }, "approved": { "type": "boolean", "title": "Boolean" }, "employeeIdType": { "enum": [ "Standard", "External" ], "type": "string", "title": "IdType" }, "locationIdType": { "enum": [ "Standard", "External" ], "type": "string", "title": "IdType" }, "workTypeIdType": { "enum": [ "Standard", "External" ], "type": "string", "title": "IdType" }, "timesheets": { "type": "object", "additionalProperties": { "type": "array", "items": { "$ref": "#/definitions/TimesheetLineModel" }, "xml": { "name": "TimesheetLineModel", "wrapped": true }, "title": "IList" }, "title": "IDictionary" } }, "xml": { "name": "SubmitTimesheetsRequest" }, "example": { "fromDate": "2017-06-01T00:00:00", "toDate": "2017-06-30T00:00:00", "replaceExisting": false, "approved": true, "employeeIdType": "External", "locationIdType": "Standard", "workTypeIdType": "External", "timesheets": { "emP3316": [ { "id": 0, "employeeId": 0, "startTime": "2017-06-11T10:00:00", "endTime": "2017-06-11T13:00:00", "units": null, "workTypeId": null, "locationId": null, "comments": null, "breaks": [], "status": null, "rate": null, "leaveCategoryId": null, "payCategoryId": null, "classificationId": null, "externalId": null, "source": "None", "attachmentId": null, "shiftConditionIds": null } ], "emP3317": [ { "id": 0, "employeeId": 0, "startTime": "2017-06-13T09:00:00", "endTime": "2017-06-13T17:00:00", "units": 8.0, "workTypeId": "WT1485", "locationId": "123456", "comments": "Some Comments", "breaks": [ { "startTime": "2017-06-13T11:00:00", "endTime": "2017-06-13T12:00:00" } ], "status": null, "rate": 20.0, "leaveCategoryId": null, "payCategoryId": null, "classificationId": null, "externalId": null, "source": "None", "attachmentId": null, "shiftConditionIds": null }, { "id": 0, "employeeId": 0, "startTime": "2017-06-15T09:00:00", "endTime": "2017-06-15T17:00:00", "units": 8.0, "workTypeId": "WT1485", "locationId": "123456", "comments": "Some Comments", "breaks": [ { "startTime": "2017-06-15T11:00:00", "endTime": "2017-06-15T12:00:00" } ], "status": null, "rate": 20.0, "leaveCategoryId": null, "payCategoryId": null, "classificationId": null, "externalId": null, "source": "None", "attachmentId": null, "shiftConditionIds": null } ] } }, "title": "SubmitTimesheetsRequest" }, "UnavailabilityFilter": { "type": "object", "properties": { "fromDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "toDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "employeeId": { "format": "int32", "type": "integer", "title": "Nullable" }, "defaultLocationId": { "format": "int32", "type": "integer", "title": "Nullable" } }, "xml": { "name": "UnavailabilityFilter" }, "title": "UnavailabilityFilter" }, "UnavailabilityModel": { "type": "object", "properties": { "employeeId": { "format": "int32", "type": "integer", "title": "Int32" }, "id": { "format": "int32", "type": "integer", "title": "Int32" }, "fromDate": { "format": "date-time", "type": "string", "title": "DateTime" }, "toDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "endDate": { "format": "date-time", "type": "string", "title": "Nullable" }, "reason": { "type": "string", "title": "String" }, "recurring": { "type": "boolean", "title": "Boolean" }, "recurringDay": { "enum": [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], "type": "string", "title": "Nullable" }, "isAllDay": { "type": "boolean", "readOnly": true, "title": "Boolean" }, "viewOnly": { "type": "boolean", "title": "Boolean" } }, "xml": { "name": "UnavailabilityModel" }, "title": "UnavailabilityModel" }, "UserModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "email": { "type": "string", "title": "String" }, "displayName": { "type": "string", "title": "String" }, "timeZone": { "type": "string", "title": "String" } }, "xml": { "name": "UserModel" }, "title": "UserModel" }, "NewUserModel": { "type": "object", "properties": { "username": { "type": "string", "title": "String" }, "displayName": { "type": "string", "title": "String" }, "timeZone": { "type": "string", "title": "String" }, "apiOnly": { "type": "boolean", "title": "Boolean" } }, "xml": { "name": "NewUserModel" }, "title": "NewUserModel" }, "WebHook": { "required": [ "webHookUri" ], "type": "object", "properties": { "id": { "type": "string", "title": "String" }, "webHookUri": { "type": "string", "title": "Uri" }, "secret": { "type": "string", "title": "String" }, "description": { "type": "string", "title": "String" }, "isPaused": { "type": "boolean", "title": "Boolean" }, "filters": { "type": "array", "items": { "type": "string", "title": "String" }, "readOnly": true, "title": "ISet" }, "headers": { "type": "object", "additionalProperties": { "type": "string", "title": "String" }, "readOnly": true, "title": "IDictionary" }, "properties": { "type": "object", "additionalProperties": { "type": "object", "title": "Object" }, "readOnly": true, "title": "IDictionary" } }, "xml": { "name": "WebHook" }, "title": "WebHook" }, "WhiteLabelModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "name": { "type": "string", "title": "String" } }, "xml": { "name": "WhiteLabelModel" }, "title": "WhiteLabelModel" }, "InvoiceModel": { "type": "object", "properties": { "id": { "format": "int32", "type": "integer", "title": "Int32" }, "invoiceNumber": { "type": "string", "title": "String" }, "date": { "format": "date-time", "type": "string", "title": "DateTime" }, "totalExcludingGst": { "format": "double", "type": "number", "title": "Decimal" }, "gst": { "format": "double", "type": "number", "title": "Decimal" }, "totalIncludingGst": { "format": "double", "type": "number", "title": "Decimal" }, "cultureName": { "type": "string", "title": "String" }, "currency": { "type": "string", "title": "String" }, "lineItems": { "type": "array", "items": { "$ref": "#/definitions/InvoiceLineItemModel" }, "xml": { "name": "InvoiceLineItemModel", "wrapped": true }, "title": "List" } }, "xml": { "name": "InvoiceModel" }, "title": "InvoiceModel" }, "InvoiceLineItemModel": { "type": "object", "properties": { "abn": { "type": "string", "title": "String" }, "description": { "type": "string", "title": "String" }, "unitPriceIncludingGst": { "format": "double", "type": "number", "title": "Decimal" }, "quantity": { "format": "double", "type": "number", "title": "Decimal" }, "totalIncludingGst": { "format": "double", "type": "number", "title": "Decimal" }, "details": { "type": "array", "items": { "$ref": "#/definitions/InvoiceLineItemDetailModel" }, "xml": { "name": "InvoiceLineItemDetailModel", "wrapped": true }, "title": "List" } }, "xml": { "name": "InvoiceLineItemModel" }, "title": "InvoiceLineItemModel" }, "InvoiceLineItemDetailModel": { "type": "object", "properties": { "description": { "type": "string", "title": "String" } }, "xml": { "name": "InvoiceLineItemDetailModel" }, "title": "InvoiceLineItemDetailModel" }, "ODataQueryOptions[WorkType]": { "type": "object", "properties": { "ifMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "ifNoneMatch": { "type": "object", "readOnly": true, "title": "ETag" }, "context": { "$ref": "#/definitions/ODataQueryContext", "readOnly": true }, "request": { "type": "object", "readOnly": true, "title": "HttpRequestMessage" }, "rawValues": { "$ref": "#/definitions/ODataRawQueryOptions", "readOnly": true }, "selectExpand": { "$ref": "#/definitions/SelectExpandQueryOption", "readOnly": true }, "filter": { "$ref": "#/definitions/FilterQueryOption", "readOnly": true }, "orderBy": { "$ref": "#/definitions/OrderByQueryOption", "readOnly": true }, "skip": { "$ref": "#/definitions/SkipQueryOption", "readOnly": true }, "top": { "$ref": "#/definitions/TopQueryOption", "readOnly": true }, "inlineCount": { "$ref": "#/definitions/InlineCountQueryOption", "readOnly": true }, "validator": { "$ref": "#/definitions/ODataQueryValidator" } }, "xml": { "name": "ODataQueryOptions`1" }, "title": "ODataQueryOptions" } }, "securityDefinitions": { "basic": { "type": "basic", "description": "Your API key should be the username and the password can be left blank" }, "apiKey": { "type": "apiKey", "description": "API Key Authentication", "name": "apiKey", "in": "header" }, "oauth2": { "type": "oauth2", "description": "OAuth2 Implicit Grant", "flow": "implicit", "authorizationUrl": "https://{yourwhitelabel}.yourpayroll.com.au/oauth/authorise", "tokenUrl": "https://{yourwhitelabel}.yourpayroll.com.au/oauth/token", "scopes": { "read": "Read access to protected resources", "write": "Write access to protected resources" } } }, "security": [ { "apiKey": [] } ], "tags": [ { "name": "User", "description": "User" }, { "name": "Authentication", "description": "Authentication" }, { "name": "Business", "description": "Business" }, { "name": "PayRun", "description": "Pay Run" }, { "name": "PublicHoliday", "description": "Public Holiday" }, { "name": "TimeAndAttendance", "description": "Time and Attendance" }, { "name": "EmployeeQualifications", "description": "Employee Qualifications" }, { "name": "LeaveRequests", "description": "Leave Requests" }, { "name": "Timesheets", "description": "Timesheets" }, { "name": "Location", "description": "Location" }, { "name": "DeductionCategories", "description": "Deduction Categories" }, { "name": "EmployeeExpenseCategories", "description": "Employee Expense Categories" }, { "name": "EmployerLiabilityCategories", "description": "Employer Liability Categories" }, { "name": "LeaveAllowance", "description": "Leave Allowances" }, { "name": "Employee", "description": "Employee" }, { "name": "EmployeeDocument", "description": "Employee Documents" }, { "name": "EmployeeGroups", "description": "Employee Groups" }, { "name": "AbaSettings", "description": "ABA Settings" }, { "name": "EmployingEntities", "description": "Employing Entities" }, { "name": "EmploymentAgreement", "description": "Employment Agreement" }, { "name": "LeaveCategories", "description": "Leave Categories" }, { "name": "PayCategory", "description": "Pay Category" }, { "name": "PaymentSummary", "description": "Payment Summaries" }, { "name": "PayRateTemplate", "description": "Pay Rate Templates" }, { "name": "PaySchedule", "description": "Pay Schedules" }, { "name": "Qualifications", "description": "Qualifications" }, { "name": "RosterShift", "description": "Roster Shifts" }, { "name": "SuperFund", "description": "Super Funds" }, { "name": "WorkType", "description": "Work Types" }, { "name": "EmployeeAccess", "description": "Employee Access" }, { "name": "EmployeeExpenseRequest", "description": "Employee Expense Requests" }, { "name": "EmployeeBankAccount", "description": "Employee Bank Accounts" }, { "name": "EmployeeSuperFund", "description": "Employee Super Funds" }, { "name": "EmployeeRecurringTransactions", "description": "Pay Run Inclusions" }, { "name": "Unavailability", "description": "Unavailability" }, { "name": "Reporting", "description": "Reporting" }, { "name": "Ess", "description": "Employee Self Service" }, { "name": "LookupData", "description": "Lookup Data" }, { "name": "Webhook", "description": "Webhook" }, { "name": "WhiteLabel", "description": "White Label Only" } ], "x-navigateMethodsByName": true }spec-0.21.0/fixtures/bugs/957/000077500000000000000000000000001457312531500156675ustar00rootroot00000000000000spec-0.21.0/fixtures/bugs/957/fixture-957.json000066400000000000000000002640101457312531500205750ustar00rootroot00000000000000{ "info": { "title": "API title", "version": "0.0.1" }, "swagger": "2.0", "produces": [ "application/json", "text/plain" ], "securityDefinitions": { "api_key": { "type": "apiKey", "name": "private_token", "in": "query" }, "oauth2": { "type": "oauth2", "authorizationUrl": "https://local.tools.stack.local/torca/oauth/authorize", "flow": "implicit" } }, "host": "local.tools.stack.local", "basePath": "/torca/nmdb/api", "schemes": [ "https" ], "tags": [ { "name": "devices", "description": "Operations about devices" }, { "name": "info", "description": "Operations about infos" } ], "paths": { "/v2/devices": { "get": { "summary": "Query Nmdb::Device Object.", "description": "Query Nmdb::Device Object.", "produces": [ "application/json" ], "parameters": [ { "in": "query", "name": "page", "description": "Page offset to fetch.", "type": "integer", "format": "int32", "default": 1, "required": false }, { "in": "query", "name": "per_page", "description": "Number of results to return per page.", "type": "integer", "format": "int32", "default": 20, "required": false }, { "in": "query", "name": "offset", "description": "Pad a number of results.", "type": "integer", "format": "int32", "default": 0, "required": false }, { "in": "query", "name": "fmt", "type": "string", "default": "full_root", "enum": [ "full", "full_root", "base" ], "required": false }, { "in": "query", "name": "rels", "description": "Comma-separated list of relationships. Maximum 5 levels. \n e.g. interfaces,interfaces.ip_address", "type": "string", "required": false }, { "in": "query", "name": "filters", "description": "Supports nesting up to 2 levels. \n e.g {\"host_name\":\"~hhcvi\",\"interfaces\":{\"ip_address\":{\"network_address\":\"~10.10.10\"},\"name\":\"eth0\"}}", "type": "string", "required": false }, { "in": "query", "name": "search", "type": "string", "required": false } ], "responses": { "200": { "description": "Query Nmdb::Device Object.", "schema": { "type": "array", "items": { "$ref": "#/definitions/Device" } } }, "406": { "description": "NmdbQueryError", "schema": { "$ref": "#/definitions/NmdbQueryError" } } }, "tags": [ "devices" ], "operationId": "getV2Devices" }, "post": { "summary": "Create Nmdb::Device Object.", "description": "Create Nmdb::Device Object.", "produces": [ "application/json" ], "consumes": [ "application/json" ], "parameters": [ { "name": "V2Devices", "in": "body", "required": true, "schema": { "$ref": "#/definitions/postV2Devices" } } ], "responses": { "201": { "description": "Create Nmdb::Device Object.", "schema": { "$ref": "#/definitions/Device" } } }, "tags": [ "devices" ], "operationId": "postV2Devices" } }, "/v2/devices/{id}": { "get": { "summary": "GET Nmdb::Device Object.", "description": "GET Nmdb::Device Object.", "produces": [ "application/json" ], "parameters": [ { "in": "path", "name": "id", "type": "integer", "format": "int32", "required": true }, { "in": "query", "name": "fmt", "type": "string", "default": "full_root", "enum": [ "full", "full_root", "base" ], "required": false }, { "in": "query", "name": "rels", "description": "Comma-separated list of relationships. Maximum 5 levels. \n e.g. interfaces,interfaces.ip_address", "type": "string", "required": false } ], "responses": { "200": { "description": "GET Nmdb::Device Object.", "schema": { "$ref": "#/definitions/Device" } }, "406": { "description": "NmdbQueryError", "schema": { "$ref": "#/definitions/NmdbQueryError" } } }, "tags": [ "devices" ], "operationId": "getV2DevicesId" }, "put": { "summary": "Update Nmdb::Device Object.", "description": "Update Nmdb::Device Object.", "produces": [ "application/json" ], "consumes": [ "application/json" ], "parameters": [ { "in": "path", "name": "id", "type": "integer", "format": "int32", "required": true }, { "name": "V2Devices", "in": "body", "required": true, "schema": { "$ref": "#/definitions/putV2Devices" } } ], "responses": { "200": { "description": "Update Nmdb::Device Object.", "schema": { "$ref": "#/definitions/Device" } } }, "tags": [ "devices" ], "operationId": "putV2DevicesId" } }, "/v2/info/version": { "get": { "summary": "Get API Version", "description": "Get API Version", "produces": [ "application/json" ], "responses": { "200": { "description": "Get API Version", "schema": { "$ref": "#/definitions/Version" } } }, "tags": [ "info" ], "operationId": "getV2InfoVersion" } } }, "definitions": { "Device": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "ciid": { "type": "string" }, "host_name": { "type": "string" }, "description": { "type": "string" }, "zone_id": { "type": "integer", "format": "int32" }, "project_id": { "type": "integer", "format": "int32" }, "device_model_id": { "type": "integer", "format": "int32" }, "rack_id": { "type": "integer", "format": "int32" }, "device_status_id": { "type": "integer", "format": "int32" }, "device_status_reason_id": { "type": "integer", "format": "int32" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "asset_tag": { "type": "string" }, "reconciliation_identity": { "type": "string" }, "serial_number": { "type": "string" }, "application_environment_id": { "type": "integer", "format": "int32" }, "pod_id": { "type": "integer", "format": "int32" }, "vm_capacity": { "type": "integer", "format": "int32" }, "switch_domain_id": { "type": "integer", "format": "int32" }, "blade_slot": { "type": "integer", "format": "int32" }, "blade_slots_required": { "type": "integer", "format": "int32" }, "blade_chassis_id": { "type": "integer", "format": "int32" }, "virtual_host_id": { "type": "integer", "format": "int32" }, "physical_host_id": { "type": "integer", "format": "int32" }, "blade_capacity": { "type": "integer", "format": "int32" }, "device_type_id": { "type": "integer", "format": "int32" }, "ru_required": { "type": "integer", "format": "int32" }, "primary_device_id": { "type": "integer", "format": "int32" }, "instance_id": { "type": "string" }, "operating_system_id": { "type": "integer", "format": "int32" }, "workbook_version": { "type": "string" }, "virtualized_on_vm_host_pool_id": { "type": "integer", "format": "int32" }, "contained_in_vm_host_pool_id": { "type": "integer", "format": "int32" }, "a_or_b": { "type": "integer", "format": "int32" }, "bottom_ru": { "type": "integer", "format": "int32" }, "event_logs": { "type": "array", "items": { "$ref": "#/definitions/EventLog" } }, "sync_status": { "$ref": "#/definitions/SyncStatus" }, "device_status": { "$ref": "#/definitions/DeviceStatus" }, "device_status_reason": { "$ref": "#/definitions/DeviceStatusReason" }, "versions": { "type": "array", "items": { "$ref": "#/definitions/Version" } }, "device_model": { "$ref": "#/definitions/DeviceModel" }, "device_type": { "$ref": "#/definitions/DeviceType" }, "project": { "$ref": "#/definitions/Project" }, "rack": { "$ref": "#/definitions/Rack" }, "zone": { "$ref": "#/definitions/Zone" }, "pod": { "$ref": "#/definitions/Pod" }, "application_environment": { "$ref": "#/definitions/ApplicationEnvironment" }, "operating_system": { "$ref": "#/definitions/OperatingSystem" }, "host_name_reservation": { "$ref": "#/definitions/HostNameReservation" }, "interfaces": { "type": "array", "items": { "$ref": "#/definitions/Interface" } }, "switch_ports": { "type": "array", "items": { "$ref": "#/definitions/SwitchPort" } }, "nat_entries": { "type": "array", "items": { "$ref": "#/definitions/NatEntry" } }, "load_balancer_entries": { "type": "array", "items": { "$ref": "#/definitions/LoadBalancerEntry" } }, "blades": { "type": "array", "items": { "$ref": "#/definitions/Device" } }, "blade_chassis": { "$ref": "#/definitions/Device" }, "virtual_clients": { "type": "array", "items": { "$ref": "#/definitions/Device" } }, "virtual_host": { "$ref": "#/definitions/Device" }, "virtual_hosts": { "type": "array", "items": { "$ref": "#/definitions/Device" } }, "physical_host": { "$ref": "#/definitions/Device" }, "host_pool": { "$ref": "#/definitions/VmHostPool" }, "virtualization_pool": { "$ref": "#/definitions/VmHostPool" }, "primary_device": { "$ref": "#/definitions/Device" }, "subnet_assignments": { "type": "array", "items": { "$ref": "#/definitions/SubnetAssignment" } }, "subnets": { "$ref": "#/definitions/Subnet" } }, "description": "Update Nmdb::Device Object." }, "EventLog": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "event_class": { "type": "string" }, "severity": { "type": "integer", "format": "int32" }, "name": { "type": "string" }, "status": { "type": "string" }, "details": { "type": "string" }, "data": { "type": "string" }, "loggable_id": { "type": "integer", "format": "int32" }, "loggable_type": { "type": "string" }, "start_time": { "type": "string", "format": "date-time" }, "end_time": { "type": "string", "format": "date-time" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "loggable": { "$ref": "#/definitions/Loggable" } } }, "Loggable": { "type": "object", "properties": { "id": { "type": "string" } } }, "SyncStatus": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "status": { "type": "string" }, "locked": { "type": "boolean" }, "details": { "type": "string" }, "last_sync_start": { "type": "string", "format": "date-time" }, "last_sync_end": { "type": "string", "format": "date-time" }, "synchronizable_id": { "type": "integer", "format": "int32" }, "synchronizable_type": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "synchronizable": { "$ref": "#/definitions/Synchronizable" } } }, "Synchronizable": { "type": "object", "properties": { "id": { "type": "string" } } }, "DeviceStatus": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "name": { "type": "string" }, "color": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "integration_id": { "type": "string" }, "devices": { "type": "array", "items": { "$ref": "#/definitions/Device" } }, "racks": { "type": "array", "items": { "$ref": "#/definitions/Rack" } }, "device_status_reasons": { "type": "array", "items": { "$ref": "#/definitions/DeviceStatusReason" } } } }, "Rack": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "ciid": { "type": "string" }, "name": { "type": "string" }, "description": { "type": "string" }, "width": { "type": "string" }, "height": { "type": "string" }, "depth": { "type": "string" }, "total_ru_space": { "type": "integer", "format": "int32" }, "max_power_watts": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "location_id": { "type": "integer", "format": "int32" }, "fibre_connection_count": { "type": "integer", "format": "int32" }, "ethernet_connection_count": { "type": "integer", "format": "int32" }, "device_status_id": { "type": "integer", "format": "int32" }, "device_status_reason_id": { "type": "integer", "format": "int32" }, "pod_id": { "type": "integer", "format": "int32" }, "reconciliation_identity": { "type": "string" }, "event_logs": { "type": "array", "items": { "$ref": "#/definitions/EventLog" } }, "sync_status": { "$ref": "#/definitions/SyncStatus" }, "device_status": { "$ref": "#/definitions/DeviceStatus" }, "device_status_reason": { "$ref": "#/definitions/DeviceStatusReason" }, "devices": { "type": "array", "items": { "$ref": "#/definitions/Device" } }, "location": { "$ref": "#/definitions/Location" }, "pod": { "$ref": "#/definitions/Pod" } } }, "DeviceStatusReason": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "name": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "device_status_id": { "type": "integer", "format": "int32" }, "integration_id": { "type": "string" }, "devices": { "type": "array", "items": { "$ref": "#/definitions/Device" } }, "racks": { "type": "array", "items": { "$ref": "#/definitions/Rack" } }, "device_status": { "$ref": "#/definitions/DeviceStatus" } } }, "Location": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "site": { "type": "string" }, "region": { "type": "string" }, "building": { "type": "string" }, "floor": { "type": "string" }, "room": { "type": "string" }, "latitude": { "type": "string" }, "longitude": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "pods": { "type": "array", "items": { "$ref": "#/definitions/Pod" } } } }, "Pod": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "name": { "type": "string" }, "pod_type_id": { "type": "integer", "format": "int32" }, "environment_id": { "type": "integer", "format": "int32" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "location_id": { "type": "integer", "format": "int32" }, "pod_type": { "$ref": "#/definitions/PodType" }, "location": { "$ref": "#/definitions/Location" }, "zones": { "type": "array", "items": { "$ref": "#/definitions/Zone" } }, "devices": { "type": "array", "items": { "$ref": "#/definitions/Device" } }, "racks": { "type": "array", "items": { "$ref": "#/definitions/Rack" } }, "data_transactions": { "type": "array", "items": { "$ref": "#/definitions/DataTransaction" } } } }, "PodType": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "name": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "pods": { "type": "array", "items": { "$ref": "#/definitions/Pod" } } } }, "Zone": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "name": { "type": "string" }, "parent_id": { "type": "integer", "format": "int32" }, "pod_id": { "type": "integer", "format": "int32" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "zone_group_id": { "type": "integer", "format": "int32" }, "notes": { "type": "string" }, "devices": { "type": "array", "items": { "$ref": "#/definitions/Device" } }, "vlans": { "type": "array", "items": { "$ref": "#/definitions/Vlan" } }, "subnets": { "type": "array", "items": { "$ref": "#/definitions/Subnet" } }, "pod": { "$ref": "#/definitions/Pod" }, "children": { "type": "array", "items": { "$ref": "#/definitions/Zone" } }, "data_transactions": { "type": "array", "items": { "$ref": "#/definitions/DataTransaction" } }, "parent": { "$ref": "#/definitions/Zone" } } }, "Vlan": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "primary_number": { "type": "integer", "format": "int32" }, "number": { "type": "integer", "format": "int32" }, "zone_id": { "type": "integer", "format": "int32" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "direction_id": { "type": "integer", "format": "int32" }, "vlan_type_id": { "type": "integer", "format": "int32" }, "description": { "type": "string" }, "is_primary": { "type": "boolean" }, "notes": { "type": "array", "items": { "$ref": "#/definitions/Note" } }, "subnets": { "type": "array", "items": { "$ref": "#/definitions/Subnet" } }, "zone": { "$ref": "#/definitions/Zone" }, "direction": { "$ref": "#/definitions/Direction" }, "vlan_type": { "$ref": "#/definitions/VlanType" }, "interfaces": { "type": "array", "items": { "$ref": "#/definitions/Interface" } }, "switch_ports": { "type": "array", "items": { "$ref": "#/definitions/SwitchPort" } }, "data_transactions": { "type": "array", "items": { "$ref": "#/definitions/DataTransaction" } } } }, "Note": { "type": "object", "properties": { "id": { "type": "string" } } }, "Subnet": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "name": { "type": "string" }, "description": { "type": "string" }, "network_address": { "type": "string" }, "netmask": { "type": "integer", "format": "int32" }, "default_gateway_id": { "type": "string" }, "broadcast": { "type": "string" }, "zone_id": { "type": "integer", "format": "int32" }, "supernet_id": { "type": "integer", "format": "int32" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "default_gateway": { "type": "string" }, "vlan_id": { "type": "integer", "format": "int32" }, "direction_id": { "type": "integer", "format": "int32" }, "int_address": { "type": "string" }, "cidr_address": { "type": "string" }, "zone": { "$ref": "#/definitions/Zone" }, "vlan": { "$ref": "#/definitions/Vlan" }, "direction": { "$ref": "#/definitions/Direction" }, "ip_addresses": { "type": "array", "items": { "$ref": "#/definitions/IpAddress" } }, "data_transactions": { "type": "array", "items": { "$ref": "#/definitions/DataTransaction" } }, "subnets": { "type": "array", "items": { "$ref": "#/definitions/Subnet" } }, "supernet": { "$ref": "#/definitions/Subnet" }, "devices": { "$ref": "#/definitions/Device" }, "versions": { "type": "array", "items": { "$ref": "#/definitions/Version" } } } }, "Direction": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "name": { "type": "string" }, "zone_group_id": { "type": "integer", "format": "int32" }, "notes": { "type": "string" }, "dns_suffix": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "vlans": { "type": "array", "items": { "$ref": "#/definitions/Vlan" } }, "interfaces": { "type": "array", "items": { "$ref": "#/definitions/Interface" } }, "subnets": { "type": "array", "items": { "$ref": "#/definitions/Subnet" } }, "data_transactions": { "type": "array", "items": { "$ref": "#/definitions/DataTransaction" } } } }, "Interface": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "mac_address": { "type": "string" }, "name": { "type": "string" }, "device_id": { "type": "integer", "format": "int32" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "require_ip": { "type": "boolean" }, "require_switch_port": { "type": "boolean" }, "require_default_gateway": { "type": "boolean" }, "notes": { "type": "string" }, "media": { "type": "integer", "format": "int32" }, "vlan_direction_id": { "type": "integer", "format": "int32" }, "interface_speed_id": { "type": "integer", "format": "int32" }, "vlan_id": { "type": "integer", "format": "int32" }, "subnet_id": { "type": "integer", "format": "int32" }, "direction_id": { "type": "integer", "format": "int32" }, "duplex_id": { "type": "integer", "format": "int32" }, "medium_id": { "type": "integer", "format": "int32" }, "switch_port_id": { "type": "integer", "format": "int32" }, "pci_slot": { "type": "string" }, "a_or_b": { "type": "integer", "format": "int32" }, "require_route_for_management": { "type": "boolean" }, "require_route_for_getronics": { "type": "boolean" }, "default_gateway_id": { "type": "integer", "format": "int32" }, "static_routes": { "type": "string" }, "interface_type_id": { "type": "integer", "format": "int32" }, "connector_type_id": { "type": "integer", "format": "int32" }, "mac_addr": { "type": "string" }, "device": { "$ref": "#/definitions/Device" }, "subnet": { "$ref": "#/definitions/Subnet" }, "ip_address": { "$ref": "#/definitions/IpAddress" }, "vlan": { "$ref": "#/definitions/Vlan" }, "direction": { "$ref": "#/definitions/Direction" }, "duplex": { "$ref": "#/definitions/Duplex" }, "interface_speed": { "$ref": "#/definitions/InterfaceSpeed" }, "medium": { "$ref": "#/definitions/Medium" }, "switch_port": { "$ref": "#/definitions/SwitchPort" }, "interface_type": { "$ref": "#/definitions/InterfaceType" }, "connector_type": { "$ref": "#/definitions/ConnectorType" }, "versions": { "type": "array", "items": { "$ref": "#/definitions/Version" } } } }, "IpAddress": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "network_address": { "type": "string" }, "int_address": { "type": "string" }, "description": { "type": "string" }, "interface_id": { "type": "integer", "format": "int32" }, "subnet_id": { "type": "integer", "format": "int32" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "dns_name": { "type": "string" }, "inet_address": { "type": "string" }, "ip_type": { "type": "integer", "format": "int32" }, "subnet": { "$ref": "#/definitions/Subnet" }, "interface": { "$ref": "#/definitions/Interface" }, "outgoing_load_balancer_entries": { "type": "array", "items": { "$ref": "#/definitions/LoadBalancerEntry" } }, "incoming_load_balancer_entries": { "type": "array", "items": { "$ref": "#/definitions/LoadBalancerEntry" } }, "versions": { "type": "array", "items": { "$ref": "#/definitions/Version" } } } }, "LoadBalancerEntry": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "device_id": { "type": "integer", "format": "int32" }, "virtual_ip_address_id": { "type": "integer", "format": "int32" }, "description": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "physical_ip_id": { "type": "integer", "format": "int32" }, "device": { "$ref": "#/definitions/Device" }, "virtual_ip_address": { "$ref": "#/definitions/IpAddress" }, "physical_ip": { "$ref": "#/definitions/IpAddress" } } }, "Version": { "type": "object", "properties": { "id": { "type": "string" }, "event": { "type": "string" }, "item_type": { "type": "string" }, "item_id": { "type": "string" }, "whodunnit": { "type": "string" }, "object_changes": { "type": "string" } }, "description": "Get API Version" }, "Duplex": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "name": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "switch_ports": { "type": "array", "items": { "$ref": "#/definitions/SwitchPort" } }, "interfaces": { "type": "array", "items": { "$ref": "#/definitions/Interface" } } } }, "SwitchPort": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "port_number": { "type": "integer", "format": "int32" }, "speed": { "type": "integer", "format": "int32" }, "stp": { "type": "boolean" }, "direction": { "type": "integer", "format": "int32" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "device_id": { "type": "integer", "format": "int32" }, "duplex_id": { "type": "integer", "format": "int32" }, "medium_id": { "type": "integer", "format": "int32" }, "zone_group_id": { "type": "integer", "format": "int32" }, "blade": { "type": "string" }, "switch_port_type_id": { "type": "integer", "format": "int32" }, "vlan_id": { "type": "integer", "format": "int32" }, "notes": { "type": "string" }, "cc_frame_id": { "type": "integer", "format": "int32" }, "pvlan_edge": { "type": "integer", "format": "int32" }, "in_use": { "type": "boolean" }, "ether_channel": { "type": "boolean" }, "blade_serial_number": { "type": "string" }, "trunk_id": { "type": "integer", "format": "int32" }, "stp_port_fast": { "type": "boolean" }, "vpc": { "type": "integer", "format": "int32" }, "wwn": { "type": "string" }, "connected_mac": { "type": "string" }, "connected_mac_updated_at": { "type": "string", "format": "date-time" }, "bottom_ru": { "type": "integer", "format": "int32" }, "supports_kvm": { "type": "boolean" }, "capability": { "type": "string" }, "interface_speed_id": { "type": "integer", "format": "int32" }, "port_channel": { "type": "integer", "format": "int32" }, "device": { "$ref": "#/definitions/Device" }, "duplex": { "$ref": "#/definitions/Duplex" }, "medium": { "$ref": "#/definitions/Medium" }, "switch_port_type": { "$ref": "#/definitions/SwitchPortType" }, "interface_speed": { "$ref": "#/definitions/InterfaceSpeed" }, "vlan": { "$ref": "#/definitions/Vlan" }, "interface": { "$ref": "#/definitions/Interface" }, "versions": { "type": "array", "items": { "$ref": "#/definitions/Version" } } } }, "Medium": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "name": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "switch_ports": { "type": "array", "items": { "$ref": "#/definitions/SwitchPort" } }, "interfaces": { "type": "array", "items": { "$ref": "#/definitions/Interface" } } } }, "SwitchPortType": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "name": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "switch_ports": { "type": "array", "items": { "$ref": "#/definitions/SwitchPort" } } } }, "InterfaceSpeed": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "name": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "interfaces": { "type": "array", "items": { "$ref": "#/definitions/Interface" } }, "switch_ports": { "type": "array", "items": { "$ref": "#/definitions/SwitchPort" } } } }, "InterfaceType": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "name": { "type": "string" }, "notes": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "interfaces": { "type": "array", "items": { "$ref": "#/definitions/Interface" } } } }, "ConnectorType": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "name": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "interfaces": { "type": "array", "items": { "$ref": "#/definitions/Interface" } } } }, "DataTransaction": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "transactable_type": { "type": "string" }, "transactable_id": { "type": "integer", "format": "int32" }, "data_cleanup_id": { "type": "integer", "format": "int32" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "transactions": { "type": "string" }, "data_cleanup": { "$ref": "#/definitions/DataCleanup" } } }, "DataCleanup": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "name": { "type": "string" }, "status": { "type": "integer", "format": "int32" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "data_transactions": { "type": "array", "items": { "$ref": "#/definitions/DataTransaction" } } } }, "VlanType": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "name": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "vlans": { "type": "array", "items": { "$ref": "#/definitions/Vlan" } } } }, "DeviceModel": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "name": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "vendor_name": { "type": "string" }, "manufacturer_name": { "type": "string" }, "integration_class": { "type": "string" }, "status": { "type": "integer", "format": "int32" }, "devices": { "type": "array", "items": { "$ref": "#/definitions/Device" } }, "device_types": { "type": "array", "items": { "$ref": "#/definitions/DeviceType" } }, "default_interfaces": { "type": "array", "items": { "$ref": "#/definitions/DefaultInterface" } } } }, "DeviceType": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "name": { "type": "string" }, "networkable": { "type": "boolean" }, "routable": { "type": "boolean" }, "interfaceable": { "type": "boolean" }, "switchable": { "type": "boolean" }, "has_switch_ports": { "type": "boolean" }, "rackable": { "type": "boolean" }, "virtual_client": { "type": "boolean" }, "virtual_host": { "type": "boolean" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "device_category_id": { "type": "integer", "format": "int32" }, "has_blades": { "type": "boolean" }, "is_blade": { "type": "boolean" }, "is_load_balancer": { "type": "boolean" }, "is_patch_panel": { "type": "boolean" }, "extends_switch": { "type": "boolean" }, "esmt_device_category_id": { "type": "integer", "format": "int32" }, "esmt_device_type_id": { "type": "integer", "format": "int32" }, "esmt_device_class_id": { "type": "integer", "format": "int32" }, "devices": { "type": "array", "items": { "$ref": "#/definitions/Device" } }, "device_models": { "type": "array", "items": { "$ref": "#/definitions/DeviceModel" } }, "esmt_device_class": { "$ref": "#/definitions/EsmtDeviceClass" }, "esmt_device_type": { "$ref": "#/definitions/EsmtDeviceType" }, "esmt_device_category": { "$ref": "#/definitions/EsmtDeviceCategory" }, "device_category": { "$ref": "#/definitions/DeviceCategory" } } }, "EsmtDeviceClass": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "name": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "device_types": { "type": "array", "items": { "$ref": "#/definitions/DeviceType" } } } }, "EsmtDeviceType": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "name": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "device_types": { "type": "array", "items": { "$ref": "#/definitions/DeviceType" } } } }, "EsmtDeviceCategory": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "name": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "device_categories": { "type": "array", "items": { "$ref": "#/definitions/DeviceCategory" } }, "device_types": { "type": "array", "items": { "$ref": "#/definitions/DeviceType" } } } }, "DeviceCategory": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "name": { "type": "string" }, "interfaceable": { "type": "boolean" }, "networkable": { "type": "boolean" }, "routable": { "type": "boolean" }, "switchable": { "type": "boolean" }, "has_switch_ports": { "type": "boolean" }, "rackable": { "type": "boolean" }, "virtual_host": { "type": "boolean" }, "virtual_client": { "type": "boolean" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "has_blades": { "type": "boolean" }, "is_blade": { "type": "boolean" }, "is_load_balancer": { "type": "boolean" }, "is_patch_panel": { "type": "boolean" }, "extends_switch": { "type": "boolean" }, "device_types": { "type": "array", "items": { "$ref": "#/definitions/DeviceType" } }, "esmt_device_type": { "$ref": "#/definitions/EsmtDeviceType" }, "esmt_device_category": { "$ref": "#/definitions/EsmtDeviceCategory" } } }, "DefaultInterface": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "name": { "type": "string" }, "device_model_id": { "type": "integer", "format": "int32" }, "direction": { "type": "integer", "format": "int32" }, "speed": { "type": "integer", "format": "int32" }, "require_ip": { "type": "boolean" }, "require_switch_port": { "type": "boolean" }, "require_default_gateway": { "type": "boolean" }, "interface_type": { "type": "integer", "format": "int32" }, "notes": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "device_model": { "$ref": "#/definitions/DeviceModel" } } }, "Project": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "name": { "type": "string" }, "code": { "type": "string" }, "system_id": { "type": "integer", "format": "int32" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "ciid": { "type": "string" }, "instance_id": { "type": "string" }, "reconciliation_identity": { "type": "string" }, "workbook_location": { "type": "string" }, "device_status_id": { "type": "integer", "format": "int32" }, "device_status_reason_id": { "type": "integer", "format": "int32" }, "event_logs": { "type": "array", "items": { "$ref": "#/definitions/EventLog" } }, "sync_status": { "$ref": "#/definitions/SyncStatus" }, "device_status": { "$ref": "#/definitions/DeviceStatus" }, "device_status_reason": { "$ref": "#/definitions/DeviceStatusReason" }, "devices": { "type": "array", "items": { "$ref": "#/definitions/Device" } }, "system": { "$ref": "#/definitions/System" } } }, "System": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "name": { "type": "string" }, "description": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "ciid": { "type": "string" }, "instance_id": { "type": "string" }, "reconciliation_identity": { "type": "string" }, "device_status_id": { "type": "integer", "format": "int32" }, "device_status_reason_id": { "type": "integer", "format": "int32" }, "event_logs": { "type": "array", "items": { "$ref": "#/definitions/EventLog" } }, "sync_status": { "$ref": "#/definitions/SyncStatus" }, "device_status": { "$ref": "#/definitions/DeviceStatus" }, "device_status_reason": { "$ref": "#/definitions/DeviceStatusReason" }, "projects": { "type": "array", "items": { "$ref": "#/definitions/Project" } } } }, "ApplicationEnvironment": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "name": { "type": "string" }, "ciid": { "type": "string" }, "impact_scale": { "type": "integer", "format": "int32" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "instance_id": { "type": "string" }, "reconciliation_identity": { "type": "string" }, "device_status_id": { "type": "integer", "format": "int32" }, "device_status_reason_id": { "type": "integer", "format": "int32" }, "event_logs": { "type": "array", "items": { "$ref": "#/definitions/EventLog" } }, "sync_status": { "$ref": "#/definitions/SyncStatus" }, "device_status": { "$ref": "#/definitions/DeviceStatus" }, "device_status_reason": { "$ref": "#/definitions/DeviceStatusReason" }, "devices": { "type": "array", "items": { "$ref": "#/definitions/Device" } } } }, "OperatingSystem": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "name": { "type": "string" }, "ciid": { "type": "string" }, "device_status_id": { "type": "integer", "format": "int32" }, "device_status_reason_id": { "type": "integer", "format": "int32" }, "reconciliation_identity": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "instance_id": { "type": "string" }, "event_logs": { "type": "array", "items": { "$ref": "#/definitions/EventLog" } }, "sync_status": { "$ref": "#/definitions/SyncStatus" }, "device_status": { "$ref": "#/definitions/DeviceStatus" }, "device_status_reason": { "$ref": "#/definitions/DeviceStatusReason" }, "devices": { "type": "array", "items": { "$ref": "#/definitions/Device" } } } }, "HostNameReservation": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "host_name": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "device_id": { "type": "integer", "format": "int32" }, "device": { "$ref": "#/definitions/Device" } } }, "NatEntry": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "in_ip_id": { "type": "integer", "format": "int32" }, "out_ip_id": { "type": "integer", "format": "int32" }, "device_id": { "type": "integer", "format": "int32" }, "description": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "device": { "$ref": "#/definitions/Device" }, "in_ip": { "$ref": "#/definitions/IpAddress" }, "out_ip": { "$ref": "#/definitions/IpAddress" } } }, "VmHostPool": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "ciid": { "type": "string" }, "name": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "hosts": { "type": "array", "items": { "$ref": "#/definitions/Device" } }, "clients": { "type": "array", "items": { "$ref": "#/definitions/Device" } } } }, "SubnetAssignment": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "device_id": { "type": "integer", "format": "int32" }, "subnet_id": { "type": "integer", "format": "int32" }, "assigns_vips": { "type": "boolean" }, "assigns_physical_ips": { "type": "boolean" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "device": { "$ref": "#/definitions/Device" }, "subnet": { "$ref": "#/definitions/Subnet" } } }, "NmdbQueryError": { "type": "object", "properties": { "message": { "type": "string" }, "filters": { "type": "string" }, "rels": { "type": "string" } }, "description": "GET Nmdb::Device Object." }, "postV2Devices": { "type": "object", "properties": { "body": { "type": "object", "properties": { "ciid": { "type": "string" }, "host_name": { "type": "string" }, "description": { "type": "string" }, "zone_id": { "type": "integer", "format": "int32" }, "project_id": { "type": "integer", "format": "int32" }, "device_model_id": { "type": "integer", "format": "int32" }, "rack_id": { "type": "integer", "format": "int32" }, "device_status_id": { "type": "integer", "format": "int32" }, "device_status_reason_id": { "type": "integer", "format": "int32" }, "asset_tag": { "type": "string" }, "reconciliation_identity": { "type": "string" }, "serial_number": { "type": "string" }, "application_environment_id": { "type": "integer", "format": "int32" }, "pod_id": { "type": "integer", "format": "int32" }, "vm_capacity": { "type": "integer", "format": "int32" }, "switch_domain_id": { "type": "integer", "format": "int32" }, "blade_slot": { "type": "integer", "format": "int32" }, "blade_slots_required": { "type": "integer", "format": "int32" }, "blade_chassis_id": { "type": "integer", "format": "int32" }, "virtual_host_id": { "type": "integer", "format": "int32" }, "physical_host_id": { "type": "integer", "format": "int32" }, "blade_capacity": { "type": "integer", "format": "int32" }, "device_type_id": { "type": "integer", "format": "int32" }, "ru_required": { "type": "integer", "format": "int32" }, "primary_device_id": { "type": "integer", "format": "int32" }, "instance_id": { "type": "string" }, "operating_system_id": { "type": "integer", "format": "int32" }, "workbook_version": { "type": "string" }, "virtualized_on_vm_host_pool_id": { "type": "integer", "format": "int32" }, "contained_in_vm_host_pool_id": { "type": "integer", "format": "int32" }, "a_or_b": { "type": "integer", "format": "int32" }, "bottom_ru": { "type": "integer", "format": "int32" }, "host_name_reservation_id": { "type": "integer", "format": "int32" }, "interfaces_attributes": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "mac_address": { "type": "string" }, "name": { "type": "string" }, "device_id": { "type": "integer", "format": "int32" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "require_ip": { "type": "boolean" }, "require_switch_port": { "type": "boolean" }, "require_default_gateway": { "type": "boolean" }, "notes": { "type": "string" }, "media": { "type": "integer", "format": "int32" }, "vlan_direction_id": { "type": "integer", "format": "int32" }, "interface_speed_id": { "type": "integer", "format": "int32" }, "vlan_id": { "type": "integer", "format": "int32" }, "subnet_id": { "type": "integer", "format": "int32" }, "direction_id": { "type": "integer", "format": "int32" }, "duplex_id": { "type": "integer", "format": "int32" }, "medium_id": { "type": "integer", "format": "int32" }, "switch_port_id": { "type": "integer", "format": "int32" }, "pci_slot": { "type": "string" }, "a_or_b": { "type": "integer", "format": "int32" }, "require_route_for_management": { "type": "boolean" }, "require_route_for_getronics": { "type": "boolean" }, "default_gateway_id": { "type": "integer", "format": "int32" }, "static_routes": { "type": "string" }, "interface_type_id": { "type": "integer", "format": "int32" }, "connector_type_id": { "type": "integer", "format": "int32" }, "mac_addr": { "type": "string" }, "ip_address_id": { "type": "integer", "format": "int32" }, "_destroy": { "type": "boolean" } } } }, "switch_ports_attributes": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "port_number": { "type": "integer", "format": "int32" }, "speed": { "type": "integer", "format": "int32" }, "stp": { "type": "boolean" }, "direction": { "type": "integer", "format": "int32" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "device_id": { "type": "integer", "format": "int32" }, "duplex_id": { "type": "integer", "format": "int32" }, "medium_id": { "type": "integer", "format": "int32" }, "zone_group_id": { "type": "integer", "format": "int32" }, "blade": { "type": "string" }, "switch_port_type_id": { "type": "integer", "format": "int32" }, "vlan_id": { "type": "integer", "format": "int32" }, "notes": { "type": "string" }, "cc_frame_id": { "type": "integer", "format": "int32" }, "pvlan_edge": { "type": "integer", "format": "int32" }, "in_use": { "type": "boolean" }, "ether_channel": { "type": "boolean" }, "blade_serial_number": { "type": "string" }, "trunk_id": { "type": "integer", "format": "int32" }, "stp_port_fast": { "type": "boolean" }, "vpc": { "type": "integer", "format": "int32" }, "wwn": { "type": "string" }, "connected_mac": { "type": "string" }, "connected_mac_updated_at": { "type": "string", "format": "date-time" }, "bottom_ru": { "type": "integer", "format": "int32" }, "supports_kvm": { "type": "boolean" }, "capability": { "type": "string" }, "interface_speed_id": { "type": "integer", "format": "int32" }, "port_channel": { "type": "integer", "format": "int32" }, "_destroy": { "type": "boolean" } } } }, "nat_entries_attributes": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "in_ip_id": { "type": "integer", "format": "int32" }, "out_ip_id": { "type": "integer", "format": "int32" }, "device_id": { "type": "integer", "format": "int32" }, "description": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "_destroy": { "type": "boolean" } } } }, "load_balancer_entries_attributes": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "device_id": { "type": "integer", "format": "int32" }, "virtual_ip_address_id": { "type": "integer", "format": "int32" }, "description": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "physical_ip_id": { "type": "integer", "format": "int32" }, "_destroy": { "type": "boolean" } } } }, "subnet_assignments_attributes": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "device_id": { "type": "integer", "format": "int32" }, "subnet_id": { "type": "integer", "format": "int32" }, "assigns_vips": { "type": "boolean" }, "assigns_physical_ips": { "type": "boolean" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "_destroy": { "type": "boolean" } } } } } } }, "required": [ "body" ], "description": "Create Nmdb::Device Object." }, "putV2Devices": { "type": "object", "properties": { "body": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "ciid": { "type": "string" }, "host_name": { "type": "string" }, "description": { "type": "string" }, "zone_id": { "type": "integer", "format": "int32" }, "project_id": { "type": "integer", "format": "int32" }, "device_model_id": { "type": "integer", "format": "int32" }, "rack_id": { "type": "integer", "format": "int32" }, "device_status_id": { "type": "integer", "format": "int32" }, "device_status_reason_id": { "type": "integer", "format": "int32" }, "asset_tag": { "type": "string" }, "reconciliation_identity": { "type": "string" }, "serial_number": { "type": "string" }, "application_environment_id": { "type": "integer", "format": "int32" }, "pod_id": { "type": "integer", "format": "int32" }, "vm_capacity": { "type": "integer", "format": "int32" }, "switch_domain_id": { "type": "integer", "format": "int32" }, "blade_slot": { "type": "integer", "format": "int32" }, "blade_slots_required": { "type": "integer", "format": "int32" }, "blade_chassis_id": { "type": "integer", "format": "int32" }, "virtual_host_id": { "type": "integer", "format": "int32" }, "physical_host_id": { "type": "integer", "format": "int32" }, "blade_capacity": { "type": "integer", "format": "int32" }, "device_type_id": { "type": "integer", "format": "int32" }, "ru_required": { "type": "integer", "format": "int32" }, "primary_device_id": { "type": "integer", "format": "int32" }, "instance_id": { "type": "string" }, "operating_system_id": { "type": "integer", "format": "int32" }, "workbook_version": { "type": "string" }, "virtualized_on_vm_host_pool_id": { "type": "integer", "format": "int32" }, "contained_in_vm_host_pool_id": { "type": "integer", "format": "int32" }, "a_or_b": { "type": "integer", "format": "int32" }, "bottom_ru": { "type": "integer", "format": "int32" }, "interfaces_attributes": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "mac_address": { "type": "string" }, "name": { "type": "string" }, "device_id": { "type": "integer", "format": "int32" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "require_ip": { "type": "boolean" }, "require_switch_port": { "type": "boolean" }, "require_default_gateway": { "type": "boolean" }, "notes": { "type": "string" }, "media": { "type": "integer", "format": "int32" }, "vlan_direction_id": { "type": "integer", "format": "int32" }, "interface_speed_id": { "type": "integer", "format": "int32" }, "vlan_id": { "type": "integer", "format": "int32" }, "subnet_id": { "type": "integer", "format": "int32" }, "direction_id": { "type": "integer", "format": "int32" }, "duplex_id": { "type": "integer", "format": "int32" }, "medium_id": { "type": "integer", "format": "int32" }, "switch_port_id": { "type": "integer", "format": "int32" }, "pci_slot": { "type": "string" }, "a_or_b": { "type": "integer", "format": "int32" }, "require_route_for_management": { "type": "boolean" }, "require_route_for_getronics": { "type": "boolean" }, "default_gateway_id": { "type": "integer", "format": "int32" }, "static_routes": { "type": "string" }, "interface_type_id": { "type": "integer", "format": "int32" }, "connector_type_id": { "type": "integer", "format": "int32" }, "mac_addr": { "type": "string" }, "ip_address_id": { "type": "integer", "format": "int32" }, "_destroy": { "type": "boolean" } } } }, "switch_ports_attributes": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "port_number": { "type": "integer", "format": "int32" }, "speed": { "type": "integer", "format": "int32" }, "stp": { "type": "boolean" }, "direction": { "type": "integer", "format": "int32" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "device_id": { "type": "integer", "format": "int32" }, "duplex_id": { "type": "integer", "format": "int32" }, "medium_id": { "type": "integer", "format": "int32" }, "zone_group_id": { "type": "integer", "format": "int32" }, "blade": { "type": "string" }, "switch_port_type_id": { "type": "integer", "format": "int32" }, "vlan_id": { "type": "integer", "format": "int32" }, "notes": { "type": "string" }, "cc_frame_id": { "type": "integer", "format": "int32" }, "pvlan_edge": { "type": "integer", "format": "int32" }, "in_use": { "type": "boolean" }, "ether_channel": { "type": "boolean" }, "blade_serial_number": { "type": "string" }, "trunk_id": { "type": "integer", "format": "int32" }, "stp_port_fast": { "type": "boolean" }, "vpc": { "type": "integer", "format": "int32" }, "wwn": { "type": "string" }, "connected_mac": { "type": "string" }, "connected_mac_updated_at": { "type": "string", "format": "date-time" }, "bottom_ru": { "type": "integer", "format": "int32" }, "supports_kvm": { "type": "boolean" }, "capability": { "type": "string" }, "interface_speed_id": { "type": "integer", "format": "int32" }, "port_channel": { "type": "integer", "format": "int32" }, "_destroy": { "type": "boolean" } } } }, "nat_entries_attributes": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "in_ip_id": { "type": "integer", "format": "int32" }, "out_ip_id": { "type": "integer", "format": "int32" }, "device_id": { "type": "integer", "format": "int32" }, "description": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "_destroy": { "type": "boolean" } } } }, "load_balancer_entries_attributes": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "device_id": { "type": "integer", "format": "int32" }, "virtual_ip_address_id": { "type": "integer", "format": "int32" }, "description": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "physical_ip_id": { "type": "integer", "format": "int32" }, "_destroy": { "type": "boolean" } } } }, "subnet_assignments_attributes": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer", "format": "int32" }, "device_id": { "type": "integer", "format": "int32" }, "subnet_id": { "type": "integer", "format": "int32" }, "assigns_vips": { "type": "boolean" }, "assigns_physical_ips": { "type": "boolean" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "_destroy": { "type": "boolean" } } } } } } }, "required": [ "body" ], "description": "Update Nmdb::Device Object." } } } spec-0.21.0/fixtures/bugs/schema-148.json000066400000000000000000000002531457312531500200100ustar00rootroot00000000000000{ "definitions": { "empty": { "additionalProperties": {} }, "false": { "additionalProperties": false } } } spec-0.21.0/fixtures/expansion/000077500000000000000000000000001457312531500164075ustar00rootroot00000000000000spec-0.21.0/fixtures/expansion/all-the-things.json000066400000000000000000000131171457312531500221250ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore", "description": "A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification", "termsOfService": "http://helloreverb.com/terms/", "contact": { "name": "Wordnik API Team" }, "license": { "name": "MIT" } }, "host": "petstore.swagger.wordnik.com", "basePath": "/api", "schemes": [ "http" ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": { "idParam": { "name": "id", "in": "path", "description": "ID of pet to fetch", "required": true, "type": "integer", "format": "int64" }, "tag": { "type": "string", "in": "query", "required": false }, "query": { "$ref": "#/parameters/tag" } }, "responses": { "petResponse": { "description": "pet response", "schema": { "$ref": "#/definitions/pet" } }, "stringResponse": { "descripion": "string response", "schema": { "type": "string" } }, "anotherPet": { "$ref": "#/responses/petResponse" } }, "paths": { "/": { "get": { "operationId": "indexStuff", "responses": { "default": { "$ref": "#/responses/stringResponse" }, "200": { "$ref": "#/responses/anotherPet" } } } }, "/pets": { "get": { "description": "Returns all pets from the system that the user has access to", "operationId": "findPets", "produces": [ "application/json", "application/xml", "text/xml", "text/html" ], "parameters": [ { "name": "tags", "in": "query", "description": "tags to filter by", "required": false, "type": "array", "items": { "type": "string" }, "collectionFormat": "csv" }, { "name": "limit", "in": "query", "description": "maximum number of results to return", "required": false, "type": "integer", "format": "int32" } ], "responses": { "200": { "description": "pet response", "schema": { "type": "array", "items": { "$ref": "#/definitions/pet" } } }, "default": { "description": "unexpected error", "schema": { "$ref": "#/definitions/errorModel" } } } }, "post": { "description": "Creates a new pet in the store. Duplicates are allowed", "operationId": "addPet", "produces": [ "application/json" ], "parameters": [ { "name": "pet", "in": "body", "description": "Pet to add to the store", "required": true, "schema": { "$ref": "#/definitions/petInput" } } ], "responses": { "200": { "$ref": "#/responses/petResponse" }, "default": { "description": "unexpected error", "schema": { "$ref": "#/definitions/errorModel" } } } } }, "/pets/{id}": { "get": { "description": "Returns a user based on a single ID, if the user does not have access to the pet", "operationId": "findPetById", "produces": [ "application/json", "application/xml", "text/xml", "text/html" ], "parameters": [ { "$ref": "#/parameters/idParam" } ], "responses": { "200": { "$ref": "#/responses/petResponse" }, "default": { "description": "unexpected error", "schema": { "$ref": "#/definitions/errorModel" } } } }, "delete": { "description": "deletes a single pet based on the ID supplied", "operationId": "deletePet", "parameters": [ { "$ref": "#/parameters/idParam" } ], "responses": { "204": { "description": "pet deleted" }, "default": { "description": "unexpected error", "schema": { "$ref": "#/definitions/errorModel" } } } } } }, "definitions": { "pet": { "required": [ "id", "name" ], "properties": { "id": { "type": "integer", "format": "int64" }, "name": { "type": "string" }, "tag": { "type": "string" } } }, "petInput": { "allOf": [ { "$ref": "#/definitions/pet" }, { "required": [ "name" ], "properties": { "id": { "type": "integer", "format": "int64" } } } ] }, "errorModel": { "required": [ "code", "message" ], "properties": { "code": { "type": "integer", "format": "int32" }, "message": { "type": "string" } } } } }spec-0.21.0/fixtures/expansion/circular-minimal.json000066400000000000000000000017311457312531500225340ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "version": "0.0.1" }, "basePath": "/", "paths": { "/cycles": { "get": { "responses": { "200": { "description": "ok", "schema": { "$ref": "#/definitions/node0" } } } } } }, "definitions": { "node0": { "type": "object", "properties": { "p00": { "$ref": "#/definitions/node1" }, "p01": { "$ref": "#/definitions/node3" } } }, "node1": { "type": "object", "properties": { "p1": { "$ref": "#/definitions/node2" } } }, "node2": { "type": "object", "properties": { "p2": { "$ref": "#/definitions/node0" } } }, "node3": { "type": "object", "properties": { "p3": { "$ref": "#/definitions/node1" } } } } } spec-0.21.0/fixtures/expansion/circularRefs.json000066400000000000000000000020051457312531500217230ustar00rootroot00000000000000{ "definitions": { "brand": { "type": "object", "properties": { "name": { "type": "string" } } }, "category": { "type": "object", "properties": { "children": { "type": "array", "items": { "$ref": "#/definitions/category" } } } }, "car": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64" }, "make": { "type": "string" }, "similar": { "items": { "$ref": "#/definitions/car" } }, "notSimilar": { "additionalProperties": { "$ref": "#/definitions/car" } }, "oneCar": { "$ref": "#/definitions/car" }, "category": { "$ref": "#/definitions/category" }, "brand": { "$ref": "#/definitions/brand" } } } } } spec-0.21.0/fixtures/expansion/circularSpec.json000066400000000000000000000020351457312531500217210ustar00rootroot00000000000000{"swagger":"2.0","info":{"title":"Swagger Sample","description":"Sample API Playground.","version":"1.0.0"},"basePath":"/v1","schemes":["http"],"consumes":["application/vdn.sample.v1+json"],"produces":["application/vdn.sample.v1+json"],"paths":{"/books":{"get":{"summary":"List all books","operationId":"listBooks","tags":["books"],"responses":{"200":{"headers":{"Link":{"type":"string"}},"description":"An array of books","schema":{"type":"array","items":{"$ref":"#/definitions/Book"}}},"default":{"description":"generic error response","schema":{"$ref":"#/definitions/Error"}}}}}},"definitions":{"Book":{"type":"object","required":["title","summary"],"properties":{"title":{"type":"string","example":"Winnie the Pooh"},"summary":{"type":"string","example":"Famous children's book"},"related_books":{"type":"array","items":{"$ref":"#/definitions/Book"}}}},"Error":{"type":"object","readOnly":true,"properties":{"code":{"type":"integer","format":"int64","example":400},"message":{"type":"string","example":"Unexpected error"}},"required":["message"]}}} spec-0.21.0/fixtures/expansion/circularSpec.yaml000066400000000000000000000023621457312531500217150ustar00rootroot00000000000000--- swagger: "2.0" info: title: Swagger Sample description: Sample API Playground. version: 1.0.0 basePath: /v1 schemes: - http consumes: - application/vdn.sample.v1+json produces: - application/vdn.sample.v1+json paths: /books: get: summary: List all books operationId: listBooks tags: - books responses: 200: headers: Link: type: string description: An array of books schema: type: array items: $ref: "#/definitions/Book" default: description: generic error response schema: $ref: "#/definitions/Error" definitions: Book: type: object required: - title - summary properties: title: type: string example: Winnie the Pooh summary: type: string example: Famous children's book related_books: type: array items: $ref: "#/definitions/Book" Error: type: object readOnly: true properties: code: type: integer format: int64 example: 400 message: type: string example: Unexpected error required: - message spec-0.21.0/fixtures/expansion/circularSpec2.json000066400000000000000000000162271457312531500220130ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "title": "swagger.yaml for investigating an issue with spec.expandSchema", "version": "0.0.1", "description": "expander.go test for issue analysis, the spec derived from ODataWebV3.Northwind.Model and simplified for the analysis" }, "schemes": [ "http" ], "host": "localhost", "basePath": "/modified_from_Northwind.svc", "consumes": [ "application/json" ], "produces": [ "application/json" ], "paths": { "/Employees": { "get": { "summary": "Get entities from Employees", "responses": { "200": { "description": "Retrieved entities", "schema": { "title": "Collection of Employee", "type": "object", "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/Employee" } } } } }, "default": { "$ref": "#/responses/error" } } } } }, "definitions": { "Category": { "type": "object", "properties": { "CategoryID": { "type": "integer", "format": "int32" }, "CategoryName": { "type": "string", "maxLength": 15 }, "Products": { "type": "array", "items": { "$ref": "#/definitions/Product" } } }, "title": "Category" }, "CustomerDemographic": { "type": "object", "properties": { "CustomerTypeID": { "type": "string", "maxLength": 10 }, "CustomerDesc": { "type": "string", "example": "string" }, "Customers": { "type": "array", "items": { "$ref": "#/definitions/Customer" } } }, "title": "CustomerDemographic" }, "Customer": { "type": "object", "properties": { "CustomerID": { "type": "string", "maxLength": 5 }, "CompanyName": { "type": "string", "maxLength": 40 }, "Orders": { "type": "array", "items": { "$ref": "#/definitions/Order" } }, "CustomerDemographics": { "type": "array", "items": { "$ref": "#/definitions/CustomerDemographic" } } }, "title": "Customer" }, "Employee": { "type": "object", "properties": { "EmployeeID": { "type": "integer", "format": "int32" }, "LastName": { "type": "string", "maxLength": 20 }, "FirstName": { "type": "string", "maxLength": 10 }, "Employees1": { "type": "array", "items": { "$ref": "#/definitions/Employee" } }, "Employee1": { "$ref": "#/definitions/Employee" }, "Orders": { "type": "array", "items": { "$ref": "#/definitions/Order" } }, "Territories": { "type": "array", "items": { "$ref": "#/definitions/Territory" } } }, "title": "Employee" }, "Order_Detail": { "type": "object", "properties": { "OrderID": { "type": "integer", "format": "int32" }, "ProductID": { "type": "integer", "format": "int32" }, "UnitPrice": { "type": "number", "format": "decimal", "multipleOf": 0.0001 }, "Quantity": { "type": "integer", "format": "int16" }, "Order": { "$ref": "#/definitions/Order" }, "Product": { "$ref": "#/definitions/Product" } }, "title": "Order_Detail" }, "Order": { "type": "object", "properties": { "OrderID": { "type": "integer", "format": "int32" }, "CustomerID": { "type": "string", "maxLength": 5, "example": "string" }, "Customer": { "$ref": "#/definitions/Customer" }, "Employee": { "$ref": "#/definitions/Employee" }, "Order_Details": { "type": "array", "items": { "$ref": "#/definitions/Order_Detail" } }, "Shipper": { "$ref": "#/definitions/Shipper" } }, "title": "Order" }, "Product": { "type": "object", "properties": { "ProductID": { "type": "integer", "format": "int32" }, "ProductName": { "type": "string", "maxLength": 40 }, "Category": { "$ref": "#/definitions/Category" }, "Order_Details": { "type": "array", "items": { "$ref": "#/definitions/Order_Detail" } }, "Supplier": { "$ref": "#/definitions/Supplier" } }, "title": "Product" }, "Region": { "type": "object", "properties": { "RegionID": { "type": "integer", "format": "int32" }, "RegionDescription": { "type": "string", "maxLength": 50 }, "Territories": { "type": "array", "items": { "$ref": "#/definitions/Territory" } } }, "title": "Region" }, "Shipper": { "type": "object", "properties": { "ShipperID": { "type": "integer", "format": "int32" }, "CompanyName": { "type": "string", "maxLength": 40 }, "Orders": { "type": "array", "items": { "$ref": "#/definitions/Order" } } }, "title": "Shipper" }, "Supplier": { "type": "object", "properties": { "SupplierID": { "type": "integer", "format": "int32" }, "CompanyName": { "type": "string", "maxLength": 40 }, "Products": { "type": "array", "items": { "$ref": "#/definitions/Product" } } }, "title": "Supplier" }, "Territory": { "type": "object", "properties": { "TerritoryID": { "type": "string", "maxLength": 20 }, "TerritoryDescription": { "type": "string", "maxLength": 50 }, "RegionID": { "type": "integer", "format": "int32" }, "Region": { "$ref": "#/definitions/Region" }, "Employees": { "type": "array", "items": { "$ref": "#/definitions/Employee" } } }, "title": "Territory" } }, "responses": { "error": { "description": "Error" } } } spec-0.21.0/fixtures/expansion/clickmeter.json000066400000000000000000004032511457312531500214310ustar00rootroot00000000000000{"swagger":"2.0","schemes":["http","https"],"host":"apiv2.clickmeter.com:80","info":{"contact":{"email":"api@clickmeter.com","name":"Api Support","url":"http://www.clickmeter.com/api"},"description":"Api dashboard for ClickMeter API","title":"ClickMeter","version":"v2","x-logo":{"url":"https://s3.amazonaws.com/clickmeter.com/Web/static/cmlogo.svg"},"x-origin":{"format":"swagger","url":"http://api.v2.clickmeter.com.s3.amazonaws.com/docs/api-docs-v2.json","version":"2.0"},"x-providerName":"clickmeter.com"},"securityDefinitions":{"api_key":{"description":"API Key Authentication","in":"header","name":"X-Clickmeter-AuthKey","type":"apiKey"}},"security":[{"api_key":[]}],"paths":{"/account":{"get":{"consumes":[],"deprecated":false,"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.Accounting.User"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve current account data","tags":["Account"]},"post":{"consumes":["application/json","text/json","application/xml","text/xml","application/x-www-form-urlencoded"],"deprecated":false,"parameters":[{"in":"body","name":"value","required":true,"schema":{"$ref":"#/definitions/Api.Core.Dto.Accounting.User"}}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.Accounting.User"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Update current account data","tags":["Account"]}},"/account/domainwhitelist":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Offset where to start from","format":"int32","in":"query","minLength":0,"name":"offset","required":false,"type":"integer"},{"description":"Limit results to this number","format":"int32","in":"query","maxLength":0,"minLength":0,"name":"limit","required":false,"type":"integer"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Dto.Accounting.DomainWhitelistEntry]"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve list of a domains allowed to redirect in DDU mode","tags":["Account"]},"post":{"consumes":["application/json","text/json","application/xml","text/xml","application/x-www-form-urlencoded"],"deprecated":false,"parameters":[{"description":"The entry to add","in":"body","name":"value","required":true,"schema":{"$ref":"#/definitions/Api.Core.Dto.Accounting.DomainWhitelistEntry"}}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.Accounting.DomainWhitelistEntry"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Create an domain entry","tags":["Account"]}},"/account/domainwhitelist/{whitelistId}":{"delete":{"consumes":[],"deprecated":false,"parameters":[{"description":"The id of the domain to delete","in":"path","name":"whitelistId","required":true,"type":"string"}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.Accounting.DomainWhitelistEntry"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Delete an domain entry","tags":["Account"]}},"/account/guests":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Offset where to start from","format":"int32","in":"query","minLength":0,"name":"offset","required":false,"type":"integer"},{"description":"Limit results to this number","format":"int32","in":"query","maxLength":0,"minLength":0,"name":"limit","required":false,"type":"integer"},{"description":"Field to sort by","in":"query","name":"sortBy","required":false,"type":"string"},{"description":"Direction of sort \"asc\" or \"desc\"","enum":["asc","desc"],"in":"query","name":"sortDirection","required":false,"type":"string"},{"description":"Filter fields by this pattern","in":"query","name":"textSearch","required":false,"type":"string"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Responses.EntityUri[System.Int64]]"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve list of a guest","tags":["Account"]},"post":{"consumes":["application/json","text/json","application/xml","text/xml","application/x-www-form-urlencoded"],"deprecated":false,"parameters":[{"description":"Guest object to create","in":"body","name":"value","required":true,"schema":{"$ref":"#/definitions/Api.Core.Dto.Accounting.Guest"}}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.Accounting.Guest"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Create a guest","tags":["Account"]}},"/account/guests/count":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Filter fields by this pattern","in":"query","name":"textSearch","required":false,"type":"string"}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.CountResponce"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve count of guests","tags":["Account"]}},"/account/guests/{guestId}":{"delete":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of the guest","format":"int64","in":"path","name":"guestId","required":true,"type":"integer"}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntityUri[System.Int64]"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Delete a guest","tags":["Account"]},"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of the guest","format":"int64","in":"path","name":"guestId","required":true,"type":"integer"}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.Accounting.Guest"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve a guest","tags":["Account"]},"post":{"consumes":["application/json","text/json","application/xml","text/xml","application/x-www-form-urlencoded"],"deprecated":false,"parameters":[{"description":"Id of the guest","format":"int64","in":"path","name":"guestId","required":true,"type":"integer"},{"description":"Guest object with field updated","in":"body","name":"value","required":true,"schema":{"$ref":"#/definitions/Api.Core.Dto.Accounting.Guest"}}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.Accounting.Guest"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Update a guest","tags":["Account"]}},"/account/guests/{guestId}/permissions":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of the guest","format":"int64","in":"path","name":"guestId","required":true,"type":"integer"},{"description":"Can be \"datapoint\" or \"group\"","enum":["datapoint","group"],"in":"query","name":"entityType","required":false,"type":"string"},{"description":"Offset where to start from","format":"int32","in":"query","minLength":0,"name":"offset","required":false,"type":"integer"},{"description":"Limit results to this number","format":"int32","in":"query","maxLength":0,"minLength":0,"name":"limit","required":false,"type":"integer"},{"description":"Can be \"w\" or \"r\"","enum":["r","w"],"in":"query","name":"type","required":false,"type":"string"},{"description":"Optional id of the datapoint/group entity to filter by","format":"int64","in":"query","name":"entityId","required":false,"type":"integer"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Dto.Grants.Grant]"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve permissions for a guest","tags":["Account"]}},"/account/guests/{guestId}/permissions/count":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of the guest","format":"int64","in":"path","name":"guestId","required":true,"type":"integer"},{"description":"Can be \"datapoint\" or \"group\"","enum":["datapoint","group"],"in":"query","name":"entityType","required":false,"type":"string"},{"description":"Can be \"w\" or \"r\"","enum":["r","w"],"in":"query","name":"type","required":false,"type":"string"},{"description":"Optional id of the datapoint/group entity to filter by","format":"int64","in":"query","name":"entityId","required":false,"type":"integer"}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.CountResponce"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve count of the permissions for a guest","tags":["Account"]}},"/account/guests/{guestId}/{type}/permissions/patch":{"post":{"consumes":["application/json","text/json","application/xml","text/xml","application/x-www-form-urlencoded"],"deprecated":false,"parameters":[{"description":"Id of the guest","format":"int64","in":"path","name":"guestId","required":true,"type":"integer"},{"description":"Can be \"datapoint\" or \"group\"","enum":["datapoint","group"],"in":"path","name":"type","required":true,"type":"string"},{"description":"The patch permission request","in":"body","name":"body","required":true,"schema":{"$ref":"#/definitions/Api.Core.Requests.PermissionPatchRequest"}}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntityUri[System.Int64]"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Change the permission on a shared object","tags":["Account"]},"put":{"consumes":["application/json","text/json","application/xml","text/xml","application/x-www-form-urlencoded"],"deprecated":false,"parameters":[{"description":"Id of the guest","format":"int64","in":"path","name":"guestId","required":true,"type":"integer"},{"description":"Can be \"datapoint\" or \"group\"","enum":["datapoint","group"],"in":"path","name":"type","required":true,"type":"string"},{"description":"The patch permission request","in":"body","name":"body","required":true,"schema":{"$ref":"#/definitions/Api.Core.Requests.PermissionPatchRequest"}}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntityUri[System.Int64]"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Change the permission on a shared object","tags":["Account"]}},"/account/ipblacklist":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Offset where to start from","format":"int32","in":"query","minLength":0,"name":"offset","required":false,"type":"integer"},{"description":"Limit results to this number","format":"int32","in":"query","maxLength":0,"minLength":0,"name":"limit","required":false,"type":"integer"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Dto.Accounting.IpBlacklistEntry]"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve list of a ip to exclude from event tracking","tags":["Account"]},"post":{"consumes":["application/json","text/json","application/xml","text/xml","application/x-www-form-urlencoded"],"deprecated":false,"parameters":[{"description":"The entry to add","in":"body","name":"value","required":true,"schema":{"$ref":"#/definitions/Api.Core.Dto.Accounting.IpBlacklistEntry"}}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.Accounting.IpBlacklistEntry"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Create an ip blacklist entry","tags":["Account"]}},"/account/ipblacklist/{blacklistId}":{"delete":{"consumes":[],"deprecated":false,"parameters":[{"description":"The id of the ip to delete","in":"path","name":"blacklistId","required":true,"type":"string"}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.Accounting.IpBlacklistEntry"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Delete an ip blacklist entry","tags":["Account"]}},"/account/plan":{"get":{"consumes":[],"deprecated":false,"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.Accounting.Plan"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve current account plan","tags":["Account"]}},"/aggregated":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Timeframe of the request. See list at $timeframeList","enum":["today","yesterday","last7","last30","lastmonth","currentmonth","previousmonth","last90","last120","last180","last12months","lastyear","currentyear","beginning","custom"],"in":"query","name":"timeFrame","required":true,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the starting day (YYYYMMDD)","in":"query","name":"fromDay","required":false,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the ending day (YYYYMMDD)","in":"query","name":"toDay","required":false,"type":"string"},{"description":"If using \"yesterday\" or \"today\" timeframe you can ask for the hourly detail","in":"query","name":"hourly","required":false,"type":"boolean"},{"description":"","in":"query","name":"onlyFavorites","required":false,"type":"string"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.Aggregated.AggregatedResult"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve statistics about this customer for a timeframe","tags":["Aggregated"]}},"/aggregated/list":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Timeframe of the request. See list at $timeframeList","enum":["today","yesterday","last7","last30","lastmonth","currentmonth","previousmonth","last90","last120","last180","last12months","lastyear","currentyear","beginning","custom"],"in":"query","name":"timeFrame","required":true,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the starting day (YYYYMMDD)","in":"query","name":"fromDay","required":false,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the ending day (YYYYMMDD)","in":"query","name":"toDay","required":false,"type":"string"},{"description":"The temporal entity you want to group by (\"week\"/\"month\"). If unspecified is \"day\".","enum":["week","month"],"in":"query","name":"groupBy","required":false,"type":"string"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Dto.Aggregated.AggregatedResult]"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve statistics about this customer for a timeframe grouped by some temporal entity (day/week/month)","tags":["Aggregated"]}},"/aggregated/summary/conversions":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Timeframe of the request. See list at $timeframeList","enum":["today","yesterday","last7","last30","lastmonth","currentmonth","previousmonth","last90","last120","last180","last12months","lastyear","currentyear","beginning","custom"],"in":"query","name":"timeFrame","required":true,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the starting day (YYYYMMDD)","in":"query","name":"fromDay","required":false,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the ending day (YYYYMMDD)","in":"query","name":"toDay","required":false,"type":"string"},{"description":"Status of conversion (\"deleted\"/\"active\")","enum":["deleted","active"],"in":"query","name":"status","required":false,"type":"string"},{"description":"Field to sort by","in":"query","name":"sortBy","required":false,"type":"string"},{"description":"Direction of sort \"asc\" or \"desc\"","enum":["asc","desc"],"in":"query","name":"sortDirection","required":false,"type":"string"},{"description":"Offset where to start from","format":"int32","in":"query","minLength":0,"name":"offset","required":false,"type":"integer"},{"description":"Limit results to this number","format":"int32","in":"query","maxLength":0,"minLength":0,"name":"limit","required":false,"type":"integer"},{"description":"Filter fields by this pattern","in":"query","name":"textSearch","required":false,"type":"string"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.Aggregated.AggregatedSummaryResult"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve statistics about a subset of conversions for a timeframe with conversions data","tags":["Aggregated"]}},"/aggregated/summary/datapoints":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Timeframe of the request. See list at $timeframeList","enum":["today","yesterday","last7","last30","lastmonth","currentmonth","previousmonth","last90","last120","last180","last12months","lastyear","currentyear","beginning","custom"],"in":"query","name":"timeFrame","required":true,"type":"string"},{"description":"Type of datapoint (\"tl\"/\"tp\")","enum":["tp","tl"],"in":"query","name":"type","required":true,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the starting day (YYYYMMDD)","in":"query","name":"fromDay","required":false,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the ending day (YYYYMMDD)","in":"query","name":"toDay","required":false,"type":"string"},{"description":"Status of datapoint (\"deleted\"/\"active\"/\"paused\"/\"spam\")","enum":["deleted","active","paused","spam"],"in":"query","name":"status","required":false,"type":"string"},{"description":"A comma separated list of tags you want to filter with.","in":"query","name":"tag","required":false,"type":"string"},{"description":"Is the datapoint marked as favourite","in":"query","name":"favourite","required":false,"type":"boolean"},{"description":"Field to sort by","in":"query","name":"sortBy","required":false,"type":"string"},{"description":"Direction of sort \"asc\" or \"desc\"","enum":["asc","desc"],"in":"query","name":"sortDirection","required":false,"type":"string"},{"description":"Offset where to start from","format":"int32","in":"query","minLength":0,"name":"offset","required":false,"type":"integer"},{"description":"Limit results to this number","format":"int32","in":"query","maxLength":0,"minLength":0,"name":"limit","required":false,"type":"integer"},{"description":"Filter by this group id","format":"int64","in":"query","name":"groupId","required":false,"type":"integer"},{"description":"Filter fields by this pattern","in":"query","name":"textSearch","required":false,"type":"string"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.Aggregated.AggregatedSummaryResult"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve statistics about a subset of datapoints for a timeframe with datapoints data","tags":["Aggregated"]}},"/aggregated/summary/groups":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Timeframe of the request. See list at $timeframeList","enum":["today","yesterday","last7","last30","lastmonth","currentmonth","previousmonth","last90","last120","last180","last12months","lastyear","currentyear","beginning","custom"],"in":"query","name":"timeFrame","required":true,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the starting day (YYYYMMDD)","in":"query","name":"fromDay","required":false,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the ending day (YYYYMMDD)","in":"query","name":"toDay","required":false,"type":"string"},{"description":"Status of group (\"deleted\"/\"active\")","enum":["deleted","active"],"in":"query","name":"status","required":false,"type":"string"},{"description":"A comma separated list of tags you want to filter with.","in":"query","name":"tag","required":false,"type":"string"},{"description":"Is the group marked as favourite","in":"query","name":"favourite","required":false,"type":"boolean"},{"description":"Field to sort by","in":"query","name":"sortBy","required":false,"type":"string"},{"description":"Direction of sort \"asc\" or \"desc\"","enum":["asc","desc"],"in":"query","name":"sortDirection","required":false,"type":"string"},{"description":"Offset where to start from","format":"int32","in":"query","minLength":0,"name":"offset","required":false,"type":"integer"},{"description":"Limit results to this number","format":"int32","in":"query","maxLength":0,"minLength":0,"name":"limit","required":false,"type":"integer"},{"description":"Filter fields by this pattern","in":"query","name":"textSearch","required":false,"type":"string"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.Aggregated.AggregatedSummaryResult"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve statistics about a subset of groups for a timeframe with groups data","tags":["Aggregated"]}},"/clickstream":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Filter by this group id (mutually exclusive with \"datapoint\" and \"conversion\")","format":"int64","in":"query","name":"group","required":false,"type":"integer"},{"description":"Filter by this datapoint id (mutually exclusive with \"group\" and \"conversion\")","format":"int64","in":"query","name":"datapoint","required":false,"type":"integer"},{"description":"Filter by this conversion id (mutually exclusive with \"datapoint\" and \"group\")","format":"int64","in":"query","name":"conversion","required":false,"type":"integer"},{"default":50,"description":"Limit results to this number","format":"int32","in":"query","name":"pageSize","required":false,"type":"integer"},{"description":"Filter event type (\"spiders\"/\"uniques\"/\"nonuniques\"/\"conversions\")","enum":["","spiders","uniques","nonuniques","conversions"],"in":"query","name":"filter","required":false,"type":"string"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Dto.ClickStream.Hit]"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve the latest list of events of this account. Limited to last 100.","tags":["ClickStream"]}},"/conversions":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Offset where to start from","format":"int32","in":"query","minLength":0,"name":"offset","required":false,"type":"integer"},{"description":"Limit results to this number","format":"int32","in":"query","maxLength":0,"minLength":0,"name":"limit","required":false,"type":"integer"},{"description":"Status of conversion (\"deleted\"/\"active\")","enum":["deleted","active"],"in":"query","name":"status","required":false,"type":"string"},{"description":"Filter fields by this pattern","in":"query","name":"textSearch","required":false,"type":"string"},{"description":"Exclude conversions created before this date (YYYYMMDD)","in":"query","name":"createdAfter","required":false,"type":"string"},{"description":"Exclude conversions created after this date (YYYYMMDD)","in":"query","name":"createdBefore","required":false,"type":"string"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Responses.EntityUri[System.Int64]]"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve a list of conversions","tags":["Conversions"]},"post":{"consumes":["application/json","text/json","application/xml","text/xml","application/x-www-form-urlencoded"],"deprecated":false,"parameters":[{"description":"The body of the conversion","in":"body","name":"value","required":true,"schema":{"$ref":"#/definitions/Api.Core.Dto.Conversions.Conversion"}}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntityUri[System.Int64]"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Create a conversion","tags":["Conversions"]}},"/conversions/aggregated/list":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Timeframe of the request. See list at $timeframeList","enum":["today","yesterday","last7","last30","lastmonth","currentmonth","previousmonth","last90","last120","last180","last12months","lastyear","currentyear","beginning","custom"],"in":"query","name":"timeFrame","required":true,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the starting day (YYYYMMDD)","in":"query","name":"fromDay","required":false,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the ending day (YYYYMMDD)","in":"query","name":"toDay","required":false,"type":"string"},{"description":"Status of conversion (\"deleted\"/\"active\")","enum":["deleted","active"],"in":"query","name":"status","required":false,"type":"string"},{"description":"The temporal entity you want to group by (\"week\"/\"month\"). If unspecified is \"day\".","enum":["week","month"],"in":"query","name":"groupBy","required":false,"type":"string"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Dto.Aggregated.AggregatedResult]"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve statistics about this customer for a timeframe related to a subset of conversions grouped by some temporal entity (day/week/month)","tags":["Conversions"]}},"/conversions/count":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Status of conversion (\"deleted\"/\"active\")","enum":["deleted","active"],"in":"query","name":"status","required":false,"type":"string"},{"description":"Filter fields by this pattern","in":"query","name":"textSearch","required":false,"type":"string"},{"description":"Exclude conversions created before this date (YYYYMMDD)","in":"query","name":"createdAfter","required":false,"type":"string"},{"description":"Exclude conversions created after this date (YYYYMMDD)","in":"query","name":"createdBefore","required":false,"type":"string"}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.CountResponce"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve a count of conversions","tags":["Conversions"]}},"/conversions/{conversionId}":{"delete":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of the conversion","format":"int64","in":"path","name":"conversionId","required":true,"type":"integer"}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntityUri[System.Int64]"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Delete conversion specified by id","tags":["Conversions"]},"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of the conversion","format":"int64","in":"path","name":"conversionId","required":true,"type":"integer"}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.Conversions.Conversion"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve conversion specified by id","tags":["Conversions"]},"post":{"consumes":["application/json","text/json","application/xml","text/xml","application/x-www-form-urlencoded"],"deprecated":false,"parameters":[{"description":"Id of the conversion","format":"int64","in":"path","name":"conversionId","required":true,"type":"integer"},{"description":"Updated body of the conversion","in":"body","name":"value","required":true,"schema":{"$ref":"#/definitions/Api.Core.Dto.Conversions.Conversion"}}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntityUri[System.Int64]"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Update conversion specified by id","tags":["Conversions"]}},"/conversions/{conversionId}/aggregated":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of the conversion","format":"int64","in":"path","name":"conversionId","required":true,"type":"integer"},{"description":"Timeframe of the request. See list at $timeframeList","enum":["today","yesterday","last7","last30","lastmonth","currentmonth","previousmonth","last90","last120","last180","last12months","lastyear","currentyear","beginning","custom"],"in":"query","name":"timeFrame","required":true,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the starting day (YYYYMMDD)","in":"query","name":"fromDay","required":false,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the ending day (YYYYMMDD)","in":"query","name":"toDay","required":false,"type":"string"},{"description":"Filter by this tag name","in":"query","name":"tag","required":false,"type":"string"},{"description":"Is the datapoint marked as favourite","in":"query","name":"favourite","required":false,"type":"boolean"},{"description":"If using \"yesterday\" or \"today\" timeframe you can ask for the hourly detail","in":"query","name":"hourly","required":false,"type":"boolean"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.Aggregated.AggregatedResult"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve statistics about this conversion for a timeframe","tags":["Conversions"]}},"/conversions/{conversionId}/aggregated/list":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of the conversion","format":"int64","in":"path","name":"conversionId","required":true,"type":"integer"},{"description":"Timeframe of the request. See list at $timeframeList","enum":["today","yesterday","last7","last30","lastmonth","currentmonth","previousmonth","last90","last120","last180","last12months","lastyear","currentyear","beginning","custom"],"in":"query","name":"timeFrame","required":true,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the starting day (YYYYMMDD)","in":"query","name":"fromDay","required":false,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the ending day (YYYYMMDD)","in":"query","name":"toDay","required":false,"type":"string"},{"description":"The temporal entity you want to group by (\"week\"/\"month\"). If unspecified is \"day\".","enum":["week","month"],"in":"query","name":"groupBy","required":false,"type":"string"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Dto.Aggregated.AggregatedResult]"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve statistics about this conversion for a timeframe grouped by some temporal entity (day/week/month)","tags":["Conversions"]}},"/conversions/{conversionId}/datapoints":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of the conversion","format":"int64","in":"path","name":"conversionId","required":true,"type":"integer"},{"description":"Offset where to start from","format":"int32","in":"query","minLength":0,"name":"offset","required":false,"type":"integer"},{"description":"Limit results to this number","format":"int32","in":"query","maxLength":0,"minLength":0,"name":"limit","required":false,"type":"integer"},{"description":"Type of datapoint (\"tl\"/\"tp\")","enum":["tp","tl"],"in":"query","name":"type","required":false,"type":"string"},{"description":"Status of datapoint (\"deleted\"/\"active\"/\"paused\"/\"spam\")","enum":["deleted","active","paused","spam"],"in":"query","name":"status","required":false,"type":"string"},{"description":"Filter by this tag name","in":"query","name":"tags","required":false,"type":"string"},{"description":"Filter fields by this pattern","in":"query","name":"textSearch","required":false,"type":"string"},{"description":"Exclude datapoints created before this date (YYYYMMDD)","in":"query","name":"createdAfter","required":false,"type":"string"},{"description":"Exclude datapoints created after this date (YYYYMMDD)","in":"query","name":"createdBefore","required":false,"type":"string"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Responses.EntityUri[System.Int64]]"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve a list of datapoints connected to this conversion","tags":["Conversions"]}},"/conversions/{conversionId}/datapoints/batch/patch":{"put":{"consumes":["application/json","text/json","application/x-www-form-urlencoded"],"deprecated":false,"parameters":[{"description":"Id of the conversion","format":"int64","in":"path","name":"conversionId","required":true,"type":"integer"},{"description":"Patch requests","in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/Api.Core.Requests.PatchBodyBatch"}}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntityUri[System.Int64]"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Modify the association between a conversion and multiple datapoints","tags":["Conversions"]}},"/conversions/{conversionId}/datapoints/count":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of the conversion","format":"int64","in":"path","name":"conversionId","required":true,"type":"integer"},{"description":"Type of datapoint (\"tl\"/\"tp\")","in":"query","name":"type","required":false,"type":"string"},{"description":"Status of datapoint (\"deleted\"/\"active\"/\"paused\"/\"spam\")","in":"query","name":"status","required":false,"type":"string"},{"description":"Filter by this tag name","in":"query","name":"tags","required":false,"type":"string"},{"description":"Filter fields by this pattern","in":"query","name":"textSearch","required":false,"type":"string"},{"description":"Exclude datapoints created before this date (YYYYMMDD)","in":"query","name":"createdAfter","required":false,"type":"string"},{"description":"Exclude datapoints created after this date (YYYYMMDD)","in":"query","name":"createdBefore","required":false,"type":"string"}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.CountResponce"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve a count of datapoints connected to this conversion","tags":["Conversions"]}},"/conversions/{conversionId}/datapoints/patch":{"put":{"consumes":["application/json","text/json","application/xml","text/xml","application/x-www-form-urlencoded"],"deprecated":false,"parameters":[{"description":"Id of the conversion","format":"int64","in":"path","name":"conversionId","required":true,"type":"integer"},{"description":"Patch request","in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/Api.Core.Requests.ConversionPatchBody"}}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntityUri[System.Int64]"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Modify the association between a conversion and a datapoint","tags":["Conversions"]}},"/conversions/{conversionId}/hits":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of the conversion","format":"int64","in":"path","name":"conversionId","required":true,"type":"integer"},{"description":"Timeframe of the request. See list at $timeframeList","enum":["yesterday","last7","last30","lastmonth","currentmonth","previousmonth","last90","last120","last180","custom"],"in":"query","name":"timeframe","required":true,"type":"string"},{"description":"Limit results to this number","format":"int32","in":"query","maxLength":0,"minLength":0,"name":"limit","required":false,"type":"integer"},{"description":"Offset where to start from (it's the lastKey field in the response object)","in":"query","name":"offset","required":false,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the starting day (YYYYMMDD)","in":"query","name":"fromDay","required":false,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the ending day (YYYYMMDD)","in":"query","name":"toDay","required":false,"type":"string"},{"description":"Filter event type (\"spiders\"/\"uniques\"/\"nonuniques\"/\"conversions\")","enum":["spiders","uniques","nonuniques","conversions"],"in":"query","name":"filter","required":false,"type":"string"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.ClickStream.HitListPage"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve the list of events related to this conversion.","tags":["Conversions"]}},"/conversions/{conversionId}/notes":{"put":{"consumes":["application/json","text/json","application/xml","text/xml","application/x-www-form-urlencoded"],"deprecated":false,"parameters":[{"description":"Id of the conversion","format":"int64","in":"path","name":"conversionId","required":true,"type":"integer"},{"description":"Patch requests","in":"body","name":"note","required":true,"schema":{"$ref":"#/definitions/Api.Core.Requests.GenericTextPatch"}}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntityUri[System.Int64]"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Fast patch the \"notes\" field of a conversion","tags":["Conversions"]}},"/conversions/{conversionId}/reports":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of the conversion","format":"int64","in":"path","name":"conversionId","required":true,"type":"integer"},{"description":"Type of the report.","enum":["datapoints","groups","browsers","browsersfamilies","platforms","cities","countries","keywords","referrers","convparameters","destinations","languages","params"],"in":"query","name":"type","required":true,"type":"string"},{"description":"Timeframe of the request. See list at $timeframeList","enum":["yesterday","last7","last30","lastmonth","currentmonth","previousmonth","last90","last120","last180","beginning","custom"],"in":"query","name":"timeframe","required":true,"type":"string"},{"description":"Type of the event you want to filter this report with. By default no filter is applied.","enum":["clicks","views"],"in":"query","name":"hittype","required":false,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the starting day (YYYYMMDD)","in":"query","name":"fromDay","required":false,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the ending day (YYYYMMDD)","in":"query","name":"toDay","required":false,"type":"string"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.Tops.Top"}},"401":{"description":"Forbidden"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve a top report connected to this conversion","tags":["Conversions"]}},"/datapoints":{"get":{"consumes":[],"deprecated":false,"parameters":[{"default":0,"description":"Where to start when retrieving elements. Default is 0 if not specified.","format":"int32","in":"query","minLength":0,"name":"offset","required":false,"type":"integer"},{"default":20,"description":"Maximum elements to retrieve. Default to 20 if not specified.","format":"int32","in":"query","maxLength":0,"minLength":0,"name":"limit","required":false,"type":"integer"},{"description":"Type of the datapoint (\"tp\"/\"tl\")","enum":["tp","tl"],"in":"query","name":"type","required":false,"type":"string"},{"description":"Status of the datapoint","enum":["deleted","active","paused","spam"],"in":"query","name":"status","required":false,"type":"string"},{"description":"A comma separated list of tags you want to filter with.","in":"query","name":"tags","required":false,"type":"string"},{"description":"Filter fields by this pattern","in":"query","name":"textSearch","required":false,"type":"string"},{"description":"Filter fields by favourite status","in":"query","name":"onlyFavorites","required":false,"type":"boolean"},{"description":"Field to sort by","in":"query","name":"sortBy","required":false,"type":"string"},{"description":"Direction of sort \"asc\" or \"desc\"","enum":["asc","desc"],"in":"query","name":"sortDirection","required":false,"type":"string"},{"description":"Exclude datapoints created before this date (YYYYMMDD)","in":"query","name":"createdAfter","required":false,"type":"string"},{"description":"Exclude datapoints created after this date (YYYYMMDD)","in":"query","name":"createdBefore","required":false,"type":"string"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Responses.EntityUri[System.Int64]]"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"List of all the datapoints associated to the user","tags":["DataPoints"]},"post":{"consumes":["application/json","text/json","application/x-www-form-urlencoded"],"deprecated":false,"parameters":[{"description":"The body of the datapoint","in":"body","name":"value","required":true,"schema":{"$ref":"#/definitions/Api.Core.Dto.Datapoints.Datapoint"}}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntityUri[System.Int64]"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Create a datapoint","tags":["DataPoints"]}},"/datapoints/aggregated":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Timeframe of the request. See list at $timeframeList","enum":["today","yesterday","last7","last30","lastmonth","currentmonth","previousmonth","last90","last120","last180","last12months","lastyear","currentyear","beginning","custom"],"in":"query","name":"timeFrame","required":true,"type":"string"},{"description":"Type of datapoint (\"tl\"/\"tp\")","enum":["tp","tl"],"in":"query","name":"type","required":false,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the starting day (YYYYMMDD)","in":"query","name":"fromDay","required":false,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the ending day (YYYYMMDD)","in":"query","name":"toDay","required":false,"type":"string"},{"description":"If using \"yesterday\" or \"today\" timeframe you can ask for the hourly detail","in":"query","name":"hourly","required":false,"type":"boolean"},{"description":"Status of datapoint (\"deleted\"/\"active\"/\"paused\"/\"spam\")","enum":["deleted","active","paused","spam"],"in":"query","name":"status","required":false,"type":"string"},{"description":"A comma separated list of tags you want to filter with.","in":"query","name":"tag","required":false,"type":"string"},{"description":"Is the datapoint is marked as favourite","in":"query","name":"favourite","required":false,"type":"boolean"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.Aggregated.AggregatedResult"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve statistics about this customer for a timeframe by groups","tags":["DataPoints"]}},"/datapoints/aggregated/list":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Type of datapoint (\"tl\"/\"tp\")","enum":["tp","tl"],"in":"query","name":"type","required":true,"type":"string"},{"description":"Timeframe of the request. See list at $timeframeList","enum":["today","yesterday","last7","last30","lastmonth","currentmonth","previousmonth","last90","last120","last180","last12months","lastyear","currentyear","beginning","custom"],"in":"query","name":"timeFrame","required":true,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the starting day (YYYYMMDD)","in":"query","name":"fromDay","required":false,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the ending day (YYYYMMDD)","in":"query","name":"toDay","required":false,"type":"string"},{"description":"Status of datapoint (\"deleted\"/\"active\"/\"paused\"/\"spam\")","enum":["deleted","active","paused","spam"],"in":"query","name":"status","required":false,"type":"string"},{"description":"A comma separated list of tags you want to filter with.","in":"query","name":"tag","required":false,"type":"string"},{"description":"Is the datapoint is marked as favourite","in":"query","name":"favourite","required":false,"type":"boolean"},{"description":"The temporal entity you want to group by (\"week\"/\"month\"). If unspecified is \"day\".","enum":["week","month"],"in":"query","name":"groupBy","required":false,"type":"string"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Dto.Aggregated.AggregatedResult]"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve statistics about all datapoints of this customer for a timeframe grouped by some temporal entity (day/week/month)","tags":["DataPoints"]}},"/datapoints/batch":{"delete":{"consumes":["application/json","text/json","application/x-www-form-urlencoded"],"deprecated":false,"parameters":[{"description":"A json containing the datapoints to delete.","in":"body","name":"batch","required":true,"schema":{"$ref":"#/definitions/Api.Core.Requests.DeleteBatch"}}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.ModifyBatchItemResponce[Api.Core.Dto.Datapoints.Datapoint,System.Int64]"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Delete multiple datapoints","tags":["DataPoints"]},"post":{"consumes":["application/json","text/json","application/x-www-form-urlencoded"],"deprecated":false,"parameters":[{"description":"A json containing the datapoints to update.","in":"body","name":"batch","required":true,"schema":{"$ref":"#/definitions/Api.Core.Requests.DatapointsBatch"}}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.ModifyBatchItemResponce[Api.Core.Dto.Datapoints.Datapoint,System.Int64]"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Update multiple datapoints","tags":["DataPoints"]},"put":{"consumes":["application/json","text/json","application/x-www-form-urlencoded"],"deprecated":false,"parameters":[{"description":"A json containing the datapoints to create.","in":"body","name":"batch","required":true,"schema":{"$ref":"#/definitions/Api.Core.Requests.DatapointsBatch"}}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.ModifyBatchItemResponce[Api.Core.Dto.Datapoints.Datapoint,System.Int64]"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Create multiple datapoints","tags":["DataPoints"]}},"/datapoints/count":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Type of the datapoint (\"tp\"/\"tl\")","enum":["tp","tl"],"in":"query","name":"type","required":false,"type":"string"},{"description":"Status of the datapoint","enum":["deleted","active","paused","spam"],"in":"query","name":"status","required":false,"type":"string"},{"description":"A comma separated list of tags you want to filter with.","in":"query","name":"tags","required":false,"type":"string"},{"description":"Filter fields by this pattern","in":"query","name":"textSearch","required":false,"type":"string"},{"description":"Filter fields by favourite status","in":"query","name":"onlyFavorites","required":false,"type":"boolean"},{"description":"Exclude datapoints created before this date (YYYYMMDD)","in":"query","name":"createdAfter","required":false,"type":"string"},{"description":"Exclude datapoints created after this date (YYYYMMDD)","in":"query","name":"createdBefore","required":false,"type":"string"}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.CountResponce"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Count the datapoints associated to the user","tags":["DataPoints"]}},"/datapoints/{id}":{"delete":{"consumes":[],"deprecated":false,"parameters":[{"description":"The id of the datapoint","format":"int64","in":"path","name":"id","required":true,"type":"integer"}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntityUri[System.Int64]"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Delete a datapoint","tags":["DataPoints"]},"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"The id of the datapoint","format":"int64","in":"path","name":"id","required":true,"type":"integer"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.Datapoints.Datapoint"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Get a datapoint","tags":["DataPoints"]},"post":{"consumes":["application/json","text/json","application/x-www-form-urlencoded"],"deprecated":false,"parameters":[{"description":"The id of the datapoint","format":"int64","in":"path","name":"id","required":true,"type":"integer"},{"description":"The body of the datapoint","in":"body","name":"value","required":true,"schema":{"$ref":"#/definitions/Api.Core.Dto.Datapoints.Datapoint"}}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntityUri[System.Int64]"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Update a datapoint","tags":["DataPoints"]}},"/datapoints/{id}/aggregated":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of the datapoint","format":"int64","in":"path","name":"id","required":true,"type":"integer"},{"description":"Timeframe of the request. See list at $timeframeList","enum":["today","yesterday","last7","last30","lastmonth","currentmonth","previousmonth","last90","last120","last180","last12months","lastyear","currentyear","beginning","custom"],"in":"query","name":"timeFrame","required":true,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the starting day (YYYYMMDD)","in":"query","name":"fromDay","required":false,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the ending day (YYYYMMDD)","in":"query","name":"toDay","required":false,"type":"string"},{"description":"If using \"yesterday\" or \"today\" timeframe you can ask for the hourly detail","in":"query","name":"hourly","required":false,"type":"boolean"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.Aggregated.AggregatedResult"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve statistics about this datapoint for a timeframe","tags":["DataPoints"]}},"/datapoints/{id}/aggregated/list":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of the datapoint","format":"int64","in":"path","name":"id","required":true,"type":"integer"},{"description":"Timeframe of the request. See list at $timeframeList","enum":["today","yesterday","last7","last30","lastmonth","currentmonth","previousmonth","last90","last120","last180","last12months","lastyear","currentyear","beginning","custom"],"in":"query","name":"timeFrame","required":true,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the starting day (YYYYMMDD)","in":"query","name":"fromDay","required":false,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the ending day (YYYYMMDD)","in":"query","name":"toDay","required":false,"type":"string"},{"description":"The temporal entity you want to group by (\"week\"/\"month\"). If unspecified is \"day\".","enum":["week","month"],"in":"query","name":"groupBy","required":false,"type":"string"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Dto.Aggregated.AggregatedResult]"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve statistics about this datapoint for a timeframe grouped by some temporal entity (day/week/month)","tags":["DataPoints"]}},"/datapoints/{id}/favourite":{"put":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of the datapoint","format":"int64","in":"path","name":"id","required":true,"type":"integer"}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntityUri[System.Int64]"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Fast switch the \"favourite\" field of a datapoint","tags":["DataPoints"]}},"/datapoints/{id}/hits":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of the datapoint","format":"int64","in":"path","name":"id","required":true,"type":"integer"},{"description":"Timeframe of the request. See list at $timeframeList","enum":["yesterday","last7","last30","lastmonth","currentmonth","previousmonth","last90","last120","last180","custom"],"in":"query","name":"timeframe","required":true,"type":"string"},{"description":"Limit results to this number","format":"int32","in":"query","maxLength":0,"minLength":0,"name":"limit","required":false,"type":"integer"},{"description":"Offset where to start from (it's the lastKey field in the response object)","in":"query","name":"offset","required":false,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the starting day (YYYYMMDD)","in":"query","name":"fromDay","required":false,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the ending day (YYYYMMDD)","in":"query","name":"toDay","required":false,"type":"string"},{"description":"Filter event type (\"spiders\"/\"uniques\"/\"nonuniques\"/\"conversions\")","enum":["spiders","uniques","nonuniques","conversions"],"in":"query","name":"filter","required":false,"type":"string"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.ClickStream.HitListPage"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve the list of events related to this datapoint.","tags":["DataPoints"]}},"/datapoints/{id}/notes":{"put":{"consumes":["application/json","text/json","application/xml","text/xml","application/x-www-form-urlencoded"],"deprecated":false,"parameters":[{"description":"Id of the datapoint","format":"int64","in":"path","name":"id","required":true,"type":"integer"},{"description":"Patch requests","in":"body","name":"note","required":true,"schema":{"$ref":"#/definitions/Api.Core.Requests.GenericTextPatch"}}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntityUri[System.Int64]"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Fast patch the \"notes\" field of a datapoint","tags":["DataPoints"]}},"/datapoints/{id}/reports":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of the datapoint","format":"int64","in":"path","name":"id","required":true,"type":"integer"},{"description":"Type of the report.","enum":["browsers","browsersfamilies","platforms","cities","countries","isps","ips","oss","ossfamilies","keywords","referrers","destinations","languages","params"],"in":"query","name":"type","required":true,"type":"string"},{"description":"Timeframe of the request. See list at $timeframeList","enum":["yesterday","last7","last30","lastmonth","currentmonth","previousmonth","last90","last120","last180","beginning","custom"],"in":"query","name":"timeframe","required":true,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the starting day (YYYYMMDD)","in":"query","name":"fromDay","required":false,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the ending day (YYYYMMDD)","in":"query","name":"toDay","required":false,"type":"string"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.Tops.Top"}},"401":{"description":"Forbidden"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve a top report connected to this datapoint","tags":["DataPoints"]}},"/domains":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Offset where to start from","format":"int32","in":"query","minLength":0,"name":"offset","required":false,"type":"integer"},{"description":"Limit results to this number","format":"int32","in":"query","maxLength":0,"minLength":0,"name":"limit","required":false,"type":"integer"},{"default":"system","description":"Type of domain (\"system\"/\"go\"/\"personal\"/\"dedicated\"). If not specified default is \"system\"","enum":["system","go","personal","dedicated"],"in":"query","name":"type","required":false,"type":"string"},{"description":"Filter domains with this anmen","in":"query","name":"name","required":false,"type":"string"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Responses.EntityUri[System.Int64]]"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve a list of domains","tags":["Domains"]},"post":{"consumes":["application/json","text/json","application/xml","text/xml","application/x-www-form-urlencoded"],"deprecated":false,"parameters":[{"description":"The domain to create","in":"body","name":"value","required":true,"schema":{"$ref":"#/definitions/Api.Core.Dto.Domains.Domain"}}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntityUri[System.Int64]"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Create a domain","tags":["Domains"]}},"/domains/count":{"get":{"consumes":[],"deprecated":false,"parameters":[{"default":"system","description":"Type of domain (\"system\"/\"go\"/\"personal\"/\"dedicated\"). If not specified default is \"system\"","enum":["system","go","personal","dedicated"],"in":"query","name":"type","required":false,"type":"string"},{"description":"Filter domains with this anmen","in":"query","name":"name","required":false,"type":"string"}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.CountResponce"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve count of domains","tags":["Domains"]}},"/domains/{id}":{"delete":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of domain","format":"int64","in":"path","name":"id","required":true,"type":"integer"}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntityUri[System.Int64]"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Delete a domain","tags":["Domains"]},"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of domain","format":"int64","in":"path","name":"id","required":true,"type":"integer"}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.Domains.Domain"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Get a domain","tags":["Domains"]},"post":{"consumes":["application/json","text/json","application/xml","text/xml","application/x-www-form-urlencoded"],"deprecated":false,"parameters":[{"description":"Id of domain","format":"int64","in":"path","name":"id","required":true,"type":"integer"},{"description":"The domain to update","in":"body","name":"value","required":true,"schema":{"$ref":"#/definitions/Api.Core.Dto.Domains.Domain"}}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntityUri[System.Int64]"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Update a domain","tags":["Domains"]}},"/groups":{"get":{"consumes":[],"deprecated":false,"parameters":[{"default":0,"description":"Where to start when retrieving elements. Default is 0 if not specified.","format":"int32","in":"query","minLength":0,"name":"offset","required":false,"type":"integer"},{"default":20,"description":"Maximum elements to retrieve. Default to 20 if not specified.","format":"int32","in":"query","maxLength":0,"minLength":0,"name":"limit","required":false,"type":"integer"},{"description":"Status of the group","enum":["deleted","active"],"in":"query","name":"status","required":false,"type":"string"},{"description":"A comma separated list of tags you want to filter with.","in":"query","name":"tags","required":false,"type":"string"},{"description":"Filter fields by this pattern","in":"query","name":"textSearch","required":false,"type":"string"},{"description":"Exclude groups created before this date (YYYYMMDD)","in":"query","name":"createdAfter","required":false,"type":"string"},{"description":"Exclude groups created after this date (YYYYMMDD)","in":"query","name":"createdBefore","required":false,"type":"string"},{"description":"Write permission","in":"query","name":"write","required":false,"type":"boolean"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Responses.EntityUri[System.Int64]]"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"List of all the groups associated to the user.","tags":["Groups"]},"post":{"consumes":["application/json","text/json","application/x-www-form-urlencoded"],"deprecated":false,"parameters":[{"description":"The body of the group","in":"body","name":"value","required":true,"schema":{"$ref":"#/definitions/Api.Core.Dto.Groups.Group"}}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntityUri[System.Int64]"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Create a group","tags":["Groups"]}},"/groups/aggregated":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Timeframe of the request. See list at $timeframeList","enum":["today","yesterday","last7","last30","lastmonth","currentmonth","previousmonth","last90","last120","last180","last12months","lastyear","currentyear","beginning","custom"],"in":"query","name":"timeFrame","required":true,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the starting day (YYYYMMDD)","in":"query","name":"fromDay","required":false,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the ending day (YYYYMMDD)","in":"query","name":"toDay","required":false,"type":"string"},{"description":"If using \"yesterday\" or \"today\" timeframe you can ask for the hourly detail","in":"query","name":"hourly","required":false,"type":"boolean"},{"description":"Status of group (\"deleted\"/\"active\")","enum":["deleted","active"],"in":"query","name":"status","required":false,"type":"string"},{"description":"A comma separated list of tags you want to filter with.","in":"query","name":"tag","required":false,"type":"string"},{"description":"Is the group is marked as favourite","in":"query","name":"favourite","required":false,"type":"boolean"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.Aggregated.AggregatedResult"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve statistics about this customer for a timeframe by groups","tags":["Groups"]}},"/groups/aggregated/list":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Timeframe of the request. See list at $timeframeList","enum":["today","yesterday","last7","last30","lastmonth","currentmonth","previousmonth","last90","last120","last180","last12months","lastyear","currentyear","beginning","custom"],"in":"query","name":"timeFrame","required":true,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the starting day (YYYYMMDD)","in":"query","name":"fromDay","required":false,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the ending day (YYYYMMDD)","in":"query","name":"toDay","required":false,"type":"string"},{"description":"Status of group (\"deleted\"/\"active\")","in":"query","name":"status","required":false,"type":"string"},{"description":"A comma separated list of tags you want to filter with.","in":"query","name":"tag","required":false,"type":"string"},{"description":"Is the group is marked as favourite","in":"query","name":"favourite","required":false,"type":"boolean"},{"description":"The temporal entity you want to group by (\"week\"/\"month\"). If unspecified is \"day\".","enum":["deleted","active"],"in":"query","name":"groupBy","required":false,"type":"string"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Dto.Aggregated.AggregatedResult]"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve statistics about all groups of this customer for a timeframe grouped by some temporal entity (day/week/month)","tags":["Groups"]}},"/groups/count":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Status of the datapoint","enum":["deleted","active"],"in":"query","name":"status","required":false,"type":"string"},{"description":"A comma separated list of tags you want to filter with.","in":"query","name":"tags","required":false,"type":"string"},{"description":"Filter fields by this pattern","in":"query","name":"textSearch","required":false,"type":"string"},{"description":"Exclude groups created before this date (YYYYMMDD)","in":"query","name":"createdAfter","required":false,"type":"string"},{"description":"Exclude groups created after this date (YYYYMMDD)","in":"query","name":"createdBefore","required":false,"type":"string"},{"description":"Write permission","in":"query","name":"write","required":false,"type":"boolean"}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.CountResponce"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Count the groups associated to the user.","tags":["Groups"]}},"/groups/{id}":{"delete":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of the group","format":"int64","in":"path","name":"id","required":true,"type":"integer"}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntityUri[System.Int64]"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Delete group specified by id","tags":["Groups"]},"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"The id of the group","format":"int64","in":"path","name":"id","required":true,"type":"integer"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.Groups.Group"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Get a group","tags":["Groups"]},"post":{"consumes":["application/json","text/json","application/x-www-form-urlencoded"],"deprecated":false,"parameters":[{"description":"The id of the group","format":"int64","in":"path","name":"id","required":true,"type":"integer"},{"description":"The body of the group","in":"body","name":"value","required":true,"schema":{"$ref":"#/definitions/Api.Core.Dto.Groups.Group"}}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntityUri[System.Int64]"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Update a group","tags":["Groups"]}},"/groups/{id}/aggregated":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of the group","format":"int64","in":"path","name":"id","required":true,"type":"integer"},{"description":"Timeframe of the request. See list at $timeframeList","enum":["today","yesterday","last7","last30","lastmonth","currentmonth","previousmonth","last90","last120","last180","last12months","lastyear","currentyear","beginning","custom"],"in":"query","name":"timeFrame","required":true,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the starting day (YYYYMMDD)","in":"query","name":"fromDay","required":false,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the ending day (YYYYMMDD)","in":"query","name":"toDay","required":false,"type":"string"},{"description":"If using \"yesterday\" or \"today\" timeframe you can ask for the hourly detail","in":"query","name":"hourly","required":false,"type":"boolean"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.Aggregated.AggregatedResult"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve statistics about this group for a timeframe","tags":["Groups"]}},"/groups/{id}/aggregated/list":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of the group","format":"int64","in":"path","name":"id","required":true,"type":"integer"},{"description":"Timeframe of the request. See list at $timeframeList","enum":["today","yesterday","last7","last30","lastmonth","currentmonth","previousmonth","last90","last120","last180","last12months","lastyear","currentyear","beginning","custom"],"in":"query","name":"timeFrame","required":true,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the starting day (YYYYMMDD)","in":"query","name":"fromDay","required":false,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the ending day (YYYYMMDD)","in":"query","name":"toDay","required":false,"type":"string"},{"description":"The temporal entity you want to group by (\"week\"/\"month\"). If unspecified is \"day\".","enum":["week","month"],"in":"query","name":"groupBy","required":false,"type":"string"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Dto.Aggregated.AggregatedResult]"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve statistics about this group for a timeframe grouped by some temporal entity (day/week/month)","tags":["Groups"]}},"/groups/{id}/aggregated/summary":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Filter by this group id","format":"int64","in":"path","name":"id","required":true,"type":"integer"},{"description":"Timeframe of the request. See list at $timeframeList","enum":["today","yesterday","last7","last30","lastmonth","currentmonth","previousmonth","last90","last120","last180","last12months","lastyear","currentyear","beginning","custom"],"in":"query","name":"timeFrame","required":true,"type":"string"},{"description":"Type of datapoint (\"tl\"/\"tp\")","enum":["tp","tl"],"in":"query","name":"type","required":false,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the starting day (YYYYMMDD)","in":"query","name":"fromDay","required":false,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the ending day (YYYYMMDD)","in":"query","name":"toDay","required":false,"type":"string"},{"description":"Status of datapoint (\"deleted\"/\"active\"/\"paused\"/\"spam\")","enum":["deleted","active"],"in":"query","name":"status","required":false,"type":"string"},{"description":"A comma separated list of tags you want to filter with.","in":"query","name":"tag","required":false,"type":"string"},{"description":"Is the datapoint marked as favourite","in":"query","name":"favourite","required":false,"type":"boolean"},{"description":"Field to sort by","in":"query","name":"sortBy","required":false,"type":"string"},{"description":"Direction of sort \"asc\" or \"desc\"","enum":["asc","desc"],"in":"query","name":"sortDirection","required":false,"type":"string"},{"default":0,"description":"Offset where to start from","format":"int32","in":"query","minLength":0,"name":"offset","required":false,"type":"integer"},{"default":20,"description":"Limit results to this number","format":"int32","in":"query","maxLength":0,"minLength":0,"name":"limit","required":false,"type":"integer"},{"description":"Filter fields by this pattern","in":"query","name":"textSearch","required":false,"type":"string"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.Aggregated.AggregatedSummaryResult"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve statistics about a subset of datapoints for a timeframe with datapoints data","tags":["Groups"]}},"/groups/{id}/datapoints":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of the group","format":"int64","in":"path","name":"id","required":true,"type":"integer"},{"default":0,"description":"Where to start when retrieving elements. Default is 0 if not specified.","format":"int32","in":"query","minLength":0,"name":"offset","required":false,"type":"integer"},{"default":20,"description":"Maximum elements to retrieve. Default to 20 if not specified.","format":"int32","in":"query","maxLength":0,"minLength":0,"name":"limit","required":false,"type":"integer"},{"description":"Type of the datapoint (\"tp\"/\"tl\")","enum":["tp","tl"],"in":"query","name":"type","required":false,"type":"string"},{"description":"Status of the datapoint","enum":["deleted","active","paused","spam"],"in":"query","name":"status","required":false,"type":"string"},{"description":"A comma separated list of tags you want to filter with.","in":"query","name":"tags","required":false,"type":"string"},{"description":"Filter fields by this pattern","in":"query","name":"textSearch","required":false,"type":"string"},{"description":"Filter fields by favourite status","in":"query","name":"onlyFavorites","required":false,"type":"boolean"},{"description":"Field to sort by","in":"query","name":"sortBy","required":false,"type":"string"},{"description":"Direction of sort \"asc\" or \"desc\"","enum":["asc","desc"],"in":"query","name":"sortDirection","required":false,"type":"string"},{"description":"Exclude datapoints created before this date (YYYYMMDD)","in":"query","name":"createdAfter","required":false,"type":"string"},{"description":"Exclude datapoints created after this date (YYYYMMDD)","in":"query","name":"createdBefore","required":false,"type":"string"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Responses.EntityUri[System.Int64]]"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"List of all the datapoints associated to the user in this group.","tags":["Groups"]},"post":{"consumes":["application/json","text/json","application/x-www-form-urlencoded"],"deprecated":false,"parameters":[{"description":"The id of the group","format":"int64","in":"path","name":"id","required":true,"type":"integer"},{"description":"The body of the datapoint","in":"body","name":"value","required":true,"schema":{"$ref":"#/definitions/Api.Core.Dto.Datapoints.Datapoint"}}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntityUri[System.Int64]"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Create a datapoint in this group","tags":["Groups"]}},"/groups/{id}/datapoints/count":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of the group","format":"int64","in":"path","name":"id","required":true,"type":"integer"},{"description":"Type of the datapoint (\"tp\"/\"tl\")","enum":["tp","tl"],"in":"query","name":"type","required":false,"type":"string"},{"description":"Status of the datapoint","enum":["deleted","active","paused","spam"],"in":"query","name":"status","required":false,"type":"string"},{"description":"A comma separated list of tags you want to filter with.","in":"query","name":"tags","required":false,"type":"string"},{"description":"Filter fields by this pattern","in":"query","name":"textSearch","required":false,"type":"string"},{"description":"Filter fields by favourite status","in":"query","name":"onlyFavorites","required":false,"type":"boolean"},{"description":"Exclude datapoints created before this date (YYYYMMDD)","in":"query","name":"createdAfter","required":false,"type":"string"},{"description":"Exclude datapoints created after this date (YYYYMMDD)","in":"query","name":"createdBefore","required":false,"type":"string"}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.CountResponce"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Count the datapoints associated to the user in this group.","tags":["Groups"]}},"/groups/{id}/favourite":{"put":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of the group","format":"int64","in":"path","name":"id","required":true,"type":"integer"}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntityUri[System.Int64]"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Fast switch the \"favourite\" field of a group","tags":["Groups"]}},"/groups/{id}/hits":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of the group","format":"int64","in":"path","name":"id","required":true,"type":"integer"},{"description":"Timeframe of the request. See list at $timeframeList","enum":["yesterday","last7","last30","lastmonth","currentmonth","previousmonth","last90","last120","last180","custom"],"in":"query","name":"timeframe","required":true,"type":"string"},{"description":"Limit results to this number","format":"int32","in":"query","maxLength":0,"minLength":0,"name":"limit","required":false,"type":"integer"},{"description":"Offset where to start from (it's the lastKey field in the response object)","in":"query","name":"offset","required":false,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the starting day (YYYYMMDD)","in":"query","name":"fromDay","required":false,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the ending day (YYYYMMDD)","in":"query","name":"toDay","required":false,"type":"string"},{"description":"Filter event type (\"spiders\"/\"uniques\"/\"nonuniques\"/\"conversions\")","enum":["spiders","uniques","nonuniques","conversions"],"in":"query","name":"filter","required":false,"type":"string"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.ClickStream.HitListPage"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve the list of events related to this group.","tags":["Groups"]}},"/groups/{id}/notes":{"put":{"consumes":["application/json","text/json","application/xml","text/xml","application/x-www-form-urlencoded"],"deprecated":false,"parameters":[{"description":"Id of the group","format":"int64","in":"path","name":"id","required":true,"type":"integer"},{"description":"Patch requests","in":"body","name":"note","required":true,"schema":{"$ref":"#/definitions/Api.Core.Requests.GenericTextPatch"}}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntityUri[System.Int64]"}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Fast patch the \"notes\" field of a group","tags":["Groups"]}},"/groups/{id}/reports":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of the group","format":"int64","in":"path","name":"id","required":true,"type":"integer"},{"description":"Type of the report.","enum":["browsers","browsersfamilies","platforms","cities","countries","isps","ips","oss","ossfamilies","keywords","referrers","destinations","languages","params"],"in":"query","name":"type","required":true,"type":"string"},{"description":"Timeframe of the request. See list at $timeframeList","enum":["yesterday","last7","last30","lastmonth","currentmonth","previousmonth","last90","last120","last180","beginning","custom"],"in":"query","name":"timeframe","required":true,"type":"string"},{"description":"Type of the event you want to filter this report with. By default no filter is applied.","enum":["clicks","views"],"in":"query","name":"hittype","required":false,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the starting day (YYYYMMDD)","in":"query","name":"fromDay","required":false,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the ending day (YYYYMMDD)","in":"query","name":"toDay","required":false,"type":"string"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.Tops.Top"}},"401":{"description":"Forbidden"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve a top report connected to this group","tags":["Groups"]}},"/hits":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Timeframe of the request. See list at $timeframeList","enum":["yesterday","last7","last30","lastmonth","currentmonth","previousmonth","last90","last120","last180","custom"],"in":"query","name":"timeframe","required":true,"type":"string"},{"description":"Limit results to this number","format":"int32","in":"query","name":"limit","required":false,"type":"integer"},{"description":"Offset where to start from (it's the lastKey field in the response object)","in":"query","name":"offset","required":false,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the starting day (YYYYMMDD)","in":"query","name":"fromDay","required":false,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the ending day (YYYYMMDD)","in":"query","name":"toDay","required":false,"type":"string"},{"description":"Filter event type (\"spiders\"/\"uniques\"/\"nonuniques\"/\"conversions\")","enum":["spiders","uniques","nonuniques","conversions"],"in":"query","name":"filter","required":false,"type":"string"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.ClickStream.HitListPage"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve the list of events related to this account.","tags":["Hits"]}},"/me":{"get":{"consumes":[],"deprecated":false,"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.Accounting.User"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve current account data","tags":["Me"]}},"/me/plan":{"get":{"consumes":[],"deprecated":false,"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.Accounting.Plan"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve current account plan","tags":["Me"]}},"/reports":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Type of the report.","enum":["browsers","browsersfamilies","platforms","cities","countries","isps","ips","oss","ossfamilies","keywords","referrers","destinations","languages","params"],"in":"query","name":"type","required":true,"type":"string"},{"description":"Timeframe of the request. See list at $timeframeList","enum":["yesterday","last7","last30","lastmonth","currentmonth","previousmonth","last90","last120","last180","beginning","custom"],"in":"query","name":"timeframe","required":true,"type":"string"},{"description":"Type of the event you want to filter this report with. By default no filter is applied.","in":"query","name":"hittype","required":false,"type":"string"},{"description":"Filter by this group id (mutually exclusive with \"datapoint\" and \"conversion\")","format":"int64","in":"query","name":"group","required":false,"type":"integer"},{"description":"Filter by this datapoint id (mutually exclusive with \"group\" and \"conversion\")","format":"int64","in":"query","name":"datapoint","required":false,"type":"integer"},{"description":"Filter by this conversion id (mutually exclusive with \"datapoint\" and \"group\")","format":"int64","in":"query","name":"conversion","required":false,"type":"integer"},{"description":"If using a \"custom\" timeFrame you can specify the starting day (YYYYMMDD)","in":"query","name":"fromDay","required":false,"type":"string"},{"description":"If using a \"custom\" timeFrame you can specify the ending day (YYYYMMDD)","in":"query","name":"toDay","required":false,"type":"string"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.Tops.Top"}},"401":{"description":"Forbidden"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve a top report","tags":["Reports"]}},"/retargeting":{"get":{"consumes":[],"deprecated":false,"parameters":[{"default":0,"description":"Where to start when retrieving elements. Default is 0 if not specified.","format":"int32","in":"query","minLength":0,"name":"offset","required":false,"type":"integer"},{"default":20,"description":"Maximum elements to retrieve. Default to 20 if not specified.","format":"int32","in":"query","maxLength":0,"minLength":0,"name":"limit","required":false,"type":"integer"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Responses.EntityUri[System.Int64]]"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"List of all the retargeting scripts associated to the user","tags":["Retargeting"]},"post":{"consumes":["application/json","text/json","application/xml","text/xml","application/x-www-form-urlencoded"],"deprecated":false,"parameters":[{"description":"The body of the retargeting script","in":"body","name":"value","required":true,"schema":{"$ref":"#/definitions/Api.Core.Dto.Retargeting.RetargetingScript"}}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntityUri[System.Int64]"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Creates a retargeting script","tags":["Retargeting"]}},"/retargeting/count":{"get":{"consumes":[],"deprecated":false,"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.CountResponce"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve count of retargeting scripts","tags":["Retargeting"]}},"/retargeting/{id}":{"delete":{"consumes":[],"deprecated":false,"parameters":[{"description":"The id of the retargeting script","format":"int64","in":"path","name":"id","required":true,"type":"integer"}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntityUri[System.Int64]"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Deletes a retargeting script (and remove associations)","tags":["Retargeting"]},"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"The id of the retargeting script","format":"int64","in":"path","name":"id","required":true,"type":"integer"}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.Retargeting.RetargetingScript"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Get a retargeting script object","tags":["Retargeting"]},"post":{"consumes":["application/json","text/json","application/xml","text/xml","application/x-www-form-urlencoded"],"deprecated":false,"parameters":[{"description":"The id of the retargeting script","format":"int64","in":"path","name":"id","required":true,"type":"integer"},{"description":"The body of the retargeting script","in":"body","name":"value","required":true,"schema":{"$ref":"#/definitions/Api.Core.Dto.Retargeting.RetargetingScript"}}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntityUri[System.Int64]"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Updates a retargeting script","tags":["Retargeting"]}},"/retargeting/{id}/datapoints":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of the retargeting script","format":"int64","in":"path","name":"id","required":true,"type":"integer"},{"default":0,"description":"Where to start when retrieving elements. Default is 0 if not specified.","format":"int32","in":"query","minLength":0,"name":"offset","required":false,"type":"integer"},{"default":20,"description":"Maximum elements to retrieve. Default to 20 if not specified.","format":"int32","in":"query","maxLength":0,"minLength":0,"name":"limit","required":false,"type":"integer"},{"description":"Status of the datapoint","enum":["deleted","active","paused","spam"],"in":"query","name":"status","required":false,"type":"string"},{"description":"A comma separated list of tags you want to filter with.","in":"query","name":"tags","required":false,"type":"string"},{"description":"Filter fields by this pattern","in":"query","name":"textSearch","required":false,"type":"string"},{"description":"Filter fields by favourite status","in":"query","name":"onlyFavorites","required":false,"type":"boolean"},{"description":"Field to sort by","in":"query","name":"sortBy","required":false,"type":"string"},{"description":"Direction of sort \"asc\" or \"desc\"","enum":["asc","desc"],"in":"query","name":"sortDirection","required":false,"type":"string"},{"description":"Exclude datapoints created before this date (YYYYMMDD)","in":"query","name":"createdAfter","required":false,"type":"string"},{"description":"Exclude datapoints created after this date (YYYYMMDD)","in":"query","name":"createdBefore","required":false,"type":"string"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Responses.EntityUri[System.Int64]]"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"List of all the datapoints associated to the retargeting script.","tags":["Retargeting"]}},"/retargeting/{id}/datapoints/count":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of the group","format":"int64","in":"path","name":"id","required":true,"type":"integer"},{"description":"Status of the datapoint","enum":["deleted","active","paused","spam"],"in":"query","name":"status","required":false,"type":"string"},{"description":"A comma separated list of tags you want to filter with.","in":"query","name":"tags","required":false,"type":"string"},{"description":"Filter fields by this pattern","in":"query","name":"textSearch","required":false,"type":"string"},{"description":"Filter fields by favourite status","in":"query","name":"onlyFavorites","required":false,"type":"boolean"},{"description":"Exclude datapoints created before this date (YYYYMMDD)","in":"query","name":"createdAfter","required":false,"type":"string"},{"description":"Exclude datapoints created after this date (YYYYMMDD)","in":"query","name":"createdBefore","required":false,"type":"string"}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.CountResponce"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Count the datapoints associated to the retargeting script.","tags":["Retargeting"]}},"/tags":{"get":{"consumes":[],"deprecated":false,"parameters":[{"default":0,"description":"Where to start when retrieving elements. Default is 0 if not specified.","format":"int32","in":"query","minLength":0,"name":"offset","required":false,"type":"integer"},{"default":20,"description":"Maximum elements to retrieve. Default to 20 if not specified.","format":"int32","in":"query","maxLength":0,"minLength":0,"name":"limit","required":false,"type":"integer"},{"description":"Name of the tag","in":"query","name":"name","required":false,"type":"string"},{"description":"Comma separated list of datapoints id to filter by","in":"query","name":"datapoints","required":false,"type":"string"},{"description":"Comma separated list of groups id to filter by","in":"query","name":"groups","required":false,"type":"string"},{"description":"Type of entity related to the tag","enum":["tp","tl","dp","gr"],"in":"query","name":"type","required":false,"type":"string"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Responses.EntityUri[System.Int64]]"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"List of all the groups associated to the user filtered by this tag.","tags":["Tags"]},"post":{"consumes":["application/json","text/json","application/x-www-form-urlencoded"],"deprecated":false,"parameters":[{"description":"The body of the tag","in":"body","name":"value","required":true,"schema":{"$ref":"#/definitions/Api.Core.Dto.Tags.Tag"}}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntityUri[System.Int64]"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Create a tag","tags":["Tags"]}},"/tags/count":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Name of the tag","in":"query","name":"name","required":false,"type":"string"},{"description":"Comma separated list of datapoints id to filter by","in":"query","name":"datapoints","required":false,"type":"string"},{"description":"Comma separated list of groups id to filter by","in":"query","name":"groups","required":false,"type":"string"},{"description":"Type of entity related to the tag","enum":["tp","tl","dp","gr"],"in":"query","name":"type","required":false,"type":"string"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/System.Object"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"List of all the groups associated to the user filtered by this tag.","tags":["Tags"]}},"/tags/{tagId}":{"delete":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of the tag","format":"int64","in":"path","name":"tagId","required":true,"type":"integer"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/System.Object"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Delete a tag","tags":["Tags"]},"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of the tag","format":"int64","in":"path","name":"tagId","required":true,"type":"integer"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Dto.Tags.Tag"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Retrieve a tag","tags":["Tags"]}},"/tags/{tagId}/datapoints":{"delete":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of the tag","format":"int64","in":"path","name":"tagId","required":true,"type":"integer"}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntityUri[System.Int64]"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Delete the association of this tag with all datapoints","tags":["Tags"]},"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of the tag.","format":"int64","in":"path","name":"tagId","required":true,"type":"integer"},{"default":0,"description":"Where to start when retrieving elements. Default is 0 if not specified.","format":"int32","in":"query","minLength":0,"name":"offset","required":false,"type":"integer"},{"default":20,"description":"Maximum elements to retrieve. Default to 20 if not specified.","format":"int32","in":"query","maxLength":0,"minLength":0,"name":"limit","required":false,"type":"integer"},{"description":"Type of the datapoint (\"tp\"/\"tl\")","enum":["tp","tl"],"in":"query","name":"type","required":false,"type":"string"},{"description":"Status of the datapoint","enum":["deleted","active","paused","spam"],"in":"query","name":"status","required":false,"type":"string"},{"description":"Filter fields by this pattern","in":"query","name":"textSearch","required":false,"type":"string"},{"description":"Exclude datapoints created before this date (YYYYMMDD)","in":"query","name":"createdAfter","required":false,"type":"string"},{"description":"Exclude datapoints created after this date (YYYYMMDD)","in":"query","name":"createdBefore","required":false,"type":"string"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Responses.EntityUri[System.Int64]]"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"List of all the datapoints associated to the user filtered by this tag","tags":["Tags"]}},"/tags/{tagId}/datapoints/count":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of the tag.","format":"int64","in":"path","name":"tagId","required":true,"type":"integer"},{"description":"Type of the datapoint (\"tp\"/\"tl\")","enum":["tp","tl"],"in":"query","name":"type","required":false,"type":"string"},{"description":"Status of the datapoint","enum":["deleted","active","paused","spam"],"in":"query","name":"status","required":false,"type":"string"},{"description":"Filter fields by this pattern","in":"query","name":"textSearch","required":false,"type":"string"},{"description":"Exclude datapoints created before this date (YYYYMMDD)","in":"query","name":"createdAfter","required":false,"type":"string"},{"description":"Exclude datapoints created after this date (YYYYMMDD)","in":"query","name":"createdBefore","required":false,"type":"string"}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.CountResponce"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Count the datapoints associated to the user filtered by this tag","tags":["Tags"]}},"/tags/{tagId}/datapoints/patch":{"put":{"consumes":["application/json","text/json","application/xml","text/xml","application/x-www-form-urlencoded"],"deprecated":false,"parameters":[{"description":"Id of the tag","format":"int64","in":"path","name":"tagId","required":true,"type":"integer"},{"description":"The body patch","in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/Api.Core.Requests.PatchBody"}}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntityUri[System.Int64]"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Associate/Deassociate a tag with a datapoint","tags":["Tags"]}},"/tags/{tagId}/groups":{"delete":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of the tag","format":"int64","in":"path","name":"tagId","required":true,"type":"integer"}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntityUri[System.Int64]"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Delete the association of this tag with all groups","tags":["Tags"]},"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of the tag.","format":"int64","in":"path","name":"tagId","required":true,"type":"integer"},{"default":0,"description":"Where to start when retrieving elements. Default is 0 if not specified.","format":"int32","in":"query","minLength":0,"name":"offset","required":false,"type":"integer"},{"default":20,"description":"Maximum elements to retrieve. Default to 20 if not specified.","format":"int32","in":"query","maxLength":0,"minLength":0,"name":"limit","required":false,"type":"integer"},{"description":"Status of the datapoint","enum":["deleted","active"],"in":"query","name":"status","required":false,"type":"string"},{"description":"Filter fields by this pattern","in":"query","name":"textSearch","required":false,"type":"string"},{"description":"Exclude groups created before this date (YYYYMMDD)","in":"query","name":"createdAfter","required":false,"type":"string"},{"description":"Exclude groups created after this date (YYYYMMDD)","in":"query","name":"createdBefore","required":false,"type":"string"}],"produces":["application/json","text/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Responses.EntityUri[System.Int64]]"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"List of all the groups associated to the user filtered by this tag.","tags":["Tags"]}},"/tags/{tagId}/groups/count":{"get":{"consumes":[],"deprecated":false,"parameters":[{"description":"Id of the tag.","format":"int64","in":"path","name":"tagId","required":true,"type":"integer"},{"description":"Status of the datapoint","enum":["deleted","active"],"in":"query","name":"status","required":false,"type":"string"},{"description":"Filter fields by this pattern","in":"query","name":"textSearch","required":false,"type":"string"},{"description":"Exclude groups created before this date (YYYYMMDD)","in":"query","name":"createdAfter","required":false,"type":"string"},{"description":"Exclude groups created after this date (YYYYMMDD)","in":"query","name":"createdBefore","required":false,"type":"string"}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.CountResponce"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Count the groups associated to the user filtered by this tag","tags":["Tags"]}},"/tags/{tagId}/groups/patch":{"put":{"consumes":["application/json","text/json","application/xml","text/xml","application/x-www-form-urlencoded"],"deprecated":false,"parameters":[{"description":"Id of the tag","format":"int64","in":"path","name":"tagId","required":true,"type":"integer"},{"description":"The body patch","in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/Api.Core.Requests.PatchBody"}}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntityUri[System.Int64]"}},"401":{"description":"Unauthorized"},"404":{"description":"Not found"},"500":{"description":"Internal Server Error"}},"summary":"Associate/Deassociate a tag with a group","tags":["Tags"]}},"/tags/{tagId}/name":{"put":{"consumes":["application/json","text/json","application/xml","text/xml","application/x-www-form-urlencoded"],"deprecated":false,"parameters":[{"description":"Id of the tag","format":"int64","in":"path","name":"tagId","required":true,"type":"integer"},{"description":"The body patch","in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/Api.Core.Requests.GenericTextPatch"}}],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Api.Core.Responses.EntityUri[System.Int64]"}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}},"summary":"Fast patch a tag name","tags":["Tags"]}}},"definitions":{"Api.Core.Dto.Accounting.ConversionOptions":{"properties":{"hideComCost":{"type":"boolean"},"hideCost":{"type":"boolean"},"hideCount":{"type":"boolean"},"hideParams":{"type":"boolean"},"hideValue":{"type":"boolean"},"percentCommission":{"format":"int32","type":"integer"},"percentValue":{"format":"int32","type":"integer"}},"type":"object"},"Api.Core.Dto.Accounting.DomainWhitelistEntry":{"properties":{"id":{"type":"string"},"name":{"type":"string"}},"type":"object"},"Api.Core.Dto.Accounting.ExtendedGrants":{"properties":{"allowAllGrants":{"type":"boolean"},"allowGroupCreation":{"type":"boolean"}},"type":"object"},"Api.Core.Dto.Accounting.Guest":{"properties":{"apiKey":{"type":"string"},"conversionOptions":{"$ref":"#/definitions/Api.Core.Dto.Accounting.ConversionOptions"},"creationDate":{"description":" (A date in \"YmdHis\" format)","example":"20120203120530","type":"string"},"currentGrant":{"$ref":"#/definitions/Api.Core.Dto.Grants.Grant"},"dateFormat":{"type":"string"},"decimalSeparator":{"type":"string"},"email":{"type":"string"},"extendedGrants":{"$ref":"#/definitions/Api.Core.Dto.Accounting.ExtendedGrants"},"groupGrants":{"format":"int64","type":"integer"},"hitOptions":{"$ref":"#/definitions/Api.Core.Dto.Accounting.HitOptions"},"id":{"format":"int64","type":"integer"},"key":{"type":"string"},"language":{"type":"string"},"loginCount":{"format":"int32","type":"integer"},"name":{"type":"string"},"notes":{"type":"string"},"numberGroupSeparator":{"type":"string"},"password":{"type":"string"},"timeFormat":{"enum":["AmPm","H24"],"type":"string"},"timeZone":{"format":"int32","type":"integer"},"timeframeMinDate":{"description":" (A date in \"YmdHis\" format)","example":"20120203120530","type":"string"},"timezonename":{"type":"string"},"tlGrants":{"format":"int64","type":"integer"},"tpGrants":{"format":"int64","type":"integer"},"userName":{"type":"string"}},"type":"object"},"Api.Core.Dto.Accounting.HitOptions":{"properties":{"hideReferrer":{"type":"boolean"}},"type":"object"},"Api.Core.Dto.Accounting.IpBlacklistEntry":{"properties":{"id":{"type":"string"},"ip":{"type":"string"}},"type":"object"},"Api.Core.Dto.Accounting.Plan":{"properties":{"allowedPersonalDomains":{"format":"int32","type":"integer"},"allowedPersonalUrls":{"format":"int32","type":"integer"},"billingPeriodEnd":{"description":" (A date in \"YmdHis\" format)","example":"20120203120530","type":"string"},"billingPeriodStart":{"description":" (A date in \"YmdHis\" format)","example":"20120203120530","type":"string"},"bonusMonthlyEvents":{"format":"int64","type":"integer"},"maximumDatapoints":{"format":"int64","type":"integer"},"maximumGuests":{"format":"int64","type":"integer"},"monthlyEvents":{"format":"int64","type":"integer"},"name":{"type":"string"},"price":{"format":"double","type":"number"},"profileId":{"format":"int64","type":"integer"},"recurring":{"type":"boolean"},"recurringPeriod":{"format":"int32","type":"integer"},"usedDatapoints":{"format":"int64","type":"integer"},"usedMonthlyEvents":{"format":"int64","type":"integer"}},"type":"object"},"Api.Core.Dto.Accounting.User":{"properties":{"boGoVal":{"type":"string"},"bonusClicks":{"format":"int64","type":"integer"},"companyName":{"type":"string"},"companyRole":{"type":"string"},"email":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"phone":{"type":"string"},"redirectOnly":{"type":"boolean"},"registrationDate":{"description":" (A date in \"YmdHis\" format)","example":"20120203120530","type":"string"},"timeframeMinDate":{"description":" (A date in \"YmdHis\" format)","example":"20120203120530","type":"string"},"timezone":{"format":"int32","type":"integer"},"timezonename":{"type":"string"}},"type":"object"},"Api.Core.Dto.Aggregated.AggregatedResult":{"properties":{"activityDay":{"description":" (A date in \"YmdHis\" format)","example":"20120203120530","type":"string"},"commissionsCost":{"format":"double","type":"number"},"conversionsCost":{"format":"double","type":"number"},"conversionsValue":{"format":"double","type":"number"},"convertedClicks":{"format":"int64","type":"integer"},"entityData":{"$ref":"#/definitions/System.Object"},"entityId":{"type":"string"},"fromDay":{"description":" (A date in \"YmdHis\" format)","example":"20120203120530","type":"string"},"hourlyBreakDown":{"additionalProperties":{"$ref":"#/definitions/Api.Core.Dto.Aggregated.AggregatedResult"},"type":"object"},"lastHitDate":{"description":" (A date in \"YmdHis\" format)","example":"20120203120530","type":"string"},"spiderHitsCount":{"format":"int64","type":"integer"},"toDay":{"description":" (A date in \"YmdHis\" format)","example":"20120203120530","type":"string"},"totalClicks":{"format":"int64","type":"integer"},"totalViews":{"format":"int64","type":"integer"},"uniqueClicks":{"format":"int64","type":"integer"},"uniqueConversions":{"format":"int64","type":"integer"},"uniqueViews":{"format":"int64","type":"integer"}},"type":"object"},"Api.Core.Dto.Aggregated.AggregatedSummaryResult":{"properties":{"count":{"format":"int64","type":"integer"},"limit":{"format":"int32","type":"integer"},"offset":{"format":"int64","type":"integer"},"result":{"items":{"$ref":"#/definitions/Api.Core.Dto.Aggregated.AggregatedResult"},"type":"array"}},"type":"object"},"Api.Core.Dto.ClickStream.Hit":{"properties":{"accessTime":{"description":" (A date in \"YmdHis\" format)","example":"20120203120530","type":"string"},"browser":{"$ref":"#/definitions/Api.Core.Dto.ClickStream.HitBrowserInfo"},"clientLanguage":{"type":"string"},"conversion1":{"$ref":"#/definitions/Api.Core.Dto.ClickStream.HitConversionInfo"},"conversion2":{"$ref":"#/definitions/Api.Core.Dto.ClickStream.HitConversionInfo"},"conversion3":{"$ref":"#/definitions/Api.Core.Dto.ClickStream.HitConversionInfo"},"conversion4":{"$ref":"#/definitions/Api.Core.Dto.ClickStream.HitConversionInfo"},"conversion5":{"$ref":"#/definitions/Api.Core.Dto.ClickStream.HitConversionInfo"},"conversions":{"items":{"$ref":"#/definitions/Api.Core.Dto.ClickStream.HitConversionInfo"},"type":"array"},"entity":{"$ref":"#/definitions/Api.Core.Dto.ClickStream.HitDatapointInfo"},"ip":{"type":"string"},"isProxy":{"type":"string"},"isSpider":{"type":"string"},"isUnique":{"type":"string"},"location":{"$ref":"#/definitions/Api.Core.Dto.ClickStream.HitLocationInfo"},"org":{"type":"string"},"os":{"$ref":"#/definitions/Api.Core.Dto.ClickStream.HitOsInfo"},"queryParams":{"type":"string"},"realDestinationUrl":{"type":"string"},"referer":{"type":"string"},"source":{"$ref":"#/definitions/Api.Core.Dto.ClickStream.HitSource"},"type":{"type":"string"}},"type":"object"},"Api.Core.Dto.ClickStream.HitBrowserInfo":{"properties":{"browserType":{"type":"string"},"familyId":{"format":"int64","type":"integer"},"familyName":{"type":"string"},"id":{"format":"int64","type":"integer"},"name":{"type":"string"}},"type":"object"},"Api.Core.Dto.ClickStream.HitConversionInfo":{"properties":{"accessTime":{"description":" (A date in \"YmdHis\" format)","example":"20120203120530","type":"string"},"comcost":{"format":"double","type":"number"},"cost":{"format":"double","type":"number"},"date":{"description":" (A date in \"YmdHis\" format)","example":"20120203120530","type":"string"},"deleted":{"type":"boolean"},"id":{"format":"int64","type":"integer"},"name":{"type":"string"},"parameter":{"type":"string"},"value":{"format":"double","type":"number"}},"type":"object"},"Api.Core.Dto.ClickStream.HitDatapointInfo":{"properties":{"creationDate":{"description":" (A date in \"YmdHis\" format)","example":"20120203120530","type":"string"},"datapointFavourite":{"type":"boolean"},"datapointId":{"format":"int64","type":"integer"},"datapointName":{"type":"string"},"datapointTitle":{"type":"string"},"datapointType":{"type":"string"},"destinationUrl":{"type":"string"},"groupId":{"format":"int64","type":"integer"},"groupName":{"type":"string"},"isABTest":{"type":"boolean"},"isPrivateShared":{"type":"boolean"},"isPublic":{"type":"boolean"},"notes":{"type":"string"},"status":{"enum":["Active","Paused","Abuse","Deleted"],"type":"string"},"tags":{"items":{"$ref":"#/definitions/Api.Core.Dto.Tags.Tag"},"type":"array"},"trackingCode":{"type":"string"}},"type":"object"},"Api.Core.Dto.ClickStream.HitListPage":{"properties":{"hits":{"items":{"$ref":"#/definitions/Api.Core.Dto.ClickStream.Hit"},"type":"array"},"lastKey":{"type":"string"}},"type":"object"},"Api.Core.Dto.ClickStream.HitLocationInfo":{"properties":{"areacode":{"type":"string"},"city":{"type":"string"},"country":{"type":"string"},"latitude":{"format":"double","type":"number"},"longitude":{"format":"double","type":"number"},"metrocode":{"type":"string"},"organization":{"type":"string"},"postalcode":{"type":"string"},"region":{"type":"string"},"regionName":{"type":"string"}},"type":"object"},"Api.Core.Dto.ClickStream.HitOsInfo":{"properties":{"familyId":{"format":"int64","type":"integer"},"familyName":{"type":"string"},"id":{"format":"int64","type":"integer"},"name":{"type":"string"}},"type":"object"},"Api.Core.Dto.ClickStream.HitSource":{"properties":{"id":{"format":"int64","type":"integer"},"name":{"type":"string"},"param":{"type":"string"}},"type":"object"},"Api.Core.Dto.Conversions.Conversion":{"properties":{"code":{"type":"string"},"creationDate":{"description":" (A date in \"YmdHis\" format)","example":"20120203120530","type":"string"},"deleted":{"type":"boolean"},"description":{"type":"string"},"id":{"format":"int64","type":"integer"},"name":{"type":"string"},"protocol":{"enum":["Http","Https"],"type":"string"},"value":{"format":"double","type":"number"}},"type":"object"},"Api.Core.Dto.Datapoints.BrowserBaseDestinationItem":{"properties":{"emailDestinationUrl":{"type":"string"},"mobileDestinationUrl":{"type":"string"},"spidersDestinationUrl":{"type":"string"}},"type":"object"},"Api.Core.Dto.Datapoints.Datapoint":{"properties":{"creationDate":{"description":" (A date in \"YmdHis\" format)","example":"20120203120530","type":"string"},"encodeIp":{"type":"boolean"},"fifthConversionId":{"format":"int64","type":"integer"},"fifthConversionName":{"type":"string"},"firstConversionId":{"format":"int64","type":"integer"},"firstConversionName":{"type":"string"},"fourthConversionId":{"format":"int64","type":"integer"},"fourthConversionName":{"type":"string"},"groupId":{"format":"int64","type":"integer"},"groupName":{"type":"string"},"id":{"format":"int64","type":"integer"},"isPublic":{"type":"boolean"},"isSecured":{"type":"boolean"},"lightTracking":{"type":"boolean"},"name":{"type":"string"},"notes":{"type":"string"},"preferred":{"type":"boolean"},"redirectOnly":{"type":"boolean"},"secondConversionId":{"format":"int64","type":"integer"},"secondConversionName":{"type":"string"},"status":{"enum":["Active","Paused","Abuse","Deleted"],"type":"string"},"tags":{"items":{"$ref":"#/definitions/Api.Core.Dto.Tags.Tag"},"type":"array"},"thirdConversionId":{"format":"int64","type":"integer"},"thirdConversionName":{"type":"string"},"title":{"type":"string"},"trackingCode":{"type":"string"},"type":{"enum":["TrackingLink","TrackingPixel"],"type":"string"},"typeTL":{"$ref":"#/definitions/Api.Core.Dto.Datapoints.TrackingLinkSpecifics"},"typeTP":{"$ref":"#/definitions/Api.Core.Dto.Datapoints.TrackingPixelSpecifics"},"writePermited":{"type":"boolean"}},"type":"object"},"Api.Core.Dto.Datapoints.DatapointRetargetingInfo":{"properties":{"id":{"format":"int64","type":"integer"},"name":{"type":"string"}},"type":"object"},"Api.Core.Dto.Datapoints.MultipleDestinationItem":{"properties":{"url":{"type":"string"}},"type":"object"},"Api.Core.Dto.Datapoints.TrackingLinkSpecifics":{"properties":{"appendQuery":{"type":"boolean"},"browserDestinationItem":{"$ref":"#/definitions/Api.Core.Dto.Datapoints.BrowserBaseDestinationItem"},"destinationMode":{"enum":["Simple","RandomDestination","DestinationByLanguage","SpilloverDestination","DynamicUrl","BrowserDestination","DestinationByNation","UniqueDestination","SequentialDestination","WeightedDestination"],"type":"string"},"domainId":{"format":"int32","type":"integer"},"encodeUrl":{"type":"boolean"},"expirationClicks":{"format":"int64","type":"integer"},"expirationDate":{"description":" (A date in \"YmdHis\" format)","example":"20120203120530","type":"string"},"firstUrl":{"type":"string"},"goDomainId":{"format":"int32","type":"integer"},"hideUrl":{"type":"boolean"},"hideUrlTitle":{"type":"string"},"isABTest":{"type":"boolean"},"password":{"type":"string"},"pauseAfterClicksExpiration":{"type":"boolean"},"pauseAfterDateExpiration":{"type":"boolean"},"randomDestinationItems":{"items":{"$ref":"#/definitions/Api.Core.Dto.Datapoints.MultipleDestinationItem"},"type":"array"},"redirectType":{"enum":["PermanentRedirect","TemporaryRedirect"],"type":"string"},"referrerClean":{"enum":["None","Clean","Myself"],"type":"string"},"scripts":{"items":{"$ref":"#/definitions/Api.Core.Dto.Datapoints.DatapointRetargetingInfo"},"type":"array"},"sequentialDestinationItems":{"items":{"$ref":"#/definitions/Api.Core.Dto.Datapoints.MultipleDestinationItem"},"type":"array"},"spilloverDestinationItems":{"items":{"$ref":"#/definitions/Api.Core.Dto.Datapoints.MultipleDestinationItem"},"type":"array"},"uniqueDestinationItem":{"$ref":"#/definitions/Api.Core.Dto.Datapoints.UniqueDestinationItem"},"url":{"type":"string"},"urlAfterClicksExpiration":{"type":"string"},"urlAfterDateExpiration":{"type":"string"},"urlsByLanguage":{"items":{"$ref":"#/definitions/Api.Core.Dto.Datapoints.UrlByLanguageItem"},"type":"array"},"urlsByNation":{"items":{"$ref":"#/definitions/Api.Core.Dto.Datapoints.UrlByNationItem"},"type":"array"},"weightedDestinationItems":{"items":{"$ref":"#/definitions/Api.Core.Dto.Datapoints.WeightedDestinationItem"},"type":"array"}},"type":"object"},"Api.Core.Dto.Datapoints.TrackingPixelSpecifics":{"properties":{"parameterNote":{"type":"string"}},"type":"object"},"Api.Core.Dto.Datapoints.UniqueDestinationItem":{"properties":{"firstDestinationUrl":{"type":"string"}},"type":"object"},"Api.Core.Dto.Datapoints.UrlByLanguageItem":{"properties":{"languageCode":{"type":"string"},"url":{"type":"string"}},"type":"object"},"Api.Core.Dto.Datapoints.UrlByNationItem":{"properties":{"nation":{"type":"string"},"url":{"type":"string"}},"type":"object"},"Api.Core.Dto.Datapoints.WeightedDestinationItem":{"properties":{"url":{"type":"string"},"weight":{"format":"int32","type":"integer"}},"type":"object"},"Api.Core.Dto.Domains.Domain":{"properties":{"custom404":{"type":"string"},"customHomepage":{"type":"string"},"id":{"format":"int64","type":"integer"},"name":{"type":"string"},"type":{"enum":["System","Go","Dedicated","Personal"],"type":"string"}},"type":"object"},"Api.Core.Dto.EntityUriLong":{"properties":{"id":{"format":"int64","type":"integer"},"uri":{"type":"string"}},"type":"object"},"Api.Core.Dto.Grants.Grant":{"properties":{"DatapointType":{"type":"string"},"Entity":{"$ref":"#/definitions/Api.Core.Responses.EntityUri[System.Int64]"},"EntityName":{"type":"string"},"EntityType":{"type":"string"},"Type":{"type":"string"}},"type":"object"},"Api.Core.Dto.Groups.Group":{"properties":{"creationDate":{"description":" (A date in \"YmdHis\" format)","example":"20120203120530","type":"string"},"deleted":{"type":"boolean"},"id":{"format":"int64","type":"integer"},"isPublic":{"type":"boolean"},"name":{"type":"string"},"notes":{"type":"string"},"preferred":{"type":"boolean"},"redirectOnly":{"type":"boolean"},"tags":{"items":{"$ref":"#/definitions/Api.Core.Dto.Tags.Tag"},"type":"array"},"writePermited":{"type":"boolean"}},"type":"object"},"Api.Core.Dto.Retargeting.RetargetingScript":{"properties":{"id":{"format":"int64","type":"integer"},"name":{"type":"string"},"script":{"type":"string"}},"type":"object"},"Api.Core.Dto.Tags.Tag":{"properties":{"datapoints":{"items":{"format":"int64","type":"integer"},"type":"array"},"groups":{"items":{"format":"int64","type":"integer"},"type":"array"},"id":{"format":"int64","type":"integer"},"name":{"type":"string"}},"type":"object"},"Api.Core.Dto.Tops.Top":{"properties":{"createdAt":{"description":" (A date in \"YmdHis\" format)","example":"20120203120530","type":"string"},"data":{"items":{"$ref":"#/definitions/Api.Core.Dto.Tops.TopItem"},"type":"array"},"key":{"type":"string"}},"type":"object"},"Api.Core.Dto.Tops.TopItem":{"properties":{"entityData":{"$ref":"#/definitions/System.Object"},"id":{"type":"string"},"lastHitDate":{"description":" (A date in \"YmdHis\" format)","example":"20120203120530","type":"string"},"spiderClicks":{"format":"int64","type":"integer"},"spiderHits":{"format":"int64","type":"integer"},"spiderViews":{"format":"int64","type":"integer"},"totalClicks":{"format":"int64","type":"integer"},"totalCommissionsCost":{"format":"double","type":"number"},"totalConversions":{"format":"int64","type":"integer"},"totalConversionsCost":{"format":"double","type":"number"},"totalConversionsValue":{"format":"double","type":"number"},"totalHits":{"format":"int64","type":"integer"},"totalViews":{"format":"int64","type":"integer"},"uniqueClicks":{"format":"int64","type":"integer"},"uniqueHits":{"format":"int64","type":"integer"},"uniqueViews":{"format":"int64","type":"integer"}},"type":"object"},"Api.Core.Requests.ConversionPatchBody":{"properties":{"Action":{"type":"string"},"Id":{"format":"int64","type":"integer"},"ReplaceId":{"format":"int64","type":"integer"}},"type":"object"},"Api.Core.Requests.DatapointsBatch":{"properties":{"List":{"items":{"$ref":"#/definitions/Api.Core.Dto.Datapoints.Datapoint"},"type":"array"}},"type":"object"},"Api.Core.Requests.DeleteBatch":{"properties":{"Entities":{"items":{"$ref":"#/definitions/Api.Core.Dto.EntityUriLong"},"type":"array"}},"type":"object"},"Api.Core.Requests.GenericTextPatch":{"properties":{"Text":{"type":"string"}},"type":"object"},"Api.Core.Requests.PatchBody":{"properties":{"Action":{"type":"string"},"Id":{"format":"int64","type":"integer"}},"type":"object"},"Api.Core.Requests.PatchBodyBatch":{"properties":{"PatchRequests":{"items":{"$ref":"#/definitions/Api.Core.Requests.PatchBody"},"type":"array"}},"type":"object"},"Api.Core.Requests.PermissionPatchRequest":{"properties":{"Action":{"type":"string"},"Id":{"format":"int64","type":"integer"},"Verb":{"type":"string"}},"type":"object"},"Api.Core.Responses.CountResponce":{"properties":{"count":{"format":"int64","type":"integer"}},"type":"object"},"Api.Core.Responses.EntitiesResponse[Api.Core.Dto.Accounting.DomainWhitelistEntry]":{"properties":{"entities":{"items":{"$ref":"#/definitions/Api.Core.Dto.Accounting.DomainWhitelistEntry"},"type":"array"}},"type":"object"},"Api.Core.Responses.EntitiesResponse[Api.Core.Dto.Accounting.IpBlacklistEntry]":{"properties":{"entities":{"items":{"$ref":"#/definitions/Api.Core.Dto.Accounting.IpBlacklistEntry"},"type":"array"}},"type":"object"},"Api.Core.Responses.EntitiesResponse[Api.Core.Dto.Aggregated.AggregatedResult]":{"properties":{"entities":{"items":{"$ref":"#/definitions/Api.Core.Dto.Aggregated.AggregatedResult"},"type":"array"}},"type":"object"},"Api.Core.Responses.EntitiesResponse[Api.Core.Dto.ClickStream.Hit]":{"properties":{"entities":{"items":{"$ref":"#/definitions/Api.Core.Dto.ClickStream.Hit"},"type":"array"}},"type":"object"},"Api.Core.Responses.EntitiesResponse[Api.Core.Dto.Grants.Grant]":{"properties":{"entities":{"items":{"$ref":"#/definitions/Api.Core.Dto.Grants.Grant"},"type":"array"}},"type":"object"},"Api.Core.Responses.EntitiesResponse[Api.Core.Responses.EntityUri[System.Int64]]":{"properties":{"entities":{"items":{"$ref":"#/definitions/Api.Core.Responses.EntityUri[System.Int64]"},"type":"array"}},"type":"object"},"Api.Core.Responses.EntityUri[System.Int64]":{"properties":{"id":{"format":"int64","type":"integer"},"uri":{"type":"string"}},"type":"object"},"Api.Core.Responses.ModifyBatchItemResponce[Api.Core.Dto.Datapoints.Datapoint,System.Int64]":{"properties":{"entityData":{"$ref":"#/definitions/Api.Core.Dto.Datapoints.Datapoint"},"errors":{"items":{"$ref":"#/definitions/ClickMeter.Infrastructure.Validation.ValidationFailure"},"type":"array"},"result":{"$ref":"#/definitions/Api.Core.Responses.EntityUri[System.Int64]"},"status":{"type":"string"}},"type":"object"},"ClickMeter.Infrastructure.Validation.ValidationFailure":{"properties":{"code":{"$ref":"#/definitions/System.Object"},"errorMessage":{"type":"string"},"errorValue":{"$ref":"#/definitions/System.Object"},"property":{"type":"string"}},"type":"object"},"System.Object":{"properties":{},"type":"object"}}} spec-0.21.0/fixtures/expansion/clickmeter.yaml000066400000000000000000005257321457312531500214330ustar00rootroot00000000000000swagger: '2.0' schemes: - http - https host: 'apiv2.clickmeter.com:80' info: contact: email: api@clickmeter.com name: Api Support url: 'http://www.clickmeter.com/api' description: Api dashboard for ClickMeter API title: ClickMeter version: v2 x-logo: url: 'https://s3.amazonaws.com/clickmeter.com/Web/static/cmlogo.svg' x-origin: format: swagger url: 'http://api.v2.clickmeter.com.s3.amazonaws.com/docs/api-docs-v2.json' version: '2.0' x-providerName: clickmeter.com securityDefinitions: api_key: description: API Key Authentication in: header name: X-Clickmeter-AuthKey type: apiKey security: - api_key: [] paths: /account: get: consumes: [] deprecated: false produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.Accounting.User' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve current account data tags: - Account post: consumes: - application/json - text/json - application/xml - text/xml - application/x-www-form-urlencoded deprecated: false parameters: - in: body name: value required: true schema: $ref: '#/definitions/Api.Core.Dto.Accounting.User' produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.Accounting.User' '401': description: Unauthorized '500': description: Internal Server Error summary: Update current account data tags: - Account /account/domainwhitelist: get: consumes: [] deprecated: false parameters: - description: Offset where to start from format: int32 in: query minLength: 0 name: offset required: false type: integer - description: Limit results to this number format: int32 in: query maxLength: 0 minLength: 0 name: limit required: false type: integer produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Dto.Accounting.DomainWhitelistEntry]' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve list of a domains allowed to redirect in DDU mode tags: - Account post: consumes: - application/json - text/json - application/xml - text/xml - application/x-www-form-urlencoded deprecated: false parameters: - description: The entry to add in: body name: value required: true schema: $ref: '#/definitions/Api.Core.Dto.Accounting.DomainWhitelistEntry' produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.Accounting.DomainWhitelistEntry' '401': description: Unauthorized '500': description: Internal Server Error summary: Create an domain entry tags: - Account '/account/domainwhitelist/{whitelistId}': delete: consumes: [] deprecated: false parameters: - description: The id of the domain to delete in: path name: whitelistId required: true type: string produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.Accounting.DomainWhitelistEntry' '401': description: Unauthorized '500': description: Internal Server Error summary: Delete an domain entry tags: - Account /account/guests: get: consumes: [] deprecated: false parameters: - description: Offset where to start from format: int32 in: query minLength: 0 name: offset required: false type: integer - description: Limit results to this number format: int32 in: query maxLength: 0 minLength: 0 name: limit required: false type: integer - description: Field to sort by in: query name: sortBy required: false type: string - description: 'Direction of sort "asc" or "desc"' enum: - asc - desc in: query name: sortDirection required: false type: string - description: Filter fields by this pattern in: query name: textSearch required: false type: string produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Responses.EntityUri[System.Int64]]' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve list of a guest tags: - Account post: consumes: - application/json - text/json - application/xml - text/xml - application/x-www-form-urlencoded deprecated: false parameters: - description: Guest object to create in: body name: value required: true schema: $ref: '#/definitions/Api.Core.Dto.Accounting.Guest' produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.Accounting.Guest' '401': description: Unauthorized '500': description: Internal Server Error summary: Create a guest tags: - Account /account/guests/count: get: consumes: [] deprecated: false parameters: - description: Filter fields by this pattern in: query name: textSearch required: false type: string produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.CountResponce' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve count of guests tags: - Account '/account/guests/{guestId}': delete: consumes: [] deprecated: false parameters: - description: Id of the guest format: int64 in: path name: guestId required: true type: integer produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntityUri[System.Int64]' '401': description: Unauthorized '500': description: Internal Server Error summary: Delete a guest tags: - Account get: consumes: [] deprecated: false parameters: - description: Id of the guest format: int64 in: path name: guestId required: true type: integer produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.Accounting.Guest' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve a guest tags: - Account post: consumes: - application/json - text/json - application/xml - text/xml - application/x-www-form-urlencoded deprecated: false parameters: - description: Id of the guest format: int64 in: path name: guestId required: true type: integer - description: Guest object with field updated in: body name: value required: true schema: $ref: '#/definitions/Api.Core.Dto.Accounting.Guest' produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.Accounting.Guest' '401': description: Unauthorized '500': description: Internal Server Error summary: Update a guest tags: - Account '/account/guests/{guestId}/permissions': get: consumes: [] deprecated: false parameters: - description: Id of the guest format: int64 in: path name: guestId required: true type: integer - description: 'Can be "datapoint" or "group"' enum: - datapoint - group in: query name: entityType required: false type: string - description: Offset where to start from format: int32 in: query minLength: 0 name: offset required: false type: integer - description: Limit results to this number format: int32 in: query maxLength: 0 minLength: 0 name: limit required: false type: integer - description: 'Can be "w" or "r"' enum: - r - w in: query name: type required: false type: string - description: Optional id of the datapoint/group entity to filter by format: int64 in: query name: entityId required: false type: integer produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Dto.Grants.Grant]' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve permissions for a guest tags: - Account '/account/guests/{guestId}/permissions/count': get: consumes: [] deprecated: false parameters: - description: Id of the guest format: int64 in: path name: guestId required: true type: integer - description: 'Can be "datapoint" or "group"' enum: - datapoint - group in: query name: entityType required: false type: string - description: 'Can be "w" or "r"' enum: - r - w in: query name: type required: false type: string - description: Optional id of the datapoint/group entity to filter by format: int64 in: query name: entityId required: false type: integer produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.CountResponce' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve count of the permissions for a guest tags: - Account '/account/guests/{guestId}/{type}/permissions/patch': post: consumes: - application/json - text/json - application/xml - text/xml - application/x-www-form-urlencoded deprecated: false parameters: - description: Id of the guest format: int64 in: path name: guestId required: true type: integer - description: 'Can be "datapoint" or "group"' enum: - datapoint - group in: path name: type required: true type: string - description: The patch permission request in: body name: body required: true schema: $ref: '#/definitions/Api.Core.Requests.PermissionPatchRequest' produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntityUri[System.Int64]' '401': description: Unauthorized '500': description: Internal Server Error summary: Change the permission on a shared object tags: - Account put: consumes: - application/json - text/json - application/xml - text/xml - application/x-www-form-urlencoded deprecated: false parameters: - description: Id of the guest format: int64 in: path name: guestId required: true type: integer - description: 'Can be "datapoint" or "group"' enum: - datapoint - group in: path name: type required: true type: string - description: The patch permission request in: body name: body required: true schema: $ref: '#/definitions/Api.Core.Requests.PermissionPatchRequest' produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntityUri[System.Int64]' '401': description: Unauthorized '500': description: Internal Server Error summary: Change the permission on a shared object tags: - Account /account/ipblacklist: get: consumes: [] deprecated: false parameters: - description: Offset where to start from format: int32 in: query minLength: 0 name: offset required: false type: integer - description: Limit results to this number format: int32 in: query maxLength: 0 minLength: 0 name: limit required: false type: integer produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Dto.Accounting.IpBlacklistEntry]' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve list of a ip to exclude from event tracking tags: - Account post: consumes: - application/json - text/json - application/xml - text/xml - application/x-www-form-urlencoded deprecated: false parameters: - description: The entry to add in: body name: value required: true schema: $ref: '#/definitions/Api.Core.Dto.Accounting.IpBlacklistEntry' produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.Accounting.IpBlacklistEntry' '401': description: Unauthorized '500': description: Internal Server Error summary: Create an ip blacklist entry tags: - Account '/account/ipblacklist/{blacklistId}': delete: consumes: [] deprecated: false parameters: - description: The id of the ip to delete in: path name: blacklistId required: true type: string produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.Accounting.IpBlacklistEntry' '401': description: Unauthorized '500': description: Internal Server Error summary: Delete an ip blacklist entry tags: - Account /account/plan: get: consumes: [] deprecated: false produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.Accounting.Plan' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve current account plan tags: - Account /aggregated: get: consumes: [] deprecated: false parameters: - description: Timeframe of the request. See list at $timeframeList enum: - today - yesterday - last7 - last30 - lastmonth - currentmonth - previousmonth - last90 - last120 - last180 - last12months - lastyear - currentyear - beginning - custom in: query name: timeFrame required: true type: string - description: 'If using a "custom" timeFrame you can specify the starting day (YYYYMMDD)' in: query name: fromDay required: false type: string - description: 'If using a "custom" timeFrame you can specify the ending day (YYYYMMDD)' in: query name: toDay required: false type: string - description: 'If using "yesterday" or "today" timeframe you can ask for the hourly detail' in: query name: hourly required: false type: boolean - description: '' in: query name: onlyFavorites required: false type: string produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.Aggregated.AggregatedResult' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve statistics about this customer for a timeframe tags: - Aggregated /aggregated/list: get: consumes: [] deprecated: false parameters: - description: Timeframe of the request. See list at $timeframeList enum: - today - yesterday - last7 - last30 - lastmonth - currentmonth - previousmonth - last90 - last120 - last180 - last12months - lastyear - currentyear - beginning - custom in: query name: timeFrame required: true type: string - description: 'If using a "custom" timeFrame you can specify the starting day (YYYYMMDD)' in: query name: fromDay required: false type: string - description: 'If using a "custom" timeFrame you can specify the ending day (YYYYMMDD)' in: query name: toDay required: false type: string - description: 'The temporal entity you want to group by ("week"/"month"). If unspecified is "day".' enum: - week - month in: query name: groupBy required: false type: string produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Dto.Aggregated.AggregatedResult]' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve statistics about this customer for a timeframe grouped by some temporal entity (day/week/month) tags: - Aggregated /aggregated/summary/conversions: get: consumes: [] deprecated: false parameters: - description: Timeframe of the request. See list at $timeframeList enum: - today - yesterday - last7 - last30 - lastmonth - currentmonth - previousmonth - last90 - last120 - last180 - last12months - lastyear - currentyear - beginning - custom in: query name: timeFrame required: true type: string - description: 'If using a "custom" timeFrame you can specify the starting day (YYYYMMDD)' in: query name: fromDay required: false type: string - description: 'If using a "custom" timeFrame you can specify the ending day (YYYYMMDD)' in: query name: toDay required: false type: string - description: 'Status of conversion ("deleted"/"active")' enum: - deleted - active in: query name: status required: false type: string - description: Field to sort by in: query name: sortBy required: false type: string - description: 'Direction of sort "asc" or "desc"' enum: - asc - desc in: query name: sortDirection required: false type: string - description: Offset where to start from format: int32 in: query minLength: 0 name: offset required: false type: integer - description: Limit results to this number format: int32 in: query maxLength: 0 minLength: 0 name: limit required: false type: integer - description: Filter fields by this pattern in: query name: textSearch required: false type: string produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.Aggregated.AggregatedSummaryResult' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve statistics about a subset of conversions for a timeframe with conversions data tags: - Aggregated /aggregated/summary/datapoints: get: consumes: [] deprecated: false parameters: - description: Timeframe of the request. See list at $timeframeList enum: - today - yesterday - last7 - last30 - lastmonth - currentmonth - previousmonth - last90 - last120 - last180 - last12months - lastyear - currentyear - beginning - custom in: query name: timeFrame required: true type: string - description: 'Type of datapoint ("tl"/"tp")' enum: - tp - tl in: query name: type required: true type: string - description: 'If using a "custom" timeFrame you can specify the starting day (YYYYMMDD)' in: query name: fromDay required: false type: string - description: 'If using a "custom" timeFrame you can specify the ending day (YYYYMMDD)' in: query name: toDay required: false type: string - description: 'Status of datapoint ("deleted"/"active"/"paused"/"spam")' enum: - deleted - active - paused - spam in: query name: status required: false type: string - description: A comma separated list of tags you want to filter with. in: query name: tag required: false type: string - description: Is the datapoint marked as favourite in: query name: favourite required: false type: boolean - description: Field to sort by in: query name: sortBy required: false type: string - description: 'Direction of sort "asc" or "desc"' enum: - asc - desc in: query name: sortDirection required: false type: string - description: Offset where to start from format: int32 in: query minLength: 0 name: offset required: false type: integer - description: Limit results to this number format: int32 in: query maxLength: 0 minLength: 0 name: limit required: false type: integer - description: Filter by this group id format: int64 in: query name: groupId required: false type: integer - description: Filter fields by this pattern in: query name: textSearch required: false type: string produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.Aggregated.AggregatedSummaryResult' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve statistics about a subset of datapoints for a timeframe with datapoints data tags: - Aggregated /aggregated/summary/groups: get: consumes: [] deprecated: false parameters: - description: Timeframe of the request. See list at $timeframeList enum: - today - yesterday - last7 - last30 - lastmonth - currentmonth - previousmonth - last90 - last120 - last180 - last12months - lastyear - currentyear - beginning - custom in: query name: timeFrame required: true type: string - description: 'If using a "custom" timeFrame you can specify the starting day (YYYYMMDD)' in: query name: fromDay required: false type: string - description: 'If using a "custom" timeFrame you can specify the ending day (YYYYMMDD)' in: query name: toDay required: false type: string - description: 'Status of group ("deleted"/"active")' enum: - deleted - active in: query name: status required: false type: string - description: A comma separated list of tags you want to filter with. in: query name: tag required: false type: string - description: Is the group marked as favourite in: query name: favourite required: false type: boolean - description: Field to sort by in: query name: sortBy required: false type: string - description: 'Direction of sort "asc" or "desc"' enum: - asc - desc in: query name: sortDirection required: false type: string - description: Offset where to start from format: int32 in: query minLength: 0 name: offset required: false type: integer - description: Limit results to this number format: int32 in: query maxLength: 0 minLength: 0 name: limit required: false type: integer - description: Filter fields by this pattern in: query name: textSearch required: false type: string produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.Aggregated.AggregatedSummaryResult' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve statistics about a subset of groups for a timeframe with groups data tags: - Aggregated /clickstream: get: consumes: [] deprecated: false parameters: - description: 'Filter by this group id (mutually exclusive with "datapoint" and "conversion")' format: int64 in: query name: group required: false type: integer - description: 'Filter by this datapoint id (mutually exclusive with "group" and "conversion")' format: int64 in: query name: datapoint required: false type: integer - description: 'Filter by this conversion id (mutually exclusive with "datapoint" and "group")' format: int64 in: query name: conversion required: false type: integer - default: 50 description: Limit results to this number format: int32 in: query name: pageSize required: false type: integer - description: 'Filter event type ("spiders"/"uniques"/"nonuniques"/"conversions")' enum: - '' - spiders - uniques - nonuniques - conversions in: query name: filter required: false type: string produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Dto.ClickStream.Hit]' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve the latest list of events of this account. Limited to last 100. tags: - ClickStream /conversions: get: consumes: [] deprecated: false parameters: - description: Offset where to start from format: int32 in: query minLength: 0 name: offset required: false type: integer - description: Limit results to this number format: int32 in: query maxLength: 0 minLength: 0 name: limit required: false type: integer - description: 'Status of conversion ("deleted"/"active")' enum: - deleted - active in: query name: status required: false type: string - description: Filter fields by this pattern in: query name: textSearch required: false type: string - description: Exclude conversions created before this date (YYYYMMDD) in: query name: createdAfter required: false type: string - description: Exclude conversions created after this date (YYYYMMDD) in: query name: createdBefore required: false type: string produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Responses.EntityUri[System.Int64]]' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve a list of conversions tags: - Conversions post: consumes: - application/json - text/json - application/xml - text/xml - application/x-www-form-urlencoded deprecated: false parameters: - description: The body of the conversion in: body name: value required: true schema: $ref: '#/definitions/Api.Core.Dto.Conversions.Conversion' produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntityUri[System.Int64]' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: Create a conversion tags: - Conversions /conversions/aggregated/list: get: consumes: [] deprecated: false parameters: - description: Timeframe of the request. See list at $timeframeList enum: - today - yesterday - last7 - last30 - lastmonth - currentmonth - previousmonth - last90 - last120 - last180 - last12months - lastyear - currentyear - beginning - custom in: query name: timeFrame required: true type: string - description: 'If using a "custom" timeFrame you can specify the starting day (YYYYMMDD)' in: query name: fromDay required: false type: string - description: 'If using a "custom" timeFrame you can specify the ending day (YYYYMMDD)' in: query name: toDay required: false type: string - description: 'Status of conversion ("deleted"/"active")' enum: - deleted - active in: query name: status required: false type: string - description: 'The temporal entity you want to group by ("week"/"month"). If unspecified is "day".' enum: - week - month in: query name: groupBy required: false type: string produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Dto.Aggregated.AggregatedResult]' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve statistics about this customer for a timeframe related to a subset of conversions grouped by some temporal entity (day/week/month) tags: - Conversions /conversions/count: get: consumes: [] deprecated: false parameters: - description: 'Status of conversion ("deleted"/"active")' enum: - deleted - active in: query name: status required: false type: string - description: Filter fields by this pattern in: query name: textSearch required: false type: string - description: Exclude conversions created before this date (YYYYMMDD) in: query name: createdAfter required: false type: string - description: Exclude conversions created after this date (YYYYMMDD) in: query name: createdBefore required: false type: string produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.CountResponce' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve a count of conversions tags: - Conversions '/conversions/{conversionId}': delete: consumes: [] deprecated: false parameters: - description: Id of the conversion format: int64 in: path name: conversionId required: true type: integer produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntityUri[System.Int64]' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: Delete conversion specified by id tags: - Conversions get: consumes: [] deprecated: false parameters: - description: Id of the conversion format: int64 in: path name: conversionId required: true type: integer produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.Conversions.Conversion' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: Retrieve conversion specified by id tags: - Conversions post: consumes: - application/json - text/json - application/xml - text/xml - application/x-www-form-urlencoded deprecated: false parameters: - description: Id of the conversion format: int64 in: path name: conversionId required: true type: integer - description: Updated body of the conversion in: body name: value required: true schema: $ref: '#/definitions/Api.Core.Dto.Conversions.Conversion' produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntityUri[System.Int64]' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: Update conversion specified by id tags: - Conversions '/conversions/{conversionId}/aggregated': get: consumes: [] deprecated: false parameters: - description: Id of the conversion format: int64 in: path name: conversionId required: true type: integer - description: Timeframe of the request. See list at $timeframeList enum: - today - yesterday - last7 - last30 - lastmonth - currentmonth - previousmonth - last90 - last120 - last180 - last12months - lastyear - currentyear - beginning - custom in: query name: timeFrame required: true type: string - description: 'If using a "custom" timeFrame you can specify the starting day (YYYYMMDD)' in: query name: fromDay required: false type: string - description: 'If using a "custom" timeFrame you can specify the ending day (YYYYMMDD)' in: query name: toDay required: false type: string - description: Filter by this tag name in: query name: tag required: false type: string - description: Is the datapoint marked as favourite in: query name: favourite required: false type: boolean - description: 'If using "yesterday" or "today" timeframe you can ask for the hourly detail' in: query name: hourly required: false type: boolean produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.Aggregated.AggregatedResult' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve statistics about this conversion for a timeframe tags: - Conversions '/conversions/{conversionId}/aggregated/list': get: consumes: [] deprecated: false parameters: - description: Id of the conversion format: int64 in: path name: conversionId required: true type: integer - description: Timeframe of the request. See list at $timeframeList enum: - today - yesterday - last7 - last30 - lastmonth - currentmonth - previousmonth - last90 - last120 - last180 - last12months - lastyear - currentyear - beginning - custom in: query name: timeFrame required: true type: string - description: 'If using a "custom" timeFrame you can specify the starting day (YYYYMMDD)' in: query name: fromDay required: false type: string - description: 'If using a "custom" timeFrame you can specify the ending day (YYYYMMDD)' in: query name: toDay required: false type: string - description: 'The temporal entity you want to group by ("week"/"month"). If unspecified is "day".' enum: - week - month in: query name: groupBy required: false type: string produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Dto.Aggregated.AggregatedResult]' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve statistics about this conversion for a timeframe grouped by some temporal entity (day/week/month) tags: - Conversions '/conversions/{conversionId}/datapoints': get: consumes: [] deprecated: false parameters: - description: Id of the conversion format: int64 in: path name: conversionId required: true type: integer - description: Offset where to start from format: int32 in: query minLength: 0 name: offset required: false type: integer - description: Limit results to this number format: int32 in: query maxLength: 0 minLength: 0 name: limit required: false type: integer - description: 'Type of datapoint ("tl"/"tp")' enum: - tp - tl in: query name: type required: false type: string - description: 'Status of datapoint ("deleted"/"active"/"paused"/"spam")' enum: - deleted - active - paused - spam in: query name: status required: false type: string - description: Filter by this tag name in: query name: tags required: false type: string - description: Filter fields by this pattern in: query name: textSearch required: false type: string - description: Exclude datapoints created before this date (YYYYMMDD) in: query name: createdAfter required: false type: string - description: Exclude datapoints created after this date (YYYYMMDD) in: query name: createdBefore required: false type: string produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Responses.EntityUri[System.Int64]]' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve a list of datapoints connected to this conversion tags: - Conversions '/conversions/{conversionId}/datapoints/batch/patch': put: consumes: - application/json - text/json - application/x-www-form-urlencoded deprecated: false parameters: - description: Id of the conversion format: int64 in: path name: conversionId required: true type: integer - description: Patch requests in: body name: data required: true schema: $ref: '#/definitions/Api.Core.Requests.PatchBodyBatch' produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntityUri[System.Int64]' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: Modify the association between a conversion and multiple datapoints tags: - Conversions '/conversions/{conversionId}/datapoints/count': get: consumes: [] deprecated: false parameters: - description: Id of the conversion format: int64 in: path name: conversionId required: true type: integer - description: 'Type of datapoint ("tl"/"tp")' in: query name: type required: false type: string - description: 'Status of datapoint ("deleted"/"active"/"paused"/"spam")' in: query name: status required: false type: string - description: Filter by this tag name in: query name: tags required: false type: string - description: Filter fields by this pattern in: query name: textSearch required: false type: string - description: Exclude datapoints created before this date (YYYYMMDD) in: query name: createdAfter required: false type: string - description: Exclude datapoints created after this date (YYYYMMDD) in: query name: createdBefore required: false type: string produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.CountResponce' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve a count of datapoints connected to this conversion tags: - Conversions '/conversions/{conversionId}/datapoints/patch': put: consumes: - application/json - text/json - application/xml - text/xml - application/x-www-form-urlencoded deprecated: false parameters: - description: Id of the conversion format: int64 in: path name: conversionId required: true type: integer - description: Patch request in: body name: data required: true schema: $ref: '#/definitions/Api.Core.Requests.ConversionPatchBody' produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntityUri[System.Int64]' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: Modify the association between a conversion and a datapoint tags: - Conversions '/conversions/{conversionId}/hits': get: consumes: [] deprecated: false parameters: - description: Id of the conversion format: int64 in: path name: conversionId required: true type: integer - description: Timeframe of the request. See list at $timeframeList enum: - yesterday - last7 - last30 - lastmonth - currentmonth - previousmonth - last90 - last120 - last180 - custom in: query name: timeframe required: true type: string - description: Limit results to this number format: int32 in: query maxLength: 0 minLength: 0 name: limit required: false type: integer - description: "Offset where to start from (it's the lastKey field in the response object)" in: query name: offset required: false type: string - description: 'If using a "custom" timeFrame you can specify the starting day (YYYYMMDD)' in: query name: fromDay required: false type: string - description: 'If using a "custom" timeFrame you can specify the ending day (YYYYMMDD)' in: query name: toDay required: false type: string - description: 'Filter event type ("spiders"/"uniques"/"nonuniques"/"conversions")' enum: - spiders - uniques - nonuniques - conversions in: query name: filter required: false type: string produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.ClickStream.HitListPage' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve the list of events related to this conversion. tags: - Conversions '/conversions/{conversionId}/notes': put: consumes: - application/json - text/json - application/xml - text/xml - application/x-www-form-urlencoded deprecated: false parameters: - description: Id of the conversion format: int64 in: path name: conversionId required: true type: integer - description: Patch requests in: body name: note required: true schema: $ref: '#/definitions/Api.Core.Requests.GenericTextPatch' produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntityUri[System.Int64]' '401': description: Unauthorized '403': description: Forbidden '404': description: Not found '500': description: Internal Server Error summary: 'Fast patch the "notes" field of a conversion' tags: - Conversions '/conversions/{conversionId}/reports': get: consumes: [] deprecated: false parameters: - description: Id of the conversion format: int64 in: path name: conversionId required: true type: integer - description: Type of the report. enum: - datapoints - groups - browsers - browsersfamilies - platforms - cities - countries - keywords - referrers - convparameters - destinations - languages - params in: query name: type required: true type: string - description: Timeframe of the request. See list at $timeframeList enum: - yesterday - last7 - last30 - lastmonth - currentmonth - previousmonth - last90 - last120 - last180 - beginning - custom in: query name: timeframe required: true type: string - description: Type of the event you want to filter this report with. By default no filter is applied. enum: - clicks - views in: query name: hittype required: false type: string - description: 'If using a "custom" timeFrame you can specify the starting day (YYYYMMDD)' in: query name: fromDay required: false type: string - description: 'If using a "custom" timeFrame you can specify the ending day (YYYYMMDD)' in: query name: toDay required: false type: string produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.Tops.Top' '401': description: Forbidden '404': description: Not found '500': description: Internal Server Error summary: Retrieve a top report connected to this conversion tags: - Conversions /datapoints: get: consumes: [] deprecated: false parameters: - default: 0 description: Where to start when retrieving elements. Default is 0 if not specified. format: int32 in: query minLength: 0 name: offset required: false type: integer - default: 20 description: Maximum elements to retrieve. Default to 20 if not specified. format: int32 in: query maxLength: 0 minLength: 0 name: limit required: false type: integer - description: 'Type of the datapoint ("tp"/"tl")' enum: - tp - tl in: query name: type required: false type: string - description: Status of the datapoint enum: - deleted - active - paused - spam in: query name: status required: false type: string - description: A comma separated list of tags you want to filter with. in: query name: tags required: false type: string - description: Filter fields by this pattern in: query name: textSearch required: false type: string - description: Filter fields by favourite status in: query name: onlyFavorites required: false type: boolean - description: Field to sort by in: query name: sortBy required: false type: string - description: 'Direction of sort "asc" or "desc"' enum: - asc - desc in: query name: sortDirection required: false type: string - description: Exclude datapoints created before this date (YYYYMMDD) in: query name: createdAfter required: false type: string - description: Exclude datapoints created after this date (YYYYMMDD) in: query name: createdBefore required: false type: string produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Responses.EntityUri[System.Int64]]' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: List of all the datapoints associated to the user tags: - DataPoints post: consumes: - application/json - text/json - application/x-www-form-urlencoded deprecated: false parameters: - description: The body of the datapoint in: body name: value required: true schema: $ref: '#/definitions/Api.Core.Dto.Datapoints.Datapoint' produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntityUri[System.Int64]' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: Create a datapoint tags: - DataPoints /datapoints/aggregated: get: consumes: [] deprecated: false parameters: - description: Timeframe of the request. See list at $timeframeList enum: - today - yesterday - last7 - last30 - lastmonth - currentmonth - previousmonth - last90 - last120 - last180 - last12months - lastyear - currentyear - beginning - custom in: query name: timeFrame required: true type: string - description: 'Type of datapoint ("tl"/"tp")' enum: - tp - tl in: query name: type required: false type: string - description: 'If using a "custom" timeFrame you can specify the starting day (YYYYMMDD)' in: query name: fromDay required: false type: string - description: 'If using a "custom" timeFrame you can specify the ending day (YYYYMMDD)' in: query name: toDay required: false type: string - description: 'If using "yesterday" or "today" timeframe you can ask for the hourly detail' in: query name: hourly required: false type: boolean - description: 'Status of datapoint ("deleted"/"active"/"paused"/"spam")' enum: - deleted - active - paused - spam in: query name: status required: false type: string - description: A comma separated list of tags you want to filter with. in: query name: tag required: false type: string - description: Is the datapoint is marked as favourite in: query name: favourite required: false type: boolean produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.Aggregated.AggregatedResult' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve statistics about this customer for a timeframe by groups tags: - DataPoints /datapoints/aggregated/list: get: consumes: [] deprecated: false parameters: - description: 'Type of datapoint ("tl"/"tp")' enum: - tp - tl in: query name: type required: true type: string - description: Timeframe of the request. See list at $timeframeList enum: - today - yesterday - last7 - last30 - lastmonth - currentmonth - previousmonth - last90 - last120 - last180 - last12months - lastyear - currentyear - beginning - custom in: query name: timeFrame required: true type: string - description: 'If using a "custom" timeFrame you can specify the starting day (YYYYMMDD)' in: query name: fromDay required: false type: string - description: 'If using a "custom" timeFrame you can specify the ending day (YYYYMMDD)' in: query name: toDay required: false type: string - description: 'Status of datapoint ("deleted"/"active"/"paused"/"spam")' enum: - deleted - active - paused - spam in: query name: status required: false type: string - description: A comma separated list of tags you want to filter with. in: query name: tag required: false type: string - description: Is the datapoint is marked as favourite in: query name: favourite required: false type: boolean - description: 'The temporal entity you want to group by ("week"/"month"). If unspecified is "day".' enum: - week - month in: query name: groupBy required: false type: string produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Dto.Aggregated.AggregatedResult]' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve statistics about all datapoints of this customer for a timeframe grouped by some temporal entity (day/week/month) tags: - DataPoints /datapoints/batch: delete: consumes: - application/json - text/json - application/x-www-form-urlencoded deprecated: false parameters: - description: A json containing the datapoints to delete. in: body name: batch required: true schema: $ref: '#/definitions/Api.Core.Requests.DeleteBatch' produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.ModifyBatchItemResponce[Api.Core.Dto.Datapoints.Datapoint,System.Int64]' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: Delete multiple datapoints tags: - DataPoints post: consumes: - application/json - text/json - application/x-www-form-urlencoded deprecated: false parameters: - description: A json containing the datapoints to update. in: body name: batch required: true schema: $ref: '#/definitions/Api.Core.Requests.DatapointsBatch' produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.ModifyBatchItemResponce[Api.Core.Dto.Datapoints.Datapoint,System.Int64]' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: Update multiple datapoints tags: - DataPoints put: consumes: - application/json - text/json - application/x-www-form-urlencoded deprecated: false parameters: - description: A json containing the datapoints to create. in: body name: batch required: true schema: $ref: '#/definitions/Api.Core.Requests.DatapointsBatch' produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.ModifyBatchItemResponce[Api.Core.Dto.Datapoints.Datapoint,System.Int64]' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: Create multiple datapoints tags: - DataPoints /datapoints/count: get: consumes: [] deprecated: false parameters: - description: 'Type of the datapoint ("tp"/"tl")' enum: - tp - tl in: query name: type required: false type: string - description: Status of the datapoint enum: - deleted - active - paused - spam in: query name: status required: false type: string - description: A comma separated list of tags you want to filter with. in: query name: tags required: false type: string - description: Filter fields by this pattern in: query name: textSearch required: false type: string - description: Filter fields by favourite status in: query name: onlyFavorites required: false type: boolean - description: Exclude datapoints created before this date (YYYYMMDD) in: query name: createdAfter required: false type: string - description: Exclude datapoints created after this date (YYYYMMDD) in: query name: createdBefore required: false type: string produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.CountResponce' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: Count the datapoints associated to the user tags: - DataPoints '/datapoints/{id}': delete: consumes: [] deprecated: false parameters: - description: The id of the datapoint format: int64 in: path name: id required: true type: integer produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntityUri[System.Int64]' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: Delete a datapoint tags: - DataPoints get: consumes: [] deprecated: false parameters: - description: The id of the datapoint format: int64 in: path name: id required: true type: integer produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.Datapoints.Datapoint' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: Get a datapoint tags: - DataPoints post: consumes: - application/json - text/json - application/x-www-form-urlencoded deprecated: false parameters: - description: The id of the datapoint format: int64 in: path name: id required: true type: integer - description: The body of the datapoint in: body name: value required: true schema: $ref: '#/definitions/Api.Core.Dto.Datapoints.Datapoint' produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntityUri[System.Int64]' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: Update a datapoint tags: - DataPoints '/datapoints/{id}/aggregated': get: consumes: [] deprecated: false parameters: - description: Id of the datapoint format: int64 in: path name: id required: true type: integer - description: Timeframe of the request. See list at $timeframeList enum: - today - yesterday - last7 - last30 - lastmonth - currentmonth - previousmonth - last90 - last120 - last180 - last12months - lastyear - currentyear - beginning - custom in: query name: timeFrame required: true type: string - description: 'If using a "custom" timeFrame you can specify the starting day (YYYYMMDD)' in: query name: fromDay required: false type: string - description: 'If using a "custom" timeFrame you can specify the ending day (YYYYMMDD)' in: query name: toDay required: false type: string - description: 'If using "yesterday" or "today" timeframe you can ask for the hourly detail' in: query name: hourly required: false type: boolean produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.Aggregated.AggregatedResult' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve statistics about this datapoint for a timeframe tags: - DataPoints '/datapoints/{id}/aggregated/list': get: consumes: [] deprecated: false parameters: - description: Id of the datapoint format: int64 in: path name: id required: true type: integer - description: Timeframe of the request. See list at $timeframeList enum: - today - yesterday - last7 - last30 - lastmonth - currentmonth - previousmonth - last90 - last120 - last180 - last12months - lastyear - currentyear - beginning - custom in: query name: timeFrame required: true type: string - description: 'If using a "custom" timeFrame you can specify the starting day (YYYYMMDD)' in: query name: fromDay required: false type: string - description: 'If using a "custom" timeFrame you can specify the ending day (YYYYMMDD)' in: query name: toDay required: false type: string - description: 'The temporal entity you want to group by ("week"/"month"). If unspecified is "day".' enum: - week - month in: query name: groupBy required: false type: string produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Dto.Aggregated.AggregatedResult]' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve statistics about this datapoint for a timeframe grouped by some temporal entity (day/week/month) tags: - DataPoints '/datapoints/{id}/favourite': put: consumes: [] deprecated: false parameters: - description: Id of the datapoint format: int64 in: path name: id required: true type: integer produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntityUri[System.Int64]' '401': description: Unauthorized '403': description: Forbidden '404': description: Not found '500': description: Internal Server Error summary: 'Fast switch the "favourite" field of a datapoint' tags: - DataPoints '/datapoints/{id}/hits': get: consumes: [] deprecated: false parameters: - description: Id of the datapoint format: int64 in: path name: id required: true type: integer - description: Timeframe of the request. See list at $timeframeList enum: - yesterday - last7 - last30 - lastmonth - currentmonth - previousmonth - last90 - last120 - last180 - custom in: query name: timeframe required: true type: string - description: Limit results to this number format: int32 in: query maxLength: 0 minLength: 0 name: limit required: false type: integer - description: "Offset where to start from (it's the lastKey field in the response object)" in: query name: offset required: false type: string - description: 'If using a "custom" timeFrame you can specify the starting day (YYYYMMDD)' in: query name: fromDay required: false type: string - description: 'If using a "custom" timeFrame you can specify the ending day (YYYYMMDD)' in: query name: toDay required: false type: string - description: 'Filter event type ("spiders"/"uniques"/"nonuniques"/"conversions")' enum: - spiders - uniques - nonuniques - conversions in: query name: filter required: false type: string produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.ClickStream.HitListPage' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve the list of events related to this datapoint. tags: - DataPoints '/datapoints/{id}/notes': put: consumes: - application/json - text/json - application/xml - text/xml - application/x-www-form-urlencoded deprecated: false parameters: - description: Id of the datapoint format: int64 in: path name: id required: true type: integer - description: Patch requests in: body name: note required: true schema: $ref: '#/definitions/Api.Core.Requests.GenericTextPatch' produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntityUri[System.Int64]' '401': description: Unauthorized '403': description: Forbidden '404': description: Not found '500': description: Internal Server Error summary: 'Fast patch the "notes" field of a datapoint' tags: - DataPoints '/datapoints/{id}/reports': get: consumes: [] deprecated: false parameters: - description: Id of the datapoint format: int64 in: path name: id required: true type: integer - description: Type of the report. enum: - browsers - browsersfamilies - platforms - cities - countries - isps - ips - oss - ossfamilies - keywords - referrers - destinations - languages - params in: query name: type required: true type: string - description: Timeframe of the request. See list at $timeframeList enum: - yesterday - last7 - last30 - lastmonth - currentmonth - previousmonth - last90 - last120 - last180 - beginning - custom in: query name: timeframe required: true type: string - description: 'If using a "custom" timeFrame you can specify the starting day (YYYYMMDD)' in: query name: fromDay required: false type: string - description: 'If using a "custom" timeFrame you can specify the ending day (YYYYMMDD)' in: query name: toDay required: false type: string produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.Tops.Top' '401': description: Forbidden '404': description: Not found '500': description: Internal Server Error summary: Retrieve a top report connected to this datapoint tags: - DataPoints /domains: get: consumes: [] deprecated: false parameters: - description: Offset where to start from format: int32 in: query minLength: 0 name: offset required: false type: integer - description: Limit results to this number format: int32 in: query maxLength: 0 minLength: 0 name: limit required: false type: integer - default: system description: 'Type of domain ("system"/"go"/"personal"/"dedicated"). If not specified default is "system"' enum: - system - go - personal - dedicated in: query name: type required: false type: string - description: Filter domains with this anmen in: query name: name required: false type: string produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Responses.EntityUri[System.Int64]]' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve a list of domains tags: - Domains post: consumes: - application/json - text/json - application/xml - text/xml - application/x-www-form-urlencoded deprecated: false parameters: - description: The domain to create in: body name: value required: true schema: $ref: '#/definitions/Api.Core.Dto.Domains.Domain' produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntityUri[System.Int64]' '401': description: Unauthorized '500': description: Internal Server Error summary: Create a domain tags: - Domains /domains/count: get: consumes: [] deprecated: false parameters: - default: system description: 'Type of domain ("system"/"go"/"personal"/"dedicated"). If not specified default is "system"' enum: - system - go - personal - dedicated in: query name: type required: false type: string - description: Filter domains with this anmen in: query name: name required: false type: string produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.CountResponce' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve count of domains tags: - Domains '/domains/{id}': delete: consumes: [] deprecated: false parameters: - description: Id of domain format: int64 in: path name: id required: true type: integer produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntityUri[System.Int64]' '401': description: Unauthorized '500': description: Internal Server Error summary: Delete a domain tags: - Domains get: consumes: [] deprecated: false parameters: - description: Id of domain format: int64 in: path name: id required: true type: integer produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.Domains.Domain' '401': description: Unauthorized '500': description: Internal Server Error summary: Get a domain tags: - Domains post: consumes: - application/json - text/json - application/xml - text/xml - application/x-www-form-urlencoded deprecated: false parameters: - description: Id of domain format: int64 in: path name: id required: true type: integer - description: The domain to update in: body name: value required: true schema: $ref: '#/definitions/Api.Core.Dto.Domains.Domain' produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntityUri[System.Int64]' '401': description: Unauthorized '500': description: Internal Server Error summary: Update a domain tags: - Domains /groups: get: consumes: [] deprecated: false parameters: - default: 0 description: Where to start when retrieving elements. Default is 0 if not specified. format: int32 in: query minLength: 0 name: offset required: false type: integer - default: 20 description: Maximum elements to retrieve. Default to 20 if not specified. format: int32 in: query maxLength: 0 minLength: 0 name: limit required: false type: integer - description: Status of the group enum: - deleted - active in: query name: status required: false type: string - description: A comma separated list of tags you want to filter with. in: query name: tags required: false type: string - description: Filter fields by this pattern in: query name: textSearch required: false type: string - description: Exclude groups created before this date (YYYYMMDD) in: query name: createdAfter required: false type: string - description: Exclude groups created after this date (YYYYMMDD) in: query name: createdBefore required: false type: string - description: Write permission in: query name: write required: false type: boolean produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Responses.EntityUri[System.Int64]]' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: List of all the groups associated to the user. tags: - Groups post: consumes: - application/json - text/json - application/x-www-form-urlencoded deprecated: false parameters: - description: The body of the group in: body name: value required: true schema: $ref: '#/definitions/Api.Core.Dto.Groups.Group' produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntityUri[System.Int64]' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: Create a group tags: - Groups /groups/aggregated: get: consumes: [] deprecated: false parameters: - description: Timeframe of the request. See list at $timeframeList enum: - today - yesterday - last7 - last30 - lastmonth - currentmonth - previousmonth - last90 - last120 - last180 - last12months - lastyear - currentyear - beginning - custom in: query name: timeFrame required: true type: string - description: 'If using a "custom" timeFrame you can specify the starting day (YYYYMMDD)' in: query name: fromDay required: false type: string - description: 'If using a "custom" timeFrame you can specify the ending day (YYYYMMDD)' in: query name: toDay required: false type: string - description: 'If using "yesterday" or "today" timeframe you can ask for the hourly detail' in: query name: hourly required: false type: boolean - description: 'Status of group ("deleted"/"active")' enum: - deleted - active in: query name: status required: false type: string - description: A comma separated list of tags you want to filter with. in: query name: tag required: false type: string - description: Is the group is marked as favourite in: query name: favourite required: false type: boolean produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.Aggregated.AggregatedResult' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve statistics about this customer for a timeframe by groups tags: - Groups /groups/aggregated/list: get: consumes: [] deprecated: false parameters: - description: Timeframe of the request. See list at $timeframeList enum: - today - yesterday - last7 - last30 - lastmonth - currentmonth - previousmonth - last90 - last120 - last180 - last12months - lastyear - currentyear - beginning - custom in: query name: timeFrame required: true type: string - description: 'If using a "custom" timeFrame you can specify the starting day (YYYYMMDD)' in: query name: fromDay required: false type: string - description: 'If using a "custom" timeFrame you can specify the ending day (YYYYMMDD)' in: query name: toDay required: false type: string - description: 'Status of group ("deleted"/"active")' in: query name: status required: false type: string - description: A comma separated list of tags you want to filter with. in: query name: tag required: false type: string - description: Is the group is marked as favourite in: query name: favourite required: false type: boolean - description: 'The temporal entity you want to group by ("week"/"month"). If unspecified is "day".' enum: - deleted - active in: query name: groupBy required: false type: string produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Dto.Aggregated.AggregatedResult]' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve statistics about all groups of this customer for a timeframe grouped by some temporal entity (day/week/month) tags: - Groups /groups/count: get: consumes: [] deprecated: false parameters: - description: Status of the datapoint enum: - deleted - active in: query name: status required: false type: string - description: A comma separated list of tags you want to filter with. in: query name: tags required: false type: string - description: Filter fields by this pattern in: query name: textSearch required: false type: string - description: Exclude groups created before this date (YYYYMMDD) in: query name: createdAfter required: false type: string - description: Exclude groups created after this date (YYYYMMDD) in: query name: createdBefore required: false type: string - description: Write permission in: query name: write required: false type: boolean produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.CountResponce' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: Count the groups associated to the user. tags: - Groups '/groups/{id}': delete: consumes: [] deprecated: false parameters: - description: Id of the group format: int64 in: path name: id required: true type: integer produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntityUri[System.Int64]' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: Delete group specified by id tags: - Groups get: consumes: [] deprecated: false parameters: - description: The id of the group format: int64 in: path name: id required: true type: integer produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.Groups.Group' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: Get a group tags: - Groups post: consumes: - application/json - text/json - application/x-www-form-urlencoded deprecated: false parameters: - description: The id of the group format: int64 in: path name: id required: true type: integer - description: The body of the group in: body name: value required: true schema: $ref: '#/definitions/Api.Core.Dto.Groups.Group' produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntityUri[System.Int64]' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: Update a group tags: - Groups '/groups/{id}/aggregated': get: consumes: [] deprecated: false parameters: - description: Id of the group format: int64 in: path name: id required: true type: integer - description: Timeframe of the request. See list at $timeframeList enum: - today - yesterday - last7 - last30 - lastmonth - currentmonth - previousmonth - last90 - last120 - last180 - last12months - lastyear - currentyear - beginning - custom in: query name: timeFrame required: true type: string - description: 'If using a "custom" timeFrame you can specify the starting day (YYYYMMDD)' in: query name: fromDay required: false type: string - description: 'If using a "custom" timeFrame you can specify the ending day (YYYYMMDD)' in: query name: toDay required: false type: string - description: 'If using "yesterday" or "today" timeframe you can ask for the hourly detail' in: query name: hourly required: false type: boolean produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.Aggregated.AggregatedResult' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve statistics about this group for a timeframe tags: - Groups '/groups/{id}/aggregated/list': get: consumes: [] deprecated: false parameters: - description: Id of the group format: int64 in: path name: id required: true type: integer - description: Timeframe of the request. See list at $timeframeList enum: - today - yesterday - last7 - last30 - lastmonth - currentmonth - previousmonth - last90 - last120 - last180 - last12months - lastyear - currentyear - beginning - custom in: query name: timeFrame required: true type: string - description: 'If using a "custom" timeFrame you can specify the starting day (YYYYMMDD)' in: query name: fromDay required: false type: string - description: 'If using a "custom" timeFrame you can specify the ending day (YYYYMMDD)' in: query name: toDay required: false type: string - description: 'The temporal entity you want to group by ("week"/"month"). If unspecified is "day".' enum: - week - month in: query name: groupBy required: false type: string produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Dto.Aggregated.AggregatedResult]' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve statistics about this group for a timeframe grouped by some temporal entity (day/week/month) tags: - Groups '/groups/{id}/aggregated/summary': get: consumes: [] deprecated: false parameters: - description: Filter by this group id format: int64 in: path name: id required: true type: integer - description: Timeframe of the request. See list at $timeframeList enum: - today - yesterday - last7 - last30 - lastmonth - currentmonth - previousmonth - last90 - last120 - last180 - last12months - lastyear - currentyear - beginning - custom in: query name: timeFrame required: true type: string - description: 'Type of datapoint ("tl"/"tp")' enum: - tp - tl in: query name: type required: false type: string - description: 'If using a "custom" timeFrame you can specify the starting day (YYYYMMDD)' in: query name: fromDay required: false type: string - description: 'If using a "custom" timeFrame you can specify the ending day (YYYYMMDD)' in: query name: toDay required: false type: string - description: 'Status of datapoint ("deleted"/"active"/"paused"/"spam")' enum: - deleted - active in: query name: status required: false type: string - description: A comma separated list of tags you want to filter with. in: query name: tag required: false type: string - description: Is the datapoint marked as favourite in: query name: favourite required: false type: boolean - description: Field to sort by in: query name: sortBy required: false type: string - description: 'Direction of sort "asc" or "desc"' enum: - asc - desc in: query name: sortDirection required: false type: string - default: 0 description: Offset where to start from format: int32 in: query minLength: 0 name: offset required: false type: integer - default: 20 description: Limit results to this number format: int32 in: query maxLength: 0 minLength: 0 name: limit required: false type: integer - description: Filter fields by this pattern in: query name: textSearch required: false type: string produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.Aggregated.AggregatedSummaryResult' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve statistics about a subset of datapoints for a timeframe with datapoints data tags: - Groups '/groups/{id}/datapoints': get: consumes: [] deprecated: false parameters: - description: Id of the group format: int64 in: path name: id required: true type: integer - default: 0 description: Where to start when retrieving elements. Default is 0 if not specified. format: int32 in: query minLength: 0 name: offset required: false type: integer - default: 20 description: Maximum elements to retrieve. Default to 20 if not specified. format: int32 in: query maxLength: 0 minLength: 0 name: limit required: false type: integer - description: 'Type of the datapoint ("tp"/"tl")' enum: - tp - tl in: query name: type required: false type: string - description: Status of the datapoint enum: - deleted - active - paused - spam in: query name: status required: false type: string - description: A comma separated list of tags you want to filter with. in: query name: tags required: false type: string - description: Filter fields by this pattern in: query name: textSearch required: false type: string - description: Filter fields by favourite status in: query name: onlyFavorites required: false type: boolean - description: Field to sort by in: query name: sortBy required: false type: string - description: 'Direction of sort "asc" or "desc"' enum: - asc - desc in: query name: sortDirection required: false type: string - description: Exclude datapoints created before this date (YYYYMMDD) in: query name: createdAfter required: false type: string - description: Exclude datapoints created after this date (YYYYMMDD) in: query name: createdBefore required: false type: string produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Responses.EntityUri[System.Int64]]' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: List of all the datapoints associated to the user in this group. tags: - Groups post: consumes: - application/json - text/json - application/x-www-form-urlencoded deprecated: false parameters: - description: The id of the group format: int64 in: path name: id required: true type: integer - description: The body of the datapoint in: body name: value required: true schema: $ref: '#/definitions/Api.Core.Dto.Datapoints.Datapoint' produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntityUri[System.Int64]' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: Create a datapoint in this group tags: - Groups '/groups/{id}/datapoints/count': get: consumes: [] deprecated: false parameters: - description: Id of the group format: int64 in: path name: id required: true type: integer - description: 'Type of the datapoint ("tp"/"tl")' enum: - tp - tl in: query name: type required: false type: string - description: Status of the datapoint enum: - deleted - active - paused - spam in: query name: status required: false type: string - description: A comma separated list of tags you want to filter with. in: query name: tags required: false type: string - description: Filter fields by this pattern in: query name: textSearch required: false type: string - description: Filter fields by favourite status in: query name: onlyFavorites required: false type: boolean - description: Exclude datapoints created before this date (YYYYMMDD) in: query name: createdAfter required: false type: string - description: Exclude datapoints created after this date (YYYYMMDD) in: query name: createdBefore required: false type: string produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.CountResponce' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: Count the datapoints associated to the user in this group. tags: - Groups '/groups/{id}/favourite': put: consumes: [] deprecated: false parameters: - description: Id of the group format: int64 in: path name: id required: true type: integer produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntityUri[System.Int64]' '401': description: Unauthorized '403': description: Forbidden '404': description: Not found '500': description: Internal Server Error summary: 'Fast switch the "favourite" field of a group' tags: - Groups '/groups/{id}/hits': get: consumes: [] deprecated: false parameters: - description: Id of the group format: int64 in: path name: id required: true type: integer - description: Timeframe of the request. See list at $timeframeList enum: - yesterday - last7 - last30 - lastmonth - currentmonth - previousmonth - last90 - last120 - last180 - custom in: query name: timeframe required: true type: string - description: Limit results to this number format: int32 in: query maxLength: 0 minLength: 0 name: limit required: false type: integer - description: "Offset where to start from (it's the lastKey field in the response object)" in: query name: offset required: false type: string - description: 'If using a "custom" timeFrame you can specify the starting day (YYYYMMDD)' in: query name: fromDay required: false type: string - description: 'If using a "custom" timeFrame you can specify the ending day (YYYYMMDD)' in: query name: toDay required: false type: string - description: 'Filter event type ("spiders"/"uniques"/"nonuniques"/"conversions")' enum: - spiders - uniques - nonuniques - conversions in: query name: filter required: false type: string produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.ClickStream.HitListPage' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve the list of events related to this group. tags: - Groups '/groups/{id}/notes': put: consumes: - application/json - text/json - application/xml - text/xml - application/x-www-form-urlencoded deprecated: false parameters: - description: Id of the group format: int64 in: path name: id required: true type: integer - description: Patch requests in: body name: note required: true schema: $ref: '#/definitions/Api.Core.Requests.GenericTextPatch' produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntityUri[System.Int64]' '401': description: Unauthorized '403': description: Forbidden '404': description: Not found '500': description: Internal Server Error summary: 'Fast patch the "notes" field of a group' tags: - Groups '/groups/{id}/reports': get: consumes: [] deprecated: false parameters: - description: Id of the group format: int64 in: path name: id required: true type: integer - description: Type of the report. enum: - browsers - browsersfamilies - platforms - cities - countries - isps - ips - oss - ossfamilies - keywords - referrers - destinations - languages - params in: query name: type required: true type: string - description: Timeframe of the request. See list at $timeframeList enum: - yesterday - last7 - last30 - lastmonth - currentmonth - previousmonth - last90 - last120 - last180 - beginning - custom in: query name: timeframe required: true type: string - description: Type of the event you want to filter this report with. By default no filter is applied. enum: - clicks - views in: query name: hittype required: false type: string - description: 'If using a "custom" timeFrame you can specify the starting day (YYYYMMDD)' in: query name: fromDay required: false type: string - description: 'If using a "custom" timeFrame you can specify the ending day (YYYYMMDD)' in: query name: toDay required: false type: string produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.Tops.Top' '401': description: Forbidden '404': description: Not found '500': description: Internal Server Error summary: Retrieve a top report connected to this group tags: - Groups /hits: get: consumes: [] deprecated: false parameters: - description: Timeframe of the request. See list at $timeframeList enum: - yesterday - last7 - last30 - lastmonth - currentmonth - previousmonth - last90 - last120 - last180 - custom in: query name: timeframe required: true type: string - description: Limit results to this number format: int32 in: query name: limit required: false type: integer - description: "Offset where to start from (it's the lastKey field in the response object)" in: query name: offset required: false type: string - description: 'If using a "custom" timeFrame you can specify the starting day (YYYYMMDD)' in: query name: fromDay required: false type: string - description: 'If using a "custom" timeFrame you can specify the ending day (YYYYMMDD)' in: query name: toDay required: false type: string - description: 'Filter event type ("spiders"/"uniques"/"nonuniques"/"conversions")' enum: - spiders - uniques - nonuniques - conversions in: query name: filter required: false type: string produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.ClickStream.HitListPage' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve the list of events related to this account. tags: - Hits /me: get: consumes: [] deprecated: false produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.Accounting.User' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve current account data tags: - Me /me/plan: get: consumes: [] deprecated: false produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.Accounting.Plan' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve current account plan tags: - Me /reports: get: consumes: [] deprecated: false parameters: - description: Type of the report. enum: - browsers - browsersfamilies - platforms - cities - countries - isps - ips - oss - ossfamilies - keywords - referrers - destinations - languages - params in: query name: type required: true type: string - description: Timeframe of the request. See list at $timeframeList enum: - yesterday - last7 - last30 - lastmonth - currentmonth - previousmonth - last90 - last120 - last180 - beginning - custom in: query name: timeframe required: true type: string - description: Type of the event you want to filter this report with. By default no filter is applied. in: query name: hittype required: false type: string - description: 'Filter by this group id (mutually exclusive with "datapoint" and "conversion")' format: int64 in: query name: group required: false type: integer - description: 'Filter by this datapoint id (mutually exclusive with "group" and "conversion")' format: int64 in: query name: datapoint required: false type: integer - description: 'Filter by this conversion id (mutually exclusive with "datapoint" and "group")' format: int64 in: query name: conversion required: false type: integer - description: 'If using a "custom" timeFrame you can specify the starting day (YYYYMMDD)' in: query name: fromDay required: false type: string - description: 'If using a "custom" timeFrame you can specify the ending day (YYYYMMDD)' in: query name: toDay required: false type: string produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.Tops.Top' '401': description: Forbidden '404': description: Not found '500': description: Internal Server Error summary: Retrieve a top report tags: - Reports /retargeting: get: consumes: [] deprecated: false parameters: - default: 0 description: Where to start when retrieving elements. Default is 0 if not specified. format: int32 in: query minLength: 0 name: offset required: false type: integer - default: 20 description: Maximum elements to retrieve. Default to 20 if not specified. format: int32 in: query maxLength: 0 minLength: 0 name: limit required: false type: integer produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Responses.EntityUri[System.Int64]]' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: List of all the retargeting scripts associated to the user tags: - Retargeting post: consumes: - application/json - text/json - application/xml - text/xml - application/x-www-form-urlencoded deprecated: false parameters: - description: The body of the retargeting script in: body name: value required: true schema: $ref: '#/definitions/Api.Core.Dto.Retargeting.RetargetingScript' produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntityUri[System.Int64]' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: Creates a retargeting script tags: - Retargeting /retargeting/count: get: consumes: [] deprecated: false produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.CountResponce' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve count of retargeting scripts tags: - Retargeting '/retargeting/{id}': delete: consumes: [] deprecated: false parameters: - description: The id of the retargeting script format: int64 in: path name: id required: true type: integer produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntityUri[System.Int64]' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: Deletes a retargeting script (and remove associations) tags: - Retargeting get: consumes: [] deprecated: false parameters: - description: The id of the retargeting script format: int64 in: path name: id required: true type: integer produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.Retargeting.RetargetingScript' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: Get a retargeting script object tags: - Retargeting post: consumes: - application/json - text/json - application/xml - text/xml - application/x-www-form-urlencoded deprecated: false parameters: - description: The id of the retargeting script format: int64 in: path name: id required: true type: integer - description: The body of the retargeting script in: body name: value required: true schema: $ref: '#/definitions/Api.Core.Dto.Retargeting.RetargetingScript' produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntityUri[System.Int64]' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: Updates a retargeting script tags: - Retargeting '/retargeting/{id}/datapoints': get: consumes: [] deprecated: false parameters: - description: Id of the retargeting script format: int64 in: path name: id required: true type: integer - default: 0 description: Where to start when retrieving elements. Default is 0 if not specified. format: int32 in: query minLength: 0 name: offset required: false type: integer - default: 20 description: Maximum elements to retrieve. Default to 20 if not specified. format: int32 in: query maxLength: 0 minLength: 0 name: limit required: false type: integer - description: Status of the datapoint enum: - deleted - active - paused - spam in: query name: status required: false type: string - description: A comma separated list of tags you want to filter with. in: query name: tags required: false type: string - description: Filter fields by this pattern in: query name: textSearch required: false type: string - description: Filter fields by favourite status in: query name: onlyFavorites required: false type: boolean - description: Field to sort by in: query name: sortBy required: false type: string - description: 'Direction of sort "asc" or "desc"' enum: - asc - desc in: query name: sortDirection required: false type: string - description: Exclude datapoints created before this date (YYYYMMDD) in: query name: createdAfter required: false type: string - description: Exclude datapoints created after this date (YYYYMMDD) in: query name: createdBefore required: false type: string produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Responses.EntityUri[System.Int64]]' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: List of all the datapoints associated to the retargeting script. tags: - Retargeting '/retargeting/{id}/datapoints/count': get: consumes: [] deprecated: false parameters: - description: Id of the group format: int64 in: path name: id required: true type: integer - description: Status of the datapoint enum: - deleted - active - paused - spam in: query name: status required: false type: string - description: A comma separated list of tags you want to filter with. in: query name: tags required: false type: string - description: Filter fields by this pattern in: query name: textSearch required: false type: string - description: Filter fields by favourite status in: query name: onlyFavorites required: false type: boolean - description: Exclude datapoints created before this date (YYYYMMDD) in: query name: createdAfter required: false type: string - description: Exclude datapoints created after this date (YYYYMMDD) in: query name: createdBefore required: false type: string produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.CountResponce' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: Count the datapoints associated to the retargeting script. tags: - Retargeting /tags: get: consumes: [] deprecated: false parameters: - default: 0 description: Where to start when retrieving elements. Default is 0 if not specified. format: int32 in: query minLength: 0 name: offset required: false type: integer - default: 20 description: Maximum elements to retrieve. Default to 20 if not specified. format: int32 in: query maxLength: 0 minLength: 0 name: limit required: false type: integer - description: Name of the tag in: query name: name required: false type: string - description: Comma separated list of datapoints id to filter by in: query name: datapoints required: false type: string - description: Comma separated list of groups id to filter by in: query name: groups required: false type: string - description: Type of entity related to the tag enum: - tp - tl - dp - gr in: query name: type required: false type: string produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Responses.EntityUri[System.Int64]]' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: List of all the groups associated to the user filtered by this tag. tags: - Tags post: consumes: - application/json - text/json - application/x-www-form-urlencoded deprecated: false parameters: - description: The body of the tag in: body name: value required: true schema: $ref: '#/definitions/Api.Core.Dto.Tags.Tag' produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntityUri[System.Int64]' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: Create a tag tags: - Tags /tags/count: get: consumes: [] deprecated: false parameters: - description: Name of the tag in: query name: name required: false type: string - description: Comma separated list of datapoints id to filter by in: query name: datapoints required: false type: string - description: Comma separated list of groups id to filter by in: query name: groups required: false type: string - description: Type of entity related to the tag enum: - tp - tl - dp - gr in: query name: type required: false type: string produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/System.Object' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: List of all the groups associated to the user filtered by this tag. tags: - Tags '/tags/{tagId}': delete: consumes: [] deprecated: false parameters: - description: Id of the tag format: int64 in: path name: tagId required: true type: integer produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/System.Object' '401': description: Unauthorized '500': description: Internal Server Error summary: Delete a tag tags: - Tags get: consumes: [] deprecated: false parameters: - description: Id of the tag format: int64 in: path name: tagId required: true type: integer produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Dto.Tags.Tag' '401': description: Unauthorized '500': description: Internal Server Error summary: Retrieve a tag tags: - Tags '/tags/{tagId}/datapoints': delete: consumes: [] deprecated: false parameters: - description: Id of the tag format: int64 in: path name: tagId required: true type: integer produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntityUri[System.Int64]' '401': description: Unauthorized '500': description: Internal Server Error summary: Delete the association of this tag with all datapoints tags: - Tags get: consumes: [] deprecated: false parameters: - description: Id of the tag. format: int64 in: path name: tagId required: true type: integer - default: 0 description: Where to start when retrieving elements. Default is 0 if not specified. format: int32 in: query minLength: 0 name: offset required: false type: integer - default: 20 description: Maximum elements to retrieve. Default to 20 if not specified. format: int32 in: query maxLength: 0 minLength: 0 name: limit required: false type: integer - description: 'Type of the datapoint ("tp"/"tl")' enum: - tp - tl in: query name: type required: false type: string - description: Status of the datapoint enum: - deleted - active - paused - spam in: query name: status required: false type: string - description: Filter fields by this pattern in: query name: textSearch required: false type: string - description: Exclude datapoints created before this date (YYYYMMDD) in: query name: createdAfter required: false type: string - description: Exclude datapoints created after this date (YYYYMMDD) in: query name: createdBefore required: false type: string produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Responses.EntityUri[System.Int64]]' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: List of all the datapoints associated to the user filtered by this tag tags: - Tags '/tags/{tagId}/datapoints/count': get: consumes: [] deprecated: false parameters: - description: Id of the tag. format: int64 in: path name: tagId required: true type: integer - description: 'Type of the datapoint ("tp"/"tl")' enum: - tp - tl in: query name: type required: false type: string - description: Status of the datapoint enum: - deleted - active - paused - spam in: query name: status required: false type: string - description: Filter fields by this pattern in: query name: textSearch required: false type: string - description: Exclude datapoints created before this date (YYYYMMDD) in: query name: createdAfter required: false type: string - description: Exclude datapoints created after this date (YYYYMMDD) in: query name: createdBefore required: false type: string produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.CountResponce' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: Count the datapoints associated to the user filtered by this tag tags: - Tags '/tags/{tagId}/datapoints/patch': put: consumes: - application/json - text/json - application/xml - text/xml - application/x-www-form-urlencoded deprecated: false parameters: - description: Id of the tag format: int64 in: path name: tagId required: true type: integer - description: The body patch in: body name: data required: true schema: $ref: '#/definitions/Api.Core.Requests.PatchBody' produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntityUri[System.Int64]' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: Associate/Deassociate a tag with a datapoint tags: - Tags '/tags/{tagId}/groups': delete: consumes: [] deprecated: false parameters: - description: Id of the tag format: int64 in: path name: tagId required: true type: integer produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntityUri[System.Int64]' '401': description: Unauthorized '500': description: Internal Server Error summary: Delete the association of this tag with all groups tags: - Tags get: consumes: [] deprecated: false parameters: - description: Id of the tag. format: int64 in: path name: tagId required: true type: integer - default: 0 description: Where to start when retrieving elements. Default is 0 if not specified. format: int32 in: query minLength: 0 name: offset required: false type: integer - default: 20 description: Maximum elements to retrieve. Default to 20 if not specified. format: int32 in: query maxLength: 0 minLength: 0 name: limit required: false type: integer - description: Status of the datapoint enum: - deleted - active in: query name: status required: false type: string - description: Filter fields by this pattern in: query name: textSearch required: false type: string - description: Exclude groups created before this date (YYYYMMDD) in: query name: createdAfter required: false type: string - description: Exclude groups created after this date (YYYYMMDD) in: query name: createdBefore required: false type: string produces: - application/json - text/json responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntitiesResponse[Api.Core.Responses.EntityUri[System.Int64]]' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: List of all the groups associated to the user filtered by this tag. tags: - Tags '/tags/{tagId}/groups/count': get: consumes: [] deprecated: false parameters: - description: Id of the tag. format: int64 in: path name: tagId required: true type: integer - description: Status of the datapoint enum: - deleted - active in: query name: status required: false type: string - description: Filter fields by this pattern in: query name: textSearch required: false type: string - description: Exclude groups created before this date (YYYYMMDD) in: query name: createdAfter required: false type: string - description: Exclude groups created after this date (YYYYMMDD) in: query name: createdBefore required: false type: string produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.CountResponce' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: Count the groups associated to the user filtered by this tag tags: - Tags '/tags/{tagId}/groups/patch': put: consumes: - application/json - text/json - application/xml - text/xml - application/x-www-form-urlencoded deprecated: false parameters: - description: Id of the tag format: int64 in: path name: tagId required: true type: integer - description: The body patch in: body name: data required: true schema: $ref: '#/definitions/Api.Core.Requests.PatchBody' produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntityUri[System.Int64]' '401': description: Unauthorized '404': description: Not found '500': description: Internal Server Error summary: Associate/Deassociate a tag with a group tags: - Tags '/tags/{tagId}/name': put: consumes: - application/json - text/json - application/xml - text/xml - application/x-www-form-urlencoded deprecated: false parameters: - description: Id of the tag format: int64 in: path name: tagId required: true type: integer - description: The body patch in: body name: data required: true schema: $ref: '#/definitions/Api.Core.Requests.GenericTextPatch' produces: - application/json - text/json - application/xml - text/xml responses: '200': description: '' schema: $ref: '#/definitions/Api.Core.Responses.EntityUri[System.Int64]' '401': description: Unauthorized '500': description: Internal Server Error summary: Fast patch a tag name tags: - Tags definitions: Api.Core.Dto.Accounting.ConversionOptions: properties: hideComCost: type: boolean hideCost: type: boolean hideCount: type: boolean hideParams: type: boolean hideValue: type: boolean percentCommission: format: int32 type: integer percentValue: format: int32 type: integer type: object Api.Core.Dto.Accounting.DomainWhitelistEntry: properties: id: type: string name: type: string type: object Api.Core.Dto.Accounting.ExtendedGrants: properties: allowAllGrants: type: boolean allowGroupCreation: type: boolean type: object Api.Core.Dto.Accounting.Guest: properties: apiKey: type: string conversionOptions: $ref: '#/definitions/Api.Core.Dto.Accounting.ConversionOptions' creationDate: description: ' (A date in "YmdHis" format)' example: '20120203120530' type: string currentGrant: $ref: '#/definitions/Api.Core.Dto.Grants.Grant' dateFormat: type: string decimalSeparator: type: string email: type: string extendedGrants: $ref: '#/definitions/Api.Core.Dto.Accounting.ExtendedGrants' groupGrants: format: int64 type: integer hitOptions: $ref: '#/definitions/Api.Core.Dto.Accounting.HitOptions' id: format: int64 type: integer key: type: string language: type: string loginCount: format: int32 type: integer name: type: string notes: type: string numberGroupSeparator: type: string password: type: string timeFormat: enum: - AmPm - H24 type: string timeZone: format: int32 type: integer timeframeMinDate: description: ' (A date in "YmdHis" format)' example: '20120203120530' type: string timezonename: type: string tlGrants: format: int64 type: integer tpGrants: format: int64 type: integer userName: type: string type: object Api.Core.Dto.Accounting.HitOptions: properties: hideReferrer: type: boolean type: object Api.Core.Dto.Accounting.IpBlacklistEntry: properties: id: type: string ip: type: string type: object Api.Core.Dto.Accounting.Plan: properties: allowedPersonalDomains: format: int32 type: integer allowedPersonalUrls: format: int32 type: integer billingPeriodEnd: description: ' (A date in "YmdHis" format)' example: '20120203120530' type: string billingPeriodStart: description: ' (A date in "YmdHis" format)' example: '20120203120530' type: string bonusMonthlyEvents: format: int64 type: integer maximumDatapoints: format: int64 type: integer maximumGuests: format: int64 type: integer monthlyEvents: format: int64 type: integer name: type: string price: format: double type: number profileId: format: int64 type: integer recurring: type: boolean recurringPeriod: format: int32 type: integer usedDatapoints: format: int64 type: integer usedMonthlyEvents: format: int64 type: integer type: object Api.Core.Dto.Accounting.User: properties: boGoVal: type: string bonusClicks: format: int64 type: integer companyName: type: string companyRole: type: string email: type: string firstName: type: string lastName: type: string phone: type: string redirectOnly: type: boolean registrationDate: description: ' (A date in "YmdHis" format)' example: '20120203120530' type: string timeframeMinDate: description: ' (A date in "YmdHis" format)' example: '20120203120530' type: string timezone: format: int32 type: integer timezonename: type: string type: object Api.Core.Dto.Aggregated.AggregatedResult: properties: activityDay: description: ' (A date in "YmdHis" format)' example: '20120203120530' type: string commissionsCost: format: double type: number conversionsCost: format: double type: number conversionsValue: format: double type: number convertedClicks: format: int64 type: integer entityData: $ref: '#/definitions/System.Object' entityId: type: string fromDay: description: ' (A date in "YmdHis" format)' example: '20120203120530' type: string hourlyBreakDown: additionalProperties: $ref: '#/definitions/Api.Core.Dto.Aggregated.AggregatedResult' type: object lastHitDate: description: ' (A date in "YmdHis" format)' example: '20120203120530' type: string spiderHitsCount: format: int64 type: integer toDay: description: ' (A date in "YmdHis" format)' example: '20120203120530' type: string totalClicks: format: int64 type: integer totalViews: format: int64 type: integer uniqueClicks: format: int64 type: integer uniqueConversions: format: int64 type: integer uniqueViews: format: int64 type: integer type: object Api.Core.Dto.Aggregated.AggregatedSummaryResult: properties: count: format: int64 type: integer limit: format: int32 type: integer offset: format: int64 type: integer result: items: $ref: '#/definitions/Api.Core.Dto.Aggregated.AggregatedResult' type: array type: object Api.Core.Dto.ClickStream.Hit: properties: accessTime: description: ' (A date in "YmdHis" format)' example: '20120203120530' type: string browser: $ref: '#/definitions/Api.Core.Dto.ClickStream.HitBrowserInfo' clientLanguage: type: string conversion1: $ref: '#/definitions/Api.Core.Dto.ClickStream.HitConversionInfo' conversion2: $ref: '#/definitions/Api.Core.Dto.ClickStream.HitConversionInfo' conversion3: $ref: '#/definitions/Api.Core.Dto.ClickStream.HitConversionInfo' conversion4: $ref: '#/definitions/Api.Core.Dto.ClickStream.HitConversionInfo' conversion5: $ref: '#/definitions/Api.Core.Dto.ClickStream.HitConversionInfo' conversions: items: $ref: '#/definitions/Api.Core.Dto.ClickStream.HitConversionInfo' type: array entity: $ref: '#/definitions/Api.Core.Dto.ClickStream.HitDatapointInfo' ip: type: string isProxy: type: string isSpider: type: string isUnique: type: string location: $ref: '#/definitions/Api.Core.Dto.ClickStream.HitLocationInfo' org: type: string os: $ref: '#/definitions/Api.Core.Dto.ClickStream.HitOsInfo' queryParams: type: string realDestinationUrl: type: string referer: type: string source: $ref: '#/definitions/Api.Core.Dto.ClickStream.HitSource' type: type: string type: object Api.Core.Dto.ClickStream.HitBrowserInfo: properties: browserType: type: string familyId: format: int64 type: integer familyName: type: string id: format: int64 type: integer name: type: string type: object Api.Core.Dto.ClickStream.HitConversionInfo: properties: accessTime: description: ' (A date in "YmdHis" format)' example: '20120203120530' type: string comcost: format: double type: number cost: format: double type: number date: description: ' (A date in "YmdHis" format)' example: '20120203120530' type: string deleted: type: boolean id: format: int64 type: integer name: type: string parameter: type: string value: format: double type: number type: object Api.Core.Dto.ClickStream.HitDatapointInfo: properties: creationDate: description: ' (A date in "YmdHis" format)' example: '20120203120530' type: string datapointFavourite: type: boolean datapointId: format: int64 type: integer datapointName: type: string datapointTitle: type: string datapointType: type: string destinationUrl: type: string groupId: format: int64 type: integer groupName: type: string isABTest: type: boolean isPrivateShared: type: boolean isPublic: type: boolean notes: type: string status: enum: - Active - Paused - Abuse - Deleted type: string tags: items: $ref: '#/definitions/Api.Core.Dto.Tags.Tag' type: array trackingCode: type: string type: object Api.Core.Dto.ClickStream.HitListPage: properties: hits: items: $ref: '#/definitions/Api.Core.Dto.ClickStream.Hit' type: array lastKey: type: string type: object Api.Core.Dto.ClickStream.HitLocationInfo: properties: areacode: type: string city: type: string country: type: string latitude: format: double type: number longitude: format: double type: number metrocode: type: string organization: type: string postalcode: type: string region: type: string regionName: type: string type: object Api.Core.Dto.ClickStream.HitOsInfo: properties: familyId: format: int64 type: integer familyName: type: string id: format: int64 type: integer name: type: string type: object Api.Core.Dto.ClickStream.HitSource: properties: id: format: int64 type: integer name: type: string param: type: string type: object Api.Core.Dto.Conversions.Conversion: properties: code: type: string creationDate: description: ' (A date in "YmdHis" format)' example: '20120203120530' type: string deleted: type: boolean description: type: string id: format: int64 type: integer name: type: string protocol: enum: - Http - Https type: string value: format: double type: number type: object Api.Core.Dto.Datapoints.BrowserBaseDestinationItem: properties: emailDestinationUrl: type: string mobileDestinationUrl: type: string spidersDestinationUrl: type: string type: object Api.Core.Dto.Datapoints.Datapoint: properties: creationDate: description: ' (A date in "YmdHis" format)' example: '20120203120530' type: string encodeIp: type: boolean fifthConversionId: format: int64 type: integer fifthConversionName: type: string firstConversionId: format: int64 type: integer firstConversionName: type: string fourthConversionId: format: int64 type: integer fourthConversionName: type: string groupId: format: int64 type: integer groupName: type: string id: format: int64 type: integer isPublic: type: boolean isSecured: type: boolean lightTracking: type: boolean name: type: string notes: type: string preferred: type: boolean redirectOnly: type: boolean secondConversionId: format: int64 type: integer secondConversionName: type: string status: enum: - Active - Paused - Abuse - Deleted type: string tags: items: $ref: '#/definitions/Api.Core.Dto.Tags.Tag' type: array thirdConversionId: format: int64 type: integer thirdConversionName: type: string title: type: string trackingCode: type: string type: enum: - TrackingLink - TrackingPixel type: string typeTL: $ref: '#/definitions/Api.Core.Dto.Datapoints.TrackingLinkSpecifics' typeTP: $ref: '#/definitions/Api.Core.Dto.Datapoints.TrackingPixelSpecifics' writePermited: type: boolean type: object Api.Core.Dto.Datapoints.DatapointRetargetingInfo: properties: id: format: int64 type: integer name: type: string type: object Api.Core.Dto.Datapoints.MultipleDestinationItem: properties: url: type: string type: object Api.Core.Dto.Datapoints.TrackingLinkSpecifics: properties: appendQuery: type: boolean browserDestinationItem: $ref: '#/definitions/Api.Core.Dto.Datapoints.BrowserBaseDestinationItem' destinationMode: enum: - Simple - RandomDestination - DestinationByLanguage - SpilloverDestination - DynamicUrl - BrowserDestination - DestinationByNation - UniqueDestination - SequentialDestination - WeightedDestination type: string domainId: format: int32 type: integer encodeUrl: type: boolean expirationClicks: format: int64 type: integer expirationDate: description: ' (A date in "YmdHis" format)' example: '20120203120530' type: string firstUrl: type: string goDomainId: format: int32 type: integer hideUrl: type: boolean hideUrlTitle: type: string isABTest: type: boolean password: type: string pauseAfterClicksExpiration: type: boolean pauseAfterDateExpiration: type: boolean randomDestinationItems: items: $ref: '#/definitions/Api.Core.Dto.Datapoints.MultipleDestinationItem' type: array redirectType: enum: - PermanentRedirect - TemporaryRedirect type: string referrerClean: enum: - None - Clean - Myself type: string scripts: items: $ref: '#/definitions/Api.Core.Dto.Datapoints.DatapointRetargetingInfo' type: array sequentialDestinationItems: items: $ref: '#/definitions/Api.Core.Dto.Datapoints.MultipleDestinationItem' type: array spilloverDestinationItems: items: $ref: '#/definitions/Api.Core.Dto.Datapoints.MultipleDestinationItem' type: array uniqueDestinationItem: $ref: '#/definitions/Api.Core.Dto.Datapoints.UniqueDestinationItem' url: type: string urlAfterClicksExpiration: type: string urlAfterDateExpiration: type: string urlsByLanguage: items: $ref: '#/definitions/Api.Core.Dto.Datapoints.UrlByLanguageItem' type: array urlsByNation: items: $ref: '#/definitions/Api.Core.Dto.Datapoints.UrlByNationItem' type: array weightedDestinationItems: items: $ref: '#/definitions/Api.Core.Dto.Datapoints.WeightedDestinationItem' type: array type: object Api.Core.Dto.Datapoints.TrackingPixelSpecifics: properties: parameterNote: type: string type: object Api.Core.Dto.Datapoints.UniqueDestinationItem: properties: firstDestinationUrl: type: string type: object Api.Core.Dto.Datapoints.UrlByLanguageItem: properties: languageCode: type: string url: type: string type: object Api.Core.Dto.Datapoints.UrlByNationItem: properties: nation: type: string url: type: string type: object Api.Core.Dto.Datapoints.WeightedDestinationItem: properties: url: type: string weight: format: int32 type: integer type: object Api.Core.Dto.Domains.Domain: properties: custom404: type: string customHomepage: type: string id: format: int64 type: integer name: type: string type: enum: - System - Go - Dedicated - Personal type: string type: object Api.Core.Dto.EntityUriLong: properties: id: format: int64 type: integer uri: type: string type: object Api.Core.Dto.Grants.Grant: properties: DatapointType: type: string Entity: $ref: '#/definitions/Api.Core.Responses.EntityUri[System.Int64]' EntityName: type: string EntityType: type: string Type: type: string type: object Api.Core.Dto.Groups.Group: properties: creationDate: description: ' (A date in "YmdHis" format)' example: '20120203120530' type: string deleted: type: boolean id: format: int64 type: integer isPublic: type: boolean name: type: string notes: type: string preferred: type: boolean redirectOnly: type: boolean tags: items: $ref: '#/definitions/Api.Core.Dto.Tags.Tag' type: array writePermited: type: boolean type: object Api.Core.Dto.Retargeting.RetargetingScript: properties: id: format: int64 type: integer name: type: string script: type: string type: object Api.Core.Dto.Tags.Tag: properties: datapoints: items: format: int64 type: integer type: array groups: items: format: int64 type: integer type: array id: format: int64 type: integer name: type: string type: object Api.Core.Dto.Tops.Top: properties: createdAt: description: ' (A date in "YmdHis" format)' example: '20120203120530' type: string data: items: $ref: '#/definitions/Api.Core.Dto.Tops.TopItem' type: array key: type: string type: object Api.Core.Dto.Tops.TopItem: properties: entityData: $ref: '#/definitions/System.Object' id: type: string lastHitDate: description: ' (A date in "YmdHis" format)' example: '20120203120530' type: string spiderClicks: format: int64 type: integer spiderHits: format: int64 type: integer spiderViews: format: int64 type: integer totalClicks: format: int64 type: integer totalCommissionsCost: format: double type: number totalConversions: format: int64 type: integer totalConversionsCost: format: double type: number totalConversionsValue: format: double type: number totalHits: format: int64 type: integer totalViews: format: int64 type: integer uniqueClicks: format: int64 type: integer uniqueHits: format: int64 type: integer uniqueViews: format: int64 type: integer type: object Api.Core.Requests.ConversionPatchBody: properties: Action: type: string Id: format: int64 type: integer ReplaceId: format: int64 type: integer type: object Api.Core.Requests.DatapointsBatch: properties: List: items: $ref: '#/definitions/Api.Core.Dto.Datapoints.Datapoint' type: array type: object Api.Core.Requests.DeleteBatch: properties: Entities: items: $ref: '#/definitions/Api.Core.Dto.EntityUriLong' type: array type: object Api.Core.Requests.GenericTextPatch: properties: Text: type: string type: object Api.Core.Requests.PatchBody: properties: Action: type: string Id: format: int64 type: integer type: object Api.Core.Requests.PatchBodyBatch: properties: PatchRequests: items: $ref: '#/definitions/Api.Core.Requests.PatchBody' type: array type: object Api.Core.Requests.PermissionPatchRequest: properties: Action: type: string Id: format: int64 type: integer Verb: type: string type: object Api.Core.Responses.CountResponce: properties: count: format: int64 type: integer type: object 'Api.Core.Responses.EntitiesResponse[Api.Core.Dto.Accounting.DomainWhitelistEntry]': properties: entities: items: $ref: '#/definitions/Api.Core.Dto.Accounting.DomainWhitelistEntry' type: array type: object 'Api.Core.Responses.EntitiesResponse[Api.Core.Dto.Accounting.IpBlacklistEntry]': properties: entities: items: $ref: '#/definitions/Api.Core.Dto.Accounting.IpBlacklistEntry' type: array type: object 'Api.Core.Responses.EntitiesResponse[Api.Core.Dto.Aggregated.AggregatedResult]': properties: entities: items: $ref: '#/definitions/Api.Core.Dto.Aggregated.AggregatedResult' type: array type: object 'Api.Core.Responses.EntitiesResponse[Api.Core.Dto.ClickStream.Hit]': properties: entities: items: $ref: '#/definitions/Api.Core.Dto.ClickStream.Hit' type: array type: object 'Api.Core.Responses.EntitiesResponse[Api.Core.Dto.Grants.Grant]': properties: entities: items: $ref: '#/definitions/Api.Core.Dto.Grants.Grant' type: array type: object 'Api.Core.Responses.EntitiesResponse[Api.Core.Responses.EntityUri[System.Int64]]': properties: entities: items: $ref: '#/definitions/Api.Core.Responses.EntityUri[System.Int64]' type: array type: object 'Api.Core.Responses.EntityUri[System.Int64]': properties: id: format: int64 type: integer uri: type: string type: object 'Api.Core.Responses.ModifyBatchItemResponce[Api.Core.Dto.Datapoints.Datapoint,System.Int64]': properties: entityData: $ref: '#/definitions/Api.Core.Dto.Datapoints.Datapoint' errors: items: $ref: '#/definitions/ClickMeter.Infrastructure.Validation.ValidationFailure' type: array result: $ref: '#/definitions/Api.Core.Responses.EntityUri[System.Int64]' status: type: string type: object ClickMeter.Infrastructure.Validation.ValidationFailure: properties: code: $ref: '#/definitions/System.Object' errorMessage: type: string errorValue: $ref: '#/definitions/System.Object' property: type: string type: object System.Object: properties: {} type: object spec-0.21.0/fixtures/expansion/crossFileRef.json000066400000000000000000000005461457312531500216750ustar00rootroot00000000000000{ "paths": { "/pets": { "get": { "parameters": [ { "$ref": "./all-the-things.json#/parameters/idParam" } ] } }, "/": { "get": { "responses": { "200": { "$ref": "./all-the-things.json#/responses/anotherPet" } } } } } } spec-0.21.0/fixtures/expansion/extraRef.json000066400000000000000000000023141457312531500210620ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "version": "2.1.0", "title": "Supported, but non Swagger 20 compliant $ref constructs" }, "host": "item.com", "basePath": "/extraRefs", "schemes": [ "http" ], "paths": { "/employees": { "get": { "operationId": "LIST-Employees", "summary": "List Employee Types", "parameters": [ { "description": "unsupported $ref in simple param", "name": "myQueryParam", "in": "query", "type": "array", "items": { "$ref": "#/definitions/arrayType" } } ], "responses": { "200": { "description": "unsupported $ref in header", "headers": { "X-header": { "type": "array", "items": { "$ref": "#/definitions/headerType" } } }, "schema": { "type": "string" } } } } } }, "definitions": { "arrayType": { "type": "integer", "format": "int32" }, "headerType": { "type": "string", "format": "uuid" } } } spec-0.21.0/fixtures/expansion/invalid-refs.json000066400000000000000000000032351457312531500216700ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore", "contact": { "name": "wordnik api team", "url": "http://developer.wordnik.com" }, "license": { "name": "Creative Commons 4.0 International", "url": "http://creativecommons.org/licenses/by/4.0/" } }, "host": "petstore.swagger.wordnik.com", "basePath": "/api", "schemes": [ "http" ], "paths": { "/pets": { "get": { "tags": [ "Pet Operations" ], "summary": "finds pets in the system", "responses": { "200": { "description": "pet response", "schema": { "type": "array", "items": { "$ref": "NotCorrectRef" } }, "headers": { "x-expires": { "type": "string" } } }, "default": { "description": "unexpected error", "schema": { "$ref": "NotCorrectRef" } } } } } }, "definitions": { "Pet": { "required": [ "id", "name" ], "properties": { "id": { "type": "integer", "format": "int64" }, "name": { "type": "string" }, "tag": { "type": "string" } } }, "Error": { "required": [ "code", "message" ], "properties": { "code": { "type": "integer", "format": "int32" }, "message": { "type": "string" } } } } } spec-0.21.0/fixtures/expansion/missingItemRef.json000066400000000000000000000011161457312531500222260ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "version": "2.1.0", "title": "Missing Item API" }, "host": "item.com", "basePath": "/missing/ref", "schemes": [ "http" ], "paths": { "/employees": { "get": { "operationId": "LIST-Employees", "summary": "List Employee Types", "responses": { "200": { "description": "", "schema": { "type": "array", "items": { "$ref": "#/definitions/employees-output" } } } } } } } }spec-0.21.0/fixtures/expansion/missingRef.json000066400000000000000000000072641457312531500214210ustar00rootroot00000000000000{ "input": { "swagger": "2.0", "info": { "version": "1.0", "title": "Continue On Error" }, "paths": { "/todos": { "get": { "responses": { "200": { "description": "List Todos", "schema": { "type": "array", "items": { "$ref": "#/definitions/todo-full" } } }, "404": { "$ref": "#/responses/404" } } } } }, "definitions": { "todo-partial": { "type": "object", "properties": { "name": { "type": "string" }, "completed": { "type": "boolean" } } }, "todo-full": { "allOf": [ { "$ref": "#/definitions/todo-partial" }, { "type": "object", "properties": { "id": { "type": "integer" }, "completed_at": { "type": "string" }, "created_at": { "type": "string" }, "updated_at": { "type": "string" } } } ] } } }, "expected": { "swagger": "2.0", "info": { "title": "Continue On Error", "version": "1.0" }, "paths": { "/todos": { "get": { "responses": { "200": { "description": "List Todos", "schema": { "type": "array", "items": { "allOf": [ { "type": "object", "properties": { "completed": { "type": "boolean" }, "name": { "type": "string" } } }, { "type": "object", "properties": { "completed_at": { "type": "string" }, "created_at": { "type": "string" }, "id": { "type": "integer" }, "updated_at": { "type": "string" } } } ] } } }, "404": {} } } } }, "definitions": { "todo-full": { "allOf": [ { "type": "object", "properties": { "completed": { "type": "boolean" }, "name": { "type": "string" } } }, { "type": "object", "properties": { "completed_at": { "type": "string" }, "created_at": { "type": "string" }, "id": { "type": "integer" }, "updated_at": { "type": "string" } } } ] }, "todo-partial": { "type": "object", "properties": { "completed": { "type": "boolean" }, "name": { "type": "string" } } } } } } spec-0.21.0/fixtures/expansion/overflow.json000066400000000000000000000065641457312531500211600ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "title": "Swagger Sample", "description": "Sample API Playground.", "version": "1.0.0" }, "basePath": "/v1", "schemes": [ "http" ], "consumes": [ "application/vdn.sample.v1+json" ], "produces": [ "application/vdn.sample.v1+json" ], "paths": { "/books": { "get": { "summary": "List all books", "operationId": "listBooks", "tags": [ "books" ], "responses": { "200": { "headers": { "Link": { "type": "string" } }, "description": "An array of books", "schema": { "type": "array", "items": { "$ref": "#/definitions/Book" } } }, "default": { "description": "generic error response", "schema": { "$ref": "#/definitions/Error" } } } } } }, "definitions": { "Store": { "type": "object", "properties": { "title": { "type": "string", "example": "Book Shop" }, "categories": { "type": "array", "items": { "$ref": "#/definitions/Category" } } } }, "Category": { "type": "object", "properties": { "title": { "type": "string", "example": "Drama" }, "books": { "type": "array", "items": { "$ref": "#/definitions/Book" } } } }, "Book": { "type": "object", "required": [ "title", "summary" ], "properties": { "title": { "type": "string", "example": "Winnie the Pooh" }, "summary": { "type": "string", "example": "Famous children's book" }, "related_books": { "type": "array", "items": { "$ref": "#/definitions/Book" } } } }, "Error": { "type": "object", "readOnly": true, "properties": { "code": { "type": "integer", "format": "int64", "example": 400 }, "message": { "type": "string", "example": "Unexpected error" } }, "required": [ "message" ] } } } spec-0.21.0/fixtures/expansion/params.json000066400000000000000000000006071457312531500205700ustar00rootroot00000000000000{ "parameters": { "id": { "type": "integer", "format": "int64", "in": "path", "required": true }, "tag": { "type": "string", "in": "query", "required": false }, "query": { "$ref": "#/parameters/tag" } }, "paths": { "/cars/{id}": { "parameters": [ { "$ref": "#/parameters/id"} ] } } }spec-0.21.0/fixtures/expansion/pathItem1.json000066400000000000000000000005111457312531500211330ustar00rootroot00000000000000{ "getTodo": { "get": { "responses": { "200": { "description": "List Todos", "schema": { "type": "array", "items": { "type": "string" } } }, "404": { "description": "error" } } } } } spec-0.21.0/fixtures/expansion/pathItems.json000066400000000000000000000002771457312531500212460ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "version": "1.0", "title": "PathItems refs" }, "paths": { "/todos": { "$ref": "pathItem1.json#/getTodo" } } } spec-0.21.0/fixtures/expansion/schemas1.json000066400000000000000000000042771457312531500210200ustar00rootroot00000000000000{ "definitions": { "car": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64" }, "make": { "type": "string" }, "brand": { "$ref": "#/definitions/brand" } } }, "tag": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64" }, "value": { "type": "string" } } }, "brand": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64" }, "name": { "type": "string" } } }, "truck": { "$ref": "#/definitions/car" }, "batch": { "items": { "$ref": "#/definitions/brand" } }, "batch2": { "items": [ { "$ref": "#/definitions/brand" }, { "$ref": "#/definitions/tag" } ] }, "allofBoth": { "allOf": [ { "$ref": "#/definitions/brand" }, { "$ref": "#/definitions/tag" } ] }, "anyofBoth": { "anyOf": [ { "$ref": "#/definitions/brand" }, { "$ref": "#/definitions/tag" } ] }, "oneofBoth": { "oneOf": [ { "$ref": "#/definitions/brand" }, { "$ref": "#/definitions/tag" } ] }, "notSomething": { "not": { "$ref": "#/definitions/tag" } }, "withAdditional": { "additionalProperties": { "$ref": "#/definitions/tag" } }, "withPattern": { "patternProperties": { "^x-ab": { "$ref": "#/definitions/tag" } } }, "withAdditionalItems": { "additionalItems": { "$ref": "#/definitions/tag" } }, "deps": { "dependencies": { "something": { "$ref": "#/definitions/tag" } } }, "defined": { "definitions": { "something": { "$ref": "#/definitions/tag" } } } } }spec-0.21.0/fixtures/expansion/schemas2.json000066400000000000000000000053731457312531500210170ustar00rootroot00000000000000{ "definitions": { "car": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64" }, "make": { "type": "string" }, "brand": { "items": { "$ref": "#/definitions/brand" } } } }, "tag": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64" }, "value": { "type": "string" } } }, "brand": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64" }, "name": { "type": "string" } } }, "truck": { "items": { "$ref": "#/definitions/car" } }, "batch": { "items": { "items": { "$ref": "#/definitions/brand" } } }, "batch2": { "items": [ { "items": { "$ref": "#/definitions/brand" } }, { "items": { "$ref": "#/definitions/tag" } } ] }, "allofBoth": { "allOf": [ { "items": { "$ref": "#/definitions/brand" } }, { "items": { "$ref": "#/definitions/tag" } } ] }, "anyofBoth": { "anyOf": [ { "items": { "$ref": "#/definitions/brand" } }, { "items": { "$ref": "#/definitions/tag" } } ] }, "oneofBoth": { "oneOf": [ { "items": { "$ref": "#/definitions/brand" } }, { "items": { "$ref": "#/definitions/tag" } } ] }, "notSomething": { "not": { "items": { "$ref": "#/definitions/tag" } } }, "withAdditional": { "additionalProperties": { "items": { "$ref": "#/definitions/tag" } } }, "withPattern": { "patternProperties": { "^x-ab": { "items": { "$ref": "#/definitions/tag" } } } }, "withAdditionalItems": { "additionalItems": { "items": { "$ref": "#/definitions/tag" } } }, "deps": { "dependencies": { "something": { "items": { "$ref": "#/definitions/tag" } } } }, "defined": { "definitions": { "something": { "items": { "$ref": "#/definitions/tag" } } } } } } spec-0.21.0/fixtures/flatten/000077500000000000000000000000001457312531500160405ustar00rootroot00000000000000spec-0.21.0/fixtures/flatten/external/000077500000000000000000000000001457312531500176625ustar00rootroot00000000000000spec-0.21.0/fixtures/flatten/external/definitions.yml000066400000000000000000000021451457312531500227220ustar00rootroot00000000000000definitions: named: type: string tag: type: object properties: id: type: integer format: int64 value: type: string audit: $ref: "#/definitions/record" record: type: object properties: createdAt: type: string format: date-time nestedThing: type: object properties: record: type: array items: - type: string format: date-time - type: object properties: createdAt: type: string format: date-time - allOf: - type: string format: date - type: object additionalProperties: type: object properties: id: type: integer format: int64 value: type: string properties: value: type: string name: $ref: "definitions2.yml#/coordinate"spec-0.21.0/fixtures/flatten/external/definitions2.yml000066400000000000000000000002261457312531500230020ustar00rootroot00000000000000coordinate: type: object properties: id: type: integer format: int64 createdAt: type: string format: date-timespec-0.21.0/fixtures/flatten/external/errors.yml000066400000000000000000000003011457312531500217130ustar00rootroot00000000000000error: type: object required: - id - message properties: id: type: integer format: int64 readOnly: true message: type: string readOnly: true spec-0.21.0/fixtures/flatten/external/nestedParams.yml000066400000000000000000000015131457312531500230330ustar00rootroot00000000000000bodyParam: name: body in: body schema: type: object properties: record: type: array items: - type: string format: date-time - type: object properties: createdAt: type: string format: date-time - allOf: - type: string format: date - type: object properties: id: type: integer format: int64 value: type: string name: type: object properties: id: type: integer format: int64 createdAt: type: string format: date-timespec-0.21.0/fixtures/flatten/external/nestedResponses.yml000066400000000000000000000013671457312531500236000ustar00rootroot00000000000000genericResponse: type: object properties: record: type: array items: - type: string format: date-time - type: object properties: createdAt: type: string format: date-time - allOf: - type: string format: date - type: object properties: id: type: integer format: int64 value: type: string name: type: object properties: id: type: integer format: int64 createdAt: type: string format: date-timespec-0.21.0/fixtures/flatten/external/parameters.yml000066400000000000000000000002701457312531500225470ustar00rootroot00000000000000parameters: idParam: name: id in: path type: integer format: int32 limitParam: name: limit in: query type: integer format: int32 required: falsespec-0.21.0/fixtures/flatten/external/pathItem.yml000066400000000000000000000003701457312531500221600ustar00rootroot00000000000000get: operationId: modelOp summary: many model variations description: Used to see if a codegen can render all the possible parameter variations for a header param tags: - testcgen responses: default: description: Generic Outspec-0.21.0/fixtures/flatten/external/responses.yml000066400000000000000000000001021457312531500224170ustar00rootroot00000000000000responses: notFound: schema: $ref: "errors.yml#/error"spec-0.21.0/fixtures/flatten/flatten.yml000066400000000000000000000035211457312531500202210ustar00rootroot00000000000000--- swagger: "2.0" info: version: "0.1.0" title: reference analysis parameters: someParam: name: some in: query type: string responses: notFound: description: "Not Found" schema: $ref: "external/errors.yml#/error" paths: "/some/where/{id}": parameters: - $ref: "external/parameters.yml#/parameters/idParam" get: parameters: - $ref: "external/parameters.yml#/parameters/limitParam" - $ref: "#/parameters/someParam" - name: other in: query type: string - $ref: "external/nestedParams.yml#/bodyParam" responses: default: $ref: "external/nestedResponses.yml#/genericResponse" 404: $ref: "#/responses/notFound" 200: description: "RecordHolder" schema: type: object properties: record: $ref: "external/definitions.yml#/definitions/nestedThing" "/other/place": $ref: "external/pathItem.yml" definitions: namedAgain: $ref: "external/definitions.yml#/definitions/named" datedTag: allOf: - type: string format: date - $ref: "external/definitions.yml#/definitions/tag" records: type: array items: - $ref: "external/definitions.yml#/definitions/record" datedRecords: type: array items: - type: string format: date-time - $ref: "external/definitions.yml#/definitions/record" otherRecords: type: array items: $ref: "external/definitions.yml#/definitions/record" tags: type: object additionalProperties: $ref: "external/definitions.yml#/definitions/tag" namedThing: type: object properties: name: $ref: "external/definitions.yml#/definitions/named" namedAgain: $ref: "#/definitions/namedAgain" spec-0.21.0/fixtures/local_expansion/000077500000000000000000000000001457312531500175615ustar00rootroot00000000000000spec-0.21.0/fixtures/local_expansion/item.json000066400000000000000000000004041457312531500214100ustar00rootroot00000000000000{ "properties": { "id": { "format": "int64", "readOnly": true, "type": "integer" }, "title": { "maxLength": 80, "minLength": 2, "type": "string" } }, "required": [ "title" ], "type": "object" } spec-0.21.0/fixtures/local_expansion/item2.yaml000066400000000000000000000002501457312531500214620ustar00rootroot00000000000000type: object required: - title properties: id: type: integer format: uint64 readOnly: true title: type: string minLength: 2 maxLength: 80 spec-0.21.0/fixtures/local_expansion/spec.json000066400000000000000000000013511457312531500214060ustar00rootroot00000000000000{ "basePath": "/v1", "consumes": [ "application/json" ], "host": "item.api.local", "info": { "description": "Item API", "title": "Item API", "version": "1.0.0" }, "paths": { "/item": { "get": { "operationId": "GetItem", "responses": { "200": { "description": "item detail response", "schema": { "$ref": "item.json" } } } } } }, "produces": [ "application/json" ], "schemes": [ "http" ], "security": [ { "key": [] } ], "securityDefinitions": { "key": { "in": "header", "name": "x-item-token", "type": "apiKey" } }, "swagger": "2.0" } spec-0.21.0/fixtures/local_expansion/spec2.yaml000066400000000000000000000007441457312531500214660ustar00rootroot00000000000000--- swagger: "2.0" info: title: Item API description: Item API version: "1.0.0" host: item.api.local basePath: /v1 securityDefinitions: key: type: apiKey name: x-item-token in: header security: - key: [] consumes: - application/json produces: - application/json schemes: - http paths: /item: get: operationId: GetItem responses: 200: description: item detail response schema: "$ref": "item2.yaml" spec-0.21.0/fixtures/more_circulars/000077500000000000000000000000001457312531500174145ustar00rootroot00000000000000spec-0.21.0/fixtures/more_circulars/bitbucket.json000066400000000000000000007422251457312531500222770ustar00rootroot00000000000000{ "info": { "termsOfService": "https://www.atlassian.com/end-user-agreement", "version": "2.0", "contact": { "url": "https://bitbucket.org/support", "name": "Bitbucket Support", "email": "support@bitbucket.org" }, "description": "Code against the Bitbucket API to automate simple tasks, embed Bitbucket data into your own site, build mobile or desktop apps, or even add custom UI add-ons into Bitbucket itself using the Connect framework.", "title": "Bitbucket API" }, "paths": { "/repositories/{username}/{repo_slug}/refs/branches/{name}": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "type": "string", "name": "name", "in": "path" } ], "get": { "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "refs" ] } }, "/teams/{username}/following": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" } ], "get": { "security": [ { "oauth2": [ "account" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the list of accounts this team is following.", "responses": { "200": { "description": "A paginated list of user objects.", "schema": { "$ref": "#/definitions/paginated_users" } }, "404": { "description": "If no team exists for the specified name, or if the specified account is a personal account, not a team account.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "required": true, "type": "string", "description": "The team's username", "name": "username", "in": "path" } ], "tags": [ "teams" ] } }, "/repositories/{username}/{repo_slug}/commit/{sha}/comments/{comment_id}": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "type": "string", "name": "sha", "in": "path" }, { "required": true, "type": "string", "name": "comment_id", "in": "path" } ], "get": { "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the specified commit comment.", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "commits" ] } }, "/repositories/{username}/{repo_slug}/hooks": { "post": { "security": [ { "oauth2": [ "webhook" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Creates a new webhook on the specified repository.", "responses": { "201": { "description": "If the webhook was registered successfully.", "schema": { "$ref": "#/definitions/webhook_subscription" } }, "403": { "description": "If the authenticated user does not have permission to install webhooks on the specified repository.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the repository does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "webhooks" ] }, "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" } ], "get": { "security": [ { "oauth2": [ "webhook" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns a paginated list of webhooks installed on this repository.", "responses": { "200": { "description": "The paginated list of installed webhooks.", "schema": { "$ref": "#/definitions/paginated_webhook_subscriptions" } }, "403": { "description": "If the authenticated user does not have permission to access the webhooks.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the repository does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "webhooks" ] } }, "/repositories/{username}/{repo_slug}/issues/{issue_id}/attachments/{path}": { "delete": { "security": [ { "oauth2": [ "issue:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Deletes an attachment.", "responses": { "401": { "description": "If the issue tracker is private and the request was not authenticated." }, "404": { "description": "If the specified repository, issue, or attachment does not exist, or if the repository doesn't have the issue tracker enabled.", "schema": { "$ref": "#/definitions/error" } }, "204": { "description": "Indicates that the deletion was successful" } }, "parameters": [], "tags": [ "issue_tracker" ] }, "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "type": "string", "name": "issue_id", "in": "path" }, { "required": true, "type": "string", "name": "path", "in": "path" } ], "get": { "security": [ { "oauth2": [ "issue" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the contents of the specified file attachment.\n\nNote that this endpoint does not return a JSON response, but instead\nreturns a redirect pointing to the actual file that in turn will return\nthe raw contents.\n\nThe redirect URL contains a one-time token that has a limited lifetime.\nAs a result, the link should not be persisted, stored, or shared.", "responses": { "401": { "description": "If the issue tracker is private and the request was not authenticated." }, "404": { "description": "If the specified repository or issue does not exist, or if the repository doesn't have the issue tracker enabled.", "schema": { "$ref": "#/definitions/error" } }, "302": { "headers": { "Location": { "type": "string" } }, "description": "A redirect to the file's contents" } }, "parameters": [], "tags": [ "issue_tracker" ] } }, "/repositories/{username}/{repo_slug}/versions/{version_id}": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "type": "string", "name": "version_id", "in": "path" } ], "get": { "security": [ { "oauth2": [ "issue" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the specified issue tracker version object.", "responses": { "200": { "description": "The specified version object.", "schema": { "$ref": "#/definitions/version" } }, "404": { "description": "If the specified repository or version does not exist, or if the repository doesn't have the issue tracker enabled.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "required": true, "type": "integer", "description": "The version's id", "name": "version_id", "in": "path" } ], "tags": [ "issue_tracker" ] } }, "/repositories/{username}/{repo_slug}/issues/{issue_id}/vote": { "put": { "security": [ { "oauth2": [ "issue", "account:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Vote for this issue.\n\nTo cast your vote, do an empty PUT. The 204 status code indicates that\nthe operation was successful.", "responses": { "401": { "description": "When the request wasn't authenticated.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "When the issue does not exist, the repo does not exist, or when the repos does not have an issue tracker.", "schema": { "$ref": "#/definitions/error" } }, "204": { "description": "Indicating the authenticated user has cast their vote successfully.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "required": true, "type": "integer", "description": "The issue's id", "name": "issue_id", "in": "path" } ], "tags": [ "issue_tracker" ] }, "delete": { "security": [ { "oauth2": [ "issue:write", "account:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Retract your vote.", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "required": true, "type": "integer", "description": "The issue's id", "name": "issue_id", "in": "path" } ], "tags": [ "issue_tracker" ] }, "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "type": "string", "name": "issue_id", "in": "path" } ], "get": { "security": [ { "oauth2": [ "issue", "account" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Check whether the authenticated user has voted for this issue.\nA 204 status code indicates that the user has voted, while a 404\nimplies they haven't.", "responses": { "401": { "description": "When the request wasn't authenticated.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the authenticated user has not voted for this issue, or when the repo does not exist, or does not have an issue tracker.", "schema": { "$ref": "#/definitions/error" } }, "204": { "description": "If the authenticated user has not voted for this issue.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "required": true, "type": "integer", "description": "The issue's id", "name": "issue_id", "in": "path" } ], "tags": [ "issue_tracker" ] } }, "/repositories/{username}/{repo_slug}/milestones": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" } ], "get": { "security": [ { "oauth2": [ "issue" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the milestones that have been defined in the issue tracker.\n\nThis resource is only available on repositories that have the issue\ntracker enabled.", "responses": { "200": { "description": "The milestones that have been defined in the issue tracker.", "schema": { "$ref": "#/definitions/paginated_milestones" } }, "404": { "description": "If the specified repository does not exist, or if the repository doesn't have the issue tracker enabled.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "issue_tracker" ] } }, "/repositories/{username}/{repo_slug}/components": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" } ], "get": { "security": [ { "oauth2": [ "issue" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the components that have been defined in the issue tracker.\n\nThis resource is only available on repositories that have the issue\ntracker enabled.", "responses": { "200": { "description": "The components that have been defined in the issue tracker.", "schema": { "$ref": "#/definitions/paginated_components" } }, "404": { "description": "If the specified repository does not exist, or if the repository doesn't have the issue tracker enabled.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "issue_tracker" ] } }, "/account/{username}/addons/{encoded_context_id}/refresh": { "put": { "security": [ { "oauth2": [ "account:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "addon" ] }, "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "encoded_context_id", "in": "path" } ] }, "/addon/linkers/{linker_key}/values": { "put": { "security": [ { "oauth2": [] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "addon" ] }, "post": { "security": [ { "oauth2": [] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "addon" ] }, "delete": { "security": [ { "oauth2": [] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "addon" ] }, "parameters": [ { "required": true, "type": "string", "name": "linker_key", "in": "path" } ], "get": { "security": [ { "oauth2": [] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "addon" ] } }, "/repositories/{username}/{repo_slug}/refs/branches": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" } ], "get": { "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "refs" ] } }, "/hook_events/{subject_type}": { "parameters": [ { "required": true, "type": "string", "name": "subject_type", "in": "path" } ], "get": { "security": [ { "oauth2": [] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns a paginated list of all valid webhook events for the\nspecified entity.\n\nThis is public data that does not require any scopes or authentication.", "responses": { "200": { "description": "A paginated list of webhook types available to subscribe on.", "schema": { "$ref": "#/definitions/paginated_hook_events" } }, "404": { "description": "If an invalid `{subject_type}` value was specified.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "enum": [ "user", "repository", "team" ], "name": "subject_type", "required": true, "in": "path", "type": "string", "description": "A resource or subject type." } ], "tags": [ "webhooks" ] } }, "/users/{username}/followers": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" } ], "get": { "security": [ { "oauth2": [] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the list of accounts that are following this team.", "responses": { "200": { "description": "A paginated list of user objects.", "schema": { "$ref": "#/definitions/paginated_users" } }, "404": { "description": "If no account exists for the specified name, or if the specified account is a team account, not a personal account.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "required": true, "type": "string", "description": "The account's username", "name": "username", "in": "path" } ], "tags": [ "users" ] } }, "/repositories/{username}/{repo_slug}/default-reviewers": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" } ], "get": { "security": [ { "oauth2": [ "repository:admin" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the repository's default reviewers.\n\nThese are the users that are automatically added as reviewers on every\nnew pull request that is created.", "responses": { "200": { "description": "The paginated list of default reviewers" } }, "parameters": [], "tags": [ "pullrequests" ] } }, "/repositories/{username}/{repo_slug}/downloads/{filename}": { "delete": { "security": [ { "oauth2": [ "repository:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Deletes the specified download artifact from the repository.", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "downloads" ] }, "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "type": "string", "name": "filename", "in": "path" } ], "get": { "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Return a redirect to the contents of a download artifact.\n\nThis endpoint returns the actual file contents and not the artifact's\nmetadata.\n\n $ curl -s -L https://api.bitbucket.org/2.0/repositories/evzijst/git-tests/downloads/hello.txt\n Hello World", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "downloads" ] } }, "/repositories/{username}/{repo_slug}/commit/{node}/statuses/build/{key}": { "put": { "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [] }, "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "type": "string", "name": "node", "in": "path" }, { "required": true, "type": "string", "name": "key", "in": "path" } ], "get": { "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [] } }, "/repositories/{username}/{repo_slug}/watchers": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" } ], "get": { "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns a paginated list of all the watchers on the specified\nrepository.", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "repositories" ] } }, "/snippets/{username}/{encoded_id}/commits": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "encoded_id", "in": "path" } ], "get": { "security": [ { "oauth2": [ "snippet" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the changes (commits) made on this snippet.", "responses": { "200": { "description": "The paginated list of snippet commits.", "schema": { "$ref": "#/definitions/paginated_snippet_commit" } }, "403": { "description": "If the authenticated user does not have access to the snippet.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the snippet does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "snippets" ] } }, "/users/{username}/repositories": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" } ], "get": { "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "All repositories owned by a user/team. This includes private\nrepositories, but filtered down to the ones that the calling user has\naccess to.", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "users", "teams" ] } }, "/repositories/{username}/{repo_slug}/pullrequests/activity": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" } ], "get": { "security": [ { "oauth2": [ "pullrequest" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the pull request's activity log. This includes comments that\nwere made by the reviewers, updates and approvals.", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "pullrequests" ] } }, "/snippets/{username}/{encoded_id}/comments/{comment_id}": { "put": { "security": [ { "oauth2": [ "snippet" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Updates a comment.\n\nComments can only be updated by their author.", "responses": { "200": { "description": "The updated comment object." }, "403": { "description": "If the authenticated user does not have access to the snippet.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the comment or snippet does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "snippets" ] }, "delete": { "security": [ { "oauth2": [ "snippet" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Deletes a snippet comment.\n\nComments can only be removed by their author.", "responses": { "204": { "description": "Indicates the comment was deleted successfully." }, "403": { "description": "If the authenticated user is not the author of the comment.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the comment or the snippet does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "snippets" ] }, "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "encoded_id", "in": "path" }, { "required": true, "type": "string", "name": "comment_id", "in": "path" } ], "get": { "security": [ { "oauth2": [ "snippet" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the specific snippet comment.", "responses": { "200": { "description": "The specified comment.", "schema": { "$ref": "#/definitions/snippet_comment" } }, "403": { "description": "If the authenticated user does not have access to the snippet.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the comment or snippet does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "snippets" ] } }, "/repositories/{username}/{repo_slug}/diff/{spec}": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "type": "string", "name": "spec", "in": "path" } ], "get": { "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "commits" ] } }, "/repositories/{username}/{repo_slug}/branch-restrictions": { "post": { "security": [ { "oauth2": [ "repository:admin" ] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "branch_restrictions" ] }, "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" } ], "get": { "security": [ { "oauth2": [ "repository:admin" ] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "branch_restrictions" ] } }, "/repositories/{username}/{repo_slug}/issues/{issue_id}/comments/{comment_id}": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "type": "string", "name": "issue_id", "in": "path" }, { "required": true, "type": "string", "name": "comment_id", "in": "path" } ], "get": { "security": [ { "oauth2": [ "issue" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the specified issue comment object.", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "issue_tracker" ] } }, "/repositories/{username}/{repo_slug}/hooks/{uid}": { "put": { "security": [ { "oauth2": [ "webhook" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Updates the specified webhook subscription.\n\nThe following properties can be mutated:\n\n* `description`\n* `url`\n* `active`\n* `events`", "responses": { "200": { "description": "The webhook subscription object.", "schema": { "$ref": "#/definitions/webhook_subscription" } }, "403": { "description": "If the authenticated user does not have permission to update the webhook.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the webhook or repository does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "required": true, "type": "string", "description": "The installed webhook's id", "name": "uid", "in": "path" } ], "tags": [ "webhooks" ] }, "delete": { "security": [ { "oauth2": [ "webhook" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Deletes the specified webhook subscription.", "responses": { "204": { "description": "When the webhook was deleted successfully", "schema": { "$ref": "#/definitions/webhook_subscription" } }, "403": { "description": "If the authenticated user does not have permission to delete the webhook.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the webhook or repository does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "required": true, "type": "string", "description": "The installed webhook's id", "name": "uid", "in": "path" } ], "tags": [ "webhooks" ] }, "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "type": "string", "name": "uid", "in": "path" } ], "get": { "security": [ { "oauth2": [ "webhook" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the webhook installed on the specified repository.", "responses": { "200": { "description": "The webhook subscription object.", "schema": { "$ref": "#/definitions/webhook_subscription" } }, "404": { "description": "If the webhook or repository does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "required": true, "type": "string", "description": "The installed webhook's id.", "name": "uid", "in": "path" } ], "tags": [ "webhooks" ] } }, "/users/{username}": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" } ], "get": { "security": [ { "oauth2": [] }, { "basic": [] }, { "api_key": [] } ], "description": "Gets the public information associated with a user account.\n\nIf the user's profile is private, `location`, `website` and\n`created_on` elements are omitted.", "responses": { "200": { "description": "The user object", "schema": { "$ref": "#/definitions/team" } }, "404": { "description": "If no user exists for the specified name or UUID, or if the specified account is a team account, not a personal account.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "required": true, "type": "string", "description": "The account's username or UUID.", "name": "username", "in": "path" } ], "tags": [ "users" ] } }, "/snippets/{username}/{encoded_id}": { "put": { "responses": { "200": { "description": "The updated snippet object.", "schema": { "$ref": "#/definitions/snippet" } }, "401": { "description": "If the snippet is private and the request was not authenticated.", "schema": { "$ref": "#/definitions/error" } }, "403": { "description": "If authenticated user does not have permission to update the private snippet.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the snippet does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "required": true, "type": "string", "description": "The snippet's id.", "name": "encoded_id", "in": "path" } ], "tags": [ "snippets" ], "produces": [ "application/json", "multipart/related", "multipart/form-data" ], "security": [ { "oauth2": [ "snippet:write" ] }, { "basic": [] }, { "api_key": [] } ], "consumes": [ "application/json", "multipart/related", "multipart/form-data" ], "description": "Used to update a snippet. Use this to add and delete files and to\nchange a snippet's title.\n\nTo update a snippet, one can either PUT a full snapshot, or only the\nparts that need to be changed.\n\nThe contract for PUT on this API is that properties missing from the\nrequest remain untouched so that snippets can be efficiently\nmanipulated with differential payloads.\n\nTo delete a property (e.g. the title, or a file), include its name in\nthe request, but omit its value (use `null`).\n\nAs in Git, explicit renaming of files is not supported. Instead, to\nrename a file, delete it and add it again under another name. This can\nbe done atomically in a single request. Rename detection is left to\nthe SCM.\n\nPUT supports three different content types for both request and\nresponse bodies:\n\n* `application/json`\n* `multipart/related`\n* `multipart/form-data`\n\nThe content type used for the request body can be different than that\nused for the response. Content types are specified using standard HTTP\nheaders.\n\nUse the `Content-Type` and `Accept` headers to select the desired\nrequest and response format.\n\n\napplication/json\n----------------\n\nAs with creation and retrieval, the content type determines what\nproperties can be manipulated. `application/json` does not support\nfile contents and is therefore limited to a snippet's meta data.\n\nTo update the title, without changing any of its files:\n\n $ curl -X POST -H \"Content-Type: application/json\" https://api.bitbucket.org/2.0/snippets/evzijst/kypj -d '{\"title\": \"Updated title\"}'\n\n\nTo delete the title:\n\n $ curl -X POST -H \"Content-Type: application/json\" https://api.bitbucket.org/2.0/snippets/evzijst/kypj -d '{\"title\": null}'\n\nNot all parts of a snippet can be manipulated. The owner and creator\nfor instance are immutable.\n\n\nmultipart/related\n-----------------\n\n`multipart/related` can be used to manipulate all of a snippet's\nproperties. The body is identical to a POST. properties omitted from\nthe request are left unchanged. Since the `start` part contains JSON,\nthe mechanism for manipulating the snippet's meta data is identical\nto `application/json` requests.\n\nTo update one of a snippet's file contents, while also changing its\ntitle:\n\n PUT /2.0/snippets/evzijst/kypj HTTP/1.1\n Content-Length: 288\n Content-Type: multipart/related; start=\"snippet\"; boundary=\"===============1438169132528273974==\"\n MIME-Version: 1.0\n\n --===============1438169132528273974==\n Content-Type: application/json; charset=\"utf-8\"\n MIME-Version: 1.0\n Content-ID: snippet\n\n {\n \"title\": \"My updated snippet\",\n \"files\": {\n \"foo.txt\": {}\n }\n }\n\n --===============1438169132528273974==\n Content-Type: text/plain; charset=\"us-ascii\"\n MIME-Version: 1.0\n Content-Transfer-Encoding: 7bit\n Content-ID: \"foo.txt\"\n Content-Disposition: attachment; filename=\"foo.txt\"\n\n Updated file contents.\n\n --===============1438169132528273974==--\n\nHere only the parts that are changed are included in the body. The\nother files remain untouched.\n\nNote the use of the `files` list in the JSON part. This list contains\nthe files that are being manipulated. This list should have\ncorresponding multiparts in the request that contain the new contents\nof these files.\n\nIf a filename in the `files` list does not have a corresponding part,\nit will be deleted from the snippet, as shown below:\n\n PUT /2.0/snippets/evzijst/kypj HTTP/1.1\n Content-Length: 188\n Content-Type: multipart/related; start=\"snippet\"; boundary=\"===============1438169132528273974==\"\n MIME-Version: 1.0\n\n --===============1438169132528273974==\n Content-Type: application/json; charset=\"utf-8\"\n MIME-Version: 1.0\n Content-ID: snippet\n\n {\n \"files\": {\n \"image.png\": {}\n }\n }\n\n --===============1438169132528273974==--\n\nTo simulate a rename, delete a file and add the same file under\nanother name:\n\n PUT /2.0/snippets/evzijst/kypj HTTP/1.1\n Content-Length: 212\n Content-Type: multipart/related; start=\"snippet\"; boundary=\"===============1438169132528273974==\"\n MIME-Version: 1.0\n\n --===============1438169132528273974==\n Content-Type: application/json; charset=\"utf-8\"\n MIME-Version: 1.0\n Content-ID: snippet\n\n {\n \"files\": {\n \"foo.txt\": {},\n \"bar.txt\": {}\n }\n }\n\n --===============1438169132528273974==\n Content-Type: text/plain; charset=\"us-ascii\"\n MIME-Version: 1.0\n Content-Transfer-Encoding: 7bit\n Content-ID: \"bar.txt\"\n Content-Disposition: attachment; filename=\"bar.txt\"\n\n foo\n\n --===============1438169132528273974==--\n\n\nmultipart/form-data\n-----------------\n\nAgain, one can also use `multipart/form-data` to manipulate file\ncontents and meta data atomically.\n\n $ curl -X PUT http://localhost:12345/2.0/snippets/evzijst/kypj -F title=\"My updated snippet\" -F file=@foo.txt\n\n PUT /2.0/snippets/evzijst/kypj HTTP/1.1\n Content-Length: 351\n Content-Type: multipart/form-data; boundary=----------------------------63a4b224c59f\n\n ------------------------------63a4b224c59f\n Content-Disposition: form-data; name=\"file\"; filename=\"foo.txt\"\n Content-Type: text/plain\n\n foo\n\n ------------------------------63a4b224c59f\n Content-Disposition: form-data; name=\"title\"\n\n My updated snippet\n ------------------------------63a4b224c59f\n\nTo delete a file, omit its contents while including its name in the\n`files` field:\n\n $ curl -X PUT https://api.bitbucket.org/2.0/snippets/evzijst/kypj -F files=image.png\n\n PUT /2.0/snippets/evzijst/kypj HTTP/1.1\n Content-Length: 149\n Content-Type: multipart/form-data; boundary=----------------------------ef8871065a86\n\n ------------------------------ef8871065a86\n Content-Disposition: form-data; name=\"files\"\n\n image.png\n ------------------------------ef8871065a86--\n\nThe explicit use of the `files` element in `multipart/related` and\n`multipart/form-data` is only required when deleting files.\nThe default mode of operation is for file parts to be processed,\nregardless of whether or not they are listed in `files`, as a\nconvenience to the client." }, "delete": { "security": [ { "oauth2": [ "snippet:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Deletes a snippet and returns an empty response.", "responses": { "401": { "description": "If the snippet is private and the request was not authenticated.", "schema": { "$ref": "#/definitions/error" } }, "403": { "description": "If authenticated user does not have permission to delete the private snippet.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the snippet does not exist.", "schema": { "$ref": "#/definitions/error" } }, "204": { "description": "If the snippet was deleted successfully." } }, "parameters": [ { "required": true, "type": "string", "description": "The snippet's id.", "name": "encoded_id", "in": "path" } ], "tags": [ "snippets" ] }, "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "encoded_id", "in": "path" } ], "get": { "responses": { "200": { "description": "The snippet object.", "schema": { "$ref": "#/definitions/snippet" } }, "401": { "description": "If the snippet is private and the request was not authenticated.", "schema": { "$ref": "#/definitions/error" } }, "403": { "description": "If authenticated user does not have access to the private snippet.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the snippet does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "required": true, "type": "string", "description": "The snippet's id.", "name": "encoded_id", "in": "path" } ], "produces": [ "application/json", "multipart/related", "multipart/form-data" ], "tags": [ "snippets" ], "security": [ { "oauth2": [ "snippet" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Retrieves a single snippet.\n\nSnippets support multiple content types:\n\n* application/json\n* multipart/related\n* multipart/form-data\n\n\napplication/json\n----------------\n\nThe default content type of the response is `application/json`.\nSince JSON is always `utf-8`, it cannot reliably contain file contents\nfor files that are not text. Therefore, JSON snippet documents only\ncontain the filename and links to the file contents.\n\nThis means that in order to retrieve all parts of a snippet, N+1\nrequests need to be made (where N is the number of files in the\nsnippet).\n\n\nmultipart/related\n-----------------\n\nTo retrieve an entire snippet in a single response, use the\n`Accept: multipart/related` HTTP request header.\n\n $ curl -H \"Accept: multipart/related\" https://api.bitbucket.org/2.0/snippets/evzijst/1\n\nResponse:\n\n HTTP/1.1 200 OK\n Content-Length: 2214\n Content-Type: multipart/related; start=\"snippet\"; boundary=\"===============1438169132528273974==\"\n MIME-Version: 1.0\n\n --===============1438169132528273974==\n Content-Type: application/json; charset=\"utf-8\"\n MIME-Version: 1.0\n Content-ID: snippet\n\n {\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/snippets/evzijst/kypj\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/snippets/evzijst/kypj\"\n },\n \"comments\": {\n \"href\": \"https://api.bitbucket.org/2.0/snippets/evzijst/kypj/comments\"\n },\n \"watchers\": {\n \"href\": \"https://api.bitbucket.org/2.0/snippets/evzijst/kypj/watchers\"\n },\n \"commits\": {\n \"href\": \"https://api.bitbucket.org/2.0/snippets/evzijst/kypj/commits\"\n }\n },\n \"id\": kypj,\n \"title\": \"My snippet\",\n \"created_on\": \"2014-12-29T22:22:04.790331+00:00\",\n \"updated_on\": \"2014-12-29T22:22:04.790331+00:00\",\n \"is_private\": false,\n \"files\": {\n \"foo.txt\": {\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/snippets/evzijst/kypj/files/367ab19/foo.txt\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/snippets/evzijst/kypj#foo.txt\"\n }\n }\n },\n \"image.png\": {\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/snippets/evzijst/kypj/files/367ab19/image.png\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/snippets/evzijst/kypj#image.png\"\n }\n }\n }\n ],\n \"owner\": {\n \"username\": \"evzijst\",\n \"display_name\": \"Erik van Zijst\",\n \"uuid\": \"{d301aafa-d676-4ee0-88be-962be7417567}\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/evzijst\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/evzijst\"\n },\n \"avatar\": {\n \"href\": \"https://bitbucket-staging-assetroot.s3.amazonaws.com/c/photos/2013/Jul/31/erik-avatar-725122544-0_avatar.png\"\n }\n }\n },\n \"creator\": {\n \"username\": \"evzijst\",\n \"display_name\": \"Erik van Zijst\",\n \"uuid\": \"{d301aafa-d676-4ee0-88be-962be7417567}\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/evzijst\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/evzijst\"\n },\n \"avatar\": {\n \"href\": \"https://bitbucket-staging-assetroot.s3.amazonaws.com/c/photos/2013/Jul/31/erik-avatar-725122544-0_avatar.png\"\n }\n }\n }\n }\n\n --===============1438169132528273974==\n Content-Type: text/plain; charset=\"us-ascii\"\n MIME-Version: 1.0\n Content-Transfer-Encoding: 7bit\n Content-ID: \"foo.txt\"\n Content-Disposition: attachment; filename=\"foo.txt\"\n\n foo\n\n --===============1438169132528273974==\n Content-Type: image/png\n MIME-Version: 1.0\n Content-Transfer-Encoding: base64\n Content-ID: \"image.png\"\n Content-Disposition: attachment; filename=\"image.png\"\n\n iVBORw0KGgoAAAANSUhEUgAAABQAAAAoCAYAAAD+MdrbAAABD0lEQVR4Ae3VMUoDQRTG8ccUaW2m\n TKONFxArJYJamCvkCnZTaa+VnQdJSBFl2SMsLFrEWNjZBZs0JgiL/+KrhhVmJRbCLPx4O+/DT2TB\n cbblJxf+UWFVVRNsEGAtgvJxnLm2H+A5RQ93uIl+3632PZyl/skjfOn9Gvdwmlcw5aPUwimG+NT5\n EnNN036IaZePUuIcK533NVfal7/5yjWeot2z9ta1cAczHEf7I+3J0ws9Cgx0fsOFpmlfwKcWPuBQ\n 73Oc4FHzBaZ8llq4q1mr5B2mOUCt815qYR8eB1hG2VJ7j35q4RofaH7IG+Xrf/PfJhfmwtfFYoIN\n AqxFUD6OMxcvkO+UfKfkOyXfKdsv/AYCHMLVkHAFWgAAAABJRU5ErkJggg==\n --===============1438169132528273974==--\n\nmultipart/form-data\n-------------------\n\nAs with creating new snippets, `multipart/form-data` can be used as an\nalternative to `multipart/related`. However, the inherently flat\nstructure of form-data means that only basic, root-level properties\ncan be returned, while nested elements like `links` are omitted:\n\n $ curl -H \"Accept: multipart/form-data\" https://api.bitbucket.org/2.0/snippets/evzijst/kypj\n\nResponse:\n\n HTTP/1.1 200 OK\n Content-Length: 951\n Content-Type: multipart/form-data; boundary=----------------------------63a4b224c59f\n\n ------------------------------63a4b224c59f\n Content-Disposition: form-data; name=\"title\"\n Content-Type: text/plain; charset=\"utf-8\"\n\n My snippet\n ------------------------------63a4b224c59f--\n Content-Disposition: attachment; name=\"file\"; filename=\"foo.txt\"\n Content-Type: text/plain\n\n foo\n\n ------------------------------63a4b224c59f\n Content-Disposition: attachment; name=\"file\"; filename=\"image.png\"\n Content-Transfer-Encoding: base64\n Content-Type: application/octet-stream\n\n iVBORw0KGgoAAAANSUhEUgAAABQAAAAoCAYAAAD+MdrbAAABD0lEQVR4Ae3VMUoDQRTG8ccUaW2m\n TKONFxArJYJamCvkCnZTaa+VnQdJSBFl2SMsLFrEWNjZBZs0JgiL/+KrhhVmJRbCLPx4O+/DT2TB\n cbblJxf+UWFVVRNsEGAtgvJxnLm2H+A5RQ93uIl+3632PZyl/skjfOn9Gvdwmlcw5aPUwimG+NT5\n EnNN036IaZePUuIcK533NVfal7/5yjWeot2z9ta1cAczHEf7I+3J0ws9Cgx0fsOFpmlfwKcWPuBQ\n 73Oc4FHzBaZ8llq4q1mr5B2mOUCt815qYR8eB1hG2VJ7j35q4RofaH7IG+Xrf/PfJhfmwtfFYoIN\n AqxFUD6OMxcvkO+UfKfkOyXfKdsv/AYCHMLVkHAFWgAAAABJRU5ErkJggg==\n ------------------------------5957323a6b76--" } }, "/addon/linkers": { "parameters": [], "get": { "security": [ { "oauth2": [] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "addon" ] } }, "/repositories/{username}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "type": "string", "name": "pull_request_id", "in": "path" }, { "required": true, "type": "string", "name": "comment_id", "in": "path" } ], "get": { "security": [ { "oauth2": [ "pullrequest" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns a specific pull request comment.", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "pullrequests" ] } }, "/repositories/{username}/{repo_slug}/components/{component_id}": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "type": "string", "name": "component_id", "in": "path" } ], "get": { "security": [ { "oauth2": [ "issue" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the specified issue tracker component object.", "responses": { "200": { "description": "The specified component object.", "schema": { "$ref": "#/definitions/component" } }, "404": { "description": "If the specified repository or component does not exist, or if the repository doesn't have the issue tracker enabled.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "required": true, "type": "integer", "description": "The component's id", "name": "component_id", "in": "path" } ], "tags": [ "issue_tracker" ] } }, "/addon": { "put": { "security": [ { "oauth2": [] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "addon" ] }, "parameters": [], "delete": { "security": [ { "oauth2": [] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "addon" ] } }, "/users/{username}/following": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" } ], "get": { "security": [ { "oauth2": [ "account" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the list of accounts this user is following.", "responses": { "200": { "description": "A paginated list of user objects.", "schema": { "$ref": "#/definitions/paginated_users" } }, "404": { "description": "If no user exists for the specified name, or if the specified account is a team account, not a personal account.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "required": true, "type": "string", "description": "The user's username", "name": "username", "in": "path" } ], "tags": [ "users" ] } }, "/repositories/{username}/{repo_slug}/issues/{issue_id}": { "delete": { "security": [ { "oauth2": [ "issue:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Deletes the specified issue. This requires write access to the\nrepository.", "responses": { "200": { "description": "The issue object.", "schema": { "$ref": "#/definitions/issue" } }, "403": { "description": "When the authenticated user lacks isn't authorized to delete the issue tracker.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the specified repository or issue does not exist, or if the repository doesn't have the issue tracker enabled.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "issue_tracker" ] }, "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "type": "string", "name": "issue_id", "in": "path" } ], "get": { "security": [ { "oauth2": [ "issue" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the specified issue.", "responses": { "200": { "description": "The issue object.", "schema": { "$ref": "#/definitions/issue" } }, "403": { "description": "When the authenticated user lacks isn't authorized to access the issue tracker.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the specified repository or issue does not exist, or if the repository doesn't have the issue tracker enabled.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "issue_tracker" ] } }, "/teams/{username}/repositories": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" } ], "get": { "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "All repositories owned by a user/team. This includes private\nrepositories, but filtered down to the ones that the calling user has\naccess to.", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "users", "teams" ] } }, "/repositories/{username}/{repo_slug}/downloads": { "post": { "security": [ { "oauth2": [ "repository:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Upload new download artifacts.\n\nTo upload files, perform a `multipart/form-data` POST containing one\nor more `files` fields:\n\n $ echo Hello World > hello.txt\n $ curl -s -u evzijst -X POST https://api.bitbucket.org/2.0/repositories/evzijst/git-tests/downloads -F files=@hello.txt\n\nWhen a file is uploaded with the same name as an existing artifact,\nthen the existing file will be replaced.", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "downloads" ] }, "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" } ], "get": { "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns a list of download links associated with the repository.", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "downloads" ] } }, "/repositories/{username}/{repo_slug}/refs": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" } ], "get": { "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "refs" ] } }, "/hook_events": { "parameters": [], "get": { "security": [ { "oauth2": [] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the webhook resource or subject types on which webhooks can\nbe registered.\n\nEach resource/subject type contains an `event` link that returns the\npaginated list of specific events each individual subject type can\nemit.\n\nThis endpoint is publicly accessible and does not require\nauthentication or scopes.", "responses": { "200": { "description": "A mapping of resource/subject types pointing to their individual event types.", "schema": { "$ref": "#/definitions/subject_types" } } }, "parameters": [], "tags": [ "webhooks" ] } }, "/teams/{username}": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" } ], "get": { "security": [ { "oauth2": [] }, { "basic": [] }, { "api_key": [] } ], "description": "Gets the public information associated with a team.\n\nIf the team's profile is private, `location`, `website` and\n`created_on` elements are omitted.", "responses": { "200": { "description": "The team object", "schema": { "$ref": "#/definitions/team" } }, "404": { "description": "If no team exists for the specified name or UUID, or if the specified account is a personal account, not a team account.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "required": true, "type": "string", "description": "The team's username or UUID.", "name": "username", "in": "path" } ], "tags": [ "teams" ] } }, "/user/emails/{email}": { "parameters": [ { "required": true, "type": "string", "name": "email", "in": "path" } ], "get": { "security": [ { "oauth2": [ "email" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns details about a specific one of the authenticated user's\nemail addresses.\n\nDetails describe whether the address has been confirmed by the user and\nwhether it is the user's primary address or not.", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "users" ] } }, "/repositories/{username}/{repo_slug}/pullrequests/{pull_request_id}/approve": { "post": { "security": [ { "oauth2": [ "pullrequest:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Approve the specified pull request as the authenticated user.", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "pullrequests" ] }, "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "type": "string", "name": "pull_request_id", "in": "path" } ], "delete": { "security": [ { "oauth2": [ "pullrequest:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Redact the authenticated user's approval of the specified pull\nrequest.", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "pullrequests" ] } }, "/repositories/{username}/{repo_slug}/patch/{spec}": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "type": "string", "name": "spec", "in": "path" } ], "get": { "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "commits" ] } }, "/snippets/{username}/{encoded_id}/{node_id}/diff": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "encoded_id", "in": "path" }, { "required": true, "type": "string", "name": "node_id", "in": "path" } ], "get": { "security": [ { "oauth2": [ "snippet" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the diff of the specified commit against its first parent.\n\nNote that this resource is different in functionality from the `patch`\nresource.\n\nThe differences between a diff and a patch are:\n\n* patches have a commit header with the username, message, etc\n* diffs support the optional `path=foo/bar.py` query param to filter the\n diff to just that one file diff (not supported for patches)\n* for a merge, the diff will show the diff between the merge commit and\n its first parent (identical to how PRs work), while patch returns a\n response containing separate patches for each commit on the second\n parent's ancestry, up to the oldest common ancestor (identical to\n its reachability).\n\nNote that the character encoding of the contents of the diff is\nunspecified as Git and Mercurial do not track this, making it hard for\nBitbucket to reliably determine this.", "responses": { "200": { "description": "The raw diff contents." }, "403": { "description": "If the authenticated user does not have access to the snippet.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the snippet does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "type": "string", "description": "When used, only one the diff of the specified file will be returned.", "name": "path", "in": "query" }, { "required": true, "type": "string", "description": "The snippet id.", "name": "encoded_id", "in": "path" } ], "tags": [ "snippets" ] } }, "/repositories/{username}/{repo_slug}/forks": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" } ], "get": { "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns a paginated list of all the forks of the specified\nrepository.", "responses": { "200": { "description": "All forks.", "schema": { "$ref": "#/definitions/paginated_repositories" } } }, "parameters": [], "tags": [ "repositories" ] } }, "/repositories/{username}/{repo_slug}/issues": { "post": { "security": [ { "oauth2": [ "issue:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Creates a new issue.\n\nThis call requires authentication. Private repositories or private\nissue trackers require the caller to authenticate with an account that\nhas appropriate authorisation.\n\nThe authenticated user is used for the issue's `reporter` field.", "responses": { "201": { "headers": { "Location": { "type": "string", "description": "The (absolute) URL of the newly created issue." } }, "description": "The newly created issue.", "schema": { "$ref": "#/definitions/issue" } }, "403": { "description": "When the authenticated user lacks the privilege to create issues in the issue tracker.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the specified repository or version does not exist, or if the repository doesn't have the issue tracker enabled.", "schema": { "$ref": "#/definitions/error" } }, "401": { "description": "When the request wasn't authenticated.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "schema": { "$ref": "#/definitions/issue" }, "required": true, "description": "The new issue. Note that the only required element is `title`. All other elements can be omitted from the body.", "name": "_body", "in": "body" } ], "tags": [ "issue_tracker" ] }, "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" } ], "get": { "security": [ { "oauth2": [ "issue" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the issues in the issue tracker.", "responses": { "200": { "description": "A paginated list of the issues matching any filter criteria that were provided.", "schema": { "$ref": "#/definitions/paginated_issues" } }, "404": { "description": "If the specified repository or version does not exist, or if the repository doesn't have the issue tracker enabled.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "issue_tracker" ] } }, "/repositories/{username}/{repo_slug}/issues/{issue_id}/attachments": { "post": { "security": [ { "oauth2": [ "issue:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Upload new issue attachments.\n\nTo upload files, perform a `multipart/form-data` POST containing one\nor more file fields.\n\nWhen a file is uploaded with the same name as an existing attachment,\nthen the existing file will be replaced.", "responses": { "400": { "description": "If no files were uploaded, or if the wrong `Content-Type` was used." }, "201": { "headers": { "Location": { "type": "string", "description": "The URL to the issue's collection of attachments." } }, "description": "An empty response document." }, "404": { "description": "If the specified repository or issue does not exist, or if the repository doesn't have the issue tracker enabled.", "schema": { "$ref": "#/definitions/error" } }, "401": { "description": "If the issue tracker is private and the request was not authenticated." } }, "parameters": [ { "required": true, "type": "integer", "description": "The issue's id", "name": "issue_id", "in": "path" } ], "tags": [ "issue_tracker" ] }, "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "type": "string", "name": "issue_id", "in": "path" } ], "get": { "security": [ { "oauth2": [ "issue" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns all attachments for this issue.\n\nThis returns the files' meta data. This does not return the files'\nactual contents.\n\nThe files are always ordered by their upload date.", "responses": { "200": { "description": "A paginated list of all attachments for this issue.", "schema": { "$ref": "#/definitions/paginated_issue_attachments" } }, "401": { "description": "If the issue tracker is private and the request was not authenticated." }, "404": { "description": "If the specified repository or version does not exist, or if the repository doesn't have the issue tracker enabled.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "required": true, "type": "integer", "description": "The issue's id", "name": "issue_id", "in": "path" } ], "tags": [ "issue_tracker" ] } }, "/repositories/{username}/{repo_slug}/versions": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" } ], "get": { "security": [ { "oauth2": [ "issue" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the versions that have been defined in the issue tracker.\n\nThis resource is only available on repositories that have the issue\ntracker enabled.", "responses": { "200": { "description": "The versions that have been defined in the issue tracker.", "schema": { "$ref": "#/definitions/paginated_versions" } }, "404": { "description": "If the specified repository does not exist, or if the repository doesn't have the issue tracker enabled.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "issue_tracker" ] } }, "/repositories/{username}/{repo_slug}/refs/tags/{name}": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "type": "string", "name": "name", "in": "path" } ], "get": { "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "refs" ] } }, "/snippets/{username}/{encoded_id}/watch": { "put": { "security": [ { "oauth2": [ "snippet:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Used to start watching a specific snippet. Returns 204 (No Content).", "responses": { "401": { "description": "If the request was not authenticated.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the snippet does not exist.", "schema": { "$ref": "#/definitions/error" } }, "204": { "description": "Indicates the authenticated user is now watching the snippet.", "schema": { "$ref": "#/definitions/paginated_users" } } }, "parameters": [ { "required": true, "type": "string", "description": "The snippet id.", "name": "encoded_id", "in": "path" } ], "tags": [ "snippets" ] }, "delete": { "security": [ { "oauth2": [ "snippet:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Used to stop watching a specific snippet. Returns 204 (No Content)\nto indicate success.", "responses": { "401": { "description": "If the request was not authenticated.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the snippet does not exist.", "schema": { "$ref": "#/definitions/error" } }, "204": { "description": "Indicates the user stopped watching the snippet successfully.", "schema": { "$ref": "#/definitions/paginated_users" } } }, "parameters": [ { "required": true, "type": "string", "description": "The snippet id.", "name": "encoded_id", "in": "path" } ], "tags": [ "snippets" ] }, "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "encoded_id", "in": "path" } ], "get": { "security": [ { "oauth2": [ "snippet" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Used to check if the current user is watching a specific snippet.\n\nReturns 204 (No Content) if the user is watching the snippet and 404 if\nnot.\n\nHitting this endpoint anonymously always returns a 404.", "responses": { "204": { "description": "If the authenticated user is watching the snippet.", "schema": { "$ref": "#/definitions/paginated_users" } }, "404": { "description": "If the snippet does not exist, or if the authenticated user is not watching the snippet.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "required": true, "type": "string", "description": "The snippet id.", "name": "encoded_id", "in": "path" } ], "tags": [ "snippets" ] } }, "/repositories/{username}/{repo_slug}/pullrequests/{pull_request_id}/diff": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "type": "string", "name": "pull_request_id", "in": "path" } ], "get": { "security": [ { "oauth2": [ "pullrequest" ] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "pullrequests" ] } }, "/snippets": { "post": { "security": [ { "oauth2": [ "snippet:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Creates a new snippet under the authenticated user's account.\n\nSnippets can contain multiple files. Both text and binary files are\nsupported.\n\nThe simplest way to create a new snippet from a local file:\n\n $ curl -u username:password -X POST https://api.bitbucket.org/2.0/snippets -F file=@image.png\n\nCreating snippets through curl has a few limitations and so let's look\nat a more complicated scenario.\n\nSnippets are created with a multipart POST. Both `multipart/form-data`\nand `multipart/related` are supported. Both allow the creation of\nsnippets with both meta data (title, etc), as well as multiple text\nand binary files.\n\nThe main difference is that `multipart/related` can use rich encoding\nfor the meta data (currently JSON).\n\n\nmultipart/related (RFC-2387)\n----------------------------\n\nThis is the most advanced and efficient way to create a paste.\n\n POST /2.0/snippets/evzijst HTTP/1.1\n Content-Length: 1188\n Content-Type: multipart/related; start=\"snippet\"; boundary=\"===============1438169132528273974==\"\n MIME-Version: 1.0\n\n --===============1438169132528273974==\n Content-Type: application/json; charset=\"utf-8\"\n MIME-Version: 1.0\n Content-ID: snippet\n\n {\n \"title\": \"My snippet\",\n \"is_private\": true,\n \"scm\": \"hg\",\n \"files\": {\n \"foo.txt\": {},\n \"image.png\": {}\n }\n }\n\n --===============1438169132528273974==\n Content-Type: text/plain; charset=\"us-ascii\"\n MIME-Version: 1.0\n Content-Transfer-Encoding: 7bit\n Content-ID: \"foo.txt\"\n Content-Disposition: attachment; filename=\"foo.txt\"\n\n foo\n\n --===============1438169132528273974==\n Content-Type: image/png\n MIME-Version: 1.0\n Content-Transfer-Encoding: base64\n Content-ID: \"image.png\"\n Content-Disposition: attachment; filename=\"image.png\"\n\n iVBORw0KGgoAAAANSUhEUgAAABQAAAAoCAYAAAD+MdrbAAABD0lEQVR4Ae3VMUoDQRTG8ccUaW2m\n TKONFxArJYJamCvkCnZTaa+VnQdJSBFl2SMsLFrEWNjZBZs0JgiL/+KrhhVmJRbCLPx4O+/DT2TB\n cbblJxf+UWFVVRNsEGAtgvJxnLm2H+A5RQ93uIl+3632PZyl/skjfOn9Gvdwmlcw5aPUwimG+NT5\n EnNN036IaZePUuIcK533NVfal7/5yjWeot2z9ta1cAczHEf7I+3J0ws9Cgx0fsOFpmlfwKcWPuBQ\n 73Oc4FHzBaZ8llq4q1mr5B2mOUCt815qYR8eB1hG2VJ7j35q4RofaH7IG+Xrf/PfJhfmwtfFYoIN\n AqxFUD6OMxcvkO+UfKfkOyXfKdsv/AYCHMLVkHAFWgAAAABJRU5ErkJggg==\n --===============1438169132528273974==--\n\nThe request contains multiple parts and is structured as follows.\n\nThe first part is the JSON document that describes the snippet's\nproperties or meta data. It either has to be the first part, or the\nrequest's `Content-Type` header must contain the `start` parameter to\npoint to it.\n\nThe remaining parts are the files of which there can be zero or more.\nEach file part should contain the `Content-ID` MIME header through\nwhich the JSON meta data's `files` element addresses it. The value\nshould be the name of the file.\n\n`Content-Disposition` is an optional MIME header. The header's\noptional `filename` parameter can be used to specify the file name\nthat Bitbucket should use when writing the file to disk. When present,\n`filename` takes precedence over the value of `Content-ID`.\n\nWhen the JSON body omits the `files` element, the remaining parts are\nnot ignored. Instead, each file is added to the new snippet as if its\nname was explicitly linked (the use of the `files` elements is\nmandatory for some operations like deleting or renaming files).\n\n\nmultipart/form-data\n-------------------\n\nThe use of JSON for the snippet's meta data is optional. Meta data can\nalso be supplied as regular form fields in a more conventional\n`multipart/form-data` request:\n\n $ curl -X POST -u credentials https://api.bitbucket.org/2.0/snippets -F title=\"My snippet\" -F file=@foo.txt -F file=@image.png\n\n POST /2.0/snippets HTTP/1.1\n Content-Length: 951\n Content-Type: multipart/form-data; boundary=----------------------------63a4b224c59f\n\n ------------------------------63a4b224c59f\n Content-Disposition: form-data; name=\"file\"; filename=\"foo.txt\"\n Content-Type: text/plain\n\n foo\n\n ------------------------------63a4b224c59f\n Content-Disposition: form-data; name=\"file\"; filename=\"image.png\"\n Content-Type: application/octet-stream\n\n ?PNG\n\n IHDR?1??I.....\n ------------------------------63a4b224c59f\n Content-Disposition: form-data; name=\"title\"\n\n My snippet\n ------------------------------63a4b224c59f--\n\nHere the meta data properties are included as flat, top-level form\nfields. The file attachments use the `file` field name. To attach\nmultiple files, simply repeat the field.\n\nThe advantage of `multipart/form-data` over `multipart/related` is\nthat it can be easier to build clients.\n\nEssentially all properties are optional, `title` and `files` included.\n\n\nSharing and Visibility\n----------------------\n\nSnippets can be either public (visible to anyone on Bitbucket, as well\nas anonymous users), or private (visible only to the owner, creator\nand members of the team in case the snippet is owned by a team). This\nis controlled through the snippet's `is_private` element:\n\n* **is_private=false** -- everyone, including anonymous users can view\n the snippet\n* **is_private=true** -- only the owner and team members (for team\n snippets) can view it\n\nTo create the snippet under a team account, just append the team name\nto the URL (see `/2.0/snippets/{username}`).", "responses": { "201": { "headers": { "Location": { "type": "string", "description": "The URL of the newly created snippet." } }, "description": "The newly created snippet object.", "schema": { "$ref": "#/definitions/snippet" } }, "401": { "description": "If the request was not authenticated", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "schema": { "$ref": "#/definitions/snippet" }, "required": true, "description": "The new snippet object.", "name": "_body", "in": "body" } ], "tags": [ "snippets" ] }, "parameters": [], "get": { "security": [ { "oauth2": [ "snippet" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns all snippets. Like pull requests, repositories and teams, the\nfull set of snippets is defined by what the current user has access to.\n\nThis includes all snippets owned by the current user, but also all snippets\nowned by any of the teams the user is a member of, or snippets by other\nusers that the current user is either watching or has collaborated on (for\ninstance by commenting on it).\n\nTo limit the set of returned snippets, apply the\n`?role=[owner|contributor|member]` query parameter where the roles are\ndefined as follows:\n\n* `owner`: all snippets owned by the current user\n* `contributor`: all snippets owned by, or watched by the current user\n* `member`: owned by the user, their teams, or watched by the current user\n\nWhen no role is specified, all public snippets are returned, as well as all\nprivately owned snippets watched or commented on.\n\nThe returned response is a normal paginated JSON list. This endpoint\nonly supports `application/json` responses and no\n`multipart/form-data` or `multipart/related`. As a result, it is not\npossible to include the file contents.", "responses": { "200": { "description": "A paginated list of snippets.", "schema": { "$ref": "#/definitions/paginated_snippets" } }, "404": { "description": "If the snippet does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "enum": [ "owner", "contributor", "member" ], "name": "role", "required": false, "in": "query", "type": "string", "description": "Filter down the result based on the authenticated user's role (`owner`, `contributor`, or `member`)." } ], "tags": [ "snippets" ] } }, "/repositories/{username}/{repo_slug}/pullrequests/{pull_request_id}": { "put": { "security": [ { "oauth2": [ "pullrequest:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Mutates the specified pull request.\n\nThis can be used to change the pull request's branches or description.\n\nOnly open pull requests can be mutated.", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "pullrequests" ] }, "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "type": "string", "name": "pull_request_id", "in": "path" } ], "get": { "security": [ { "oauth2": [ "pullrequest" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the specified pull request.", "responses": { "200": { "description": "The pull request object", "schema": { "$ref": "#/definitions/pullrequest" } } }, "parameters": [], "tags": [ "pullrequests" ] } }, "/repositories/{username}/{repo_slug}/pullrequests/{pull_request_id}/comments": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "type": "string", "name": "pull_request_id", "in": "path" } ], "get": { "security": [ { "oauth2": [ "pullrequest" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns all the pull request's comments.\n\nThis includes both global, inline comments and replies.", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "pullrequests" ] } }, "/account/{username}/addons/{encoded_context_id}": { "put": { "security": [ { "oauth2": [ "account:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "addon" ] }, "delete": { "security": [ { "oauth2": [ "account:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "addon" ] }, "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "encoded_context_id", "in": "path" } ], "get": { "security": [ { "oauth2": [ "account:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "addon" ] } }, "/repositories/{username}/{repo_slug}/pullrequests/{pull_request_id}/decline": { "post": { "security": [ { "oauth2": [ "pullrequest:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "pullrequests" ] }, "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "type": "string", "name": "pull_request_id", "in": "path" } ] }, "/user/emails": { "parameters": [], "get": { "security": [ { "oauth2": [ "email" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns all the authenticated user's email addresses. Both\nconfirmed and unconfirmed.", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "users" ] } }, "/repositories/{username}/{repo_slug}/pullrequests": { "post": { "security": [ { "oauth2": [ "pullrequest:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Creates a new pull request.", "responses": { "201": { "headers": { "Location": { "type": "string", "description": "The URL of new newly created pull request." } }, "description": "The newly created pull request.", "schema": { "$ref": "#/definitions/pullrequest" } } }, "parameters": [ { "schema": { "$ref": "#/definitions/pullrequest" }, "required": false, "description": "The new pull request.\n\nThe request URL you POST to becomes the destination repository URL. For this reason, you must specify an explicit source repository in the request object if you want to pull from a different repository (fork).\n\nSince not all elements are required or even mutable, you only need to include the elements you want to initialize, such as the source branch and the title.", "name": "_body", "in": "body" } ], "tags": [ "pullrequests" ] }, "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" } ], "get": { "security": [ { "oauth2": [ "pullrequest" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns all pull requests on the specified repository.\n\nBy default only open pull requests are returned. This can be controlled\nusing the `state` query parameter. To retrieve pull requests that are\nin one of multiple states, repeat the `state` parameter for each\nindividual state.", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "enum": [ "MERGED", "SUPERSEDED", "OPEN", "DECLINED" ], "type": "string", "description": "Only return pull requests that in this state. This parameter can be repeated.", "name": "state", "in": "query" } ], "tags": [ "pullrequests" ] } }, "/repositories/{username}/{repo_slug}/commits": { "post": { "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Identical to `GET /repositories/{username}/{repo_slug}/commits`,\nexcept that POST allows clients to place the include and exclude\nparameters in the request body to avoid URL length issues.\n\n**Note that this resource does NOT support new commit creation.**", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "commits" ] }, "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" } ], "get": { "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "These are the repository's commits. They are paginated and returned\nin reverse chronological order, similar to the output of `git log` and\n`hg log`. Like these tools, the DAG can be filtered.\n\n## GET /repositories/{username}/{repo_slug}/commits/\n\nReturns all commits in the repo in topological order (newest commit\nfirst). All branches and tags are included (similar to\n`git log --all` and `hg log`).\n\n## GET /repositories/{username}/{repo_slug}/commits/master\n\nReturns all commits on rev `master` (similar to `git log master`,\n`hg log master`).\n\n## GET /repositories/{username}/{repo_slug}/commits/dev?exclude=master\n\nReturns all commits on ref `dev`, except those that are reachable on\n`master` (similar to `git log dev ^master`).\n\n## GET /repositories/{username}/{repo_slug}/commits/?exclude=master\n\nReturns all commits in the repo that are not on master\n(similar to `git log --all ^master`).\n\n## GET /repositories/{username}/{repo_slug}/commits/?include=foo&include=bar&exclude=fu&exclude=fubar\n\nReturns all commits that are on refs `foo` or `bar`, but not on `fu` or\n`fubar` (similar to `git log foo bar ^fu ^fubar`).\n\nBecause the response could include a very large number of commits, it\nis paginated. Follow the 'next' link in the response to navigate to the\nnext page of commits. As with other paginated resources, do not\nconstruct your own links.\n\nWhen the include and exclude parameters are more than ca fit in a\nquery string, clients can use a `x-www-form-urlencoded` POST instead.", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "commits" ] } }, "/repositories/{username}/{repo_slug}/commit/{sha}/comments": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "type": "string", "name": "sha", "in": "path" } ], "get": { "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the commit's comments.\n\nThis includes both global and inline comments.", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "commits" ] } }, "/repositories/{username}/{repo_slug}/commit/{revision}": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "type": "string", "name": "revision", "in": "path" } ], "get": { "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the specified commit.", "responses": { "200": { "description": "The commit object", "schema": { "$ref": "#/definitions/commit" } }, "404": { "description": "If the specified commit or repository does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "required": true, "type": "string", "description": "The commit's SHA1.", "name": "revision", "in": "path" } ], "tags": [ "commits" ] } }, "/snippets/{username}": { "post": { "security": [ { "oauth2": [ "snippet:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Identical to `/snippets`, except that the new snippet will be\ncreated under the account specified in the path parameter `{username}`.", "responses": { "201": { "headers": { "Location": { "type": "string", "description": "The URL of the newly created snippet." } }, "description": "The newly created snippet object.", "schema": { "$ref": "#/definitions/snippet" } }, "403": { "description": "If the authenticated user does not have permission to create snippets under the specified account.", "schema": { "$ref": "#/definitions/error" } }, "401": { "description": "If the request was not authenticated", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "schema": { "$ref": "#/definitions/snippet" }, "required": true, "description": "The new snippet object.", "name": "_body", "in": "body" } ], "tags": [ "snippets" ] }, "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" } ], "get": { "security": [ { "oauth2": [ "snippet" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Identical to `/snippets`, except that the result is further filtered\nby the snippet owner and only those that are owned by `{username}` are\nreturned.", "responses": { "200": { "description": "A paginated list of snippets.", "schema": { "$ref": "#/definitions/paginated_snippets" } }, "404": { "description": "If the user does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "enum": [ "owner", "contributor", "member" ], "name": "role", "required": false, "in": "query", "type": "string", "description": "Filter down the result based on the authenticated user's role (`owner`, `contributor`, or `member`)." }, { "required": true, "type": "string", "description": "Limits the result to snippets owned by this user.", "name": "username", "in": "path" } ], "tags": [ "snippets" ] } }, "/repositories/{username}/{repo_slug}/issues/{issue_id}/watch": { "put": { "security": [ { "oauth2": [ "issue", "account:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Start watching this issue.\n\nTo start watching this issue, do an empty PUT. The 204 status code\nindicates that the operation was successful.", "responses": { "401": { "description": "When the request wasn't authenticated.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the authenticated user is not watching this issue, or when the repo does not exist, or does not have an issue tracker.", "schema": { "$ref": "#/definitions/error" } }, "204": { "description": "Indicates that the authenticated user successfully started watching this issue.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "required": true, "type": "integer", "description": "The issue's id", "name": "issue_id", "in": "path" } ], "tags": [ "issue_tracker" ] }, "delete": { "security": [ { "oauth2": [ "issue:write", "account:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Stop watching this issue.", "responses": { "401": { "description": "When the request wasn't authenticated.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the issue or the repo does not exist, or the repository does not have an issue tracker.", "schema": { "$ref": "#/definitions/error" } }, "204": { "description": "Indicates that the authenticated user successfully stopped watching this issue.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "required": true, "type": "integer", "description": "The issue's id", "name": "issue_id", "in": "path" } ], "tags": [ "issue_tracker" ] }, "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "type": "string", "name": "issue_id", "in": "path" } ], "get": { "security": [ { "oauth2": [ "issue", "account" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Indicated whether or not the authenticated user is watching this\nissue.", "responses": { "401": { "description": "When the request wasn't authenticated.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the authenticated user is not watching this issue, or when the repo does not exist, or does not have an issue tracker.", "schema": { "$ref": "#/definitions/error" } }, "204": { "description": "If the authenticated user is watching this issue.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "required": true, "type": "integer", "description": "The issue's id", "name": "issue_id", "in": "path" } ], "tags": [ "issue_tracker" ] } }, "/repositories/{username}/{repo_slug}/milestones/{milestone_id}": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "type": "string", "name": "milestone_id", "in": "path" } ], "get": { "security": [ { "oauth2": [ "issue" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the specified issue tracker milestone object.", "responses": { "200": { "description": "The specified milestone object.", "schema": { "$ref": "#/definitions/milestone" } }, "404": { "description": "If the specified repository or milestone does not exist, or if the repository doesn't have the issue tracker enabled.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "required": true, "type": "integer", "description": "The milestone's id", "name": "milestone_id", "in": "path" } ], "tags": [ "issue_tracker" ] } }, "/teams": { "parameters": [], "get": { "security": [ { "oauth2": [ "team" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns all the teams that the authenticated user is associated\nwith.", "responses": { "200": { "description": "A paginated list of teams.", "schema": { "$ref": "#/definitions/paginated_teams" } }, "401": { "description": "When the request wasn't authenticated.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "enum": [ "admin", "contributor", "member" ], "name": "role", "required": false, "in": "query", "type": "string", "description": "\nFilters the teams based on the authenticated user's role on each team.\n\n* **member**: returns a list of all the teams which the caller is a member of\n at least one team group or repository owned by the team\n* **contributor**: returns a list of teams which the caller has write access\n to at least one repository owned by the team\n* **admin**: returns a list teams which the caller has team administrator access\n" } ], "tags": [ "teams" ] } }, "/user": { "parameters": [], "get": { "security": [ { "oauth2": [ "account" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the currently logged in user.", "responses": { "200": { "description": "The current user.", "schema": { "$ref": "#/definitions/user" } }, "401": { "description": "When the request wasn't authenticated.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "users" ] } }, "/repositories/{username}/{repo_slug}/commits/{revision}": { "post": { "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Identical to `GET /repositories/{username}/{repo_slug}/commits`,\nexcept that POST allows clients to place the include and exclude\nparameters in the request body to avoid URL length issues.\n\n**Note that this resource does NOT support new commit creation.**", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "commits" ] }, "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "type": "string", "name": "revision", "in": "path" } ], "get": { "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "These are the repository's commits. They are paginated and returned\nin reverse chronological order, similar to the output of `git log` and\n`hg log`. Like these tools, the DAG can be filtered.\n\n## GET /repositories/{username}/{repo_slug}/commits/\n\nReturns all commits in the repo in topological order (newest commit\nfirst). All branches and tags are included (similar to\n`git log --all` and `hg log`).\n\n## GET /repositories/{username}/{repo_slug}/commits/master\n\nReturns all commits on rev `master` (similar to `git log master`,\n`hg log master`).\n\n## GET /repositories/{username}/{repo_slug}/commits/dev?exclude=master\n\nReturns all commits on ref `dev`, except those that are reachable on\n`master` (similar to `git log dev ^master`).\n\n## GET /repositories/{username}/{repo_slug}/commits/?exclude=master\n\nReturns all commits in the repo that are not on master\n(similar to `git log --all ^master`).\n\n## GET /repositories/{username}/{repo_slug}/commits/?include=foo&include=bar&exclude=fu&exclude=fubar\n\nReturns all commits that are on refs `foo` or `bar`, but not on `fu` or\n`fubar` (similar to `git log foo bar ^fu ^fubar`).\n\nBecause the response could include a very large number of commits, it\nis paginated. Follow the 'next' link in the response to navigate to the\nnext page of commits. As with other paginated resources, do not\nconstruct your own links.\n\nWhen the include and exclude parameters are more than ca fit in a\nquery string, clients can use a `x-www-form-urlencoded` POST instead.", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "commits" ] } }, "/snippets/{username}/{encoded_id}/comments": { "post": { "security": [ { "oauth2": [ "snippet" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Creates a new comment.\n\nThe only required field in the body is `content.raw`.\n\nTo create a threaded reply to an existing comment, include `parent.id`.", "responses": { "201": { "headers": { "Location": { "type": "string", "description": "The URL of the new comment" } }, "description": "The newly created comment.", "schema": { "$ref": "#/definitions/snippet" } }, "403": { "description": "If the authenticated user does not have access to the snippet.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the snippet does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "schema": { "$ref": "#/definitions/snippet" }, "required": true, "description": "The contents of the new comment.", "name": "_body", "in": "body" } ], "tags": [ "snippets" ] }, "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "encoded_id", "in": "path" } ], "get": { "security": [ { "oauth2": [ "snippet" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Used to retrieve a paginated list of all comments for a specific\nsnippet.\n\nThis resource works identical to commit and pull request comments.", "responses": { "200": { "description": "A paginated list of snippet comments, ordered by creation date.", "schema": { "$ref": "#/definitions/paginated_snippet_comments" } }, "403": { "description": "If the authenticated user does not have access to the snippet.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the snippet does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "snippets" ] } }, "/repositories/{username}/{repo_slug}/pullrequests/{pull_request_id}/activity": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "type": "string", "name": "pull_request_id", "in": "path" } ], "get": { "security": [ { "oauth2": [ "pullrequest" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the pull request's activity log. This includes comments that\nwere made by the reviewers, updates and approvals.", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "pullrequests" ] } }, "/repositories/{username}": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" } ], "get": { "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns all repositories owned by the specified account.\n\nThe result can be narrowed down based on the authenticated user's role.\n\nE.g. with `?role=contributor`, only those repositories that the\nauthenticated user has write access to are returned (this includes any\nrepo the user is an admin on, as that implies write access).", "responses": { "200": { "description": "The repositories owned by the specified account.", "schema": { "$ref": "#/definitions/paginated_repositories" } }, "404": { "description": "If the specified account does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "enum": [ "admin", "contributor", "member", "owner" ], "name": "role", "required": false, "in": "query", "type": "string", "description": "\nFilters the result based on the authenticated user's role on each repository.\n\n* **member**: returns repositories to which the user has explicit read access\n* **contributor**: returns repositories to which the user has explicit write access\n* **admin**: returns repositories to which the user has explicit administrator access\n* **owner**: returns all repositories owned by the current user\n" } ], "tags": [ "repositories" ] } }, "/repositories/{username}/{repo_slug}/pullrequests/{pull_request_id}/merge": { "post": { "security": [ { "oauth2": [ "pullrequest:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "pullrequests" ] }, "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "type": "string", "name": "pull_request_id", "in": "path" } ] }, "/snippets/{username}/{encoded_id}/commits/": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "encoded_id", "in": "path" } ], "get": { "security": [ { "oauth2": [ "snippet" ] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "200": { "description": "The specified snippet commit.", "schema": { "$ref": "#/definitions/snippet_commit" } }, "403": { "description": "If the authenticated user does not have access to the snippet.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the commit or the snippet does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "snippets" ] } }, "/snippets/{username}/{encoded_id}/{node_id}/patch": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "encoded_id", "in": "path" }, { "required": true, "type": "string", "name": "node_id", "in": "path" } ], "get": { "security": [ { "oauth2": [ "snippet" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the patch of the specified commit against its first\nparent.\n\nNote that this resource is different in functionality from the `diff`\nresource.\n\nThe differences between a diff and a patch are:\n\n* patches have a commit header with the username, message, etc\n* diffs support the optional `path=foo/bar.py` query param to filter the\n diff to just that one file diff (not supported for patches)\n* for a merge, the diff will show the diff between the merge commit and\n its first parent (identical to how PRs work), while patch returns a\n response containing separate patches for each commit on the second\n parent's ancestry, up to the oldest common ancestor (identical to\n its reachability).\n\nNote that the character encoding of the contents of the patch is\nunspecified as Git and Mercurial do not track this, making it hard for\nBitbucket to reliably determine this.", "responses": { "200": { "description": "The raw patch contents." }, "403": { "description": "If the authenticated user does not have access to the snippet.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the snippet does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "required": true, "type": "string", "description": "The snippet id.", "name": "encoded_id", "in": "path" } ], "tags": [ "snippets" ] } }, "/teams/{username}/followers": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" } ], "get": { "security": [ { "oauth2": [] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the list of accounts that are following this team.", "responses": { "200": { "description": "A paginated list of user objects.", "schema": { "$ref": "#/definitions/paginated_users" } }, "404": { "description": "If no team exists for the specified name, or if the specified account is a personal account, not a team account.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "required": true, "type": "string", "description": "The team's username", "name": "username", "in": "path" } ], "tags": [ "teams" ] } }, "/snippets/{username}/{encoded_id}/{node_id}/files/{path}": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "encoded_id", "in": "path" }, { "required": true, "type": "string", "name": "node_id", "in": "path" }, { "required": true, "type": "string", "name": "path", "in": "path" } ], "get": { "security": [ { "oauth2": [ "snippet" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Retrieves the raw contents of a specific file in the snippet. The\n`Content-Disposition` header will be \"attachment\" to avoid issues with\nmalevolent executable files.\n\nThe file's mime type is derived from its filename and returned in the\n`Content-Type` header.\n\nNote that for text files, no character encoding is included as part of\nthe content type.", "responses": { "200": { "headers": { "Content-Type": { "type": "string", "description": "The mime type as derived from the filename" }, "Content-Disposition": { "type": "string", "description": "attachment" } }, "description": "Returns the contents of the specified file." }, "403": { "description": "If the authenticated user does not have access to the snippet.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the file or snippet does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "snippets" ] } }, "/addon/linkers/{linker_key}": { "parameters": [ { "required": true, "type": "string", "name": "linker_key", "in": "path" } ], "get": { "security": [ { "oauth2": [] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "addon" ] } }, "/repositories/{username}/{repo_slug}/refs/tags": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" } ], "get": { "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "refs" ] } }, "/repositories/{username}/{repo_slug}/commit/{node}/approve": { "post": { "security": [ { "oauth2": [ "repository:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Approve the specified commit as the authenticated user.\n\nThis operation is only available to users that have explicit access to\nthe repository. In contrast, just the fact that a repository is\npublicly accessible to users does not give them the ability to approve\ncommits.", "responses": { "200": { "description": "The `participant` object recording that the authenticated user approved the commit.", "schema": { "$ref": "#/definitions/participant" } }, "404": { "description": "If the specified commit, or the repository does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "required": true, "type": "string", "description": "The commit's SHA1.", "name": "node", "in": "path" } ], "tags": [ "commits" ] }, "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "type": "string", "name": "node", "in": "path" } ], "delete": { "security": [ { "oauth2": [ "repository:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Redact the authenticated user's approval of the specified commit.\n\nThis operation is only available to users that have explicit access to\nthe repository. In contrast, just the fact that a repository is\npublicly accessible to users does not give them the ability to approve\ncommits.", "responses": { "204": { "description": "An empty response indicating the authenticated user's approval has been withdrawn." }, "404": { "description": "If the specified commit, or the repository does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "required": true, "type": "string", "description": "The commit's SHA1.", "name": "node", "in": "path" } ], "tags": [ "commits" ] } }, "/account/{username}/addons": { "post": { "security": [ { "oauth2": [ "account:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "addon" ] }, "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" } ], "get": { "security": [ { "oauth2": [ "account:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "addon" ] } }, "/repositories/{username}/{repo_slug}/pullrequests/{pull_request_id}/commits": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "type": "string", "name": "pull_request_id", "in": "path" } ], "get": { "security": [ { "oauth2": [ "pullrequest" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the pull request's commits.\n\nThese are the commits that are being merged into the destination\nbranch when the pull requests gets accepted.", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "pullrequests" ] } }, "/snippets/{username}/{encoded_id}/watchers": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "encoded_id", "in": "path" } ], "get": { "responses": { "200": { "description": "The paginated list of users watching this snippet", "schema": { "$ref": "#/definitions/paginated_users" } }, "404": { "description": "If the snippet does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "required": true, "type": "string", "description": "The snippet id.", "name": "encoded_id", "in": "path" } ], "tags": [ "snippets" ], "deprecated": true, "security": [ { "oauth2": [ "snippet" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns a paginated list of all users watching a specific snippet." } }, "/repositories/{username}/{repo_slug}/branch-restrictions/{id}": { "put": { "security": [ { "oauth2": [ "repository:admin" ] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "branch_restrictions" ] }, "delete": { "security": [ { "oauth2": [ "repository:admin" ] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "branch_restrictions" ] }, "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "type": "string", "name": "id", "in": "path" } ], "get": { "security": [ { "oauth2": [ "repository:admin" ] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "branch_restrictions" ] } }, "/repositories/{username}/{repo_slug}/commit/{node}/statuses/build": { "post": { "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [] }, "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "type": "string", "name": "node", "in": "path" } ] }, "/repositories/{username}/{repo_slug}": { "post": { "security": [ { "oauth2": [ "repository:admin" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Creates a new repository.", "responses": { "200": { "description": "The newly created repository.", "schema": { "$ref": "#/definitions/repository" } }, "401": { "description": "If the request was not authenticated.", "schema": { "$ref": "#/definitions/error" } }, "400": { "description": "If the input document was invalid, or if the caller lacks the privilege to create repositories under the targeted account.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "schema": { "$ref": "#/definitions/repository" }, "required": false, "description": "The repository that is to be created. Note that most object elements are optional. Elements \"owner\" and \"full_name\" are ignored as the URL implies them.", "name": "_body", "in": "body" } ], "tags": [ "repositories" ] }, "delete": { "security": [ { "oauth2": [ "repository:admin" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Deletes the repository. This is an irreversible operation.\n\nThis does not affect its forks.", "responses": { "204": { "description": "Indicates successful deletion." }, "403": { "description": "If the caller either does not have admin access to the repository, or the repository is set to read-only.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the repository does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "repositories" ] }, "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" } ], "get": { "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the object describing this repository.", "responses": { "200": { "description": "The repository object.", "schema": { "$ref": "#/definitions/repository" } }, "403": { "description": "If the repository is private and the authenticated user does not have access to it.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If no repository exists at this location.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "repositories" ] } }, "/repositories/{username}/{repo_slug}/default-reviewers/{target_username}": { "put": { "security": [ { "oauth2": [ "repository:admin" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Adds the specified user to the repository's list of default\nreviewers.\n\nThis method is idempotent. Adding a user a second time has no effect.", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "pullrequests" ] }, "delete": { "security": [ { "oauth2": [ "repository:admin" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Removes a default reviewer from the repository.", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "pullrequests" ] }, "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "type": "string", "name": "target_username", "in": "path" } ], "get": { "security": [ { "oauth2": [ "repository:admin" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the specified reviewer.\n\nThis can be used to test whether a user is among the repository's\ndefault reviewers list. A 404 indicates that that specified user is not\na default reviewer.", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "pullrequests" ] } }, "/repositories/{username}/{repo_slug}/issues/{issue_id}/comments": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "type": "string", "name": "issue_id", "in": "path" } ], "get": { "security": [ { "oauth2": [ "issue" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns all comments that were made on the specified issue.", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "issue_tracker" ] } }, "/snippets/{username}/{encoded_id}/{node_id}": { "put": { "responses": { "200": { "description": "The updated snippet object.", "schema": { "$ref": "#/definitions/snippet" } }, "401": { "description": "If the snippet is private and the request was not authenticated.", "schema": { "$ref": "#/definitions/error" } }, "403": { "description": "If authenticated user does not have permission to update the private snippet.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the snippet or the revision does not exist.", "schema": { "$ref": "#/definitions/error" } }, "405": { "description": "If `{node_id}` is not the latest revision.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "required": true, "type": "string", "description": "The snippet's id.", "name": "encoded_id", "in": "path" }, { "required": true, "type": "string", "description": "A commit revision (SHA1).", "name": "node_id", "in": "path" } ], "tags": [ "snippets" ], "produces": [ "application/json", "multipart/related", "multipart/form-data" ], "security": [ { "oauth2": [ "snippet:write" ] }, { "basic": [] }, { "api_key": [] } ], "consumes": [ "application/json", "multipart/related", "multipart/form-data" ], "description": "Identical to `UPDATE /snippets/encoded_id`, except that this endpoint\ntakes an explicit commit revision. Only the snippet's \"HEAD\"/\"tip\"\n(most recent) version can be updated and requests on all other,\nolder revisions fail by returning a 405 status.\n\nUsage of this endpoint over the unrestricted `/snippets/encoded_id`\ncould be desired if the caller wants to be sure no concurrent\nmodifications have taken place between the moment of the UPDATE\nrequest and the original GET.\n\nThis can be considered a so-called \"Compare And Swap\", or CAS\noperation.\n\nOther than that, the two endpoints are identical in behavior." }, "delete": { "security": [ { "oauth2": [ "snippet:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Deletes the snippet.\n\nNote that this only works for versioned URLs that point to the latest\ncommit of the snippet. Pointing to an older commit results in a 405\nstatus code.\n\nTo delete a snippet, regardless of whether or not concurrent changes\nare being made to it, use `DELETE /snippets/{encoded_id}` instead.", "responses": { "401": { "description": "If the snippet is private and the request was not authenticated.", "schema": { "$ref": "#/definitions/error" } }, "403": { "description": "If authenticated user does not have permission to delete the private snippet.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the snippet does not exist.", "schema": { "$ref": "#/definitions/error" } }, "204": { "description": "If the snippet was deleted successfully." }, "405": { "description": "If `{node_id}` is not the latest revision.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "required": true, "type": "string", "description": "The snippet's id.", "name": "encoded_id", "in": "path" } ], "tags": [ "snippets" ] }, "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "encoded_id", "in": "path" }, { "required": true, "type": "string", "name": "node_id", "in": "path" } ], "get": { "responses": { "200": { "description": "The snippet object.", "schema": { "$ref": "#/definitions/snippet" } }, "401": { "description": "If the snippet is private and the request was not authenticated.", "schema": { "$ref": "#/definitions/error" } }, "403": { "description": "If authenticated user does not have access to the private snippet.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the snippet, or the revision does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "required": true, "type": "string", "description": "The snippet's id.", "name": "encoded_id", "in": "path" }, { "required": true, "type": "string", "description": "A commit revision (SHA1).", "name": "node_id", "in": "path" } ], "produces": [ "application/json", "multipart/related", "multipart/form-data" ], "tags": [ "snippets" ], "security": [ { "oauth2": [ "snippet" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Identical to `GET /snippets/encoded_id`, except that this endpoint\ncan be used to retrieve the contents of the snippet as it was at an\nolder revision, while `/snippets/encoded_id` always returns the\nsnippet's current revision.\n\nNote that only the snippet's file contents are versioned, not its\nmeta data properties like the title.\n\nOther than that, the two endpoints are identical in behavior." } }, "/repositories/{username}/{repo_slug}/pullrequests/{pull_request_id}/patch": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" }, { "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "type": "string", "name": "pull_request_id", "in": "path" } ], "get": { "security": [ { "oauth2": [ "pullrequest" ] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "pullrequests" ] } }, "/addon/linkers/{linker_key}/values/": { "delete": { "security": [ { "oauth2": [] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "addon" ] }, "parameters": [ { "required": true, "type": "string", "name": "linker_key", "in": "path" } ], "get": { "security": [ { "oauth2": [] }, { "basic": [] }, { "api_key": [] } ], "description": "", "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "addon" ] } }, "/repositories": { "parameters": [], "get": { "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns all public repositories.", "responses": { "200": { "description": "All public repositories.", "schema": { "$ref": "#/definitions/paginated_repositories" } } }, "parameters": [], "tags": [ "repositories" ] } }, "/teams/{username}/members": { "parameters": [ { "required": true, "type": "string", "name": "username", "in": "path" } ], "get": { "security": [ { "oauth2": [ "account" ] }, { "basic": [] }, { "api_key": [] } ], "description": "All members of a team.\n\nReturns all members of the specified team. Any member of any of the\nteam's groups is considered a member of the team. This includes users\nin groups that may not actually have access to any of the team's\nrepositories.\n\nNote that members using the \"private profile\" feature are not included.", "responses": { "200": { "description": "All members", "schema": { "$ref": "#/definitions/user" } }, "404": { "description": "When the team does not exist, or multiple teams with the same name exist that differ only in casing and the URL did not match the exact casing of a particular one.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [], "tags": [ "teams" ] } } }, "schemes": [ "https" ], "tags": [ { "name": "users", "description": "" }, { "name": "teams", "description": "" }, { "name": "repositories", "description": "" }, { "name": "refs", "description": "" }, { "name": "commits", "description": "" }, { "name": "pullrequests", "description": "" }, { "name": "issue_tracker", "description": "The issues resource provides functionality for getting information on\nissues in an issue tracker, creating new issues, updating them and deleting\nthem.\n\nYou can access public issues without authentication, but you can't gain access\nto private repositories' issues. By authenticating, you will get the ability\nto create issues, as well as access to updating data or deleting issues you\nhave access to." }, { "name": "wiki", "description": "" }, { "name": "downloads", "description": "" }, { "name": "snippets", "description": "" }, { "name": "webhooks", "description": "Webhooks provide a way to configure Bitbucket Cloud to make requests to\nyour server (or another external service) whenever certain events occur in\nBitbucket Cloud.\n\nA webhook consists of:\n\n* A subject -- The resource that generates the events. Currently, this resource\n is the repository, user account, or team where you create the webhook.\n* One or more event -- The default event is a repository push, but you can\n select multiple events that can trigger the webhook.\n* A URL -- The endpoint where you want Bitbucket to send the event payloads\n when a matching event happens.\n\nThere are two parts to getting a webhook to work: creating the webhook and\ntriggering the webhook. After you create a webhook for an event, every time\nthat event occurs, Bitbucket sends a payload request that describes the event\nto the specified URL. Thus, you can think of webhooks as a kind of\nnotification system.\n\nUse webhooks to integrate applications with Bitbucket Cloud. The following\nuse cases provides examples of when you would want to use webhooks:\n\n* Every time a user pushes commits in a repository, you may want to notify\n your CI server to start a build.\n* Every time a user pushes commits or creates a pull request, you may want to\n display a notification in your application.\n" } ], "basePath": "/2.0", "produces": [ "application/json" ], "securityDefinitions": { "oauth2": { "scopes": { "wiki": "Read and write to your repositories' wikis", "snippet": "Read your snippets", "account": "Read your account information", "repository:admin": "Administer your repositories", "repository": "Read your repositories", "snippet:write": "Read and write to your snippets", "issue:write": "Read and write to your repositories' issues", "pullrequest": "Read your repositories and their pull requests", "webhook": "Read and write to your repositories' webhooks", "pullrequest:write": "Read and write to your repositories and their pull requests", "project": "Read your team's projects", "project:write": "Read and write to your team's projects and move repositories between them", "team": "Read your team membership information", "repository:write": "Read and write to your repositories", "team:write": "Read and write to your team membership information", "account:write": "Read and write to your account information", "issue": "Read your repositories' issues", "email": "Read your account's primary email address" }, "tokenUrl": "http://dev.bitbucket.org:8000/site/oauth2/access_token", "description": "OAuth 2 as per [RFC-6749](https://tools.ietf.org/html/rfc6749).", "flow": "accessCode", "type": "oauth2", "authorizationUrl": "http://dev.bitbucket.org:8000/site/oauth2/authorize" }, "api_key": { "in": "header", "type": "apiKey", "description": "API Keys can be used as Basic HTTP Authentication credentials and provide a substitute for the account's actual username and password. API Keys are only available to team accounts and there is only 1 key per account. API Keys do not support scopes and have therefore access to all contents of the account.", "name": "Authorization" }, "basic": { "type": "basic", "description": "Basic HTTP Authentication as per [RFC-2617](https://tools.ietf.org/html/rfc2617) (Digest not supported). Note that Basic Auth with username and password as credentials is only available on accounts that have 2-factor-auth / 2-step-verification disabled. If you use 2fa, you should authenticate using OAuth2 instead." } }, "x-revision": "dev-1452122794", "host": "api.dev.bitbucket.org:8000", "definitions": { "paginated_repositories": { "allOf": [ { "$ref": "#/definitions/page" }, { "additionalProperties": true, "type": "object", "description": "A paginated list of repositories.", "properties": { "values": { "minItems": 0, "items": { "$ref": "#/definitions/repository" }, "uniqueItems": true, "type": "array" } } } ] }, "subject_types": { "additionalProperties": false, "type": "object", "description": "The mapping of resource/subject types pointing to their individual event types.", "properties": { "user": { "additionalProperties": false, "type": "object", "properties": { "events": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } } } }, "repository": { "additionalProperties": false, "type": "object", "properties": { "events": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } } } }, "team": { "additionalProperties": false, "type": "object", "properties": { "events": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } } } } } }, "paginated_hook_events": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A paginated list of webhook types available to subscribe on.", "properties": { "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "minItems": 0, "items": { "$ref": "#/definitions/hook_event" }, "uniqueItems": true, "type": "array" }, "pagelen": { "minimum": 1, "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values." }, "size": { "minimum": 0, "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute." }, "page": { "minimum": 1, "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses." }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" } } } ] }, "base_commit": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "The common base type for both repository and snippet commits.", "properties": { "date": { "type": "string", "format": "date-time" }, "parents": { "minItems": 0, "items": { "$ref": "#/definitions/base_commit" }, "type": "array" }, "message": { "type": "string" }, "hash": { "pattern": "[0-9a-f]{7,}?", "type": "string" }, "author": { "$ref": "#/definitions/account" } } } ] }, "error": { "additionalProperties": false, "type": "object", "properties": { "error": { "additionalProperties": false, "required": [ "message" ], "type": "object", "properties": { "message": { "type": "string" }, "detail": { "type": "string" } } } } }, "participant": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "Object describing a user's role on resources like commits or pull requests.", "properties": { "role": { "enum": [ "PARTICIPANT", "REVIEWER" ], "type": "string" }, "user": { "$ref": "#/definitions/user" }, "approved": { "type": "boolean" } } } ] }, "paginated_versions": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A paginated list of issue tracker versions.", "properties": { "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "minItems": 0, "items": { "$ref": "#/definitions/version" }, "uniqueItems": true, "type": "array" }, "pagelen": { "minimum": 1, "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values." }, "size": { "minimum": 0, "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute." }, "page": { "minimum": 1, "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses." }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" } } } ] }, "paginated_users": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A paginated list of users.", "properties": { "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "minItems": 0, "items": { "$ref": "#/definitions/user" }, "uniqueItems": true, "type": "array" }, "pagelen": { "minimum": 1, "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values." }, "size": { "minimum": 0, "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute." }, "page": { "minimum": 1, "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses." }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" } } } ] }, "snippet": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A snippet object.", "properties": { "scm": { "enum": [ "hg", "git" ], "type": "string", "description": "The DVCS used to store the snippet." }, "title": { "type": "string" }, "creator": { "$ref": "#/definitions/account" }, "created_on": { "type": "string", "format": "date-time" }, "owner": { "$ref": "#/definitions/account" }, "updated_on": { "type": "string", "format": "date-time" }, "id": { "minimum": 0, "type": "integer" }, "is_private": { "type": "boolean" } } } ] }, "hook_event": { "additionalProperties": false, "type": "object", "description": "An event, associated with a resource or subject type.", "properties": { "category": { "type": "string", "description": "The category this event belongs to." }, "event": { "enum": [ "pullrequest:updated", "repo:commit_status_created", "repo:fork", "issue:comment_created", "pullrequest:rejected", "pullrequest:fulfilled", "pullrequest:comment_created", "pullrequest:comment_deleted", "issue:created", "repo:commit_comment_created", "pullrequest:approved", "repo:commit_status_updated", "pullrequest:comment_updated", "issue:updated", "pullrequest:unapproved", "pullrequest:created", "repo:push" ], "type": "string", "description": "The event identifier." }, "description": { "type": "string", "description": "More detailed description of the webhook event type." }, "label": { "type": "string", "description": "Summary of the webhook event type." } } }, "version": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A version as defined in a repository's issue tracker.", "properties": { "name": { "type": "string" }, "links": { "additionalProperties": false, "type": "object", "properties": { "self": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } } } }, "id": { "type": "integer" } } } ] }, "issue": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "An issue.", "properties": { "content": { "additionalProperties": false, "type": "object", "properties": { "raw": { "type": "string", "description": "The text as it was typed by a user." }, "markup": { "enum": [ "markdown", "creole" ], "type": "string", "description": "The type of markup language the content is to be interpreted in." }, "html": { "type": "string", "description": "The user's markup rendered as HTML." } } }, "kind": { "enum": [ "bug", "enhancement", "proposal", "task" ], "type": "string" }, "repository": { "$ref": "#/definitions/repository" }, "links": { "additionalProperties": false, "type": "object", "properties": { "attachments": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } }, "self": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } }, "watch": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } }, "comments": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } }, "html": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } }, "vote": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } } } }, "title": { "type": "string" }, "reporter": { "$ref": "#/definitions/user" }, "component": { "$ref": "#/definitions/component" }, "votes": { "type": "integer" }, "priority": { "enum": [ "trivial", "minor", "major", "critical", "blocker" ], "type": "string" }, "assignee": { "$ref": "#/definitions/user" }, "state": { "enum": [ "new", "open", "resolved", "on hold", "invalid", "duplicate", "wontfix", "closed" ], "type": "string" }, "version": { "$ref": "#/definitions/version" }, "edited_on": { "type": "string", "format": "date-time" }, "created_on": { "type": "string", "format": "date-time" }, "milestone": { "$ref": "#/definitions/milestone" }, "updated_on": { "type": "string", "format": "date-time" }, "id": { "type": "integer" } } } ] }, "webhook_subscription": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A Webhook subscription.", "properties": { "subject_type": { "enum": [ "user", "repository", "team" ], "type": "string", "description": "The type of entity, which is `repository` in the case of webhook subscriptions on repositories." }, "uuid": { "type": "string", "description": "The webhook's id" }, "url": { "type": "string", "description": "The URL events get delivered to.", "format": "uri" }, "created_at": { "type": "string", "format": "date-time" }, "description": { "type": "string", "description": "A user-defined description of the webhook." }, "active": { "type": "boolean" }, "events": { "minItems": 1, "items": { "enum": [ "pullrequest:updated", "repo:commit_status_created", "repo:fork", "issue:comment_created", "pullrequest:rejected", "pullrequest:fulfilled", "pullrequest:comment_created", "pullrequest:comment_deleted", "issue:created", "repo:commit_comment_created", "pullrequest:approved", "repo:commit_status_updated", "pullrequest:comment_updated", "issue:updated", "pullrequest:unapproved", "pullrequest:created", "repo:push" ], "type": "string" }, "uniqueItems": true, "description": "The events this webhook is subscribed to.", "type": "array" }, "subject": { "$ref": "#/definitions/object" } } } ] }, "repository": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A Bitbucket repository.", "properties": { "scm": { "enum": [ "hg", "git" ], "type": "string" }, "has_wiki": { "type": "boolean" }, "uuid": { "type": "string", "description": "The repository's immutable id. This can be used as a substitute for the slug segment in URLs. Doing this guarantees your URLs will survive renaming of the repository by its owner, or even transfer of the repository to a different user." }, "links": { "additionalProperties": false, "type": "object", "properties": { "watchers": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } }, "commits": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } }, "downloads": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } }, "self": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } }, "html": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } }, "avatar": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } }, "hooks": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } }, "forks": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } }, "clone": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } }, "pullrequests": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } } } }, "fork_policy": { "enum": [ "allow_forks", "no_public_forks", "no_forks" ], "type": "string", "description": "\nControls the rules for forking this repository.\n\n* **allow_forks**: unrestricted forking\n* **no_public_forks**: restrict forking to private forks (forks cannot\n be made public later)\n* **no_forks**: deny all forking\n" }, "description": { "type": "string" }, "language": { "type": "string" }, "created_on": { "type": "string", "format": "date-time" }, "parent": { "$ref": "#/definitions/repository" }, "full_name": { "type": "string", "description": "The concatenation of the repository owner's username and the slugified name, e.g. \"evzijst/interruptingcow\". This is the same string used in Bitbucket URLs." }, "has_issues": { "type": "boolean" }, "owner": { "$ref": "#/definitions/account" }, "updated_on": { "type": "string", "format": "date-time" }, "size": { "type": "integer" }, "is_private": { "type": "boolean" }, "name": { "type": "string" } } } ] }, "snippet_commit": { "allOf": [ { "$ref": "#/definitions/base_commit" }, { "additionalProperties": true, "type": "object", "description": "", "properties": { "snippet": { "$ref": "#/definitions/snippet" }, "links": { "additionalProperties": false, "type": "object", "properties": { "diff": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } }, "self": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } }, "html": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } } } } } } ] }, "object": { "description": "Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.", "required": [ "type" ], "additionalProperties": true, "discriminator": "type", "type": "object", "properties": { "type": { "type": "string" } } }, "component": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A component as defined in a repository's issue tracker.", "properties": { "name": { "type": "string" }, "links": { "additionalProperties": false, "type": "object", "properties": { "self": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } } } }, "id": { "type": "integer" } } } ] }, "paginated_issues": { "allOf": [ { "$ref": "#/definitions/page" }, { "additionalProperties": true, "type": "object", "description": "A paginated list of issues.", "properties": { "values": { "minItems": 0, "items": { "$ref": "#/definitions/issue" }, "uniqueItems": true, "type": "array" } } } ] }, "user": { "allOf": [ { "$ref": "#/definitions/account" }, { "additionalProperties": true, "type": "object", "description": "A user object.", "properties": {} } ] }, "milestone": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A milestone as defined in a repository's issue tracker.", "properties": { "name": { "type": "string" }, "links": { "additionalProperties": false, "type": "object", "properties": { "self": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } } } }, "id": { "type": "integer" } } } ] }, "paginated_issue_attachments": { "allOf": [ { "$ref": "#/definitions/page" }, { "additionalProperties": true, "type": "object", "description": "A paginated list of issue attachments.", "properties": { "values": { "minItems": 0, "items": { "$ref": "#/definitions/issue_attachment" }, "type": "array" } } } ] }, "paginated_webhook_subscriptions": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A paginated list of webhook subscriptions", "properties": { "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "minItems": 0, "items": { "$ref": "#/definitions/webhook_subscription" }, "uniqueItems": true, "type": "array" }, "pagelen": { "minimum": 1, "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values." }, "size": { "minimum": 0, "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute." }, "page": { "minimum": 1, "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses." }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" } } } ] }, "snippet_comment": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A comment on a snippet.", "properties": { "snippet": { "$ref": "#/definitions/snippet" }, "links": { "additionalProperties": false, "type": "object", "properties": { "self": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } }, "html": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } } } } } } ] }, "paginated_milestones": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A paginated list of issue tracker milestones.", "properties": { "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "minItems": 0, "items": { "$ref": "#/definitions/milestone" }, "uniqueItems": true, "type": "array" }, "pagelen": { "minimum": 1, "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values." }, "size": { "minimum": 0, "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute." }, "page": { "minimum": 1, "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses." }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" } } } ] }, "paginated_components": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A paginated list of issue tracker components.", "properties": { "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "minItems": 0, "items": { "$ref": "#/definitions/component" }, "uniqueItems": true, "type": "array" }, "pagelen": { "minimum": 1, "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values." }, "size": { "minimum": 0, "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute." }, "page": { "minimum": 1, "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses." }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" } } } ] }, "account": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "An account object.", "properties": { "username": { "pattern": "^[a-zA-Z0-9_\\-]+$", "type": "string" }, "website": { "type": "string" }, "display_name": { "type": "string" }, "uuid": { "type": "string" }, "links": { "additionalProperties": false, "type": "object", "properties": { "self": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } }, "repositories": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } }, "html": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } }, "followers": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } }, "avatar": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } }, "following": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } } } }, "created_on": { "type": "string", "format": "date-time" } } } ] }, "issue_attachment": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "An issue file attachment's meta data. Note this does not contain the file's actual contents.", "properties": { "name": { "type": "string" }, "links": { "additionalProperties": false, "type": "object", "properties": { "self": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } } } } } } ] }, "paginated_snippet_commit": { "allOf": [ { "$ref": "#/definitions/page" }, { "additionalProperties": true, "type": "object", "description": "A paginated list of snippet commits.", "properties": { "values": { "minItems": 0, "items": { "$ref": "#/definitions/snippet_commit" }, "type": "array" } } } ] }, "pullrequest": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A pull request object.", "properties": { "state": { "enum": [ "MERGED", "SUPERSEDED", "OPEN", "DECLINED" ], "type": "string" }, "author": { "$ref": "#/definitions/account" }, "id": { "type": "integer" }, "links": { "additionalProperties": false, "type": "object", "properties": { "decline": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } }, "commits": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } }, "self": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } }, "comments": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } }, "merge": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } }, "html": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } }, "activity": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } }, "diff": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } }, "approve": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } } } }, "title": { "type": "string" } } } ] }, "paginated_teams": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A paginated list of teams.", "properties": { "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "minItems": 0, "items": { "$ref": "#/definitions/team" }, "uniqueItems": true, "type": "array" }, "pagelen": { "minimum": 1, "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values." }, "size": { "minimum": 0, "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute." }, "page": { "minimum": 1, "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses." }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" } } } ] }, "paginated_snippet_comments": { "allOf": [ { "$ref": "#/definitions/page" }, { "additionalProperties": true, "type": "object", "description": "A paginated list of snippet comments.", "properties": { "values": { "minItems": 0, "items": { "$ref": "#/definitions/snippet_comment" }, "uniqueItems": true, "type": "array" } } } ] }, "team": { "allOf": [ { "$ref": "#/definitions/account" }, { "additionalProperties": true, "type": "object", "description": "A team object.", "properties": {} } ] }, "commit": { "allOf": [ { "$ref": "#/definitions/base_commit" }, { "additionalProperties": true, "type": "object", "description": "A repository commit object.", "properties": { "participants": { "minItems": 0, "items": { "$ref": "#/definitions/participant" }, "type": "array" }, "repository": { "$ref": "#/definitions/repository" }, "links": { "additionalProperties": false, "type": "object", "properties": { "self": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } }, "comments": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } }, "patch": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } }, "html": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } }, "diff": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } }, "approve": { "additionalProperties": false, "type": "object", "properties": { "href": { "type": "string", "format": "uri" } } } } } } } ] }, "paginated_snippets": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A paginated list of snippets.", "properties": { "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "minItems": 0, "items": { "$ref": "#/definitions/snippet" }, "uniqueItems": true, "type": "array" }, "pagelen": { "minimum": 1, "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values." }, "size": { "minimum": 0, "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute." }, "page": { "minimum": 1, "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses." }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" } } } ] }, "page": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.", "properties": { "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "pagelen": { "minimum": 1, "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values." }, "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "page": { "minimum": 1, "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses." }, "size": { "minimum": 0, "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute." } } } ] } }, "swagger": "2.0", "consumes": [ "application/json" ] } spec-0.21.0/fixtures/more_circulars/item.json000066400000000000000000000005631457312531500212510ustar00rootroot00000000000000{ "item": { "type": "object", "required": [ "title" ], "properties": { "id": { "type": "integer", "format": "uint64", "readOnly": true }, "title": { "type": "string", "minLength": 2, "maxLength": 80 }, "subitem": { "$ref": "item.json#/item" } } } } spec-0.21.0/fixtures/more_circulars/item2.json000066400000000000000000000005521457312531500213310ustar00rootroot00000000000000{ "item": { "type": "object", "required": [ "title" ], "properties": { "id": { "type": "integer", "format": "uint64", "readOnly": true }, "title": { "type": "string", "minLength": 2, "maxLength": 80 }, "subitem": { "$ref": "#/item" } } } } spec-0.21.0/fixtures/more_circulars/item4.json000066400000000000000000000005641457312531500213360ustar00rootroot00000000000000{ "item": { "type": "object", "required": [ "title" ], "properties": { "id": { "type": "integer", "format": "uint64", "readOnly": true }, "title": { "type": "string", "minLength": 2, "maxLength": 80 }, "subitem": { "$ref": "item4.json#/item" } } } } spec-0.21.0/fixtures/more_circulars/pointers/000077500000000000000000000000001457312531500212575ustar00rootroot00000000000000spec-0.21.0/fixtures/more_circulars/pointers/fixture-pointers-loop.yaml000066400000000000000000000010531457312531500264400ustar00rootroot00000000000000--- swagger: '2.0' info: version: '0.1.0' title: JSON pointers paths: /some/where: get: responses: default: schema: $ref: '#/definitions/whiteStone/properties/p1' definitions: whiteStone: type: object properties: p1: $ref: '#/definitions/blackStone/properties/p2' blackStone: type: object properties: p2: $ref: '#/definitions/redStone/properties/p3' redStone: type: object properties: p3: $ref: '#/definitions/whiteStone/properties/p1' spec-0.21.0/fixtures/more_circulars/pointers/fixture-pointers.yaml000066400000000000000000000110221457312531500254660ustar00rootroot00000000000000--- swagger: '2.0' info: version: '0.1.0' title: JSON pointers parameters: someParam: name: some in: query type: string bodyParam: name: some in: body schema: $ref: '#/responses/notFound/schema' remoteParam: name: some in: body schema: $ref: 'remote.yaml#/remotes/u64' responses: notFound: description: 'Not Found' schema: $ref: '#/definitions/notFound' funnyResponse: description: ok schema: $ref: '#/parameters/bodyParam/schema' remoteResponse: description: ok schema: type: object properties: prop0: $ref: 'remote.yaml#/remotes/u64' paths: /some/where: parameters: - $ref: '#/parameters/someParam' get: parameters: - $ref: '#/parameters/bodyParam' - name: other in: query type: string responses: default: $ref: '#/responses/notFound' 404: description: ok schema: $ref: '#/definitions/myResponse' 200: description: 'RecordHolder' schema: type: object properties: prop0: $ref: '#/definitions/myBody' post: responses: default: description: default schema: $ref: '#/definitions/myDefaultResponse/properties/zzz' 203: description: funny schema: $ref: '#/responses/funnyResponse/schema' 204: $ref: '#/responses/funnyResponse' /some/where/else: get: responses: default: description: default schema: $ref: '#/definitions/notFound' 200: description: ok schema: $ref: '#/definitions/myDefaultResponse' /with/slice/container: get: responses: default: description: default schema: allOf: - $ref: 'remote.yaml#/remotes/u64' - $ref: 'remote.yaml#/remotes/u32' - $ref: '#/definitions/myBody/properties/prop3' /with/tuple/container: get: responses: default: description: default schema: type: array items: - $ref: '#/definitions/myBody/properties/prop2' - $ref: '#/definitions/myBody/properties/prop3' - $ref: 'remote.yaml#/remotes/i32' /with/array/container: get: responses: 200: description: ok schema: $ref: '#/definitions/anArray' default: description: default schema: type: array items: $ref: '#/definitions/anArray/items' /with/boolable/container: get: responses: 200: description: ok schema: type: array items: - type: integer - type: string additionalItems: $ref: '#/definitions/myBody/properties/prop3' default: description: default schema: type: object additionalProperties: $ref: '#/definitions/myBody/properties/prop3' /with/ZcomesFirstInOrder/container: get: responses: 200: description: ok schema: type: array items: - type: integer - type: string additionalItems: $ref: '#/definitions/myBody/properties/prop3' 203: description: ok schema: $ref: '#/definitions/anExtensible/additionalProperties' 204: description: ok schema: type: object additionalProperties: type: object additionalProperties: $ref: '#/definitions/anExtensible/additionalProperties' definitions: anExtensible: type: object additionalProperties: type: object properties: addProp1: type: string anArray: type: array items: type: string format: uuid notFound: type: object properties: prop1: $ref: '#/definitions/myDefaultResponse/properties/zzz' myDefaultResponse: type: object properties: zzz: type: integer myResponse: type: object additionalProperties: $ref: '#/definitions/notFound/properties/prop1' myBody: type: object properties: prop2: type: integer prop3: $ref: '#/definitions/myDefaultResponse/properties/zzz' spec-0.21.0/fixtures/more_circulars/pointers/remote.yaml000066400000000000000000000002671457312531500234430ustar00rootroot00000000000000remotes: u32: type: integer format: uint32 i32: type: integer format: int32 u64: type: integer format: uint64 i64: type: integer format: int64 spec-0.21.0/fixtures/more_circulars/remote/000077500000000000000000000000001457312531500207075ustar00rootroot00000000000000spec-0.21.0/fixtures/more_circulars/remote/tree000066400000000000000000000007411457312531500215730ustar00rootroot00000000000000{ "id": "http://localhost:1234/tree", "type": "object", "required": ["meta", "nodes"], "properties": { "meta": {"type": "string"}, "nodes": { "type": "array", "items": {"$ref": "node"} } }, "definitions": { "node": { "id": "http://localhost:1234/node", "type": "object", "required": ["value"], "properties": { "value": {"type": "number"}, "subtree": {"$ref": "tree"} } } } } spec-0.21.0/fixtures/more_circulars/resp.json000066400000000000000000000016461457312531500212670ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "description": "TestSwagger", "version": "1.0", "title": "Test" }, "host": "127.0.0.1:8443", "basePath": "/", "schemes": [ "https" ], "paths": { "/api/v1/getx": { "post": { "operationId": "getx", "consumes": [ "application/json" ], "produces": [ "application/json" ], "responses": { "200": { "description": "Operation successful", "schema": { "$ref": "#/definitions/MyObj" } } }, "security": [] } } }, "definitions": { "MyObj": { "type": "object", "properties": { "name": { "type": "string" }, "child-objects": { "type": "array", "items": { "$ref": "#/definitions/MyObj" } } } } } }spec-0.21.0/fixtures/more_circulars/spec.json000066400000000000000000000017151457312531500212450ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "title": "Item API", "description": "Item API", "version": "1.0.0" }, "host": "item.api.local", "basePath": "/v1", "securityDefinitions": { "key": { "type": "apiKey", "name": "x-item-token", "in": "header" } }, "security": [ { "key": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "schemes": [ "http" ], "responses": { "itemResponse": { "description": "Item", "schema": { "$ref": "item.json#/item" } } }, "paths": { "/item": { "get": { "operationId": "GetItem", "responses": { "200": { "description": "item detail response", "schema": { "$ref": "item.json#/item" } }, "default": { "$ref": "#/responses/itemResponse" } } } } } } spec-0.21.0/fixtures/more_circulars/spec2.json000066400000000000000000000017171457312531500213310ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "title": "Item API", "description": "Item API", "version": "1.0.0" }, "host": "item.api.local", "basePath": "/v1", "securityDefinitions": { "key": { "type": "apiKey", "name": "x-item-token", "in": "header" } }, "security": [ { "key": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "schemes": [ "http" ], "responses": { "itemResponse": { "description": "Item", "schema": { "$ref": "item2.json#/item" } } }, "paths": { "/item": { "get": { "operationId": "GetItem", "responses": { "200": { "description": "item detail response", "schema": { "$ref": "item2.json#/item" } }, "default": { "$ref": "#/responses/itemResponse" } } } } } } spec-0.21.0/fixtures/more_circulars/spec3.json000066400000000000000000000015041457312531500213240ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "title": "Item API", "description": "Item API", "version": "1.0.0" }, "host": "item.api.local", "basePath": "/v1", "securityDefinitions": { "key": { "type": "apiKey", "name": "x-item-token", "in": "header" } }, "security": [ { "key": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "schemes": [ "http" ], "paths": { "/item": { "get": { "operationId": "GetItem", "responses": { "200": { "description": "item detail response", "schema": { "$ref": "#/definitions/myItems" } } } } } }, "definitions": { "myItems": { "$ref": "item.json#/item" } } } spec-0.21.0/fixtures/more_circulars/spec4.json000066400000000000000000000020321457312531500213220ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "title": "Item API", "description": "Item API", "version": "1.0.0" }, "host": "item.api.local", "basePath": "/v1", "securityDefinitions": { "key": { "type": "apiKey", "name": "x-item-token", "in": "header" } }, "security": [ { "key": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "schemes": [ "http" ], "parameters": { "itemParameter": { "description": "Item", "name": "bodyParam", "in": "body", "schema": { "$ref": "item4.json#/item" } } }, "paths": { "/item": { "get": { "operationId": "GetItem", "parameters": [ { "$ref": "#/parameters/itemParameter" } ], "responses": { "200": { "description": "item detail response", "schema": { "$ref": "item4.json#/item" } } } } } } } spec-0.21.0/fixtures/more_circulars/with-id.json000066400000000000000000000011731457312531500216560ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "title": "circular schema with ID", "description": "reproduces #92", "version": "1.0.0" }, "host": "id.api.local", "basePath": "/v1", "consumes": [ "application/json" ], "produces": [ "application/json" ], "schemes": [ "http" ], "paths": { "/id": { "get": { "responses": { "200": { "description": "item detail response", "schema": { "$ref": "#/definitions/remote" } } } } } }, "definitions": { "remote": { "$ref": "http://localhost:1234/tree" } } } spec-0.21.0/fixtures/remote/000077500000000000000000000000001457312531500156765ustar00rootroot00000000000000spec-0.21.0/fixtures/remote/all-the-things.json000066400000000000000000000133031457312531500214110ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore", "description": "A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification", "termsOfService": "http://helloreverb.com/terms/", "contact": { "name": "Wordnik API Team" }, "license": { "name": "MIT" } }, "host": "petstore.swagger.wordnik.com", "basePath": "/api", "schemes": ["http"], "consumes": ["application/json"], "produces": ["application/json"], "parameters": { "idParam": { "name": "id", "in": "path", "description": "ID of pet to fetch", "required": true, "type": "integer", "format": "int64" }, "tag": { "type": "string", "in": "query", "required": false }, "query": { "$ref": "#/parameters/tag" } }, "responses": { "petResponse": { "description": "pet response", "schema": { "$ref": "pet/pet.json#/definitions/pet" } }, "stringResponse": { "descripion": "string response", "schema": { "type": "string" } }, "anotherPet": { "$ref": "pet/pet.json#/responses/anotherPet" }, "circularA": { "$ref": "pet/pet.json#/responses/circularB" }, "backRef": { "$ref": "pet/pet.json#/responses/backRef" } }, "paths": { "/": { "get": { "operationId": "indexStuff", "responses": { "default": { "$ref": "#/responses/stringResponse" }, "200": { "$ref": "#/responses/anotherPet" } } } }, "/pets": { "get": { "description": "Returns all pets from the system that the user has access to", "operationId": "findPets", "produces": [ "application/json", "application/xml", "text/xml", "text/html" ], "parameters": [ { "name": "tags", "in": "query", "description": "tags to filter by", "required": false, "type": "array", "items": { "type": "string" }, "collectionFormat": "csv" }, { "name": "limit", "in": "query", "description": "maximum number of results to return", "required": false, "type": "integer", "format": "int32" } ], "responses": { "200": { "description": "pet response", "schema": { "type": "array", "items": { "$ref": "pet/pet.json#/definitions/pet" } } }, "default": { "description": "unexpected error", "schema": { "$ref": "#/definitions/errorModel" } } } }, "post": { "description": "Creates a new pet in the store. Duplicates are allowed", "operationId": "addPet", "produces": ["application/json"], "parameters": [ { "name": "pet", "in": "body", "description": "Pet to add to the store", "required": true, "schema": { "$ref": "#/definitions/petInput" } } ], "responses": { "200": { "$ref": "#/responses/petResponse" }, "default": { "description": "unexpected error", "schema": { "$ref": "#/definitions/errorModel" } } } } }, "/pets/{id}": { "get": { "description": "Returns a user based on a single ID, if the user does not have access to the pet", "operationId": "findPetById", "produces": [ "application/json", "application/xml", "text/xml", "text/html" ], "parameters": [ { "$ref": "#/parameters/idParam" } ], "responses": { "200": { "$ref": "#/responses/petResponse" }, "default": { "description": "unexpected error", "schema": { "$ref": "#/definitions/errorModel" } } } }, "delete": { "description": "deletes a single pet based on the ID supplied", "operationId": "deletePet", "parameters": [ { "$ref": "#/parameters/idParam" } ], "responses": { "204": { "description": "pet deleted" }, "default": { "description": "unexpected error", "schema": { "$ref": "#/definitions/errorModel" } } } } } }, "definitions": { "pet": { "required": ["id", "name"], "properties": { "id": { "type": "integer", "format": "int64" }, "name": { "type": "string" }, "tag": { "type": "string" } } }, "petInput": { "allOf": [ { "$ref": "pet/pet.json#/definitions/pet" }, { "required": ["name"], "properties": { "id": { "type": "integer", "format": "int64" } } } ] }, "errorModel": { "required": ["code", "message"], "properties": { "code": { "type": "integer", "format": "int32" }, "message": { "type": "string" } } } } } spec-0.21.0/fixtures/remote/pet/000077500000000000000000000000001457312531500164665ustar00rootroot00000000000000spec-0.21.0/fixtures/remote/pet/pet.json000066400000000000000000000015541457312531500201560ustar00rootroot00000000000000{ "responses": { "petResponse": { "description": "pet response", "schema": { "$ref": "#/definitions/pet" } }, "stringResponse": { "descripion": "string response", "schema": { "type": "string" } }, "circularB": { "$ref": "#/responses/circularC" }, "circularC": { "$ref": "../all-the-things.json#/responses/circularA" }, "backRef": { "$ref": "../all-the-things.json#/responses/petResponse" }, "anotherPet": { "$ref": "#/responses/petResponse" } }, "definitions": { "pet": { "required": ["id", "name"], "properties": { "id": { "type": "integer", "format": "int64" }, "name": { "type": "string" }, "tag": { "type": "string" } } } } } spec-0.21.0/fixtures/skipschema/000077500000000000000000000000001457312531500165325ustar00rootroot00000000000000spec-0.21.0/fixtures/skipschema/external/000077500000000000000000000000001457312531500203545ustar00rootroot00000000000000spec-0.21.0/fixtures/skipschema/external/definitions.yml000066400000000000000000000021451457312531500234140ustar00rootroot00000000000000definitions: named: type: string tag: type: object properties: id: type: integer format: int64 value: type: string audit: $ref: "#/definitions/record" record: type: object properties: createdAt: type: string format: date-time nestedThing: type: object properties: record: type: array items: - type: string format: date-time - type: object properties: createdAt: type: string format: date-time - allOf: - type: string format: date - type: object additionalProperties: type: object properties: id: type: integer format: int64 value: type: string properties: value: type: string name: $ref: "definitions2.yml#/coordinate"spec-0.21.0/fixtures/skipschema/external/definitions2.yml000066400000000000000000000002261457312531500234740ustar00rootroot00000000000000coordinate: type: object properties: id: type: integer format: int64 createdAt: type: string format: date-timespec-0.21.0/fixtures/skipschema/external/errors.yml000066400000000000000000000003011457312531500224050ustar00rootroot00000000000000error: type: object required: - id - message properties: id: type: integer format: int64 readOnly: true message: type: string readOnly: true spec-0.21.0/fixtures/skipschema/external/nestedParams.yml000066400000000000000000000015131457312531500235250ustar00rootroot00000000000000bodyParam: name: body in: body schema: type: object properties: record: type: array items: - type: string format: date-time - type: object properties: createdAt: type: string format: date-time - allOf: - type: string format: date - type: object properties: id: type: integer format: int64 value: type: string name: type: object properties: id: type: integer format: int64 createdAt: type: string format: date-timespec-0.21.0/fixtures/skipschema/external/nestedResponses.yml000066400000000000000000000013671457312531500242720ustar00rootroot00000000000000genericResponse: type: object properties: record: type: array items: - type: string format: date-time - type: object properties: createdAt: type: string format: date-time - allOf: - type: string format: date - type: object properties: id: type: integer format: int64 value: type: string name: type: object properties: id: type: integer format: int64 createdAt: type: string format: date-timespec-0.21.0/fixtures/skipschema/external/parameters.yml000066400000000000000000000005641457312531500232470ustar00rootroot00000000000000parameters: idParam: name: id in: path type: integer format: int32 limitParam: name: limit in: query type: integer format: int32 required: false bodyExt1: name: bodyExt1 in: body schema: type: object parameters2: bodyExt2: name: bodyExt2 in: body schema: $ref: 'nestedParams.yml#/bodyParam' spec-0.21.0/fixtures/skipschema/external/pathItem.yml000066400000000000000000000004721457312531500226550ustar00rootroot00000000000000get: operationId: modelOp summary: many model variations description: Used to see if a codegen can render all the possible parameter variations for a header param tags: - testcgen parameters: - $ref: 'parameters.yml#/parameters2/bodyExt2' responses: default: description: Generic Out spec-0.21.0/fixtures/skipschema/external/responses.yml000066400000000000000000000001021457312531500231110ustar00rootroot00000000000000responses: notFound: schema: $ref: "errors.yml#/error"spec-0.21.0/fixtures/skipschema/external_definitions_valid.yml000066400000000000000000000043171457312531500246560ustar00rootroot00000000000000--- swagger: "2.0" info: version: "0.1.0" title: reference analysis parameters: someParam: name: someParam in: body schema: $ref: "external/definitions.yml#/definitions/record" responses: someResponse: schema: $ref: "external/definitions.yml#/definitions/record" paths: "/some/where/{id}": parameters: - $ref: "external/parameters.yml#/parameters/idParam" - name: bodyId in: body schema: $ref: "external/definitions.yml#/definitions/record" get: parameters: - $ref: "external/parameters.yml#/parameters/limitParam" - name: other in: query type: array # $ref in parameter array items is not swagger 2.0 compliant items: type: string - name: body in: body schema: $ref: "external/definitions.yml#/definitions/record" responses: default: schema: $ref: "external/definitions.yml#/definitions/record" 404: $ref: "external/responses.yml#/responses/notFound" 200: schema: $ref: "external/definitions.yml#/definitions/tag" "/other/place": $ref: "external/pathItem.yml" definitions: namedAgain: $ref: "external/definitions.yml#/definitions/named" datedTag: allOf: - type: string format: date - $ref: "external/definitions.yml#/definitions/tag" records: type: array items: - $ref: "external/definitions.yml#/definitions/record" datedRecords: type: array items: - type: string format: date-time - $ref: "external/definitions.yml#/definitions/record" datedTaggedRecords: type: array items: - type: string format: date-time - $ref: "external/definitions.yml#/definitions/record" additionalItems: $ref: "external/definitions.yml#/definitions/tag" otherRecords: type: array items: $ref: "external/definitions.yml#/definitions/record" tags: type: object additionalProperties: $ref: "external/definitions.yml#/definitions/tag" namedThing: type: object properties: name: $ref: "external/definitions.yml#/definitions/named" spec-0.21.0/fixtures/specs/000077500000000000000000000000001457312531500155205ustar00rootroot00000000000000spec-0.21.0/fixtures/specs/deeper/000077500000000000000000000000001457312531500167645ustar00rootroot00000000000000spec-0.21.0/fixtures/specs/deeper/arrayProp.json000066400000000000000000000000731457312531500216360ustar00rootroot00000000000000{ "type":"array", "items": { "type": "string" } }spec-0.21.0/fixtures/specs/deeper/stringProp.json000066400000000000000000000000261457312531500220240ustar00rootroot00000000000000{ "type": "string" }spec-0.21.0/fixtures/specs/refed.json000066400000000000000000000117451457312531500175100ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "version": "1.0.0", "title": "Swagger Petstore", "description": "A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification", "termsOfService": "http://helloreverb.com/terms/", "contact": { "name": "Wordnik API Team" }, "license": { "name": "MIT" } }, "host": "petstore.swagger.wordnik.com", "basePath": "/api", "schemes": [ "http" ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": { "idParam": { "name": "id", "in": "path", "description": "ID of pet to fetch", "required": true, "type": "integer", "format": "int64" } }, "responses": { "petResponse": { "description": "pet response", "schema": { "$ref": "#/definitions/pet" } } }, "paths": { "/pets": { "get": { "description": "Returns all pets from the system that the user has access to", "operationId": "findPets", "produces": [ "application/json", "application/xml", "text/xml", "text/html" ], "parameters": [ { "name": "tags", "in": "query", "description": "tags to filter by", "required": false, "type": "array", "items": { "type": "string" }, "collectionFormat": "csv" }, { "name": "limit", "in": "query", "description": "maximum number of results to return", "required": false, "type": "integer", "format": "int32" } ], "responses": { "200": { "description": "pet response", "schema": { "type": "array", "items": { "$ref": "#/definitions/pet" } } }, "default": { "description": "unexpected error", "schema": { "$ref": "#/definitions/errorModel" } } } }, "post": { "description": "Creates a new pet in the store. Duplicates are allowed", "operationId": "addPet", "produces": [ "application/json" ], "parameters": [ { "name": "pet", "in": "body", "description": "Pet to add to the store", "required": true, "schema": { "$ref": "#/definitions/petInput" } } ], "responses": { "200": { "$ref": "#/responses/petResponse" }, "default": { "description": "unexpected error", "schema": { "$ref": "#/definitions/errorModel" } } } } }, "/pets/{id}": { "get": { "description": "Returns a user based on a single ID, if the user does not have access to the pet", "operationId": "findPetById", "produces": [ "application/json", "application/xml", "text/xml", "text/html" ], "parameters": [ { "$ref": "#/parameters/idParam" } ], "responses": { "200": { "$ref": "#/responses/petResponse" }, "default": { "description": "unexpected error", "schema": { "$ref": "#/definitions/errorModel" } } } }, "delete": { "description": "deletes a single pet based on the ID supplied", "operationId": "deletePet", "parameters": [ { "$ref": "#/parameters/idParam" } ], "responses": { "204": { "description": "pet deleted" }, "default": { "description": "unexpected error", "schema": { "$ref": "#/definitions/errorModel" } } } } } }, "definitions": { "pet": { "required": [ "id", "name" ], "properties": { "id": { "type": "integer", "format": "int64" }, "name": { "type": "string" }, "tag": { "type": "string" } } }, "petInput": { "allOf": [ { "$ref": "pet" }, { "required": [ "name" ], "properties": { "id": { "type": "integer", "format": "int64" } } } ] }, "errorModel": { "required": [ "code", "message" ], "properties": { "code": { "type": "integer", "format": "int32" }, "message": { "type": "string" } } } } }spec-0.21.0/fixtures/specs/resolution.json000066400000000000000000000003121457312531500206120ustar00rootroot00000000000000{ "id": "http://localhost:1234", "items": { "id": "deeper/", "items": { "$ref": "stringProp.json" } }, "definitions": { "bool": { "$ref": "boolProp.json" } } } spec-0.21.0/fixtures/specs/resolution2.json000066400000000000000000000002051457312531500206750ustar00rootroot00000000000000{ "id": "http://localhost:1234", "items": { "id": "deeper/", "items": { "$ref": "arrayProp.json#/items" } } }spec-0.21.0/fixtures/specs/todos.common.json000066400000000000000000000045471457312531500210440ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "version": "1.0", "title": "To-do Demo", "description": "### Notes:\n\nThis OAS2 (Swagger 2) specification defines common models and responses, that other specifications may reference.\n\nFor example, check out the user poperty in the main.oas2 todo-partial model - it references the user model in this specification!\n\nLikewise, the main.oas2 operations reference the shared error responses in this common specification.", "contact": { "name": "Stoplight", "url": "https://stoplight.io" }, "license": { "name": "MIT" } }, "host": "example.com", "securityDefinitions": {}, "paths": {}, "responses": { "401": { "description": "", "schema": { "$ref": "#/definitions/error-response" }, "examples": { "application/json": { "status": "401", "error": "Not Authorized" } } }, "403": { "description": "", "schema": { "$ref": "#/definitions/error-response" }, "examples": { "application/json": { "status": "403", "error": "Forbbiden" } } }, "404": { "description": "", "schema": { "$ref": "#/definitions/error-response" }, "examples": { "application/json": { "status": "404", "error": "Not Found" } } }, "500": { "description": "", "schema": { "$ref": "#/definitions/error-response" }, "examples": { "application/json": { "status": "500", "error": "Server Error" } } } }, "definitions": { "user": { "title": "User", "type": "object", "properties": { "name": { "type": "string", "description": "The user's full name." }, "age": { "type": "number", "minimum": 0, "maximum": 150 }, "error": { "$ref": "#/definitions/error-response" } }, "required": ["name", "age"] }, "error-response": { "type": "object", "title": "Error Response", "properties": { "status": { "type": "string" }, "error": { "type": "string" } }, "required": ["status", "error"] } } } spec-0.21.0/fixtures/specs/todos.json000066400000000000000000000215551457312531500175530ustar00rootroot00000000000000{ "swagger": "2.0", "info": { "version": "1.0", "title": "To-do Demo", "description": "This OAS2 (Swagger 2) file represents a real API that lives at http://todos.stoplight.io.\n\nFor authentication information, click the apikey security scheme in the editor sidebar.", "contact": { "name": "Stoplight", "url": "https://stoplight.io" }, "license": { "name": "MIT" } }, "host": "todos.stoplight.io", "schemes": ["http"], "consumes": ["application/json"], "produces": ["application/json"], "securityDefinitions": { "Basic": { "type": "basic" }, "API Key": { "type": "apiKey", "name": "apikey", "in": "query" } }, "paths": { "/todos/{todoId}": { "parameters": [{ "name": "todoId", "in": "path", "required": true, "type": "string" }], "get": { "operationId": "GET_todo", "summary": "Get Todo", "tags": ["Todos"], "responses": { "200": { "description": "", "schema": { "$ref": "#/definitions/todo-full" }, "examples": { "application/json": { "id": 1, "name": "get food", "completed": false, "completed_at": "1955-04-23T13:22:52.685Z", "created_at": "1994-11-05T03:26:51.471Z", "updated_at": "1989-07-29T11:30:06.701Z" }, "/todos/foobar": "{\n\t\"foo\": \"bar\"\n}\n", "/todos/chores": { "id": 9000, "name": "Do Chores", "completed": false, "created_at": "2014-08-28T14:14:28.494Z", "updated_at": "2014-08-28T14:14:28.494Z" }, "new": { "name": "esse qui proident labore", "completed": null, "id": 920778, "completed_at": "2014-01-07T07:49:55.123Z", "created_at": "1948-04-21T12:04:21.282Z", "updated_at": "1951-12-19T11:10:34.039Z", "user": { "name": "irure deserunt fugiat", "age": 121.45395681110494 }, "float": -47990796.228164576 } } }, "404": { "$ref": "./todos.common.json#/responses/404" }, "500": { "$ref": "./todos.common.json#/responses/500" } }, "parameters": [{ "in": "query", "name": "", "type": "string" }] }, "put": { "operationId": "PUT_todos", "summary": "Update Todo", "tags": ["Todos"], "parameters": [{ "name": "body", "in": "body", "schema": { "$ref": "#/definitions/todo-partial", "example": { "name": "my todo's new name", "completed": false } } }], "responses": { "200": { "description": "", "schema": { "$ref": "#/definitions/todo-full" }, "examples": { "application/json": { "id": 9000, "name": "It's Over 9000!!!", "completed": true, "completed_at": null, "created_at": "2014-08-28T14:14:28.494Z", "updated_at": "2015-08-28T14:14:28.494Z" } } }, "401": { "$ref": "./todos.common.json#/responses/401" }, "404": { "$ref": "./todos.common.json#/responses/404" }, "500": { "$ref": "./todos.common.json#/responses/500" } }, "security": [{ "Basic": [] }, { "API Key": [] } ] }, "delete": { "operationId": "DELETE_todo", "summary": "Delete Todo", "tags": ["Todos"], "responses": { "204": { "description": "" }, "401": { "$ref": "./todos.common.json#/responses/401" }, "404": { "$ref": "./todos.common.json#/responses/404" }, "500": { "$ref": "./todos.common.json#/responses/500" } }, "security": [{ "Basic": [] }, { "API Key": [] } ] } }, "/todos": { "post": { "operationId": "POST_todos", "summary": "Create Todo", "tags": ["Todos"], "parameters": [{ "name": "body", "in": "body", "schema": { "$ref": "#/definitions/todo-partial", "example": { "name": "my todo's name", "completed": false } } }], "responses": { "201": { "description": "", "schema": { "$ref": "#/definitions/todo-full" }, "examples": { "application/json": { "id": 9000, "name": "It's Over 9000!!!", "completed": null, "completed_at": null, "created_at": "2014-08-28T14:14:28.494Z", "updated_at": "2014-08-28T14:14:28.494Z" }, "/todos/chores": { "id": 9000, "name": "Do Chores", "completed": false, "created_at": "2014-08-28T14:14:28.494Z", "updated_at": "2014-08-28T14:14:28.494Z" } } }, "401": { "$ref": "./todos.common.json#/responses/401" }, "500": { "$ref": "./todos.common.json#/responses/500" } }, "security": [{ "API Key": [] }, { "Basic": [] } ], "description": "This creates a Todo object.\n\nTesting `inline code`." }, "get": { "operationId": "GET_todos", "summary": "List Todos", "tags": ["Todos"], "parameters": [{ "$ref": "#/parameters/limit" }, { "$ref": "#/parameters/skip" } ], "responses": { "200": { "description": "", "schema": { "type": "array", "items": { "$ref": "#/definitions/todo-full" } }, "examples": { "application/json": [{ "id": 1, "name": "design the thingz", "completed": true }, { "id": 2, "name": "mock the thingz", "completed": true }, { "id": 3, "name": "code the thingz", "completed": false } ], "empty": [] }, "headers": { "foo": { "type": "string", "default": "bar" } } }, "500": { "$ref": "./todos.common.json#/responses/500" } }, "description": "​" } } }, "parameters": { "limit": { "name": "limit", "in": "query", "description": "This is how it works.", "required": false, "type": "integer", "maximum": 100 }, "skip": { "name": "skip", "in": "query", "required": false, "type": "string" } }, "definitions": { "todo-partial": { "title": "Todo Partial", "type": "object", "properties": { "name": { "type": "string" }, "completed": { "type": ["boolean", "null"] } }, "required": ["name", "completed"] }, "todo-full": { "title": "Todo Full", "allOf": [{ "$ref": "#/definitions/todo-partial" }, { "type": "object", "properties": { "id": { "type": "integer", "minimum": 0, "maximum": 1000000 }, "completed_at": { "type": ["string", "null"], "format": "date-time" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "user": { "$ref": "./todos.common.json#/definitions/user" } }, "required": ["id", "user"] } ] } }, "tags": [{ "name": "Todos" }] } spec-0.21.0/go.mod000066400000000000000000000006761457312531500136510ustar00rootroot00000000000000module github.com/go-openapi/spec require ( github.com/go-openapi/jsonpointer v0.21.0 github.com/go-openapi/jsonreference v0.21.0 github.com/go-openapi/swag v0.23.0 github.com/stretchr/testify v1.9.0 gopkg.in/yaml.v3 v3.0.1 ) require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect ) go 1.20 spec-0.21.0/go.sum000066400000000000000000000037361457312531500136760ustar00rootroot00000000000000github.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.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4= github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= 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/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= spec-0.21.0/header.go000066400000000000000000000117061457312531500143160ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "encoding/json" "strings" "github.com/go-openapi/jsonpointer" "github.com/go-openapi/swag" ) const ( jsonArray = "array" ) // HeaderProps describes a response header type HeaderProps struct { Description string `json:"description,omitempty"` } // Header describes a header for a response of the API // // For more information: http://goo.gl/8us55a#headerObject type Header struct { CommonValidations SimpleSchema VendorExtensible HeaderProps } // ResponseHeader creates a new header instance for use in a response func ResponseHeader() *Header { return new(Header) } // WithDescription sets the description on this response, allows for chaining func (h *Header) WithDescription(description string) *Header { h.Description = description return h } // Typed a fluent builder method for the type of parameter func (h *Header) Typed(tpe, format string) *Header { h.Type = tpe h.Format = format return h } // CollectionOf a fluent builder method for an array item func (h *Header) CollectionOf(items *Items, format string) *Header { h.Type = jsonArray h.Items = items h.CollectionFormat = format return h } // WithDefault sets the default value on this item func (h *Header) WithDefault(defaultValue interface{}) *Header { h.Default = defaultValue return h } // WithMaxLength sets a max length value func (h *Header) WithMaxLength(max int64) *Header { h.MaxLength = &max return h } // WithMinLength sets a min length value func (h *Header) WithMinLength(min int64) *Header { h.MinLength = &min return h } // WithPattern sets a pattern value func (h *Header) WithPattern(pattern string) *Header { h.Pattern = pattern return h } // WithMultipleOf sets a multiple of value func (h *Header) WithMultipleOf(number float64) *Header { h.MultipleOf = &number return h } // WithMaximum sets a maximum number value func (h *Header) WithMaximum(max float64, exclusive bool) *Header { h.Maximum = &max h.ExclusiveMaximum = exclusive return h } // WithMinimum sets a minimum number value func (h *Header) WithMinimum(min float64, exclusive bool) *Header { h.Minimum = &min h.ExclusiveMinimum = exclusive return h } // WithEnum sets a the enum values (replace) func (h *Header) WithEnum(values ...interface{}) *Header { h.Enum = append([]interface{}{}, values...) return h } // WithMaxItems sets the max items func (h *Header) WithMaxItems(size int64) *Header { h.MaxItems = &size return h } // WithMinItems sets the min items func (h *Header) WithMinItems(size int64) *Header { h.MinItems = &size return h } // UniqueValues dictates that this array can only have unique items func (h *Header) UniqueValues() *Header { h.UniqueItems = true return h } // AllowDuplicates this array can have duplicates func (h *Header) AllowDuplicates() *Header { h.UniqueItems = false return h } // WithValidations is a fluent method to set header validations func (h *Header) WithValidations(val CommonValidations) *Header { h.SetValidations(SchemaValidations{CommonValidations: val}) return h } // MarshalJSON marshal this to JSON func (h Header) MarshalJSON() ([]byte, error) { b1, err := json.Marshal(h.CommonValidations) if err != nil { return nil, err } b2, err := json.Marshal(h.SimpleSchema) if err != nil { return nil, err } b3, err := json.Marshal(h.HeaderProps) if err != nil { return nil, err } return swag.ConcatJSON(b1, b2, b3), nil } // UnmarshalJSON unmarshals this header from JSON func (h *Header) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &h.CommonValidations); err != nil { return err } if err := json.Unmarshal(data, &h.SimpleSchema); err != nil { return err } if err := json.Unmarshal(data, &h.VendorExtensible); err != nil { return err } return json.Unmarshal(data, &h.HeaderProps) } // JSONLookup look up a value by the json property name func (h Header) JSONLookup(token string) (interface{}, error) { if ex, ok := h.Extensions[token]; ok { return &ex, nil } r, _, err := jsonpointer.GetForToken(h.CommonValidations, token) if err != nil && !strings.HasPrefix(err.Error(), "object has no field") { return nil, err } if r != nil { return r, nil } r, _, err = jsonpointer.GetForToken(h.SimpleSchema, token) if err != nil && !strings.HasPrefix(err.Error(), "object has no field") { return nil, err } if r != nil { return r, nil } r, _, err = jsonpointer.GetForToken(h.HeaderProps, token) return r, err } spec-0.21.0/header_test.go000066400000000000000000000105641457312531500153560ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "encoding/json" "testing" "github.com/go-openapi/swag" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) const epsilon = 1e-9 func float64Ptr(f float64) *float64 { return &f } func int64Ptr(f int64) *int64 { return &f } var header = Header{ VendorExtensible: VendorExtensible{Extensions: map[string]interface{}{ "x-framework": "swagger-go", }}, HeaderProps: HeaderProps{Description: "the description of this header"}, SimpleSchema: SimpleSchema{ Items: &Items{ Refable: Refable{Ref: MustCreateRef("Cat")}, }, Type: "string", Format: "date", Default: "8", }, CommonValidations: CommonValidations{ Maximum: float64Ptr(100), ExclusiveMaximum: true, ExclusiveMinimum: true, Minimum: float64Ptr(5), MaxLength: int64Ptr(100), MinLength: int64Ptr(5), Pattern: "\\w{1,5}\\w+", MaxItems: int64Ptr(100), MinItems: int64Ptr(5), UniqueItems: true, MultipleOf: float64Ptr(5), Enum: []interface{}{"hello", "world"}, }, } const headerJSON = `{ "items": { "$ref": "Cat" }, "x-framework": "swagger-go", "description": "the description of this header", "maximum": 100, "minimum": 5, "exclusiveMaximum": true, "exclusiveMinimum": true, "maxLength": 100, "minLength": 5, "pattern": "\\w{1,5}\\w+", "maxItems": 100, "minItems": 5, "uniqueItems": true, "multipleOf": 5, "enum": ["hello", "world"], "type": "string", "format": "date", "default": "8" }` func TestIntegrationHeader(t *testing.T) { var actual Header require.NoError(t, json.Unmarshal([]byte(headerJSON), &actual)) assert.EqualValues(t, actual, header) assertParsesJSON(t, headerJSON, header) } func TestJSONLookupHeader(t *testing.T) { var def string res, err := header.JSONLookup("default") require.NoError(t, err) require.NotNil(t, res) require.IsType(t, def, res) var ok bool def, ok = res.(string) require.True(t, ok) assert.Equal(t, "8", def) var x *interface{} res, err = header.JSONLookup("x-framework") require.NoError(t, err) require.NotNil(t, res) require.IsType(t, x, res) x, ok = res.(*interface{}) require.True(t, ok) assert.EqualValues(t, "swagger-go", *x) res, err = header.JSONLookup("unknown") require.Error(t, err) require.Nil(t, res) var max *float64 res, err = header.JSONLookup("maximum") require.NoError(t, err) require.NotNil(t, res) require.IsType(t, max, res) max, ok = res.(*float64) require.True(t, ok) assert.InDelta(t, float64(100), *max, epsilon) } func TestResponseHeaueder(t *testing.T) { var expectedHeader *Header h := ResponseHeader() assert.IsType(t, expectedHeader, h) } func TestWithHeader(t *testing.T) { h := new(Header).WithDescription("header description").Typed("integer", "int32") assert.Equal(t, "header description", h.Description) assert.Equal(t, "integer", h.Type) assert.Equal(t, "int32", h.Format) i := new(Items).Typed("string", "date") h = new(Header).CollectionOf(i, "pipe") assert.EqualValues(t, *i, *h.Items) assert.Equal(t, "pipe", h.CollectionFormat) h = new(Header).WithDefault([]string{"a", "b", "c"}).WithMaxLength(10).WithMinLength(3) assert.Equal(t, int64(10), *h.MaxLength) assert.Equal(t, int64(3), *h.MinLength) assert.EqualValues(t, []string{"a", "b", "c"}, h.Default) h = new(Header).WithPattern("^abc$") assert.Equal(t, Header{ CommonValidations: CommonValidations{ Pattern: "^abc$", }, }, *h) h = new(Header).WithEnum("a", "b", "c") assert.Equal(t, Header{ CommonValidations: CommonValidations{ Enum: []interface{}{ "a", "b", "c", }, }, }, *h) } func TestHeaderWithValidation(t *testing.T) { h := new(Header).WithValidations(CommonValidations{MaxLength: swag.Int64(15)}) assert.EqualValues(t, swag.Int64(15), h.MaxLength) } spec-0.21.0/helpers_spec_test.go000066400000000000000000000077341457312531500166070ustar00rootroot00000000000000package spec_test import ( "encoding/json" "fmt" "regexp" "strings" "testing" "github.com/go-openapi/spec" "github.com/go-openapi/swag" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) var ( rex = regexp.MustCompile(`"\$ref":\s*"(.*?)"`) testLoader func(string) (json.RawMessage, error) ) func init() { // mimics what the go-openapi/load does testLoader = func(path string) (json.RawMessage, error) { if swag.YAMLMatcher(path) { return swag.YAMLDoc(path) } data, err := swag.LoadFromFileOrHTTP(path) if err != nil { return nil, err } return json.RawMessage(data), nil } } func loadOrFail(t *testing.T, path string) *spec.Swagger { raw, err := testLoader(path) require.NoErrorf(t, err, "can't load fixture %s: %v", path, err) swspec := new(spec.Swagger) err = json.Unmarshal(raw, swspec) require.NoError(t, err) return swspec } func assertRefInJSON(t testing.TB, jazon, prefix string) { // assert a match in a references m := rex.FindAllStringSubmatch(jazon, -1) require.NotNil(t, m) for _, matched := range m { subMatch := matched[1] assert.True(t, strings.HasPrefix(subMatch, prefix), "expected $ref to match %q, got: %s", prefix, matched[0]) } } func assertRefInJSONRegexp(t testing.TB, jazon, match string) { // assert a match in a references m := rex.FindAllStringSubmatch(jazon, -1) require.NotNil(t, m) refMatch, err := regexp.Compile(match) require.NoError(t, err) for _, matched := range m { subMatch := matched[1] assert.True(t, refMatch.MatchString(subMatch), "expected $ref to match %q, got: %s", match, matched[0]) } } // assertRefExpand ensures that all $ref in some json doc expand properly against a root document. // // "exclude" is a regexp pattern to ignore certain $ref (e.g. some specs may embed $ref that are not processed, such as extensions). func assertRefExpand(t *testing.T, jazon, _ string, root interface{}, opts ...*spec.ExpandOptions) { if len(opts) > 0 { assertRefWithFunc(t, "expand-with-base", jazon, "", func(t *testing.T, match string) { ref := spec.RefSchema(match) options := *opts[0] require.NoError(t, spec.ExpandSchemaWithBasePath(ref, nil, &options)) }) return } assertRefWithFunc(t, "expand", jazon, "", func(t *testing.T, match string) { ref := spec.RefSchema(match) require.NoError(t, spec.ExpandSchema(ref, root, nil)) }) } func assertRefResolve(t *testing.T, jazon, exclude string, root interface{}, opts ...*spec.ExpandOptions) { assertRefWithFunc(t, "resolve", jazon, exclude, func(t *testing.T, match string) { ref := spec.MustCreateRef(match) var ( sch *spec.Schema err error ) if len(opts) > 0 { options := *opts[0] sch, err = spec.ResolveRefWithBase(root, &ref, &options) } else { sch, err = spec.ResolveRef(root, &ref) } require.NoErrorf(t, err, `%v: for "$ref": %q`, err, match) require.NotNil(t, sch) }) } // assertRefWithFunc ensures that all $ref in a j // // "exclude" is a regexp pattern to ignore certain $ref (e.g. some specs may embed $ref that are not processed, such as extensions). func assertRefWithFunc(t *testing.T, name, jazon, exclude string, asserter func(*testing.T, string)) { filterRex := regexp.MustCompile(exclude) m := rex.FindAllStringSubmatch(jazon, -1) require.NotNil(t, m) allRefs := make(map[string]struct{}, len(m)) for _, toPin := range m { matched := toPin subMatch := matched[1] if exclude != "" && filterRex.MatchString(subMatch) { continue } _, ok := allRefs[subMatch] if ok { continue } allRefs[subMatch] = struct{}{} t.Run(fmt.Sprintf("%s-%s-%s", t.Name(), name, subMatch), func(t *testing.T) { // t.Parallel() asserter(t, subMatch) }) } } func asJSON(t testing.TB, sp interface{}) string { bbb, err := json.MarshalIndent(sp, "", " ") require.NoError(t, err) return string(bbb) } // assertNoRef ensures that no $ref is remaining in json doc func assertNoRef(t testing.TB, jazon string) { m := rex.FindAllStringSubmatch(jazon, -1) require.Nil(t, m) } spec-0.21.0/helpers_test.go000066400000000000000000000115451457312531500155700ustar00rootroot00000000000000package spec import ( "encoding/json" "fmt" "regexp" "strings" "testing" "github.com/go-openapi/swag" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) var rex = regexp.MustCompile(`"\$ref":\s*"(.*?)"`) func jsonDoc(path string) (json.RawMessage, error) { data, err := swag.LoadFromFileOrHTTP(path) if err != nil { return nil, err } return json.RawMessage(data), nil } func docAndOpts(t testing.TB, fixturePath string) ([]byte, *ExpandOptions) { doc, err := jsonDoc(fixturePath) require.NoError(t, err) return doc, &ExpandOptions{ RelativeBase: fixturePath, } } func expandThisSchemaOrDieTrying(t testing.TB, fixturePath string) (string, *Schema) { doc, opts := docAndOpts(t, fixturePath) sch := new(Schema) require.NoError(t, json.Unmarshal(doc, sch)) require.NotPanics(t, func() { require.NoError(t, ExpandSchemaWithBasePath(sch, nil, opts)) }, "calling expand schema circular refs, should not panic!") bbb, err := json.MarshalIndent(sch, "", " ") require.NoError(t, err) return string(bbb), sch } func expandThisOrDieTrying(t testing.TB, fixturePath string) (string, *Swagger) { doc, opts := docAndOpts(t, fixturePath) spec := new(Swagger) require.NoError(t, json.Unmarshal(doc, spec)) require.NotPanics(t, func() { require.NoError(t, ExpandSpec(spec, opts)) }, "calling expand spec with circular refs, should not panic!") bbb, err := json.MarshalIndent(spec, "", " ") require.NoError(t, err) return string(bbb), spec } // assertRefInJSONRegexp ensures all $ref in a jazon document have a given prefix. // // NOTE: matched $ref might be empty. func assertRefInJSON(t testing.TB, jazon, prefix string) { // assert a match in a references m := rex.FindAllStringSubmatch(jazon, -1) require.NotNil(t, m) for _, matched := range m { subMatch := matched[1] assert.True(t, strings.HasPrefix(subMatch, prefix), "expected $ref to match %q, got: %s", prefix, matched[0]) } } // assertRefInJSONRegexp ensures all $ref in a jazon document match a given regexp // // NOTE: matched $ref might be empty. func assertRefInJSONRegexp(t testing.TB, jazon, match string) { // assert a match in a references m := rex.FindAllStringSubmatch(jazon, -1) require.NotNil(t, m) refMatch, err := regexp.Compile(match) require.NoError(t, err) for _, matched := range m { subMatch := matched[1] assert.True(t, refMatch.MatchString(subMatch), "expected $ref to match %q, got: %s", match, matched[0]) } } // assertNoRef ensures that no $ref is remaining in json doc func assertNoRef(t testing.TB, jazon string) { m := rex.FindAllStringSubmatch(jazon, -1) require.Nil(t, m) } // assertRefExpand ensures that all $ref in some json doc expand properly against a root document. // // "exclude" is a regexp pattern to ignore certain $ref (e.g. some specs may embed $ref that are not processed, such as extensions). func assertRefExpand(t *testing.T, jazon, _ string, root interface{}, opts ...*ExpandOptions) { assertRefWithFunc(t, jazon, "", func(t *testing.T, match string) { ref := RefSchema(match) if len(opts) > 0 { options := *opts[0] require.NoError(t, ExpandSchemaWithBasePath(ref, nil, &options)) } else { require.NoError(t, ExpandSchema(ref, root, nil)) } }) } // assertRefResolve ensures that all $ref in some json doc resolve properly against a root document. // // "exclude" is a regexp pattern to ignore certain $ref (e.g. some specs may embed $ref that are not processed, such as extensions). func assertRefResolve(t *testing.T, jazon, exclude string, root interface{}, opts ...*ExpandOptions) { assertRefWithFunc(t, jazon, exclude, func(t *testing.T, match string) { ref := MustCreateRef(match) var ( sch *Schema err error ) if len(opts) > 0 { options := *opts[0] sch, err = ResolveRefWithBase(root, &ref, &options) } else { sch, err = ResolveRef(root, &ref) } require.NoErrorf(t, err, `%v: for "$ref": %q`, err, match) require.NotNil(t, sch) }) } // assertRefResolve ensures that all $ref in some json doc verify some asserting func. // // "exclude" is a regexp pattern to ignore certain $ref (e.g. some specs may embed $ref that are not processed, such as extensions). func assertRefWithFunc(t *testing.T, jazon, exclude string, asserter func(t *testing.T, match string)) { filterRex := regexp.MustCompile(exclude) m := rex.FindAllStringSubmatch(jazon, -1) require.NotNil(t, m) allRefs := make(map[string]struct{}, len(m)) for _, matched := range m { subMatch := matched[1] if exclude != "" && filterRex.MatchString(subMatch) { continue } _, ok := allRefs[subMatch] if ok { continue } allRefs[subMatch] = struct{}{} t.Run(fmt.Sprintf("%s-%s", t.Name(), subMatch), func(t *testing.T) { t.Parallel() asserter(t, subMatch) }) } } func asJSON(t testing.TB, sp interface{}) string { bbb, err := json.MarshalIndent(sp, "", " ") require.NoError(t, err) return string(bbb) } spec-0.21.0/info.go000066400000000000000000000111711457312531500140150ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "encoding/json" "strconv" "strings" "github.com/go-openapi/jsonpointer" "github.com/go-openapi/swag" ) // Extensions vendor specific extensions type Extensions map[string]interface{} // Add adds a value to these extensions func (e Extensions) Add(key string, value interface{}) { realKey := strings.ToLower(key) e[realKey] = value } // GetString gets a string value from the extensions func (e Extensions) GetString(key string) (string, bool) { if v, ok := e[strings.ToLower(key)]; ok { str, ok := v.(string) return str, ok } return "", false } // GetInt gets a int value from the extensions func (e Extensions) GetInt(key string) (int, bool) { realKey := strings.ToLower(key) if v, ok := e.GetString(realKey); ok { if r, err := strconv.Atoi(v); err == nil { return r, true } } if v, ok := e[realKey]; ok { if r, rOk := v.(float64); rOk { return int(r), true } } return -1, false } // GetBool gets a string value from the extensions func (e Extensions) GetBool(key string) (bool, bool) { if v, ok := e[strings.ToLower(key)]; ok { str, ok := v.(bool) return str, ok } return false, false } // GetStringSlice gets a string value from the extensions func (e Extensions) GetStringSlice(key string) ([]string, bool) { if v, ok := e[strings.ToLower(key)]; ok { arr, isSlice := v.([]interface{}) if !isSlice { return nil, false } var strs []string for _, iface := range arr { str, isString := iface.(string) if !isString { return nil, false } strs = append(strs, str) } return strs, ok } return nil, false } // VendorExtensible composition block. type VendorExtensible struct { Extensions Extensions } // AddExtension adds an extension to this extensible object func (v *VendorExtensible) AddExtension(key string, value interface{}) { if value == nil { return } if v.Extensions == nil { v.Extensions = make(map[string]interface{}) } v.Extensions.Add(key, value) } // MarshalJSON marshals the extensions to json func (v VendorExtensible) MarshalJSON() ([]byte, error) { toser := make(map[string]interface{}) for k, v := range v.Extensions { lk := strings.ToLower(k) if strings.HasPrefix(lk, "x-") { toser[k] = v } } return json.Marshal(toser) } // UnmarshalJSON for this extensible object func (v *VendorExtensible) UnmarshalJSON(data []byte) error { var d map[string]interface{} if err := json.Unmarshal(data, &d); err != nil { return err } for k, vv := range d { lk := strings.ToLower(k) if strings.HasPrefix(lk, "x-") { if v.Extensions == nil { v.Extensions = map[string]interface{}{} } v.Extensions[k] = vv } } return nil } // InfoProps the properties for an info definition type InfoProps struct { Description string `json:"description,omitempty"` Title string `json:"title,omitempty"` TermsOfService string `json:"termsOfService,omitempty"` Contact *ContactInfo `json:"contact,omitempty"` License *License `json:"license,omitempty"` Version string `json:"version,omitempty"` } // Info object provides metadata about the API. // The metadata can be used by the clients if needed, and can be presented in the Swagger-UI for convenience. // // For more information: http://goo.gl/8us55a#infoObject type Info struct { VendorExtensible InfoProps } // JSONLookup look up a value by the json property name func (i Info) JSONLookup(token string) (interface{}, error) { if ex, ok := i.Extensions[token]; ok { return &ex, nil } r, _, err := jsonpointer.GetForToken(i.InfoProps, token) return r, err } // MarshalJSON marshal this to JSON func (i Info) MarshalJSON() ([]byte, error) { b1, err := json.Marshal(i.InfoProps) if err != nil { return nil, err } b2, err := json.Marshal(i.VendorExtensible) if err != nil { return nil, err } return swag.ConcatJSON(b1, b2), nil } // UnmarshalJSON marshal this from JSON func (i *Info) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &i.InfoProps); err != nil { return err } return json.Unmarshal(data, &i.VendorExtensible) } spec-0.21.0/info_test.go000066400000000000000000000046141457312531500150600ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "encoding/json" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) const infoJSON = `{ "description": "A sample API that uses a petstore as an example to demonstrate features in ` + `the swagger-2.0 specification", "title": "Swagger Sample API", "termsOfService": "http://helloreverb.com/terms/", "contact": { "name": "wordnik api team", "url": "http://developer.wordnik.com" }, "license": { "name": "Creative Commons 4.0 International", "url": "http://creativecommons.org/licenses/by/4.0/" }, "version": "1.0.9-abcd", "x-framework": "go-swagger" }` var info = Info{ InfoProps: InfoProps{ Version: "1.0.9-abcd", Title: "Swagger Sample API", Description: "A sample API that uses a petstore as an example to demonstrate features in " + "the swagger-2.0 specification", TermsOfService: "http://helloreverb.com/terms/", Contact: &ContactInfo{ContactInfoProps: ContactInfoProps{Name: "wordnik api team", URL: "http://developer.wordnik.com"}}, License: &License{LicenseProps: LicenseProps{ Name: "Creative Commons 4.0 International", URL: "http://creativecommons.org/licenses/by/4.0/", }, }, }, VendorExtensible: VendorExtensible{Extensions: map[string]interface{}{"x-framework": "go-swagger"}}, } func TestIntegrationInfo_Serialize(t *testing.T) { b, err := json.MarshalIndent(info, "", "\t") require.NoError(t, err) assert.Equal(t, infoJSON, string(b)) } func TestIntegrationInfo_Deserialize(t *testing.T) { actual := Info{} require.NoError(t, json.Unmarshal([]byte(infoJSON), &actual)) assert.EqualValues(t, info, actual) } func TestInfoGobEncoding(t *testing.T) { var src, dst Info require.NoError(t, json.Unmarshal([]byte(infoJSON), &src)) assert.EqualValues(t, src, info) doTestAnyGobEncoding(t, &src, &dst) } spec-0.21.0/items.go000066400000000000000000000134051457312531500142050ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "encoding/json" "strings" "github.com/go-openapi/jsonpointer" "github.com/go-openapi/swag" ) const ( jsonRef = "$ref" ) // SimpleSchema describe swagger simple schemas for parameters and headers type SimpleSchema struct { Type string `json:"type,omitempty"` Nullable bool `json:"nullable,omitempty"` Format string `json:"format,omitempty"` Items *Items `json:"items,omitempty"` CollectionFormat string `json:"collectionFormat,omitempty"` Default interface{} `json:"default,omitempty"` Example interface{} `json:"example,omitempty"` } // TypeName return the type (or format) of a simple schema func (s *SimpleSchema) TypeName() string { if s.Format != "" { return s.Format } return s.Type } // ItemsTypeName yields the type of items in a simple schema array func (s *SimpleSchema) ItemsTypeName() string { if s.Items == nil { return "" } return s.Items.TypeName() } // Items a limited subset of JSON-Schema's items object. // It is used by parameter definitions that are not located in "body". // // For more information: http://goo.gl/8us55a#items-object type Items struct { Refable CommonValidations SimpleSchema VendorExtensible } // NewItems creates a new instance of items func NewItems() *Items { return &Items{} } // Typed a fluent builder method for the type of item func (i *Items) Typed(tpe, format string) *Items { i.Type = tpe i.Format = format return i } // AsNullable flags this schema as nullable. func (i *Items) AsNullable() *Items { i.Nullable = true return i } // CollectionOf a fluent builder method for an array item func (i *Items) CollectionOf(items *Items, format string) *Items { i.Type = jsonArray i.Items = items i.CollectionFormat = format return i } // WithDefault sets the default value on this item func (i *Items) WithDefault(defaultValue interface{}) *Items { i.Default = defaultValue return i } // WithMaxLength sets a max length value func (i *Items) WithMaxLength(max int64) *Items { i.MaxLength = &max return i } // WithMinLength sets a min length value func (i *Items) WithMinLength(min int64) *Items { i.MinLength = &min return i } // WithPattern sets a pattern value func (i *Items) WithPattern(pattern string) *Items { i.Pattern = pattern return i } // WithMultipleOf sets a multiple of value func (i *Items) WithMultipleOf(number float64) *Items { i.MultipleOf = &number return i } // WithMaximum sets a maximum number value func (i *Items) WithMaximum(max float64, exclusive bool) *Items { i.Maximum = &max i.ExclusiveMaximum = exclusive return i } // WithMinimum sets a minimum number value func (i *Items) WithMinimum(min float64, exclusive bool) *Items { i.Minimum = &min i.ExclusiveMinimum = exclusive return i } // WithEnum sets a the enum values (replace) func (i *Items) WithEnum(values ...interface{}) *Items { i.Enum = append([]interface{}{}, values...) return i } // WithMaxItems sets the max items func (i *Items) WithMaxItems(size int64) *Items { i.MaxItems = &size return i } // WithMinItems sets the min items func (i *Items) WithMinItems(size int64) *Items { i.MinItems = &size return i } // UniqueValues dictates that this array can only have unique items func (i *Items) UniqueValues() *Items { i.UniqueItems = true return i } // AllowDuplicates this array can have duplicates func (i *Items) AllowDuplicates() *Items { i.UniqueItems = false return i } // WithValidations is a fluent method to set Items validations func (i *Items) WithValidations(val CommonValidations) *Items { i.SetValidations(SchemaValidations{CommonValidations: val}) return i } // UnmarshalJSON hydrates this items instance with the data from JSON func (i *Items) UnmarshalJSON(data []byte) error { var validations CommonValidations if err := json.Unmarshal(data, &validations); err != nil { return err } var ref Refable if err := json.Unmarshal(data, &ref); err != nil { return err } var simpleSchema SimpleSchema if err := json.Unmarshal(data, &simpleSchema); err != nil { return err } var vendorExtensible VendorExtensible if err := json.Unmarshal(data, &vendorExtensible); err != nil { return err } i.Refable = ref i.CommonValidations = validations i.SimpleSchema = simpleSchema i.VendorExtensible = vendorExtensible return nil } // MarshalJSON converts this items object to JSON func (i Items) MarshalJSON() ([]byte, error) { b1, err := json.Marshal(i.CommonValidations) if err != nil { return nil, err } b2, err := json.Marshal(i.SimpleSchema) if err != nil { return nil, err } b3, err := json.Marshal(i.Refable) if err != nil { return nil, err } b4, err := json.Marshal(i.VendorExtensible) if err != nil { return nil, err } return swag.ConcatJSON(b4, b3, b1, b2), nil } // JSONLookup look up a value by the json property name func (i Items) JSONLookup(token string) (interface{}, error) { if token == jsonRef { return &i.Ref, nil } r, _, err := jsonpointer.GetForToken(i.CommonValidations, token) if err != nil && !strings.HasPrefix(err.Error(), "object has no field") { return nil, err } if r != nil { return r, nil } r, _, err = jsonpointer.GetForToken(i.SimpleSchema, token) return r, err } spec-0.21.0/items_test.go000066400000000000000000000110101457312531500152320ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "encoding/json" "testing" "github.com/go-openapi/swag" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) var items = Items{ Refable: Refable{Ref: MustCreateRef("Dog")}, CommonValidations: CommonValidations{ Maximum: float64Ptr(100), ExclusiveMaximum: true, ExclusiveMinimum: true, Minimum: float64Ptr(5), MaxLength: int64Ptr(100), MinLength: int64Ptr(5), Pattern: "\\w{1,5}\\w+", MaxItems: int64Ptr(100), MinItems: int64Ptr(5), UniqueItems: true, MultipleOf: float64Ptr(5), Enum: []interface{}{"hello", "world"}, }, SimpleSchema: SimpleSchema{ Type: "string", Format: "date", Items: &Items{ Refable: Refable{Ref: MustCreateRef("Cat")}, }, CollectionFormat: "csv", Default: "8", }, } const itemsJSON = `{ "items": { "$ref": "Cat" }, "$ref": "Dog", "maximum": 100, "minimum": 5, "exclusiveMaximum": true, "exclusiveMinimum": true, "maxLength": 100, "minLength": 5, "pattern": "\\w{1,5}\\w+", "maxItems": 100, "minItems": 5, "uniqueItems": true, "multipleOf": 5, "enum": ["hello", "world"], "type": "string", "format": "date", "collectionFormat": "csv", "default": "8" }` func TestIntegrationItems(t *testing.T) { var actual Items require.NoError(t, json.Unmarshal([]byte(itemsJSON), &actual)) assert.EqualValues(t, actual, items) assertParsesJSON(t, itemsJSON, items) } func TestTypeNameItems(t *testing.T) { var nilItems Items assert.Equal(t, "", nilItems.TypeName()) assert.Equal(t, "date", items.TypeName()) assert.Equal(t, "", items.ItemsTypeName()) nested := Items{ SimpleSchema: SimpleSchema{ Type: "array", Items: &Items{ SimpleSchema: SimpleSchema{ Type: "integer", Format: "int32", }, }, CollectionFormat: "csv", }, } assert.Equal(t, "array", nested.TypeName()) assert.Equal(t, "int32", nested.ItemsTypeName()) simple := SimpleSchema{ Type: "string", Items: nil, } assert.Equal(t, "string", simple.TypeName()) assert.Equal(t, "", simple.ItemsTypeName()) simple.Items = NewItems() simple.Type = "array" simple.Items.Type = "string" assert.Equal(t, "array", simple.TypeName()) assert.Equal(t, "string", simple.ItemsTypeName()) } func TestItemsBuilder(t *testing.T) { simple := SimpleSchema{ Type: "array", Items: NewItems(). Typed("string", "uuid"). WithDefault([]string{"default-value"}). WithEnum([]string{"abc", "efg"}, []string{"hij"}). WithMaxItems(4). WithMinItems(1). UniqueValues(), } assert.Equal(t, SimpleSchema{ Type: "array", Items: &Items{ SimpleSchema: SimpleSchema{ Type: "string", Format: "uuid", Default: []string{"default-value"}, }, CommonValidations: CommonValidations{ Enum: []interface{}{[]string{"abc", "efg"}, []string{"hij"}}, MinItems: swag.Int64(1), MaxItems: swag.Int64(4), UniqueItems: true, }, }, }, simple) } func TestJSONLookupItems(t *testing.T) { res, err := items.JSONLookup("$ref") require.NoError(t, err) require.NotNil(t, res) require.IsType(t, &Ref{}, res) var ok bool ref, ok := res.(*Ref) require.True(t, ok) assert.EqualValues(t, MustCreateRef("Dog"), *ref) var max *float64 res, err = items.JSONLookup("maximum") require.NoError(t, err) require.NotNil(t, res) require.IsType(t, max, res) max, ok = res.(*float64) require.True(t, ok) assert.InDelta(t, float64(100), *max, epsilon) var f string res, err = items.JSONLookup("collectionFormat") require.NoError(t, err) require.NotNil(t, res) require.IsType(t, f, res) f, ok = res.(string) require.True(t, ok) assert.Equal(t, "csv", f) res, err = items.JSONLookup("unknown") require.Error(t, err) require.Nil(t, res) } func TestItemsWithValidation(t *testing.T) { i := new(Items).WithValidations(CommonValidations{MaxLength: swag.Int64(15)}) assert.EqualValues(t, swag.Int64(15), i.MaxLength) } spec-0.21.0/license.go000066400000000000000000000027541457312531500145130ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "encoding/json" "github.com/go-openapi/swag" ) // License information for the exposed API. // // For more information: http://goo.gl/8us55a#licenseObject type License struct { LicenseProps VendorExtensible } // LicenseProps holds the properties of a License object type LicenseProps struct { Name string `json:"name,omitempty"` URL string `json:"url,omitempty"` } // UnmarshalJSON hydrates License from json func (l *License) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &l.LicenseProps); err != nil { return err } return json.Unmarshal(data, &l.VendorExtensible) } // MarshalJSON produces License as json func (l License) MarshalJSON() ([]byte, error) { b1, err := json.Marshal(l.LicenseProps) if err != nil { return nil, err } b2, err := json.Marshal(l.VendorExtensible) if err != nil { return nil, err } return swag.ConcatJSON(b1, b2), nil } spec-0.21.0/license_test.go000066400000000000000000000025411457312531500155440ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "encoding/json" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) var license = License{ LicenseProps: LicenseProps{Name: "the name", URL: "the url"}, VendorExtensible: VendorExtensible{Extensions: map[string]interface{}{"x-license": "custom term"}}} const licenseJSON = `{ "name": "the name", "url": "the url", "x-license": "custom term" }` func TestIntegrationLicense(t *testing.T) { // const licenseYAML = "name: the name\nurl: the url\n" b, err := json.MarshalIndent(license, "", "\t") require.NoError(t, err) assert.Equal(t, licenseJSON, string(b)) actual := License{} err = json.Unmarshal([]byte(licenseJSON), &actual) require.NoError(t, err) assert.EqualValues(t, license, actual) } spec-0.21.0/normalizer.go000066400000000000000000000143671457312531500152560ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "net/url" "path" "strings" ) const fileScheme = "file" // normalizeURI ensures that all $ref paths used internally by the expander are canonicalized. // // NOTE(windows): there is a tolerance over the strict URI format on windows. // // The normalizer accepts relative file URLs like 'Path\File.JSON' as well as absolute file URLs like // 'C:\Path\file.Yaml'. // // Both are canonicalized with a "file://" scheme, slashes and a lower-cased path: // 'file:///c:/path/file.yaml' // // URLs can be specified with a file scheme, like in 'file:///folder/file.json' or // 'file:///c:\folder\File.json'. // // URLs like file://C:\folder are considered invalid (i.e. there is no host 'c:\folder') and a "repair" // is attempted. // // The base path argument is assumed to be canonicalized (e.g. using normalizeBase()). func normalizeURI(refPath, base string) string { refURL, err := parseURL(refPath) if err != nil { specLogger.Printf("warning: invalid URI in $ref %q: %v", refPath, err) refURL, refPath = repairURI(refPath) } fixWindowsURI(refURL, refPath) // noop on non-windows OS refURL.Path = path.Clean(refURL.Path) if refURL.Path == "." { refURL.Path = "" } r := MustCreateRef(refURL.String()) if r.IsCanonical() { return refURL.String() } baseURL, _ := parseURL(base) if path.IsAbs(refURL.Path) { baseURL.Path = refURL.Path } else if refURL.Path != "" { baseURL.Path = path.Join(path.Dir(baseURL.Path), refURL.Path) } // copying fragment from ref to base baseURL.Fragment = refURL.Fragment return baseURL.String() } // denormalizeRef returns the simplest notation for a normalized $ref, given the path of the original root document. // // When calling this, we assume that: // * $ref is a canonical URI // * originalRelativeBase is a canonical URI // // denormalizeRef is currently used when we rewrite a $ref after a circular $ref has been detected. // In this case, expansion stops and normally renders the internal canonical $ref. // // This internal $ref is eventually rebased to the original RelativeBase used for the expansion. // // There is a special case for schemas that are anchored with an "id": // in that case, the rebasing is performed // against the id only if this is an anchor for the initial root document. // All other intermediate "id"'s found along the way are ignored for the purpose of rebasing. func denormalizeRef(ref *Ref, originalRelativeBase, id string) Ref { debugLog("denormalizeRef called:\n$ref: %q\noriginal: %s\nroot ID:%s", ref.String(), originalRelativeBase, id) if ref.String() == "" || ref.IsRoot() || ref.HasFragmentOnly { // short circuit: $ref to current doc return *ref } if id != "" { idBaseURL, err := parseURL(id) if err == nil { // if the schema id is not usable as a URI, ignore it if ref, ok := rebase(ref, idBaseURL, true); ok { // rebase, but keep references to root unchaged (do not want $ref: "") // $ref relative to the ID of the schema in the root document return ref } } } originalRelativeBaseURL, _ := parseURL(originalRelativeBase) r, _ := rebase(ref, originalRelativeBaseURL, false) return r } func rebase(ref *Ref, v *url.URL, notEqual bool) (Ref, bool) { var newBase url.URL u := ref.GetURL() if u.Scheme != v.Scheme || u.Host != v.Host { return *ref, false } docPath := v.Path v.Path = path.Dir(v.Path) if v.Path == "." { v.Path = "" } else if !strings.HasSuffix(v.Path, "/") { v.Path += "/" } newBase.Fragment = u.Fragment if strings.HasPrefix(u.Path, docPath) { newBase.Path = strings.TrimPrefix(u.Path, docPath) } else { newBase.Path = strings.TrimPrefix(u.Path, v.Path) } if notEqual && newBase.Path == "" && newBase.Fragment == "" { // do not want rebasing to end up in an empty $ref return *ref, false } if path.IsAbs(newBase.Path) { // whenever we end up with an absolute path, specify the scheme and host newBase.Scheme = v.Scheme newBase.Host = v.Host } return MustCreateRef(newBase.String()), true } // normalizeRef canonicalize a Ref, using a canonical relativeBase as its absolute anchor func normalizeRef(ref *Ref, relativeBase string) *Ref { r := MustCreateRef(normalizeURI(ref.String(), relativeBase)) return &r } // normalizeBase performs a normalization of the input base path. // // This always yields a canonical URI (absolute), usable for the document cache. // // It ensures that all further internal work on basePath may safely assume // a non-empty, cross-platform, canonical URI (i.e. absolute). // // This normalization tolerates windows paths (e.g. C:\x\y\File.dat) and transform this // in a file:// URL with lower cased drive letter and path. // // See also: https://en.wikipedia.org/wiki/File_URI_scheme func normalizeBase(in string) string { u, err := parseURL(in) if err != nil { specLogger.Printf("warning: invalid URI in RelativeBase %q: %v", in, err) u, in = repairURI(in) } u.Fragment = "" // any fragment in the base is irrelevant fixWindowsURI(u, in) // noop on non-windows OS u.Path = path.Clean(u.Path) if u.Path == "." { // empty after Clean() u.Path = "" } if u.Scheme != "" { if path.IsAbs(u.Path) || u.Scheme != fileScheme { // this is absolute or explicitly not a local file: we're good return u.String() } } // no scheme or file scheme with relative path: assume file and make it absolute // enforce scheme file://... with absolute path. // // If the input path is relative, we anchor the path to the current working directory. // NOTE: we may end up with a host component. Leave it unchanged: e.g. file://host/folder/file.json u.Scheme = fileScheme u.Path = absPath(u.Path) // platform-dependent u.RawQuery = "" // any query component is irrelevant for a base return u.String() } spec-0.21.0/normalizer_nonwindows.go000066400000000000000000000023031457312531500175260ustar00rootroot00000000000000//go:build !windows // +build !windows // Copyright 2015 go-swagger maintainers // // 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 spec import ( "net/url" "path/filepath" ) // absPath makes a file path absolute and compatible with a URI path component. // // The parameter must be a path, not an URI. func absPath(in string) string { anchored, err := filepath.Abs(in) if err != nil { specLogger.Printf("warning: could not resolve current working directory: %v", err) return in } return anchored } func repairURI(in string) (*url.URL, string) { u, _ := parseURL("") debugLog("repaired URI: original: %q, repaired: %q", in, "") return u, "" } func fixWindowsURI(_ *url.URL, _ string) { } spec-0.21.0/normalizer_test.go000066400000000000000000000437201457312531500163100ustar00rootroot00000000000000package spec import ( "os" "path" "path/filepath" "runtime" "strings" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) const windowsOS = "windows" // only used for windows var currentDriveLetter = getCurrentDrive() // get the current drive letter in lowercase on windows that the test is running func getCurrentDrive() string { if runtime.GOOS != windowsOS { return "" } p, err := filepath.Abs("/") if err != nil { panic(err) } if len(p) == 0 { panic("current windows drive letter is empty") } return strings.ToLower(string(p[0])) } func TestNormalizer_NormalizeURI(t *testing.T) { type testNormalizePathsTestCases []struct { refPath string base string expOutput string windows bool nonWindows bool } testCases := func() testNormalizePathsTestCases { return testNormalizePathsTestCases{ { // http basePath, absolute refPath refPath: "", base: "http://www.example.com/base/path/swagger.json", expOutput: "http://www.example.com/base/path/swagger.json", }, { // http basePath, absolute refPath refPath: "#", base: "http://www.example.com/base/path/swagger.json", expOutput: "http://www.example.com/base/path/swagger.json", }, { // http basePath, absolute refPath refPath: "#/definitions/Pet", base: "http://www.example.com/base/path/swagger.json", expOutput: "http://www.example.com/base/path/swagger.json#/definitions/Pet", }, { // http basePath, absolute refPath refPath: "http://www.anotherexample.com/another/base/path/swagger.json#/definitions/Pet", base: "http://www.example.com/base/path/swagger.json", expOutput: "http://www.anotherexample.com/another/base/path/swagger.json#/definitions/Pet", }, { // http basePath, relative refPath refPath: "another/base/path/swagger.json#/definitions/Pet", base: "http://www.example.com/base/path/swagger.json", expOutput: "http://www.example.com/base/path/another/base/path/swagger.json#/definitions/Pet", }, { // file basePath, absolute refPath, no fragment refPath: "/another/base/path.json", base: "/base/path.json", expOutput: "/another/base/path.json", }, { // path clean refPath: "/another///base//path.json/", base: "/base/path.json", expOutput: "/another/base/path.json", }, { // path clean edge case refPath: "", base: "/base/path.json", expOutput: "/base/path.json", }, { // file basePath, absolute refPath refPath: "/another/base/path.json#/definitions/Pet", base: "/base/path.json", expOutput: "/another/base/path.json#/definitions/Pet", }, { // file basePath, relative refPath refPath: "another/base/path.json#/definitions/Pet", base: "/base/path.json", expOutput: "/base/another/base/path.json#/definitions/Pet", }, { // file basePath, relative refPath refPath: "./another/base/path.json#/definitions/Pet", base: "/base/path.json", expOutput: "/base/another/base/path.json#/definitions/Pet", }, { refPath: "another/base/path.json#/definitions/Pet", base: "file:///base/path.json", expOutput: "file:///base/another/base/path.json#/definitions/Pet", }, { refPath: "/another/base/path.json#/definitions/Pet", base: "https://www.example.com:8443//base/path.json", expOutput: "https://www.example.com:8443/another/base/path.json#/definitions/Pet", }, { // params in base refPath: "/another/base/path.json#/definitions/Pet", base: "https://www.example.com:8443//base/path.json?raw=true", expOutput: "https://www.example.com:8443/another/base/path.json?raw=true#/definitions/Pet", }, { // params in ref refPath: "https://origin.com/another/file.json?raw=true", base: "https://www.example.com:8443//base/path.json?raw=true", expOutput: "https://origin.com/another/file.json?raw=true", }, { refPath: "another/base/def.yaml#/definitions/Pet", base: "file:///base/path.json", expOutput: "file:///base/another/base/def.yaml#/definitions/Pet", }, { refPath: "", base: "file:///base/path.json", expOutput: "file:///base/path.json", }, { refPath: "#", base: "file:///base/path.json", expOutput: "file:///base/path.json", }, { refPath: "../other/another.json#/definitions/X", base: "file:///base/path.json", expOutput: "file:///other/another.json#/definitions/X", }, { // invalid URI refPath: "\x7f\x9a", base: "file:///base/path.json", expOutput: "file:///base/path.json", }, { // file basePath, absolute refPath, no fragment refPath: `C:\another\base\path.json`, base: `file:///c:/base/path.json`, expOutput: `file:///c:/another/base/path.json`, windows: true, }, { // file basePath, absolute refPath refPath: `C:\another\Base\path.json#/definitions/Pet`, base: `file:///c:/base/path.json`, expOutput: `file:///c:/another/base/path.json#/definitions/Pet`, windows: true, }, { // file basePath, relative refPath refPath: `another\base\path.json#/definitions/Pet`, base: `file:///c:/base/path.json`, expOutput: `file:///c:/base/another/base/path.json#/definitions/Pet`, windows: true, }, { // file basePath, relative refPath refPath: `.\another\base\path.json#/definitions/Pet`, base: `file:///c:/base/path.json`, expOutput: `file:///c:/base/another/base/path.json#/definitions/Pet`, windows: true, }, { refPath: `\\host\share\another\base\path.json#/definitions/Pet`, base: `file:///c:/base/path.json`, expOutput: `file://host/share/another/base/path.json#/definitions/Pet`, windows: true, }, { // repair URI refPath: `file://E:\Base\sub\File.json`, base: `file:///c:/base/path.json`, expOutput: `file:///e:/base/sub/file.json`, windows: true, }, { // case sensitivity on local paths only (1/4) // see note: refPath: `Resources.yaml#/definitions/Pets`, base: `file:///c:/base/Spec.json`, expOutput: `file:///c:/base/Resources.yaml#/definitions/Pets`, windows: true, }, { // case sensitivity on local paths only (2/4) refPath: `Resources.yaml#/definitions/Pets`, base: `file:///c:/base/Spec.json`, expOutput: `file:///c:/base/Resources.yaml#/definitions/Pets`, nonWindows: true, }, { // case sensitivity on local paths only (3/4) refPath: `Resources.yaml#/definitions/Pets`, base: `https://example.com//base/Spec.json`, expOutput: `https://example.com/base/Resources.yaml#/definitions/Pets`, }, { // escaped characters in base (1) refPath: `Resources.yaml#/definitions/Pets`, base: `https://example.com/base (x86)/Spec.json`, expOutput: `https://example.com/base%20%28x86%29/Resources.yaml#/definitions/Pets`, }, { // escaped characters in base (2) refPath: `Resources.yaml#/definitions/Pets`, base: `https://example.com/base [x86]/Spec.json`, expOutput: `https://example.com/base%20%5Bx86%5D/Resources.yaml#/definitions/Pets`, }, { // escaped characters in joined fragment refPath: `Resources.yaml#/definitions (x86)/Pets`, base: `https://example.com/base/Spec.json`, expOutput: `https://example.com/base/Resources.yaml#/definitions%20(x86)/Pets`, }, { // escaped characters in joined path refPath: `Resources [x86].yaml#/definitions/Pets`, base: `https://example.com/base/Spec.json`, expOutput: `https://example.com/base/Resources%20%5Bx86%5D.yaml#/definitions/Pets`, }, } }() for _, toPin := range testCases { testCase := toPin if testCase.windows && runtime.GOOS != windowsOS { continue } if testCase.nonWindows && runtime.GOOS == windowsOS { continue } t.Run(testCase.refPath, func(t *testing.T) { t.Parallel() out := normalizeURI(testCase.refPath, testCase.base) assert.Equalf(t, testCase.expOutput, out, "unexpected normalized URL with $ref %q and base %q", testCase.refPath, testCase.base) }) } } func TestNormalizer_NormalizeBase(t *testing.T) { cwd, err := os.Getwd() require.NoError(t, err) if runtime.GOOS == windowsOS { cwd = "/" + strings.ToLower(filepath.ToSlash(cwd)) } const fileScheme = "file:///" for _, toPin := range []struct { Base, Expected string Windows bool NonWindows bool }{ { Base: "", Expected: "file://$cwd", // edge case: this won't work because a document is a file }, { Base: "#", Expected: "file://$cwd", // edge case: this won't work because a document is a file }, { Base: "\x7f\x9a", Expected: "file://$cwd", // edge case: invalid URI }, { Base: ".", Expected: "file://$cwd", // edge case: this won't work because a document is a file }, { Base: "https://user:password@www.example.com:123/base/sub/file.json", Expected: "https://user:password@www.example.com:123/base/sub/file.json", }, { // irrelevant fragment: cleaned Base: "http://www.anotherexample.com/another/base/path/swagger.json#/definitions/Pet", Expected: "http://www.anotherexample.com/another/base/path/swagger.json", }, { Base: "base/sub/file.json", Expected: "file://$cwd/base/sub/file.json", }, { Base: "./base/sub/file.json", Expected: "file://$cwd/base/sub/file.json", }, { Base: "file:/base/sub/file.json", Expected: "file:///base/sub/file.json", }, { // funny scheme, no path Base: "smb://host", Expected: "smb://host", }, { // explicit scheme, with host and path Base: "gs://bucket/folder/file.json", Expected: "gs://bucket/folder/file.json", }, { // explicit file scheme, with host and path Base: "file://folder/file.json", Expected: "file://folder/file.json", }, { // path clean Base: "file:///folder//subfolder///file.json/", Expected: "file:///folder/subfolder/file.json", }, { // path clean Base: "///folder//subfolder///file.json/", Expected: "file:///folder/subfolder/file.json", NonWindows: true, }, { // path clean Base: "///folder//subfolder///file.json/", Expected: fileScheme + currentDriveLetter + ":/folder/subfolder/file.json", Windows: true, }, { // relevant query param: kept Base: "https:///host/base/sub/file.json?query=param", Expected: "https:///host/base/sub/file.json?query=param", }, { // no host component, absolute path Base: `file:/base/sub/file.json`, Expected: "file:///base/sub/file.json", }, { // handling dots (1/6): dodgy specification - resolved to / Base: `file:///.`, Expected: "file:///", }, { // handling dots (2/6): valid, cleaned to / Base: "/..", Expected: "file:///", NonWindows: true, }, { // handling dots (3/6): valid, cleaned to /c:/ on windows Base: "/..", Expected: fileScheme + currentDriveLetter + ":", Windows: true, }, { // handling dots (4/6): dodgy specification - resolved to / Base: `file:/.`, Expected: fileScheme, }, { // handling dots (5/6): dodgy specification - resolved to / Base: `file:/..`, Expected: fileScheme, }, { // handling dots (6/6) Base: `..`, Expected: "file://$dir", }, // non-windows case { Base: "/base/sub/file.json", Expected: "file:///base/sub/file.json", NonWindows: true, }, { // irrelevant query param (local file resolver): cleaned Base: "/base/sub/file.json?query=param", Expected: "file:///base/sub/file.json", NonWindows: true, }, // windows-only cases { Base: "/base/sub/file.json", Expected: fileScheme + currentDriveLetter + ":/base/sub/file.json", // on windows, filepath.Abs("/a/b") prepends the "c:" drive Windows: true, }, { // case sensitivity Base: `C:\Base\sub\File.json`, Expected: "file:///c:/base/sub/file.json", Windows: true, }, { // This one is parsed correctly: notice the third slash Base: `file:///\Base\sub\File.json`, Expected: "file:///base/sub/file.json", Windows: true, }, { // absolute path Base: `file:/\Base\sub\File.json`, Expected: "file:///base/sub/file.json", Windows: true, }, { // windows UNC path, no drive Base: `\\host\share@1234\Folder\File.json`, Expected: "file://host/share@1234/folder/file.json", Windows: true, }, { // repair invalid use of leading "." on windows Base: `file:///.\Base\sub\File.json`, Expected: "file://$cwd/base/sub/file.json", Windows: true, }, { Base: `file:/E:\Base\sub\File.json`, Expected: "file:///e:/base/sub/file.json", Windows: true, }, { // repair URI (windows) // This one exhibits an example of invalid URI (missing a 3rd "/") Base: `file://E:\Base\sub\File.json`, Expected: "file:///e:/base/sub/file.json", Windows: true, }, { // escaped characters in base (1) Base: `file:///c:/base (x86)/spec.json`, Expected: `file:///c:/base%20%28x86%29/spec.json`, }, } { testCase := toPin if testCase.Windows && runtime.GOOS != windowsOS { continue } if testCase.NonWindows && runtime.GOOS == windowsOS { continue } t.Run(testCase.Base, func(t *testing.T) { t.Parallel() expected := strings.ReplaceAll(strings.ReplaceAll(testCase.Expected, "$cwd", cwd), "$dir", path.Dir(cwd)) require.Equalf(t, expected, normalizeBase(testCase.Base), "for base %q", testCase.Base) // check for idempotence require.Equalf(t, expected, normalizeBase(normalizeBase(testCase.Base)), "expected idempotent behavior on base %q", testCase.Base) }) } } func TestNormalizer_Denormalize(t *testing.T) { cwd, err := os.Getwd() require.NoError(t, err) for _, toPin := range []struct { OriginalBase, Ref, Expected, ID string Windows bool NonWindows bool }{ { OriginalBase: "file:///a/b/c/file.json", Ref: "#/definitions/X", Expected: "#/definitions/X", }, { OriginalBase: "file:///a/b/c/file.json#ignoredFragment", Ref: "#/definitions/X", Expected: "#/definitions/X", }, { OriginalBase: "https://user:password@example.com/a/b/c/file.json", Ref: "https://user:password@example.com/a/b/c/other.json#/definitions/X", Expected: "other.json#/definitions/X", }, { OriginalBase: "file:///a/b/c/file.json", Ref: "file:///a/b/c/items.json#/definitions/X", Expected: "items.json#/definitions/X", }, { OriginalBase: "file:///a/b/c/file.json", Ref: "https:///x/y/z/items.json#/definitions/X", Expected: "https:///x/y/z/items.json#/definitions/X", }, { OriginalBase: "file:///a/b/c/file.json", Ref: "file:///a/b/c/file.json#/definitions/X", Expected: "#/definitions/X", }, { OriginalBase: "file:///a/b/c/file.json", Ref: "file:///a/b/c/d/other.json#/definitions/X", Expected: "d/other.json#/definitions/X", }, { OriginalBase: "file:///a/b/c/file.json", Ref: "file:///a/b/c/file.json#", Expected: "", }, { OriginalBase: "file:///a/b/c/file.json", Ref: "file:///a/b/c/d/file.json", Expected: "d/file.json", }, { OriginalBase: "file:///a/b/c/file.json", Ref: "file:///a/b/c/file.json", Expected: "", }, { OriginalBase: "file:///a/b/c/file.json", Ref: "file:///a/b/c/../other.json#/definitions/X", Expected: "../other.json#/definitions/X", }, { OriginalBase: "file:///a/b/c/file.json", Ref: "file:///a/b/c/../../other.json#/definitions/X", Expected: "../../other.json#/definitions/X", }, { // we may end up in this situation following ../.. in paths OriginalBase: "file:///a1/b/c/file.json", Ref: "file:///a2/b/c/file.json#/definitions/X", Expected: "file:///a2/b/c/file.json#/definitions/X", }, { OriginalBase: "file:///file.json", Ref: "file:///file.json#/definitions/X", Expected: "#/definitions/X", }, { OriginalBase: "file://host/file.json", Ref: "file://host/file.json#/definitions/X", Expected: "#/definitions/X", }, { OriginalBase: "file://host1/file.json", Ref: "file://host2/file.json#/definitions/X", Expected: "file://host2/file.json#/definitions/X", }, { OriginalBase: "file:///a/b/c/file.json", ID: "https://myschema/", Ref: "file:///a/b/c/file.json#/definitions/X", Expected: "#/definitions/X", }, { OriginalBase: "file:///a/b/c/file.json", ID: "https://myschema/", Ref: "https://myschema#/definitions/X", Expected: "#/definitions/X", }, { OriginalBase: "file:///a/b/c/file.json", ID: "https://myschema/", Ref: "https://myschema#/definitions/X", Expected: "#/definitions/X", }, { OriginalBase: "file:///folder/file.json", ID: "https://example.com/schema", Ref: "https://example.com/schema#/definitions/X", Expected: "#/definitions/X", }, { OriginalBase: "file:///folder/file.json", ID: "https://example.com/schema", Ref: "https://example.com/schema/other-file.json#/definitions/X", Expected: "https://example.com/other-file.json#/definitions/X", }, } { testCase := toPin if testCase.Windows && runtime.GOOS != windowsOS { // windows only continue } if testCase.NonWindows && runtime.GOOS == windowsOS { // non-windows only continue } t.Run(testCase.Ref, func(t *testing.T) { t.Parallel() expected := strings.ReplaceAll(testCase.Expected, "$cwd", cwd) ref := MustCreateRef(testCase.Ref) newRef := denormalizeRef(&ref, testCase.OriginalBase, testCase.ID) require.NotNil(t, newRef) require.Equalf(t, expected, newRef.String(), "expected %s, but got %s", testCase.Expected, newRef.String()) }) } } spec-0.21.0/normalizer_windows.go000066400000000000000000000122261457312531500170200ustar00rootroot00000000000000// -build windows // Copyright 2015 go-swagger maintainers // // 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 spec import ( "net/url" "os" "path" "path/filepath" "strings" ) // absPath makes a file path absolute and compatible with a URI path component // // The parameter must be a path, not an URI. func absPath(in string) string { // NOTE(windows): filepath.Abs exhibits a special behavior on windows for empty paths. // See https://github.com/golang/go/issues/24441 if in == "" { in = "." } anchored, err := filepath.Abs(in) if err != nil { specLogger.Printf("warning: could not resolve current working directory: %v", err) return in } pth := strings.ReplaceAll(strings.ToLower(anchored), `\`, `/`) if !strings.HasPrefix(pth, "/") { pth = "/" + pth } return path.Clean(pth) } // repairURI tolerates invalid file URIs with common typos // such as 'file://E:\folder\file', that break the regular URL parser. // // Adopting the same defaults as for unixes (e.g. return an empty path) would // result into a counter-intuitive result for that case (e.g. E:\folder\file is // eventually resolved as the current directory). The repair will detect the missing "/". // // Note that this only works for the file scheme. func repairURI(in string) (*url.URL, string) { const prefix = fileScheme + "://" if !strings.HasPrefix(in, prefix) { // giving up: resolve to empty path u, _ := parseURL("") return u, "" } // attempt the repair, stripping the scheme should be sufficient u, _ := parseURL(strings.TrimPrefix(in, prefix)) debugLog("repaired URI: original: %q, repaired: %q", in, u.String()) return u, u.String() } // fixWindowsURI tolerates an absolute file path on windows such as C:\Base\File.yaml or \\host\share\Base\File.yaml // and makes it a canonical URI: file:///c:/base/file.yaml // // Catch 22 notes for Windows: // // * There may be a drive letter on windows (it is lower-cased) // * There may be a share UNC, e.g. \\server\folder\data.xml // * Paths are case insensitive // * Paths may already contain slashes // * Paths must be slashed // // NOTE: there is no escaping. "/" may be valid separators just like "\". // We don't use ToSlash() (which escapes everything) because windows now also // tolerates the use of "/". Hence, both C:\File.yaml and C:/File.yaml will work. func fixWindowsURI(u *url.URL, in string) { drive := filepath.VolumeName(in) if len(drive) > 0 { if len(u.Scheme) == 1 && strings.EqualFold(u.Scheme, drive[:1]) { // a path with a drive letter u.Scheme = fileScheme u.Host = "" u.Path = strings.Join([]string{drive, u.Opaque, u.Path}, `/`) // reconstruct the full path component (no fragment, no query) } else if u.Host == "" && strings.HasPrefix(u.Path, drive) { // a path with a \\host volume // NOTE: the special host@port syntax for UNC is not supported (yet) u.Scheme = fileScheme // this is a modified version of filepath.Dir() to apply on the VolumeName itself i := len(drive) - 1 for i >= 0 && !os.IsPathSeparator(drive[i]) { i-- } host := drive[:i] // \\host\share => host u.Path = strings.TrimPrefix(u.Path, host) u.Host = strings.TrimPrefix(host, `\\`) } u.Opaque = "" u.Path = strings.ReplaceAll(strings.ToLower(u.Path), `\`, `/`) // ensure we form an absolute path if !strings.HasPrefix(u.Path, "/") { u.Path = "/" + u.Path } u.Path = path.Clean(u.Path) return } if u.Scheme == fileScheme { // Handle dodgy cases for file://{...} URIs on windows. // A canonical URI should always be followed by an absolute path. // // Examples: // * file:///folder/file => valid, unchanged // * file:///c:\folder\file => slashed // * file:///./folder/file => valid, cleaned to remove the dot // * file:///.\folder\file => remapped to cwd // * file:///. => dodgy, remapped to / (consistent with the behavior on unix) // * file:///.. => dodgy, remapped to / (consistent with the behavior on unix) if (!path.IsAbs(u.Path) && !filepath.IsAbs(u.Path)) || (strings.HasPrefix(u.Path, `/.`) && strings.Contains(u.Path, `\`)) { // ensure we form an absolute path u.Path, _ = filepath.Abs(strings.TrimLeft(u.Path, `/`)) if !strings.HasPrefix(u.Path, "/") { u.Path = "/" + u.Path } } u.Path = strings.ToLower(u.Path) } // NOTE: lower case normalization does not propagate to inner resources, // generated when rebasing: when joining a relative URI with a file to an absolute base, // only the base is currently lower-cased. // // For now, we assume this is good enough for most use cases // and try not to generate too many differences // between the output produced on different platforms. u.Path = path.Clean(strings.ReplaceAll(u.Path, `\`, `/`)) } spec-0.21.0/operation.go000066400000000000000000000255361457312531500150740ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "bytes" "encoding/gob" "encoding/json" "sort" "github.com/go-openapi/jsonpointer" "github.com/go-openapi/swag" ) func init() { gob.Register(map[string]interface{}{}) gob.Register([]interface{}{}) } // OperationProps describes an operation // // NOTES: // - schemes, when present must be from [http, https, ws, wss]: see validate // - Security is handled as a special case: see MarshalJSON function type OperationProps struct { Description string `json:"description,omitempty"` Consumes []string `json:"consumes,omitempty"` Produces []string `json:"produces,omitempty"` Schemes []string `json:"schemes,omitempty"` Tags []string `json:"tags,omitempty"` Summary string `json:"summary,omitempty"` ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"` ID string `json:"operationId,omitempty"` Deprecated bool `json:"deprecated,omitempty"` Security []map[string][]string `json:"security,omitempty"` Parameters []Parameter `json:"parameters,omitempty"` Responses *Responses `json:"responses,omitempty"` } // MarshalJSON takes care of serializing operation properties to JSON // // We use a custom marhaller here to handle a special cases related to // the Security field. We need to preserve zero length slice // while omitting the field when the value is nil/unset. func (op OperationProps) MarshalJSON() ([]byte, error) { type Alias OperationProps if op.Security == nil { return json.Marshal(&struct { Security []map[string][]string `json:"security,omitempty"` *Alias }{ Security: op.Security, Alias: (*Alias)(&op), }) } return json.Marshal(&struct { Security []map[string][]string `json:"security"` *Alias }{ Security: op.Security, Alias: (*Alias)(&op), }) } // Operation describes a single API operation on a path. // // For more information: http://goo.gl/8us55a#operationObject type Operation struct { VendorExtensible OperationProps } // SuccessResponse gets a success response model func (o *Operation) SuccessResponse() (*Response, int, bool) { if o.Responses == nil { return nil, 0, false } responseCodes := make([]int, 0, len(o.Responses.StatusCodeResponses)) for k := range o.Responses.StatusCodeResponses { if k >= 200 && k < 300 { responseCodes = append(responseCodes, k) } } if len(responseCodes) > 0 { sort.Ints(responseCodes) v := o.Responses.StatusCodeResponses[responseCodes[0]] return &v, responseCodes[0], true } return o.Responses.Default, 0, false } // JSONLookup look up a value by the json property name func (o Operation) JSONLookup(token string) (interface{}, error) { if ex, ok := o.Extensions[token]; ok { return &ex, nil } r, _, err := jsonpointer.GetForToken(o.OperationProps, token) return r, err } // UnmarshalJSON hydrates this items instance with the data from JSON func (o *Operation) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &o.OperationProps); err != nil { return err } return json.Unmarshal(data, &o.VendorExtensible) } // MarshalJSON converts this items object to JSON func (o Operation) MarshalJSON() ([]byte, error) { b1, err := json.Marshal(o.OperationProps) if err != nil { return nil, err } b2, err := json.Marshal(o.VendorExtensible) if err != nil { return nil, err } concated := swag.ConcatJSON(b1, b2) return concated, nil } // NewOperation creates a new operation instance. // It expects an ID as parameter but not passing an ID is also valid. func NewOperation(id string) *Operation { op := new(Operation) op.ID = id return op } // WithID sets the ID property on this operation, allows for chaining. func (o *Operation) WithID(id string) *Operation { o.ID = id return o } // WithDescription sets the description on this operation, allows for chaining func (o *Operation) WithDescription(description string) *Operation { o.Description = description return o } // WithSummary sets the summary on this operation, allows for chaining func (o *Operation) WithSummary(summary string) *Operation { o.Summary = summary return o } // WithExternalDocs sets/removes the external docs for/from this operation. // When you pass empty strings as params the external documents will be removed. // When you pass non-empty string as one value then those values will be used on the external docs object. // So when you pass a non-empty description, you should also pass the url and vice versa. func (o *Operation) WithExternalDocs(description, url string) *Operation { if description == "" && url == "" { o.ExternalDocs = nil return o } if o.ExternalDocs == nil { o.ExternalDocs = &ExternalDocumentation{} } o.ExternalDocs.Description = description o.ExternalDocs.URL = url return o } // Deprecate marks the operation as deprecated func (o *Operation) Deprecate() *Operation { o.Deprecated = true return o } // Undeprecate marks the operation as not deprected func (o *Operation) Undeprecate() *Operation { o.Deprecated = false return o } // WithConsumes adds media types for incoming body values func (o *Operation) WithConsumes(mediaTypes ...string) *Operation { o.Consumes = append(o.Consumes, mediaTypes...) return o } // WithProduces adds media types for outgoing body values func (o *Operation) WithProduces(mediaTypes ...string) *Operation { o.Produces = append(o.Produces, mediaTypes...) return o } // WithTags adds tags for this operation func (o *Operation) WithTags(tags ...string) *Operation { o.Tags = append(o.Tags, tags...) return o } // AddParam adds a parameter to this operation, when a parameter for that location // and with that name already exists it will be replaced func (o *Operation) AddParam(param *Parameter) *Operation { if param == nil { return o } for i, p := range o.Parameters { if p.Name == param.Name && p.In == param.In { params := make([]Parameter, 0, len(o.Parameters)+1) params = append(params, o.Parameters[:i]...) params = append(params, *param) params = append(params, o.Parameters[i+1:]...) o.Parameters = params return o } } o.Parameters = append(o.Parameters, *param) return o } // RemoveParam removes a parameter from the operation func (o *Operation) RemoveParam(name, in string) *Operation { for i, p := range o.Parameters { if p.Name == name && p.In == in { o.Parameters = append(o.Parameters[:i], o.Parameters[i+1:]...) return o } } return o } // SecuredWith adds a security scope to this operation. func (o *Operation) SecuredWith(name string, scopes ...string) *Operation { o.Security = append(o.Security, map[string][]string{name: scopes}) return o } // WithDefaultResponse adds a default response to the operation. // Passing a nil value will remove the response func (o *Operation) WithDefaultResponse(response *Response) *Operation { return o.RespondsWith(0, response) } // RespondsWith adds a status code response to the operation. // When the code is 0 the value of the response will be used as default response value. // When the value of the response is nil it will be removed from the operation func (o *Operation) RespondsWith(code int, response *Response) *Operation { if o.Responses == nil { o.Responses = new(Responses) } if code == 0 { o.Responses.Default = response return o } if response == nil { delete(o.Responses.StatusCodeResponses, code) return o } if o.Responses.StatusCodeResponses == nil { o.Responses.StatusCodeResponses = make(map[int]Response) } o.Responses.StatusCodeResponses[code] = *response return o } type opsAlias OperationProps type gobAlias struct { Security []map[string]struct { List []string Pad bool } Alias *opsAlias SecurityIsEmpty bool } // GobEncode provides a safe gob encoder for Operation, including empty security requirements func (o Operation) GobEncode() ([]byte, error) { raw := struct { Ext VendorExtensible Props OperationProps }{ Ext: o.VendorExtensible, Props: o.OperationProps, } var b bytes.Buffer err := gob.NewEncoder(&b).Encode(raw) return b.Bytes(), err } // GobDecode provides a safe gob decoder for Operation, including empty security requirements func (o *Operation) GobDecode(b []byte) error { var raw struct { Ext VendorExtensible Props OperationProps } buf := bytes.NewBuffer(b) err := gob.NewDecoder(buf).Decode(&raw) if err != nil { return err } o.VendorExtensible = raw.Ext o.OperationProps = raw.Props return nil } // GobEncode provides a safe gob encoder for Operation, including empty security requirements func (op OperationProps) GobEncode() ([]byte, error) { raw := gobAlias{ Alias: (*opsAlias)(&op), } var b bytes.Buffer if op.Security == nil { // nil security requirement err := gob.NewEncoder(&b).Encode(raw) return b.Bytes(), err } if len(op.Security) == 0 { // empty, but non-nil security requirement raw.SecurityIsEmpty = true raw.Alias.Security = nil err := gob.NewEncoder(&b).Encode(raw) return b.Bytes(), err } raw.Security = make([]map[string]struct { List []string Pad bool }, 0, len(op.Security)) for _, req := range op.Security { v := make(map[string]struct { List []string Pad bool }, len(req)) for k, val := range req { v[k] = struct { List []string Pad bool }{ List: val, } } raw.Security = append(raw.Security, v) } err := gob.NewEncoder(&b).Encode(raw) return b.Bytes(), err } // GobDecode provides a safe gob decoder for Operation, including empty security requirements func (op *OperationProps) GobDecode(b []byte) error { var raw gobAlias buf := bytes.NewBuffer(b) err := gob.NewDecoder(buf).Decode(&raw) if err != nil { return err } if raw.Alias == nil { return nil } switch { case raw.SecurityIsEmpty: // empty, but non-nil security requirement raw.Alias.Security = []map[string][]string{} case len(raw.Alias.Security) == 0: // nil security requirement raw.Alias.Security = nil default: raw.Alias.Security = make([]map[string][]string, 0, len(raw.Security)) for _, req := range raw.Security { v := make(map[string][]string, len(req)) for k, val := range req { v[k] = make([]string, 0, len(val.List)) v[k] = append(v[k], val.List...) } raw.Alias.Security = append(raw.Alias.Security, v) } } *op = *(*OperationProps)(raw.Alias) return nil } spec-0.21.0/operation_test.go000066400000000000000000000227461457312531500161330ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "bytes" "encoding/gob" "encoding/json" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) var operation = Operation{ VendorExtensible: VendorExtensible{ Extensions: map[string]interface{}{ "x-framework": "go-swagger", }, }, OperationProps: OperationProps{ Description: "operation description", Consumes: []string{"application/json", "application/x-yaml"}, Produces: []string{"application/json", "application/x-yaml"}, Schemes: []string{"http", "https"}, Tags: []string{"dogs"}, Summary: "the summary of the operation", ID: "sendCat", Deprecated: true, Security: []map[string][]string{ { "apiKey": {}, }, }, Parameters: []Parameter{ {Refable: Refable{Ref: MustCreateRef("Cat")}}, }, Responses: &Responses{ ResponsesProps: ResponsesProps{ Default: &Response{ ResponseProps: ResponseProps{ Description: "void response", }, }, }, }, }, } const operationJSON = `{ "description": "operation description", "x-framework": "go-swagger", "consumes": [ "application/json", "application/x-yaml" ], "produces": [ "application/json", "application/x-yaml" ], "schemes": ["http", "https"], "tags": ["dogs"], "summary": "the summary of the operation", "operationId": "sendCat", "deprecated": true, "security": [ { "apiKey": [] } ], "parameters": [{"$ref":"Cat"}], "responses": { "default": { "description": "void response" } } }` func TestSuccessResponse(t *testing.T) { ope := &Operation{} resp, n, f := ope.SuccessResponse() assert.Nil(t, resp) assert.Equal(t, 0, n) assert.False(t, f) resp, n, f = operation.SuccessResponse() require.NotNil(t, resp) assert.Equal(t, "void response", resp.Description) assert.Equal(t, 0, n) assert.False(t, f) require.NoError(t, json.Unmarshal([]byte(operationJSON), ope)) ope = ope.RespondsWith(301, &Response{ ResponseProps: ResponseProps{ Description: "failure", }, }) resp, n, f = ope.SuccessResponse() require.NotNil(t, resp) assert.Equal(t, "void response", resp.Description) assert.Equal(t, 0, n) assert.False(t, f) ope = ope.RespondsWith(200, &Response{ ResponseProps: ResponseProps{ Description: "success", }, }) resp, n, f = ope.SuccessResponse() require.NotNil(t, resp) assert.Equal(t, "success", resp.Description) assert.Equal(t, 200, n) assert.True(t, f) } func TestOperationBuilder(t *testing.T) { ope := NewOperation("").WithID("operationID") ope = ope.RespondsWith(200, &Response{ ResponseProps: ResponseProps{ Description: "success", }, }). WithDefaultResponse(&Response{ ResponseProps: ResponseProps{ Description: "default", }, }). SecuredWith("scheme-name", "scope1", "scope2"). WithConsumes("application/json"). WithProduces("application/json"). Deprecate(). WithTags("this", "that"). AddParam(nil). AddParam(QueryParam("myQueryParam").Typed("integer", "int32")). AddParam(QueryParam("myQueryParam").Typed("string", "hostname")). AddParam(PathParam("myPathParam").Typed("string", "uuid")). WithDescription("test operation"). WithSummary("my summary"). WithExternalDocs("some doc", "https://www.example.com") jazon, err := json.MarshalIndent(ope, "", " ") require.NoError(t, err) assert.JSONEq(t, `{ "operationId": "operationID", "description": "test operation", "summary": "my summary", "externalDocs": { "description": "some doc", "url": "https://www.example.com" }, "security": [ { "scheme-name": [ "scope1", "scope2" ] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "this", "that" ], "deprecated": true, "parameters": [ { "type": "string", "format": "hostname", "name": "myQueryParam", "in": "query" }, { "type": "string", "format": "uuid", "name": "myPathParam", "in": "path", "required": true } ], "responses": { "200": { "description": "success" }, "default": { "description": "default" } } }`, string(jazon)) // check token lookup token, err := ope.JSONLookup("responses") require.NoError(t, err) jazon, err = json.MarshalIndent(token, "", " ") require.NoError(t, err) assert.JSONEq(t, `{ "200": { "description": "success" }, "default": { "description": "default" } }`, string(jazon)) // check delete methods ope = ope.RespondsWith(200, nil). RemoveParam("myQueryParam", "query"). RemoveParam("myPathParam", "path"). RemoveParam("fakeParam", "query"). Undeprecate(). WithExternalDocs("", "") jazon, err = json.MarshalIndent(ope, "", " ") require.NoError(t, err) assert.JSONEq(t, `{ "security": [ { "scheme-name": [ "scope1", "scope2" ] } ], "description": "test operation", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "this", "that" ], "summary": "my summary", "operationId": "operationID", "responses": { "default": { "description": "default" } } }`, string(jazon)) } func TestIntegrationOperation(t *testing.T) { var actual Operation require.NoError(t, json.Unmarshal([]byte(operationJSON), &actual)) assert.EqualValues(t, actual, operation) assertParsesJSON(t, operationJSON, operation) } func TestSecurityProperty(t *testing.T) { // Ensure we omit security key when unset securityNotSet := OperationProps{} jsonResult, err := json.Marshal(securityNotSet) require.NoError(t, err) assert.NotContains(t, string(jsonResult), "security", "security key should be omitted when unset") // Ensure we preserve the security key when it contains an empty (zero length) slice securityContainsEmptyArray := OperationProps{ Security: []map[string][]string{}, } jsonResult, err = json.Marshal(securityContainsEmptyArray) require.NoError(t, err) var props OperationProps require.NoError(t, json.Unmarshal(jsonResult, &props)) assert.Equal(t, securityContainsEmptyArray, props) } func TestOperationGobEncoding(t *testing.T) { // 1. empty scope in security requirements: "security": [ { "apiKey": [] } ], doTestOperationGobEncoding(t, operationJSON) // 2. nil security requirements doTestOperationGobEncoding(t, `{ "description": "operation description", "x-framework": "go-swagger", "consumes": [ "application/json", "application/x-yaml" ], "produces": [ "application/json", "application/x-yaml" ], "schemes": ["http", "https"], "tags": ["dogs"], "summary": "the summary of the operation", "operationId": "sendCat", "deprecated": true, "parameters": [{"$ref":"Cat"}], "responses": { "default": { "description": "void response" } } }`) // 3. empty security requirement doTestOperationGobEncoding(t, `{ "description": "operation description", "x-framework": "go-swagger", "consumes": [ "application/json", "application/x-yaml" ], "produces": [ "application/json", "application/x-yaml" ], "schemes": ["http", "https"], "tags": ["dogs"], "security": [], "summary": "the summary of the operation", "operationId": "sendCat", "deprecated": true, "parameters": [{"$ref":"Cat"}], "responses": { "default": { "description": "void response" } } }`) // 4. non-empty security requirements doTestOperationGobEncoding(t, `{ "description": "operation description", "x-framework": "go-swagger", "consumes": [ "application/json", "application/x-yaml" ], "produces": [ "application/json", "application/x-yaml" ], "schemes": ["http", "https"], "tags": ["dogs"], "summary": "the summary of the operation", "security": [ { "scoped-auth": [ "phone", "email" ] , "api-key": []} ], "operationId": "sendCat", "deprecated": true, "parameters": [{"$ref":"Cat"}], "responses": { "default": { "description": "void response" } } }`) } func doTestOperationGobEncoding(t *testing.T, fixture string) { var src, dst Operation require.NoError(t, json.Unmarshal([]byte(fixture), &src)) doTestAnyGobEncoding(t, &src, &dst) } func doTestAnyGobEncoding(t *testing.T, src, dst interface{}) { expectedJSON, _ := json.MarshalIndent(src, "", " ") var b bytes.Buffer err := gob.NewEncoder(&b).Encode(src) require.NoError(t, err) err = gob.NewDecoder(&b).Decode(dst) require.NoError(t, err) jazon, err := json.MarshalIndent(dst, "", " ") require.NoError(t, err) assert.JSONEq(t, string(expectedJSON), string(jazon)) } spec-0.21.0/parameter.go000066400000000000000000000246061457312531500150510ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "encoding/json" "strings" "github.com/go-openapi/jsonpointer" "github.com/go-openapi/swag" ) // QueryParam creates a query parameter func QueryParam(name string) *Parameter { return &Parameter{ParamProps: ParamProps{Name: name, In: "query"}} } // HeaderParam creates a header parameter, this is always required by default func HeaderParam(name string) *Parameter { return &Parameter{ParamProps: ParamProps{Name: name, In: "header", Required: true}} } // PathParam creates a path parameter, this is always required func PathParam(name string) *Parameter { return &Parameter{ParamProps: ParamProps{Name: name, In: "path", Required: true}} } // BodyParam creates a body parameter func BodyParam(name string, schema *Schema) *Parameter { return &Parameter{ParamProps: ParamProps{Name: name, In: "body", Schema: schema}} } // FormDataParam creates a body parameter func FormDataParam(name string) *Parameter { return &Parameter{ParamProps: ParamProps{Name: name, In: "formData"}} } // FileParam creates a body parameter func FileParam(name string) *Parameter { return &Parameter{ParamProps: ParamProps{Name: name, In: "formData"}, SimpleSchema: SimpleSchema{Type: "file"}} } // SimpleArrayParam creates a param for a simple array (string, int, date etc) func SimpleArrayParam(name, tpe, fmt string) *Parameter { return &Parameter{ParamProps: ParamProps{Name: name}, SimpleSchema: SimpleSchema{Type: jsonArray, CollectionFormat: "csv", Items: &Items{SimpleSchema: SimpleSchema{Type: tpe, Format: fmt}}}} } // ParamRef creates a parameter that's a json reference func ParamRef(uri string) *Parameter { p := new(Parameter) p.Ref = MustCreateRef(uri) return p } // ParamProps describes the specific attributes of an operation parameter // // NOTE: // - Schema is defined when "in" == "body": see validate // - AllowEmptyValue is allowed where "in" == "query" || "formData" type ParamProps struct { Description string `json:"description,omitempty"` Name string `json:"name,omitempty"` In string `json:"in,omitempty"` Required bool `json:"required,omitempty"` Schema *Schema `json:"schema,omitempty"` AllowEmptyValue bool `json:"allowEmptyValue,omitempty"` } // Parameter a unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn). // // There are five possible parameter types. // - Path - Used together with [Path Templating](#pathTemplating), where the parameter value is actually part // of the operation's URL. This does not include the host or base path of the API. For example, in `/items/{itemId}`, // the path parameter is `itemId`. // - Query - Parameters that are appended to the URL. For example, in `/items?id=###`, the query parameter is `id`. // - Header - Custom headers that are expected as part of the request. // - Body - The payload that's appended to the HTTP request. Since there can only be one payload, there can only be // _one_ body parameter. The name of the body parameter has no effect on the parameter itself and is used for // documentation purposes only. Since Form parameters are also in the payload, body and form parameters cannot exist // together for the same operation. // - Form - Used to describe the payload of an HTTP request when either `application/x-www-form-urlencoded` or // `multipart/form-data` are used as the content type of the request (in Swagger's definition, // the [`consumes`](#operationConsumes) property of an operation). This is the only parameter type that can be used // to send files, thus supporting the `file` type. Since form parameters are sent in the payload, they cannot be // declared together with a body parameter for the same operation. Form parameters have a different format based on // the content-type used (for further details, consult http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4). // - `application/x-www-form-urlencoded` - Similar to the format of Query parameters but as a payload. // For example, `foo=1&bar=swagger` - both `foo` and `bar` are form parameters. This is normally used for simple // parameters that are being transferred. // - `multipart/form-data` - each parameter takes a section in the payload with an internal header. // For example, for the header `Content-Disposition: form-data; name="submit-name"` the name of the parameter is // `submit-name`. This type of form parameters is more commonly used for file transfers. // // For more information: http://goo.gl/8us55a#parameterObject type Parameter struct { Refable CommonValidations SimpleSchema VendorExtensible ParamProps } // JSONLookup look up a value by the json property name func (p Parameter) JSONLookup(token string) (interface{}, error) { if ex, ok := p.Extensions[token]; ok { return &ex, nil } if token == jsonRef { return &p.Ref, nil } r, _, err := jsonpointer.GetForToken(p.CommonValidations, token) if err != nil && !strings.HasPrefix(err.Error(), "object has no field") { return nil, err } if r != nil { return r, nil } r, _, err = jsonpointer.GetForToken(p.SimpleSchema, token) if err != nil && !strings.HasPrefix(err.Error(), "object has no field") { return nil, err } if r != nil { return r, nil } r, _, err = jsonpointer.GetForToken(p.ParamProps, token) return r, err } // WithDescription a fluent builder method for the description of the parameter func (p *Parameter) WithDescription(description string) *Parameter { p.Description = description return p } // Named a fluent builder method to override the name of the parameter func (p *Parameter) Named(name string) *Parameter { p.Name = name return p } // WithLocation a fluent builder method to override the location of the parameter func (p *Parameter) WithLocation(in string) *Parameter { p.In = in return p } // Typed a fluent builder method for the type of the parameter value func (p *Parameter) Typed(tpe, format string) *Parameter { p.Type = tpe p.Format = format return p } // CollectionOf a fluent builder method for an array parameter func (p *Parameter) CollectionOf(items *Items, format string) *Parameter { p.Type = jsonArray p.Items = items p.CollectionFormat = format return p } // WithDefault sets the default value on this parameter func (p *Parameter) WithDefault(defaultValue interface{}) *Parameter { p.AsOptional() // with default implies optional p.Default = defaultValue return p } // AllowsEmptyValues flags this parameter as being ok with empty values func (p *Parameter) AllowsEmptyValues() *Parameter { p.AllowEmptyValue = true return p } // NoEmptyValues flags this parameter as not liking empty values func (p *Parameter) NoEmptyValues() *Parameter { p.AllowEmptyValue = false return p } // AsOptional flags this parameter as optional func (p *Parameter) AsOptional() *Parameter { p.Required = false return p } // AsRequired flags this parameter as required func (p *Parameter) AsRequired() *Parameter { if p.Default != nil { // with a default required makes no sense return p } p.Required = true return p } // WithMaxLength sets a max length value func (p *Parameter) WithMaxLength(max int64) *Parameter { p.MaxLength = &max return p } // WithMinLength sets a min length value func (p *Parameter) WithMinLength(min int64) *Parameter { p.MinLength = &min return p } // WithPattern sets a pattern value func (p *Parameter) WithPattern(pattern string) *Parameter { p.Pattern = pattern return p } // WithMultipleOf sets a multiple of value func (p *Parameter) WithMultipleOf(number float64) *Parameter { p.MultipleOf = &number return p } // WithMaximum sets a maximum number value func (p *Parameter) WithMaximum(max float64, exclusive bool) *Parameter { p.Maximum = &max p.ExclusiveMaximum = exclusive return p } // WithMinimum sets a minimum number value func (p *Parameter) WithMinimum(min float64, exclusive bool) *Parameter { p.Minimum = &min p.ExclusiveMinimum = exclusive return p } // WithEnum sets a the enum values (replace) func (p *Parameter) WithEnum(values ...interface{}) *Parameter { p.Enum = append([]interface{}{}, values...) return p } // WithMaxItems sets the max items func (p *Parameter) WithMaxItems(size int64) *Parameter { p.MaxItems = &size return p } // WithMinItems sets the min items func (p *Parameter) WithMinItems(size int64) *Parameter { p.MinItems = &size return p } // UniqueValues dictates that this array can only have unique items func (p *Parameter) UniqueValues() *Parameter { p.UniqueItems = true return p } // AllowDuplicates this array can have duplicates func (p *Parameter) AllowDuplicates() *Parameter { p.UniqueItems = false return p } // WithValidations is a fluent method to set parameter validations func (p *Parameter) WithValidations(val CommonValidations) *Parameter { p.SetValidations(SchemaValidations{CommonValidations: val}) return p } // UnmarshalJSON hydrates this items instance with the data from JSON func (p *Parameter) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &p.CommonValidations); err != nil { return err } if err := json.Unmarshal(data, &p.Refable); err != nil { return err } if err := json.Unmarshal(data, &p.SimpleSchema); err != nil { return err } if err := json.Unmarshal(data, &p.VendorExtensible); err != nil { return err } return json.Unmarshal(data, &p.ParamProps) } // MarshalJSON converts this items object to JSON func (p Parameter) MarshalJSON() ([]byte, error) { b1, err := json.Marshal(p.CommonValidations) if err != nil { return nil, err } b2, err := json.Marshal(p.SimpleSchema) if err != nil { return nil, err } b3, err := json.Marshal(p.Refable) if err != nil { return nil, err } b4, err := json.Marshal(p.VendorExtensible) if err != nil { return nil, err } b5, err := json.Marshal(p.ParamProps) if err != nil { return nil, err } return swag.ConcatJSON(b3, b1, b2, b4, b5), nil } spec-0.21.0/parameters_test.go000066400000000000000000000114171457312531500162670ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "encoding/json" "testing" "github.com/go-openapi/swag" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) var parameter = Parameter{ VendorExtensible: VendorExtensible{Extensions: map[string]interface{}{ "x-framework": "swagger-go", }}, Refable: Refable{Ref: MustCreateRef("Dog")}, CommonValidations: CommonValidations{ Maximum: float64Ptr(100), ExclusiveMaximum: true, ExclusiveMinimum: true, Minimum: float64Ptr(5), MaxLength: int64Ptr(100), MinLength: int64Ptr(5), Pattern: "\\w{1,5}\\w+", MaxItems: int64Ptr(100), MinItems: int64Ptr(5), UniqueItems: true, MultipleOf: float64Ptr(5), Enum: []interface{}{"hello", "world"}, }, SimpleSchema: SimpleSchema{ Type: "string", Format: "date", CollectionFormat: "csv", Items: &Items{ Refable: Refable{Ref: MustCreateRef("Cat")}, }, Default: "8", }, ParamProps: ParamProps{ Name: "param-name", In: "header", Required: true, Schema: &Schema{SchemaProps: SchemaProps{Type: []string{"string"}}}, Description: "the description of this parameter", }, } var parameterJSON = `{ "items": { "$ref": "Cat" }, "x-framework": "swagger-go", "$ref": "Dog", "description": "the description of this parameter", "maximum": 100, "minimum": 5, "exclusiveMaximum": true, "exclusiveMinimum": true, "maxLength": 100, "minLength": 5, "pattern": "\\w{1,5}\\w+", "maxItems": 100, "minItems": 5, "uniqueItems": true, "multipleOf": 5, "enum": ["hello", "world"], "type": "string", "format": "date", "name": "param-name", "in": "header", "required": true, "schema": { "type": "string" }, "collectionFormat": "csv", "default": "8" }` func TestIntegrationParameter(t *testing.T) { var actual Parameter require.NoError(t, json.Unmarshal([]byte(parameterJSON), &actual)) assert.EqualValues(t, actual, parameter) assertParsesJSON(t, parameterJSON, parameter) } func TestParameterSerialization(t *testing.T) { items := &Items{ SimpleSchema: SimpleSchema{Type: "string"}, } intItems := &Items{ SimpleSchema: SimpleSchema{Type: "int", Format: "int32"}, } assertSerializeJSON(t, QueryParam("").Typed("string", ""), `{"type":"string","in":"query"}`) assertSerializeJSON(t, QueryParam("").CollectionOf(items, "multi"), `{"type":"array","items":{"type":"string"},"collectionFormat":"multi","in":"query"}`) assertSerializeJSON(t, PathParam("").Typed("string", ""), `{"type":"string","in":"path","required":true}`) assertSerializeJSON(t, PathParam("").CollectionOf(items, "multi"), `{"type":"array","items":{"type":"string"},"collectionFormat":"multi","in":"path","required":true}`) assertSerializeJSON(t, PathParam("").CollectionOf(intItems, "multi"), `{"type":"array","items":{"type":"int","format":"int32"},"collectionFormat":"multi","in":"path","required":true}`) assertSerializeJSON(t, HeaderParam("").Typed("string", ""), `{"type":"string","in":"header","required":true}`) assertSerializeJSON(t, HeaderParam("").CollectionOf(items, "multi"), `{"type":"array","items":{"type":"string"},"collectionFormat":"multi","in":"header","required":true}`) schema := &Schema{SchemaProps: SchemaProps{ Properties: map[string]Schema{ "name": {SchemaProps: SchemaProps{ Type: []string{"string"}, }}, }, }} refSchema := &Schema{ SchemaProps: SchemaProps{Ref: MustCreateRef("Cat")}, } assertSerializeJSON(t, BodyParam("", schema), `{"in":"body","schema":{"properties":{"name":{"type":"string"}}}}`) assertSerializeJSON(t, BodyParam("", refSchema), `{"in":"body","schema":{"$ref":"Cat"}}`) // array body param assertSerializeJSON(t, BodyParam("", ArrayProperty(RefProperty("Cat"))), `{"in":"body","schema":{"type":"array","items":{"$ref":"Cat"}}}`) } func TestParameterGobEncoding(t *testing.T) { var src, dst Parameter require.NoError(t, json.Unmarshal([]byte(parameterJSON), &src)) doTestAnyGobEncoding(t, &src, &dst) } func TestParametersWithValidation(t *testing.T) { p := new(Parameter).WithValidations(CommonValidations{MaxLength: swag.Int64(15)}) assert.EqualValues(t, swag.Int64(15), p.MaxLength) } spec-0.21.0/path_item.go000066400000000000000000000051421457312531500150350ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "encoding/json" "github.com/go-openapi/jsonpointer" "github.com/go-openapi/swag" ) // PathItemProps the path item specific properties type PathItemProps struct { Get *Operation `json:"get,omitempty"` Put *Operation `json:"put,omitempty"` Post *Operation `json:"post,omitempty"` Delete *Operation `json:"delete,omitempty"` Options *Operation `json:"options,omitempty"` Head *Operation `json:"head,omitempty"` Patch *Operation `json:"patch,omitempty"` Parameters []Parameter `json:"parameters,omitempty"` } // PathItem describes the operations available on a single path. // A Path Item may be empty, due to [ACL constraints](http://goo.gl/8us55a#securityFiltering). // The path itself is still exposed to the documentation viewer but they will // not know which operations and parameters are available. // // For more information: http://goo.gl/8us55a#pathItemObject type PathItem struct { Refable VendorExtensible PathItemProps } // JSONLookup look up a value by the json property name func (p PathItem) JSONLookup(token string) (interface{}, error) { if ex, ok := p.Extensions[token]; ok { return &ex, nil } if token == jsonRef { return &p.Ref, nil } r, _, err := jsonpointer.GetForToken(p.PathItemProps, token) return r, err } // UnmarshalJSON hydrates this items instance with the data from JSON func (p *PathItem) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &p.Refable); err != nil { return err } if err := json.Unmarshal(data, &p.VendorExtensible); err != nil { return err } return json.Unmarshal(data, &p.PathItemProps) } // MarshalJSON converts this items object to JSON func (p PathItem) MarshalJSON() ([]byte, error) { b3, err := json.Marshal(p.Refable) if err != nil { return nil, err } b4, err := json.Marshal(p.VendorExtensible) if err != nil { return nil, err } b5, err := json.Marshal(p.PathItemProps) if err != nil { return nil, err } concated := swag.ConcatJSON(b3, b4, b5) return concated, nil } spec-0.21.0/path_item_test.go000066400000000000000000000047151457312531500161010ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "encoding/json" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) var pathItem = PathItem{ Refable: Refable{Ref: MustCreateRef("Dog")}, VendorExtensible: VendorExtensible{ Extensions: map[string]interface{}{ "x-framework": "go-swagger", }, }, PathItemProps: PathItemProps{ Get: &Operation{ OperationProps: OperationProps{Description: "get operation description"}, }, Put: &Operation{ OperationProps: OperationProps{Description: "put operation description"}, }, Post: &Operation{ OperationProps: OperationProps{Description: "post operation description"}, }, Delete: &Operation{ OperationProps: OperationProps{Description: "delete operation description"}, }, Options: &Operation{ OperationProps: OperationProps{Description: "options operation description"}, }, Head: &Operation{ OperationProps: OperationProps{Description: "head operation description"}, }, Patch: &Operation{ OperationProps: OperationProps{Description: "patch operation description"}, }, Parameters: []Parameter{ { ParamProps: ParamProps{In: "path"}, }, }, }, } const pathItemJSON = `{ "$ref": "Dog", "x-framework": "go-swagger", "get": { "description": "get operation description" }, "put": { "description": "put operation description" }, "post": { "description": "post operation description" }, "delete": { "description": "delete operation description" }, "options": { "description": "options operation description" }, "head": { "description": "head operation description" }, "patch": { "description": "patch operation description" }, "parameters": [{"in":"path"}] }` func TestIntegrationPathItem(t *testing.T) { var actual PathItem require.NoError(t, json.Unmarshal([]byte(pathItemJSON), &actual)) assert.EqualValues(t, actual, pathItem) assertParsesJSON(t, pathItemJSON, pathItem) } spec-0.21.0/paths.go000066400000000000000000000051111457312531500141760ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "encoding/json" "fmt" "strings" "github.com/go-openapi/swag" ) // Paths holds the relative paths to the individual endpoints. // The path is appended to the [`basePath`](http://goo.gl/8us55a#swaggerBasePath) in order // to construct the full URL. // The Paths may be empty, due to [ACL constraints](http://goo.gl/8us55a#securityFiltering). // // For more information: http://goo.gl/8us55a#pathsObject type Paths struct { VendorExtensible Paths map[string]PathItem `json:"-"` // custom serializer to flatten this, each entry must start with "/" } // JSONLookup look up a value by the json property name func (p Paths) JSONLookup(token string) (interface{}, error) { if pi, ok := p.Paths[token]; ok { return &pi, nil } if ex, ok := p.Extensions[token]; ok { return &ex, nil } return nil, fmt.Errorf("object has no field %q", token) } // UnmarshalJSON hydrates this items instance with the data from JSON func (p *Paths) UnmarshalJSON(data []byte) error { var res map[string]json.RawMessage if err := json.Unmarshal(data, &res); err != nil { return err } for k, v := range res { if strings.HasPrefix(strings.ToLower(k), "x-") { if p.Extensions == nil { p.Extensions = make(map[string]interface{}) } var d interface{} if err := json.Unmarshal(v, &d); err != nil { return err } p.Extensions[k] = d } if strings.HasPrefix(k, "/") { if p.Paths == nil { p.Paths = make(map[string]PathItem) } var pi PathItem if err := json.Unmarshal(v, &pi); err != nil { return err } p.Paths[k] = pi } } return nil } // MarshalJSON converts this items object to JSON func (p Paths) MarshalJSON() ([]byte, error) { b1, err := json.Marshal(p.VendorExtensible) if err != nil { return nil, err } pths := make(map[string]PathItem) for k, v := range p.Paths { if strings.HasPrefix(k, "/") { pths[k] = v } } b2, err := json.Marshal(pths) if err != nil { return nil, err } concated := swag.ConcatJSON(b1, b2) return concated, nil } spec-0.21.0/paths_test.go000066400000000000000000000023121457312531500152350ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "encoding/json" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) var paths = Paths{ VendorExtensible: VendorExtensible{Extensions: map[string]interface{}{"x-framework": "go-swagger"}}, Paths: map[string]PathItem{ "/": { Refable: Refable{Ref: MustCreateRef("cats")}, }, }, } const pathsJSON = `{"x-framework":"go-swagger","/":{"$ref":"cats"}}` func TestIntegrationPaths(t *testing.T) { var actual Paths require.NoError(t, json.Unmarshal([]byte(pathsJSON), &actual)) assert.EqualValues(t, actual, paths) assertParsesJSON(t, pathsJSON, paths) } spec-0.21.0/properties.go000066400000000000000000000045511457312531500152620ustar00rootroot00000000000000package spec import ( "bytes" "encoding/json" "reflect" "sort" ) // OrderSchemaItem holds a named schema (e.g. from a property of an object) type OrderSchemaItem struct { Name string Schema } // OrderSchemaItems is a sortable slice of named schemas. // The ordering is defined by the x-order schema extension. type OrderSchemaItems []OrderSchemaItem // MarshalJSON produces a json object with keys defined by the name schemas // of the OrderSchemaItems slice, keeping the original order of the slice. func (items OrderSchemaItems) MarshalJSON() ([]byte, error) { buf := bytes.NewBuffer(nil) buf.WriteString("{") for i := range items { if i > 0 { buf.WriteString(",") } buf.WriteString("\"") buf.WriteString(items[i].Name) buf.WriteString("\":") bs, err := json.Marshal(&items[i].Schema) if err != nil { return nil, err } buf.Write(bs) } buf.WriteString("}") return buf.Bytes(), nil } func (items OrderSchemaItems) Len() int { return len(items) } func (items OrderSchemaItems) Swap(i, j int) { items[i], items[j] = items[j], items[i] } func (items OrderSchemaItems) Less(i, j int) (ret bool) { ii, oki := items[i].Extensions.GetInt("x-order") ij, okj := items[j].Extensions.GetInt("x-order") if oki { if okj { defer func() { if err := recover(); err != nil { defer func() { if err = recover(); err != nil { ret = items[i].Name < items[j].Name } }() ret = reflect.ValueOf(ii).String() < reflect.ValueOf(ij).String() } }() return ii < ij } return true } else if okj { return false } return items[i].Name < items[j].Name } // SchemaProperties is a map representing the properties of a Schema object. // It knows how to transform its keys into an ordered slice. type SchemaProperties map[string]Schema // ToOrderedSchemaItems transforms the map of properties into a sortable slice func (properties SchemaProperties) ToOrderedSchemaItems() OrderSchemaItems { items := make(OrderSchemaItems, 0, len(properties)) for k, v := range properties { items = append(items, OrderSchemaItem{ Name: k, Schema: v, }) } sort.Sort(items) return items } // MarshalJSON produces properties as json, keeping their order. func (properties SchemaProperties) MarshalJSON() ([]byte, error) { if properties == nil { return []byte("null"), nil } return json.Marshal(properties.ToOrderedSchemaItems()) } spec-0.21.0/properties_test.go000066400000000000000000000040671457312531500163230ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "testing" ) func TestPropertySerialization(t *testing.T) { strProp := StringProperty() strProp.Enum = append(strProp.Enum, "a", "b") prop := &Schema{SchemaProps: SchemaProps{ Items: &SchemaOrArray{Schemas: []Schema{ {SchemaProps: SchemaProps{Type: []string{"string"}}}, {SchemaProps: SchemaProps{Type: []string{"string"}}}, }}, }} var propSerData = []struct { Schema *Schema JSON string }{ {BooleanProperty(), `{"type":"boolean"}`}, {DateProperty(), `{"type":"string","format":"date"}`}, {DateTimeProperty(), `{"type":"string","format":"date-time"}`}, {Float64Property(), `{"type":"number","format":"double"}`}, {Float32Property(), `{"type":"number","format":"float"}`}, {Int32Property(), `{"type":"integer","format":"int32"}`}, {Int64Property(), `{"type":"integer","format":"int64"}`}, {MapProperty(StringProperty()), `{"type":"object","additionalProperties":{"type":"string"}}`}, {MapProperty(Int32Property()), `{"type":"object","additionalProperties":{"type":"integer","format":"int32"}}`}, {RefProperty("Dog"), `{"$ref":"Dog"}`}, {StringProperty(), `{"type":"string"}`}, {strProp, `{"type":"string","enum":["a","b"]}`}, {ArrayProperty(StringProperty()), `{"type":"array","items":{"type":"string"}}`}, {prop, `{"items":[{"type":"string"},{"type":"string"}]}`}, } for _, v := range propSerData { t.Log("roundtripping for", v.JSON) assertSerializeJSON(t, v.Schema, v.JSON) assertParsesJSON(t, v.JSON, v.Schema) } } spec-0.21.0/ref.go000066400000000000000000000102531457312531500136360ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "bytes" "encoding/gob" "encoding/json" "net/http" "os" "path/filepath" "github.com/go-openapi/jsonreference" ) // Refable is a struct for things that accept a $ref property type Refable struct { Ref Ref } // MarshalJSON marshals the ref to json func (r Refable) MarshalJSON() ([]byte, error) { return r.Ref.MarshalJSON() } // UnmarshalJSON unmarshalss the ref from json func (r *Refable) UnmarshalJSON(d []byte) error { return json.Unmarshal(d, &r.Ref) } // Ref represents a json reference that is potentially resolved type Ref struct { jsonreference.Ref } // RemoteURI gets the remote uri part of the ref func (r *Ref) RemoteURI() string { if r.String() == "" { return "" } u := *r.GetURL() u.Fragment = "" return u.String() } // IsValidURI returns true when the url the ref points to can be found func (r *Ref) IsValidURI(basepaths ...string) bool { if r.String() == "" { return true } v := r.RemoteURI() if v == "" { return true } if r.HasFullURL { //nolint:noctx,gosec rr, err := http.Get(v) if err != nil { return false } defer rr.Body.Close() return rr.StatusCode/100 == 2 } if !(r.HasFileScheme || r.HasFullFilePath || r.HasURLPathOnly) { return false } // check for local file pth := v if r.HasURLPathOnly { base := "." if len(basepaths) > 0 { base = filepath.Dir(filepath.Join(basepaths...)) } p, e := filepath.Abs(filepath.ToSlash(filepath.Join(base, pth))) if e != nil { return false } pth = p } fi, err := os.Stat(filepath.ToSlash(pth)) if err != nil { return false } return !fi.IsDir() } // 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) { ref, err := r.Ref.Inherits(child.Ref) if err != nil { return nil, err } return &Ref{Ref: *ref}, nil } // NewRef creates a new instance of a ref object // returns an error when the reference uri is an invalid uri func NewRef(refURI string) (Ref, error) { ref, err := jsonreference.New(refURI) if err != nil { return Ref{}, err } return Ref{Ref: ref}, nil } // MustCreateRef creates a ref object but panics when refURI is invalid. // Use the NewRef method for a version that returns an error. func MustCreateRef(refURI string) Ref { return Ref{Ref: jsonreference.MustCreateRef(refURI)} } // MarshalJSON marshals this ref into a JSON object func (r Ref) MarshalJSON() ([]byte, error) { str := r.String() if str == "" { if r.IsRoot() { return []byte(`{"$ref":""}`), nil } return []byte("{}"), nil } v := map[string]interface{}{"$ref": str} return json.Marshal(v) } // UnmarshalJSON unmarshals this ref from a JSON object func (r *Ref) UnmarshalJSON(d []byte) error { var v map[string]interface{} if err := json.Unmarshal(d, &v); err != nil { return err } return r.fromMap(v) } // GobEncode provides a safe gob encoder for Ref func (r Ref) GobEncode() ([]byte, error) { var b bytes.Buffer raw, err := r.MarshalJSON() if err != nil { return nil, err } err = gob.NewEncoder(&b).Encode(raw) return b.Bytes(), err } // GobDecode provides a safe gob decoder for Ref func (r *Ref) GobDecode(b []byte) error { var raw []byte buf := bytes.NewBuffer(b) err := gob.NewDecoder(buf).Decode(&raw) if err != nil { return err } return json.Unmarshal(raw, r) } func (r *Ref) fromMap(v map[string]interface{}) error { if v == nil { return nil } if vv, ok := v["$ref"]; ok { if str, ok := vv.(string); ok { ref, err := jsonreference.New(str) if err != nil { return err } *r = Ref{Ref: ref} } } return nil } spec-0.21.0/ref_test.go000066400000000000000000000022331457312531500146740ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "bytes" "encoding/gob" "encoding/json" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) // pin pointing go-swagger/go-swagger#1816 issue with cloning ref's func TestCloneRef(t *testing.T) { var b bytes.Buffer src := MustCreateRef("#/definitions/test") require.NoError(t, gob.NewEncoder(&b).Encode(&src), ) var dst Ref require.NoError(t, gob.NewDecoder(&b).Decode(&dst), ) jazon, err := json.Marshal(dst) require.NoError(t, err) assert.Equal(t, `{"$ref":"#/definitions/test"}`, string(jazon)) } spec-0.21.0/resolver.go000066400000000000000000000074021457312531500147250ustar00rootroot00000000000000package spec import ( "fmt" "github.com/go-openapi/swag" ) func resolveAnyWithBase(root interface{}, ref *Ref, result interface{}, options *ExpandOptions) error { options = optionsOrDefault(options) resolver := defaultSchemaLoader(root, options, nil, nil) if err := resolver.Resolve(ref, result, options.RelativeBase); err != nil { return err } return nil } // ResolveRefWithBase resolves a reference against a context root with preservation of base path func ResolveRefWithBase(root interface{}, ref *Ref, options *ExpandOptions) (*Schema, error) { result := new(Schema) if err := resolveAnyWithBase(root, ref, result, options); err != nil { return nil, err } return result, nil } // ResolveRef resolves a reference for a schema against a context root // ref is guaranteed to be in root (no need to go to external files) // // ResolveRef is ONLY called from the code generation module func ResolveRef(root interface{}, ref *Ref) (*Schema, error) { res, _, err := ref.GetPointer().Get(root) if err != nil { return nil, err } switch sch := res.(type) { case Schema: return &sch, nil case *Schema: return sch, nil case map[string]interface{}: newSch := new(Schema) if err = swag.DynamicJSONToStruct(sch, newSch); err != nil { return nil, err } return newSch, nil default: return nil, fmt.Errorf("type: %T: %w", sch, ErrUnknownTypeForReference) } } // ResolveParameterWithBase resolves a parameter reference against a context root and base path func ResolveParameterWithBase(root interface{}, ref Ref, options *ExpandOptions) (*Parameter, error) { result := new(Parameter) if err := resolveAnyWithBase(root, &ref, result, options); err != nil { return nil, err } return result, nil } // ResolveParameter resolves a parameter reference against a context root func ResolveParameter(root interface{}, ref Ref) (*Parameter, error) { return ResolveParameterWithBase(root, ref, nil) } // ResolveResponseWithBase resolves response a reference against a context root and base path func ResolveResponseWithBase(root interface{}, ref Ref, options *ExpandOptions) (*Response, error) { result := new(Response) err := resolveAnyWithBase(root, &ref, result, options) if err != nil { return nil, err } return result, nil } // ResolveResponse resolves response a reference against a context root func ResolveResponse(root interface{}, ref Ref) (*Response, error) { return ResolveResponseWithBase(root, ref, nil) } // ResolvePathItemWithBase resolves response a path item against a context root and base path func ResolvePathItemWithBase(root interface{}, ref Ref, options *ExpandOptions) (*PathItem, error) { result := new(PathItem) if err := resolveAnyWithBase(root, &ref, result, options); err != nil { return nil, err } return result, nil } // ResolvePathItem resolves response a path item against a context root and base path // // Deprecated: use ResolvePathItemWithBase instead func ResolvePathItem(root interface{}, ref Ref, options *ExpandOptions) (*PathItem, error) { return ResolvePathItemWithBase(root, ref, options) } // ResolveItemsWithBase resolves parameter items reference against a context root and base path. // // NOTE: stricly speaking, this construct is not supported by Swagger 2.0. // Similarly, $ref are forbidden in response headers. func ResolveItemsWithBase(root interface{}, ref Ref, options *ExpandOptions) (*Items, error) { result := new(Items) if err := resolveAnyWithBase(root, &ref, result, options); err != nil { return nil, err } return result, nil } // ResolveItems resolves parameter items reference against a context root and base path. // // Deprecated: use ResolveItemsWithBase instead func ResolveItems(root interface{}, ref Ref, options *ExpandOptions) (*Items, error) { return ResolveItemsWithBase(root, ref, options) } spec-0.21.0/resolver_test.go000066400000000000000000000313741457312531500157710ustar00rootroot00000000000000package spec import ( "encoding/json" "net/http" "net/http/httptest" "os" "path/filepath" "testing" "github.com/go-openapi/jsonpointer" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestResolveRef(t *testing.T) { var root interface{} require.NoError(t, json.Unmarshal([]byte(PetStore20), &root)) ref, err := NewRef("#/definitions/Category") require.NoError(t, err) sch, err := ResolveRef(root, &ref) require.NoError(t, err) b, err := sch.MarshalJSON() require.NoError(t, err) assert.JSONEq(t, `{"id":"Category","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}}}`, string(b)) // WithBase variant sch, err = ResolveRefWithBase(root, &ref, &ExpandOptions{ RelativeBase: "/", }) require.NoError(t, err) b, err = sch.MarshalJSON() require.NoError(t, err) assert.JSONEq(t, `{"id":"Category","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}}}`, string(b)) } func TestResolveResponse(t *testing.T) { specDoc, err := jsonDoc(filepath.Join("fixtures", "expansion", "all-the-things.json")) require.NoError(t, err) spec := new(Swagger) require.NoError(t, json.Unmarshal(specDoc, spec)) // Resolve with root version resp := spec.Paths.Paths["/"].Get.Responses.StatusCodeResponses[200] resp2, err := ResolveResponse(spec, resp.Ref) require.NoError(t, err) // resolve resolves the ref, but dos not expand jazon := asJSON(t, resp2) assert.JSONEq(t, `{ "$ref": "#/responses/petResponse" }`, jazon) } func TestResolveResponseWithBase(t *testing.T) { specDoc, err := jsonDoc(crossFileRefFixture) require.NoError(t, err) spec := new(Swagger) require.NoError(t, json.Unmarshal(specDoc, spec)) // Resolve with root version resp := spec.Paths.Paths["/"].Get.Responses.StatusCodeResponses[200] resp2, err := ResolveResponseWithBase(spec, resp.Ref, &ExpandOptions{RelativeBase: crossFileRefFixture}) require.NoError(t, err) // resolve resolves the ref, but dos not expand jazon := asJSON(t, resp2) assert.JSONEq(t, `{ "$ref": "#/responses/petResponse" }`, jazon) } func TestResolveParam(t *testing.T) { specDoc, err := jsonDoc(filepath.Join("fixtures", "expansion", "all-the-things.json")) require.NoError(t, err) var spec Swagger require.NoError(t, json.Unmarshal(specDoc, &spec)) param := spec.Paths.Paths["/pets/{id}"].Get.Parameters[0] par, err := ResolveParameter(spec, param.Ref) require.NoError(t, err) jazon := asJSON(t, par) assert.JSONEq(t, `{ "name": "id", "in": "path", "description": "ID of pet to fetch", "required": true, "type": "integer", "format": "int64" }`, jazon) } func TestResolveParamWithBase(t *testing.T) { specDoc, err := jsonDoc(crossFileRefFixture) require.NoError(t, err) var spec Swagger require.NoError(t, json.Unmarshal(specDoc, &spec)) param := spec.Paths.Paths["/pets"].Get.Parameters[0] par, err := ResolveParameterWithBase(spec, param.Ref, &ExpandOptions{RelativeBase: crossFileRefFixture}) require.NoError(t, err) jazon := asJSON(t, par) assert.JSONEq(t, `{ "description":"ID of pet to fetch", "format":"int64", "in":"path", "name":"id", "required":true, "type":"integer" }`, jazon) } func TestResolveRemoteRef_RootSame(t *testing.T) { fileserver := http.FileServer(http.Dir(specs)) server := httptest.NewServer(fileserver) defer server.Close() rootDoc := new(Swagger) b, err := os.ReadFile(filepath.Join(specs, "refed.json")) require.NoError(t, err) require.NoError(t, json.Unmarshal(b, rootDoc)) // the filename doesn't matter because ref will eventually point to refed.json specBase := normalizeBase(filepath.Join(specs, "anyotherfile.json")) var result0 Swagger ref0, _ := NewRef(server.URL + "/refed.json#") resolver0 := defaultSchemaLoader(rootDoc, nil, nil, nil) require.NoError(t, resolver0.Resolve(&ref0, &result0, "")) assertSpecs(t, result0, *rootDoc) var result1 Swagger ref1, _ := NewRef("./refed.json") resolver1 := defaultSchemaLoader(rootDoc, &ExpandOptions{ RelativeBase: specBase, }, nil, nil) require.NoError(t, resolver1.Resolve(&ref1, &result1, specBase)) assertSpecs(t, result1, *rootDoc) } func TestResolveRemoteRef_FromFragment(t *testing.T) { fileserver := http.FileServer(http.Dir(specs)) server := httptest.NewServer(fileserver) defer server.Close() rootDoc := new(Swagger) b, err := os.ReadFile(filepath.Join(specs, "refed.json")) require.NoError(t, err) require.NoError(t, json.Unmarshal(b, rootDoc)) var tgt Schema ref, err := NewRef(server.URL + "/refed.json#/definitions/pet") require.NoError(t, err) context := newResolverContext(&ExpandOptions{PathLoader: jsonDoc}) resolver := &schemaLoader{root: rootDoc, cache: defaultResolutionCache(), context: context} require.NoError(t, resolver.Resolve(&ref, &tgt, "")) assert.Equal(t, []string{"id", "name"}, tgt.Required) } func TestResolveRemoteRef_FromInvalidFragment(t *testing.T) { fileserver := http.FileServer(http.Dir(specs)) server := httptest.NewServer(fileserver) defer server.Close() rootDoc := new(Swagger) b, err := os.ReadFile(filepath.Join(specs, "refed.json")) require.NoError(t, err) require.NoError(t, json.Unmarshal(b, rootDoc)) var tgt Schema ref, err := NewRef(server.URL + "/refed.json#/definitions/NotThere") require.NoError(t, err) resolver := defaultSchemaLoader(rootDoc, nil, nil, nil) require.Error(t, resolver.Resolve(&ref, &tgt, "")) } /* This next test will have to wait until we do full $ID analysis for every subschema on every file that is referenced */ /* For now, TestResolveRemoteRef_WithNestedResolutionContext replaces this next test */ // func TestResolveRemoteRef_WithNestedResolutionContextWithFragment_WithParentID(t *testing.T) { // server := resolutionContextServer() // defer server.Close() // // rootDoc := new(Swagger) // b, err := os.ReadFile("fixtures/specs/refed.json") // require.NoError(t, err) && assert.NoError(t, json.Unmarshal(b, rootDoc)) // // var tgt Schema // ref, err := NewRef(server.URL + "/resolution2.json#/items/items") // require.NoError(t, err) // // resolver := defaultSchemaLoader(rootDoc, nil, nil,nil) // require.NoError(t, resolver.Resolve(&ref, &tgt, "")) // assert.Equal(t, StringOrArray([]string{"file"}), tgt.Type) // } func TestResolveRemoteRef_ToParameter(t *testing.T) { fileserver := http.FileServer(http.Dir(specs)) server := httptest.NewServer(fileserver) defer server.Close() rootDoc := new(Swagger) b, err := os.ReadFile(filepath.Join(specs, "refed.json")) require.NoError(t, err) require.NoError(t, json.Unmarshal(b, rootDoc)) var tgt Parameter ref, err := NewRef(server.URL + "/refed.json#/parameters/idParam") require.NoError(t, err) resolver := defaultSchemaLoader(rootDoc, nil, nil, nil) require.NoError(t, resolver.Resolve(&ref, &tgt, "")) assert.Equal(t, "id", tgt.Name) assert.Equal(t, "path", tgt.In) assert.Equal(t, "ID of pet to fetch", tgt.Description) assert.True(t, tgt.Required) assert.Equal(t, "integer", tgt.Type) assert.Equal(t, "int64", tgt.Format) } func TestResolveRemoteRef_ToPathItem(t *testing.T) { fileserver := http.FileServer(http.Dir(specs)) server := httptest.NewServer(fileserver) defer server.Close() rootDoc := new(Swagger) b, err := os.ReadFile(filepath.Join(specs, "refed.json")) require.NoError(t, err) require.NoError(t, json.Unmarshal(b, rootDoc)) var tgt PathItem ref, err := NewRef(server.URL + "/refed.json#/paths/" + jsonpointer.Escape("/pets/{id}")) require.NoError(t, err) resolver := defaultSchemaLoader(rootDoc, nil, nil, nil) require.NoError(t, resolver.Resolve(&ref, &tgt, "")) assert.Equal(t, rootDoc.Paths.Paths["/pets/{id}"].Get, tgt.Get) } func TestResolveRemoteRef_ToResponse(t *testing.T) { fileserver := http.FileServer(http.Dir(specs)) server := httptest.NewServer(fileserver) defer server.Close() rootDoc := new(Swagger) b, err := os.ReadFile(filepath.Join(specs, "refed.json")) require.NoError(t, err) require.NoError(t, json.Unmarshal(b, rootDoc)) var tgt Response ref, err := NewRef(server.URL + "/refed.json#/responses/petResponse") require.NoError(t, err) resolver := defaultSchemaLoader(rootDoc, nil, nil, nil) require.NoError(t, resolver.Resolve(&ref, &tgt, "")) assert.Equal(t, rootDoc.Responses["petResponse"], tgt) } func TestResolveLocalRef_SameRoot(t *testing.T) { rootDoc := new(Swagger) require.NoError(t, json.Unmarshal(PetStoreJSONMessage, rootDoc)) result := new(Swagger) ref, _ := NewRef("#") resolver := defaultSchemaLoader(rootDoc, nil, nil, nil) require.NoError(t, resolver.Resolve(&ref, result, "")) assert.Equal(t, rootDoc, result) } func TestResolveLocalRef_FromFragment(t *testing.T) { rootDoc := new(Swagger) require.NoError(t, json.Unmarshal(PetStoreJSONMessage, rootDoc)) var tgt Schema ref, err := NewRef("#/definitions/Category") require.NoError(t, err) resolver := defaultSchemaLoader(rootDoc, nil, nil, nil) require.NoError(t, resolver.Resolve(&ref, &tgt, "")) assert.Equal(t, "Category", tgt.ID) } func TestResolveLocalRef_FromInvalidFragment(t *testing.T) { rootDoc := new(Swagger) require.NoError(t, json.Unmarshal(PetStoreJSONMessage, rootDoc)) var tgt Schema ref, err := NewRef("#/definitions/NotThere") require.NoError(t, err) resolver := defaultSchemaLoader(rootDoc, nil, nil, nil) require.Error(t, resolver.Resolve(&ref, &tgt, "")) } func TestResolveLocalRef_Parameter(t *testing.T) { rootDoc := new(Swagger) b, err := os.ReadFile(filepath.Join(specs, "refed.json")) require.NoError(t, err) basePath := filepath.Join(specs, "refed.json") require.NoError(t, json.Unmarshal(b, rootDoc)) var tgt Parameter ref, err := NewRef("#/parameters/idParam") require.NoError(t, err) resolver := defaultSchemaLoader(rootDoc, nil, nil, nil) require.NoError(t, resolver.Resolve(&ref, &tgt, basePath)) assert.Equal(t, "id", tgt.Name) assert.Equal(t, "path", tgt.In) assert.Equal(t, "ID of pet to fetch", tgt.Description) assert.True(t, tgt.Required) assert.Equal(t, "integer", tgt.Type) assert.Equal(t, "int64", tgt.Format) } func TestResolveLocalRef_PathItem(t *testing.T) { rootDoc := new(Swagger) b, err := os.ReadFile(filepath.Join(specs, "refed.json")) require.NoError(t, err) basePath := filepath.Join(specs, "refed.json") require.NoError(t, json.Unmarshal(b, rootDoc)) var tgt PathItem ref, err := NewRef("#/paths/" + jsonpointer.Escape("/pets/{id}")) require.NoError(t, err) resolver := defaultSchemaLoader(rootDoc, nil, nil, nil) require.NoError(t, resolver.Resolve(&ref, &tgt, basePath)) assert.Equal(t, rootDoc.Paths.Paths["/pets/{id}"].Get, tgt.Get) } func TestResolveLocalRef_Response(t *testing.T) { rootDoc := new(Swagger) b, err := os.ReadFile(filepath.Join(specs, "refed.json")) require.NoError(t, err) basePath := filepath.Join(specs, "refed.json") require.NoError(t, json.Unmarshal(b, rootDoc)) var tgt Response ref, err := NewRef("#/responses/petResponse") require.NoError(t, err) resolver := defaultSchemaLoader(rootDoc, nil, nil, nil) require.NoError(t, resolver.Resolve(&ref, &tgt, basePath)) assert.Equal(t, rootDoc.Responses["petResponse"], tgt) } func TestResolvePathItem(t *testing.T) { spec := new(Swagger) specDoc, err := jsonDoc(pathItemsFixture) require.NoError(t, err) require.NoError(t, json.Unmarshal(specDoc, spec)) // Resolve use case pth := spec.Paths.Paths["/todos"] pathItem, err := ResolvePathItem(spec, pth.Ref, &ExpandOptions{RelativeBase: pathItemsFixture}) require.NoError(t, err) jazon := asJSON(t, pathItem) assert.JSONEq(t, `{ "get": { "responses": { "200": { "description": "List Todos", "schema": { "type": "array", "items": { "type": "string" } } }, "404": { "description": "error" } } } }`, jazon) } func TestResolveExtraItem(t *testing.T) { // go-openapi extra goodie: $ref in simple schema Items and Headers spec := new(Swagger) specDoc, err := jsonDoc(extraRefFixture) require.NoError(t, err) require.NoError(t, json.Unmarshal(specDoc, spec)) // Resolve param Items use case: here we explicitly resolve the unsuppord case parm := spec.Paths.Paths["/employees"].Get.Parameters[0] parmItem, err := ResolveItems(spec, parm.Items.Ref, &ExpandOptions{RelativeBase: extraRefFixture}) require.NoError(t, err) jazon := asJSON(t, parmItem) assert.JSONEq(t, `{ "type": "integer", "format": "int32" }`, jazon) // Resolve header Items use case: here we explicitly resolve the unsuppord case hdr := spec.Paths.Paths["/employees"].Get.Responses.StatusCodeResponses[200].Headers["X-header"] hdrItem, err := ResolveItems(spec, hdr.Items.Ref, &ExpandOptions{RelativeBase: extraRefFixture}) require.NoError(t, err) jazon = asJSON(t, hdrItem) assert.JSONEq(t, `{ "type": "string", "format": "uuid" }`, jazon) } spec-0.21.0/response.go000066400000000000000000000102521457312531500147170ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "encoding/json" "github.com/go-openapi/jsonpointer" "github.com/go-openapi/swag" ) // ResponseProps properties specific to a response type ResponseProps struct { Description string `json:"description"` Schema *Schema `json:"schema,omitempty"` Headers map[string]Header `json:"headers,omitempty"` Examples map[string]interface{} `json:"examples,omitempty"` } // Response describes a single response from an API Operation. // // For more information: http://goo.gl/8us55a#responseObject type Response struct { Refable ResponseProps VendorExtensible } // JSONLookup look up a value by the json property name func (r Response) JSONLookup(token string) (interface{}, error) { if ex, ok := r.Extensions[token]; ok { return &ex, nil } if token == "$ref" { return &r.Ref, nil } ptr, _, err := jsonpointer.GetForToken(r.ResponseProps, token) return ptr, err } // UnmarshalJSON hydrates this items instance with the data from JSON func (r *Response) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &r.ResponseProps); err != nil { return err } if err := json.Unmarshal(data, &r.Refable); err != nil { return err } return json.Unmarshal(data, &r.VendorExtensible) } // MarshalJSON converts this items object to JSON func (r Response) MarshalJSON() ([]byte, error) { var ( b1 []byte err error ) if r.Ref.String() == "" { // when there is no $ref, empty description is rendered as an empty string b1, err = json.Marshal(r.ResponseProps) } else { // when there is $ref inside the schema, description should be omitempty-ied b1, err = json.Marshal(struct { Description string `json:"description,omitempty"` Schema *Schema `json:"schema,omitempty"` Headers map[string]Header `json:"headers,omitempty"` Examples map[string]interface{} `json:"examples,omitempty"` }{ Description: r.ResponseProps.Description, Schema: r.ResponseProps.Schema, Examples: r.ResponseProps.Examples, }) } if err != nil { return nil, err } b2, err := json.Marshal(r.Refable) if err != nil { return nil, err } b3, err := json.Marshal(r.VendorExtensible) if err != nil { return nil, err } return swag.ConcatJSON(b1, b2, b3), nil } // NewResponse creates a new response instance func NewResponse() *Response { return new(Response) } // ResponseRef creates a response as a json reference func ResponseRef(url string) *Response { resp := NewResponse() resp.Ref = MustCreateRef(url) return resp } // WithDescription sets the description on this response, allows for chaining func (r *Response) WithDescription(description string) *Response { r.Description = description return r } // WithSchema sets the schema on this response, allows for chaining. // Passing a nil argument removes the schema from this response func (r *Response) WithSchema(schema *Schema) *Response { r.Schema = schema return r } // AddHeader adds a header to this response func (r *Response) AddHeader(name string, header *Header) *Response { if header == nil { return r.RemoveHeader(name) } if r.Headers == nil { r.Headers = make(map[string]Header) } r.Headers[name] = *header return r } // RemoveHeader removes a header from this response func (r *Response) RemoveHeader(name string) *Response { delete(r.Headers, name) return r } // AddExample adds an example to this response func (r *Response) AddExample(mediaType string, example interface{}) *Response { if r.Examples == nil { r.Examples = make(map[string]interface{}) } r.Examples[mediaType] = example return r } spec-0.21.0/response_test.go000066400000000000000000000055431457312531500157650ustar00rootroot00000000000000// Copyright 2017 go-swagger maintainers // // 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 spec import ( "encoding/json" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) var response = Response{ Refable: Refable{Ref: MustCreateRef("Dog")}, VendorExtensible: VendorExtensible{ Extensions: map[string]interface{}{ "x-go-name": "PutDogExists", }, }, ResponseProps: ResponseProps{ Description: "Dog exists", Schema: &Schema{SchemaProps: SchemaProps{Type: []string{"string"}}}, }, } const responseJSON = `{ "$ref": "Dog", "x-go-name": "PutDogExists", "description": "Dog exists", "schema": { "type": "string" } }` func TestIntegrationResponse(t *testing.T) { var actual Response require.NoError(t, json.Unmarshal([]byte(responseJSON), &actual)) assert.EqualValues(t, actual, response) assertParsesJSON(t, responseJSON, response) } func TestJSONLookupResponse(t *testing.T) { res, err := response.JSONLookup("$ref") require.NoError(t, err) require.NotNil(t, res) require.IsType(t, &Ref{}, res) var ok bool ref, ok := res.(*Ref) require.True(t, ok) assert.EqualValues(t, MustCreateRef("Dog"), *ref) var def string res, err = response.JSONLookup("description") require.NoError(t, err) require.NotNil(t, res) require.IsType(t, def, res) def, ok = res.(string) require.True(t, ok) assert.Equal(t, "Dog exists", def) var x *interface{} res, err = response.JSONLookup("x-go-name") require.NoError(t, err) require.NotNil(t, res) require.IsType(t, x, res) x, ok = res.(*interface{}) require.True(t, ok) assert.EqualValues(t, "PutDogExists", *x) res, err = response.JSONLookup("unknown") require.Error(t, err) require.Nil(t, res) } func TestResponseBuild(t *testing.T) { resp := NewResponse(). WithDescription("some response"). WithSchema(new(Schema).Typed("object", "")). AddHeader("x-header", ResponseHeader().Typed("string", "")). AddExample("application/json", `{"key":"value"}`) jazon, err := json.MarshalIndent(resp, "", " ") require.NoError(t, err) assert.JSONEq(t, `{ "description": "some response", "schema": { "type": "object" }, "headers": { "x-header": { "type": "string" } }, "examples": { "application/json": "{\"key\":\"value\"}" } }`, string(jazon)) } spec-0.21.0/responses.go000066400000000000000000000076471457312531500151200ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "encoding/json" "fmt" "reflect" "strconv" "strings" "github.com/go-openapi/swag" ) // Responses is a container for the expected responses of an operation. // The container maps a HTTP response code to the expected response. // It is not expected from the documentation to necessarily cover all possible HTTP response codes, // since they may not be known in advance. However, it is expected from the documentation to cover // a successful operation response and any known errors. // // The `default` can be used a default response object for all HTTP codes that are not covered // individually by the specification. // // The `Responses Object` MUST contain at least one response code, and it SHOULD be the response // for a successful operation call. // // For more information: http://goo.gl/8us55a#responsesObject type Responses struct { VendorExtensible ResponsesProps } // JSONLookup implements an interface to customize json pointer lookup func (r Responses) JSONLookup(token string) (interface{}, error) { if token == "default" { return r.Default, nil } if ex, ok := r.Extensions[token]; ok { return &ex, nil } if i, err := strconv.Atoi(token); err == nil { if scr, ok := r.StatusCodeResponses[i]; ok { return scr, nil } } return nil, fmt.Errorf("object has no field %q", token) } // UnmarshalJSON hydrates this items instance with the data from JSON func (r *Responses) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &r.ResponsesProps); err != nil { return err } if err := json.Unmarshal(data, &r.VendorExtensible); err != nil { return err } if reflect.DeepEqual(ResponsesProps{}, r.ResponsesProps) { r.ResponsesProps = ResponsesProps{} } return nil } // MarshalJSON converts this items object to JSON func (r Responses) MarshalJSON() ([]byte, error) { b1, err := json.Marshal(r.ResponsesProps) if err != nil { return nil, err } b2, err := json.Marshal(r.VendorExtensible) if err != nil { return nil, err } concated := swag.ConcatJSON(b1, b2) return concated, nil } // ResponsesProps describes all responses for an operation. // It tells what is the default response and maps all responses with a // HTTP status code. type ResponsesProps struct { Default *Response StatusCodeResponses map[int]Response } // MarshalJSON marshals responses as JSON func (r ResponsesProps) MarshalJSON() ([]byte, error) { toser := map[string]Response{} if r.Default != nil { toser["default"] = *r.Default } for k, v := range r.StatusCodeResponses { toser[strconv.Itoa(k)] = v } return json.Marshal(toser) } // UnmarshalJSON unmarshals responses from JSON func (r *ResponsesProps) UnmarshalJSON(data []byte) error { var res map[string]json.RawMessage if err := json.Unmarshal(data, &res); err != nil { return err } if v, ok := res["default"]; ok { var defaultRes Response if err := json.Unmarshal(v, &defaultRes); err != nil { return err } r.Default = &defaultRes delete(res, "default") } for k, v := range res { if !strings.HasPrefix(k, "x-") { var statusCodeResp Response if err := json.Unmarshal(v, &statusCodeResp); err != nil { return err } if nk, err := strconv.Atoi(k); err == nil { if r.StatusCodeResponses == nil { r.StatusCodeResponses = map[int]Response{} } r.StatusCodeResponses[nk] = statusCodeResp } } } return nil } spec-0.21.0/responses_test.go000066400000000000000000000062641457312531500161510ustar00rootroot00000000000000// Copyright 2017 go-swagger maintainers // // 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 spec import ( "encoding/json" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) var responses = Responses{ VendorExtensible: VendorExtensible{ Extensions: map[string]interface{}{ "x-go-name": "PutDogExists", }, }, ResponsesProps: ResponsesProps{ StatusCodeResponses: map[int]Response{ 200: { Refable: Refable{Ref: MustCreateRef("Dog")}, VendorExtensible: VendorExtensible{ Extensions: map[string]interface{}{ "x-go-name": "PutDogExists", }, }, ResponseProps: ResponseProps{ Description: "Dog exists", Schema: &Schema{SchemaProps: SchemaProps{Type: []string{"string"}}}, }, }, }, }, } const responsesJSON = `{ "x-go-name": "PutDogExists", "200": { "$ref": "Dog", "x-go-name": "PutDogExists", "description": "Dog exists", "schema": { "type": "string" } } }` func TestIntegrationResponses(t *testing.T) { var actual Responses require.NoError(t, json.Unmarshal([]byte(responsesJSON), &actual)) assert.EqualValues(t, actual, responses) assertParsesJSON(t, responsesJSON, responses) } func TestJSONLookupResponses(t *testing.T) { resp200, ok := responses.StatusCodeResponses[200] require.True(t, ok) res, err := resp200.JSONLookup("$ref") require.NoError(t, err) require.NotNil(t, res) require.IsType(t, &Ref{}, res) ref, ok := res.(*Ref) require.True(t, ok) assert.EqualValues(t, MustCreateRef("Dog"), *ref) var def string res, err = resp200.JSONLookup("description") require.NoError(t, err) require.NotNil(t, res) require.IsType(t, def, res) def, ok = res.(string) require.True(t, ok) assert.Equal(t, "Dog exists", def) var x *interface{} res, err = responses.JSONLookup("x-go-name") require.NoError(t, err) require.NotNil(t, res) require.IsType(t, x, res) x, ok = res.(*interface{}) require.True(t, ok) assert.EqualValues(t, "PutDogExists", *x) res, err = responses.JSONLookup("unknown") require.Error(t, err) require.Nil(t, res) } func TestResponsesBuild(t *testing.T) { resp := NewResponse(). WithDescription("some response"). WithSchema(new(Schema).Typed("object", "")). AddHeader("x-header", ResponseHeader().Typed("string", "")). AddExample("application/json", `{"key":"value"}`) jazon, _ := json.MarshalIndent(resp, "", " ") assert.JSONEq(t, `{ "description": "some response", "schema": { "type": "object" }, "headers": { "x-header": { "type": "string" } }, "examples": { "application/json": "{\"key\":\"value\"}" } }`, string(jazon)) } spec-0.21.0/schema.go000066400000000000000000000442171457312531500143310ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "encoding/json" "fmt" "strings" "github.com/go-openapi/jsonpointer" "github.com/go-openapi/swag" ) // BooleanProperty creates a boolean property func BooleanProperty() *Schema { return &Schema{SchemaProps: SchemaProps{Type: []string{"boolean"}}} } // BoolProperty creates a boolean property func BoolProperty() *Schema { return BooleanProperty() } // StringProperty creates a string property func StringProperty() *Schema { return &Schema{SchemaProps: SchemaProps{Type: []string{"string"}}} } // CharProperty creates a string property func CharProperty() *Schema { return &Schema{SchemaProps: SchemaProps{Type: []string{"string"}}} } // Float64Property creates a float64/double property func Float64Property() *Schema { return &Schema{SchemaProps: SchemaProps{Type: []string{"number"}, Format: "double"}} } // Float32Property creates a float32/float property func Float32Property() *Schema { return &Schema{SchemaProps: SchemaProps{Type: []string{"number"}, Format: "float"}} } // Int8Property creates an int8 property func Int8Property() *Schema { return &Schema{SchemaProps: SchemaProps{Type: []string{"integer"}, Format: "int8"}} } // Int16Property creates an int16 property func Int16Property() *Schema { return &Schema{SchemaProps: SchemaProps{Type: []string{"integer"}, Format: "int16"}} } // Int32Property creates an int32 property func Int32Property() *Schema { return &Schema{SchemaProps: SchemaProps{Type: []string{"integer"}, Format: "int32"}} } // Int64Property creates an int64 property func Int64Property() *Schema { return &Schema{SchemaProps: SchemaProps{Type: []string{"integer"}, Format: "int64"}} } // StrFmtProperty creates a property for the named string format func StrFmtProperty(format string) *Schema { return &Schema{SchemaProps: SchemaProps{Type: []string{"string"}, Format: format}} } // DateProperty creates a date property func DateProperty() *Schema { return &Schema{SchemaProps: SchemaProps{Type: []string{"string"}, Format: "date"}} } // DateTimeProperty creates a date time property func DateTimeProperty() *Schema { return &Schema{SchemaProps: SchemaProps{Type: []string{"string"}, Format: "date-time"}} } // MapProperty creates a map property func MapProperty(property *Schema) *Schema { return &Schema{SchemaProps: SchemaProps{Type: []string{"object"}, AdditionalProperties: &SchemaOrBool{Allows: true, Schema: property}}} } // RefProperty creates a ref property func RefProperty(name string) *Schema { return &Schema{SchemaProps: SchemaProps{Ref: MustCreateRef(name)}} } // RefSchema creates a ref property func RefSchema(name string) *Schema { return &Schema{SchemaProps: SchemaProps{Ref: MustCreateRef(name)}} } // ArrayProperty creates an array property func ArrayProperty(items *Schema) *Schema { if items == nil { return &Schema{SchemaProps: SchemaProps{Type: []string{"array"}}} } return &Schema{SchemaProps: SchemaProps{Items: &SchemaOrArray{Schema: items}, Type: []string{"array"}}} } // ComposedSchema creates a schema with allOf func ComposedSchema(schemas ...Schema) *Schema { s := new(Schema) s.AllOf = schemas return s } // SchemaURL represents a schema url type SchemaURL string // MarshalJSON marshal this to JSON func (r SchemaURL) MarshalJSON() ([]byte, error) { if r == "" { return []byte("{}"), nil } v := map[string]interface{}{"$schema": string(r)} return json.Marshal(v) } // UnmarshalJSON unmarshal this from JSON func (r *SchemaURL) UnmarshalJSON(data []byte) error { var v map[string]interface{} if err := json.Unmarshal(data, &v); err != nil { return err } return r.fromMap(v) } func (r *SchemaURL) fromMap(v map[string]interface{}) error { if v == nil { return nil } if vv, ok := v["$schema"]; ok { if str, ok := vv.(string); ok { u, err := parseURL(str) if err != nil { return err } *r = SchemaURL(u.String()) } } return nil } // SchemaProps describes a JSON schema (draft 4) type SchemaProps struct { ID string `json:"id,omitempty"` Ref Ref `json:"-"` Schema SchemaURL `json:"-"` Description string `json:"description,omitempty"` Type StringOrArray `json:"type,omitempty"` Nullable bool `json:"nullable,omitempty"` Format string `json:"format,omitempty"` Title string `json:"title,omitempty"` Default interface{} `json:"default,omitempty"` Maximum *float64 `json:"maximum,omitempty"` ExclusiveMaximum bool `json:"exclusiveMaximum,omitempty"` Minimum *float64 `json:"minimum,omitempty"` ExclusiveMinimum bool `json:"exclusiveMinimum,omitempty"` MaxLength *int64 `json:"maxLength,omitempty"` MinLength *int64 `json:"minLength,omitempty"` Pattern string `json:"pattern,omitempty"` MaxItems *int64 `json:"maxItems,omitempty"` MinItems *int64 `json:"minItems,omitempty"` UniqueItems bool `json:"uniqueItems,omitempty"` MultipleOf *float64 `json:"multipleOf,omitempty"` Enum []interface{} `json:"enum,omitempty"` MaxProperties *int64 `json:"maxProperties,omitempty"` MinProperties *int64 `json:"minProperties,omitempty"` Required []string `json:"required,omitempty"` Items *SchemaOrArray `json:"items,omitempty"` AllOf []Schema `json:"allOf,omitempty"` OneOf []Schema `json:"oneOf,omitempty"` AnyOf []Schema `json:"anyOf,omitempty"` Not *Schema `json:"not,omitempty"` Properties SchemaProperties `json:"properties,omitempty"` AdditionalProperties *SchemaOrBool `json:"additionalProperties,omitempty"` PatternProperties SchemaProperties `json:"patternProperties,omitempty"` Dependencies Dependencies `json:"dependencies,omitempty"` AdditionalItems *SchemaOrBool `json:"additionalItems,omitempty"` Definitions Definitions `json:"definitions,omitempty"` } // SwaggerSchemaProps are additional properties supported by swagger schemas, but not JSON-schema (draft 4) type SwaggerSchemaProps struct { Discriminator string `json:"discriminator,omitempty"` ReadOnly bool `json:"readOnly,omitempty"` XML *XMLObject `json:"xml,omitempty"` ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"` Example interface{} `json:"example,omitempty"` } // Schema the schema object allows the definition of input and output data types. // These types can be objects, but also primitives and arrays. // This object is based on the [JSON Schema Specification Draft 4](http://json-schema.org/) // and uses a predefined subset of it. // On top of this subset, there are extensions provided by this specification to allow for more complete documentation. // // For more information: http://goo.gl/8us55a#schemaObject type Schema struct { VendorExtensible SchemaProps SwaggerSchemaProps ExtraProps map[string]interface{} `json:"-"` } // JSONLookup implements an interface to customize json pointer lookup func (s Schema) JSONLookup(token string) (interface{}, error) { if ex, ok := s.Extensions[token]; ok { return &ex, nil } if ex, ok := s.ExtraProps[token]; ok { return &ex, nil } r, _, err := jsonpointer.GetForToken(s.SchemaProps, token) if r != nil || (err != nil && !strings.HasPrefix(err.Error(), "object has no field")) { return r, err } r, _, err = jsonpointer.GetForToken(s.SwaggerSchemaProps, token) return r, err } // WithID sets the id for this schema, allows for chaining func (s *Schema) WithID(id string) *Schema { s.ID = id return s } // WithTitle sets the title for this schema, allows for chaining func (s *Schema) WithTitle(title string) *Schema { s.Title = title return s } // WithDescription sets the description for this schema, allows for chaining func (s *Schema) WithDescription(description string) *Schema { s.Description = description return s } // WithProperties sets the properties for this schema func (s *Schema) WithProperties(schemas map[string]Schema) *Schema { s.Properties = schemas return s } // SetProperty sets a property on this schema func (s *Schema) SetProperty(name string, schema Schema) *Schema { if s.Properties == nil { s.Properties = make(map[string]Schema) } s.Properties[name] = schema return s } // WithAllOf sets the all of property func (s *Schema) WithAllOf(schemas ...Schema) *Schema { s.AllOf = schemas return s } // WithMaxProperties sets the max number of properties an object can have func (s *Schema) WithMaxProperties(max int64) *Schema { s.MaxProperties = &max return s } // WithMinProperties sets the min number of properties an object must have func (s *Schema) WithMinProperties(min int64) *Schema { s.MinProperties = &min return s } // Typed sets the type of this schema for a single value item func (s *Schema) Typed(tpe, format string) *Schema { s.Type = []string{tpe} s.Format = format return s } // AddType adds a type with potential format to the types for this schema func (s *Schema) AddType(tpe, format string) *Schema { s.Type = append(s.Type, tpe) if format != "" { s.Format = format } return s } // AsNullable flags this schema as nullable. func (s *Schema) AsNullable() *Schema { s.Nullable = true return s } // CollectionOf a fluent builder method for an array parameter func (s *Schema) CollectionOf(items Schema) *Schema { s.Type = []string{jsonArray} s.Items = &SchemaOrArray{Schema: &items} return s } // WithDefault sets the default value on this parameter func (s *Schema) WithDefault(defaultValue interface{}) *Schema { s.Default = defaultValue return s } // WithRequired flags this parameter as required func (s *Schema) WithRequired(items ...string) *Schema { s.Required = items return s } // AddRequired adds field names to the required properties array func (s *Schema) AddRequired(items ...string) *Schema { s.Required = append(s.Required, items...) return s } // WithMaxLength sets a max length value func (s *Schema) WithMaxLength(max int64) *Schema { s.MaxLength = &max return s } // WithMinLength sets a min length value func (s *Schema) WithMinLength(min int64) *Schema { s.MinLength = &min return s } // WithPattern sets a pattern value func (s *Schema) WithPattern(pattern string) *Schema { s.Pattern = pattern return s } // WithMultipleOf sets a multiple of value func (s *Schema) WithMultipleOf(number float64) *Schema { s.MultipleOf = &number return s } // WithMaximum sets a maximum number value func (s *Schema) WithMaximum(max float64, exclusive bool) *Schema { s.Maximum = &max s.ExclusiveMaximum = exclusive return s } // WithMinimum sets a minimum number value func (s *Schema) WithMinimum(min float64, exclusive bool) *Schema { s.Minimum = &min s.ExclusiveMinimum = exclusive return s } // WithEnum sets a the enum values (replace) func (s *Schema) WithEnum(values ...interface{}) *Schema { s.Enum = append([]interface{}{}, values...) return s } // WithMaxItems sets the max items func (s *Schema) WithMaxItems(size int64) *Schema { s.MaxItems = &size return s } // WithMinItems sets the min items func (s *Schema) WithMinItems(size int64) *Schema { s.MinItems = &size return s } // UniqueValues dictates that this array can only have unique items func (s *Schema) UniqueValues() *Schema { s.UniqueItems = true return s } // AllowDuplicates this array can have duplicates func (s *Schema) AllowDuplicates() *Schema { s.UniqueItems = false return s } // AddToAllOf adds a schema to the allOf property func (s *Schema) AddToAllOf(schemas ...Schema) *Schema { s.AllOf = append(s.AllOf, schemas...) return s } // WithDiscriminator sets the name of the discriminator field func (s *Schema) WithDiscriminator(discriminator string) *Schema { s.Discriminator = discriminator return s } // AsReadOnly flags this schema as readonly func (s *Schema) AsReadOnly() *Schema { s.ReadOnly = true return s } // AsWritable flags this schema as writeable (not read-only) func (s *Schema) AsWritable() *Schema { s.ReadOnly = false return s } // WithExample sets the example for this schema func (s *Schema) WithExample(example interface{}) *Schema { s.Example = example return s } // WithExternalDocs sets/removes the external docs for/from this schema. // When you pass empty strings as params the external documents will be removed. // When you pass non-empty string as one value then those values will be used on the external docs object. // So when you pass a non-empty description, you should also pass the url and vice versa. func (s *Schema) WithExternalDocs(description, url string) *Schema { if description == "" && url == "" { s.ExternalDocs = nil return s } if s.ExternalDocs == nil { s.ExternalDocs = &ExternalDocumentation{} } s.ExternalDocs.Description = description s.ExternalDocs.URL = url return s } // WithXMLName sets the xml name for the object func (s *Schema) WithXMLName(name string) *Schema { if s.XML == nil { s.XML = new(XMLObject) } s.XML.Name = name return s } // WithXMLNamespace sets the xml namespace for the object func (s *Schema) WithXMLNamespace(namespace string) *Schema { if s.XML == nil { s.XML = new(XMLObject) } s.XML.Namespace = namespace return s } // WithXMLPrefix sets the xml prefix for the object func (s *Schema) WithXMLPrefix(prefix string) *Schema { if s.XML == nil { s.XML = new(XMLObject) } s.XML.Prefix = prefix return s } // AsXMLAttribute flags this object as xml attribute func (s *Schema) AsXMLAttribute() *Schema { if s.XML == nil { s.XML = new(XMLObject) } s.XML.Attribute = true return s } // AsXMLElement flags this object as an xml node func (s *Schema) AsXMLElement() *Schema { if s.XML == nil { s.XML = new(XMLObject) } s.XML.Attribute = false return s } // AsWrappedXML flags this object as wrapped, this is mostly useful for array types func (s *Schema) AsWrappedXML() *Schema { if s.XML == nil { s.XML = new(XMLObject) } s.XML.Wrapped = true return s } // AsUnwrappedXML flags this object as an xml node func (s *Schema) AsUnwrappedXML() *Schema { if s.XML == nil { s.XML = new(XMLObject) } s.XML.Wrapped = false return s } // SetValidations defines all schema validations. // // NOTE: Required, ReadOnly, AllOf, AnyOf, OneOf and Not are not considered. func (s *Schema) SetValidations(val SchemaValidations) { s.Maximum = val.Maximum s.ExclusiveMaximum = val.ExclusiveMaximum s.Minimum = val.Minimum s.ExclusiveMinimum = val.ExclusiveMinimum s.MaxLength = val.MaxLength s.MinLength = val.MinLength s.Pattern = val.Pattern s.MaxItems = val.MaxItems s.MinItems = val.MinItems s.UniqueItems = val.UniqueItems s.MultipleOf = val.MultipleOf s.Enum = val.Enum s.MinProperties = val.MinProperties s.MaxProperties = val.MaxProperties s.PatternProperties = val.PatternProperties } // WithValidations is a fluent method to set schema validations func (s *Schema) WithValidations(val SchemaValidations) *Schema { s.SetValidations(val) return s } // Validations returns a clone of the validations for this schema func (s Schema) Validations() SchemaValidations { return SchemaValidations{ CommonValidations: CommonValidations{ Maximum: s.Maximum, ExclusiveMaximum: s.ExclusiveMaximum, Minimum: s.Minimum, ExclusiveMinimum: s.ExclusiveMinimum, MaxLength: s.MaxLength, MinLength: s.MinLength, Pattern: s.Pattern, MaxItems: s.MaxItems, MinItems: s.MinItems, UniqueItems: s.UniqueItems, MultipleOf: s.MultipleOf, Enum: s.Enum, }, MinProperties: s.MinProperties, MaxProperties: s.MaxProperties, PatternProperties: s.PatternProperties, } } // MarshalJSON marshal this to JSON func (s Schema) MarshalJSON() ([]byte, error) { b1, err := json.Marshal(s.SchemaProps) if err != nil { return nil, fmt.Errorf("schema props %v", err) } b2, err := json.Marshal(s.VendorExtensible) if err != nil { return nil, fmt.Errorf("vendor props %v", err) } b3, err := s.Ref.MarshalJSON() if err != nil { return nil, fmt.Errorf("ref prop %v", err) } b4, err := s.Schema.MarshalJSON() if err != nil { return nil, fmt.Errorf("schema prop %v", err) } b5, err := json.Marshal(s.SwaggerSchemaProps) if err != nil { return nil, fmt.Errorf("common validations %v", err) } var b6 []byte if s.ExtraProps != nil { jj, err := json.Marshal(s.ExtraProps) if err != nil { return nil, fmt.Errorf("extra props %v", err) } b6 = jj } return swag.ConcatJSON(b1, b2, b3, b4, b5, b6), nil } // UnmarshalJSON marshal this from JSON func (s *Schema) UnmarshalJSON(data []byte) error { props := struct { SchemaProps SwaggerSchemaProps }{} if err := json.Unmarshal(data, &props); err != nil { return err } sch := Schema{ SchemaProps: props.SchemaProps, SwaggerSchemaProps: props.SwaggerSchemaProps, } var d map[string]interface{} if err := json.Unmarshal(data, &d); err != nil { return err } _ = sch.Ref.fromMap(d) _ = sch.Schema.fromMap(d) delete(d, "$ref") delete(d, "$schema") for _, pn := range swag.DefaultJSONNameProvider.GetJSONNames(s) { delete(d, pn) } for k, vv := range d { lk := strings.ToLower(k) if strings.HasPrefix(lk, "x-") { if sch.Extensions == nil { sch.Extensions = map[string]interface{}{} } sch.Extensions[k] = vv continue } if sch.ExtraProps == nil { sch.ExtraProps = map[string]interface{}{} } sch.ExtraProps[k] = vv } *s = sch return nil } spec-0.21.0/schema_loader.go000066400000000000000000000215541457312531500156560ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "encoding/json" "fmt" "log" "net/url" "reflect" "strings" "github.com/go-openapi/swag" ) // PathLoader is a function to use when loading remote refs. // // This is a package level default. It may be overridden or bypassed by // specifying the loader in ExpandOptions. // // NOTE: if you are using the go-openapi/loads package, it will override // this value with its own default (a loader to retrieve YAML documents as // well as JSON ones). var PathLoader = func(pth string) (json.RawMessage, error) { data, err := swag.LoadFromFileOrHTTP(pth) if err != nil { return nil, err } return json.RawMessage(data), nil } // resolverContext allows to share a context during spec processing. // At the moment, it just holds the index of circular references found. type resolverContext struct { // circulars holds all visited circular references, to shortcircuit $ref resolution. // // This structure is privately instantiated and needs not be locked against // concurrent access, unless we chose to implement a parallel spec walking. circulars map[string]bool basePath string loadDoc func(string) (json.RawMessage, error) rootID string } func newResolverContext(options *ExpandOptions) *resolverContext { expandOptions := optionsOrDefault(options) // path loader may be overridden by options var loader func(string) (json.RawMessage, error) if expandOptions.PathLoader == nil { loader = PathLoader } else { loader = expandOptions.PathLoader } return &resolverContext{ circulars: make(map[string]bool), basePath: expandOptions.RelativeBase, // keep the root base path in context loadDoc: loader, } } type schemaLoader struct { root interface{} options *ExpandOptions cache ResolutionCache context *resolverContext } func (r *schemaLoader) transitiveResolver(basePath string, ref Ref) *schemaLoader { if ref.IsRoot() || ref.HasFragmentOnly { return r } baseRef := MustCreateRef(basePath) currentRef := normalizeRef(&ref, basePath) if strings.HasPrefix(currentRef.String(), baseRef.String()) { return r } // set a new root against which to resolve rootURL := currentRef.GetURL() rootURL.Fragment = "" root, _ := r.cache.Get(rootURL.String()) // shallow copy of resolver options to set a new RelativeBase when // traversing multiple documents newOptions := r.options newOptions.RelativeBase = rootURL.String() return defaultSchemaLoader(root, newOptions, r.cache, r.context) } func (r *schemaLoader) updateBasePath(transitive *schemaLoader, basePath string) string { if transitive != r { if transitive.options != nil && transitive.options.RelativeBase != "" { return normalizeBase(transitive.options.RelativeBase) } } return basePath } func (r *schemaLoader) resolveRef(ref *Ref, target interface{}, basePath string) error { tgt := reflect.ValueOf(target) if tgt.Kind() != reflect.Ptr { return ErrResolveRefNeedsAPointer } if ref.GetURL() == nil { return nil } var ( res interface{} data interface{} err error ) // Resolve against the root if it isn't nil, and if ref is pointing at the root, or has a fragment only which means // it is pointing somewhere in the root. root := r.root if (ref.IsRoot() || ref.HasFragmentOnly) && root == nil && basePath != "" { if baseRef, erb := NewRef(basePath); erb == nil { root, _, _, _ = r.load(baseRef.GetURL()) } } if (ref.IsRoot() || ref.HasFragmentOnly) && root != nil { data = root } else { baseRef := normalizeRef(ref, basePath) data, _, _, err = r.load(baseRef.GetURL()) if err != nil { return err } } res = data if ref.String() != "" { res, _, err = ref.GetPointer().Get(data) if err != nil { return err } } return swag.DynamicJSONToStruct(res, target) } func (r *schemaLoader) load(refURL *url.URL) (interface{}, url.URL, bool, error) { debugLog("loading schema from url: %s", refURL) toFetch := *refURL toFetch.Fragment = "" var err error pth := toFetch.String() normalized := normalizeBase(pth) debugLog("loading doc from: %s", normalized) data, fromCache := r.cache.Get(normalized) if fromCache { return data, toFetch, fromCache, nil } b, err := r.context.loadDoc(normalized) if err != nil { return nil, url.URL{}, false, err } var doc interface{} if err := json.Unmarshal(b, &doc); err != nil { return nil, url.URL{}, false, err } r.cache.Set(normalized, doc) return doc, toFetch, fromCache, nil } // isCircular detects cycles in sequences of $ref. // // It relies on a private context (which needs not be locked). func (r *schemaLoader) isCircular(ref *Ref, basePath string, parentRefs ...string) (foundCycle bool) { normalizedRef := normalizeURI(ref.String(), basePath) if _, ok := r.context.circulars[normalizedRef]; ok { // circular $ref has been already detected in another explored cycle foundCycle = true return } foundCycle = swag.ContainsStrings(parentRefs, normalizedRef) // normalized windows url's are lower cased if foundCycle { r.context.circulars[normalizedRef] = true } return } // Resolve resolves a reference against basePath and stores the result in target. // // Resolve is not in charge of following references: it only resolves ref by following its URL. // // If the schema the ref is referring to holds nested refs, Resolve doesn't resolve them. // // If basePath is an empty string, ref is resolved against the root schema stored in the schemaLoader struct func (r *schemaLoader) Resolve(ref *Ref, target interface{}, basePath string) error { return r.resolveRef(ref, target, basePath) } func (r *schemaLoader) deref(input interface{}, parentRefs []string, basePath string) error { var ref *Ref switch refable := input.(type) { case *Schema: ref = &refable.Ref case *Parameter: ref = &refable.Ref case *Response: ref = &refable.Ref case *PathItem: ref = &refable.Ref default: return fmt.Errorf("unsupported type: %T: %w", input, ErrDerefUnsupportedType) } curRef := ref.String() if curRef == "" { return nil } normalizedRef := normalizeRef(ref, basePath) normalizedBasePath := normalizedRef.RemoteURI() if r.isCircular(normalizedRef, basePath, parentRefs...) { return nil } if err := r.resolveRef(ref, input, basePath); r.shouldStopOnError(err) { return err } if ref.String() == "" || ref.String() == curRef { // done with rereferencing return nil } parentRefs = append(parentRefs, normalizedRef.String()) return r.deref(input, parentRefs, normalizedBasePath) } func (r *schemaLoader) shouldStopOnError(err error) bool { if err != nil && !r.options.ContinueOnError { return true } if err != nil { log.Println(err) } return false } func (r *schemaLoader) setSchemaID(target interface{}, id, basePath string) (string, string) { debugLog("schema has ID: %s", id) // handling the case when id is a folder // remember that basePath has to point to a file var refPath string if strings.HasSuffix(id, "/") { // ensure this is detected as a file, not a folder refPath = fmt.Sprintf("%s%s", id, "placeholder.json") } else { refPath = id } // updates the current base path // * important: ID can be a relative path // * registers target to be fetchable from the new base proposed by this id newBasePath := normalizeURI(refPath, basePath) // store found IDs for possible future reuse in $ref r.cache.Set(newBasePath, target) // the root document has an ID: all $ref relative to that ID may // be rebased relative to the root document if basePath == r.context.basePath { debugLog("root document is a schema with ID: %s (normalized as:%s)", id, newBasePath) r.context.rootID = newBasePath } return newBasePath, refPath } func defaultSchemaLoader( root interface{}, expandOptions *ExpandOptions, cache ResolutionCache, context *resolverContext) *schemaLoader { if expandOptions == nil { expandOptions = &ExpandOptions{} } cache = cacheOrDefault(cache) if expandOptions.RelativeBase == "" { // if no relative base is provided, assume the root document // contains all $ref, or at least, that the relative documents // may be resolved from the current working directory. expandOptions.RelativeBase = baseForRoot(root, cache) } debugLog("effective expander options: %#v", expandOptions) if context == nil { context = newResolverContext(expandOptions) } return &schemaLoader{ root: root, options: expandOptions, cache: cache, context: context, } } spec-0.21.0/schema_loader_test.go000066400000000000000000000015511457312531500167100ustar00rootroot00000000000000package spec import ( "encoding/json" "path/filepath" "testing" "github.com/stretchr/testify/require" ) func TestLoader_Issue145(t *testing.T) { t.Run("with ExpandSpec", func(t *testing.T) { basePath := filepath.Join("fixtures", "bugs", "145", "Program Files (x86)", "AppName", "todos.json") todosDoc, err := jsonDoc(basePath) require.NoError(t, err) spec := new(Swagger) require.NoError(t, json.Unmarshal(todosDoc, spec)) require.NoError(t, ExpandSpec(spec, &ExpandOptions{RelativeBase: basePath})) }) t.Run("with ExpandSchema", func(t *testing.T) { basePath := filepath.Join("fixtures", "bugs", "145", "Program Files (x86)", "AppName", "ref.json") schemaDoc, err := jsonDoc(basePath) require.NoError(t, err) sch := new(Schema) require.NoError(t, json.Unmarshal(schemaDoc, sch)) require.NoError(t, ExpandSchema(sch, nil, nil)) }) } spec-0.21.0/schema_test.go000066400000000000000000000152231457312531500153630ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "encoding/json" "testing" "github.com/go-openapi/swag" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) var schema = Schema{ VendorExtensible: VendorExtensible{Extensions: map[string]interface{}{"x-framework": "go-swagger"}}, SchemaProps: SchemaProps{ Ref: MustCreateRef("Cat"), Type: []string{"string"}, Format: "date", Description: "the description of this schema", Title: "the title", Default: "blah", Maximum: float64Ptr(100), ExclusiveMaximum: true, ExclusiveMinimum: true, Minimum: float64Ptr(5), MaxLength: int64Ptr(100), MinLength: int64Ptr(5), Pattern: "\\w{1,5}\\w+", MaxItems: int64Ptr(100), MinItems: int64Ptr(5), UniqueItems: true, MultipleOf: float64Ptr(5), Enum: []interface{}{"hello", "world"}, MaxProperties: int64Ptr(5), MinProperties: int64Ptr(1), Required: []string{"id", "name"}, Items: &SchemaOrArray{Schema: &Schema{SchemaProps: SchemaProps{Type: []string{"string"}}}}, AllOf: []Schema{{SchemaProps: SchemaProps{Type: []string{"string"}}}}, Properties: map[string]Schema{ "id": {SchemaProps: SchemaProps{Type: []string{"integer"}, Format: "int64"}}, "name": {SchemaProps: SchemaProps{Type: []string{"string"}}}, }, AdditionalProperties: &SchemaOrBool{Allows: true, Schema: &Schema{SchemaProps: SchemaProps{ Type: []string{"integer"}, Format: "int32", }}}, }, SwaggerSchemaProps: SwaggerSchemaProps{ Discriminator: "not this", ReadOnly: true, XML: &XMLObject{Name: "sch", Namespace: "io", Prefix: "sw", Attribute: true, Wrapped: true}, ExternalDocs: &ExternalDocumentation{ Description: "the documentation etc", URL: "http://readthedocs.org/swagger", }, Example: []interface{}{ map[string]interface{}{ "id": 1, "name": "a book", }, map[string]interface{}{ "id": 2, "name": "the thing", }, }, }, } var schemaJSON = `{ "x-framework": "go-swagger", "$ref": "Cat", "description": "the description of this schema", "maximum": 100, "minimum": 5, "exclusiveMaximum": true, "exclusiveMinimum": true, "maxLength": 100, "minLength": 5, "pattern": "\\w{1,5}\\w+", "maxItems": 100, "minItems": 5, "uniqueItems": true, "multipleOf": 5, "enum": ["hello", "world"], "type": "string", "format": "date", "title": "the title", "default": "blah", "maxProperties": 5, "minProperties": 1, "required": ["id", "name"], "items": { "type": "string" }, "allOf": [ { "type": "string" } ], "properties": { "id": { "type": "integer", "format": "int64" }, "name": { "type": "string" } }, "discriminator": "not this", "readOnly": true, "xml": { "name": "sch", "namespace": "io", "prefix": "sw", "wrapped": true, "attribute": true }, "externalDocs": { "description": "the documentation etc", "url": "http://readthedocs.org/swagger" }, "example": [ { "id": 1, "name": "a book" }, { "id": 2, "name": "the thing" } ], "additionalProperties": { "type": "integer", "format": "int32" } } ` func TestSchema(t *testing.T) { expected := map[string]interface{}{} _ = json.Unmarshal([]byte(schemaJSON), &expected) b, err := json.Marshal(schema) require.NoError(t, err) var actual map[string]interface{} require.NoError(t, json.Unmarshal(b, &actual)) assert.Equal(t, expected, actual) actual2 := Schema{} require.NoError(t, json.Unmarshal([]byte(schemaJSON), &actual2)) assert.Equal(t, schema.Ref, actual2.Ref) assert.Equal(t, schema.Description, actual2.Description) assert.Equal(t, schema.Maximum, actual2.Maximum) assert.Equal(t, schema.Minimum, actual2.Minimum) assert.Equal(t, schema.ExclusiveMinimum, actual2.ExclusiveMinimum) assert.Equal(t, schema.ExclusiveMaximum, actual2.ExclusiveMaximum) assert.Equal(t, schema.MaxLength, actual2.MaxLength) assert.Equal(t, schema.MinLength, actual2.MinLength) assert.Equal(t, schema.Pattern, actual2.Pattern) assert.Equal(t, schema.MaxItems, actual2.MaxItems) assert.Equal(t, schema.MinItems, actual2.MinItems) assert.True(t, actual2.UniqueItems) assert.Equal(t, schema.MultipleOf, actual2.MultipleOf) assert.Equal(t, schema.Enum, actual2.Enum) assert.Equal(t, schema.Type, actual2.Type) assert.Equal(t, schema.Format, actual2.Format) assert.Equal(t, schema.Title, actual2.Title) assert.Equal(t, schema.MaxProperties, actual2.MaxProperties) assert.Equal(t, schema.MinProperties, actual2.MinProperties) assert.Equal(t, schema.Required, actual2.Required) assert.Equal(t, schema.Items, actual2.Items) assert.Equal(t, schema.AllOf, actual2.AllOf) assert.Equal(t, schema.Properties, actual2.Properties) assert.Equal(t, schema.Discriminator, actual2.Discriminator) assert.Equal(t, schema.ReadOnly, actual2.ReadOnly) assert.Equal(t, schema.XML, actual2.XML) assert.Equal(t, schema.ExternalDocs, actual2.ExternalDocs) assert.Equal(t, schema.AdditionalProperties, actual2.AdditionalProperties) assert.Equal(t, schema.Extensions, actual2.Extensions) examples := actual2.Example.([]interface{}) expEx := schema.Example.([]interface{}) ex1 := examples[0].(map[string]interface{}) ex2 := examples[1].(map[string]interface{}) exp1 := expEx[0].(map[string]interface{}) exp2 := expEx[1].(map[string]interface{}) assert.EqualValues(t, exp1["id"], ex1["id"]) assert.Equal(t, exp1["name"], ex1["name"]) assert.EqualValues(t, exp2["id"], ex2["id"]) assert.Equal(t, exp2["name"], ex2["name"]) } func BenchmarkSchemaUnmarshal(b *testing.B) { for i := 0; i < b.N; i++ { sch := &Schema{} _ = sch.UnmarshalJSON([]byte(schemaJSON)) } } func TestSchemaWithValidation(t *testing.T) { s := new(Schema).WithValidations(SchemaValidations{CommonValidations: CommonValidations{MaxLength: swag.Int64(15)}}) assert.EqualValues(t, swag.Int64(15), s.MaxLength) val := mkVal() s = new(Schema).WithValidations(val) assert.EqualValues(t, val, s.Validations()) } spec-0.21.0/schemas/000077500000000000000000000000001457312531500141555ustar00rootroot00000000000000spec-0.21.0/schemas/jsonschema-draft-04.json000066400000000000000000000104051457312531500205210ustar00rootroot00000000000000{ "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" }, "$schema": { "type": "string" }, "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 } ] }, "format": { "type": "string" }, "allOf": { "$ref": "#/definitions/schemaArray" }, "anyOf": { "$ref": "#/definitions/schemaArray" }, "oneOf": { "$ref": "#/definitions/schemaArray" }, "not": { "$ref": "#" } }, "dependencies": { "exclusiveMaximum": [ "maximum" ], "exclusiveMinimum": [ "minimum" ] }, "default": {} } spec-0.21.0/schemas/v2/000077500000000000000000000000001457312531500145045ustar00rootroot00000000000000spec-0.21.0/schemas/v2/README.md000066400000000000000000000002651457312531500157660ustar00rootroot00000000000000# Swagger 2.0 specification schema This folder contains the Swagger 2.0 specification schema files maintained here: https://github.com/reverb/swagger-spec/blob/master/schemas/v2.0spec-0.21.0/schemas/v2/schema.json000066400000000000000000001164701457312531500166500ustar00rootroot00000000000000{ "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": { "anyOf": [ { "$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" } } } } } spec-0.21.0/security_scheme.go000066400000000000000000000133321457312531500162560ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "encoding/json" "github.com/go-openapi/jsonpointer" "github.com/go-openapi/swag" ) const ( basic = "basic" apiKey = "apiKey" oauth2 = "oauth2" implicit = "implicit" password = "password" application = "application" accessCode = "accessCode" ) // BasicAuth creates a basic auth security scheme func BasicAuth() *SecurityScheme { return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{Type: basic}} } // APIKeyAuth creates an api key auth security scheme func APIKeyAuth(fieldName, valueSource string) *SecurityScheme { return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{Type: apiKey, Name: fieldName, In: valueSource}} } // OAuth2Implicit creates an implicit flow oauth2 security scheme func OAuth2Implicit(authorizationURL string) *SecurityScheme { return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{ Type: oauth2, Flow: implicit, AuthorizationURL: authorizationURL, }} } // OAuth2Password creates a password flow oauth2 security scheme func OAuth2Password(tokenURL string) *SecurityScheme { return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{ Type: oauth2, Flow: password, TokenURL: tokenURL, }} } // OAuth2Application creates an application flow oauth2 security scheme func OAuth2Application(tokenURL string) *SecurityScheme { return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{ Type: oauth2, Flow: application, TokenURL: tokenURL, }} } // OAuth2AccessToken creates an access token flow oauth2 security scheme func OAuth2AccessToken(authorizationURL, tokenURL string) *SecurityScheme { return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{ Type: oauth2, Flow: accessCode, AuthorizationURL: authorizationURL, TokenURL: tokenURL, }} } // SecuritySchemeProps describes a swagger security scheme in the securityDefinitions section type SecuritySchemeProps struct { Description string `json:"description,omitempty"` Type string `json:"type"` Name string `json:"name,omitempty"` // api key In string `json:"in,omitempty"` // api key Flow string `json:"flow,omitempty"` // oauth2 AuthorizationURL string `json:"authorizationUrl"` // oauth2 TokenURL string `json:"tokenUrl,omitempty"` // oauth2 Scopes map[string]string `json:"scopes,omitempty"` // oauth2 } // AddScope adds a scope to this security scheme func (s *SecuritySchemeProps) AddScope(scope, description string) { if s.Scopes == nil { s.Scopes = make(map[string]string) } s.Scopes[scope] = description } // SecurityScheme allows the definition of a security scheme that can be used by the operations. // Supported schemes are basic authentication, an API key (either as a header or as a query parameter) // and OAuth2's common flows (implicit, password, application and access code). // // For more information: http://goo.gl/8us55a#securitySchemeObject type SecurityScheme struct { VendorExtensible SecuritySchemeProps } // JSONLookup implements an interface to customize json pointer lookup func (s SecurityScheme) JSONLookup(token string) (interface{}, error) { if ex, ok := s.Extensions[token]; ok { return &ex, nil } r, _, err := jsonpointer.GetForToken(s.SecuritySchemeProps, token) return r, err } // MarshalJSON marshal this to JSON func (s SecurityScheme) MarshalJSON() ([]byte, error) { var ( b1 []byte err error ) if s.Type == oauth2 && (s.Flow == "implicit" || s.Flow == "accessCode") { // when oauth2 for implicit or accessCode flows, empty AuthorizationURL is added as empty string b1, err = json.Marshal(s.SecuritySchemeProps) } else { // when not oauth2, empty AuthorizationURL should be omitted b1, err = json.Marshal(struct { Description string `json:"description,omitempty"` Type string `json:"type"` Name string `json:"name,omitempty"` // api key In string `json:"in,omitempty"` // api key Flow string `json:"flow,omitempty"` // oauth2 AuthorizationURL string `json:"authorizationUrl,omitempty"` // oauth2 TokenURL string `json:"tokenUrl,omitempty"` // oauth2 Scopes map[string]string `json:"scopes,omitempty"` // oauth2 }{ Description: s.Description, Type: s.Type, Name: s.Name, In: s.In, Flow: s.Flow, AuthorizationURL: s.AuthorizationURL, TokenURL: s.TokenURL, Scopes: s.Scopes, }) } if err != nil { return nil, err } b2, err := json.Marshal(s.VendorExtensible) if err != nil { return nil, err } return swag.ConcatJSON(b1, b2), nil } // UnmarshalJSON marshal this from JSON func (s *SecurityScheme) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &s.SecuritySchemeProps); err != nil { return err } return json.Unmarshal(data, &s.VendorExtensible) } spec-0.21.0/spec.go000066400000000000000000000042501457312531500140140ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "encoding/json" ) //go:generate curl -L --progress -o ./schemas/v2/schema.json http://swagger.io/v2/schema.json //go:generate curl -L --progress -o ./schemas/jsonschema-draft-04.json http://json-schema.org/draft-04/schema //go:generate go-bindata -pkg=spec -prefix=./schemas -ignore=.*\.md ./schemas/... //go:generate perl -pi -e s,Json,JSON,g bindata.go const ( // SwaggerSchemaURL the url for the swagger 2.0 schema to validate specs SwaggerSchemaURL = "http://swagger.io/v2/schema.json#" // JSONSchemaURL the url for the json schema JSONSchemaURL = "http://json-schema.org/draft-04/schema#" ) // MustLoadJSONSchemaDraft04 panics when Swagger20Schema returns an error func MustLoadJSONSchemaDraft04() *Schema { d, e := JSONSchemaDraft04() if e != nil { panic(e) } return d } // JSONSchemaDraft04 loads the json schema document for json shema draft04 func JSONSchemaDraft04() (*Schema, error) { b, err := jsonschemaDraft04JSONBytes() if err != nil { return nil, err } schema := new(Schema) if err := json.Unmarshal(b, schema); err != nil { return nil, err } return schema, nil } // MustLoadSwagger20Schema panics when Swagger20Schema returns an error func MustLoadSwagger20Schema() *Schema { d, e := Swagger20Schema() if e != nil { panic(e) } return d } // Swagger20Schema loads the swagger 2.0 schema from the embedded assets func Swagger20Schema() (*Schema, error) { b, err := v2SchemaJSONBytes() if err != nil { return nil, err } schema := new(Schema) if err := json.Unmarshal(b, schema); err != nil { return nil, err } return schema, nil } spec-0.21.0/spec_test.go000066400000000000000000000337641457312531500150670ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec_test import ( "path/filepath" "strings" "testing" "github.com/go-openapi/spec" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) // Test unitary fixture for dev and bug fixing func TestSpec_Issue2743(t *testing.T) { t.Run("should expand but produce unresolvable $ref", func(t *testing.T) { path := filepath.Join("fixtures", "bugs", "2743", "working", "spec.yaml") sp := loadOrFail(t, path) require.NoError(t, spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: true, PathLoader: testLoader}), ) t.Run("all $ref do not resolve when expanding again", func(t *testing.T) { err := spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: false, PathLoader: testLoader}) require.Error(t, err) require.ErrorContains(t, err, filepath.FromSlash("swagger/paths/swagger/user/index.yml")) }) }) t.Run("should expand and produce resolvable $ref", func(t *testing.T) { path := filepath.Join("fixtures", "bugs", "2743", "not-working", "spec.yaml") sp := loadOrFail(t, path) require.NoError(t, spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: true, PathLoader: testLoader}), ) t.Run("all $ref properly reolve when expanding again", func(t *testing.T) { require.NoError(t, spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: false, PathLoader: testLoader}), ) require.NotContainsf(t, asJSON(t, sp), "$ref", "all $ref's should have been expanded properly") }) }) } func TestSpec_Issue1429(t *testing.T) { path := filepath.Join("fixtures", "bugs", "1429", "swagger.yaml") // load and full expand sp := loadOrFail(t, path) err := spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: false, PathLoader: testLoader}) require.NoError(t, err) // assert well expanded require.Truef(t, (sp.Paths != nil && sp.Paths.Paths != nil), "expected paths to be available in fixture") assertPaths1429(t, sp) for _, def := range sp.Definitions { assert.Empty(t, def.Ref) } // reload and SkipSchemas: true sp = loadOrFail(t, path) err = spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: true, PathLoader: testLoader}) require.NoError(t, err) // assert well resolved require.Truef(t, (sp.Paths != nil && sp.Paths.Paths != nil), "expected paths to be available in fixture") assertPaths1429SkipSchema(t, sp) for _, def := range sp.Definitions { assert.Contains(t, def.Ref.String(), "responses.yaml#/definitions/") } } func assertPaths1429(t testing.TB, sp *spec.Swagger) { for _, pi := range sp.Paths.Paths { for _, param := range pi.Get.Parameters { require.NotNilf(t, param.Schema, "expected param schema not to be nil") // all param fixtures are body param with schema // all $ref expanded assert.Equal(t, "", param.Schema.Ref.String()) } for code, response := range pi.Get.Responses.StatusCodeResponses { // all response fixtures are with StatusCodeResponses, but 200 if code == 200 { assert.Nilf(t, response.Schema, "expected response schema to be nil") continue } require.NotNilf(t, response.Schema, "expected response schema not to be nil") assert.Equal(t, "", response.Schema.Ref.String()) } } } func assertPaths1429SkipSchema(t testing.TB, sp *spec.Swagger) { for _, pi := range sp.Paths.Paths { for _, param := range pi.Get.Parameters { require.NotNilf(t, param.Schema, "expected param schema not to be nil") // all param fixtures are body param with schema switch param.Name { case "plainRequest": // this one is expanded assert.Equal(t, "", param.Schema.Ref.String()) continue case "nestedBody": // this one is local assert.Truef(t, strings.HasPrefix(param.Schema.Ref.String(), "#/definitions/"), "expected rooted definitions $ref, got: %s", param.Schema.Ref.String()) continue case "remoteRequest": assert.Contains(t, param.Schema.Ref.String(), "remote/remote.yaml#/") continue } assert.Contains(t, param.Schema.Ref.String(), "responses.yaml#/") } for code, response := range pi.Get.Responses.StatusCodeResponses { // all response fixtures are with StatusCodeResponses, but 200 switch code { case 200: assert.Nilf(t, response.Schema, "expected response schema to be nil") continue case 204: assert.Contains(t, response.Schema.Ref.String(), "remote/remote.yaml#/") continue case 404: assert.Equal(t, "", response.Schema.Ref.String()) continue } assert.Containsf(t, response.Schema.Ref.String(), "responses.yaml#/", "expected remote ref at resp. %d", code) } } } func TestSpec_MoreLocalExpansion(t *testing.T) { path := filepath.Join("fixtures", "local_expansion", "spec2.yaml") // load and full expand sp := loadOrFail(t, path) require.NoError(t, spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: false, PathLoader: testLoader})) // asserts all $ref are expanded assert.NotContains(t, asJSON(t, sp), `"$ref"`) } func TestSpec_Issue69(t *testing.T) { // this checks expansion for the dapperbox spec (circular ref issues) path := filepath.Join("fixtures", "bugs", "69", "dapperbox.json") // expand with relative path // load and expand sp := loadOrFail(t, path) require.NoError(t, spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: false, PathLoader: testLoader})) // asserts all $ref expanded jazon := asJSON(t, sp) // circular $ref are not expanded: however, they point to the expanded root document // assert all $ref match "$ref": "#/definitions/something" assertRefInJSON(t, jazon, "#/definitions") // assert all $ref expand correctly against the spec assertRefExpand(t, jazon, "", sp) } func TestSpec_Issue1621(t *testing.T) { path := filepath.Join("fixtures", "bugs", "1621", "fixture-1621.yaml") // expand with relative path // load and expand sp := loadOrFail(t, path) err := spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: false, PathLoader: testLoader}) require.NoError(t, err) // asserts all $ref expanded jazon := asJSON(t, sp) assertNoRef(t, jazon) } func TestSpec_Issue1614(t *testing.T) { path := filepath.Join("fixtures", "bugs", "1614", "gitea.json") // expand with relative path // load and expand sp := loadOrFail(t, path) require.NoError(t, spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: false, PathLoader: testLoader})) // asserts all $ref expanded jazon := asJSON(t, sp) // assert all $ref match "$ref": "#/definitions/something" assertRefInJSON(t, jazon, "#/definitions") // assert all $ref expand correctly against the spec assertRefExpand(t, jazon, "", sp) // now with option CircularRefAbsolute: circular $ref are not denormalized and are kept absolute. // This option is essentially for debugging purpose. sp = loadOrFail(t, path) require.NoError(t, spec.ExpandSpec(sp, &spec.ExpandOptions{ RelativeBase: path, SkipSchemas: false, AbsoluteCircularRef: true, PathLoader: testLoader, })) // asserts all $ref expanded jazon = asJSON(t, sp) // assert all $ref match "$ref": "file://{file}#/definitions/something" assertRefInJSONRegexp(t, jazon, `file://.*/gitea.json#/definitions/`) // assert all $ref expand correctly against the spec assertRefExpand(t, jazon, "", sp, &spec.ExpandOptions{RelativeBase: path}) } func TestSpec_Issue2113(t *testing.T) { // this checks expansion with nested specs path := filepath.Join("fixtures", "bugs", "2113", "base.yaml") // load and expand sp := loadOrFail(t, path) err := spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: false, PathLoader: testLoader}) require.NoError(t, err) // asserts all $ref expanded jazon := asJSON(t, sp) // assert all $ref match have been expanded assertNoRef(t, jazon) // now trying with SkipSchemas sp = loadOrFail(t, path) err = spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: true, PathLoader: testLoader}) require.NoError(t, err) jazon = asJSON(t, sp) // assert all $ref match assertRefInJSONRegexp(t, jazon, `^(schemas/dummy/dummy.yaml)|(schemas/example/example.yaml)`) // assert all $ref resolve correctly against the spec assertRefResolve(t, jazon, "", sp, &spec.ExpandOptions{RelativeBase: path, PathLoader: testLoader}) // assert all $ref expand correctly against the spec assertRefExpand(t, jazon, "", sp, &spec.ExpandOptions{RelativeBase: path, PathLoader: testLoader}) } func TestSpec_Issue2113_External(t *testing.T) { // Exercises the SkipSchema mode (used by spec flattening in go-openapi/analysis). // Provides more ground for testing with schemas nested in $refs // this checks expansion with nested specs path := filepath.Join("fixtures", "skipschema", "external_definitions_valid.yml") // load and expand, skipping schema expansion sp := loadOrFail(t, path) require.NoError(t, spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: true, PathLoader: testLoader})) // asserts all $ref are expanded as expected jazon := asJSON(t, sp) assertRefInJSONRegexp(t, jazon, `^(external/definitions.yml#/definitions)|(external/errors.yml#/error)|(external/nestedParams.yml#/bodyParam)`) // assert all $ref resolve correctly against the spec assertRefResolve(t, jazon, "", sp, &spec.ExpandOptions{RelativeBase: path, PathLoader: testLoader}) // assert all $ref in jazon expand correctly against the spec assertRefExpand(t, jazon, "", sp, &spec.ExpandOptions{RelativeBase: path, PathLoader: testLoader}) // expansion can be iterated again, including schemas require.NoError(t, spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: false, PathLoader: testLoader})) jazon = asJSON(t, sp) assertNoRef(t, jazon) // load and expand everything sp = loadOrFail(t, path) require.NoError(t, spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: false, PathLoader: testLoader})) jazon = asJSON(t, sp) assertNoRef(t, jazon) } func TestSpec_Issue2113_SkipSchema(t *testing.T) { // Exercises the SkipSchema mode from spec flattening in go-openapi/analysis // Provides more ground for testing with schemas nested in $refs // this checks expansion with nested specs path := filepath.Join("fixtures", "flatten", "flatten.yml") // load and expand, skipping schema expansion sp := loadOrFail(t, path) require.NoError(t, spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: true, PathLoader: testLoader})) jazon := asJSON(t, sp) // asserts all $ref are expanded as expected assertRefInJSONRegexp(t, jazon, `^(external/definitions.yml#/definitions)|(#/definitions/namedAgain)|(external/errors.yml#/error)`) // assert all $ref resolve correctly against the spec assertRefResolve(t, jazon, "", sp, &spec.ExpandOptions{RelativeBase: path, PathLoader: testLoader}) assertRefExpand(t, jazon, "", sp, &spec.ExpandOptions{RelativeBase: path, PathLoader: testLoader}) // load and expand, including schemas sp = loadOrFail(t, path) require.NoError(t, spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: false, PathLoader: testLoader})) jazon = asJSON(t, sp) assertNoRef(t, jazon) } func TestSpec_PointersLoop(t *testing.T) { // this a spec that cannot be flattened (self-referencing pointer). // however, it should be expanded without errors // this checks expansion with nested specs path := filepath.Join("fixtures", "more_circulars", "pointers", "fixture-pointers-loop.yaml") // load and expand, skipping schema expansion sp := loadOrFail(t, path) require.NoError(t, spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: true, PathLoader: testLoader})) jazon := asJSON(t, sp) assertRefExpand(t, jazon, "", sp, &spec.ExpandOptions{RelativeBase: path, PathLoader: testLoader}) sp = loadOrFail(t, path) require.NoError(t, spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: false, PathLoader: testLoader})) // cannot guarantee which ref will be kept, but only one remains: expand reduces all $ref down // to the last self-referencing one (the one picked changes from one run to another, depending // on where during the walk the cycle is detected). jazon = asJSON(t, sp) m := rex.FindAllStringSubmatch(jazon, -1) require.NotEmpty(t, m) refs := make(map[string]struct{}, 5) for _, matched := range m { subMatch := matched[1] refs[subMatch] = struct{}{} } require.Len(t, refs, 1) assertRefExpand(t, jazon, "", sp, &spec.ExpandOptions{RelativeBase: path, PathLoader: testLoader}) } func TestSpec_Issue102(t *testing.T) { // go-openapi/validate/issues#102 path := filepath.Join("fixtures", "bugs", "102", "fixture-102.json") sp := loadOrFail(t, path) require.NoError(t, spec.ExpandSpec(sp, nil)) jazon := asJSON(t, sp) assertRefInJSONRegexp(t, jazon, `^#/definitions/Error$`) sp = loadOrFail(t, path) sch := spec.RefSchema("#/definitions/Error") require.NoError(t, spec.ExpandSchema(sch, sp, nil)) jazon = asJSON(t, sch) assertRefInJSONRegexp(t, jazon, "^#/definitions/Error$") sp = loadOrFail(t, path) sch = spec.RefSchema("#/definitions/Error") resp := spec.NewResponse().WithDescription("ok").WithSchema(sch) require.NoError(t, spec.ExpandResponseWithRoot(resp, sp, nil)) jazon = asJSON(t, resp) assertRefInJSONRegexp(t, jazon, "^#/definitions/Error$") sp = loadOrFail(t, path) sch = spec.RefSchema("#/definitions/Error") param := spec.BodyParam("error", sch) require.NoError(t, spec.ExpandParameterWithRoot(param, sp, nil)) jazon = asJSON(t, resp) assertRefInJSONRegexp(t, jazon, "^#/definitions/Error$") } spec-0.21.0/structs_test.go000066400000000000000000000076051457312531500156370ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "encoding/json" "reflect" "testing" "github.com/stretchr/testify/assert" "gopkg.in/yaml.v3" ) func assertSerializeJSON(t testing.TB, actual interface{}, expected string) bool { ser, err := json.Marshal(actual) if err != nil { return assert.Fail(t, "unable to marshal to json (%s): %#v", err, actual) } return assert.Equal(t, expected, string(ser)) } func assertSerializeYAML(t testing.TB, actual interface{}, expected string) bool { ser, err := yaml.Marshal(actual) if err != nil { return assert.Fail(t, "unable to marshal to yaml (%s): %#v", err, actual) } return assert.Equal(t, expected, string(ser)) } func derefTypeOf(expected interface{}) (tpe reflect.Type) { tpe = reflect.TypeOf(expected) if tpe.Kind() == reflect.Ptr { tpe = tpe.Elem() } return } func isPointed(expected interface{}) (pointed bool) { tpe := reflect.TypeOf(expected) if tpe.Kind() == reflect.Ptr { pointed = true } return } func assertParsesJSON(t testing.TB, actual string, expected interface{}) bool { parsed := reflect.New(derefTypeOf(expected)) err := json.Unmarshal([]byte(actual), parsed.Interface()) if err != nil { return assert.Fail(t, "unable to unmarshal from json (%s): %s", err, actual) } act := parsed.Interface() if !isPointed(expected) { act = reflect.Indirect(parsed).Interface() } return assert.Equal(t, expected, act) } func assertParsesYAML(t testing.TB, actual string, expected interface{}) bool { parsed := reflect.New(derefTypeOf(expected)) err := yaml.Unmarshal([]byte(actual), parsed.Interface()) if err != nil { return assert.Fail(t, "unable to unmarshal from yaml (%s): %s", err, actual) } act := parsed.Interface() if !isPointed(expected) { act = reflect.Indirect(parsed).Interface() } return assert.EqualValues(t, expected, act) } func TestSerialization_SerializeJSON(t *testing.T) { assertSerializeJSON(t, []string{"hello"}, "[\"hello\"]") assertSerializeJSON(t, []string{"hello", "world", "and", "stuff"}, "[\"hello\",\"world\",\"and\",\"stuff\"]") assertSerializeJSON(t, StringOrArray(nil), "null") assertSerializeJSON(t, SchemaOrArray{ Schemas: []Schema{ {SchemaProps: SchemaProps{Type: []string{"string"}}}}, }, "[{\"type\":\"string\"}]") assertSerializeJSON(t, SchemaOrArray{ Schemas: []Schema{ {SchemaProps: SchemaProps{Type: []string{"string"}}}, {SchemaProps: SchemaProps{Type: []string{"string"}}}, }}, "[{\"type\":\"string\"},{\"type\":\"string\"}]") assertSerializeJSON(t, SchemaOrArray{}, "null") } func TestSerialization_DeserializeJSON(t *testing.T) { // String assertParsesJSON(t, "\"hello\"", StringOrArray([]string{"hello"})) assertParsesJSON(t, "[\"hello\",\"world\",\"and\",\"stuff\"]", StringOrArray([]string{"hello", "world", "and", "stuff"})) assertParsesJSON(t, "[\"hello\",\"world\",null,\"stuff\"]", StringOrArray([]string{"hello", "world", "", "stuff"})) assertParsesJSON(t, "null", StringOrArray(nil)) // Schema assertParsesJSON(t, "{\"type\":\"string\"}", SchemaOrArray{Schema: &Schema{ SchemaProps: SchemaProps{Type: []string{"string"}}}, }) assertParsesJSON(t, "[{\"type\":\"string\"},{\"type\":\"string\"}]", &SchemaOrArray{ Schemas: []Schema{ {SchemaProps: SchemaProps{Type: []string{"string"}}}, {SchemaProps: SchemaProps{Type: []string{"string"}}}, }, }) assertParsesJSON(t, "null", SchemaOrArray{}) } spec-0.21.0/swagger.go000066400000000000000000000274631457312531500145340ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "bytes" "encoding/gob" "encoding/json" "fmt" "strconv" "github.com/go-openapi/jsonpointer" "github.com/go-openapi/swag" ) // Swagger this is the root document object for the API specification. // It combines what previously was the Resource Listing and API Declaration (version 1.2 and earlier) // together into one document. // // For more information: http://goo.gl/8us55a#swagger-object- type Swagger struct { VendorExtensible SwaggerProps } // JSONLookup look up a value by the json property name func (s Swagger) JSONLookup(token string) (interface{}, error) { if ex, ok := s.Extensions[token]; ok { return &ex, nil } r, _, err := jsonpointer.GetForToken(s.SwaggerProps, token) return r, err } // MarshalJSON marshals this swagger structure to json func (s Swagger) MarshalJSON() ([]byte, error) { b1, err := json.Marshal(s.SwaggerProps) if err != nil { return nil, err } b2, err := json.Marshal(s.VendorExtensible) if err != nil { return nil, err } return swag.ConcatJSON(b1, b2), nil } // UnmarshalJSON unmarshals a swagger spec from json func (s *Swagger) UnmarshalJSON(data []byte) error { var sw Swagger if err := json.Unmarshal(data, &sw.SwaggerProps); err != nil { return err } if err := json.Unmarshal(data, &sw.VendorExtensible); err != nil { return err } *s = sw return nil } // GobEncode provides a safe gob encoder for Swagger, including extensions func (s Swagger) GobEncode() ([]byte, error) { var b bytes.Buffer raw := struct { Props SwaggerProps Ext VendorExtensible }{ Props: s.SwaggerProps, Ext: s.VendorExtensible, } err := gob.NewEncoder(&b).Encode(raw) return b.Bytes(), err } // GobDecode provides a safe gob decoder for Swagger, including extensions func (s *Swagger) GobDecode(b []byte) error { var raw struct { Props SwaggerProps Ext VendorExtensible } buf := bytes.NewBuffer(b) err := gob.NewDecoder(buf).Decode(&raw) if err != nil { return err } s.SwaggerProps = raw.Props s.VendorExtensible = raw.Ext return nil } // SwaggerProps captures the top-level properties of an Api specification // // NOTE: validation rules // - the scheme, when present must be from [http, https, ws, wss] // - BasePath must start with a leading "/" // - Paths is required type SwaggerProps struct { ID string `json:"id,omitempty"` Consumes []string `json:"consumes,omitempty"` Produces []string `json:"produces,omitempty"` Schemes []string `json:"schemes,omitempty"` Swagger string `json:"swagger,omitempty"` Info *Info `json:"info,omitempty"` Host string `json:"host,omitempty"` BasePath string `json:"basePath,omitempty"` Paths *Paths `json:"paths"` Definitions Definitions `json:"definitions,omitempty"` Parameters map[string]Parameter `json:"parameters,omitempty"` Responses map[string]Response `json:"responses,omitempty"` SecurityDefinitions SecurityDefinitions `json:"securityDefinitions,omitempty"` Security []map[string][]string `json:"security,omitempty"` Tags []Tag `json:"tags,omitempty"` ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"` } type swaggerPropsAlias SwaggerProps type gobSwaggerPropsAlias struct { Security []map[string]struct { List []string Pad bool } Alias *swaggerPropsAlias SecurityIsEmpty bool } // GobEncode provides a safe gob encoder for SwaggerProps, including empty security requirements func (o SwaggerProps) GobEncode() ([]byte, error) { raw := gobSwaggerPropsAlias{ Alias: (*swaggerPropsAlias)(&o), } var b bytes.Buffer if o.Security == nil { // nil security requirement err := gob.NewEncoder(&b).Encode(raw) return b.Bytes(), err } if len(o.Security) == 0 { // empty, but non-nil security requirement raw.SecurityIsEmpty = true raw.Alias.Security = nil err := gob.NewEncoder(&b).Encode(raw) return b.Bytes(), err } raw.Security = make([]map[string]struct { List []string Pad bool }, 0, len(o.Security)) for _, req := range o.Security { v := make(map[string]struct { List []string Pad bool }, len(req)) for k, val := range req { v[k] = struct { List []string Pad bool }{ List: val, } } raw.Security = append(raw.Security, v) } err := gob.NewEncoder(&b).Encode(raw) return b.Bytes(), err } // GobDecode provides a safe gob decoder for SwaggerProps, including empty security requirements func (o *SwaggerProps) GobDecode(b []byte) error { var raw gobSwaggerPropsAlias buf := bytes.NewBuffer(b) err := gob.NewDecoder(buf).Decode(&raw) if err != nil { return err } if raw.Alias == nil { return nil } switch { case raw.SecurityIsEmpty: // empty, but non-nil security requirement raw.Alias.Security = []map[string][]string{} case len(raw.Alias.Security) == 0: // nil security requirement raw.Alias.Security = nil default: raw.Alias.Security = make([]map[string][]string, 0, len(raw.Security)) for _, req := range raw.Security { v := make(map[string][]string, len(req)) for k, val := range req { v[k] = make([]string, 0, len(val.List)) v[k] = append(v[k], val.List...) } raw.Alias.Security = append(raw.Alias.Security, v) } } *o = *(*SwaggerProps)(raw.Alias) return nil } // Dependencies represent a dependencies property type Dependencies map[string]SchemaOrStringArray // SchemaOrBool represents a schema or boolean value, is biased towards true for the boolean property type SchemaOrBool struct { Allows bool Schema *Schema } // JSONLookup implements an interface to customize json pointer lookup func (s SchemaOrBool) JSONLookup(token string) (interface{}, error) { if token == "allows" { return s.Allows, nil } r, _, err := jsonpointer.GetForToken(s.Schema, token) return r, err } var jsTrue = []byte("true") var jsFalse = []byte("false") // MarshalJSON convert this object to JSON func (s SchemaOrBool) MarshalJSON() ([]byte, error) { if s.Schema != nil { return json.Marshal(s.Schema) } if s.Schema == nil && !s.Allows { return jsFalse, nil } return jsTrue, nil } // UnmarshalJSON converts this bool or schema object from a JSON structure func (s *SchemaOrBool) UnmarshalJSON(data []byte) error { var nw SchemaOrBool if len(data) > 0 { if data[0] == '{' { var sch Schema if err := json.Unmarshal(data, &sch); err != nil { return err } nw.Schema = &sch } nw.Allows = !bytes.Equal(data, []byte("false")) } *s = nw return nil } // SchemaOrStringArray represents a schema or a string array type SchemaOrStringArray struct { Schema *Schema Property []string } // JSONLookup implements an interface to customize json pointer lookup func (s SchemaOrStringArray) JSONLookup(token string) (interface{}, error) { r, _, err := jsonpointer.GetForToken(s.Schema, token) return r, err } // MarshalJSON converts this schema object or array into JSON structure func (s SchemaOrStringArray) MarshalJSON() ([]byte, error) { if len(s.Property) > 0 { return json.Marshal(s.Property) } if s.Schema != nil { return json.Marshal(s.Schema) } return []byte("null"), nil } // UnmarshalJSON converts this schema object or array from a JSON structure func (s *SchemaOrStringArray) UnmarshalJSON(data []byte) error { var first byte if len(data) > 1 { first = data[0] } var nw SchemaOrStringArray if first == '{' { var sch Schema if err := json.Unmarshal(data, &sch); err != nil { return err } nw.Schema = &sch } if first == '[' { if err := json.Unmarshal(data, &nw.Property); err != nil { return err } } *s = nw return nil } // Definitions contains the models explicitly defined in this spec // An object to hold data types that can be consumed and produced by operations. // These data types can be primitives, arrays or models. // // For more information: http://goo.gl/8us55a#definitionsObject type Definitions map[string]Schema // SecurityDefinitions a declaration of the security schemes available to be used in the specification. // This does not enforce the security schemes on the operations and only serves to provide // the relevant details for each scheme. // // For more information: http://goo.gl/8us55a#securityDefinitionsObject type SecurityDefinitions map[string]*SecurityScheme // StringOrArray represents a value that can either be a string // or an array of strings. Mainly here for serialization purposes type StringOrArray []string // Contains returns true when the value is contained in the slice func (s StringOrArray) Contains(value string) bool { for _, str := range s { if str == value { return true } } return false } // JSONLookup implements an interface to customize json pointer lookup func (s SchemaOrArray) JSONLookup(token string) (interface{}, error) { if _, err := strconv.Atoi(token); err == nil { r, _, err := jsonpointer.GetForToken(s.Schemas, token) return r, err } r, _, err := jsonpointer.GetForToken(s.Schema, token) return r, err } // UnmarshalJSON unmarshals this string or array object from a JSON array or JSON string func (s *StringOrArray) UnmarshalJSON(data []byte) error { var first byte if len(data) > 1 { first = data[0] } if first == '[' { var parsed []string if err := json.Unmarshal(data, &parsed); err != nil { return err } *s = StringOrArray(parsed) return nil } var single interface{} if err := json.Unmarshal(data, &single); err != nil { return err } if single == nil { return nil } switch v := single.(type) { case string: *s = StringOrArray([]string{v}) return nil default: return fmt.Errorf("only string or array is allowed, not %T", single) } } // MarshalJSON converts this string or array to a JSON array or JSON string func (s StringOrArray) MarshalJSON() ([]byte, error) { if len(s) == 1 { return json.Marshal([]string(s)[0]) } return json.Marshal([]string(s)) } // SchemaOrArray represents a value that can either be a Schema // or an array of Schema. Mainly here for serialization purposes type SchemaOrArray struct { Schema *Schema Schemas []Schema } // Len returns the number of schemas in this property func (s SchemaOrArray) Len() int { if s.Schema != nil { return 1 } return len(s.Schemas) } // ContainsType returns true when one of the schemas is of the specified type func (s *SchemaOrArray) ContainsType(name string) bool { if s.Schema != nil { return s.Schema.Type != nil && s.Schema.Type.Contains(name) } return false } // MarshalJSON converts this schema object or array into JSON structure func (s SchemaOrArray) MarshalJSON() ([]byte, error) { if len(s.Schemas) > 0 { return json.Marshal(s.Schemas) } return json.Marshal(s.Schema) } // UnmarshalJSON converts this schema object or array from a JSON structure func (s *SchemaOrArray) UnmarshalJSON(data []byte) error { var nw SchemaOrArray var first byte if len(data) > 1 { first = data[0] } if first == '{' { var sch Schema if err := json.Unmarshal(data, &sch); err != nil { return err } nw.Schema = &sch } if first == '[' { if err := json.Unmarshal(data, &nw.Schemas); err != nil { return err } } *s = nw return nil } // vim:set ft=go noet sts=2 sw=2 ts=2: spec-0.21.0/swagger_test.go000066400000000000000000000261721457312531500155670ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "encoding/json" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) var spec = Swagger{ SwaggerProps: SwaggerProps{ ID: "http://localhost:3849/api-docs", Swagger: "2.0", Consumes: []string{"application/json", "application/x-yaml"}, Produces: []string{"application/json"}, Schemes: []string{"http", "https"}, Info: &info, Host: "some.api.out.there", BasePath: "/", Paths: &paths, Definitions: map[string]Schema{"Category": {SchemaProps: SchemaProps{Type: []string{"string"}}}}, Parameters: map[string]Parameter{ "categoryParam": {ParamProps: ParamProps{Name: "category", In: "query"}, SimpleSchema: SimpleSchema{Type: "string"}}, }, Responses: map[string]Response{ "EmptyAnswer": { ResponseProps: ResponseProps{ Description: "no data to return for this operation", }, }, }, SecurityDefinitions: map[string]*SecurityScheme{ "internalApiKey": APIKeyAuth("api_key", "header"), }, Security: []map[string][]string{ {"internalApiKey": {}}, }, Tags: []Tag{NewTag("pets", "", nil)}, ExternalDocs: &ExternalDocumentation{Description: "the name", URL: "the url"}, }, VendorExtensible: VendorExtensible{Extensions: map[string]interface{}{ "x-some-extension": "vendor", "x-schemes": []interface{}{"unix", "amqp"}, }}, } const specJSON = `{ "id": "http://localhost:3849/api-docs", "consumes": ["application/json", "application/x-yaml"], "produces": ["application/json"], "schemes": ["http", "https"], "swagger": "2.0", "info": { "contact": { "name": "wordnik api team", "url": "http://developer.wordnik.com" }, "description": "A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0` + ` specification", "license": { "name": "Creative Commons 4.0 International", "url": "http://creativecommons.org/licenses/by/4.0/" }, "termsOfService": "http://helloreverb.com/terms/", "title": "Swagger Sample API", "version": "1.0.9-abcd", "x-framework": "go-swagger" }, "host": "some.api.out.there", "basePath": "/", "paths": {"x-framework":"go-swagger","/":{"$ref":"cats"}}, "definitions": { "Category": { "type": "string"} }, "parameters": { "categoryParam": { "name": "category", "in": "query", "type": "string" } }, "responses": { "EmptyAnswer": { "description": "no data to return for this operation" } }, "securityDefinitions": { "internalApiKey": { "type": "apiKey", "in": "header", "name": "api_key" } }, "security": [{"internalApiKey":[]}], "tags": [{"name":"pets"}], "externalDocs": {"description":"the name","url":"the url"}, "x-some-extension": "vendor", "x-schemes": ["unix","amqp"] }` // func verifySpecSerialize(specJSON []byte, spec Swagger) { // expected := map[string]interface{}{} // json.Unmarshal(specJSON, &expected) // b, err := json.MarshalIndent(spec, "", " ") // So(err, ShouldBeNil) // var actual map[string]interface{} // err = json.Unmarshal(b, &actual) // So(err, ShouldBeNil) // compareSpecMaps(actual, expected) // } /* // assertEquivalent is currently unused func assertEquivalent(t testing.TB, actual, expected interface{}) bool { if actual == nil || expected == nil || reflect.DeepEqual(actual, expected) { return true } actualType := reflect.TypeOf(actual) expectedType := reflect.TypeOf(expected) if reflect.TypeOf(actual).ConvertibleTo(expectedType) { expectedValue := reflect.ValueOf(expected) if swag.IsZero(expectedValue) && swag.IsZero(reflect.ValueOf(actual)) { return true } // Attempt comparison after type conversion if reflect.DeepEqual(actual, expectedValue.Convert(actualType).Interface()) { return true } } // Last ditch effort if fmt.Sprintf("%#v", expected) == fmt.Sprintf("%#v", actual) { return true } errFmt := "Expected: '%[1]T(%[1]#v)'\nActual: '%[2]T(%[2]#v)'\n(Should be equivalent)!" return assert.Fail(t, errFmt, expected, actual) } // ShouldBeEquivalentTo is currently unused func ShouldBeEquivalentTo(actual interface{}, expecteds ...interface{}) string { expected := expecteds[0] if actual == nil || expected == nil { return "" } if reflect.DeepEqual(expected, actual) { return "" } actualType := reflect.TypeOf(actual) expectedType := reflect.TypeOf(expected) if reflect.TypeOf(actual).ConvertibleTo(expectedType) { expectedValue := reflect.ValueOf(expected) if swag.IsZero(expectedValue) && swag.IsZero(reflect.ValueOf(actual)) { return "" } // Attempt comparison after type conversion if reflect.DeepEqual(actual, expectedValue.Convert(actualType).Interface()) { return "" } } // Last ditch effort if fmt.Sprintf("%#v", expected) == fmt.Sprintf("%#v", actual) { return "" } errFmt := "Expected: '%[1]T(%[1]#v)'\nActual: '%[2]T(%[2]#v)'\n(Should be equivalent)!" return fmt.Sprintf(errFmt, expected, actual) } // assertSpecMaps is currently unused func assertSpecMaps(t testing.TB, actual, expected map[string]interface{}) bool { res := true if id, ok := expected["id"]; ok { res = assert.Equal(t, id, actual["id"]) } res = res && assert.Equal(t, expected["consumes"], actual["consumes"]) res = res && assert.Equal(t, expected["produces"], actual["produces"]) res = res && assert.Equal(t, expected["schemes"], actual["schemes"]) res = res && assert.Equal(t, expected["swagger"], actual["swagger"]) res = res && assert.Equal(t, expected["info"], actual["info"]) res = res && assert.Equal(t, expected["host"], actual["host"]) res = res && assert.Equal(t, expected["basePath"], actual["basePath"]) res = res && assert.Equal(t, expected["paths"], actual["paths"]) res = res && assert.Equal(t, expected["definitions"], actual["definitions"]) res = res && assert.Equal(t, expected["responses"], actual["responses"]) res = res && assert.Equal(t, expected["securityDefinitions"], actual["securityDefinitions"]) res = res && assert.Equal(t, expected["tags"], actual["tags"]) res = res && assert.Equal(t, expected["externalDocs"], actual["externalDocs"]) res = res && assert.Equal(t, expected["x-some-extension"], actual["x-some-extension"]) res = res && assert.Equal(t, expected["x-schemes"], actual["x-schemes"]) return res } */ func assertSpecs(t testing.TB, actual, expected Swagger) bool { expected.Swagger = "2.0" return assert.Equal(t, expected, actual) } /* // assertSpecJSON is currently unused func assertSpecJSON(t testing.TB, specJSON []byte) bool { var expected map[string]interface{} if !assert.NoError(t, json.Unmarshal(specJSON, &expected)) { return false } obj := Swagger{} if !assert.NoError(t, json.Unmarshal(specJSON, &obj)) { return false } cb, err := json.MarshalIndent(obj, "", " ") if assert.NoError(t, err) { return false } var actual map[string]interface{} if !assert.NoError(t, json.Unmarshal(cb, &actual)) { return false } return assertSpecMaps(t, expected, actual ) } */ func TestSwaggerSpec_Serialize(t *testing.T) { expected := make(map[string]interface{}) _ = json.Unmarshal([]byte(specJSON), &expected) b, err := json.MarshalIndent(spec, "", " ") require.NoError(t, err) var actual map[string]interface{} require.NoError(t, json.Unmarshal(b, &actual)) assert.EqualValues(t, expected, actual) } func TestSwaggerSpec_Deserialize(t *testing.T) { var actual Swagger require.NoError(t, json.Unmarshal([]byte(specJSON), &actual)) assert.EqualValues(t, actual, spec) } func TestVendorExtensionStringSlice(t *testing.T) { var actual Swagger require.NoError(t, json.Unmarshal([]byte(specJSON), &actual)) schemes, ok := actual.Extensions.GetStringSlice("x-schemes") require.True(t, ok) assert.EqualValues(t, []string{"unix", "amqp"}, schemes) notSlice, ok := actual.Extensions.GetStringSlice("x-some-extension") assert.Nil(t, notSlice) assert.False(t, ok) actual.AddExtension("x-another-ext", 100) notString, ok := actual.Extensions.GetStringSlice("x-another-ext") assert.Nil(t, notString) assert.False(t, ok) actual.AddExtension("x-another-slice-ext", []interface{}{100, 100}) notStringSlice, ok := actual.Extensions.GetStringSlice("x-another-slice-ext") assert.Nil(t, notStringSlice) assert.False(t, ok) _, ok = actual.Extensions.GetStringSlice("x-notfound-ext") assert.False(t, ok) } func TestOptionalSwaggerProps_Serialize(t *testing.T) { minimalJSONSpec := []byte(`{ "swagger": "2.0", "info": { "version": "0.0.0", "title": "Simple API" }, "paths": { "/": { "get": { "responses": { "200": { "description": "OK" } } } } } }`) var minimalSpec Swagger err := json.Unmarshal(minimalJSONSpec, &minimalSpec) require.NoError(t, err) bytes, err := json.Marshal(&minimalSpec) require.NoError(t, err) var ms map[string]interface{} require.NoError(t, json.Unmarshal(bytes, &ms)) assert.NotContains(t, ms, "consumes") assert.NotContains(t, ms, "produces") assert.NotContains(t, ms, "schemes") assert.NotContains(t, ms, "host") assert.NotContains(t, ms, "basePath") assert.NotContains(t, ms, "definitions") assert.NotContains(t, ms, "parameters") assert.NotContains(t, ms, "responses") assert.NotContains(t, ms, "securityDefinitions") assert.NotContains(t, ms, "security") assert.NotContains(t, ms, "tags") assert.NotContains(t, ms, "externalDocs") } var minimalJSONSpec = []byte(`{ "swagger": "2.0", "info": { "version": "0.0.0", "title": "Simple API" }, "securityDefinitions": { "basic": { "type": "basic" }, "apiKey": { "type": "apiKey", "in": "header", "name": "X-API-KEY" }, "queryKey": { "type": "apiKey", "in": "query", "name": "api_key" } }, "paths": { "/": { "get": { "security": [ { "apiKey": [], "basic": [] }, {}, { "queryKey": [], "basic": [] } ], "responses": { "200": { "description": "OK" } } } } } }`) func TestSecurityRequirements(t *testing.T) { var minimalSpec Swagger require.NoError(t, json.Unmarshal(minimalJSONSpec, &minimalSpec)) sec := minimalSpec.Paths.Paths["/"].Get.Security require.Len(t, sec, 3) assert.Contains(t, sec[0], "basic") assert.Contains(t, sec[0], "apiKey") assert.NotNil(t, sec[1]) assert.Empty(t, sec[1]) assert.Contains(t, sec[2], "queryKey") } func TestSwaggerGobEncoding(t *testing.T) { doTestSwaggerGobEncoding(t, specJSON) doTestSwaggerGobEncoding(t, string(minimalJSONSpec)) } func doTestSwaggerGobEncoding(t *testing.T, fixture string) { var src, dst Swagger require.NoError(t, json.Unmarshal([]byte(fixture), &src)) doTestAnyGobEncoding(t, &src, &dst) } spec-0.21.0/tag.go000066400000000000000000000043611457312531500136400ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "encoding/json" "github.com/go-openapi/jsonpointer" "github.com/go-openapi/swag" ) // TagProps describe a tag entry in the top level tags section of a swagger spec type TagProps struct { Description string `json:"description,omitempty"` Name string `json:"name,omitempty"` ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"` } // NewTag creates a new tag func NewTag(name, description string, externalDocs *ExternalDocumentation) Tag { return Tag{TagProps: TagProps{Description: description, Name: name, ExternalDocs: externalDocs}} } // Tag allows adding meta data to a single tag that is used by the // [Operation Object](http://goo.gl/8us55a#operationObject). // It is not mandatory to have a Tag Object per tag used there. // // For more information: http://goo.gl/8us55a#tagObject type Tag struct { VendorExtensible TagProps } // JSONLookup implements an interface to customize json pointer lookup func (t Tag) JSONLookup(token string) (interface{}, error) { if ex, ok := t.Extensions[token]; ok { return &ex, nil } r, _, err := jsonpointer.GetForToken(t.TagProps, token) return r, err } // MarshalJSON marshal this to JSON func (t Tag) MarshalJSON() ([]byte, error) { b1, err := json.Marshal(t.TagProps) if err != nil { return nil, err } b2, err := json.Marshal(t.VendorExtensible) if err != nil { return nil, err } return swag.ConcatJSON(b1, b2), nil } // UnmarshalJSON marshal this from JSON func (t *Tag) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &t.TagProps); err != nil { return err } return json.Unmarshal(data, &t.VendorExtensible) } spec-0.21.0/url_go19.go000066400000000000000000000002361457312531500145230ustar00rootroot00000000000000package spec import "net/url" func parseURL(s string) (*url.URL, error) { u, err := url.Parse(s) if err == nil { u.OmitHost = false } return u, err } spec-0.21.0/validations.go000066400000000000000000000161741457312531500154070ustar00rootroot00000000000000package spec // CommonValidations describe common JSON-schema validations type CommonValidations struct { Maximum *float64 `json:"maximum,omitempty"` ExclusiveMaximum bool `json:"exclusiveMaximum,omitempty"` Minimum *float64 `json:"minimum,omitempty"` ExclusiveMinimum bool `json:"exclusiveMinimum,omitempty"` MaxLength *int64 `json:"maxLength,omitempty"` MinLength *int64 `json:"minLength,omitempty"` Pattern string `json:"pattern,omitempty"` MaxItems *int64 `json:"maxItems,omitempty"` MinItems *int64 `json:"minItems,omitempty"` UniqueItems bool `json:"uniqueItems,omitempty"` MultipleOf *float64 `json:"multipleOf,omitempty"` Enum []interface{} `json:"enum,omitempty"` } // SetValidations defines all validations for a simple schema. // // NOTE: the input is the larger set of validations available for schemas. // For simple schemas, MinProperties and MaxProperties are ignored. func (v *CommonValidations) SetValidations(val SchemaValidations) { v.Maximum = val.Maximum v.ExclusiveMaximum = val.ExclusiveMaximum v.Minimum = val.Minimum v.ExclusiveMinimum = val.ExclusiveMinimum v.MaxLength = val.MaxLength v.MinLength = val.MinLength v.Pattern = val.Pattern v.MaxItems = val.MaxItems v.MinItems = val.MinItems v.UniqueItems = val.UniqueItems v.MultipleOf = val.MultipleOf v.Enum = val.Enum } type clearedValidation struct { Validation string Value interface{} } type clearedValidations []clearedValidation func (c clearedValidations) apply(cbs []func(string, interface{})) { for _, cb := range cbs { for _, cleared := range c { cb(cleared.Validation, cleared.Value) } } } // ClearNumberValidations clears all number validations. // // Some callbacks may be set by the caller to capture changed values. func (v *CommonValidations) ClearNumberValidations(cbs ...func(string, interface{})) { done := make(clearedValidations, 0, 5) defer func() { done.apply(cbs) }() if v.Minimum != nil { done = append(done, clearedValidation{Validation: "minimum", Value: v.Minimum}) v.Minimum = nil } if v.Maximum != nil { done = append(done, clearedValidation{Validation: "maximum", Value: v.Maximum}) v.Maximum = nil } if v.ExclusiveMaximum { done = append(done, clearedValidation{Validation: "exclusiveMaximum", Value: v.ExclusiveMaximum}) v.ExclusiveMaximum = false } if v.ExclusiveMinimum { done = append(done, clearedValidation{Validation: "exclusiveMinimum", Value: v.ExclusiveMinimum}) v.ExclusiveMinimum = false } if v.MultipleOf != nil { done = append(done, clearedValidation{Validation: "multipleOf", Value: v.MultipleOf}) v.MultipleOf = nil } } // ClearStringValidations clears all string validations. // // Some callbacks may be set by the caller to capture changed values. func (v *CommonValidations) ClearStringValidations(cbs ...func(string, interface{})) { done := make(clearedValidations, 0, 3) defer func() { done.apply(cbs) }() if v.Pattern != "" { done = append(done, clearedValidation{Validation: "pattern", Value: v.Pattern}) v.Pattern = "" } if v.MinLength != nil { done = append(done, clearedValidation{Validation: "minLength", Value: v.MinLength}) v.MinLength = nil } if v.MaxLength != nil { done = append(done, clearedValidation{Validation: "maxLength", Value: v.MaxLength}) v.MaxLength = nil } } // ClearArrayValidations clears all array validations. // // Some callbacks may be set by the caller to capture changed values. func (v *CommonValidations) ClearArrayValidations(cbs ...func(string, interface{})) { done := make(clearedValidations, 0, 3) defer func() { done.apply(cbs) }() if v.MaxItems != nil { done = append(done, clearedValidation{Validation: "maxItems", Value: v.MaxItems}) v.MaxItems = nil } if v.MinItems != nil { done = append(done, clearedValidation{Validation: "minItems", Value: v.MinItems}) v.MinItems = nil } if v.UniqueItems { done = append(done, clearedValidation{Validation: "uniqueItems", Value: v.UniqueItems}) v.UniqueItems = false } } // Validations returns a clone of the validations for a simple schema. // // NOTE: in the context of simple schema objects, MinProperties, MaxProperties // and PatternProperties remain unset. func (v CommonValidations) Validations() SchemaValidations { return SchemaValidations{ CommonValidations: v, } } // HasNumberValidations indicates if the validations are for numbers or integers func (v CommonValidations) HasNumberValidations() bool { return v.Maximum != nil || v.Minimum != nil || v.MultipleOf != nil } // HasStringValidations indicates if the validations are for strings func (v CommonValidations) HasStringValidations() bool { return v.MaxLength != nil || v.MinLength != nil || v.Pattern != "" } // HasArrayValidations indicates if the validations are for arrays func (v CommonValidations) HasArrayValidations() bool { return v.MaxItems != nil || v.MinItems != nil || v.UniqueItems } // HasEnum indicates if the validation includes some enum constraint func (v CommonValidations) HasEnum() bool { return len(v.Enum) > 0 } // SchemaValidations describes the validation properties of a schema // // NOTE: at this moment, this is not embedded in SchemaProps because this would induce a breaking change // in the exported members: all initializers using litterals would fail. type SchemaValidations struct { CommonValidations PatternProperties SchemaProperties `json:"patternProperties,omitempty"` MaxProperties *int64 `json:"maxProperties,omitempty"` MinProperties *int64 `json:"minProperties,omitempty"` } // HasObjectValidations indicates if the validations are for objects func (v SchemaValidations) HasObjectValidations() bool { return v.MaxProperties != nil || v.MinProperties != nil || v.PatternProperties != nil } // SetValidations for schema validations func (v *SchemaValidations) SetValidations(val SchemaValidations) { v.CommonValidations.SetValidations(val) v.PatternProperties = val.PatternProperties v.MaxProperties = val.MaxProperties v.MinProperties = val.MinProperties } // Validations for a schema func (v SchemaValidations) Validations() SchemaValidations { val := v.CommonValidations.Validations() val.PatternProperties = v.PatternProperties val.MinProperties = v.MinProperties val.MaxProperties = v.MaxProperties return val } // ClearObjectValidations returns a clone of the validations with all object validations cleared. // // Some callbacks may be set by the caller to capture changed values. func (v *SchemaValidations) ClearObjectValidations(cbs ...func(string, interface{})) { done := make(clearedValidations, 0, 3) defer func() { done.apply(cbs) }() if v.MaxProperties != nil { done = append(done, clearedValidation{Validation: "maxProperties", Value: v.MaxProperties}) v.MaxProperties = nil } if v.MinProperties != nil { done = append(done, clearedValidation{Validation: "minProperties", Value: v.MinProperties}) v.MinProperties = nil } if v.PatternProperties != nil { done = append(done, clearedValidation{Validation: "patternProperties", Value: v.PatternProperties}) v.PatternProperties = nil } } spec-0.21.0/validations_test.go000066400000000000000000000057151457312531500164450ustar00rootroot00000000000000package spec import ( "testing" "github.com/go-openapi/swag" "github.com/stretchr/testify/require" ) func mkVal() SchemaValidations { return SchemaValidations{ CommonValidations: CommonValidations{ Maximum: swag.Float64(2.5), ExclusiveMaximum: true, Minimum: swag.Float64(3.4), ExclusiveMinimum: true, MaxLength: swag.Int64(15), MinLength: swag.Int64(16), Pattern: "abc", MaxItems: swag.Int64(17), MinItems: swag.Int64(18), UniqueItems: true, MultipleOf: swag.Float64(4.4), Enum: []interface{}{"a", 12.5}, }, PatternProperties: SchemaProperties{ "x": *BooleanProperty(), "y": *BooleanProperty(), }, MinProperties: swag.Int64(19), MaxProperties: swag.Int64(20), } } func TestValidations(t *testing.T) { var cv CommonValidations val := mkVal() cv.SetValidations(val) expectedCV := val.CommonValidations require.EqualValues(t, expectedCV, cv) require.True(t, cv.HasArrayValidations()) require.True(t, cv.HasNumberValidations()) require.True(t, cv.HasStringValidations()) require.True(t, cv.HasEnum()) cv.Enum = nil require.False(t, cv.HasEnum()) cv.MaxLength = nil require.True(t, cv.HasStringValidations()) cv.MinLength = nil require.True(t, cv.HasStringValidations()) cv.Pattern = "" require.False(t, cv.HasStringValidations()) cv.Minimum = nil require.True(t, cv.HasNumberValidations()) cv.Maximum = nil require.True(t, cv.HasNumberValidations()) cv.MultipleOf = nil require.False(t, cv.HasNumberValidations()) cv.MaxItems = nil require.True(t, cv.HasArrayValidations()) cv.MinItems = nil require.True(t, cv.HasArrayValidations()) cv.UniqueItems = false require.False(t, cv.HasArrayValidations()) val = mkVal() expectedSV := val expectedSV.PatternProperties = nil expectedSV.MinProperties = nil expectedSV.MaxProperties = nil val = mkVal() cv.SetValidations(val) require.EqualValues(t, expectedSV, cv.Validations()) var sv SchemaValidations val = mkVal() sv.SetValidations(val) expectedSV = val require.EqualValues(t, expectedSV, sv) require.EqualValues(t, val, sv.Validations()) require.True(t, sv.HasObjectValidations()) sv.MinProperties = nil require.True(t, sv.HasObjectValidations()) sv.MaxProperties = nil require.True(t, sv.HasObjectValidations()) sv.PatternProperties = nil require.False(t, sv.HasObjectValidations()) val = mkVal() cv.SetValidations(val) cv.ClearStringValidations() require.False(t, cv.HasStringValidations()) cv.ClearNumberValidations() require.False(t, cv.HasNumberValidations()) cv.ClearArrayValidations() require.False(t, cv.HasArrayValidations()) sv.SetValidations(val) sv.ClearObjectValidations(func(validation string, _ interface{}) { switch validation { case "minProperties", "maxProperties", "patternProperties": return default: t.Logf("unexpected validation %s", validation) t.Fail() } }) require.Falsef(t, sv.HasObjectValidations(), "%#v", sv) } spec-0.21.0/xml_object.go000066400000000000000000000036661457312531500152220ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec // XMLObject a metadata object that allows for more fine-tuned XML model definitions. // // For more information: http://goo.gl/8us55a#xmlObject type XMLObject struct { Name string `json:"name,omitempty"` Namespace string `json:"namespace,omitempty"` Prefix string `json:"prefix,omitempty"` Attribute bool `json:"attribute,omitempty"` Wrapped bool `json:"wrapped,omitempty"` } // WithName sets the xml name for the object func (x *XMLObject) WithName(name string) *XMLObject { x.Name = name return x } // WithNamespace sets the xml namespace for the object func (x *XMLObject) WithNamespace(namespace string) *XMLObject { x.Namespace = namespace return x } // WithPrefix sets the xml prefix for the object func (x *XMLObject) WithPrefix(prefix string) *XMLObject { x.Prefix = prefix return x } // AsAttribute flags this object as xml attribute func (x *XMLObject) AsAttribute() *XMLObject { x.Attribute = true return x } // AsElement flags this object as an xml node func (x *XMLObject) AsElement() *XMLObject { x.Attribute = false return x } // AsWrapped flags this object as wrapped, this is mostly useful for array types func (x *XMLObject) AsWrapped() *XMLObject { x.Wrapped = true return x } // AsUnwrapped flags this object as an xml node func (x *XMLObject) AsUnwrapped() *XMLObject { x.Wrapped = false return x } spec-0.21.0/xml_object_test.go000066400000000000000000000036661457312531500162610ustar00rootroot00000000000000// Copyright 2015 go-swagger maintainers // // 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 spec import ( "encoding/json" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestXmlObject_Serialize(t *testing.T) { obj1 := XMLObject{} actual, err := json.Marshal(obj1) require.NoError(t, err) assert.Equal(t, "{}", string(actual)) obj2 := XMLObject{ Name: "the name", Namespace: "the namespace", Prefix: "the prefix", Attribute: true, Wrapped: true, } actual, err = json.Marshal(obj2) require.NoError(t, err) var ad map[string]interface{} require.NoError(t, json.Unmarshal(actual, &ad)) assert.Equal(t, obj2.Name, ad["name"]) assert.Equal(t, obj2.Namespace, ad["namespace"]) assert.Equal(t, obj2.Prefix, ad["prefix"]) assert.True(t, ad["attribute"].(bool)) assert.True(t, ad["wrapped"].(bool)) } func TestXmlObject_Deserialize(t *testing.T) { expected := XMLObject{} actual := XMLObject{} require.NoError(t, json.Unmarshal([]byte("{}"), &actual)) assert.Equal(t, expected, actual) completed := `{"name":"the name","namespace":"the namespace","prefix":"the prefix","attribute":true,"wrapped":true}` expected = XMLObject{ Name: "the name", Namespace: "the namespace", Prefix: "the prefix", Attribute: true, Wrapped: true, } actual = XMLObject{} require.NoError(t, json.Unmarshal([]byte(completed), &actual)) assert.Equal(t, expected, actual) }