From e2f1bdc3729b44dce56f2b9b8043b8dba668f705 Mon Sep 17 00:00:00 2001 From: Cheng Xing Date: Mon, 19 Nov 2018 14:10:50 -0800 Subject: [PATCH] Bumping k8s version to 1.13.0-beta.1 --- Gopkg.lock | 138 +- Gopkg.toml | 11 +- .../github.com/PuerkitoBio/purell/.gitignore | 5 - .../github.com/PuerkitoBio/purell/.travis.yml | 7 - vendor/github.com/PuerkitoBio/purell/LICENSE | 12 - .../github.com/PuerkitoBio/purell/README.md | 187 - .../PuerkitoBio/purell/bench_test.go | 57 - .../PuerkitoBio/purell/benchmarks/v0.1.0 | 9 - .../PuerkitoBio/purell/example_test.go | 35 - .../github.com/PuerkitoBio/purell/purell.go | 379 - .../PuerkitoBio/purell/purell_test.go | 768 - .../PuerkitoBio/purell/urlnorm_test.go | 53 - .../github.com/PuerkitoBio/urlesc/.travis.yml | 15 - vendor/github.com/PuerkitoBio/urlesc/LICENSE | 27 - .../github.com/PuerkitoBio/urlesc/README.md | 16 - .../github.com/PuerkitoBio/urlesc/urlesc.go | 180 - .../PuerkitoBio/urlesc/urlesc_test.go | 641 - .../github.com/emicklei/go-restful/.gitignore | 70 - .../emicklei/go-restful/.travis.yml | 6 - .../github.com/emicklei/go-restful/CHANGES.md | 242 - vendor/github.com/emicklei/go-restful/LICENSE | 22 - .../github.com/emicklei/go-restful/Makefile | 7 - .../github.com/emicklei/go-restful/README.md | 88 - vendor/github.com/emicklei/go-restful/Srcfile | 1 - .../emicklei/go-restful/bench_curly_test.go | 51 - .../emicklei/go-restful/bench_test.go | 43 - .../emicklei/go-restful/bench_test.sh | 10 - .../emicklei/go-restful/compress.go | 123 - .../emicklei/go-restful/compress_test.go | 125 - .../emicklei/go-restful/compressor_cache.go | 103 - .../emicklei/go-restful/compressor_pools.go | 91 - .../emicklei/go-restful/compressors.go | 54 - .../emicklei/go-restful/constants.go | 30 - .../emicklei/go-restful/container.go | 371 - .../emicklei/go-restful/container_test.go | 83 - .../emicklei/go-restful/cors_filter.go | 202 - .../emicklei/go-restful/cors_filter_test.go | 129 - .../emicklei/go-restful/coverage.sh | 2 - .../github.com/emicklei/go-restful/curly.go | 164 - .../emicklei/go-restful/curly_route.go | 52 - .../emicklei/go-restful/curly_test.go | 238 - vendor/github.com/emicklei/go-restful/doc.go | 185 - .../emicklei/go-restful/doc_examples_test.go | 41 - .../emicklei/go-restful/entity_accessors.go | 162 - .../go-restful/entity_accessors_test.go | 69 - .../emicklei/go-restful/examples/.goconvey | 1 - .../examples/google_app_engine/.goconvey | 1 - .../examples/google_app_engine/app.yaml | 20 - .../google_app_engine/datastore/.goconvey | 1 - .../google_app_engine/datastore/app.yaml | 18 - .../google_app_engine/datastore/main.go | 267 - .../restful-appstats-integration.go | 12 - .../google_app_engine/restful-user-service.go | 162 - .../emicklei/go-restful/examples/home.html | 7 - .../examples/msgpack/msgpack_entity.go | 34 - .../examples/msgpack/msgpack_entity_test.go | 160 - .../examples/restful-CORS-filter.go | 68 - .../examples/restful-NCSA-logging.go | 54 - .../examples/restful-basic-authentication.go | 35 - .../examples/restful-cpuprofiler-service.go | 65 - .../examples/restful-curly-router.go | 107 - .../examples/restful-curly-router_test.go | 149 - .../examples/restful-encoding-filter.go | 61 - .../go-restful/examples/restful-filters.go | 114 - .../examples/restful-form-handling.go | 63 - .../examples/restful-hello-world.go | 23 - .../examples/restful-html-template.go | 35 - .../examples/restful-multi-containers.go | 43 - .../examples/restful-no-cache-filter.go | 25 - .../go-restful/examples/restful-openapi.go | 178 - .../examples/restful-options-filter.go | 51 - .../go-restful/examples/restful-path-tail.go | 27 - .../examples/restful-pre-post-filters.go | 98 - .../examples/restful-resource-functions.go | 63 - .../go-restful/examples/restful-route_test.go | 39 - .../examples/restful-routefunction_test.go | 29 - .../examples/restful-serve-static.go | 47 - .../go-restful/examples/restful-swagger.go | 61 - .../examples/restful-user-resource.go | 169 - .../github.com/emicklei/go-restful/filter.go | 35 - .../emicklei/go-restful/filter_test.go | 141 - vendor/github.com/emicklei/go-restful/json.go | 11 - .../emicklei/go-restful/jsoniter.go | 12 - .../github.com/emicklei/go-restful/jsr311.go | 293 - .../emicklei/go-restful/jsr311_test.go | 332 - .../github.com/emicklei/go-restful/log/log.go | 34 - .../github.com/emicklei/go-restful/logger.go | 32 - vendor/github.com/emicklei/go-restful/mime.go | 45 - .../emicklei/go-restful/mime_test.go | 17 - .../emicklei/go-restful/options_filter.go | 34 - .../go-restful/options_filter_test.go | 34 - .../emicklei/go-restful/parameter.go | 143 - .../emicklei/go-restful/path_expression.go | 74 - .../go-restful/path_expression_test.go | 45 - .../emicklei/go-restful/path_processor.go | 63 - .../go-restful/path_processor_test.go | 55 - .../github.com/emicklei/go-restful/request.go | 118 - .../emicklei/go-restful/request_test.go | 155 - .../emicklei/go-restful/response.go | 250 - .../emicklei/go-restful/response_test.go | 213 - .../github.com/emicklei/go-restful/route.go | 149 - .../emicklei/go-restful/route_builder.go | 321 - .../emicklei/go-restful/route_builder_test.go | 76 - .../emicklei/go-restful/route_test.go | 76 - .../github.com/emicklei/go-restful/router.go | 20 - .../emicklei/go-restful/service_error.go | 23 - .../emicklei/go-restful/tracer_test.go | 18 - .../emicklei/go-restful/web_service.go | 290 - .../go-restful/web_service_container.go | 39 - .../emicklei/go-restful/web_service_test.go | 343 - vendor/github.com/ghodss/yaml/.travis.yml | 7 - .../go-openapi/jsonpointer/.editorconfig | 26 - .../jsonpointer/.github/CONTRIBUTING.md | 117 - .../go-openapi/jsonpointer/.gitignore | 1 - .../go-openapi/jsonpointer/.travis.yml | 15 - .../go-openapi/jsonpointer/CODE_OF_CONDUCT.md | 74 - .../github.com/go-openapi/jsonpointer/LICENSE | 202 - .../go-openapi/jsonpointer/README.md | 15 - .../github.com/go-openapi/jsonpointer/go.mod | 10 - .../github.com/go-openapi/jsonpointer/go.sum | 11 - .../go-openapi/jsonpointer/pointer.go | 390 - .../go-openapi/jsonpointer/pointer_test.go | 573 - .../jsonreference/.github/CONTRIBUTING.md | 117 - .../go-openapi/jsonreference/.gitignore | 1 - .../go-openapi/jsonreference/.travis.yml | 16 - .../jsonreference/CODE_OF_CONDUCT.md | 74 - .../go-openapi/jsonreference/LICENSE | 202 - .../go-openapi/jsonreference/README.md | 15 - .../go-openapi/jsonreference/go.mod | 15 - .../go-openapi/jsonreference/go.sum | 20 - .../go-openapi/jsonreference/reference.go | 156 - .../jsonreference/reference_test.go | 420 - .../github.com/go-openapi/spec/.editorconfig | 26 - .../go-openapi/spec/.github/CONTRIBUTING.md | 117 - vendor/github.com/go-openapi/spec/.gitignore | 2 - .../github.com/go-openapi/spec/.golangci.yml | 21 - vendor/github.com/go-openapi/spec/.travis.yml | 18 - .../go-openapi/spec/CODE_OF_CONDUCT.md | 74 - vendor/github.com/go-openapi/spec/LICENSE | 202 - vendor/github.com/go-openapi/spec/README.md | 10 - .../github.com/go-openapi/spec/auth_test.go | 128 - vendor/github.com/go-openapi/spec/bindata.go | 260 - .../go-openapi/spec/contact_info.go | 24 - .../go-openapi/spec/contact_info_test.go | 37 - vendor/github.com/go-openapi/spec/debug.go | 47 - .../github.com/go-openapi/spec/debug_test.go | 59 - vendor/github.com/go-openapi/spec/expander.go | 1227 - .../go-openapi/spec/expander_test.go | 1799 - .../go-openapi/spec/external_docs.go | 24 - .../go-openapi/spec/external_docs_test.go | 29 - .../bugs/1429/remote/farther/farther.yaml | 5 - .../fixtures/bugs/1429/remote/remote.yaml | 11 - .../bugs/1429/remote/remote/remote.yaml | 5 - .../spec/fixtures/bugs/1429/responses.yaml | 104 - .../spec/fixtures/bugs/1429/swagger.yaml | 39 - .../spec/fixtures/bugs/1614/gitea.json | 7916 ---- .../spec/fixtures/bugs/1621/definitions.yaml | 618 - .../spec/fixtures/bugs/1621/fixture-1621.yaml | 1310 - .../spec/fixtures/bugs/1621/parameters.yaml | 61 - .../spec/fixtures/bugs/1621/responses.yaml | 13 - .../spec/fixtures/bugs/69/dapperbox.json | 38329 ---------------- .../spec/fixtures/bugs/957/fixture-957.json | 3713 -- .../fixtures/expansion/all-the-things.json | 254 - .../fixtures/expansion/circular-minimal.json | 58 - .../spec/fixtures/expansion/circularRefs.json | 54 - .../spec/fixtures/expansion/circularSpec.json | 1 - .../spec/fixtures/expansion/circularSpec.yaml | 67 - .../fixtures/expansion/circularSpec2.json | 330 - .../spec/fixtures/expansion/clickmeter.json | 1 - .../spec/fixtures/expansion/clickmeter.yaml | 6461 --- .../spec/fixtures/expansion/invalid-refs.json | 85 - .../fixtures/expansion/missingItemRef.json | 31 - .../spec/fixtures/expansion/missingRef.json | 165 - .../spec/fixtures/expansion/overflow.json | 124 - .../spec/fixtures/expansion/params.json | 25 - .../spec/fixtures/expansion/schemas1.json | 127 - .../spec/fixtures/expansion/schemas2.json | 161 - .../spec/fixtures/local_expansion/item.json | 18 - .../spec/fixtures/local_expansion/item2.yaml | 12 - .../spec/fixtures/local_expansion/spec.json | 46 - .../spec/fixtures/local_expansion/spec2.yaml | 30 - .../fixtures/more_circulars/bitbucket.json | 8322 ---- .../spec/fixtures/more_circulars/item.json | 23 - .../spec/fixtures/more_circulars/item2.json | 23 - .../spec/fixtures/more_circulars/item4.json | 23 - .../spec/fixtures/more_circulars/spec.json | 57 - .../spec/fixtures/more_circulars/spec2.json | 57 - .../spec/fixtures/more_circulars/spec3.json | 51 - .../spec/fixtures/more_circulars/spec4.json | 59 - .../spec/fixtures/remote/all-the-things.json | 245 - .../spec/fixtures/remote/pet/pet.json | 42 - .../spec/fixtures/specs/deeper/arrayProp.json | 6 - .../fixtures/specs/deeper/stringProp.json | 3 - .../go-openapi/spec/fixtures/specs/refed.json | 224 - .../spec/fixtures/specs/resolution.json | 14 - .../spec/fixtures/specs/resolution2.json | 9 - .../spec/fixtures/specs/todos.common.json | 103 - .../go-openapi/spec/fixtures/specs/todos.json | 346 - vendor/github.com/go-openapi/spec/go.mod | 16 - vendor/github.com/go-openapi/spec/go.sum | 22 - vendor/github.com/go-openapi/spec/header.go | 193 - .../github.com/go-openapi/spec/header_test.go | 126 - vendor/github.com/go-openapi/spec/info.go | 168 - .../github.com/go-openapi/spec/info_test.go | 65 - vendor/github.com/go-openapi/spec/items.go | 233 - .../github.com/go-openapi/spec/items_test.go | 141 - vendor/github.com/go-openapi/spec/license.go | 23 - .../go-openapi/spec/license_test.go | 28 - .../github.com/go-openapi/spec/operation.go | 259 - .../go-openapi/spec/operation_test.go | 107 - .../github.com/go-openapi/spec/parameter.go | 302 - .../go-openapi/spec/parameters_test.go | 156 - .../github.com/go-openapi/spec/path_item.go | 90 - .../go-openapi/spec/path_item_test.go | 81 - vendor/github.com/go-openapi/spec/paths.go | 97 - .../github.com/go-openapi/spec/paths_test.go | 43 - .../go-openapi/spec/properties_test.go | 58 - vendor/github.com/go-openapi/spec/ref.go | 167 - vendor/github.com/go-openapi/spec/response.go | 134 - .../go-openapi/spec/response_test.go | 90 - .../github.com/go-openapi/spec/responses.go | 127 - vendor/github.com/go-openapi/spec/schema.go | 636 - .../github.com/go-openapi/spec/schema_test.go | 212 - .../spec/schemas/jsonschema-draft-04.json | 149 - .../go-openapi/spec/schemas/v2/README.md | 5 - .../go-openapi/spec/schemas/v2/schema.json | 1607 - .../go-openapi/spec/security_scheme.go | 143 - vendor/github.com/go-openapi/spec/spec.go | 86 - .../github.com/go-openapi/spec/spec_test.go | 269 - .../go-openapi/spec/structs_test.go | 116 - vendor/github.com/go-openapi/spec/swagger.go | 318 - .../go-openapi/spec/swagger_test.go | 389 - vendor/github.com/go-openapi/spec/tag.go | 74 - .../github.com/go-openapi/spec/xml_object.go | 68 - .../go-openapi/spec/xml_object_test.go | 65 - .../github.com/go-openapi/swag/.editorconfig | 26 - .../go-openapi/swag/.github/CONTRIBUTING.md | 117 - vendor/github.com/go-openapi/swag/.gitignore | 3 - .../github.com/go-openapi/swag/.golangci.yml | 20 - vendor/github.com/go-openapi/swag/.travis.yml | 16 - .../go-openapi/swag/CODE_OF_CONDUCT.md | 74 - vendor/github.com/go-openapi/swag/LICENSE | 202 - vendor/github.com/go-openapi/swag/README.md | 23 - vendor/github.com/go-openapi/swag/convert.go | 207 - .../go-openapi/swag/convert_test.go | 216 - .../go-openapi/swag/convert_types.go | 595 - .../go-openapi/swag/convert_types_test.go | 703 - vendor/github.com/go-openapi/swag/doc.go | 33 - vendor/github.com/go-openapi/swag/go.mod | 9 - vendor/github.com/go-openapi/swag/go.sum | 9 - vendor/github.com/go-openapi/swag/json.go | 311 - .../github.com/go-openapi/swag/json_test.go | 169 - vendor/github.com/go-openapi/swag/loading.go | 80 - .../go-openapi/swag/loading_test.go | 47 - vendor/github.com/go-openapi/swag/net.go | 24 - vendor/github.com/go-openapi/swag/net_test.go | 30 - vendor/github.com/go-openapi/swag/path.go | 59 - .../github.com/go-openapi/swag/path_test.go | 118 - .../github.com/go-openapi/swag/post_go18.go | 9 - .../github.com/go-openapi/swag/post_go19.go | 53 - vendor/github.com/go-openapi/swag/pre_go18.go | 9 - vendor/github.com/go-openapi/swag/pre_go19.go | 55 - vendor/github.com/go-openapi/swag/util.go | 405 - .../github.com/go-openapi/swag/util_test.go | 375 - vendor/github.com/go-openapi/swag/yaml.go | 228 - .../github.com/go-openapi/swag/yaml_test.go | 445 - vendor/github.com/mailru/easyjson/.gitignore | 5 - vendor/github.com/mailru/easyjson/.travis.yml | 9 - vendor/github.com/mailru/easyjson/LICENSE | 7 - vendor/github.com/mailru/easyjson/Makefile | 61 - vendor/github.com/mailru/easyjson/README.md | 333 - .../mailru/easyjson/benchmark/codec_test.go | 279 - .../mailru/easyjson/benchmark/data.go | 148 - .../mailru/easyjson/benchmark/data_codec.go | 6914 --- .../mailru/easyjson/benchmark/data_ffjson.go | 6723 --- .../mailru/easyjson/benchmark/data_var.go | 350 - .../mailru/easyjson/benchmark/default_test.go | 118 - .../mailru/easyjson/benchmark/dummy_test.go | 11 - .../easyjson/benchmark/easyjson_test.go | 184 - .../mailru/easyjson/benchmark/example.json | 415 - .../mailru/easyjson/benchmark/ffjson_test.go | 190 - .../easyjson/benchmark/jsoniter_test.go | 119 - .../mailru/easyjson/benchmark/ujson.sh | 7 - .../mailru/easyjson/bootstrap/bootstrap.go | 193 - .../github.com/mailru/easyjson/buffer/pool.go | 270 - .../mailru/easyjson/buffer/pool_test.go | 107 - .../mailru/easyjson/easyjson/main.go | 108 - .../github.com/mailru/easyjson/gen/decoder.go | 515 - .../github.com/mailru/easyjson/gen/encoder.go | 399 - .../mailru/easyjson/gen/generator.go | 533 - .../mailru/easyjson/gen/generator_test.go | 87 - vendor/github.com/mailru/easyjson/helpers.go | 78 - .../mailru/easyjson/jlexer/bytestostr.go | 24 - .../easyjson/jlexer/bytestostr_nounsafe.go | 13 - .../mailru/easyjson/jlexer/error.go | 15 - .../mailru/easyjson/jlexer/lexer.go | 1181 - .../mailru/easyjson/jlexer/lexer_test.go | 333 - .../mailru/easyjson/jwriter/writer.go | 390 - .../mailru/easyjson/opt/gotemplate_Bool.go | 79 - .../mailru/easyjson/opt/gotemplate_Float32.go | 79 - .../mailru/easyjson/opt/gotemplate_Float64.go | 79 - .../mailru/easyjson/opt/gotemplate_Int.go | 79 - .../mailru/easyjson/opt/gotemplate_Int16.go | 79 - .../mailru/easyjson/opt/gotemplate_Int32.go | 79 - .../mailru/easyjson/opt/gotemplate_Int64.go | 79 - .../mailru/easyjson/opt/gotemplate_Int8.go | 79 - .../mailru/easyjson/opt/gotemplate_String.go | 79 - .../mailru/easyjson/opt/gotemplate_Uint.go | 79 - .../mailru/easyjson/opt/gotemplate_Uint16.go | 79 - .../mailru/easyjson/opt/gotemplate_Uint32.go | 79 - .../mailru/easyjson/opt/gotemplate_Uint64.go | 79 - .../mailru/easyjson/opt/gotemplate_Uint8.go | 79 - .../mailru/easyjson/opt/optional/opt.go | 80 - vendor/github.com/mailru/easyjson/opt/opts.go | 22 - .../mailru/easyjson/parser/parser.go | 98 - .../mailru/easyjson/parser/pkgpath.go | 163 - vendor/github.com/mailru/easyjson/raw.go | 45 - .../mailru/easyjson/tests/basic_test.go | 244 - .../easyjson/tests/custom_map_key_type.go | 29 - .../github.com/mailru/easyjson/tests/data.go | 802 - .../mailru/easyjson/tests/disallow_unknown.go | 8 - .../mailru/easyjson/tests/embedded_type.go | 24 - .../mailru/easyjson/tests/errors.go | 26 - .../mailru/easyjson/tests/errors_test.go | 285 - .../mailru/easyjson/tests/named_type.go | 22 - .../mailru/easyjson/tests/nested_easy.go | 25 - .../mailru/easyjson/tests/nothing.go | 3 - .../mailru/easyjson/tests/omitempty.go | 12 - .../mailru/easyjson/tests/opt_test.go | 70 - .../mailru/easyjson/tests/required_test.go | 28 - .../github.com/mailru/easyjson/tests/snake.go | 10 - vendor/golang.org/x/sys/unix/mkerrors.sh | 2 + .../x/sys/unix/zerrors_linux_386.go | 34 + .../x/sys/unix/zerrors_linux_amd64.go | 34 + .../x/sys/unix/zerrors_linux_arm.go | 34 + .../x/sys/unix/zerrors_linux_arm64.go | 34 + .../x/sys/unix/zerrors_linux_mips.go | 34 + .../x/sys/unix/zerrors_linux_mips64.go | 34 + .../x/sys/unix/zerrors_linux_mips64le.go | 34 + .../x/sys/unix/zerrors_linux_mipsle.go | 34 + .../x/sys/unix/zerrors_linux_ppc64.go | 34 + .../x/sys/unix/zerrors_linux_ppc64le.go | 34 + .../x/sys/unix/zerrors_linux_riscv64.go | 34 + .../x/sys/unix/zerrors_linux_s390x.go | 34 + .../analysis/internal/analysisflags/help.go | 2 +- .../go/analysis/passes/composite/composite.go | 2 +- .../analysis/passes/lostcancel/lostcancel.go | 109 +- .../analysis/passes/stdmethods/stdmethods.go | 8 +- .../passes/stdmethods/testdata/src/a/a.go | 4 + .../go/analysis/passes/unsafeptr/unsafeptr.go | 44 +- .../{cmd/vet-lite => unitchecker}/main.go | 26 +- .../go/analysis/unitchecker/unitchecker.go | 2 +- .../tools/go/packages/packagestest/expect.go | 5 + .../tools/go/packages/packagestest/export.go | 2 +- .../golang.org/x/tools/go/ssa/source_test.go | 41 +- .../x/tools/go/ssa/testdata/valueforexpr.go | 11 +- .../x/tools/internal/lsp/lsp_test.go | 208 +- .../x/tools/internal/lsp/position.go | 8 +- .../x/tools/internal/lsp/protocol/printers.go | 23 +- .../golang.org/x/tools/internal/lsp/server.go | 2 +- .../x/tools/internal/lsp/source/definition.go | 34 +- .../x/tools/internal/lsp/testdata/bad/bad.go | 5 +- .../internal/lsp/testdata/bad/bad_util.go | 2 - .../tools/internal/lsp/testdata/godef/a/a.go | 11 + .../internal/lsp/testdata/godef/a/random.go | 23 + .../tools/internal/lsp/testdata/godef/b/b.go | 23 + .../tools/internal/lsp/testdata/godef/b/c.go | 8 + .../internal/lsp/testdata/godef/b/c.go.saved | 7 + .../testdata/godef/broken/unclosedIf.go.in | 11 + .../noparse_format/noparse_format.1_10.go.in | 11 + vendor/k8s.io/api/Godeps/Godeps.json | 98 +- .../api/authentication/v1/generated.pb.go | 217 +- .../api/authentication/v1/generated.proto | 20 + vendor/k8s.io/api/authentication/v1/types.go | 18 + .../v1/types_swagger_doc_generated.go | 6 +- .../v1/zz_generated.deepcopy.go | 12 +- .../authentication/v1beta1/generated.pb.go | 186 +- .../authentication/v1beta1/generated.proto | 20 + .../api/authentication/v1beta1/types.go | 18 + .../v1beta1/types_swagger_doc_generated.go | 6 +- .../v1beta1/zz_generated.deepcopy.go | 12 +- vendor/k8s.io/api/core/v1/generated.pb.go | 2120 +- vendor/k8s.io/api/core/v1/generated.proto | 32 +- vendor/k8s.io/api/core/v1/types.go | 32 +- .../core/v1/types_swagger_doc_generated.go | 18 +- .../api/core/v1/zz_generated.deepcopy.go | 25 +- vendor/k8s.io/api/storage/v1/generated.pb.go | 1369 +- vendor/k8s.io/api/storage/v1/generated.proto | 96 + vendor/k8s.io/api/storage/v1/register.go | 3 + vendor/k8s.io/api/storage/v1/types.go | 107 + .../storage/v1/types_swagger_doc_generated.go | 63 + .../api/storage/v1/zz_generated.deepcopy.go | 149 + .../Godeps/Godeps.json | 808 +- .../versioned/typed/cr/v1/example.go | 17 + vendor/k8s.io/apiextensions-apiserver/main.go | 4 +- .../pkg/apis/apiextensions/types.go | 32 +- .../apis/apiextensions/v1beta1/defaults.go | 18 +- .../apiextensions/v1beta1/generated.pb.go | 562 +- .../apiextensions/v1beta1/generated.proto | 32 +- .../pkg/apis/apiextensions/v1beta1/types.go | 29 +- .../v1beta1/zz_generated.conversion.go | 46 +- .../v1beta1/zz_generated.deepcopy.go | 19 +- .../apiextensions/validation/validation.go | 159 +- .../validation/validation_test.go | 192 +- .../apiextensions/zz_generated.deepcopy.go | 19 +- .../pkg/apiserver/apiserver.go | 13 +- .../pkg/apiserver/conversion/converter.go | 67 +- .../pkg/apiserver/conversion/nop_converter.go | 6 +- .../apiserver/conversion/webhook_converter.go | 350 + .../customresource_discovery_controller.go | 24 +- .../pkg/apiserver/customresource_handler.go | 71 +- .../apiserver/customresource_handler_test.go | 14 +- .../pkg/apiserver/helpers.go | 117 + .../v1beta1/customresourcedefinition.go | 17 + .../customresourcedefinition.go | 17 + .../pkg/cmd/server/options/options.go | 22 +- .../establish/establishing_controller.go | 6 +- .../pkg/controller/finalizer/crd_finalizer.go | 8 +- .../controller/status/naming_controller.go | 16 +- .../pkg/features/kube_features.go | 2 +- .../customresourcedefinition/strategy.go | 52 + .../test/integration/fixtures/resources.go | 12 +- .../test/integration/helpers.go | 100 +- .../test/integration/subresources_test.go | 1078 +- .../test/integration/table_test.go | 314 +- .../test/integration/validation_test.go | 591 +- .../test/integration/versioning_test.go | 2 +- .../test/integration/yaml_test.go | 8 +- vendor/k8s.io/apimachinery/Godeps/Godeps.json | 32 +- .../k8s.io/apimachinery/pkg/api/meta/meta.go | 10 +- .../pkg/apis/meta/v1/duration_test.go | 2 +- .../pkg/apis/meta/v1/micro_time_test.go | 2 +- .../pkg/apis/meta/v1/time_test.go | 2 +- .../apimachinery/pkg/labels/selector.go | 8 +- .../apimachinery/pkg/runtime/converter.go | 10 +- .../pkg/runtime/serializer/codec_test.go | 2 +- .../pkg/runtime/serializer/json/json.go | 2 +- .../pkg/util/httpstream/spdy/connection.go | 4 +- .../apimachinery/pkg/util/intstr/intstr.go | 4 +- .../pkg/util/intstr/intstr_test.go | 2 +- .../pkg/util/jsonmergepatch/patch_test.go | 2 +- .../apimachinery/pkg/util/mergepatch/util.go | 2 +- .../k8s.io/apimachinery/pkg/util/net/http.go | 8 +- .../apimachinery/pkg/util/net/interface.go | 38 +- .../apimachinery/pkg/util/proxy/dial.go | 8 +- .../apimachinery/pkg/util/proxy/transport.go | 6 +- .../pkg/util/proxy/upgradeaware.go | 22 +- .../apimachinery/pkg/util/runtime/runtime.go | 10 +- .../pkg/util/strategicpatch/patch_test.go | 2 +- .../apimachinery/pkg/util/yaml/decoder.go | 10 +- .../apimachinery/pkg/watch/streamwatcher.go | 8 +- vendor/k8s.io/apimachinery/pkg/watch/watch.go | 6 +- vendor/k8s.io/client-go/Godeps/Godeps.json | 198 +- .../client-go/discovery/cached_discovery.go | 18 +- .../client-go/discovery/round_tripper.go | 4 +- .../client-go/examples/workqueue/main.go | 16 +- vendor/k8s.io/client-go/informers/generic.go | 2 + .../informers/storage/v1/interface.go | 7 + .../informers/storage/v1/volumeattachment.go | 88 + .../v1alpha1/initializerconfiguration.go | 17 + .../v1beta1/mutatingwebhookconfiguration.go | 17 + .../v1beta1/validatingwebhookconfiguration.go | 17 + .../typed/apps/v1/controllerrevision.go | 17 + .../kubernetes/typed/apps/v1/daemonset.go | 17 + .../kubernetes/typed/apps/v1/deployment.go | 17 + .../kubernetes/typed/apps/v1/replicaset.go | 17 + .../kubernetes/typed/apps/v1/statefulset.go | 17 + .../typed/apps/v1beta1/controllerrevision.go | 17 + .../typed/apps/v1beta1/deployment.go | 17 + .../typed/apps/v1beta1/statefulset.go | 17 + .../typed/apps/v1beta2/controllerrevision.go | 17 + .../typed/apps/v1beta2/daemonset.go | 17 + .../typed/apps/v1beta2/deployment.go | 17 + .../typed/apps/v1beta2/replicaset.go | 17 + .../typed/apps/v1beta2/statefulset.go | 17 + .../auditregistration/v1alpha1/auditsink.go | 17 + .../autoscaling/v1/horizontalpodautoscaler.go | 17 + .../v2beta1/horizontalpodautoscaler.go | 17 + .../v2beta2/horizontalpodautoscaler.go | 17 + .../kubernetes/typed/batch/v1/job.go | 17 + .../kubernetes/typed/batch/v1beta1/cronjob.go | 17 + .../typed/batch/v2alpha1/cronjob.go | 17 + .../v1beta1/certificatesigningrequest.go | 17 + .../typed/coordination/v1beta1/lease.go | 17 + .../typed/core/v1/componentstatus.go | 17 + .../kubernetes/typed/core/v1/configmap.go | 17 + .../kubernetes/typed/core/v1/endpoints.go | 17 + .../kubernetes/typed/core/v1/event.go | 17 + .../kubernetes/typed/core/v1/limitrange.go | 17 + .../kubernetes/typed/core/v1/namespace.go | 12 + .../kubernetes/typed/core/v1/node.go | 17 + .../typed/core/v1/persistentvolume.go | 17 + .../typed/core/v1/persistentvolumeclaim.go | 17 + .../client-go/kubernetes/typed/core/v1/pod.go | 17 + .../kubernetes/typed/core/v1/podtemplate.go | 17 + .../typed/core/v1/replicationcontroller.go | 17 + .../kubernetes/typed/core/v1/resourcequota.go | 17 + .../kubernetes/typed/core/v1/secret.go | 17 + .../kubernetes/typed/core/v1/service.go | 12 + .../typed/core/v1/serviceaccount.go | 17 + .../kubernetes/typed/events/v1beta1/event.go | 17 + .../typed/extensions/v1beta1/daemonset.go | 17 + .../typed/extensions/v1beta1/deployment.go | 17 + .../typed/extensions/v1beta1/ingress.go | 17 + .../extensions/v1beta1/podsecuritypolicy.go | 17 + .../typed/extensions/v1beta1/replicaset.go | 17 + .../typed/networking/v1/networkpolicy.go | 17 + .../policy/v1beta1/poddisruptionbudget.go | 17 + .../typed/policy/v1beta1/podsecuritypolicy.go | 17 + .../kubernetes/typed/rbac/v1/clusterrole.go | 17 + .../typed/rbac/v1/clusterrolebinding.go | 17 + .../kubernetes/typed/rbac/v1/role.go | 17 + .../kubernetes/typed/rbac/v1/rolebinding.go | 17 + .../typed/rbac/v1alpha1/clusterrole.go | 17 + .../typed/rbac/v1alpha1/clusterrolebinding.go | 17 + .../kubernetes/typed/rbac/v1alpha1/role.go | 17 + .../typed/rbac/v1alpha1/rolebinding.go | 17 + .../typed/rbac/v1beta1/clusterrole.go | 17 + .../typed/rbac/v1beta1/clusterrolebinding.go | 17 + .../kubernetes/typed/rbac/v1beta1/role.go | 17 + .../typed/rbac/v1beta1/rolebinding.go | 17 + .../scheduling/v1alpha1/priorityclass.go | 17 + .../typed/scheduling/v1beta1/priorityclass.go | 17 + .../typed/settings/v1alpha1/podpreset.go | 17 + .../storage/v1/fake/fake_storage_client.go | 4 + .../storage/v1/fake/fake_volumeattachment.go | 131 + .../typed/storage/v1/generated_expansion.go | 2 + .../typed/storage/v1/storage_client.go | 5 + .../typed/storage/v1/storageclass.go | 17 + .../typed/storage/v1/volumeattachment.go | 180 + .../storage/v1alpha1/volumeattachment.go | 17 + .../typed/storage/v1beta1/storageclass.go | 17 + .../typed/storage/v1beta1/volumeattachment.go | 17 + .../client-go/kubernetes_test/timeout_test.go | 60 + .../v1beta1/poddisruptionbudget_expansion.go | 4 +- .../listers/storage/v1/expansion_generated.go | 4 + .../listers/storage/v1/volumeattachment.go | 65 + .../plugin/pkg/client/auth/azure/azure.go | 6 +- .../plugin/pkg/client/auth/exec/exec.go | 4 +- .../plugin/pkg/client/auth/gcp/gcp.go | 10 +- .../plugin/pkg/client/auth/oidc/oidc.go | 6 +- .../pkg/client/auth/openstack/openstack.go | 10 +- vendor/k8s.io/client-go/rest/config.go | 4 +- vendor/k8s.io/client-go/rest/plugin.go | 4 +- vendor/k8s.io/client-go/rest/request.go | 30 +- vendor/k8s.io/client-go/rest/request_test.go | 8 +- vendor/k8s.io/client-go/rest/token_source.go | 4 +- vendor/k8s.io/client-go/rest/urlbackoff.go | 8 +- .../k8s.io/client-go/restmapper/discovery.go | 4 +- .../k8s.io/client-go/restmapper/shortcut.go | 6 +- .../client-go/tools/cache/delta_fifo.go | 30 +- .../client-go/tools/cache/expiration_cache.go | 4 +- .../k8s.io/client-go/tools/cache/listers.go | 4 +- .../client-go/tools/cache/mutation_cache.go | 4 +- .../tools/cache/mutation_detector.go | 4 +- .../k8s.io/client-go/tools/cache/reflector.go | 14 +- .../client-go/tools/cache/shared_informer.go | 16 +- .../tools/clientcmd/api/helpers_test.go | 2 +- .../tools/clientcmd/api/types_test.go | 2 +- .../tools/clientcmd/client_config.go | 6 +- .../client-go/tools/clientcmd/config.go | 4 +- .../client-go/tools/clientcmd/loader.go | 4 +- .../client-go/tools/clientcmd/loader_test.go | 2 +- .../tools/clientcmd/merged_client_builder.go | 6 +- .../tools/leaderelection/healthzadaptor.go | 69 + .../leaderelection/healthzadaptor_test.go | 175 + .../tools/leaderelection/leaderelection.go | 60 +- .../leaderelection/leaderelection_test.go | 2 + vendor/k8s.io/client-go/tools/record/event.go | 16 +- .../client-go/tools/remotecommand/reader.go | 41 + .../tools/remotecommand/remotecommand.go | 4 +- .../client-go/tools/remotecommand/v1.go | 10 +- .../client-go/tools/remotecommand/v2.go | 2 +- vendor/k8s.io/client-go/tools/watch/until.go | 4 +- .../client-go/transport/round_trippers.go | 38 +- vendor/k8s.io/client-go/util/cert/cert.go | 28 - .../client-go/util/cert/triple/triple.go | 116 - .../util/certificate/certificate_manager.go | 24 +- .../util/certificate/certificate_store.go | 8 +- .../client-go/util/certificate/csr/csr.go | 102 +- .../util/certificate/csr/csr_test.go | 135 - .../client-go/util/workqueue/metrics.go | 113 +- .../client-go/util/workqueue/metrics_test.go | 293 + .../k8s.io/client-go/util/workqueue/queue.go | 52 +- .../k8s.io/code-generator/Godeps/Godeps.json | 140 +- .../typed/example/v1/clustertesttype.go | 17 + .../versioned/typed/example/v1/testtype.go | 17 + .../typed/example/internalversion/testtype.go | 17 + .../example2/internalversion/testtype.go | 17 + .../versioned/typed/example/v1/testtype.go | 17 + .../versioned/typed/example2/v1/testtype.go | 17 + .../typed/example/v1/clustertesttype.go | 17 + .../versioned/typed/example/v1/testtype.go | 17 + .../versioned/typed/example2/v1/testtype.go | 17 + .../client-gen/generators/client_generator.go | 6 +- .../generators/generator_for_type.go | 20 + .../code-generator/cmd/client-gen/main.go | 7 +- .../conversion-gen/generators/conversion.go | 66 +- .../code-generator/cmd/conversion-gen/main.go | 9 +- .../code-generator/cmd/deepcopy-gen/main.go | 9 +- .../code-generator/cmd/defaulter-gen/main.go | 9 +- .../cmd/go-to-protobuf/protobuf/generator.go | 4 +- .../cmd/go-to-protobuf/protobuf/tags.go | 4 +- .../code-generator/cmd/import-boss/main.go | 7 +- .../cmd/informer-gen/generators/factory.go | 4 +- .../generators/factoryinterface.go | 4 +- .../cmd/informer-gen/generators/informer.go | 4 +- .../cmd/informer-gen/generators/packages.go | 10 +- .../cmd/informer-gen/generators/tags.go | 4 +- .../code-generator/cmd/informer-gen/main.go | 9 +- .../cmd/lister-gen/generators/lister.go | 10 +- .../cmd/lister-gen/generators/tags.go | 4 +- .../code-generator/cmd/lister-gen/main.go | 9 +- .../code-generator/cmd/openapi-gen/README | 13 - .../cmd/openapi-gen/args/args.go | 53 - .../code-generator/cmd/openapi-gen/main.go | 61 - .../cmd/register-gen/generators/packages.go | 18 +- .../code-generator/cmd/register-gen/main.go | 9 +- .../k8s.io/code-generator/cmd/set-gen/main.go | 7 +- .../ghodss => sigs.k8s.io}/yaml/.gitignore | 0 vendor/sigs.k8s.io/yaml/.travis.yml | 14 + vendor/sigs.k8s.io/yaml/CONTRIBUTING.md | 31 + .../ghodss => sigs.k8s.io}/yaml/LICENSE | 0 vendor/sigs.k8s.io/yaml/OWNERS | 25 + .../ghodss => sigs.k8s.io}/yaml/README.md | 0 vendor/sigs.k8s.io/yaml/RELEASE.md | 9 + vendor/sigs.k8s.io/yaml/SECURITY_CONTACTS | 17 + vendor/sigs.k8s.io/yaml/code-of-conduct.md | 3 + .../ghodss => sigs.k8s.io}/yaml/fields.go | 1 + .../ghodss => sigs.k8s.io}/yaml/yaml.go | 68 +- vendor/sigs.k8s.io/yaml/yaml_go110.go | 14 + vendor/sigs.k8s.io/yaml/yaml_go110_test.go | 46 + .../ghodss => sigs.k8s.io}/yaml/yaml_test.go | 140 +- 633 files changed, 11189 insertions(+), 126194 deletions(-) delete mode 100644 vendor/github.com/PuerkitoBio/purell/.gitignore delete mode 100644 vendor/github.com/PuerkitoBio/purell/.travis.yml delete mode 100644 vendor/github.com/PuerkitoBio/purell/LICENSE delete mode 100644 vendor/github.com/PuerkitoBio/purell/README.md delete mode 100644 vendor/github.com/PuerkitoBio/purell/bench_test.go delete mode 100644 vendor/github.com/PuerkitoBio/purell/benchmarks/v0.1.0 delete mode 100644 vendor/github.com/PuerkitoBio/purell/example_test.go delete mode 100644 vendor/github.com/PuerkitoBio/purell/purell.go delete mode 100644 vendor/github.com/PuerkitoBio/purell/purell_test.go delete mode 100644 vendor/github.com/PuerkitoBio/purell/urlnorm_test.go delete mode 100644 vendor/github.com/PuerkitoBio/urlesc/.travis.yml delete mode 100644 vendor/github.com/PuerkitoBio/urlesc/LICENSE delete mode 100644 vendor/github.com/PuerkitoBio/urlesc/README.md delete mode 100644 vendor/github.com/PuerkitoBio/urlesc/urlesc.go delete mode 100644 vendor/github.com/PuerkitoBio/urlesc/urlesc_test.go delete mode 100644 vendor/github.com/emicklei/go-restful/.gitignore delete mode 100644 vendor/github.com/emicklei/go-restful/.travis.yml delete mode 100644 vendor/github.com/emicklei/go-restful/CHANGES.md delete mode 100644 vendor/github.com/emicklei/go-restful/LICENSE delete mode 100644 vendor/github.com/emicklei/go-restful/Makefile delete mode 100644 vendor/github.com/emicklei/go-restful/README.md delete mode 100644 vendor/github.com/emicklei/go-restful/Srcfile delete mode 100644 vendor/github.com/emicklei/go-restful/bench_curly_test.go delete mode 100644 vendor/github.com/emicklei/go-restful/bench_test.go delete mode 100644 vendor/github.com/emicklei/go-restful/bench_test.sh delete mode 100644 vendor/github.com/emicklei/go-restful/compress.go delete mode 100644 vendor/github.com/emicklei/go-restful/compress_test.go delete mode 100644 vendor/github.com/emicklei/go-restful/compressor_cache.go delete mode 100644 vendor/github.com/emicklei/go-restful/compressor_pools.go delete mode 100644 vendor/github.com/emicklei/go-restful/compressors.go delete mode 100644 vendor/github.com/emicklei/go-restful/constants.go delete mode 100644 vendor/github.com/emicklei/go-restful/container.go delete mode 100644 vendor/github.com/emicklei/go-restful/container_test.go delete mode 100644 vendor/github.com/emicklei/go-restful/cors_filter.go delete mode 100644 vendor/github.com/emicklei/go-restful/cors_filter_test.go delete mode 100644 vendor/github.com/emicklei/go-restful/coverage.sh delete mode 100644 vendor/github.com/emicklei/go-restful/curly.go delete mode 100644 vendor/github.com/emicklei/go-restful/curly_route.go delete mode 100644 vendor/github.com/emicklei/go-restful/curly_test.go delete mode 100644 vendor/github.com/emicklei/go-restful/doc.go delete mode 100644 vendor/github.com/emicklei/go-restful/doc_examples_test.go delete mode 100644 vendor/github.com/emicklei/go-restful/entity_accessors.go delete mode 100644 vendor/github.com/emicklei/go-restful/entity_accessors_test.go delete mode 100644 vendor/github.com/emicklei/go-restful/examples/.goconvey delete mode 100644 vendor/github.com/emicklei/go-restful/examples/google_app_engine/.goconvey delete mode 100644 vendor/github.com/emicklei/go-restful/examples/google_app_engine/app.yaml delete mode 100644 vendor/github.com/emicklei/go-restful/examples/google_app_engine/datastore/.goconvey delete mode 100644 vendor/github.com/emicklei/go-restful/examples/google_app_engine/datastore/app.yaml delete mode 100644 vendor/github.com/emicklei/go-restful/examples/google_app_engine/datastore/main.go delete mode 100644 vendor/github.com/emicklei/go-restful/examples/google_app_engine/restful-appstats-integration.go delete mode 100644 vendor/github.com/emicklei/go-restful/examples/google_app_engine/restful-user-service.go delete mode 100644 vendor/github.com/emicklei/go-restful/examples/home.html delete mode 100644 vendor/github.com/emicklei/go-restful/examples/msgpack/msgpack_entity.go delete mode 100644 vendor/github.com/emicklei/go-restful/examples/msgpack/msgpack_entity_test.go delete mode 100644 vendor/github.com/emicklei/go-restful/examples/restful-CORS-filter.go delete mode 100644 vendor/github.com/emicklei/go-restful/examples/restful-NCSA-logging.go delete mode 100644 vendor/github.com/emicklei/go-restful/examples/restful-basic-authentication.go delete mode 100644 vendor/github.com/emicklei/go-restful/examples/restful-cpuprofiler-service.go delete mode 100644 vendor/github.com/emicklei/go-restful/examples/restful-curly-router.go delete mode 100644 vendor/github.com/emicklei/go-restful/examples/restful-curly-router_test.go delete mode 100644 vendor/github.com/emicklei/go-restful/examples/restful-encoding-filter.go delete mode 100644 vendor/github.com/emicklei/go-restful/examples/restful-filters.go delete mode 100644 vendor/github.com/emicklei/go-restful/examples/restful-form-handling.go delete mode 100644 vendor/github.com/emicklei/go-restful/examples/restful-hello-world.go delete mode 100644 vendor/github.com/emicklei/go-restful/examples/restful-html-template.go delete mode 100644 vendor/github.com/emicklei/go-restful/examples/restful-multi-containers.go delete mode 100644 vendor/github.com/emicklei/go-restful/examples/restful-no-cache-filter.go delete mode 100644 vendor/github.com/emicklei/go-restful/examples/restful-openapi.go delete mode 100644 vendor/github.com/emicklei/go-restful/examples/restful-options-filter.go delete mode 100644 vendor/github.com/emicklei/go-restful/examples/restful-path-tail.go delete mode 100644 vendor/github.com/emicklei/go-restful/examples/restful-pre-post-filters.go delete mode 100644 vendor/github.com/emicklei/go-restful/examples/restful-resource-functions.go delete mode 100644 vendor/github.com/emicklei/go-restful/examples/restful-route_test.go delete mode 100644 vendor/github.com/emicklei/go-restful/examples/restful-routefunction_test.go delete mode 100644 vendor/github.com/emicklei/go-restful/examples/restful-serve-static.go delete mode 100644 vendor/github.com/emicklei/go-restful/examples/restful-swagger.go delete mode 100644 vendor/github.com/emicklei/go-restful/examples/restful-user-resource.go delete mode 100644 vendor/github.com/emicklei/go-restful/filter.go delete mode 100644 vendor/github.com/emicklei/go-restful/filter_test.go delete mode 100644 vendor/github.com/emicklei/go-restful/json.go delete mode 100644 vendor/github.com/emicklei/go-restful/jsoniter.go delete mode 100644 vendor/github.com/emicklei/go-restful/jsr311.go delete mode 100644 vendor/github.com/emicklei/go-restful/jsr311_test.go delete mode 100644 vendor/github.com/emicklei/go-restful/log/log.go delete mode 100644 vendor/github.com/emicklei/go-restful/logger.go delete mode 100644 vendor/github.com/emicklei/go-restful/mime.go delete mode 100644 vendor/github.com/emicklei/go-restful/mime_test.go delete mode 100644 vendor/github.com/emicklei/go-restful/options_filter.go delete mode 100644 vendor/github.com/emicklei/go-restful/options_filter_test.go delete mode 100644 vendor/github.com/emicklei/go-restful/parameter.go delete mode 100644 vendor/github.com/emicklei/go-restful/path_expression.go delete mode 100644 vendor/github.com/emicklei/go-restful/path_expression_test.go delete mode 100644 vendor/github.com/emicklei/go-restful/path_processor.go delete mode 100644 vendor/github.com/emicklei/go-restful/path_processor_test.go delete mode 100644 vendor/github.com/emicklei/go-restful/request.go delete mode 100644 vendor/github.com/emicklei/go-restful/request_test.go delete mode 100644 vendor/github.com/emicklei/go-restful/response.go delete mode 100644 vendor/github.com/emicklei/go-restful/response_test.go delete mode 100644 vendor/github.com/emicklei/go-restful/route.go delete mode 100644 vendor/github.com/emicklei/go-restful/route_builder.go delete mode 100644 vendor/github.com/emicklei/go-restful/route_builder_test.go delete mode 100644 vendor/github.com/emicklei/go-restful/route_test.go delete mode 100644 vendor/github.com/emicklei/go-restful/router.go delete mode 100644 vendor/github.com/emicklei/go-restful/service_error.go delete mode 100644 vendor/github.com/emicklei/go-restful/tracer_test.go delete mode 100644 vendor/github.com/emicklei/go-restful/web_service.go delete mode 100644 vendor/github.com/emicklei/go-restful/web_service_container.go delete mode 100644 vendor/github.com/emicklei/go-restful/web_service_test.go delete mode 100644 vendor/github.com/ghodss/yaml/.travis.yml delete mode 100644 vendor/github.com/go-openapi/jsonpointer/.editorconfig delete mode 100644 vendor/github.com/go-openapi/jsonpointer/.github/CONTRIBUTING.md delete mode 100644 vendor/github.com/go-openapi/jsonpointer/.gitignore delete mode 100644 vendor/github.com/go-openapi/jsonpointer/.travis.yml delete mode 100644 vendor/github.com/go-openapi/jsonpointer/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/go-openapi/jsonpointer/LICENSE delete mode 100644 vendor/github.com/go-openapi/jsonpointer/README.md delete mode 100644 vendor/github.com/go-openapi/jsonpointer/go.mod delete mode 100644 vendor/github.com/go-openapi/jsonpointer/go.sum delete mode 100644 vendor/github.com/go-openapi/jsonpointer/pointer.go delete mode 100644 vendor/github.com/go-openapi/jsonpointer/pointer_test.go delete mode 100644 vendor/github.com/go-openapi/jsonreference/.github/CONTRIBUTING.md delete mode 100644 vendor/github.com/go-openapi/jsonreference/.gitignore delete mode 100644 vendor/github.com/go-openapi/jsonreference/.travis.yml delete mode 100644 vendor/github.com/go-openapi/jsonreference/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/go-openapi/jsonreference/LICENSE delete mode 100644 vendor/github.com/go-openapi/jsonreference/README.md delete mode 100644 vendor/github.com/go-openapi/jsonreference/go.mod delete mode 100644 vendor/github.com/go-openapi/jsonreference/go.sum delete mode 100644 vendor/github.com/go-openapi/jsonreference/reference.go delete mode 100644 vendor/github.com/go-openapi/jsonreference/reference_test.go delete mode 100644 vendor/github.com/go-openapi/spec/.editorconfig delete mode 100644 vendor/github.com/go-openapi/spec/.github/CONTRIBUTING.md delete mode 100644 vendor/github.com/go-openapi/spec/.gitignore delete mode 100644 vendor/github.com/go-openapi/spec/.golangci.yml delete mode 100644 vendor/github.com/go-openapi/spec/.travis.yml delete mode 100644 vendor/github.com/go-openapi/spec/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/go-openapi/spec/LICENSE delete mode 100644 vendor/github.com/go-openapi/spec/README.md delete mode 100644 vendor/github.com/go-openapi/spec/auth_test.go delete mode 100644 vendor/github.com/go-openapi/spec/bindata.go delete mode 100644 vendor/github.com/go-openapi/spec/contact_info.go delete mode 100644 vendor/github.com/go-openapi/spec/contact_info_test.go delete mode 100644 vendor/github.com/go-openapi/spec/debug.go delete mode 100644 vendor/github.com/go-openapi/spec/debug_test.go delete mode 100644 vendor/github.com/go-openapi/spec/expander.go delete mode 100644 vendor/github.com/go-openapi/spec/expander_test.go delete mode 100644 vendor/github.com/go-openapi/spec/external_docs.go delete mode 100644 vendor/github.com/go-openapi/spec/external_docs_test.go delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/bugs/1429/remote/farther/farther.yaml delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/bugs/1429/remote/remote.yaml delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/bugs/1429/remote/remote/remote.yaml delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/bugs/1429/responses.yaml delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/bugs/1429/swagger.yaml delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/bugs/1614/gitea.json delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/bugs/1621/definitions.yaml delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/bugs/1621/fixture-1621.yaml delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/bugs/1621/parameters.yaml delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/bugs/1621/responses.yaml delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/bugs/69/dapperbox.json delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/bugs/957/fixture-957.json delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/expansion/all-the-things.json delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/expansion/circular-minimal.json delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/expansion/circularRefs.json delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/expansion/circularSpec.json delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/expansion/circularSpec.yaml delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/expansion/circularSpec2.json delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/expansion/clickmeter.json delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/expansion/clickmeter.yaml delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/expansion/invalid-refs.json delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/expansion/missingItemRef.json delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/expansion/missingRef.json delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/expansion/overflow.json delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/expansion/params.json delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/expansion/schemas1.json delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/expansion/schemas2.json delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/local_expansion/item.json delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/local_expansion/item2.yaml delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/local_expansion/spec.json delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/local_expansion/spec2.yaml delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/more_circulars/bitbucket.json delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/more_circulars/item.json delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/more_circulars/item2.json delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/more_circulars/item4.json delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/more_circulars/spec.json delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/more_circulars/spec2.json delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/more_circulars/spec3.json delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/more_circulars/spec4.json delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/remote/all-the-things.json delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/remote/pet/pet.json delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/specs/deeper/arrayProp.json delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/specs/deeper/stringProp.json delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/specs/refed.json delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/specs/resolution.json delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/specs/resolution2.json delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/specs/todos.common.json delete mode 100644 vendor/github.com/go-openapi/spec/fixtures/specs/todos.json delete mode 100644 vendor/github.com/go-openapi/spec/go.mod delete mode 100644 vendor/github.com/go-openapi/spec/go.sum delete mode 100644 vendor/github.com/go-openapi/spec/header.go delete mode 100644 vendor/github.com/go-openapi/spec/header_test.go delete mode 100644 vendor/github.com/go-openapi/spec/info.go delete mode 100644 vendor/github.com/go-openapi/spec/info_test.go delete mode 100644 vendor/github.com/go-openapi/spec/items.go delete mode 100644 vendor/github.com/go-openapi/spec/items_test.go delete mode 100644 vendor/github.com/go-openapi/spec/license.go delete mode 100644 vendor/github.com/go-openapi/spec/license_test.go delete mode 100644 vendor/github.com/go-openapi/spec/operation.go delete mode 100644 vendor/github.com/go-openapi/spec/operation_test.go delete mode 100644 vendor/github.com/go-openapi/spec/parameter.go delete mode 100644 vendor/github.com/go-openapi/spec/parameters_test.go delete mode 100644 vendor/github.com/go-openapi/spec/path_item.go delete mode 100644 vendor/github.com/go-openapi/spec/path_item_test.go delete mode 100644 vendor/github.com/go-openapi/spec/paths.go delete mode 100644 vendor/github.com/go-openapi/spec/paths_test.go delete mode 100644 vendor/github.com/go-openapi/spec/properties_test.go delete mode 100644 vendor/github.com/go-openapi/spec/ref.go delete mode 100644 vendor/github.com/go-openapi/spec/response.go delete mode 100644 vendor/github.com/go-openapi/spec/response_test.go delete mode 100644 vendor/github.com/go-openapi/spec/responses.go delete mode 100644 vendor/github.com/go-openapi/spec/schema.go delete mode 100644 vendor/github.com/go-openapi/spec/schema_test.go delete mode 100644 vendor/github.com/go-openapi/spec/schemas/jsonschema-draft-04.json delete mode 100644 vendor/github.com/go-openapi/spec/schemas/v2/README.md delete mode 100644 vendor/github.com/go-openapi/spec/schemas/v2/schema.json delete mode 100644 vendor/github.com/go-openapi/spec/security_scheme.go delete mode 100644 vendor/github.com/go-openapi/spec/spec.go delete mode 100644 vendor/github.com/go-openapi/spec/spec_test.go delete mode 100644 vendor/github.com/go-openapi/spec/structs_test.go delete mode 100644 vendor/github.com/go-openapi/spec/swagger.go delete mode 100644 vendor/github.com/go-openapi/spec/swagger_test.go delete mode 100644 vendor/github.com/go-openapi/spec/tag.go delete mode 100644 vendor/github.com/go-openapi/spec/xml_object.go delete mode 100644 vendor/github.com/go-openapi/spec/xml_object_test.go delete mode 100644 vendor/github.com/go-openapi/swag/.editorconfig delete mode 100644 vendor/github.com/go-openapi/swag/.github/CONTRIBUTING.md delete mode 100644 vendor/github.com/go-openapi/swag/.gitignore delete mode 100644 vendor/github.com/go-openapi/swag/.golangci.yml delete mode 100644 vendor/github.com/go-openapi/swag/.travis.yml delete mode 100644 vendor/github.com/go-openapi/swag/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/go-openapi/swag/LICENSE delete mode 100644 vendor/github.com/go-openapi/swag/README.md delete mode 100644 vendor/github.com/go-openapi/swag/convert.go delete mode 100644 vendor/github.com/go-openapi/swag/convert_test.go delete mode 100644 vendor/github.com/go-openapi/swag/convert_types.go delete mode 100644 vendor/github.com/go-openapi/swag/convert_types_test.go delete mode 100644 vendor/github.com/go-openapi/swag/doc.go delete mode 100644 vendor/github.com/go-openapi/swag/go.mod delete mode 100644 vendor/github.com/go-openapi/swag/go.sum delete mode 100644 vendor/github.com/go-openapi/swag/json.go delete mode 100644 vendor/github.com/go-openapi/swag/json_test.go delete mode 100644 vendor/github.com/go-openapi/swag/loading.go delete mode 100644 vendor/github.com/go-openapi/swag/loading_test.go delete mode 100644 vendor/github.com/go-openapi/swag/net.go delete mode 100644 vendor/github.com/go-openapi/swag/net_test.go delete mode 100644 vendor/github.com/go-openapi/swag/path.go delete mode 100644 vendor/github.com/go-openapi/swag/path_test.go delete mode 100644 vendor/github.com/go-openapi/swag/post_go18.go delete mode 100644 vendor/github.com/go-openapi/swag/post_go19.go delete mode 100644 vendor/github.com/go-openapi/swag/pre_go18.go delete mode 100644 vendor/github.com/go-openapi/swag/pre_go19.go delete mode 100644 vendor/github.com/go-openapi/swag/util.go delete mode 100644 vendor/github.com/go-openapi/swag/util_test.go delete mode 100644 vendor/github.com/go-openapi/swag/yaml.go delete mode 100644 vendor/github.com/go-openapi/swag/yaml_test.go delete mode 100644 vendor/github.com/mailru/easyjson/.gitignore delete mode 100644 vendor/github.com/mailru/easyjson/.travis.yml delete mode 100644 vendor/github.com/mailru/easyjson/LICENSE delete mode 100644 vendor/github.com/mailru/easyjson/Makefile delete mode 100644 vendor/github.com/mailru/easyjson/README.md delete mode 100644 vendor/github.com/mailru/easyjson/benchmark/codec_test.go delete mode 100644 vendor/github.com/mailru/easyjson/benchmark/data.go delete mode 100644 vendor/github.com/mailru/easyjson/benchmark/data_codec.go delete mode 100644 vendor/github.com/mailru/easyjson/benchmark/data_ffjson.go delete mode 100644 vendor/github.com/mailru/easyjson/benchmark/data_var.go delete mode 100644 vendor/github.com/mailru/easyjson/benchmark/default_test.go delete mode 100644 vendor/github.com/mailru/easyjson/benchmark/dummy_test.go delete mode 100644 vendor/github.com/mailru/easyjson/benchmark/easyjson_test.go delete mode 100644 vendor/github.com/mailru/easyjson/benchmark/example.json delete mode 100644 vendor/github.com/mailru/easyjson/benchmark/ffjson_test.go delete mode 100644 vendor/github.com/mailru/easyjson/benchmark/jsoniter_test.go delete mode 100755 vendor/github.com/mailru/easyjson/benchmark/ujson.sh delete mode 100644 vendor/github.com/mailru/easyjson/bootstrap/bootstrap.go delete mode 100644 vendor/github.com/mailru/easyjson/buffer/pool.go delete mode 100644 vendor/github.com/mailru/easyjson/buffer/pool_test.go delete mode 100644 vendor/github.com/mailru/easyjson/easyjson/main.go delete mode 100644 vendor/github.com/mailru/easyjson/gen/decoder.go delete mode 100644 vendor/github.com/mailru/easyjson/gen/encoder.go delete mode 100644 vendor/github.com/mailru/easyjson/gen/generator.go delete mode 100644 vendor/github.com/mailru/easyjson/gen/generator_test.go delete mode 100644 vendor/github.com/mailru/easyjson/helpers.go delete mode 100644 vendor/github.com/mailru/easyjson/jlexer/bytestostr.go delete mode 100644 vendor/github.com/mailru/easyjson/jlexer/bytestostr_nounsafe.go delete mode 100644 vendor/github.com/mailru/easyjson/jlexer/error.go delete mode 100644 vendor/github.com/mailru/easyjson/jlexer/lexer.go delete mode 100644 vendor/github.com/mailru/easyjson/jlexer/lexer_test.go delete mode 100644 vendor/github.com/mailru/easyjson/jwriter/writer.go delete mode 100644 vendor/github.com/mailru/easyjson/opt/gotemplate_Bool.go delete mode 100644 vendor/github.com/mailru/easyjson/opt/gotemplate_Float32.go delete mode 100644 vendor/github.com/mailru/easyjson/opt/gotemplate_Float64.go delete mode 100644 vendor/github.com/mailru/easyjson/opt/gotemplate_Int.go delete mode 100644 vendor/github.com/mailru/easyjson/opt/gotemplate_Int16.go delete mode 100644 vendor/github.com/mailru/easyjson/opt/gotemplate_Int32.go delete mode 100644 vendor/github.com/mailru/easyjson/opt/gotemplate_Int64.go delete mode 100644 vendor/github.com/mailru/easyjson/opt/gotemplate_Int8.go delete mode 100644 vendor/github.com/mailru/easyjson/opt/gotemplate_String.go delete mode 100644 vendor/github.com/mailru/easyjson/opt/gotemplate_Uint.go delete mode 100644 vendor/github.com/mailru/easyjson/opt/gotemplate_Uint16.go delete mode 100644 vendor/github.com/mailru/easyjson/opt/gotemplate_Uint32.go delete mode 100644 vendor/github.com/mailru/easyjson/opt/gotemplate_Uint64.go delete mode 100644 vendor/github.com/mailru/easyjson/opt/gotemplate_Uint8.go delete mode 100644 vendor/github.com/mailru/easyjson/opt/optional/opt.go delete mode 100644 vendor/github.com/mailru/easyjson/opt/opts.go delete mode 100644 vendor/github.com/mailru/easyjson/parser/parser.go delete mode 100644 vendor/github.com/mailru/easyjson/parser/pkgpath.go delete mode 100644 vendor/github.com/mailru/easyjson/raw.go delete mode 100644 vendor/github.com/mailru/easyjson/tests/basic_test.go delete mode 100644 vendor/github.com/mailru/easyjson/tests/custom_map_key_type.go delete mode 100644 vendor/github.com/mailru/easyjson/tests/data.go delete mode 100644 vendor/github.com/mailru/easyjson/tests/disallow_unknown.go delete mode 100644 vendor/github.com/mailru/easyjson/tests/embedded_type.go delete mode 100644 vendor/github.com/mailru/easyjson/tests/errors.go delete mode 100644 vendor/github.com/mailru/easyjson/tests/errors_test.go delete mode 100644 vendor/github.com/mailru/easyjson/tests/named_type.go delete mode 100644 vendor/github.com/mailru/easyjson/tests/nested_easy.go delete mode 100644 vendor/github.com/mailru/easyjson/tests/nothing.go delete mode 100644 vendor/github.com/mailru/easyjson/tests/omitempty.go delete mode 100644 vendor/github.com/mailru/easyjson/tests/opt_test.go delete mode 100644 vendor/github.com/mailru/easyjson/tests/required_test.go delete mode 100644 vendor/github.com/mailru/easyjson/tests/snake.go rename vendor/golang.org/x/tools/go/analysis/{cmd/vet-lite => unitchecker}/main.go (64%) create mode 100644 vendor/golang.org/x/tools/internal/lsp/testdata/godef/a/a.go create mode 100644 vendor/golang.org/x/tools/internal/lsp/testdata/godef/a/random.go create mode 100644 vendor/golang.org/x/tools/internal/lsp/testdata/godef/b/b.go create mode 100644 vendor/golang.org/x/tools/internal/lsp/testdata/godef/b/c.go create mode 100644 vendor/golang.org/x/tools/internal/lsp/testdata/godef/b/c.go.saved create mode 100644 vendor/golang.org/x/tools/internal/lsp/testdata/godef/broken/unclosedIf.go.in create mode 100644 vendor/golang.org/x/tools/internal/lsp/testdata/noparse_format/noparse_format.1_10.go.in create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/conversion/webhook_converter.go create mode 100644 vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/helpers.go create mode 100644 vendor/k8s.io/client-go/informers/storage/v1/volumeattachment.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_volumeattachment.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1/volumeattachment.go create mode 100644 vendor/k8s.io/client-go/kubernetes_test/timeout_test.go create mode 100644 vendor/k8s.io/client-go/listers/storage/v1/volumeattachment.go create mode 100644 vendor/k8s.io/client-go/tools/leaderelection/healthzadaptor.go create mode 100644 vendor/k8s.io/client-go/tools/leaderelection/healthzadaptor_test.go create mode 100644 vendor/k8s.io/client-go/tools/remotecommand/reader.go delete mode 100644 vendor/k8s.io/client-go/util/cert/triple/triple.go delete mode 100644 vendor/k8s.io/client-go/util/certificate/csr/csr_test.go create mode 100644 vendor/k8s.io/client-go/util/workqueue/metrics_test.go delete mode 100644 vendor/k8s.io/code-generator/cmd/openapi-gen/README delete mode 100644 vendor/k8s.io/code-generator/cmd/openapi-gen/args/args.go delete mode 100644 vendor/k8s.io/code-generator/cmd/openapi-gen/main.go rename vendor/{github.com/ghodss => sigs.k8s.io}/yaml/.gitignore (100%) create mode 100644 vendor/sigs.k8s.io/yaml/.travis.yml create mode 100644 vendor/sigs.k8s.io/yaml/CONTRIBUTING.md rename vendor/{github.com/ghodss => sigs.k8s.io}/yaml/LICENSE (100%) create mode 100644 vendor/sigs.k8s.io/yaml/OWNERS rename vendor/{github.com/ghodss => sigs.k8s.io}/yaml/README.md (100%) create mode 100644 vendor/sigs.k8s.io/yaml/RELEASE.md create mode 100644 vendor/sigs.k8s.io/yaml/SECURITY_CONTACTS create mode 100644 vendor/sigs.k8s.io/yaml/code-of-conduct.md rename vendor/{github.com/ghodss => sigs.k8s.io}/yaml/fields.go (99%) rename vendor/{github.com/ghodss => sigs.k8s.io}/yaml/yaml.go (77%) create mode 100644 vendor/sigs.k8s.io/yaml/yaml_go110.go create mode 100644 vendor/sigs.k8s.io/yaml/yaml_go110_test.go rename vendor/{github.com/ghodss => sigs.k8s.io}/yaml/yaml_test.go (62%) diff --git a/Gopkg.lock b/Gopkg.lock index 9088311c..7821e111 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -1,22 +1,6 @@ # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. -[[projects]] - digest = "1:8e47871087b94913898333f37af26732faaab30cdb41571136cf7aec9921dae7" - name = "github.com/PuerkitoBio/purell" - packages = ["."] - pruneopts = "" - revision = "0bcb03f4b4d0a9428594752bd2a3b9aa0a9d4bd4" - version = "v1.1.0" - -[[projects]] - branch = "master" - digest = "1:331a419049c2be691e5ba1d24342fc77c7e767a80c666a18fd8a9f7b82419c1c" - name = "github.com/PuerkitoBio/urlesc" - packages = ["."] - pruneopts = "" - revision = "de5bf2ad457846296e2031421a34e2568e304e35" - [[projects]] digest = "1:93147eb1d6f08d39f2c0efe3d29ee043bda72be7a8b3b367eb08c72c18524638" name = "github.com/container-storage-interface/spec" @@ -33,17 +17,6 @@ revision = "8991bc29aa16c548c550c7ff78260e27b9ab7c73" version = "v1.1.1" -[[projects]] - digest = "1:8a34d7a37b8f07239487752e14a5faafcbbc718fc385ad429a2c4ac6f27a207f" - name = "github.com/emicklei/go-restful" - packages = [ - ".", - "log", - ] - pruneopts = "" - revision = "3eb9738c1697594ea6e71a7156a9bb32ed216cf0" - version = "v2.8.0" - [[projects]] digest = "1:4216202f4088a73e2982df875e2f0d1401137bbc248e57391e70547af167a18a" name = "github.com/evanphx/json-patch" @@ -52,46 +25,6 @@ revision = "72bf35d0ff611848c1dc9df0f976c81192392fa5" version = "v4.1.0" -[[projects]] - digest = "1:b13707423743d41665fd23f0c36b2f37bb49c30e94adb813319c44188a51ba22" - name = "github.com/ghodss/yaml" - packages = ["."] - pruneopts = "" - revision = "0ca9ea5df5451ffdf184b4428c902747c2c11cd7" - version = "v1.0.0" - -[[projects]] - digest = "1:c8052dcf3ec378a9a6bc4f00ecc10d6d5eb3cc1f8faaf6b2f70f047e8881d446" - name = "github.com/go-openapi/jsonpointer" - packages = ["."] - pruneopts = "" - revision = "ef5f0afec364d3b9396b7b77b43dbe26bf1f8004" - version = "v0.17.2" - -[[projects]] - digest = "1:1824e5330b35b2a2418d06aa55629cc59ad454b72e338aa125ba8ff98f16298b" - name = "github.com/go-openapi/jsonreference" - packages = ["."] - pruneopts = "" - revision = "8483a886a90412cd6858df4ea3483dce9c8e35a3" - version = "v0.17.2" - -[[projects]] - digest = "1:d4680b89600466e543754c838cbc987ed58b962417a88600881cd0ed88d6b4cc" - name = "github.com/go-openapi/spec" - packages = ["."] - pruneopts = "" - revision = "5bae59e25b21498baea7f9d46e9c147ec106a42e" - version = "v0.17.2" - -[[projects]] - digest = "1:062de20b7d299ae95c902a5c472c4bc87a2f3ae707751fe155ecf640d99074b4" - name = "github.com/go-openapi/swag" - packages = ["."] - pruneopts = "" - revision = "5899d5c5e619fda5fa86e14795a835f473ca284c" - version = "v0.17.2" - [[projects]] digest = "1:6e73003ecd35f4487a5e88270d3ca0a81bc80dc88053ac7e4dcfec5fba30d918" name = "github.com/gogo/protobuf" @@ -220,18 +153,6 @@ revision = "619da6853e10bef67ddcc8f1c2b68b73154bf11d" version = "v1.0.0-rc2" -[[projects]] - branch = "master" - digest = "1:212bebc561f4f654a653225868b2a97353cd5e160dc0b0bbc7232b06608474ec" - name = "github.com/mailru/easyjson" - packages = [ - "buffer", - "jlexer", - "jwriter", - ] - pruneopts = "" - revision = "60711f1a8329503b04e1c88535f419d0bb440bff" - [[projects]] digest = "1:0c0ff2a89c1bb0d01887e1dac043ad7efbf3ec77482ef058ac423d13497e16fd" name = "github.com/modern-go/concurrent" @@ -310,14 +231,14 @@ [[projects]] branch = "master" - digest = "1:bae7ec6144727bacb0f06565215267a39134f63a4955114d03961ca9061a1e97" + digest = "1:0ad2730a94694f9968449f91f0311788b58b2822ff5eff299202e02f538c6027" name = "golang.org/x/sys" packages = [ "unix", "windows", ] pruneopts = "" - revision = "93218def8b18e66adbdab3eca8ec334700329f1f" + revision = "ec83556a53fe16b65c452a104ea9d1e86a671852" [[projects]] digest = "1:5acd3512b047305d49e8763eef7ba423901e85d5dd2fd1e71778a0ea8de10bd4" @@ -337,7 +258,6 @@ "unicode/cldr", "unicode/norm", "unicode/rangetable", - "width", ] pruneopts = "" revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0" @@ -353,7 +273,7 @@ [[projects]] branch = "master" - digest = "1:61cd6a264d327e970f4570c0c73108bde1deb108a63acdf14f92a8a5303d9107" + digest = "1:f17543c60083ff4f8fae5ee3e5d51bcd6fece074fd39a49cfd0f29573039dd17" name = "golang.org/x/tools" packages = [ "go/ast/astutil", @@ -362,7 +282,7 @@ "internal/gopathwalk", ] pruneopts = "" - revision = "e77c06808af6317101c5a7124008b3f7e0103768" + revision = "89e258047f9bd4255fae0d48139e1d5ff0a7b8dd" [[projects]] digest = "1:77d3cff3a451d50be4b52db9c7766c0d8570ba47593f0c9dc72173adb208e788" @@ -442,7 +362,7 @@ version = "v2.2.1" [[projects]] - digest = "1:fd9e9a89a222c17f0f306f0385bf68b80b122eeb31a0a1feb0562d5c28081df3" + digest = "1:63ada4e68469e695bda7bb2a14f3009c1fc6e78b0f36d53436b38d919a576109" name = "k8s.io/api" packages = [ "admissionregistration/v1alpha1", @@ -479,11 +399,11 @@ "storage/v1beta1", ] pruneopts = "" - revision = "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" - version = "kubernetes-1.13.0-beta.0" + revision = "d01564359763a39d310efc27866b63d4f5c92f1d" + version = "kubernetes-1.13.0-beta.1" [[projects]] - digest = "1:0bfcb0558f47126ce77d53b9f366acd93285b08eeb24ab850605d84d61c41560" + digest = "1:fdde42c63adc2e1605319b3fe32843c1c33fd70434c9acfaf20e5a465216ceab" name = "k8s.io/apiextensions-apiserver" packages = [ "pkg/apis/apiextensions", @@ -493,11 +413,11 @@ "pkg/client/clientset/clientset/typed/apiextensions/v1beta1", ] pruneopts = "" - revision = "3efadf0e4da664c216d56d72367a17a7be2073ec" - version = "kubernetes-1.13.0-beta.0" + revision = "e1ae69ff7b8b6c135578c1892f3781c55d75c69e" + version = "kubernetes-1.13.0-beta.1" [[projects]] - digest = "1:450ccf79705e5c59f07f839c7fc008a6c1073621836dad0ad40ffc67a77d8f03" + digest = "1:3166a472475f9904e42f93565fca74f7f20d9a5f3bc1b0ac321aedc5a211e796" name = "k8s.io/apimachinery" packages = [ "pkg/api/errors", @@ -544,11 +464,11 @@ "third_party/forked/golang/reflect", ] pruneopts = "" - revision = "ffd2ae06646c02ab214c0fe691dff61cb464ed87" - version = "kubernetes-1.13.0-beta.0" + revision = "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" + version = "kubernetes-1.13.0-beta.1" [[projects]] - digest = "1:8b78e4176f0e68981b95b4b1c6be9fce461fae13da22f88803170c4ef95afe74" + digest = "1:c521267e4944f34c38ac078f20b3d485a5ca709d5e53d80586182cc0ef675f65" name = "k8s.io/client-go" packages = [ "discovery", @@ -649,11 +569,11 @@ "util/workqueue", ] pruneopts = "" - revision = "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" - version = "kubernetes-1.13.0-beta.0" + revision = "46a8dc78ec29761d6cb89a9eb50ddde947c84030" + version = "kubernetes-1.13.0-beta.1" [[projects]] - digest = "1:4f39eae923c084d65d1f1f0481a8ec83bcca05cb539f2671974ed5f3b027498f" + digest = "1:d809e6c8dfa3448ae10f5624eff4ed1ebdc906755e7cea294c44e8b7ac0b077a" name = "k8s.io/code-generator" packages = [ "cmd/client-gen", @@ -674,13 +594,11 @@ "cmd/lister-gen", "cmd/lister-gen/args", "cmd/lister-gen/generators", - "cmd/openapi-gen", - "cmd/openapi-gen/args", "pkg/util", ] pruneopts = "" - revision = "e8b5114992ff73fae0ea97e098e6f5de54c703d3" - version = "kubernetes-1.13.0-beta.0" + revision = "c2090bec4d9b1fb25de3812f868accc2bc9ecbae" + version = "kubernetes-1.13.0-beta.1" [[projects]] branch = "master" @@ -711,14 +629,7 @@ branch = "master" digest = "1:e5d4ca90c0f3862515c98454bb37d4d340f4ceeca60ac3e0a5cb5857360aed7c" name = "k8s.io/kube-openapi" - packages = [ - "cmd/openapi-gen/args", - "pkg/common", - "pkg/generators", - "pkg/generators/rules", - "pkg/util/proto", - "pkg/util/sets", - ] + packages = ["pkg/util/proto"] pruneopts = "" revision = "0317810137be915b9cf888946c6e115c1bfac693" @@ -733,6 +644,14 @@ revision = "17c77c7898218073f14c8d573582e8d2313dc740" version = "v1.12.2" +[[projects]] + digest = "1:321081b4a44256715f2b68411d8eda9a17f17ebfe6f0cc61d2cc52d11c08acfa" + name = "sigs.k8s.io/yaml" + packages = ["."] + pruneopts = "" + revision = "fd68e9863619f6ec2fdd8625fe1f02e7c877e480" + version = "v1.1.0" + [solve-meta] analyzer-name = "dep" analyzer-version = 1 @@ -786,7 +705,6 @@ "k8s.io/code-generator/cmd/defaulter-gen", "k8s.io/code-generator/cmd/informer-gen", "k8s.io/code-generator/cmd/lister-gen", - "k8s.io/code-generator/cmd/openapi-gen", "k8s.io/kubernetes/pkg/util/goroutinemap", "k8s.io/kubernetes/pkg/util/goroutinemap/exponentialbackoff", ] diff --git a/Gopkg.toml b/Gopkg.toml index 73b98494..cd90bde5 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -6,7 +6,6 @@ required = [ "k8s.io/code-generator/cmd/lister-gen", "k8s.io/code-generator/cmd/deepcopy-gen", "k8s.io/code-generator/cmd/defaulter-gen", - "k8s.io/code-generator/cmd/openapi-gen", ] @@ -32,15 +31,15 @@ required = [ [[constraint]] name = "k8s.io/api" - version = "kubernetes-1.13.0-beta.0" + version = "kubernetes-1.13.0-beta.1" [[constraint]] name = "k8s.io/apimachinery" - version = "kubernetes-1.13.0-beta.0" + version = "kubernetes-1.13.0-beta.1" [[constraint]] name = "k8s.io/client-go" - version = "kubernetes-1.13.0-beta.0" + version = "kubernetes-1.13.0-beta.1" [[override]] name = "github.com/json-iterator/go" @@ -48,8 +47,8 @@ required = [ [[constraint]] name = "k8s.io/code-generator" - version = "kubernetes-1.13.0-beta.0" + version = "kubernetes-1.13.0-beta.1" [[constraint]] name = "k8s.io/apiextensions-apiserver" - version = "kubernetes-1.13.0-beta.0" + version = "kubernetes-1.13.0-beta.1" diff --git a/vendor/github.com/PuerkitoBio/purell/.gitignore b/vendor/github.com/PuerkitoBio/purell/.gitignore deleted file mode 100644 index 748e4c80..00000000 --- a/vendor/github.com/PuerkitoBio/purell/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -*.sublime-* -.DS_Store -*.swp -*.swo -tags diff --git a/vendor/github.com/PuerkitoBio/purell/.travis.yml b/vendor/github.com/PuerkitoBio/purell/.travis.yml deleted file mode 100644 index facfc91c..00000000 --- a/vendor/github.com/PuerkitoBio/purell/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: go - -go: - - 1.4 - - 1.5 - - 1.6 - - tip diff --git a/vendor/github.com/PuerkitoBio/purell/LICENSE b/vendor/github.com/PuerkitoBio/purell/LICENSE deleted file mode 100644 index 4b9986de..00000000 --- a/vendor/github.com/PuerkitoBio/purell/LICENSE +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (c) 2012, Martin Angers -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -* Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/PuerkitoBio/purell/README.md b/vendor/github.com/PuerkitoBio/purell/README.md deleted file mode 100644 index 09e8a32c..00000000 --- a/vendor/github.com/PuerkitoBio/purell/README.md +++ /dev/null @@ -1,187 +0,0 @@ -# Purell - -Purell is a tiny Go library to normalize URLs. It returns a pure URL. Pure-ell. Sanitizer and all. Yeah, I know... - -Based on the [wikipedia paper][wiki] and the [RFC 3986 document][rfc]. - -[![build status](https://secure.travis-ci.org/PuerkitoBio/purell.png)](http://travis-ci.org/PuerkitoBio/purell) - -## Install - -`go get github.com/PuerkitoBio/purell` - -## Changelog - -* **2016-11-14 (v1.1.0)** : IDN: Conform to RFC 5895: Fold character width (thanks to @beeker1121). -* **2016-07-27 (v1.0.0)** : Normalize IDN to ASCII (thanks to @zenovich). -* **2015-02-08** : Add fix for relative paths issue ([PR #5][pr5]) and add fix for unnecessary encoding of reserved characters ([see issue #7][iss7]). -* **v0.2.0** : Add benchmarks, Attempt IDN support. -* **v0.1.0** : Initial release. - -## Examples - -From `example_test.go` (note that in your code, you would import "github.com/PuerkitoBio/purell", and would prefix references to its methods and constants with "purell."): - -```go -package purell - -import ( - "fmt" - "net/url" -) - -func ExampleNormalizeURLString() { - if normalized, err := NormalizeURLString("hTTp://someWEBsite.com:80/Amazing%3f/url/", - FlagLowercaseScheme|FlagLowercaseHost|FlagUppercaseEscapes); err != nil { - panic(err) - } else { - fmt.Print(normalized) - } - // Output: http://somewebsite.com:80/Amazing%3F/url/ -} - -func ExampleMustNormalizeURLString() { - normalized := MustNormalizeURLString("hTTpS://someWEBsite.com:443/Amazing%fa/url/", - FlagsUnsafeGreedy) - fmt.Print(normalized) - - // Output: http://somewebsite.com/Amazing%FA/url -} - -func ExampleNormalizeURL() { - if u, err := url.Parse("Http://SomeUrl.com:8080/a/b/.././c///g?c=3&a=1&b=9&c=0#target"); err != nil { - panic(err) - } else { - normalized := NormalizeURL(u, FlagsUsuallySafeGreedy|FlagRemoveDuplicateSlashes|FlagRemoveFragment) - fmt.Print(normalized) - } - - // Output: http://someurl.com:8080/a/c/g?c=3&a=1&b=9&c=0 -} -``` - -## API - -As seen in the examples above, purell offers three methods, `NormalizeURLString(string, NormalizationFlags) (string, error)`, `MustNormalizeURLString(string, NormalizationFlags) (string)` and `NormalizeURL(*url.URL, NormalizationFlags) (string)`. They all normalize the provided URL based on the specified flags. Here are the available flags: - -```go -const ( - // Safe normalizations - FlagLowercaseScheme NormalizationFlags = 1 << iota // HTTP://host -> http://host, applied by default in Go1.1 - FlagLowercaseHost // http://HOST -> http://host - FlagUppercaseEscapes // http://host/t%ef -> http://host/t%EF - FlagDecodeUnnecessaryEscapes // http://host/t%41 -> http://host/tA - FlagEncodeNecessaryEscapes // http://host/!"#$ -> http://host/%21%22#$ - FlagRemoveDefaultPort // http://host:80 -> http://host - FlagRemoveEmptyQuerySeparator // http://host/path? -> http://host/path - - // Usually safe normalizations - FlagRemoveTrailingSlash // http://host/path/ -> http://host/path - FlagAddTrailingSlash // http://host/path -> http://host/path/ (should choose only one of these add/remove trailing slash flags) - FlagRemoveDotSegments // http://host/path/./a/b/../c -> http://host/path/a/c - - // Unsafe normalizations - FlagRemoveDirectoryIndex // http://host/path/index.html -> http://host/path/ - FlagRemoveFragment // http://host/path#fragment -> http://host/path - FlagForceHTTP // https://host -> http://host - FlagRemoveDuplicateSlashes // http://host/path//a///b -> http://host/path/a/b - FlagRemoveWWW // http://www.host/ -> http://host/ - FlagAddWWW // http://host/ -> http://www.host/ (should choose only one of these add/remove WWW flags) - FlagSortQuery // http://host/path?c=3&b=2&a=1&b=1 -> http://host/path?a=1&b=1&b=2&c=3 - - // Normalizations not in the wikipedia article, required to cover tests cases - // submitted by jehiah - FlagDecodeDWORDHost // http://1113982867 -> http://66.102.7.147 - FlagDecodeOctalHost // http://0102.0146.07.0223 -> http://66.102.7.147 - FlagDecodeHexHost // http://0x42660793 -> http://66.102.7.147 - FlagRemoveUnnecessaryHostDots // http://.host../path -> http://host/path - FlagRemoveEmptyPortSeparator // http://host:/path -> http://host/path - - // Convenience set of safe normalizations - FlagsSafe NormalizationFlags = FlagLowercaseHost | FlagLowercaseScheme | FlagUppercaseEscapes | FlagDecodeUnnecessaryEscapes | FlagEncodeNecessaryEscapes | FlagRemoveDefaultPort | FlagRemoveEmptyQuerySeparator - - // For convenience sets, "greedy" uses the "remove trailing slash" and "remove www. prefix" flags, - // while "non-greedy" uses the "add (or keep) the trailing slash" and "add www. prefix". - - // Convenience set of usually safe normalizations (includes FlagsSafe) - FlagsUsuallySafeGreedy NormalizationFlags = FlagsSafe | FlagRemoveTrailingSlash | FlagRemoveDotSegments - FlagsUsuallySafeNonGreedy NormalizationFlags = FlagsSafe | FlagAddTrailingSlash | FlagRemoveDotSegments - - // Convenience set of unsafe normalizations (includes FlagsUsuallySafe) - FlagsUnsafeGreedy NormalizationFlags = FlagsUsuallySafeGreedy | FlagRemoveDirectoryIndex | FlagRemoveFragment | FlagForceHTTP | FlagRemoveDuplicateSlashes | FlagRemoveWWW | FlagSortQuery - FlagsUnsafeNonGreedy NormalizationFlags = FlagsUsuallySafeNonGreedy | FlagRemoveDirectoryIndex | FlagRemoveFragment | FlagForceHTTP | FlagRemoveDuplicateSlashes | FlagAddWWW | FlagSortQuery - - // Convenience set of all available flags - FlagsAllGreedy = FlagsUnsafeGreedy | FlagDecodeDWORDHost | FlagDecodeOctalHost | FlagDecodeHexHost | FlagRemoveUnnecessaryHostDots | FlagRemoveEmptyPortSeparator - FlagsAllNonGreedy = FlagsUnsafeNonGreedy | FlagDecodeDWORDHost | FlagDecodeOctalHost | FlagDecodeHexHost | FlagRemoveUnnecessaryHostDots | FlagRemoveEmptyPortSeparator -) -``` - -For convenience, the set of flags `FlagsSafe`, `FlagsUsuallySafe[Greedy|NonGreedy]`, `FlagsUnsafe[Greedy|NonGreedy]` and `FlagsAll[Greedy|NonGreedy]` are provided for the similarly grouped normalizations on [wikipedia's URL normalization page][wiki]. You can add (using the bitwise OR `|` operator) or remove (using the bitwise AND NOT `&^` operator) individual flags from the sets if required, to build your own custom set. - -The [full godoc reference is available on gopkgdoc][godoc]. - -Some things to note: - -* `FlagDecodeUnnecessaryEscapes`, `FlagEncodeNecessaryEscapes`, `FlagUppercaseEscapes` and `FlagRemoveEmptyQuerySeparator` are always implicitly set, because internally, the URL string is parsed as an URL object, which automatically decodes unnecessary escapes, uppercases and encodes necessary ones, and removes empty query separators (an unnecessary `?` at the end of the url). So this operation cannot **not** be done. For this reason, `FlagRemoveEmptyQuerySeparator` (as well as the other three) has been included in the `FlagsSafe` convenience set, instead of `FlagsUnsafe`, where Wikipedia puts it. - -* The `FlagDecodeUnnecessaryEscapes` decodes the following escapes (*from -> to*): - - %24 -> $ - - %26 -> & - - %2B-%3B -> +,-./0123456789:; - - %3D -> = - - %40-%5A -> @ABCDEFGHIJKLMNOPQRSTUVWXYZ - - %5F -> _ - - %61-%7A -> abcdefghijklmnopqrstuvwxyz - - %7E -> ~ - - -* When the `NormalizeURL` function is used (passing an URL object), this source URL object is modified (that is, after the call, the URL object will be modified to reflect the normalization). - -* The *replace IP with domain name* normalization (`http://208.77.188.166/ → http://www.example.com/`) is obviously not possible for a library without making some network requests. This is not implemented in purell. - -* The *remove unused query string parameters* and *remove default query parameters* are also not implemented, since this is a very case-specific normalization, and it is quite trivial to do with an URL object. - -### Safe vs Usually Safe vs Unsafe - -Purell allows you to control the level of risk you take while normalizing an URL. You can aggressively normalize, play it totally safe, or anything in between. - -Consider the following URL: - -`HTTPS://www.RooT.com/toto/t%45%1f///a/./b/../c/?z=3&w=2&a=4&w=1#invalid` - -Normalizing with the `FlagsSafe` gives: - -`https://www.root.com/toto/tE%1F///a/./b/../c/?z=3&w=2&a=4&w=1#invalid` - -With the `FlagsUsuallySafeGreedy`: - -`https://www.root.com/toto/tE%1F///a/c?z=3&w=2&a=4&w=1#invalid` - -And with `FlagsUnsafeGreedy`: - -`http://root.com/toto/tE%1F/a/c?a=4&w=1&w=2&z=3` - -## TODOs - -* Add a class/default instance to allow specifying custom directory index names? At the moment, removing directory index removes `(^|/)((?:default|index)\.\w{1,4})$`. - -## Thanks / Contributions - -@rogpeppe -@jehiah -@opennota -@pchristopher1275 -@zenovich -@beeker1121 - -## License - -The [BSD 3-Clause license][bsd]. - -[bsd]: http://opensource.org/licenses/BSD-3-Clause -[wiki]: http://en.wikipedia.org/wiki/URL_normalization -[rfc]: http://tools.ietf.org/html/rfc3986#section-6 -[godoc]: http://go.pkgdoc.org/github.com/PuerkitoBio/purell -[pr5]: https://github.com/PuerkitoBio/purell/pull/5 -[iss7]: https://github.com/PuerkitoBio/purell/issues/7 diff --git a/vendor/github.com/PuerkitoBio/purell/bench_test.go b/vendor/github.com/PuerkitoBio/purell/bench_test.go deleted file mode 100644 index 7549731f..00000000 --- a/vendor/github.com/PuerkitoBio/purell/bench_test.go +++ /dev/null @@ -1,57 +0,0 @@ -package purell - -import ( - "testing" -) - -var ( - safeUrl = "HttPS://..iaMHost..Test:443/paTh^A%ef//./%41PaTH/..//?" - usuallySafeUrl = "HttPS://..iaMHost..Test:443/paTh^A%ef//./%41PaTH/../final/" - unsafeUrl = "HttPS://..www.iaMHost..Test:443/paTh^A%ef//./%41PaTH/../final/index.html?t=val1&a=val4&z=val5&a=val1#fragment" - allDWORDUrl = "HttPS://1113982867:/paTh^A%ef//./%41PaTH/../final/index.html?t=val1&a=val4&z=val5&a=val1#fragment" - allOctalUrl = "HttPS://0102.0146.07.0223:/paTh^A%ef//./%41PaTH/../final/index.html?t=val1&a=val4&z=val5&a=val1#fragment" - allHexUrl = "HttPS://0x42660793:/paTh^A%ef//./%41PaTH/../final/index.html?t=val1&a=val4&z=val5&a=val1#fragment" - allCombinedUrl = "HttPS://..0x42660793.:/paTh^A%ef//./%41PaTH/../final/index.html?t=val1&a=val4&z=val5&a=val1#fragment" -) - -func BenchmarkSafe(b *testing.B) { - for i := 0; i < b.N; i++ { - NormalizeURLString(safeUrl, FlagsSafe) - } -} - -func BenchmarkUsuallySafe(b *testing.B) { - for i := 0; i < b.N; i++ { - NormalizeURLString(usuallySafeUrl, FlagsUsuallySafeGreedy) - } -} - -func BenchmarkUnsafe(b *testing.B) { - for i := 0; i < b.N; i++ { - NormalizeURLString(unsafeUrl, FlagsUnsafeGreedy) - } -} - -func BenchmarkAllDWORD(b *testing.B) { - for i := 0; i < b.N; i++ { - NormalizeURLString(allDWORDUrl, FlagsAllGreedy) - } -} - -func BenchmarkAllOctal(b *testing.B) { - for i := 0; i < b.N; i++ { - NormalizeURLString(allOctalUrl, FlagsAllGreedy) - } -} - -func BenchmarkAllHex(b *testing.B) { - for i := 0; i < b.N; i++ { - NormalizeURLString(allHexUrl, FlagsAllGreedy) - } -} - -func BenchmarkAllCombined(b *testing.B) { - for i := 0; i < b.N; i++ { - NormalizeURLString(allCombinedUrl, FlagsAllGreedy) - } -} diff --git a/vendor/github.com/PuerkitoBio/purell/benchmarks/v0.1.0 b/vendor/github.com/PuerkitoBio/purell/benchmarks/v0.1.0 deleted file mode 100644 index 3bbe7113..00000000 --- a/vendor/github.com/PuerkitoBio/purell/benchmarks/v0.1.0 +++ /dev/null @@ -1,9 +0,0 @@ -PASS -BenchmarkSafe 500000 6131 ns/op -BenchmarkUsuallySafe 200000 7864 ns/op -BenchmarkUnsafe 100000 28560 ns/op -BenchmarkAllDWORD 50000 38722 ns/op -BenchmarkAllOctal 50000 40941 ns/op -BenchmarkAllHex 50000 44063 ns/op -BenchmarkAllCombined 50000 33613 ns/op -ok github.com/PuerkitoBio/purell 17.404s diff --git a/vendor/github.com/PuerkitoBio/purell/example_test.go b/vendor/github.com/PuerkitoBio/purell/example_test.go deleted file mode 100644 index 997b9536..00000000 --- a/vendor/github.com/PuerkitoBio/purell/example_test.go +++ /dev/null @@ -1,35 +0,0 @@ -package purell - -import ( - "fmt" - "net/url" -) - -func ExampleNormalizeURLString() { - if normalized, err := NormalizeURLString("hTTp://someWEBsite.com:80/Amazing%3f/url/", - FlagLowercaseScheme|FlagLowercaseHost|FlagUppercaseEscapes); err != nil { - panic(err) - } else { - fmt.Print(normalized) - } - // Output: http://somewebsite.com:80/Amazing%3F/url/ -} - -func ExampleMustNormalizeURLString() { - normalized := MustNormalizeURLString("hTTpS://someWEBsite.com:443/Amazing%fa/url/", - FlagsUnsafeGreedy) - fmt.Print(normalized) - - // Output: http://somewebsite.com/Amazing%FA/url -} - -func ExampleNormalizeURL() { - if u, err := url.Parse("Http://SomeUrl.com:8080/a/b/.././c///g?c=3&a=1&b=9&c=0#target"); err != nil { - panic(err) - } else { - normalized := NormalizeURL(u, FlagsUsuallySafeGreedy|FlagRemoveDuplicateSlashes|FlagRemoveFragment) - fmt.Print(normalized) - } - - // Output: http://someurl.com:8080/a/c/g?c=3&a=1&b=9&c=0 -} diff --git a/vendor/github.com/PuerkitoBio/purell/purell.go b/vendor/github.com/PuerkitoBio/purell/purell.go deleted file mode 100644 index 645e1b76..00000000 --- a/vendor/github.com/PuerkitoBio/purell/purell.go +++ /dev/null @@ -1,379 +0,0 @@ -/* -Package purell offers URL normalization as described on the wikipedia page: -http://en.wikipedia.org/wiki/URL_normalization -*/ -package purell - -import ( - "bytes" - "fmt" - "net/url" - "regexp" - "sort" - "strconv" - "strings" - - "github.com/PuerkitoBio/urlesc" - "golang.org/x/net/idna" - "golang.org/x/text/unicode/norm" - "golang.org/x/text/width" -) - -// A set of normalization flags determines how a URL will -// be normalized. -type NormalizationFlags uint - -const ( - // Safe normalizations - FlagLowercaseScheme NormalizationFlags = 1 << iota // HTTP://host -> http://host, applied by default in Go1.1 - FlagLowercaseHost // http://HOST -> http://host - FlagUppercaseEscapes // http://host/t%ef -> http://host/t%EF - FlagDecodeUnnecessaryEscapes // http://host/t%41 -> http://host/tA - FlagEncodeNecessaryEscapes // http://host/!"#$ -> http://host/%21%22#$ - FlagRemoveDefaultPort // http://host:80 -> http://host - FlagRemoveEmptyQuerySeparator // http://host/path? -> http://host/path - - // Usually safe normalizations - FlagRemoveTrailingSlash // http://host/path/ -> http://host/path - FlagAddTrailingSlash // http://host/path -> http://host/path/ (should choose only one of these add/remove trailing slash flags) - FlagRemoveDotSegments // http://host/path/./a/b/../c -> http://host/path/a/c - - // Unsafe normalizations - FlagRemoveDirectoryIndex // http://host/path/index.html -> http://host/path/ - FlagRemoveFragment // http://host/path#fragment -> http://host/path - FlagForceHTTP // https://host -> http://host - FlagRemoveDuplicateSlashes // http://host/path//a///b -> http://host/path/a/b - FlagRemoveWWW // http://www.host/ -> http://host/ - FlagAddWWW // http://host/ -> http://www.host/ (should choose only one of these add/remove WWW flags) - FlagSortQuery // http://host/path?c=3&b=2&a=1&b=1 -> http://host/path?a=1&b=1&b=2&c=3 - - // Normalizations not in the wikipedia article, required to cover tests cases - // submitted by jehiah - FlagDecodeDWORDHost // http://1113982867 -> http://66.102.7.147 - FlagDecodeOctalHost // http://0102.0146.07.0223 -> http://66.102.7.147 - FlagDecodeHexHost // http://0x42660793 -> http://66.102.7.147 - FlagRemoveUnnecessaryHostDots // http://.host../path -> http://host/path - FlagRemoveEmptyPortSeparator // http://host:/path -> http://host/path - - // Convenience set of safe normalizations - FlagsSafe NormalizationFlags = FlagLowercaseHost | FlagLowercaseScheme | FlagUppercaseEscapes | FlagDecodeUnnecessaryEscapes | FlagEncodeNecessaryEscapes | FlagRemoveDefaultPort | FlagRemoveEmptyQuerySeparator - - // For convenience sets, "greedy" uses the "remove trailing slash" and "remove www. prefix" flags, - // while "non-greedy" uses the "add (or keep) the trailing slash" and "add www. prefix". - - // Convenience set of usually safe normalizations (includes FlagsSafe) - FlagsUsuallySafeGreedy NormalizationFlags = FlagsSafe | FlagRemoveTrailingSlash | FlagRemoveDotSegments - FlagsUsuallySafeNonGreedy NormalizationFlags = FlagsSafe | FlagAddTrailingSlash | FlagRemoveDotSegments - - // Convenience set of unsafe normalizations (includes FlagsUsuallySafe) - FlagsUnsafeGreedy NormalizationFlags = FlagsUsuallySafeGreedy | FlagRemoveDirectoryIndex | FlagRemoveFragment | FlagForceHTTP | FlagRemoveDuplicateSlashes | FlagRemoveWWW | FlagSortQuery - FlagsUnsafeNonGreedy NormalizationFlags = FlagsUsuallySafeNonGreedy | FlagRemoveDirectoryIndex | FlagRemoveFragment | FlagForceHTTP | FlagRemoveDuplicateSlashes | FlagAddWWW | FlagSortQuery - - // Convenience set of all available flags - FlagsAllGreedy = FlagsUnsafeGreedy | FlagDecodeDWORDHost | FlagDecodeOctalHost | FlagDecodeHexHost | FlagRemoveUnnecessaryHostDots | FlagRemoveEmptyPortSeparator - FlagsAllNonGreedy = FlagsUnsafeNonGreedy | FlagDecodeDWORDHost | FlagDecodeOctalHost | FlagDecodeHexHost | FlagRemoveUnnecessaryHostDots | FlagRemoveEmptyPortSeparator -) - -const ( - defaultHttpPort = ":80" - defaultHttpsPort = ":443" -) - -// Regular expressions used by the normalizations -var rxPort = regexp.MustCompile(`(:\d+)/?$`) -var rxDirIndex = regexp.MustCompile(`(^|/)((?:default|index)\.\w{1,4})$`) -var rxDupSlashes = regexp.MustCompile(`/{2,}`) -var rxDWORDHost = regexp.MustCompile(`^(\d+)((?:\.+)?(?:\:\d*)?)$`) -var rxOctalHost = regexp.MustCompile(`^(0\d*)\.(0\d*)\.(0\d*)\.(0\d*)((?:\.+)?(?:\:\d*)?)$`) -var rxHexHost = regexp.MustCompile(`^0x([0-9A-Fa-f]+)((?:\.+)?(?:\:\d*)?)$`) -var rxHostDots = regexp.MustCompile(`^(.+?)(:\d+)?$`) -var rxEmptyPort = regexp.MustCompile(`:+$`) - -// Map of flags to implementation function. -// FlagDecodeUnnecessaryEscapes has no action, since it is done automatically -// by parsing the string as an URL. Same for FlagUppercaseEscapes and FlagRemoveEmptyQuerySeparator. - -// Since maps have undefined traversing order, make a slice of ordered keys -var flagsOrder = []NormalizationFlags{ - FlagLowercaseScheme, - FlagLowercaseHost, - FlagRemoveDefaultPort, - FlagRemoveDirectoryIndex, - FlagRemoveDotSegments, - FlagRemoveFragment, - FlagForceHTTP, // Must be after remove default port (because https=443/http=80) - FlagRemoveDuplicateSlashes, - FlagRemoveWWW, - FlagAddWWW, - FlagSortQuery, - FlagDecodeDWORDHost, - FlagDecodeOctalHost, - FlagDecodeHexHost, - FlagRemoveUnnecessaryHostDots, - FlagRemoveEmptyPortSeparator, - FlagRemoveTrailingSlash, // These two (add/remove trailing slash) must be last - FlagAddTrailingSlash, -} - -// ... and then the map, where order is unimportant -var flags = map[NormalizationFlags]func(*url.URL){ - FlagLowercaseScheme: lowercaseScheme, - FlagLowercaseHost: lowercaseHost, - FlagRemoveDefaultPort: removeDefaultPort, - FlagRemoveDirectoryIndex: removeDirectoryIndex, - FlagRemoveDotSegments: removeDotSegments, - FlagRemoveFragment: removeFragment, - FlagForceHTTP: forceHTTP, - FlagRemoveDuplicateSlashes: removeDuplicateSlashes, - FlagRemoveWWW: removeWWW, - FlagAddWWW: addWWW, - FlagSortQuery: sortQuery, - FlagDecodeDWORDHost: decodeDWORDHost, - FlagDecodeOctalHost: decodeOctalHost, - FlagDecodeHexHost: decodeHexHost, - FlagRemoveUnnecessaryHostDots: removeUnncessaryHostDots, - FlagRemoveEmptyPortSeparator: removeEmptyPortSeparator, - FlagRemoveTrailingSlash: removeTrailingSlash, - FlagAddTrailingSlash: addTrailingSlash, -} - -// MustNormalizeURLString returns the normalized string, and panics if an error occurs. -// It takes an URL string as input, as well as the normalization flags. -func MustNormalizeURLString(u string, f NormalizationFlags) string { - result, e := NormalizeURLString(u, f) - if e != nil { - panic(e) - } - return result -} - -// NormalizeURLString returns the normalized string, or an error if it can't be parsed into an URL object. -// It takes an URL string as input, as well as the normalization flags. -func NormalizeURLString(u string, f NormalizationFlags) (string, error) { - parsed, err := url.Parse(u) - if err != nil { - return "", err - } - - if f&FlagLowercaseHost == FlagLowercaseHost { - parsed.Host = strings.ToLower(parsed.Host) - } - - // The idna package doesn't fully conform to RFC 5895 - // (https://tools.ietf.org/html/rfc5895), so we do it here. - // Taken from Go 1.8 cycle source, courtesy of bradfitz. - // TODO: Remove when (if?) idna package conforms to RFC 5895. - parsed.Host = width.Fold.String(parsed.Host) - parsed.Host = norm.NFC.String(parsed.Host) - if parsed.Host, err = idna.ToASCII(parsed.Host); err != nil { - return "", err - } - - return NormalizeURL(parsed, f), nil -} - -// NormalizeURL returns the normalized string. -// It takes a parsed URL object as input, as well as the normalization flags. -func NormalizeURL(u *url.URL, f NormalizationFlags) string { - for _, k := range flagsOrder { - if f&k == k { - flags[k](u) - } - } - return urlesc.Escape(u) -} - -func lowercaseScheme(u *url.URL) { - if len(u.Scheme) > 0 { - u.Scheme = strings.ToLower(u.Scheme) - } -} - -func lowercaseHost(u *url.URL) { - if len(u.Host) > 0 { - u.Host = strings.ToLower(u.Host) - } -} - -func removeDefaultPort(u *url.URL) { - if len(u.Host) > 0 { - scheme := strings.ToLower(u.Scheme) - u.Host = rxPort.ReplaceAllStringFunc(u.Host, func(val string) string { - if (scheme == "http" && val == defaultHttpPort) || (scheme == "https" && val == defaultHttpsPort) { - return "" - } - return val - }) - } -} - -func removeTrailingSlash(u *url.URL) { - if l := len(u.Path); l > 0 { - if strings.HasSuffix(u.Path, "/") { - u.Path = u.Path[:l-1] - } - } else if l = len(u.Host); l > 0 { - if strings.HasSuffix(u.Host, "/") { - u.Host = u.Host[:l-1] - } - } -} - -func addTrailingSlash(u *url.URL) { - if l := len(u.Path); l > 0 { - if !strings.HasSuffix(u.Path, "/") { - u.Path += "/" - } - } else if l = len(u.Host); l > 0 { - if !strings.HasSuffix(u.Host, "/") { - u.Host += "/" - } - } -} - -func removeDotSegments(u *url.URL) { - if len(u.Path) > 0 { - var dotFree []string - var lastIsDot bool - - sections := strings.Split(u.Path, "/") - for _, s := range sections { - if s == ".." { - if len(dotFree) > 0 { - dotFree = dotFree[:len(dotFree)-1] - } - } else if s != "." { - dotFree = append(dotFree, s) - } - lastIsDot = (s == "." || s == "..") - } - // Special case if host does not end with / and new path does not begin with / - u.Path = strings.Join(dotFree, "/") - if u.Host != "" && !strings.HasSuffix(u.Host, "/") && !strings.HasPrefix(u.Path, "/") { - u.Path = "/" + u.Path - } - // Special case if the last segment was a dot, make sure the path ends with a slash - if lastIsDot && !strings.HasSuffix(u.Path, "/") { - u.Path += "/" - } - } -} - -func removeDirectoryIndex(u *url.URL) { - if len(u.Path) > 0 { - u.Path = rxDirIndex.ReplaceAllString(u.Path, "$1") - } -} - -func removeFragment(u *url.URL) { - u.Fragment = "" -} - -func forceHTTP(u *url.URL) { - if strings.ToLower(u.Scheme) == "https" { - u.Scheme = "http" - } -} - -func removeDuplicateSlashes(u *url.URL) { - if len(u.Path) > 0 { - u.Path = rxDupSlashes.ReplaceAllString(u.Path, "/") - } -} - -func removeWWW(u *url.URL) { - if len(u.Host) > 0 && strings.HasPrefix(strings.ToLower(u.Host), "www.") { - u.Host = u.Host[4:] - } -} - -func addWWW(u *url.URL) { - if len(u.Host) > 0 && !strings.HasPrefix(strings.ToLower(u.Host), "www.") { - u.Host = "www." + u.Host - } -} - -func sortQuery(u *url.URL) { - q := u.Query() - - if len(q) > 0 { - arKeys := make([]string, len(q)) - i := 0 - for k, _ := range q { - arKeys[i] = k - i++ - } - sort.Strings(arKeys) - buf := new(bytes.Buffer) - for _, k := range arKeys { - sort.Strings(q[k]) - for _, v := range q[k] { - if buf.Len() > 0 { - buf.WriteRune('&') - } - buf.WriteString(fmt.Sprintf("%s=%s", k, urlesc.QueryEscape(v))) - } - } - - // Rebuild the raw query string - u.RawQuery = buf.String() - } -} - -func decodeDWORDHost(u *url.URL) { - if len(u.Host) > 0 { - if matches := rxDWORDHost.FindStringSubmatch(u.Host); len(matches) > 2 { - var parts [4]int64 - - dword, _ := strconv.ParseInt(matches[1], 10, 0) - for i, shift := range []uint{24, 16, 8, 0} { - parts[i] = dword >> shift & 0xFF - } - u.Host = fmt.Sprintf("%d.%d.%d.%d%s", parts[0], parts[1], parts[2], parts[3], matches[2]) - } - } -} - -func decodeOctalHost(u *url.URL) { - if len(u.Host) > 0 { - if matches := rxOctalHost.FindStringSubmatch(u.Host); len(matches) > 5 { - var parts [4]int64 - - for i := 1; i <= 4; i++ { - parts[i-1], _ = strconv.ParseInt(matches[i], 8, 0) - } - u.Host = fmt.Sprintf("%d.%d.%d.%d%s", parts[0], parts[1], parts[2], parts[3], matches[5]) - } - } -} - -func decodeHexHost(u *url.URL) { - if len(u.Host) > 0 { - if matches := rxHexHost.FindStringSubmatch(u.Host); len(matches) > 2 { - // Conversion is safe because of regex validation - parsed, _ := strconv.ParseInt(matches[1], 16, 0) - // Set host as DWORD (base 10) encoded host - u.Host = fmt.Sprintf("%d%s", parsed, matches[2]) - // The rest is the same as decoding a DWORD host - decodeDWORDHost(u) - } - } -} - -func removeUnncessaryHostDots(u *url.URL) { - if len(u.Host) > 0 { - if matches := rxHostDots.FindStringSubmatch(u.Host); len(matches) > 1 { - // Trim the leading and trailing dots - u.Host = strings.Trim(matches[1], ".") - if len(matches) > 2 { - u.Host += matches[2] - } - } - } -} - -func removeEmptyPortSeparator(u *url.URL) { - if len(u.Host) > 0 { - u.Host = rxEmptyPort.ReplaceAllString(u.Host, "") - } -} diff --git a/vendor/github.com/PuerkitoBio/purell/purell_test.go b/vendor/github.com/PuerkitoBio/purell/purell_test.go deleted file mode 100644 index a3732e5a..00000000 --- a/vendor/github.com/PuerkitoBio/purell/purell_test.go +++ /dev/null @@ -1,768 +0,0 @@ -package purell - -import ( - "fmt" - "net/url" - "testing" -) - -type testCase struct { - nm string - src string - flgs NormalizationFlags - res string - parsed bool -} - -var ( - cases = [...]*testCase{ - &testCase{ - "LowerScheme", - "HTTP://www.SRC.ca", - FlagLowercaseScheme, - "http://www.SRC.ca", - false, - }, - &testCase{ - "LowerScheme2", - "http://www.SRC.ca", - FlagLowercaseScheme, - "http://www.SRC.ca", - false, - }, - &testCase{ - "LowerHost", - "HTTP://www.SRC.ca/", - FlagLowercaseHost, - "http://www.src.ca/", // Since Go1.1, scheme is automatically lowercased - false, - }, - &testCase{ - "UpperEscapes", - `http://www.whatever.com/Some%aa%20Special%8Ecases/`, - FlagUppercaseEscapes, - "http://www.whatever.com/Some%AA%20Special%8Ecases/", - false, - }, - &testCase{ - "UnnecessaryEscapes", - `http://www.toto.com/%41%42%2E%44/%32%33%52%2D/%5f%7E`, - FlagDecodeUnnecessaryEscapes, - "http://www.toto.com/AB.D/23R-/_~", - false, - }, - &testCase{ - "RemoveDefaultPort", - "HTTP://www.SRC.ca:80/", - FlagRemoveDefaultPort, - "http://www.SRC.ca/", // Since Go1.1, scheme is automatically lowercased - false, - }, - &testCase{ - "RemoveDefaultPort2", - "HTTP://www.SRC.ca:80", - FlagRemoveDefaultPort, - "http://www.SRC.ca", // Since Go1.1, scheme is automatically lowercased - false, - }, - &testCase{ - "RemoveDefaultPort3", - "HTTP://www.SRC.ca:8080", - FlagRemoveDefaultPort, - "http://www.SRC.ca:8080", // Since Go1.1, scheme is automatically lowercased - false, - }, - &testCase{ - "Safe", - "HTTP://www.SRC.ca:80/to%1ato%8b%ee/OKnow%41%42%43%7e", - FlagsSafe, - "http://www.src.ca/to%1Ato%8B%EE/OKnowABC~", - false, - }, - &testCase{ - "BothLower", - "HTTP://www.SRC.ca:80/to%1ato%8b%ee/OKnow%41%42%43%7e", - FlagLowercaseHost | FlagLowercaseScheme, - "http://www.src.ca:80/to%1Ato%8B%EE/OKnowABC~", - false, - }, - &testCase{ - "RemoveTrailingSlash", - "HTTP://www.SRC.ca:80/", - FlagRemoveTrailingSlash, - "http://www.SRC.ca:80", // Since Go1.1, scheme is automatically lowercased - false, - }, - &testCase{ - "RemoveTrailingSlash2", - "HTTP://www.SRC.ca:80/toto/titi/", - FlagRemoveTrailingSlash, - "http://www.SRC.ca:80/toto/titi", // Since Go1.1, scheme is automatically lowercased - false, - }, - &testCase{ - "RemoveTrailingSlash3", - "HTTP://www.SRC.ca:80/toto/titi/fin/?a=1", - FlagRemoveTrailingSlash, - "http://www.SRC.ca:80/toto/titi/fin?a=1", // Since Go1.1, scheme is automatically lowercased - false, - }, - &testCase{ - "AddTrailingSlash", - "HTTP://www.SRC.ca:80", - FlagAddTrailingSlash, - "http://www.SRC.ca:80/", // Since Go1.1, scheme is automatically lowercased - false, - }, - &testCase{ - "AddTrailingSlash2", - "HTTP://www.SRC.ca:80/toto/titi.html", - FlagAddTrailingSlash, - "http://www.SRC.ca:80/toto/titi.html/", // Since Go1.1, scheme is automatically lowercased - false, - }, - &testCase{ - "AddTrailingSlash3", - "HTTP://www.SRC.ca:80/toto/titi/fin?a=1", - FlagAddTrailingSlash, - "http://www.SRC.ca:80/toto/titi/fin/?a=1", // Since Go1.1, scheme is automatically lowercased - false, - }, - &testCase{ - "RemoveDotSegments", - "HTTP://root/a/b/./../../c/", - FlagRemoveDotSegments, - "http://root/c/", // Since Go1.1, scheme is automatically lowercased - false, - }, - &testCase{ - "RemoveDotSegments2", - "HTTP://root/../a/b/./../c/../d", - FlagRemoveDotSegments, - "http://root/a/d", // Since Go1.1, scheme is automatically lowercased - false, - }, - &testCase{ - "UsuallySafe", - "HTTP://www.SRC.ca:80/to%1ato%8b%ee/./c/d/../OKnow%41%42%43%7e/?a=b#test", - FlagsUsuallySafeGreedy, - "http://www.src.ca/to%1Ato%8B%EE/c/OKnowABC~?a=b#test", - false, - }, - &testCase{ - "RemoveDirectoryIndex", - "HTTP://root/a/b/c/default.aspx", - FlagRemoveDirectoryIndex, - "http://root/a/b/c/", // Since Go1.1, scheme is automatically lowercased - false, - }, - &testCase{ - "RemoveDirectoryIndex2", - "HTTP://root/a/b/c/default#a=b", - FlagRemoveDirectoryIndex, - "http://root/a/b/c/default#a=b", // Since Go1.1, scheme is automatically lowercased - false, - }, - &testCase{ - "RemoveFragment", - "HTTP://root/a/b/c/default#toto=tata", - FlagRemoveFragment, - "http://root/a/b/c/default", // Since Go1.1, scheme is automatically lowercased - false, - }, - &testCase{ - "ForceHTTP", - "https://root/a/b/c/default#toto=tata", - FlagForceHTTP, - "http://root/a/b/c/default#toto=tata", - false, - }, - &testCase{ - "RemoveDuplicateSlashes", - "https://root/a//b///c////default#toto=tata", - FlagRemoveDuplicateSlashes, - "https://root/a/b/c/default#toto=tata", - false, - }, - &testCase{ - "RemoveDuplicateSlashes2", - "https://root//a//b///c////default#toto=tata", - FlagRemoveDuplicateSlashes, - "https://root/a/b/c/default#toto=tata", - false, - }, - &testCase{ - "RemoveWWW", - "https://www.root/a/b/c/", - FlagRemoveWWW, - "https://root/a/b/c/", - false, - }, - &testCase{ - "RemoveWWW2", - "https://WwW.Root/a/b/c/", - FlagRemoveWWW, - "https://Root/a/b/c/", - false, - }, - &testCase{ - "AddWWW", - "https://Root/a/b/c/", - FlagAddWWW, - "https://www.Root/a/b/c/", - false, - }, - &testCase{ - "SortQuery", - "http://root/toto/?b=4&a=1&c=3&b=2&a=5", - FlagSortQuery, - "http://root/toto/?a=1&a=5&b=2&b=4&c=3", - false, - }, - &testCase{ - "RemoveEmptyQuerySeparator", - "http://root/toto/?", - FlagRemoveEmptyQuerySeparator, - "http://root/toto/", - false, - }, - &testCase{ - "Unsafe", - "HTTPS://www.RooT.com/toto/t%45%1f///a/./b/../c/?z=3&w=2&a=4&w=1#invalid", - FlagsUnsafeGreedy, - "http://root.com/toto/tE%1F/a/c?a=4&w=1&w=2&z=3", - false, - }, - &testCase{ - "Safe2", - "HTTPS://www.RooT.com/toto/t%45%1f///a/./b/../c/?z=3&w=2&a=4&w=1#invalid", - FlagsSafe, - "https://www.root.com/toto/tE%1F///a/./b/../c/?z=3&w=2&a=4&w=1#invalid", - false, - }, - &testCase{ - "UsuallySafe2", - "HTTPS://www.RooT.com/toto/t%45%1f///a/./b/../c/?z=3&w=2&a=4&w=1#invalid", - FlagsUsuallySafeGreedy, - "https://www.root.com/toto/tE%1F///a/c?z=3&w=2&a=4&w=1#invalid", - false, - }, - &testCase{ - "AddTrailingSlashBug", - "http://src.ca/", - FlagsAllNonGreedy, - "http://www.src.ca/", - false, - }, - &testCase{ - "SourceModified", - "HTTPS://www.RooT.com/toto/t%45%1f///a/./b/../c/?z=3&w=2&a=4&w=1#invalid", - FlagsUnsafeGreedy, - "http://root.com/toto/tE%1F/a/c?a=4&w=1&w=2&z=3", - true, - }, - &testCase{ - "IPv6-1", - "http://[2001:db8:1f70::999:de8:7648:6e8]/test", - FlagsSafe | FlagRemoveDotSegments, - "http://[2001:db8:1f70::999:de8:7648:6e8]/test", - false, - }, - &testCase{ - "IPv6-2", - "http://[::ffff:192.168.1.1]/test", - FlagsSafe | FlagRemoveDotSegments, - "http://[::ffff:192.168.1.1]/test", - false, - }, - &testCase{ - "IPv6-3", - "http://[::ffff:192.168.1.1]:80/test", - FlagsSafe | FlagRemoveDotSegments, - "http://[::ffff:192.168.1.1]/test", - false, - }, - &testCase{ - "IPv6-4", - "htTps://[::fFff:192.168.1.1]:443/test", - FlagsSafe | FlagRemoveDotSegments, - "https://[::ffff:192.168.1.1]/test", - false, - }, - &testCase{ - "FTP", - "ftp://user:pass@ftp.foo.net/foo/bar", - FlagsSafe | FlagRemoveDotSegments, - "ftp://user:pass@ftp.foo.net/foo/bar", - false, - }, - &testCase{ - "Standard-1", - "http://www.foo.com:80/foo", - FlagsSafe | FlagRemoveDotSegments, - "http://www.foo.com/foo", - false, - }, - &testCase{ - "Standard-2", - "http://www.foo.com:8000/foo", - FlagsSafe | FlagRemoveDotSegments, - "http://www.foo.com:8000/foo", - false, - }, - &testCase{ - "Standard-3", - "http://www.foo.com/%7ebar", - FlagsSafe | FlagRemoveDotSegments, - "http://www.foo.com/~bar", - false, - }, - &testCase{ - "Standard-4", - "http://www.foo.com/%7Ebar", - FlagsSafe | FlagRemoveDotSegments, - "http://www.foo.com/~bar", - false, - }, - &testCase{ - "Standard-5", - "http://USER:pass@www.Example.COM/foo/bar", - FlagsSafe | FlagRemoveDotSegments, - "http://USER:pass@www.example.com/foo/bar", - false, - }, - &testCase{ - "Standard-6", - "http://test.example/?a=%26&b=1", - FlagsSafe | FlagRemoveDotSegments, - "http://test.example/?a=%26&b=1", - false, - }, - &testCase{ - "Standard-7", - "http://test.example/%25/?p=%20val%20%25", - FlagsSafe | FlagRemoveDotSegments, - "http://test.example/%25/?p=%20val%20%25", - false, - }, - &testCase{ - "Standard-8", - "http://test.example/path/with a%20space+/", - FlagsSafe | FlagRemoveDotSegments, - "http://test.example/path/with%20a%20space+/", - false, - }, - &testCase{ - "Standard-9", - "http://test.example/?", - FlagsSafe | FlagRemoveDotSegments, - "http://test.example/", - false, - }, - &testCase{ - "Standard-10", - "http://a.COM/path/?b&a", - FlagsSafe | FlagRemoveDotSegments, - "http://a.com/path/?b&a", - false, - }, - &testCase{ - "StandardCasesAddTrailingSlash", - "http://test.example?", - FlagsSafe | FlagAddTrailingSlash, - "http://test.example/", - false, - }, - &testCase{ - "OctalIP-1", - "http://0123.011.0.4/", - FlagsSafe | FlagDecodeOctalHost, - "http://0123.011.0.4/", - false, - }, - &testCase{ - "OctalIP-2", - "http://0102.0146.07.0223/", - FlagsSafe | FlagDecodeOctalHost, - "http://66.102.7.147/", - false, - }, - &testCase{ - "OctalIP-3", - "http://0102.0146.07.0223.:23/", - FlagsSafe | FlagDecodeOctalHost, - "http://66.102.7.147.:23/", - false, - }, - &testCase{ - "OctalIP-4", - "http://USER:pass@0102.0146.07.0223../", - FlagsSafe | FlagDecodeOctalHost, - "http://USER:pass@66.102.7.147../", - false, - }, - &testCase{ - "DWORDIP-1", - "http://123.1113982867/", - FlagsSafe | FlagDecodeDWORDHost, - "http://123.1113982867/", - false, - }, - &testCase{ - "DWORDIP-2", - "http://1113982867/", - FlagsSafe | FlagDecodeDWORDHost, - "http://66.102.7.147/", - false, - }, - &testCase{ - "DWORDIP-3", - "http://1113982867.:23/", - FlagsSafe | FlagDecodeDWORDHost, - "http://66.102.7.147.:23/", - false, - }, - &testCase{ - "DWORDIP-4", - "http://USER:pass@1113982867../", - FlagsSafe | FlagDecodeDWORDHost, - "http://USER:pass@66.102.7.147../", - false, - }, - &testCase{ - "HexIP-1", - "http://0x123.1113982867/", - FlagsSafe | FlagDecodeHexHost, - "http://0x123.1113982867/", - false, - }, - &testCase{ - "HexIP-2", - "http://0x42660793/", - FlagsSafe | FlagDecodeHexHost, - "http://66.102.7.147/", - false, - }, - &testCase{ - "HexIP-3", - "http://0x42660793.:23/", - FlagsSafe | FlagDecodeHexHost, - "http://66.102.7.147.:23/", - false, - }, - &testCase{ - "HexIP-4", - "http://USER:pass@0x42660793../", - FlagsSafe | FlagDecodeHexHost, - "http://USER:pass@66.102.7.147../", - false, - }, - &testCase{ - "UnnecessaryHostDots-1", - "http://.www.foo.com../foo/bar.html", - FlagsSafe | FlagRemoveUnnecessaryHostDots, - "http://www.foo.com/foo/bar.html", - false, - }, - &testCase{ - "UnnecessaryHostDots-2", - "http://www.foo.com./foo/bar.html", - FlagsSafe | FlagRemoveUnnecessaryHostDots, - "http://www.foo.com/foo/bar.html", - false, - }, - &testCase{ - "UnnecessaryHostDots-3", - "http://www.foo.com.:81/foo", - FlagsSafe | FlagRemoveUnnecessaryHostDots, - "http://www.foo.com:81/foo", - false, - }, - &testCase{ - "UnnecessaryHostDots-4", - "http://www.example.com./", - FlagsSafe | FlagRemoveUnnecessaryHostDots, - "http://www.example.com/", - false, - }, - &testCase{ - "EmptyPort-1", - "http://www.thedraymin.co.uk:/main/?p=308", - FlagsSafe | FlagRemoveEmptyPortSeparator, - "http://www.thedraymin.co.uk/main/?p=308", - false, - }, - &testCase{ - "EmptyPort-2", - "http://www.src.ca:", - FlagsSafe | FlagRemoveEmptyPortSeparator, - "http://www.src.ca", - false, - }, - &testCase{ - "Slashes-1", - "http://test.example/foo/bar/.", - FlagsSafe | FlagRemoveDotSegments | FlagRemoveDuplicateSlashes, - "http://test.example/foo/bar/", - false, - }, - &testCase{ - "Slashes-2", - "http://test.example/foo/bar/./", - FlagsSafe | FlagRemoveDotSegments | FlagRemoveDuplicateSlashes, - "http://test.example/foo/bar/", - false, - }, - &testCase{ - "Slashes-3", - "http://test.example/foo/bar/..", - FlagsSafe | FlagRemoveDotSegments | FlagRemoveDuplicateSlashes, - "http://test.example/foo/", - false, - }, - &testCase{ - "Slashes-4", - "http://test.example/foo/bar/../", - FlagsSafe | FlagRemoveDotSegments | FlagRemoveDuplicateSlashes, - "http://test.example/foo/", - false, - }, - &testCase{ - "Slashes-5", - "http://test.example/foo/bar/../baz", - FlagsSafe | FlagRemoveDotSegments | FlagRemoveDuplicateSlashes, - "http://test.example/foo/baz", - false, - }, - &testCase{ - "Slashes-6", - "http://test.example/foo/bar/../..", - FlagsSafe | FlagRemoveDotSegments | FlagRemoveDuplicateSlashes, - "http://test.example/", - false, - }, - &testCase{ - "Slashes-7", - "http://test.example/foo/bar/../../", - FlagsSafe | FlagRemoveDotSegments | FlagRemoveDuplicateSlashes, - "http://test.example/", - false, - }, - &testCase{ - "Slashes-8", - "http://test.example/foo/bar/../../baz", - FlagsSafe | FlagRemoveDotSegments | FlagRemoveDuplicateSlashes, - "http://test.example/baz", - false, - }, - &testCase{ - "Slashes-9", - "http://test.example/foo/bar/../../../baz", - FlagsSafe | FlagRemoveDotSegments | FlagRemoveDuplicateSlashes, - "http://test.example/baz", - false, - }, - &testCase{ - "Slashes-10", - "http://test.example/foo/bar/../../../../baz", - FlagsSafe | FlagRemoveDotSegments | FlagRemoveDuplicateSlashes, - "http://test.example/baz", - false, - }, - &testCase{ - "Slashes-11", - "http://test.example/./foo", - FlagsSafe | FlagRemoveDotSegments | FlagRemoveDuplicateSlashes, - "http://test.example/foo", - false, - }, - &testCase{ - "Slashes-12", - "http://test.example/../foo", - FlagsSafe | FlagRemoveDotSegments | FlagRemoveDuplicateSlashes, - "http://test.example/foo", - false, - }, - &testCase{ - "Slashes-13", - "http://test.example/foo.", - FlagsSafe | FlagRemoveDotSegments | FlagRemoveDuplicateSlashes, - "http://test.example/foo.", - false, - }, - &testCase{ - "Slashes-14", - "http://test.example/.foo", - FlagsSafe | FlagRemoveDotSegments | FlagRemoveDuplicateSlashes, - "http://test.example/.foo", - false, - }, - &testCase{ - "Slashes-15", - "http://test.example/foo..", - FlagsSafe | FlagRemoveDotSegments | FlagRemoveDuplicateSlashes, - "http://test.example/foo..", - false, - }, - &testCase{ - "Slashes-16", - "http://test.example/..foo", - FlagsSafe | FlagRemoveDotSegments | FlagRemoveDuplicateSlashes, - "http://test.example/..foo", - false, - }, - &testCase{ - "Slashes-17", - "http://test.example/./../foo", - FlagsSafe | FlagRemoveDotSegments | FlagRemoveDuplicateSlashes, - "http://test.example/foo", - false, - }, - &testCase{ - "Slashes-18", - "http://test.example/./foo/.", - FlagsSafe | FlagRemoveDotSegments | FlagRemoveDuplicateSlashes, - "http://test.example/foo/", - false, - }, - &testCase{ - "Slashes-19", - "http://test.example/foo/./bar", - FlagsSafe | FlagRemoveDotSegments | FlagRemoveDuplicateSlashes, - "http://test.example/foo/bar", - false, - }, - &testCase{ - "Slashes-20", - "http://test.example/foo/../bar", - FlagsSafe | FlagRemoveDotSegments | FlagRemoveDuplicateSlashes, - "http://test.example/bar", - false, - }, - &testCase{ - "Slashes-21", - "http://test.example/foo//", - FlagsSafe | FlagRemoveDotSegments | FlagRemoveDuplicateSlashes, - "http://test.example/foo/", - false, - }, - &testCase{ - "Slashes-22", - "http://test.example/foo///bar//", - FlagsSafe | FlagRemoveDotSegments | FlagRemoveDuplicateSlashes, - "http://test.example/foo/bar/", - false, - }, - &testCase{ - "Relative", - "foo/bar", - FlagsAllGreedy, - "foo/bar", - false, - }, - &testCase{ - "Relative-1", - "./../foo", - FlagsSafe | FlagRemoveDotSegments | FlagRemoveDuplicateSlashes, - "foo", - false, - }, - &testCase{ - "Relative-2", - "./foo/bar/../baz/../bang/..", - FlagsSafe | FlagRemoveDotSegments | FlagRemoveDuplicateSlashes, - "foo/", - false, - }, - &testCase{ - "Relative-3", - "foo///bar//", - FlagsSafe | FlagRemoveDotSegments | FlagRemoveDuplicateSlashes, - "foo/bar/", - false, - }, - &testCase{ - "Relative-4", - "www.youtube.com", - FlagsUsuallySafeGreedy, - "www.youtube.com", - false, - }, - /*&testCase{ - "UrlNorm-5", - "http://ja.wikipedia.org/wiki/%E3%82%AD%E3%83%A3%E3%82%BF%E3%83%94%E3%83%A9%E3%83%BC%E3%82%B8%E3%83%A3%E3%83%91%E3%83%B3", - FlagsSafe | FlagRemoveDotSegments, - "http://ja.wikipedia.org/wiki/\xe3\x82\xad\xe3\x83\xa3\xe3\x82\xbf\xe3\x83\x94\xe3\x83\xa9\xe3\x83\xbc\xe3\x82\xb8\xe3\x83\xa3\xe3\x83\x91\xe3\x83\xb3", - false, - }, - &testCase{ - "UrlNorm-1", - "http://test.example/?a=%e3%82%82%26", - FlagsAllGreedy, - "http://test.example/?a=\xe3\x82\x82%26", - false, - },*/ - } -) - -func TestRunner(t *testing.T) { - for _, tc := range cases { - runCase(tc, t) - } -} - -func runCase(tc *testCase, t *testing.T) { - t.Logf("running %s...", tc.nm) - if tc.parsed { - u, e := url.Parse(tc.src) - if e != nil { - t.Errorf("%s - FAIL : %s", tc.nm, e) - return - } else { - NormalizeURL(u, tc.flgs) - if s := u.String(); s != tc.res { - t.Errorf("%s - FAIL expected '%s', got '%s'", tc.nm, tc.res, s) - } - } - } else { - if s, e := NormalizeURLString(tc.src, tc.flgs); e != nil { - t.Errorf("%s - FAIL : %s", tc.nm, e) - } else if s != tc.res { - t.Errorf("%s - FAIL expected '%s', got '%s'", tc.nm, tc.res, s) - } - } -} - -func TestDecodeUnnecessaryEscapesAll(t *testing.T) { - var url = "http://host/" - - for i := 0; i < 256; i++ { - url += fmt.Sprintf("%%%02x", i) - } - if s, e := NormalizeURLString(url, FlagDecodeUnnecessaryEscapes); e != nil { - t.Fatalf("Got error %s", e.Error()) - } else { - const want = "http://host/%00%01%02%03%04%05%06%07%08%09%0A%0B%0C%0D%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%20!%22%23$%25&'()*+,-./0123456789:;%3C=%3E%3F@ABCDEFGHIJKLMNOPQRSTUVWXYZ[%5C]%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D~%7F%80%81%82%83%84%85%86%87%88%89%8A%8B%8C%8D%8E%8F%90%91%92%93%94%95%96%97%98%99%9A%9B%9C%9D%9E%9F%A0%A1%A2%A3%A4%A5%A6%A7%A8%A9%AA%AB%AC%AD%AE%AF%B0%B1%B2%B3%B4%B5%B6%B7%B8%B9%BA%BB%BC%BD%BE%BF%C0%C1%C2%C3%C4%C5%C6%C7%C8%C9%CA%CB%CC%CD%CE%CF%D0%D1%D2%D3%D4%D5%D6%D7%D8%D9%DA%DB%DC%DD%DE%DF%E0%E1%E2%E3%E4%E5%E6%E7%E8%E9%EA%EB%EC%ED%EE%EF%F0%F1%F2%F3%F4%F5%F6%F7%F8%F9%FA%FB%FC%FD%FE%FF" - if s != want { - t.Errorf("DecodeUnnecessaryEscapesAll:\nwant\n%s\ngot\n%s", want, s) - } - } -} - -func TestEncodeNecessaryEscapesAll(t *testing.T) { - var url = "http://host/" - - for i := 0; i < 256; i++ { - if i != 0x25 { - url += string(i) - } - } - if s, e := NormalizeURLString(url, FlagEncodeNecessaryEscapes); e != nil { - t.Fatalf("Got error %s", e.Error()) - } else { - const want = "http://host/%00%01%02%03%04%05%06%07%08%09%0A%0B%0C%0D%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%20!%22#$&'()*+,-./0123456789:;%3C=%3E?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[%5C]%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D~%7F%C2%80%C2%81%C2%82%C2%83%C2%84%C2%85%C2%86%C2%87%C2%88%C2%89%C2%8A%C2%8B%C2%8C%C2%8D%C2%8E%C2%8F%C2%90%C2%91%C2%92%C2%93%C2%94%C2%95%C2%96%C2%97%C2%98%C2%99%C2%9A%C2%9B%C2%9C%C2%9D%C2%9E%C2%9F%C2%A0%C2%A1%C2%A2%C2%A3%C2%A4%C2%A5%C2%A6%C2%A7%C2%A8%C2%A9%C2%AA%C2%AB%C2%AC%C2%AD%C2%AE%C2%AF%C2%B0%C2%B1%C2%B2%C2%B3%C2%B4%C2%B5%C2%B6%C2%B7%C2%B8%C2%B9%C2%BA%C2%BB%C2%BC%C2%BD%C2%BE%C2%BF%C3%80%C3%81%C3%82%C3%83%C3%84%C3%85%C3%86%C3%87%C3%88%C3%89%C3%8A%C3%8B%C3%8C%C3%8D%C3%8E%C3%8F%C3%90%C3%91%C3%92%C3%93%C3%94%C3%95%C3%96%C3%97%C3%98%C3%99%C3%9A%C3%9B%C3%9C%C3%9D%C3%9E%C3%9F%C3%A0%C3%A1%C3%A2%C3%A3%C3%A4%C3%A5%C3%A6%C3%A7%C3%A8%C3%A9%C3%AA%C3%AB%C3%AC%C3%AD%C3%AE%C3%AF%C3%B0%C3%B1%C3%B2%C3%B3%C3%B4%C3%B5%C3%B6%C3%B7%C3%B8%C3%B9%C3%BA%C3%BB%C3%BC%C3%BD%C3%BE%C3%BF" - if s != want { - t.Errorf("EncodeNecessaryEscapesAll:\nwant\n%s\ngot\n%s", want, s) - } - } -} diff --git a/vendor/github.com/PuerkitoBio/purell/urlnorm_test.go b/vendor/github.com/PuerkitoBio/purell/urlnorm_test.go deleted file mode 100644 index d1b2ca6c..00000000 --- a/vendor/github.com/PuerkitoBio/purell/urlnorm_test.go +++ /dev/null @@ -1,53 +0,0 @@ -package purell - -import ( - "testing" -) - -// Test cases merged from PR #1 -// Originally from https://github.com/jehiah/urlnorm/blob/master/test_urlnorm.py - -func assertMap(t *testing.T, cases map[string]string, f NormalizationFlags) { - for bad, good := range cases { - s, e := NormalizeURLString(bad, f) - if e != nil { - t.Errorf("%s normalizing %v to %v", e.Error(), bad, good) - } else { - if s != good { - t.Errorf("source: %v expected: %v got: %v", bad, good, s) - } - } - } -} - -// This tests normalization to a unicode representation -// precent escapes for unreserved values are unescaped to their unicode value -// tests normalization to idna domains -// test ip word handling, ipv6 address handling, and trailing domain periods -// in general, this matches google chromes unescaping for things in the address bar. -// spaces are converted to '+' (perhaphs controversial) -// http://code.google.com/p/google-url/ probably is another good reference for this approach -func TestUrlnorm(t *testing.T) { - testcases := map[string]string{ - "http://test.example/?a=%e3%82%82%26": "http://test.example/?a=%e3%82%82%26", - //"http://test.example/?a=%e3%82%82%26": "http://test.example/?a=\xe3\x82\x82%26", //should return a unicode character - "http://s.xn--q-bga.DE/": "http://s.xn--q-bga.de/", //should be in idna format - "http://XBLA\u306eXbox.com": "http://xn--xblaxbox-jf4g.com", //test utf8 and unicode - "http://президент.рф": "http://xn--d1abbgf6aiiy.xn--p1ai", - "http://ПРЕЗИДЕНТ.РФ": "http://xn--d1abbgf6aiiy.xn--p1ai", - "http://ab¥ヲ₩○.com": "http://xn--ab-ida8983azmfnvs.com", //test width folding - "http://\u00e9.com": "http://xn--9ca.com", - "http://e\u0301.com": "http://xn--9ca.com", - "http://ja.wikipedia.org/wiki/%E3%82%AD%E3%83%A3%E3%82%BF%E3%83%94%E3%83%A9%E3%83%BC%E3%82%B8%E3%83%A3%E3%83%91%E3%83%B3": "http://ja.wikipedia.org/wiki/%E3%82%AD%E3%83%A3%E3%82%BF%E3%83%94%E3%83%A9%E3%83%BC%E3%82%B8%E3%83%A3%E3%83%91%E3%83%B3", - //"http://ja.wikipedia.org/wiki/%E3%82%AD%E3%83%A3%E3%82%BF%E3%83%94%E3%83%A9%E3%83%BC%E3%82%B8%E3%83%A3%E3%83%91%E3%83%B3": "http://ja.wikipedia.org/wiki/\xe3\x82\xad\xe3\x83\xa3\xe3\x82\xbf\xe3\x83\x94\xe3\x83\xa9\xe3\x83\xbc\xe3\x82\xb8\xe3\x83\xa3\xe3\x83\x91\xe3\x83\xb3", - - "http://test.example/\xe3\x82\xad": "http://test.example/%E3%82%AD", - //"http://test.example/\xe3\x82\xad": "http://test.example/\xe3\x82\xad", - "http://test.example/?p=%23val#test-%23-val%25": "http://test.example/?p=%23val#test-%23-val%25", //check that %23 (#) is not escaped where it shouldn't be - - "http://test.domain/I%C3%B1t%C3%ABrn%C3%A2ti%C3%B4n%EF%BF%BDliz%C3%A6ti%C3%B8n": "http://test.domain/I%C3%B1t%C3%ABrn%C3%A2ti%C3%B4n%EF%BF%BDliz%C3%A6ti%C3%B8n", - //"http://test.domain/I%C3%B1t%C3%ABrn%C3%A2ti%C3%B4n%EF%BF%BDliz%C3%A6ti%C3%B8n": "http://test.domain/I\xc3\xb1t\xc3\xabrn\xc3\xa2ti\xc3\xb4n\xef\xbf\xbdliz\xc3\xa6ti\xc3\xb8n", - } - - assertMap(t, testcases, FlagsSafe|FlagRemoveDotSegments) -} diff --git a/vendor/github.com/PuerkitoBio/urlesc/.travis.yml b/vendor/github.com/PuerkitoBio/urlesc/.travis.yml deleted file mode 100644 index ba6b225f..00000000 --- a/vendor/github.com/PuerkitoBio/urlesc/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: go - -go: - - 1.4.x - - 1.5.x - - 1.6.x - - 1.7.x - - 1.8.x - - tip - -install: - - go build . - -script: - - go test -v diff --git a/vendor/github.com/PuerkitoBio/urlesc/LICENSE b/vendor/github.com/PuerkitoBio/urlesc/LICENSE deleted file mode 100644 index 74487567..00000000 --- a/vendor/github.com/PuerkitoBio/urlesc/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2012 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/PuerkitoBio/urlesc/README.md b/vendor/github.com/PuerkitoBio/urlesc/README.md deleted file mode 100644 index 57aff0a5..00000000 --- a/vendor/github.com/PuerkitoBio/urlesc/README.md +++ /dev/null @@ -1,16 +0,0 @@ -urlesc [![Build Status](https://travis-ci.org/PuerkitoBio/urlesc.svg?branch=master)](https://travis-ci.org/PuerkitoBio/urlesc) [![GoDoc](http://godoc.org/github.com/PuerkitoBio/urlesc?status.svg)](http://godoc.org/github.com/PuerkitoBio/urlesc) -====== - -Package urlesc implements query escaping as per RFC 3986. - -It contains some parts of the net/url package, modified so as to allow -some reserved characters incorrectly escaped by net/url (see [issue 5684](https://github.com/golang/go/issues/5684)). - -## Install - - go get github.com/PuerkitoBio/urlesc - -## License - -Go license (BSD-3-Clause) - diff --git a/vendor/github.com/PuerkitoBio/urlesc/urlesc.go b/vendor/github.com/PuerkitoBio/urlesc/urlesc.go deleted file mode 100644 index 1b846245..00000000 --- a/vendor/github.com/PuerkitoBio/urlesc/urlesc.go +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package urlesc implements query escaping as per RFC 3986. -// It contains some parts of the net/url package, modified so as to allow -// some reserved characters incorrectly escaped by net/url. -// See https://github.com/golang/go/issues/5684 -package urlesc - -import ( - "bytes" - "net/url" - "strings" -) - -type encoding int - -const ( - encodePath encoding = 1 + iota - encodeUserPassword - encodeQueryComponent - encodeFragment -) - -// Return true if the specified character should be escaped when -// appearing in a URL string, according to RFC 3986. -func shouldEscape(c byte, mode encoding) bool { - // §2.3 Unreserved characters (alphanum) - if 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z' || '0' <= c && c <= '9' { - return false - } - - switch c { - case '-', '.', '_', '~': // §2.3 Unreserved characters (mark) - return false - - // §2.2 Reserved characters (reserved) - case ':', '/', '?', '#', '[', ']', '@', // gen-delims - '!', '$', '&', '\'', '(', ')', '*', '+', ',', ';', '=': // sub-delims - // Different sections of the URL allow a few of - // the reserved characters to appear unescaped. - switch mode { - case encodePath: // §3.3 - // The RFC allows sub-delims and : @. - // '/', '[' and ']' can be used to assign meaning to individual path - // segments. This package only manipulates the path as a whole, - // so we allow those as well. That leaves only ? and # to escape. - return c == '?' || c == '#' - - case encodeUserPassword: // §3.2.1 - // The RFC allows : and sub-delims in - // userinfo. The parsing of userinfo treats ':' as special so we must escape - // all the gen-delims. - return c == ':' || c == '/' || c == '?' || c == '#' || c == '[' || c == ']' || c == '@' - - case encodeQueryComponent: // §3.4 - // The RFC allows / and ?. - return c != '/' && c != '?' - - case encodeFragment: // §4.1 - // The RFC text is silent but the grammar allows - // everything, so escape nothing but # - return c == '#' - } - } - - // Everything else must be escaped. - return true -} - -// QueryEscape escapes the string so it can be safely placed -// inside a URL query. -func QueryEscape(s string) string { - return escape(s, encodeQueryComponent) -} - -func escape(s string, mode encoding) string { - spaceCount, hexCount := 0, 0 - for i := 0; i < len(s); i++ { - c := s[i] - if shouldEscape(c, mode) { - if c == ' ' && mode == encodeQueryComponent { - spaceCount++ - } else { - hexCount++ - } - } - } - - if spaceCount == 0 && hexCount == 0 { - return s - } - - t := make([]byte, len(s)+2*hexCount) - j := 0 - for i := 0; i < len(s); i++ { - switch c := s[i]; { - case c == ' ' && mode == encodeQueryComponent: - t[j] = '+' - j++ - case shouldEscape(c, mode): - t[j] = '%' - t[j+1] = "0123456789ABCDEF"[c>>4] - t[j+2] = "0123456789ABCDEF"[c&15] - j += 3 - default: - t[j] = s[i] - j++ - } - } - return string(t) -} - -var uiReplacer = strings.NewReplacer( - "%21", "!", - "%27", "'", - "%28", "(", - "%29", ")", - "%2A", "*", -) - -// unescapeUserinfo unescapes some characters that need not to be escaped as per RFC3986. -func unescapeUserinfo(s string) string { - return uiReplacer.Replace(s) -} - -// Escape reassembles the URL into a valid URL string. -// The general form of the result is one of: -// -// scheme:opaque -// scheme://userinfo@host/path?query#fragment -// -// If u.Opaque is non-empty, String uses the first form; -// otherwise it uses the second form. -// -// In the second form, the following rules apply: -// - if u.Scheme is empty, scheme: is omitted. -// - if u.User is nil, userinfo@ is omitted. -// - if u.Host is empty, host/ is omitted. -// - if u.Scheme and u.Host are empty and u.User is nil, -// the entire scheme://userinfo@host/ is omitted. -// - if u.Host is non-empty and u.Path begins with a /, -// the form host/path does not add its own /. -// - if u.RawQuery is empty, ?query is omitted. -// - if u.Fragment is empty, #fragment is omitted. -func Escape(u *url.URL) string { - var buf bytes.Buffer - if u.Scheme != "" { - buf.WriteString(u.Scheme) - buf.WriteByte(':') - } - if u.Opaque != "" { - buf.WriteString(u.Opaque) - } else { - if u.Scheme != "" || u.Host != "" || u.User != nil { - buf.WriteString("//") - if ui := u.User; ui != nil { - buf.WriteString(unescapeUserinfo(ui.String())) - buf.WriteByte('@') - } - if h := u.Host; h != "" { - buf.WriteString(h) - } - } - if u.Path != "" && u.Path[0] != '/' && u.Host != "" { - buf.WriteByte('/') - } - buf.WriteString(escape(u.Path, encodePath)) - } - if u.RawQuery != "" { - buf.WriteByte('?') - buf.WriteString(u.RawQuery) - } - if u.Fragment != "" { - buf.WriteByte('#') - buf.WriteString(escape(u.Fragment, encodeFragment)) - } - return buf.String() -} diff --git a/vendor/github.com/PuerkitoBio/urlesc/urlesc_test.go b/vendor/github.com/PuerkitoBio/urlesc/urlesc_test.go deleted file mode 100644 index 45202e1d..00000000 --- a/vendor/github.com/PuerkitoBio/urlesc/urlesc_test.go +++ /dev/null @@ -1,641 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package urlesc - -import ( - "net/url" - "testing" -) - -type URLTest struct { - in string - out *url.URL - roundtrip string // expected result of reserializing the URL; empty means same as "in". -} - -var urltests = []URLTest{ - // no path - { - "http://www.google.com", - &url.URL{ - Scheme: "http", - Host: "www.google.com", - }, - "", - }, - // path - { - "http://www.google.com/", - &url.URL{ - Scheme: "http", - Host: "www.google.com", - Path: "/", - }, - "", - }, - // path with hex escaping - { - "http://www.google.com/file%20one%26two", - &url.URL{ - Scheme: "http", - Host: "www.google.com", - Path: "/file one&two", - }, - "http://www.google.com/file%20one&two", - }, - // user - { - "ftp://webmaster@www.google.com/", - &url.URL{ - Scheme: "ftp", - User: url.User("webmaster"), - Host: "www.google.com", - Path: "/", - }, - "", - }, - // escape sequence in username - { - "ftp://john%20doe@www.google.com/", - &url.URL{ - Scheme: "ftp", - User: url.User("john doe"), - Host: "www.google.com", - Path: "/", - }, - "ftp://john%20doe@www.google.com/", - }, - // query - { - "http://www.google.com/?q=go+language", - &url.URL{ - Scheme: "http", - Host: "www.google.com", - Path: "/", - RawQuery: "q=go+language", - }, - "", - }, - // query with hex escaping: NOT parsed - { - "http://www.google.com/?q=go%20language", - &url.URL{ - Scheme: "http", - Host: "www.google.com", - Path: "/", - RawQuery: "q=go%20language", - }, - "", - }, - // %20 outside query - { - "http://www.google.com/a%20b?q=c+d", - &url.URL{ - Scheme: "http", - Host: "www.google.com", - Path: "/a b", - RawQuery: "q=c+d", - }, - "", - }, - // path without leading /, so no parsing - { - "http:www.google.com/?q=go+language", - &url.URL{ - Scheme: "http", - Opaque: "www.google.com/", - RawQuery: "q=go+language", - }, - "http:www.google.com/?q=go+language", - }, - // path without leading /, so no parsing - { - "http:%2f%2fwww.google.com/?q=go+language", - &url.URL{ - Scheme: "http", - Opaque: "%2f%2fwww.google.com/", - RawQuery: "q=go+language", - }, - "http:%2f%2fwww.google.com/?q=go+language", - }, - // non-authority with path - { - "mailto:/webmaster@golang.org", - &url.URL{ - Scheme: "mailto", - Path: "/webmaster@golang.org", - }, - "mailto:///webmaster@golang.org", // unfortunate compromise - }, - // non-authority - { - "mailto:webmaster@golang.org", - &url.URL{ - Scheme: "mailto", - Opaque: "webmaster@golang.org", - }, - "", - }, - // unescaped :// in query should not create a scheme - { - "/foo?query=http://bad", - &url.URL{ - Path: "/foo", - RawQuery: "query=http://bad", - }, - "", - }, - // leading // without scheme should create an authority - { - "//foo", - &url.URL{ - Host: "foo", - }, - "", - }, - // leading // without scheme, with userinfo, path, and query - { - "//user@foo/path?a=b", - &url.URL{ - User: url.User("user"), - Host: "foo", - Path: "/path", - RawQuery: "a=b", - }, - "", - }, - // Three leading slashes isn't an authority, but doesn't return an error. - // (We can't return an error, as this code is also used via - // ServeHTTP -> ReadRequest -> Parse, which is arguably a - // different URL parsing context, but currently shares the - // same codepath) - { - "///threeslashes", - &url.URL{ - Path: "///threeslashes", - }, - "", - }, - { - "http://user:password@google.com", - &url.URL{ - Scheme: "http", - User: url.UserPassword("user", "password"), - Host: "google.com", - }, - "http://user:password@google.com", - }, - // unescaped @ in username should not confuse host - { - "http://j@ne:password@google.com", - &url.URL{ - Scheme: "http", - User: url.UserPassword("j@ne", "password"), - Host: "google.com", - }, - "http://j%40ne:password@google.com", - }, - // unescaped @ in password should not confuse host - { - "http://jane:p@ssword@google.com", - &url.URL{ - Scheme: "http", - User: url.UserPassword("jane", "p@ssword"), - Host: "google.com", - }, - "http://jane:p%40ssword@google.com", - }, - { - "http://j@ne:password@google.com/p@th?q=@go", - &url.URL{ - Scheme: "http", - User: url.UserPassword("j@ne", "password"), - Host: "google.com", - Path: "/p@th", - RawQuery: "q=@go", - }, - "http://j%40ne:password@google.com/p@th?q=@go", - }, - { - "http://www.google.com/?q=go+language#foo", - &url.URL{ - Scheme: "http", - Host: "www.google.com", - Path: "/", - RawQuery: "q=go+language", - Fragment: "foo", - }, - "", - }, - { - "http://www.google.com/?q=go+language#foo%26bar", - &url.URL{ - Scheme: "http", - Host: "www.google.com", - Path: "/", - RawQuery: "q=go+language", - Fragment: "foo&bar", - }, - "http://www.google.com/?q=go+language#foo&bar", - }, - { - "file:///home/adg/rabbits", - &url.URL{ - Scheme: "file", - Host: "", - Path: "/home/adg/rabbits", - }, - "file:///home/adg/rabbits", - }, - // "Windows" paths are no exception to the rule. - // See golang.org/issue/6027, especially comment #9. - { - "file:///C:/FooBar/Baz.txt", - &url.URL{ - Scheme: "file", - Host: "", - Path: "/C:/FooBar/Baz.txt", - }, - "file:///C:/FooBar/Baz.txt", - }, - // case-insensitive scheme - { - "MaIlTo:webmaster@golang.org", - &url.URL{ - Scheme: "mailto", - Opaque: "webmaster@golang.org", - }, - "mailto:webmaster@golang.org", - }, - // Relative path - { - "a/b/c", - &url.URL{ - Path: "a/b/c", - }, - "a/b/c", - }, - // escaped '?' in username and password - { - "http://%3Fam:pa%3Fsword@google.com", - &url.URL{ - Scheme: "http", - User: url.UserPassword("?am", "pa?sword"), - Host: "google.com", - }, - "", - }, - // escaped '?' and '#' in path - { - "http://example.com/%3F%23", - &url.URL{ - Scheme: "http", - Host: "example.com", - Path: "?#", - }, - "", - }, - // unescaped [ ] ! ' ( ) * in path - { - "http://example.com/[]!'()*", - &url.URL{ - Scheme: "http", - Host: "example.com", - Path: "[]!'()*", - }, - "http://example.com/[]!'()*", - }, - // escaped : / ? # [ ] @ in username and password - { - "http://%3A%2F%3F:%23%5B%5D%40@example.com", - &url.URL{ - Scheme: "http", - User: url.UserPassword(":/?", "#[]@"), - Host: "example.com", - }, - "", - }, - // unescaped ! $ & ' ( ) * + , ; = in username and password - { - "http://!$&'():*+,;=@example.com", - &url.URL{ - Scheme: "http", - User: url.UserPassword("!$&'()", "*+,;="), - Host: "example.com", - }, - "", - }, - // unescaped = : / . ? = in query component - { - "http://example.com/?q=http://google.com/?q=", - &url.URL{ - Scheme: "http", - Host: "example.com", - Path: "/", - RawQuery: "q=http://google.com/?q=", - }, - "", - }, - // unescaped : / ? [ ] @ ! $ & ' ( ) * + , ; = in fragment - { - "http://example.com/#:/?%23[]@!$&'()*+,;=", - &url.URL{ - Scheme: "http", - Host: "example.com", - Path: "/", - Fragment: ":/?#[]@!$&'()*+,;=", - }, - "", - }, -} - -func DoTestString(t *testing.T, parse func(string) (*url.URL, error), name string, tests []URLTest) { - for _, tt := range tests { - u, err := parse(tt.in) - if err != nil { - t.Errorf("%s(%q) returned error %s", name, tt.in, err) - continue - } - expected := tt.in - if len(tt.roundtrip) > 0 { - expected = tt.roundtrip - } - s := Escape(u) - if s != expected { - t.Errorf("Escape(%s(%q)) == %q (expected %q)", name, tt.in, s, expected) - } - } -} - -func TestURLString(t *testing.T) { - DoTestString(t, url.Parse, "Parse", urltests) - - // no leading slash on path should prepend - // slash on String() call - noslash := URLTest{ - "http://www.google.com/search", - &url.URL{ - Scheme: "http", - Host: "www.google.com", - Path: "search", - }, - "", - } - s := Escape(noslash.out) - if s != noslash.in { - t.Errorf("Expected %s; go %s", noslash.in, s) - } -} - -type EscapeTest struct { - in string - out string - err error -} - -var escapeTests = []EscapeTest{ - { - "", - "", - nil, - }, - { - "abc", - "abc", - nil, - }, - { - "one two", - "one+two", - nil, - }, - { - "10%", - "10%25", - nil, - }, - { - " ?&=#+%!<>#\"{}|\\^[]`☺\t:/@$'()*,;", - "+?%26%3D%23%2B%25%21%3C%3E%23%22%7B%7D%7C%5C%5E%5B%5D%60%E2%98%BA%09%3A/%40%24%27%28%29%2A%2C%3B", - nil, - }, -} - -func TestEscape(t *testing.T) { - for _, tt := range escapeTests { - actual := QueryEscape(tt.in) - if tt.out != actual { - t.Errorf("QueryEscape(%q) = %q, want %q", tt.in, actual, tt.out) - } - - // for bonus points, verify that escape:unescape is an identity. - roundtrip, err := url.QueryUnescape(actual) - if roundtrip != tt.in || err != nil { - t.Errorf("QueryUnescape(%q) = %q, %s; want %q, %s", actual, roundtrip, err, tt.in, "[no error]") - } - } -} - -var resolveReferenceTests = []struct { - base, rel, expected string -}{ - // Absolute URL references - {"http://foo.com?a=b", "https://bar.com/", "https://bar.com/"}, - {"http://foo.com/", "https://bar.com/?a=b", "https://bar.com/?a=b"}, - {"http://foo.com/bar", "mailto:foo@example.com", "mailto:foo@example.com"}, - - // Path-absolute references - {"http://foo.com/bar", "/baz", "http://foo.com/baz"}, - {"http://foo.com/bar?a=b#f", "/baz", "http://foo.com/baz"}, - {"http://foo.com/bar?a=b", "/baz?c=d", "http://foo.com/baz?c=d"}, - - // Scheme-relative - {"https://foo.com/bar?a=b", "//bar.com/quux", "https://bar.com/quux"}, - - // Path-relative references: - - // ... current directory - {"http://foo.com", ".", "http://foo.com/"}, - {"http://foo.com/bar", ".", "http://foo.com/"}, - {"http://foo.com/bar/", ".", "http://foo.com/bar/"}, - - // ... going down - {"http://foo.com", "bar", "http://foo.com/bar"}, - {"http://foo.com/", "bar", "http://foo.com/bar"}, - {"http://foo.com/bar/baz", "quux", "http://foo.com/bar/quux"}, - - // ... going up - {"http://foo.com/bar/baz", "../quux", "http://foo.com/quux"}, - {"http://foo.com/bar/baz", "../../../../../quux", "http://foo.com/quux"}, - {"http://foo.com/bar", "..", "http://foo.com/"}, - {"http://foo.com/bar/baz", "./..", "http://foo.com/"}, - // ".." in the middle (issue 3560) - {"http://foo.com/bar/baz", "quux/dotdot/../tail", "http://foo.com/bar/quux/tail"}, - {"http://foo.com/bar/baz", "quux/./dotdot/../tail", "http://foo.com/bar/quux/tail"}, - {"http://foo.com/bar/baz", "quux/./dotdot/.././tail", "http://foo.com/bar/quux/tail"}, - {"http://foo.com/bar/baz", "quux/./dotdot/./../tail", "http://foo.com/bar/quux/tail"}, - {"http://foo.com/bar/baz", "quux/./dotdot/dotdot/././../../tail", "http://foo.com/bar/quux/tail"}, - {"http://foo.com/bar/baz", "quux/./dotdot/dotdot/./.././../tail", "http://foo.com/bar/quux/tail"}, - {"http://foo.com/bar/baz", "quux/./dotdot/dotdot/dotdot/./../../.././././tail", "http://foo.com/bar/quux/tail"}, - {"http://foo.com/bar/baz", "quux/./dotdot/../dotdot/../dot/./tail/..", "http://foo.com/bar/quux/dot/"}, - - // Remove any dot-segments prior to forming the target URI. - // http://tools.ietf.org/html/rfc3986#section-5.2.4 - {"http://foo.com/dot/./dotdot/../foo/bar", "../baz", "http://foo.com/dot/baz"}, - - // Triple dot isn't special - {"http://foo.com/bar", "...", "http://foo.com/..."}, - - // Fragment - {"http://foo.com/bar", ".#frag", "http://foo.com/#frag"}, - - // RFC 3986: Normal Examples - // http://tools.ietf.org/html/rfc3986#section-5.4.1 - {"http://a/b/c/d;p?q", "g:h", "g:h"}, - {"http://a/b/c/d;p?q", "g", "http://a/b/c/g"}, - {"http://a/b/c/d;p?q", "./g", "http://a/b/c/g"}, - {"http://a/b/c/d;p?q", "g/", "http://a/b/c/g/"}, - {"http://a/b/c/d;p?q", "/g", "http://a/g"}, - {"http://a/b/c/d;p?q", "//g", "http://g"}, - {"http://a/b/c/d;p?q", "?y", "http://a/b/c/d;p?y"}, - {"http://a/b/c/d;p?q", "g?y", "http://a/b/c/g?y"}, - {"http://a/b/c/d;p?q", "#s", "http://a/b/c/d;p?q#s"}, - {"http://a/b/c/d;p?q", "g#s", "http://a/b/c/g#s"}, - {"http://a/b/c/d;p?q", "g?y#s", "http://a/b/c/g?y#s"}, - {"http://a/b/c/d;p?q", ";x", "http://a/b/c/;x"}, - {"http://a/b/c/d;p?q", "g;x", "http://a/b/c/g;x"}, - {"http://a/b/c/d;p?q", "g;x?y#s", "http://a/b/c/g;x?y#s"}, - {"http://a/b/c/d;p?q", "", "http://a/b/c/d;p?q"}, - {"http://a/b/c/d;p?q", ".", "http://a/b/c/"}, - {"http://a/b/c/d;p?q", "./", "http://a/b/c/"}, - {"http://a/b/c/d;p?q", "..", "http://a/b/"}, - {"http://a/b/c/d;p?q", "../", "http://a/b/"}, - {"http://a/b/c/d;p?q", "../g", "http://a/b/g"}, - {"http://a/b/c/d;p?q", "../..", "http://a/"}, - {"http://a/b/c/d;p?q", "../../", "http://a/"}, - {"http://a/b/c/d;p?q", "../../g", "http://a/g"}, - - // RFC 3986: Abnormal Examples - // http://tools.ietf.org/html/rfc3986#section-5.4.2 - {"http://a/b/c/d;p?q", "../../../g", "http://a/g"}, - {"http://a/b/c/d;p?q", "../../../../g", "http://a/g"}, - {"http://a/b/c/d;p?q", "/./g", "http://a/g"}, - {"http://a/b/c/d;p?q", "/../g", "http://a/g"}, - {"http://a/b/c/d;p?q", "g.", "http://a/b/c/g."}, - {"http://a/b/c/d;p?q", ".g", "http://a/b/c/.g"}, - {"http://a/b/c/d;p?q", "g..", "http://a/b/c/g.."}, - {"http://a/b/c/d;p?q", "..g", "http://a/b/c/..g"}, - {"http://a/b/c/d;p?q", "./../g", "http://a/b/g"}, - {"http://a/b/c/d;p?q", "./g/.", "http://a/b/c/g/"}, - {"http://a/b/c/d;p?q", "g/./h", "http://a/b/c/g/h"}, - {"http://a/b/c/d;p?q", "g/../h", "http://a/b/c/h"}, - {"http://a/b/c/d;p?q", "g;x=1/./y", "http://a/b/c/g;x=1/y"}, - {"http://a/b/c/d;p?q", "g;x=1/../y", "http://a/b/c/y"}, - {"http://a/b/c/d;p?q", "g?y/./x", "http://a/b/c/g?y/./x"}, - {"http://a/b/c/d;p?q", "g?y/../x", "http://a/b/c/g?y/../x"}, - {"http://a/b/c/d;p?q", "g#s/./x", "http://a/b/c/g#s/./x"}, - {"http://a/b/c/d;p?q", "g#s/../x", "http://a/b/c/g#s/../x"}, - - // Extras. - {"https://a/b/c/d;p?q", "//g?q", "https://g?q"}, - {"https://a/b/c/d;p?q", "//g#s", "https://g#s"}, - {"https://a/b/c/d;p?q", "//g/d/e/f?y#s", "https://g/d/e/f?y#s"}, - {"https://a/b/c/d;p#s", "?y", "https://a/b/c/d;p?y"}, - {"https://a/b/c/d;p?q#s", "?y", "https://a/b/c/d;p?y"}, -} - -func TestResolveReference(t *testing.T) { - mustParse := func(url_ string) *url.URL { - u, err := url.Parse(url_) - if err != nil { - t.Fatalf("Expected URL to parse: %q, got error: %v", url_, err) - } - return u - } - opaque := &url.URL{Scheme: "scheme", Opaque: "opaque"} - for _, test := range resolveReferenceTests { - base := mustParse(test.base) - rel := mustParse(test.rel) - url := base.ResolveReference(rel) - if Escape(url) != test.expected { - t.Errorf("URL(%q).ResolveReference(%q) == %q, got %q", test.base, test.rel, test.expected, Escape(url)) - } - // Ensure that new instances are returned. - if base == url { - t.Errorf("Expected URL.ResolveReference to return new URL instance.") - } - // Test the convenience wrapper too. - url, err := base.Parse(test.rel) - if err != nil { - t.Errorf("URL(%q).Parse(%q) failed: %v", test.base, test.rel, err) - } else if Escape(url) != test.expected { - t.Errorf("URL(%q).Parse(%q) == %q, got %q", test.base, test.rel, test.expected, Escape(url)) - } else if base == url { - // Ensure that new instances are returned for the wrapper too. - t.Errorf("Expected URL.Parse to return new URL instance.") - } - // Ensure Opaque resets the URL. - url = base.ResolveReference(opaque) - if *url != *opaque { - t.Errorf("ResolveReference failed to resolve opaque URL: want %#v, got %#v", url, opaque) - } - // Test the convenience wrapper with an opaque URL too. - url, err = base.Parse("scheme:opaque") - if err != nil { - t.Errorf(`URL(%q).Parse("scheme:opaque") failed: %v`, test.base, err) - } else if *url != *opaque { - t.Errorf("Parse failed to resolve opaque URL: want %#v, got %#v", url, opaque) - } else if base == url { - // Ensure that new instances are returned, again. - t.Errorf("Expected URL.Parse to return new URL instance.") - } - } -} - -type shouldEscapeTest struct { - in byte - mode encoding - escape bool -} - -var shouldEscapeTests = []shouldEscapeTest{ - // Unreserved characters (§2.3) - {'a', encodePath, false}, - {'a', encodeUserPassword, false}, - {'a', encodeQueryComponent, false}, - {'a', encodeFragment, false}, - {'z', encodePath, false}, - {'A', encodePath, false}, - {'Z', encodePath, false}, - {'0', encodePath, false}, - {'9', encodePath, false}, - {'-', encodePath, false}, - {'-', encodeUserPassword, false}, - {'-', encodeQueryComponent, false}, - {'-', encodeFragment, false}, - {'.', encodePath, false}, - {'_', encodePath, false}, - {'~', encodePath, false}, - - // User information (§3.2.1) - {':', encodeUserPassword, true}, - {'/', encodeUserPassword, true}, - {'?', encodeUserPassword, true}, - {'@', encodeUserPassword, true}, - {'$', encodeUserPassword, false}, - {'&', encodeUserPassword, false}, - {'+', encodeUserPassword, false}, - {',', encodeUserPassword, false}, - {';', encodeUserPassword, false}, - {'=', encodeUserPassword, false}, -} - -func TestShouldEscape(t *testing.T) { - for _, tt := range shouldEscapeTests { - if shouldEscape(tt.in, tt.mode) != tt.escape { - t.Errorf("shouldEscape(%q, %v) returned %v; expected %v", tt.in, tt.mode, !tt.escape, tt.escape) - } - } -} diff --git a/vendor/github.com/emicklei/go-restful/.gitignore b/vendor/github.com/emicklei/go-restful/.gitignore deleted file mode 100644 index cece7be6..00000000 --- a/vendor/github.com/emicklei/go-restful/.gitignore +++ /dev/null @@ -1,70 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe - -restful.html - -*.out - -tmp.prof - -go-restful.test - -examples/restful-basic-authentication - -examples/restful-encoding-filter - -examples/restful-filters - -examples/restful-hello-world - -examples/restful-resource-functions - -examples/restful-serve-static - -examples/restful-user-service - -*.DS_Store -examples/restful-user-resource - -examples/restful-multi-containers - -examples/restful-form-handling - -examples/restful-CORS-filter - -examples/restful-options-filter - -examples/restful-curly-router - -examples/restful-cpuprofiler-service - -examples/restful-pre-post-filters - -curly.prof - -examples/restful-NCSA-logging - -examples/restful-html-template - -s.html -restful-path-tail diff --git a/vendor/github.com/emicklei/go-restful/.travis.yml b/vendor/github.com/emicklei/go-restful/.travis.yml deleted file mode 100644 index b22f8f54..00000000 --- a/vendor/github.com/emicklei/go-restful/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: go - -go: - - 1.x - -script: go test -v \ No newline at end of file diff --git a/vendor/github.com/emicklei/go-restful/CHANGES.md b/vendor/github.com/emicklei/go-restful/CHANGES.md deleted file mode 100644 index 195449fd..00000000 --- a/vendor/github.com/emicklei/go-restful/CHANGES.md +++ /dev/null @@ -1,242 +0,0 @@ -Change history of go-restful -= -v2.8.0 -- add Request.QueryParameters() -- add json-iterator (via build tag) -- disable vgo module (until log is moved) - -v2.7.1 -- add vgo module - -v2.6.1 -- add JSONNewDecoderFunc to allow custom JSON Decoder usage (go 1.10+) - -v2.6.0 -- Make JSR 311 routing and path param processing consistent -- Adding description to RouteBuilder.Reads() -- Update example for Swagger12 and OpenAPI - -2017-09-13 -- added route condition functions using `.If(func)` in route building. - -2017-02-16 -- solved issue #304, make operation names unique - -2017-01-30 - - [IMPORTANT] For swagger users, change your import statement to: - swagger "github.com/emicklei/go-restful-swagger12" - -- moved swagger 1.2 code to go-restful-swagger12 -- created TAG 2.0.0 - -2017-01-27 - -- remove defer request body close -- expose Dispatch for testing filters and Routefunctions -- swagger response model cannot be array -- created TAG 1.0.0 - -2016-12-22 - -- (API change) Remove code related to caching request content. Removes SetCacheReadEntity(doCache bool) - -2016-11-26 - -- Default change! now use CurlyRouter (was RouterJSR311) -- Default change! no more caching of request content -- Default change! do not recover from panics - -2016-09-22 - -- fix the DefaultRequestContentType feature - -2016-02-14 - -- take the qualify factor of the Accept header mediatype into account when deciding the contentype of the response -- add constructors for custom entity accessors for xml and json - -2015-09-27 - -- rename new WriteStatusAnd... to WriteHeaderAnd... for consistency - -2015-09-25 - -- fixed problem with changing Header after WriteHeader (issue 235) - -2015-09-14 - -- changed behavior of WriteHeader (immediate write) and WriteEntity (no status write) -- added support for custom EntityReaderWriters. - -2015-08-06 - -- add support for reading entities from compressed request content -- use sync.Pool for compressors of http response and request body -- add Description to Parameter for documentation in Swagger UI - -2015-03-20 - -- add configurable logging - -2015-03-18 - -- if not specified, the Operation is derived from the Route function - -2015-03-17 - -- expose Parameter creation functions -- make trace logger an interface -- fix OPTIONSFilter -- customize rendering of ServiceError -- JSR311 router now handles wildcards -- add Notes to Route - -2014-11-27 - -- (api add) PrettyPrint per response. (as proposed in #167) - -2014-11-12 - -- (api add) ApiVersion(.) for documentation in Swagger UI - -2014-11-10 - -- (api change) struct fields tagged with "description" show up in Swagger UI - -2014-10-31 - -- (api change) ReturnsError -> Returns -- (api add) RouteBuilder.Do(aBuilder) for DRY use of RouteBuilder -- fix swagger nested structs -- sort Swagger response messages by code - -2014-10-23 - -- (api add) ReturnsError allows you to document Http codes in swagger -- fixed problem with greedy CurlyRouter -- (api add) Access-Control-Max-Age in CORS -- add tracing functionality (injectable) for debugging purposes -- support JSON parse 64bit int -- fix empty parameters for swagger -- WebServicesUrl is now optional for swagger -- fixed duplicate AccessControlAllowOrigin in CORS -- (api change) expose ServeMux in container -- (api add) added AllowedDomains in CORS -- (api add) ParameterNamed for detailed documentation - -2014-04-16 - -- (api add) expose constructor of Request for testing. - -2014-06-27 - -- (api add) ParameterNamed gives access to a Parameter definition and its data (for further specification). -- (api add) SetCacheReadEntity allow scontrol over whether or not the request body is being cached (default true for compatibility reasons). - -2014-07-03 - -- (api add) CORS can be configured with a list of allowed domains - -2014-03-12 - -- (api add) Route path parameters can use wildcard or regular expressions. (requires CurlyRouter) - -2014-02-26 - -- (api add) Request now provides information about the matched Route, see method SelectedRoutePath - -2014-02-17 - -- (api change) renamed parameter constants (go-lint checks) - -2014-01-10 - -- (api add) support for CloseNotify, see http://golang.org/pkg/net/http/#CloseNotifier - -2014-01-07 - -- (api change) Write* methods in Response now return the error or nil. -- added example of serving HTML from a Go template. -- fixed comparing Allowed headers in CORS (is now case-insensitive) - -2013-11-13 - -- (api add) Response knows how many bytes are written to the response body. - -2013-10-29 - -- (api add) RecoverHandler(handler RecoverHandleFunction) to change how panic recovery is handled. Default behavior is to log and return a stacktrace. This may be a security issue as it exposes sourcecode information. - -2013-10-04 - -- (api add) Response knows what HTTP status has been written -- (api add) Request can have attributes (map of string->interface, also called request-scoped variables - -2013-09-12 - -- (api change) Router interface simplified -- Implemented CurlyRouter, a Router that does not use|allow regular expressions in paths - -2013-08-05 - - add OPTIONS support - - add CORS support - -2013-08-27 - -- fixed some reported issues (see github) -- (api change) deprecated use of WriteError; use WriteErrorString instead - -2014-04-15 - -- (fix) v1.0.1 tag: fix Issue 111: WriteErrorString - -2013-08-08 - -- (api add) Added implementation Container: a WebServices collection with its own http.ServeMux allowing multiple endpoints per program. Existing uses of go-restful will register their services to the DefaultContainer. -- (api add) the swagger package has be extended to have a UI per container. -- if panic is detected then a small stack trace is printed (thanks to runner-mei) -- (api add) WriteErrorString to Response - -Important API changes: - -- (api remove) package variable DoNotRecover no longer works ; use restful.DefaultContainer.DoNotRecover(true) instead. -- (api remove) package variable EnableContentEncoding no longer works ; use restful.DefaultContainer.EnableContentEncoding(true) instead. - - -2013-07-06 - -- (api add) Added support for response encoding (gzip and deflate(zlib)). This feature is disabled on default (for backwards compatibility). Use restful.EnableContentEncoding = true in your initialization to enable this feature. - -2013-06-19 - -- (improve) DoNotRecover option, moved request body closer, improved ReadEntity - -2013-06-03 - -- (api change) removed Dispatcher interface, hide PathExpression -- changed receiver names of type functions to be more idiomatic Go - -2013-06-02 - -- (optimize) Cache the RegExp compilation of Paths. - -2013-05-22 - -- (api add) Added support for request/response filter functions - -2013-05-18 - - -- (api add) Added feature to change the default Http Request Dispatch function (travis cline) -- (api change) Moved Swagger Webservice to swagger package (see example restful-user) - -[2012-11-14 .. 2013-05-18> - -- See https://github.com/emicklei/go-restful/commits - -2012-11-14 - -- Initial commit - - diff --git a/vendor/github.com/emicklei/go-restful/LICENSE b/vendor/github.com/emicklei/go-restful/LICENSE deleted file mode 100644 index ece7ec61..00000000 --- a/vendor/github.com/emicklei/go-restful/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012,2013 Ernest Micklei - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/vendor/github.com/emicklei/go-restful/Makefile b/vendor/github.com/emicklei/go-restful/Makefile deleted file mode 100644 index b40081cc..00000000 --- a/vendor/github.com/emicklei/go-restful/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -all: test - -test: - go test -v . - -ex: - cd examples && ls *.go | xargs go build -o /tmp/ignore \ No newline at end of file diff --git a/vendor/github.com/emicklei/go-restful/README.md b/vendor/github.com/emicklei/go-restful/README.md deleted file mode 100644 index f52c25ac..00000000 --- a/vendor/github.com/emicklei/go-restful/README.md +++ /dev/null @@ -1,88 +0,0 @@ -go-restful -========== -package for building REST-style Web Services using Google Go - -[![Build Status](https://travis-ci.org/emicklei/go-restful.png)](https://travis-ci.org/emicklei/go-restful) -[![Go Report Card](https://goreportcard.com/badge/github.com/emicklei/go-restful)](https://goreportcard.com/report/github.com/emicklei/go-restful) -[![GoDoc](https://godoc.org/github.com/emicklei/go-restful?status.svg)](https://godoc.org/github.com/emicklei/go-restful) - -- [Code examples](https://github.com/emicklei/go-restful/tree/master/examples) - -REST asks developers to use HTTP methods explicitly and in a way that's consistent with the protocol definition. This basic REST design principle establishes a one-to-one mapping between create, read, update, and delete (CRUD) operations and HTTP methods. According to this mapping: - -- GET = Retrieve a representation of a resource -- POST = Create if you are sending content to the server to create a subordinate of the specified resource collection, using some server-side algorithm. -- PUT = Create if you are sending the full content of the specified resource (URI). -- PUT = Update if you are updating the full content of the specified resource. -- DELETE = Delete if you are requesting the server to delete the resource -- PATCH = Update partial content of a resource -- OPTIONS = Get information about the communication options for the request URI - -### Example - -```Go -ws := new(restful.WebService) -ws. - Path("/users"). - Consumes(restful.MIME_XML, restful.MIME_JSON). - Produces(restful.MIME_JSON, restful.MIME_XML) - -ws.Route(ws.GET("/{user-id}").To(u.findUser). - Doc("get a user"). - Param(ws.PathParameter("user-id", "identifier of the user").DataType("string")). - Writes(User{})) -... - -func (u UserResource) findUser(request *restful.Request, response *restful.Response) { - id := request.PathParameter("user-id") - ... -} -``` - -[Full API of a UserResource](https://github.com/emicklei/go-restful/tree/master/examples/restful-user-resource.go) - -### Features - -- Routes for request → function mapping with path parameter (e.g. {id}) support -- Configurable router: - - (default) Fast routing algorithm that allows static elements, regular expressions and dynamic parameters in the URL path (e.g. /meetings/{id} or /static/{subpath:*} - - Routing algorithm after [JSR311](http://jsr311.java.net/nonav/releases/1.1/spec/spec.html) that is implemented using (but does **not** accept) regular expressions -- Request API for reading structs from JSON/XML and accesing parameters (path,query,header) -- Response API for writing structs to JSON/XML and setting headers -- Customizable encoding using EntityReaderWriter registration -- Filters for intercepting the request → response flow on Service or Route level -- Request-scoped variables using attributes -- Containers for WebServices on different HTTP endpoints -- Content encoding (gzip,deflate) of request and response payloads -- Automatic responses on OPTIONS (using a filter) -- Automatic CORS request handling (using a filter) -- API declaration for Swagger UI ([go-restful-openapi](https://github.com/emicklei/go-restful-openapi), see [go-restful-swagger12](https://github.com/emicklei/go-restful-swagger12)) -- Panic recovery to produce HTTP 500, customizable using RecoverHandler(...) -- Route errors produce HTTP 404/405/406/415 errors, customizable using ServiceErrorHandler(...) -- Configurable (trace) logging -- Customizable gzip/deflate readers and writers using CompressorProvider registration - -## How to customize -There are several hooks to customize the behavior of the go-restful package. - -- Router algorithm -- Panic recovery -- JSON decoder -- Trace logging -- Compression -- Encoders for other serializers -- Use [jsoniter](https://github.com/json-iterator/go) by build this package using a tag, e.g. `go build -tags=jsoniter .` - -TODO: write examples of these. - -## Resources - -- [Example posted on blog](http://ernestmicklei.com/2012/11/go-restful-first-working-example/) -- [Design explained on blog](http://ernestmicklei.com/2012/11/go-restful-api-design/) -- [sourcegraph](https://sourcegraph.com/github.com/emicklei/go-restful) -- [showcase: Zazkia - tcp proxy for testing resiliency](https://github.com/emicklei/zazkia) -- [showcase: Mora - MongoDB REST Api server](https://github.com/emicklei/mora) - -Type ```git shortlog -s``` for a full list of contributors. - -© 2012 - 2018, http://ernestmicklei.com. MIT License. Contributions are welcome. diff --git a/vendor/github.com/emicklei/go-restful/Srcfile b/vendor/github.com/emicklei/go-restful/Srcfile deleted file mode 100644 index 16fd1868..00000000 --- a/vendor/github.com/emicklei/go-restful/Srcfile +++ /dev/null @@ -1 +0,0 @@ -{"SkipDirs": ["examples"]} diff --git a/vendor/github.com/emicklei/go-restful/bench_curly_test.go b/vendor/github.com/emicklei/go-restful/bench_curly_test.go deleted file mode 100644 index db6a1a75..00000000 --- a/vendor/github.com/emicklei/go-restful/bench_curly_test.go +++ /dev/null @@ -1,51 +0,0 @@ -package restful - -import ( - "fmt" - "net/http" - "net/http/httptest" - "testing" -) - -func setupCurly(container *Container) []string { - wsCount := 26 - rtCount := 26 - urisCurly := []string{} - - container.Router(CurlyRouter{}) - for i := 0; i < wsCount; i++ { - root := fmt.Sprintf("/%s/{%s}/", string(i+97), string(i+97)) - ws := new(WebService).Path(root) - for j := 0; j < rtCount; j++ { - sub := fmt.Sprintf("/%s2/{%s2}", string(j+97), string(j+97)) - ws.Route(ws.GET(sub).Consumes("application/xml").Produces("application/xml").To(echoCurly)) - } - container.Add(ws) - for _, each := range ws.Routes() { - urisCurly = append(urisCurly, "http://bench.com"+each.Path) - } - } - return urisCurly -} - -func echoCurly(req *Request, resp *Response) {} - -func BenchmarkManyCurly(b *testing.B) { - container := NewContainer() - urisCurly := setupCurly(container) - b.ResetTimer() - for t := 0; t < b.N; t++ { - for r := 0; r < 1000; r++ { - for _, each := range urisCurly { - sendNoReturnTo(each, container, t) - } - } - } -} - -func sendNoReturnTo(address string, container *Container, t int) { - httpRequest, _ := http.NewRequest("GET", address, nil) - httpRequest.Header.Set("Accept", "application/xml") - httpWriter := httptest.NewRecorder() - container.dispatch(httpWriter, httpRequest) -} diff --git a/vendor/github.com/emicklei/go-restful/bench_test.go b/vendor/github.com/emicklei/go-restful/bench_test.go deleted file mode 100644 index 3e77c2d2..00000000 --- a/vendor/github.com/emicklei/go-restful/bench_test.go +++ /dev/null @@ -1,43 +0,0 @@ -package restful - -import ( - "fmt" - "io" - "testing" -) - -var uris = []string{} - -func setup(container *Container) { - wsCount := 26 - rtCount := 26 - - for i := 0; i < wsCount; i++ { - root := fmt.Sprintf("/%s/{%s}/", string(i+97), string(i+97)) - ws := new(WebService).Path(root) - for j := 0; j < rtCount; j++ { - sub := fmt.Sprintf("/%s2/{%s2}", string(j+97), string(j+97)) - ws.Route(ws.GET(sub).To(echo)) - } - container.Add(ws) - for _, each := range ws.Routes() { - uris = append(uris, "http://bench.com"+each.Path) - } - } -} - -func echo(req *Request, resp *Response) { - io.WriteString(resp.ResponseWriter, "echo") -} - -func BenchmarkMany(b *testing.B) { - container := NewContainer() - setup(container) - b.ResetTimer() - for t := 0; t < b.N; t++ { - for _, each := range uris { - // println(each) - sendItTo(each, container) - } - } -} diff --git a/vendor/github.com/emicklei/go-restful/bench_test.sh b/vendor/github.com/emicklei/go-restful/bench_test.sh deleted file mode 100644 index 47ffbe4a..00000000 --- a/vendor/github.com/emicklei/go-restful/bench_test.sh +++ /dev/null @@ -1,10 +0,0 @@ -#go test -run=none -file bench_test.go -test.bench . -cpuprofile=bench_test.out - -go test -c -./go-restful.test -test.run=none -test.cpuprofile=tmp.prof -test.bench=BenchmarkMany -./go-restful.test -test.run=none -test.cpuprofile=curly.prof -test.bench=BenchmarkManyCurly - -#go tool pprof go-restful.test tmp.prof -go tool pprof go-restful.test curly.prof - - diff --git a/vendor/github.com/emicklei/go-restful/compress.go b/vendor/github.com/emicklei/go-restful/compress.go deleted file mode 100644 index 220b3771..00000000 --- a/vendor/github.com/emicklei/go-restful/compress.go +++ /dev/null @@ -1,123 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "bufio" - "compress/gzip" - "compress/zlib" - "errors" - "io" - "net" - "net/http" - "strings" -) - -// OBSOLETE : use restful.DefaultContainer.EnableContentEncoding(true) to change this setting. -var EnableContentEncoding = false - -// CompressingResponseWriter is a http.ResponseWriter that can perform content encoding (gzip and zlib) -type CompressingResponseWriter struct { - writer http.ResponseWriter - compressor io.WriteCloser - encoding string -} - -// Header is part of http.ResponseWriter interface -func (c *CompressingResponseWriter) Header() http.Header { - return c.writer.Header() -} - -// WriteHeader is part of http.ResponseWriter interface -func (c *CompressingResponseWriter) WriteHeader(status int) { - c.writer.WriteHeader(status) -} - -// Write is part of http.ResponseWriter interface -// It is passed through the compressor -func (c *CompressingResponseWriter) Write(bytes []byte) (int, error) { - if c.isCompressorClosed() { - return -1, errors.New("Compressing error: tried to write data using closed compressor") - } - return c.compressor.Write(bytes) -} - -// CloseNotify is part of http.CloseNotifier interface -func (c *CompressingResponseWriter) CloseNotify() <-chan bool { - return c.writer.(http.CloseNotifier).CloseNotify() -} - -// Close the underlying compressor -func (c *CompressingResponseWriter) Close() error { - if c.isCompressorClosed() { - return errors.New("Compressing error: tried to close already closed compressor") - } - - c.compressor.Close() - if ENCODING_GZIP == c.encoding { - currentCompressorProvider.ReleaseGzipWriter(c.compressor.(*gzip.Writer)) - } - if ENCODING_DEFLATE == c.encoding { - currentCompressorProvider.ReleaseZlibWriter(c.compressor.(*zlib.Writer)) - } - // gc hint needed? - c.compressor = nil - return nil -} - -func (c *CompressingResponseWriter) isCompressorClosed() bool { - return nil == c.compressor -} - -// Hijack implements the Hijacker interface -// This is especially useful when combining Container.EnabledContentEncoding -// in combination with websockets (for instance gorilla/websocket) -func (c *CompressingResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) { - hijacker, ok := c.writer.(http.Hijacker) - if !ok { - return nil, nil, errors.New("ResponseWriter doesn't support Hijacker interface") - } - return hijacker.Hijack() -} - -// WantsCompressedResponse reads the Accept-Encoding header to see if and which encoding is requested. -func wantsCompressedResponse(httpRequest *http.Request) (bool, string) { - header := httpRequest.Header.Get(HEADER_AcceptEncoding) - gi := strings.Index(header, ENCODING_GZIP) - zi := strings.Index(header, ENCODING_DEFLATE) - // use in order of appearance - if gi == -1 { - return zi != -1, ENCODING_DEFLATE - } else if zi == -1 { - return gi != -1, ENCODING_GZIP - } else { - if gi < zi { - return true, ENCODING_GZIP - } - return true, ENCODING_DEFLATE - } -} - -// NewCompressingResponseWriter create a CompressingResponseWriter for a known encoding = {gzip,deflate} -func NewCompressingResponseWriter(httpWriter http.ResponseWriter, encoding string) (*CompressingResponseWriter, error) { - httpWriter.Header().Set(HEADER_ContentEncoding, encoding) - c := new(CompressingResponseWriter) - c.writer = httpWriter - var err error - if ENCODING_GZIP == encoding { - w := currentCompressorProvider.AcquireGzipWriter() - w.Reset(httpWriter) - c.compressor = w - c.encoding = ENCODING_GZIP - } else if ENCODING_DEFLATE == encoding { - w := currentCompressorProvider.AcquireZlibWriter() - w.Reset(httpWriter) - c.compressor = w - c.encoding = ENCODING_DEFLATE - } else { - return nil, errors.New("Unknown encoding:" + encoding) - } - return c, err -} diff --git a/vendor/github.com/emicklei/go-restful/compress_test.go b/vendor/github.com/emicklei/go-restful/compress_test.go deleted file mode 100644 index cc3e93d5..00000000 --- a/vendor/github.com/emicklei/go-restful/compress_test.go +++ /dev/null @@ -1,125 +0,0 @@ -package restful - -import ( - "bytes" - "compress/gzip" - "compress/zlib" - "io" - "io/ioutil" - "net/http" - "net/http/httptest" - "testing" -) - -// go test -v -test.run TestGzip ...restful -func TestGzip(t *testing.T) { - EnableContentEncoding = true - httpRequest, _ := http.NewRequest("GET", "/test", nil) - httpRequest.Header.Set("Accept-Encoding", "gzip,deflate") - httpWriter := httptest.NewRecorder() - wanted, encoding := wantsCompressedResponse(httpRequest) - if !wanted { - t.Fatal("should accept gzip") - } - if encoding != "gzip" { - t.Fatal("expected gzip") - } - c, err := NewCompressingResponseWriter(httpWriter, encoding) - if err != nil { - t.Fatal(err.Error()) - } - c.Write([]byte("Hello World")) - c.Close() - if httpWriter.Header().Get("Content-Encoding") != "gzip" { - t.Fatal("Missing gzip header") - } - reader, err := gzip.NewReader(httpWriter.Body) - if err != nil { - t.Fatal(err.Error()) - } - data, err := ioutil.ReadAll(reader) - if err != nil { - t.Fatal(err.Error()) - } - if got, want := string(data), "Hello World"; got != want { - t.Errorf("got %v want %v", got, want) - } -} - -func TestDeflate(t *testing.T) { - EnableContentEncoding = true - httpRequest, _ := http.NewRequest("GET", "/test", nil) - httpRequest.Header.Set("Accept-Encoding", "deflate,gzip") - httpWriter := httptest.NewRecorder() - wanted, encoding := wantsCompressedResponse(httpRequest) - if !wanted { - t.Fatal("should accept deflate") - } - if encoding != "deflate" { - t.Fatal("expected deflate") - } - c, err := NewCompressingResponseWriter(httpWriter, encoding) - if err != nil { - t.Fatal(err.Error()) - } - c.Write([]byte("Hello World")) - c.Close() - if httpWriter.Header().Get("Content-Encoding") != "deflate" { - t.Fatal("Missing deflate header") - } - reader, err := zlib.NewReader(httpWriter.Body) - if err != nil { - t.Fatal(err.Error()) - } - data, err := ioutil.ReadAll(reader) - if err != nil { - t.Fatal(err.Error()) - } - if got, want := string(data), "Hello World"; got != want { - t.Errorf("got %v want %v", got, want) - } -} - -func TestGzipDecompressRequestBody(t *testing.T) { - b := new(bytes.Buffer) - w := newGzipWriter() - w.Reset(b) - io.WriteString(w, `{"msg":"hi"}`) - w.Flush() - w.Close() - - req := new(Request) - httpRequest, _ := http.NewRequest("GET", "/", bytes.NewReader(b.Bytes())) - httpRequest.Header.Set("Content-Type", "application/json") - httpRequest.Header.Set("Content-Encoding", "gzip") - req.Request = httpRequest - - doc := make(map[string]interface{}) - req.ReadEntity(&doc) - - if got, want := doc["msg"], "hi"; got != want { - t.Errorf("got %v want %v", got, want) - } -} - -func TestZlibDecompressRequestBody(t *testing.T) { - b := new(bytes.Buffer) - w := newZlibWriter() - w.Reset(b) - io.WriteString(w, `{"msg":"hi"}`) - w.Flush() - w.Close() - - req := new(Request) - httpRequest, _ := http.NewRequest("GET", "/", bytes.NewReader(b.Bytes())) - httpRequest.Header.Set("Content-Type", "application/json") - httpRequest.Header.Set("Content-Encoding", "deflate") - req.Request = httpRequest - - doc := make(map[string]interface{}) - req.ReadEntity(&doc) - - if got, want := doc["msg"], "hi"; got != want { - t.Errorf("got %v want %v", got, want) - } -} diff --git a/vendor/github.com/emicklei/go-restful/compressor_cache.go b/vendor/github.com/emicklei/go-restful/compressor_cache.go deleted file mode 100644 index ee426010..00000000 --- a/vendor/github.com/emicklei/go-restful/compressor_cache.go +++ /dev/null @@ -1,103 +0,0 @@ -package restful - -// Copyright 2015 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "compress/gzip" - "compress/zlib" -) - -// BoundedCachedCompressors is a CompressorProvider that uses a cache with a fixed amount -// of writers and readers (resources). -// If a new resource is acquired and all are in use, it will return a new unmanaged resource. -type BoundedCachedCompressors struct { - gzipWriters chan *gzip.Writer - gzipReaders chan *gzip.Reader - zlibWriters chan *zlib.Writer - writersCapacity int - readersCapacity int -} - -// NewBoundedCachedCompressors returns a new, with filled cache, BoundedCachedCompressors. -func NewBoundedCachedCompressors(writersCapacity, readersCapacity int) *BoundedCachedCompressors { - b := &BoundedCachedCompressors{ - gzipWriters: make(chan *gzip.Writer, writersCapacity), - gzipReaders: make(chan *gzip.Reader, readersCapacity), - zlibWriters: make(chan *zlib.Writer, writersCapacity), - writersCapacity: writersCapacity, - readersCapacity: readersCapacity, - } - for ix := 0; ix < writersCapacity; ix++ { - b.gzipWriters <- newGzipWriter() - b.zlibWriters <- newZlibWriter() - } - for ix := 0; ix < readersCapacity; ix++ { - b.gzipReaders <- newGzipReader() - } - return b -} - -// AcquireGzipWriter returns an resettable *gzip.Writer. Needs to be released. -func (b *BoundedCachedCompressors) AcquireGzipWriter() *gzip.Writer { - var writer *gzip.Writer - select { - case writer, _ = <-b.gzipWriters: - default: - // return a new unmanaged one - writer = newGzipWriter() - } - return writer -} - -// ReleaseGzipWriter accepts a writer (does not have to be one that was cached) -// only when the cache has room for it. It will ignore it otherwise. -func (b *BoundedCachedCompressors) ReleaseGzipWriter(w *gzip.Writer) { - // forget the unmanaged ones - if len(b.gzipWriters) < b.writersCapacity { - b.gzipWriters <- w - } -} - -// AcquireGzipReader returns a *gzip.Reader. Needs to be released. -func (b *BoundedCachedCompressors) AcquireGzipReader() *gzip.Reader { - var reader *gzip.Reader - select { - case reader, _ = <-b.gzipReaders: - default: - // return a new unmanaged one - reader = newGzipReader() - } - return reader -} - -// ReleaseGzipReader accepts a reader (does not have to be one that was cached) -// only when the cache has room for it. It will ignore it otherwise. -func (b *BoundedCachedCompressors) ReleaseGzipReader(r *gzip.Reader) { - // forget the unmanaged ones - if len(b.gzipReaders) < b.readersCapacity { - b.gzipReaders <- r - } -} - -// AcquireZlibWriter returns an resettable *zlib.Writer. Needs to be released. -func (b *BoundedCachedCompressors) AcquireZlibWriter() *zlib.Writer { - var writer *zlib.Writer - select { - case writer, _ = <-b.zlibWriters: - default: - // return a new unmanaged one - writer = newZlibWriter() - } - return writer -} - -// ReleaseZlibWriter accepts a writer (does not have to be one that was cached) -// only when the cache has room for it. It will ignore it otherwise. -func (b *BoundedCachedCompressors) ReleaseZlibWriter(w *zlib.Writer) { - // forget the unmanaged ones - if len(b.zlibWriters) < b.writersCapacity { - b.zlibWriters <- w - } -} diff --git a/vendor/github.com/emicklei/go-restful/compressor_pools.go b/vendor/github.com/emicklei/go-restful/compressor_pools.go deleted file mode 100644 index d866ce64..00000000 --- a/vendor/github.com/emicklei/go-restful/compressor_pools.go +++ /dev/null @@ -1,91 +0,0 @@ -package restful - -// Copyright 2015 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "bytes" - "compress/gzip" - "compress/zlib" - "sync" -) - -// SyncPoolCompessors is a CompressorProvider that use the standard sync.Pool. -type SyncPoolCompessors struct { - GzipWriterPool *sync.Pool - GzipReaderPool *sync.Pool - ZlibWriterPool *sync.Pool -} - -// NewSyncPoolCompessors returns a new ("empty") SyncPoolCompessors. -func NewSyncPoolCompessors() *SyncPoolCompessors { - return &SyncPoolCompessors{ - GzipWriterPool: &sync.Pool{ - New: func() interface{} { return newGzipWriter() }, - }, - GzipReaderPool: &sync.Pool{ - New: func() interface{} { return newGzipReader() }, - }, - ZlibWriterPool: &sync.Pool{ - New: func() interface{} { return newZlibWriter() }, - }, - } -} - -func (s *SyncPoolCompessors) AcquireGzipWriter() *gzip.Writer { - return s.GzipWriterPool.Get().(*gzip.Writer) -} - -func (s *SyncPoolCompessors) ReleaseGzipWriter(w *gzip.Writer) { - s.GzipWriterPool.Put(w) -} - -func (s *SyncPoolCompessors) AcquireGzipReader() *gzip.Reader { - return s.GzipReaderPool.Get().(*gzip.Reader) -} - -func (s *SyncPoolCompessors) ReleaseGzipReader(r *gzip.Reader) { - s.GzipReaderPool.Put(r) -} - -func (s *SyncPoolCompessors) AcquireZlibWriter() *zlib.Writer { - return s.ZlibWriterPool.Get().(*zlib.Writer) -} - -func (s *SyncPoolCompessors) ReleaseZlibWriter(w *zlib.Writer) { - s.ZlibWriterPool.Put(w) -} - -func newGzipWriter() *gzip.Writer { - // create with an empty bytes writer; it will be replaced before using the gzipWriter - writer, err := gzip.NewWriterLevel(new(bytes.Buffer), gzip.BestSpeed) - if err != nil { - panic(err.Error()) - } - return writer -} - -func newGzipReader() *gzip.Reader { - // create with an empty reader (but with GZIP header); it will be replaced before using the gzipReader - // we can safely use currentCompressProvider because it is set on package initialization. - w := currentCompressorProvider.AcquireGzipWriter() - defer currentCompressorProvider.ReleaseGzipWriter(w) - b := new(bytes.Buffer) - w.Reset(b) - w.Flush() - w.Close() - reader, err := gzip.NewReader(bytes.NewReader(b.Bytes())) - if err != nil { - panic(err.Error()) - } - return reader -} - -func newZlibWriter() *zlib.Writer { - writer, err := zlib.NewWriterLevel(new(bytes.Buffer), gzip.BestSpeed) - if err != nil { - panic(err.Error()) - } - return writer -} diff --git a/vendor/github.com/emicklei/go-restful/compressors.go b/vendor/github.com/emicklei/go-restful/compressors.go deleted file mode 100644 index 9db4a8c8..00000000 --- a/vendor/github.com/emicklei/go-restful/compressors.go +++ /dev/null @@ -1,54 +0,0 @@ -package restful - -// Copyright 2015 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "compress/gzip" - "compress/zlib" -) - -// CompressorProvider describes a component that can provider compressors for the std methods. -type CompressorProvider interface { - // Returns a *gzip.Writer which needs to be released later. - // Before using it, call Reset(). - AcquireGzipWriter() *gzip.Writer - - // Releases an acquired *gzip.Writer. - ReleaseGzipWriter(w *gzip.Writer) - - // Returns a *gzip.Reader which needs to be released later. - AcquireGzipReader() *gzip.Reader - - // Releases an acquired *gzip.Reader. - ReleaseGzipReader(w *gzip.Reader) - - // Returns a *zlib.Writer which needs to be released later. - // Before using it, call Reset(). - AcquireZlibWriter() *zlib.Writer - - // Releases an acquired *zlib.Writer. - ReleaseZlibWriter(w *zlib.Writer) -} - -// DefaultCompressorProvider is the actual provider of compressors (zlib or gzip). -var currentCompressorProvider CompressorProvider - -func init() { - currentCompressorProvider = NewSyncPoolCompessors() -} - -// CurrentCompressorProvider returns the current CompressorProvider. -// It is initialized using a SyncPoolCompessors. -func CurrentCompressorProvider() CompressorProvider { - return currentCompressorProvider -} - -// SetCompressorProvider sets the actual provider of compressors (zlib or gzip). -func SetCompressorProvider(p CompressorProvider) { - if p == nil { - panic("cannot set compressor provider to nil") - } - currentCompressorProvider = p -} diff --git a/vendor/github.com/emicklei/go-restful/constants.go b/vendor/github.com/emicklei/go-restful/constants.go deleted file mode 100644 index 203439c5..00000000 --- a/vendor/github.com/emicklei/go-restful/constants.go +++ /dev/null @@ -1,30 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -const ( - MIME_XML = "application/xml" // Accept or Content-Type used in Consumes() and/or Produces() - MIME_JSON = "application/json" // Accept or Content-Type used in Consumes() and/or Produces() - MIME_OCTET = "application/octet-stream" // If Content-Type is not present in request, use the default - - HEADER_Allow = "Allow" - HEADER_Accept = "Accept" - HEADER_Origin = "Origin" - HEADER_ContentType = "Content-Type" - HEADER_LastModified = "Last-Modified" - HEADER_AcceptEncoding = "Accept-Encoding" - HEADER_ContentEncoding = "Content-Encoding" - HEADER_AccessControlExposeHeaders = "Access-Control-Expose-Headers" - HEADER_AccessControlRequestMethod = "Access-Control-Request-Method" - HEADER_AccessControlRequestHeaders = "Access-Control-Request-Headers" - HEADER_AccessControlAllowMethods = "Access-Control-Allow-Methods" - HEADER_AccessControlAllowOrigin = "Access-Control-Allow-Origin" - HEADER_AccessControlAllowCredentials = "Access-Control-Allow-Credentials" - HEADER_AccessControlAllowHeaders = "Access-Control-Allow-Headers" - HEADER_AccessControlMaxAge = "Access-Control-Max-Age" - - ENCODING_GZIP = "gzip" - ENCODING_DEFLATE = "deflate" -) diff --git a/vendor/github.com/emicklei/go-restful/container.go b/vendor/github.com/emicklei/go-restful/container.go deleted file mode 100644 index b4ad153e..00000000 --- a/vendor/github.com/emicklei/go-restful/container.go +++ /dev/null @@ -1,371 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "bytes" - "errors" - "fmt" - "net/http" - "os" - "runtime" - "strings" - "sync" - - "github.com/emicklei/go-restful/log" -) - -// Container holds a collection of WebServices and a http.ServeMux to dispatch http requests. -// The requests are further dispatched to routes of WebServices using a RouteSelector -type Container struct { - webServicesLock sync.RWMutex - webServices []*WebService - ServeMux *http.ServeMux - isRegisteredOnRoot bool - containerFilters []FilterFunction - doNotRecover bool // default is true - recoverHandleFunc RecoverHandleFunction - serviceErrorHandleFunc ServiceErrorHandleFunction - router RouteSelector // default is a CurlyRouter (RouterJSR311 is a slower alternative) - contentEncodingEnabled bool // default is false -} - -// NewContainer creates a new Container using a new ServeMux and default router (CurlyRouter) -func NewContainer() *Container { - return &Container{ - webServices: []*WebService{}, - ServeMux: http.NewServeMux(), - isRegisteredOnRoot: false, - containerFilters: []FilterFunction{}, - doNotRecover: true, - recoverHandleFunc: logStackOnRecover, - serviceErrorHandleFunc: writeServiceError, - router: CurlyRouter{}, - contentEncodingEnabled: false} -} - -// RecoverHandleFunction declares functions that can be used to handle a panic situation. -// The first argument is what recover() returns. The second must be used to communicate an error response. -type RecoverHandleFunction func(interface{}, http.ResponseWriter) - -// RecoverHandler changes the default function (logStackOnRecover) to be called -// when a panic is detected. DoNotRecover must be have its default value (=false). -func (c *Container) RecoverHandler(handler RecoverHandleFunction) { - c.recoverHandleFunc = handler -} - -// ServiceErrorHandleFunction declares functions that can be used to handle a service error situation. -// The first argument is the service error, the second is the request that resulted in the error and -// the third must be used to communicate an error response. -type ServiceErrorHandleFunction func(ServiceError, *Request, *Response) - -// ServiceErrorHandler changes the default function (writeServiceError) to be called -// when a ServiceError is detected. -func (c *Container) ServiceErrorHandler(handler ServiceErrorHandleFunction) { - c.serviceErrorHandleFunc = handler -} - -// DoNotRecover controls whether panics will be caught to return HTTP 500. -// If set to true, Route functions are responsible for handling any error situation. -// Default value is true. -func (c *Container) DoNotRecover(doNot bool) { - c.doNotRecover = doNot -} - -// Router changes the default Router (currently CurlyRouter) -func (c *Container) Router(aRouter RouteSelector) { - c.router = aRouter -} - -// EnableContentEncoding (default=false) allows for GZIP or DEFLATE encoding of responses. -func (c *Container) EnableContentEncoding(enabled bool) { - c.contentEncodingEnabled = enabled -} - -// Add a WebService to the Container. It will detect duplicate root paths and exit in that case. -func (c *Container) Add(service *WebService) *Container { - c.webServicesLock.Lock() - defer c.webServicesLock.Unlock() - - // if rootPath was not set then lazy initialize it - if len(service.rootPath) == 0 { - service.Path("/") - } - - // cannot have duplicate root paths - for _, each := range c.webServices { - if each.RootPath() == service.RootPath() { - log.Printf("[restful] WebService with duplicate root path detected:['%v']", each) - os.Exit(1) - } - } - - // If not registered on root then add specific mapping - if !c.isRegisteredOnRoot { - c.isRegisteredOnRoot = c.addHandler(service, c.ServeMux) - } - c.webServices = append(c.webServices, service) - return c -} - -// addHandler may set a new HandleFunc for the serveMux -// this function must run inside the critical region protected by the webServicesLock. -// returns true if the function was registered on root ("/") -func (c *Container) addHandler(service *WebService, serveMux *http.ServeMux) bool { - pattern := fixedPrefixPath(service.RootPath()) - // check if root path registration is needed - if "/" == pattern || "" == pattern { - serveMux.HandleFunc("/", c.dispatch) - return true - } - // detect if registration already exists - alreadyMapped := false - for _, each := range c.webServices { - if each.RootPath() == service.RootPath() { - alreadyMapped = true - break - } - } - if !alreadyMapped { - serveMux.HandleFunc(pattern, c.dispatch) - if !strings.HasSuffix(pattern, "/") { - serveMux.HandleFunc(pattern+"/", c.dispatch) - } - } - return false -} - -func (c *Container) Remove(ws *WebService) error { - if c.ServeMux == http.DefaultServeMux { - errMsg := fmt.Sprintf("[restful] cannot remove a WebService from a Container using the DefaultServeMux: ['%v']", ws) - log.Print(errMsg) - return errors.New(errMsg) - } - c.webServicesLock.Lock() - defer c.webServicesLock.Unlock() - // build a new ServeMux and re-register all WebServices - newServeMux := http.NewServeMux() - newServices := []*WebService{} - newIsRegisteredOnRoot := false - for _, each := range c.webServices { - if each.rootPath != ws.rootPath { - // If not registered on root then add specific mapping - if !newIsRegisteredOnRoot { - newIsRegisteredOnRoot = c.addHandler(each, newServeMux) - } - newServices = append(newServices, each) - } - } - c.webServices, c.ServeMux, c.isRegisteredOnRoot = newServices, newServeMux, newIsRegisteredOnRoot - return nil -} - -// logStackOnRecover is the default RecoverHandleFunction and is called -// when DoNotRecover is false and the recoverHandleFunc is not set for the container. -// Default implementation logs the stacktrace and writes the stacktrace on the response. -// This may be a security issue as it exposes sourcecode information. -func logStackOnRecover(panicReason interface{}, httpWriter http.ResponseWriter) { - var buffer bytes.Buffer - buffer.WriteString(fmt.Sprintf("[restful] recover from panic situation: - %v\r\n", panicReason)) - for i := 2; ; i += 1 { - _, file, line, ok := runtime.Caller(i) - if !ok { - break - } - buffer.WriteString(fmt.Sprintf(" %s:%d\r\n", file, line)) - } - log.Print(buffer.String()) - httpWriter.WriteHeader(http.StatusInternalServerError) - httpWriter.Write(buffer.Bytes()) -} - -// writeServiceError is the default ServiceErrorHandleFunction and is called -// when a ServiceError is returned during route selection. Default implementation -// calls resp.WriteErrorString(err.Code, err.Message) -func writeServiceError(err ServiceError, req *Request, resp *Response) { - resp.WriteErrorString(err.Code, err.Message) -} - -// Dispatch the incoming Http Request to a matching WebService. -func (c *Container) Dispatch(httpWriter http.ResponseWriter, httpRequest *http.Request) { - if httpWriter == nil { - panic("httpWriter cannot be nil") - } - if httpRequest == nil { - panic("httpRequest cannot be nil") - } - c.dispatch(httpWriter, httpRequest) -} - -// Dispatch the incoming Http Request to a matching WebService. -func (c *Container) dispatch(httpWriter http.ResponseWriter, httpRequest *http.Request) { - writer := httpWriter - - // CompressingResponseWriter should be closed after all operations are done - defer func() { - if compressWriter, ok := writer.(*CompressingResponseWriter); ok { - compressWriter.Close() - } - }() - - // Instal panic recovery unless told otherwise - if !c.doNotRecover { // catch all for 500 response - defer func() { - if r := recover(); r != nil { - c.recoverHandleFunc(r, writer) - return - } - }() - } - - // Detect if compression is needed - // assume without compression, test for override - if c.contentEncodingEnabled { - doCompress, encoding := wantsCompressedResponse(httpRequest) - if doCompress { - var err error - writer, err = NewCompressingResponseWriter(httpWriter, encoding) - if err != nil { - log.Print("[restful] unable to install compressor: ", err) - httpWriter.WriteHeader(http.StatusInternalServerError) - return - } - } - } - // Find best match Route ; err is non nil if no match was found - var webService *WebService - var route *Route - var err error - func() { - c.webServicesLock.RLock() - defer c.webServicesLock.RUnlock() - webService, route, err = c.router.SelectRoute( - c.webServices, - httpRequest) - }() - if err != nil { - // a non-200 response has already been written - // run container filters anyway ; they should not touch the response... - chain := FilterChain{Filters: c.containerFilters, Target: func(req *Request, resp *Response) { - switch err.(type) { - case ServiceError: - ser := err.(ServiceError) - c.serviceErrorHandleFunc(ser, req, resp) - } - // TODO - }} - chain.ProcessFilter(NewRequest(httpRequest), NewResponse(writer)) - return - } - pathProcessor, routerProcessesPath := c.router.(PathProcessor) - if !routerProcessesPath { - pathProcessor = defaultPathProcessor{} - } - pathParams := pathProcessor.ExtractParameters(route, webService, httpRequest.URL.Path) - wrappedRequest, wrappedResponse := route.wrapRequestResponse(writer, httpRequest, pathParams) - // pass through filters (if any) - if len(c.containerFilters)+len(webService.filters)+len(route.Filters) > 0 { - // compose filter chain - allFilters := []FilterFunction{} - allFilters = append(allFilters, c.containerFilters...) - allFilters = append(allFilters, webService.filters...) - allFilters = append(allFilters, route.Filters...) - chain := FilterChain{Filters: allFilters, Target: func(req *Request, resp *Response) { - // handle request by route after passing all filters - route.Function(wrappedRequest, wrappedResponse) - }} - chain.ProcessFilter(wrappedRequest, wrappedResponse) - } else { - // no filters, handle request by route - route.Function(wrappedRequest, wrappedResponse) - } -} - -// fixedPrefixPath returns the fixed part of the partspec ; it may include template vars {} -func fixedPrefixPath(pathspec string) string { - varBegin := strings.Index(pathspec, "{") - if -1 == varBegin { - return pathspec - } - return pathspec[:varBegin] -} - -// ServeHTTP implements net/http.Handler therefore a Container can be a Handler in a http.Server -func (c *Container) ServeHTTP(httpwriter http.ResponseWriter, httpRequest *http.Request) { - c.ServeMux.ServeHTTP(httpwriter, httpRequest) -} - -// Handle registers the handler for the given pattern. If a handler already exists for pattern, Handle panics. -func (c *Container) Handle(pattern string, handler http.Handler) { - c.ServeMux.Handle(pattern, handler) -} - -// HandleWithFilter registers the handler for the given pattern. -// Container's filter chain is applied for handler. -// If a handler already exists for pattern, HandleWithFilter panics. -func (c *Container) HandleWithFilter(pattern string, handler http.Handler) { - f := func(httpResponse http.ResponseWriter, httpRequest *http.Request) { - if len(c.containerFilters) == 0 { - handler.ServeHTTP(httpResponse, httpRequest) - return - } - - chain := FilterChain{Filters: c.containerFilters, Target: func(req *Request, resp *Response) { - handler.ServeHTTP(httpResponse, httpRequest) - }} - chain.ProcessFilter(NewRequest(httpRequest), NewResponse(httpResponse)) - } - - c.Handle(pattern, http.HandlerFunc(f)) -} - -// Filter appends a container FilterFunction. These are called before dispatching -// a http.Request to a WebService from the container -func (c *Container) Filter(filter FilterFunction) { - c.containerFilters = append(c.containerFilters, filter) -} - -// RegisteredWebServices returns the collections of added WebServices -func (c *Container) RegisteredWebServices() []*WebService { - c.webServicesLock.RLock() - defer c.webServicesLock.RUnlock() - result := make([]*WebService, len(c.webServices)) - for ix := range c.webServices { - result[ix] = c.webServices[ix] - } - return result -} - -// computeAllowedMethods returns a list of HTTP methods that are valid for a Request -func (c *Container) computeAllowedMethods(req *Request) []string { - // Go through all RegisteredWebServices() and all its Routes to collect the options - methods := []string{} - requestPath := req.Request.URL.Path - for _, ws := range c.RegisteredWebServices() { - matches := ws.pathExpr.Matcher.FindStringSubmatch(requestPath) - if matches != nil { - finalMatch := matches[len(matches)-1] - for _, rt := range ws.Routes() { - matches := rt.pathExpr.Matcher.FindStringSubmatch(finalMatch) - if matches != nil { - lastMatch := matches[len(matches)-1] - if lastMatch == "" || lastMatch == "/" { // do not include if value is neither empty nor ‘/’. - methods = append(methods, rt.Method) - } - } - } - } - } - // methods = append(methods, "OPTIONS") not sure about this - return methods -} - -// newBasicRequestResponse creates a pair of Request,Response from its http versions. -// It is basic because no parameter or (produces) content-type information is given. -func newBasicRequestResponse(httpWriter http.ResponseWriter, httpRequest *http.Request) (*Request, *Response) { - resp := NewResponse(httpWriter) - resp.requestAccept = httpRequest.Header.Get(HEADER_Accept) - return NewRequest(httpRequest), resp -} diff --git a/vendor/github.com/emicklei/go-restful/container_test.go b/vendor/github.com/emicklei/go-restful/container_test.go deleted file mode 100644 index 491c793a..00000000 --- a/vendor/github.com/emicklei/go-restful/container_test.go +++ /dev/null @@ -1,83 +0,0 @@ -package restful - -import ( - "net/http" - "net/http/httptest" - "testing" -) - -// go test -v -test.run TestContainer_computeAllowedMethods ...restful -func TestContainer_computeAllowedMethods(t *testing.T) { - wc := NewContainer() - ws1 := new(WebService).Path("/users") - ws1.Route(ws1.GET("{i}").To(dummy)) - ws1.Route(ws1.POST("{i}").To(dummy)) - wc.Add(ws1) - httpRequest, _ := http.NewRequest("GET", "http://api.his.com/users/1", nil) - rreq := Request{Request: httpRequest} - m := wc.computeAllowedMethods(&rreq) - if len(m) != 2 { - t.Errorf("got %d expected 2 methods, %v", len(m), m) - } -} - -func TestContainer_HandleWithFilter(t *testing.T) { - prefilterCalled := false - postfilterCalled := false - httpHandlerCalled := false - - wc := NewContainer() - wc.Filter(func(request *Request, response *Response, chain *FilterChain) { - prefilterCalled = true - chain.ProcessFilter(request, response) - }) - wc.HandleWithFilter("/", http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { - httpHandlerCalled = true - w.Write([]byte("ok")) - })) - wc.Filter(func(request *Request, response *Response, chain *FilterChain) { - postfilterCalled = true - chain.ProcessFilter(request, response) - }) - - recorder := httptest.NewRecorder() - request, _ := http.NewRequest("GET", "/", nil) - wc.ServeHTTP(recorder, request) - if recorder.Code != http.StatusOK { - t.Errorf("unexpected code %d", recorder.Code) - } - if recorder.Body.String() != "ok" { - t.Errorf("unexpected body %s", recorder.Body.String()) - } - if !prefilterCalled { - t.Errorf("filter added before calling HandleWithFilter wasn't called") - } - if !postfilterCalled { - t.Errorf("filter added after calling HandleWithFilter wasn't called") - } - if !httpHandlerCalled { - t.Errorf("handler added by calling HandleWithFilter wasn't called") - } -} - -func TestContainerAddAndRemove(t *testing.T) { - ws1 := new(WebService).Path("/") - ws2 := new(WebService).Path("/users") - wc := NewContainer() - wc.Add(ws1) - wc.Add(ws2) - wc.Remove(ws2) - if len(wc.webServices) != 1 { - t.Errorf("expected one webservices") - } - if !wc.isRegisteredOnRoot { - t.Errorf("expected on root registered") - } - wc.Remove(ws1) - if len(wc.webServices) > 0 { - t.Errorf("expected zero webservices") - } - if wc.isRegisteredOnRoot { - t.Errorf("expected not on root registered") - } -} diff --git a/vendor/github.com/emicklei/go-restful/cors_filter.go b/vendor/github.com/emicklei/go-restful/cors_filter.go deleted file mode 100644 index 1efeef07..00000000 --- a/vendor/github.com/emicklei/go-restful/cors_filter.go +++ /dev/null @@ -1,202 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "regexp" - "strconv" - "strings" -) - -// CrossOriginResourceSharing is used to create a Container Filter that implements CORS. -// Cross-origin resource sharing (CORS) is a mechanism that allows JavaScript on a web page -// to make XMLHttpRequests to another domain, not the domain the JavaScript originated from. -// -// http://en.wikipedia.org/wiki/Cross-origin_resource_sharing -// http://enable-cors.org/server.html -// http://www.html5rocks.com/en/tutorials/cors/#toc-handling-a-not-so-simple-request -type CrossOriginResourceSharing struct { - ExposeHeaders []string // list of Header names - AllowedHeaders []string // list of Header names - AllowedDomains []string // list of allowed values for Http Origin. An allowed value can be a regular expression to support subdomain matching. If empty all are allowed. - AllowedMethods []string - MaxAge int // number of seconds before requiring new Options request - CookiesAllowed bool - Container *Container - - allowedOriginPatterns []*regexp.Regexp // internal field for origin regexp check. -} - -// Filter is a filter function that implements the CORS flow as documented on http://enable-cors.org/server.html -// and http://www.html5rocks.com/static/images/cors_server_flowchart.png -func (c CrossOriginResourceSharing) Filter(req *Request, resp *Response, chain *FilterChain) { - origin := req.Request.Header.Get(HEADER_Origin) - if len(origin) == 0 { - if trace { - traceLogger.Print("no Http header Origin set") - } - chain.ProcessFilter(req, resp) - return - } - if !c.isOriginAllowed(origin) { // check whether this origin is allowed - if trace { - traceLogger.Printf("HTTP Origin:%s is not part of %v, neither matches any part of %v", origin, c.AllowedDomains, c.allowedOriginPatterns) - } - chain.ProcessFilter(req, resp) - return - } - if req.Request.Method != "OPTIONS" { - c.doActualRequest(req, resp) - chain.ProcessFilter(req, resp) - return - } - if acrm := req.Request.Header.Get(HEADER_AccessControlRequestMethod); acrm != "" { - c.doPreflightRequest(req, resp) - } else { - c.doActualRequest(req, resp) - chain.ProcessFilter(req, resp) - return - } -} - -func (c CrossOriginResourceSharing) doActualRequest(req *Request, resp *Response) { - c.setOptionsHeaders(req, resp) - // continue processing the response -} - -func (c *CrossOriginResourceSharing) doPreflightRequest(req *Request, resp *Response) { - if len(c.AllowedMethods) == 0 { - if c.Container == nil { - c.AllowedMethods = DefaultContainer.computeAllowedMethods(req) - } else { - c.AllowedMethods = c.Container.computeAllowedMethods(req) - } - } - - acrm := req.Request.Header.Get(HEADER_AccessControlRequestMethod) - if !c.isValidAccessControlRequestMethod(acrm, c.AllowedMethods) { - if trace { - traceLogger.Printf("Http header %s:%s is not in %v", - HEADER_AccessControlRequestMethod, - acrm, - c.AllowedMethods) - } - return - } - acrhs := req.Request.Header.Get(HEADER_AccessControlRequestHeaders) - if len(acrhs) > 0 { - for _, each := range strings.Split(acrhs, ",") { - if !c.isValidAccessControlRequestHeader(strings.Trim(each, " ")) { - if trace { - traceLogger.Printf("Http header %s:%s is not in %v", - HEADER_AccessControlRequestHeaders, - acrhs, - c.AllowedHeaders) - } - return - } - } - } - resp.AddHeader(HEADER_AccessControlAllowMethods, strings.Join(c.AllowedMethods, ",")) - resp.AddHeader(HEADER_AccessControlAllowHeaders, acrhs) - c.setOptionsHeaders(req, resp) - - // return http 200 response, no body -} - -func (c CrossOriginResourceSharing) setOptionsHeaders(req *Request, resp *Response) { - c.checkAndSetExposeHeaders(resp) - c.setAllowOriginHeader(req, resp) - c.checkAndSetAllowCredentials(resp) - if c.MaxAge > 0 { - resp.AddHeader(HEADER_AccessControlMaxAge, strconv.Itoa(c.MaxAge)) - } -} - -func (c CrossOriginResourceSharing) isOriginAllowed(origin string) bool { - if len(origin) == 0 { - return false - } - if len(c.AllowedDomains) == 0 { - return true - } - - allowed := false - for _, domain := range c.AllowedDomains { - if domain == origin { - allowed = true - break - } - } - - if !allowed { - if len(c.allowedOriginPatterns) == 0 { - // compile allowed domains to allowed origin patterns - allowedOriginRegexps, err := compileRegexps(c.AllowedDomains) - if err != nil { - return false - } - c.allowedOriginPatterns = allowedOriginRegexps - } - - for _, pattern := range c.allowedOriginPatterns { - if allowed = pattern.MatchString(origin); allowed { - break - } - } - } - - return allowed -} - -func (c CrossOriginResourceSharing) setAllowOriginHeader(req *Request, resp *Response) { - origin := req.Request.Header.Get(HEADER_Origin) - if c.isOriginAllowed(origin) { - resp.AddHeader(HEADER_AccessControlAllowOrigin, origin) - } -} - -func (c CrossOriginResourceSharing) checkAndSetExposeHeaders(resp *Response) { - if len(c.ExposeHeaders) > 0 { - resp.AddHeader(HEADER_AccessControlExposeHeaders, strings.Join(c.ExposeHeaders, ",")) - } -} - -func (c CrossOriginResourceSharing) checkAndSetAllowCredentials(resp *Response) { - if c.CookiesAllowed { - resp.AddHeader(HEADER_AccessControlAllowCredentials, "true") - } -} - -func (c CrossOriginResourceSharing) isValidAccessControlRequestMethod(method string, allowedMethods []string) bool { - for _, each := range allowedMethods { - if each == method { - return true - } - } - return false -} - -func (c CrossOriginResourceSharing) isValidAccessControlRequestHeader(header string) bool { - for _, each := range c.AllowedHeaders { - if strings.ToLower(each) == strings.ToLower(header) { - return true - } - } - return false -} - -// Take a list of strings and compile them into a list of regular expressions. -func compileRegexps(regexpStrings []string) ([]*regexp.Regexp, error) { - regexps := []*regexp.Regexp{} - for _, regexpStr := range regexpStrings { - r, err := regexp.Compile(regexpStr) - if err != nil { - return regexps, err - } - regexps = append(regexps, r) - } - return regexps, nil -} diff --git a/vendor/github.com/emicklei/go-restful/cors_filter_test.go b/vendor/github.com/emicklei/go-restful/cors_filter_test.go deleted file mode 100644 index 09c5d330..00000000 --- a/vendor/github.com/emicklei/go-restful/cors_filter_test.go +++ /dev/null @@ -1,129 +0,0 @@ -package restful - -import ( - "net/http" - "net/http/httptest" - "testing" -) - -// go test -v -test.run TestCORSFilter_Preflight ...restful -// http://www.html5rocks.com/en/tutorials/cors/#toc-handling-a-not-so-simple-request -func TestCORSFilter_Preflight(t *testing.T) { - tearDown() - ws := new(WebService) - ws.Route(ws.PUT("/cors").To(dummy)) - Add(ws) - - cors := CrossOriginResourceSharing{ - ExposeHeaders: []string{"X-Custom-Header"}, - AllowedHeaders: []string{"X-Custom-Header", "X-Additional-Header"}, - CookiesAllowed: true, - Container: DefaultContainer} - Filter(cors.Filter) - - // Preflight - httpRequest, _ := http.NewRequest("OPTIONS", "http://api.alice.com/cors", nil) - httpRequest.Method = "OPTIONS" - httpRequest.Header.Set(HEADER_Origin, "http://api.bob.com") - httpRequest.Header.Set(HEADER_AccessControlRequestMethod, "PUT") - httpRequest.Header.Set(HEADER_AccessControlRequestHeaders, "X-Custom-Header, X-Additional-Header") - - httpWriter := httptest.NewRecorder() - DefaultContainer.Dispatch(httpWriter, httpRequest) - - actual := httpWriter.Header().Get(HEADER_AccessControlAllowOrigin) - if "http://api.bob.com" != actual { - t.Fatal("expected: http://api.bob.com but got:" + actual) - } - actual = httpWriter.Header().Get(HEADER_AccessControlAllowMethods) - if "PUT" != actual { - t.Fatal("expected: PUT but got:" + actual) - } - actual = httpWriter.Header().Get(HEADER_AccessControlAllowHeaders) - if "X-Custom-Header, X-Additional-Header" != actual { - t.Fatal("expected: X-Custom-Header, X-Additional-Header but got:" + actual) - } - - if !cors.isOriginAllowed("somewhere") { - t.Fatal("origin expected to be allowed") - } - cors.AllowedDomains = []string{"overthere.com"} - if cors.isOriginAllowed("somewhere") { - t.Fatal("origin [somewhere] expected NOT to be allowed") - } - if !cors.isOriginAllowed("overthere.com") { - t.Fatal("origin [overthere] expected to be allowed") - } - -} - -// go test -v -test.run TestCORSFilter_Actual ...restful -// http://www.html5rocks.com/en/tutorials/cors/#toc-handling-a-not-so-simple-request -func TestCORSFilter_Actual(t *testing.T) { - tearDown() - ws := new(WebService) - ws.Route(ws.PUT("/cors").To(dummy)) - Add(ws) - - cors := CrossOriginResourceSharing{ - ExposeHeaders: []string{"X-Custom-Header"}, - AllowedHeaders: []string{"X-Custom-Header", "X-Additional-Header"}, - CookiesAllowed: true, - Container: DefaultContainer} - Filter(cors.Filter) - - // Actual - httpRequest, _ := http.NewRequest("PUT", "http://api.alice.com/cors", nil) - httpRequest.Header.Set(HEADER_Origin, "http://api.bob.com") - httpRequest.Header.Set("X-Custom-Header", "value") - - httpWriter := httptest.NewRecorder() - DefaultContainer.Dispatch(httpWriter, httpRequest) - actual := httpWriter.Header().Get(HEADER_AccessControlAllowOrigin) - if "http://api.bob.com" != actual { - t.Fatal("expected: http://api.bob.com but got:" + actual) - } - if httpWriter.Body.String() != "dummy" { - t.Fatal("expected: dummy but got:" + httpWriter.Body.String()) - } -} - -var allowedDomainInput = []struct { - domains []string - origin string - allowed bool -}{ - {[]string{}, "http://anything.com", true}, - {[]string{"example.com"}, "example.com", true}, - {[]string{"example.com"}, "not-allowed", false}, - {[]string{"not-matching.com", "example.com"}, "example.com", true}, - {[]string{".*"}, "example.com", true}, -} - -// go test -v -test.run TestCORSFilter_AllowedDomains ...restful -func TestCORSFilter_AllowedDomains(t *testing.T) { - for _, each := range allowedDomainInput { - tearDown() - ws := new(WebService) - ws.Route(ws.PUT("/cors").To(dummy)) - Add(ws) - - cors := CrossOriginResourceSharing{ - AllowedDomains: each.domains, - CookiesAllowed: true, - Container: DefaultContainer} - Filter(cors.Filter) - - httpRequest, _ := http.NewRequest("PUT", "http://api.his.com/cors", nil) - httpRequest.Header.Set(HEADER_Origin, each.origin) - httpWriter := httptest.NewRecorder() - DefaultContainer.Dispatch(httpWriter, httpRequest) - actual := httpWriter.Header().Get(HEADER_AccessControlAllowOrigin) - if actual != each.origin && each.allowed { - t.Fatal("expected to be accepted") - } - if actual == each.origin && !each.allowed { - t.Fatal("did not expect to be accepted") - } - } -} diff --git a/vendor/github.com/emicklei/go-restful/coverage.sh b/vendor/github.com/emicklei/go-restful/coverage.sh deleted file mode 100644 index e27dbf1a..00000000 --- a/vendor/github.com/emicklei/go-restful/coverage.sh +++ /dev/null @@ -1,2 +0,0 @@ -go test -coverprofile=coverage.out -go tool cover -html=coverage.out \ No newline at end of file diff --git a/vendor/github.com/emicklei/go-restful/curly.go b/vendor/github.com/emicklei/go-restful/curly.go deleted file mode 100644 index 79f1f5aa..00000000 --- a/vendor/github.com/emicklei/go-restful/curly.go +++ /dev/null @@ -1,164 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "net/http" - "regexp" - "sort" - "strings" -) - -// CurlyRouter expects Routes with paths that contain zero or more parameters in curly brackets. -type CurlyRouter struct{} - -// SelectRoute is part of the Router interface and returns the best match -// for the WebService and its Route for the given Request. -func (c CurlyRouter) SelectRoute( - webServices []*WebService, - httpRequest *http.Request) (selectedService *WebService, selected *Route, err error) { - - requestTokens := tokenizePath(httpRequest.URL.Path) - - detectedService := c.detectWebService(requestTokens, webServices) - if detectedService == nil { - if trace { - traceLogger.Printf("no WebService was found to match URL path:%s\n", httpRequest.URL.Path) - } - return nil, nil, NewError(http.StatusNotFound, "404: Page Not Found") - } - candidateRoutes := c.selectRoutes(detectedService, requestTokens) - if len(candidateRoutes) == 0 { - if trace { - traceLogger.Printf("no Route in WebService with path %s was found to match URL path:%s\n", detectedService.rootPath, httpRequest.URL.Path) - } - return detectedService, nil, NewError(http.StatusNotFound, "404: Page Not Found") - } - selectedRoute, err := c.detectRoute(candidateRoutes, httpRequest) - if selectedRoute == nil { - return detectedService, nil, err - } - return detectedService, selectedRoute, nil -} - -// selectRoutes return a collection of Route from a WebService that matches the path tokens from the request. -func (c CurlyRouter) selectRoutes(ws *WebService, requestTokens []string) sortableCurlyRoutes { - candidates := sortableCurlyRoutes{} - for _, each := range ws.routes { - matches, paramCount, staticCount := c.matchesRouteByPathTokens(each.pathParts, requestTokens) - if matches { - candidates.add(curlyRoute{each, paramCount, staticCount}) // TODO make sure Routes() return pointers? - } - } - sort.Sort(sort.Reverse(candidates)) - return candidates -} - -// matchesRouteByPathTokens computes whether it matches, howmany parameters do match and what the number of static path elements are. -func (c CurlyRouter) matchesRouteByPathTokens(routeTokens, requestTokens []string) (matches bool, paramCount int, staticCount int) { - if len(routeTokens) < len(requestTokens) { - // proceed in matching only if last routeToken is wildcard - count := len(routeTokens) - if count == 0 || !strings.HasSuffix(routeTokens[count-1], "*}") { - return false, 0, 0 - } - // proceed - } - for i, routeToken := range routeTokens { - if i == len(requestTokens) { - // reached end of request path - return false, 0, 0 - } - requestToken := requestTokens[i] - if strings.HasPrefix(routeToken, "{") { - paramCount++ - if colon := strings.Index(routeToken, ":"); colon != -1 { - // match by regex - matchesToken, matchesRemainder := c.regularMatchesPathToken(routeToken, colon, requestToken) - if !matchesToken { - return false, 0, 0 - } - if matchesRemainder { - break - } - } - } else { // no { prefix - if requestToken != routeToken { - return false, 0, 0 - } - staticCount++ - } - } - return true, paramCount, staticCount -} - -// regularMatchesPathToken tests whether the regular expression part of routeToken matches the requestToken or all remaining tokens -// format routeToken is {someVar:someExpression}, e.g. {zipcode:[\d][\d][\d][\d][A-Z][A-Z]} -func (c CurlyRouter) regularMatchesPathToken(routeToken string, colon int, requestToken string) (matchesToken bool, matchesRemainder bool) { - regPart := routeToken[colon+1 : len(routeToken)-1] - if regPart == "*" { - if trace { - traceLogger.Printf("wildcard parameter detected in route token %s that matches %s\n", routeToken, requestToken) - } - return true, true - } - matched, err := regexp.MatchString(regPart, requestToken) - return (matched && err == nil), false -} - -var jsr311Router = RouterJSR311{} - -// detectRoute selectes from a list of Route the first match by inspecting both the Accept and Content-Type -// headers of the Request. See also RouterJSR311 in jsr311.go -func (c CurlyRouter) detectRoute(candidateRoutes sortableCurlyRoutes, httpRequest *http.Request) (*Route, error) { - // tracing is done inside detectRoute - return jsr311Router.detectRoute(candidateRoutes.routes(), httpRequest) -} - -// detectWebService returns the best matching webService given the list of path tokens. -// see also computeWebserviceScore -func (c CurlyRouter) detectWebService(requestTokens []string, webServices []*WebService) *WebService { - var best *WebService - score := -1 - for _, each := range webServices { - matches, eachScore := c.computeWebserviceScore(requestTokens, each.pathExpr.tokens) - if matches && (eachScore > score) { - best = each - score = eachScore - } - } - return best -} - -// computeWebserviceScore returns whether tokens match and -// the weighted score of the longest matching consecutive tokens from the beginning. -func (c CurlyRouter) computeWebserviceScore(requestTokens []string, tokens []string) (bool, int) { - if len(tokens) > len(requestTokens) { - return false, 0 - } - score := 0 - for i := 0; i < len(tokens); i++ { - each := requestTokens[i] - other := tokens[i] - if len(each) == 0 && len(other) == 0 { - score++ - continue - } - if len(other) > 0 && strings.HasPrefix(other, "{") { - // no empty match - if len(each) == 0 { - return false, score - } - score += 1 - } else { - // not a parameter - if each != other { - return false, score - } - score += (len(tokens) - i) * 10 //fuzzy - } - } - return true, score -} diff --git a/vendor/github.com/emicklei/go-restful/curly_route.go b/vendor/github.com/emicklei/go-restful/curly_route.go deleted file mode 100644 index 296f9465..00000000 --- a/vendor/github.com/emicklei/go-restful/curly_route.go +++ /dev/null @@ -1,52 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -// curlyRoute exits for sorting Routes by the CurlyRouter based on number of parameters and number of static path elements. -type curlyRoute struct { - route Route - paramCount int - staticCount int -} - -type sortableCurlyRoutes []curlyRoute - -func (s *sortableCurlyRoutes) add(route curlyRoute) { - *s = append(*s, route) -} - -func (s sortableCurlyRoutes) routes() (routes []Route) { - for _, each := range s { - routes = append(routes, each.route) // TODO change return type - } - return routes -} - -func (s sortableCurlyRoutes) Len() int { - return len(s) -} -func (s sortableCurlyRoutes) Swap(i, j int) { - s[i], s[j] = s[j], s[i] -} -func (s sortableCurlyRoutes) Less(i, j int) bool { - ci := s[i] - cj := s[j] - - // primary key - if ci.staticCount < cj.staticCount { - return true - } - if ci.staticCount > cj.staticCount { - return false - } - // secundary key - if ci.paramCount < cj.paramCount { - return true - } - if ci.paramCount > cj.paramCount { - return false - } - return ci.route.Path < cj.route.Path -} diff --git a/vendor/github.com/emicklei/go-restful/curly_test.go b/vendor/github.com/emicklei/go-restful/curly_test.go deleted file mode 100644 index 0568dfac..00000000 --- a/vendor/github.com/emicklei/go-restful/curly_test.go +++ /dev/null @@ -1,238 +0,0 @@ -package restful - -import ( - "io" - "net/http" - "testing" -) - -var requestPaths = []struct { - // url with path (1) is handled by service with root (2) and remainder has value final (3) - path, root string -}{ - {"/", "/"}, - {"/p", "/p"}, - {"/p/x", "/p/{q}"}, - {"/q/x", "/q"}, - {"/p/x/", "/p/{q}"}, - {"/p/x/y", "/p/{q}"}, - {"/q/x/y", "/q"}, - {"/z/q", "/{p}/q"}, - {"/a/b/c/q", "/"}, -} - -// go test -v -test.run TestCurlyDetectWebService ...restful -func TestCurlyDetectWebService(t *testing.T) { - ws1 := new(WebService).Path("/") - ws2 := new(WebService).Path("/p") - ws3 := new(WebService).Path("/q") - ws4 := new(WebService).Path("/p/q") - ws5 := new(WebService).Path("/p/{q}") - ws7 := new(WebService).Path("/{p}/q") - var wss = []*WebService{ws1, ws2, ws3, ws4, ws5, ws7} - - for _, each := range wss { - t.Logf("path=%s,toks=%v\n", each.pathExpr.Source, each.pathExpr.tokens) - } - - router := CurlyRouter{} - - ok := true - for i, fixture := range requestPaths { - requestTokens := tokenizePath(fixture.path) - who := router.detectWebService(requestTokens, wss) - if who != nil && who.RootPath() != fixture.root { - t.Logf("[line:%v] Unexpected dispatcher, expected:%v, actual:%v", i, fixture.root, who.RootPath()) - ok = false - } - } - if !ok { - t.Fail() - } -} - -var serviceDetects = []struct { - path string - found bool - root string -}{ - {"/a/b", true, "/{p}/{q}/{r}"}, - {"/p/q", true, "/p/q"}, - {"/q/p", true, "/q"}, - {"/", true, "/"}, - {"/p/q/r", true, "/p/q"}, -} - -// go test -v -test.run Test_detectWebService ...restful -func Test_detectWebService(t *testing.T) { - router := CurlyRouter{} - ws1 := new(WebService).Path("/") - ws2 := new(WebService).Path("/p") - ws3 := new(WebService).Path("/q") - ws4 := new(WebService).Path("/p/q") - ws5 := new(WebService).Path("/p/{q}") - ws6 := new(WebService).Path("/p/{q}/") - ws7 := new(WebService).Path("/{p}/q") - ws8 := new(WebService).Path("/{p}/{q}/{r}") - var wss = []*WebService{ws8, ws7, ws6, ws5, ws4, ws3, ws2, ws1} - for _, fix := range serviceDetects { - requestPath := fix.path - requestTokens := tokenizePath(requestPath) - for _, ws := range wss { - serviceTokens := ws.pathExpr.tokens - matches, score := router.computeWebserviceScore(requestTokens, serviceTokens) - t.Logf("req=%s,toks:%v,ws=%s,toks:%v,score=%d,matches=%v", requestPath, requestTokens, ws.RootPath(), serviceTokens, score, matches) - } - best := router.detectWebService(requestTokens, wss) - if best != nil { - if fix.found { - t.Logf("best=%s", best.RootPath()) - } else { - t.Fatalf("should have found:%s", fix.root) - } - } - } -} - -var routeMatchers = []struct { - route string - path string - matches bool - paramCount int - staticCount int -}{ - // route, request-path - {"/a", "/a", true, 0, 1}, - {"/a", "/b", false, 0, 0}, - {"/a", "/b", false, 0, 0}, - {"/a/{b}/c/", "/a/2/c", true, 1, 2}, - {"/{a}/{b}/{c}/", "/a/b", false, 0, 0}, - {"/{x:*}", "/", false, 0, 0}, - {"/{x:*}", "/a", true, 1, 0}, - {"/{x:*}", "/a/b", true, 1, 0}, - {"/a/{x:*}", "/a/b", true, 1, 1}, - {"/a/{x:[A-Z][A-Z]}", "/a/ZX", true, 1, 1}, - {"/basepath/{resource:*}", "/basepath/some/other/location/test.xml", true, 1, 1}, -} - -// clear && go test -v -test.run Test_matchesRouteByPathTokens ...restful -func Test_matchesRouteByPathTokens(t *testing.T) { - router := CurlyRouter{} - for i, each := range routeMatchers { - routeToks := tokenizePath(each.route) - reqToks := tokenizePath(each.path) - matches, pCount, sCount := router.matchesRouteByPathTokens(routeToks, reqToks) - if matches != each.matches { - t.Fatalf("[%d] unexpected matches outcome route:%s, path:%s, matches:%v", i, each.route, each.path, matches) - } - if pCount != each.paramCount { - t.Fatalf("[%d] unexpected paramCount got:%d want:%d ", i, pCount, each.paramCount) - } - if sCount != each.staticCount { - t.Fatalf("[%d] unexpected staticCount got:%d want:%d ", i, sCount, each.staticCount) - } - } -} - -// clear && go test -v -test.run TestExtractParameters_Wildcard1 ...restful -func TestExtractParameters_Wildcard1(t *testing.T) { - params := doExtractParams("/fixed/{var:*}", 2, "/fixed/remainder", t) - if params["var"] != "remainder" { - t.Errorf("parameter mismatch var: %s", params["var"]) - } -} - -// clear && go test -v -test.run TestExtractParameters_Wildcard2 ...restful -func TestExtractParameters_Wildcard2(t *testing.T) { - params := doExtractParams("/fixed/{var:*}", 2, "/fixed/remain/der", t) - if params["var"] != "remain/der" { - t.Errorf("parameter mismatch var: %s", params["var"]) - } -} - -// clear && go test -v -test.run TestExtractParameters_Wildcard3 ...restful -func TestExtractParameters_Wildcard3(t *testing.T) { - params := doExtractParams("/static/{var:*}", 2, "/static/test/sub/hi.html", t) - if params["var"] != "test/sub/hi.html" { - t.Errorf("parameter mismatch var: %s", params["var"]) - } -} - -func TestExtractParameters_Wildcard4(t *testing.T) { - params := doExtractParams("/static/{var:*}/sub", 3, "/static/test/sub", t) - if params["var"] != "test/sub" { - t.Errorf("parameter mismatch var: %s", params["var"]) - } -} - -// clear && go test -v -test.run TestCurly_ISSUE_34 ...restful -func TestCurly_ISSUE_34(t *testing.T) { - ws1 := new(WebService).Path("/") - ws1.Route(ws1.GET("/{type}/{id}").To(curlyDummy)) - ws1.Route(ws1.GET("/network/{id}").To(curlyDummy)) - croutes := CurlyRouter{}.selectRoutes(ws1, tokenizePath("/network/12")) - if len(croutes) != 2 { - t.Fatal("expected 2 routes") - } - if got, want := croutes[0].route.Path, "/network/{id}"; got != want { - t.Errorf("got %v want %v", got, want) - } -} - -// clear && go test -v -test.run TestCurly_ISSUE_34_2 ...restful -func TestCurly_ISSUE_34_2(t *testing.T) { - ws1 := new(WebService) - ws1.Route(ws1.GET("/network/{id}").To(curlyDummy)) - ws1.Route(ws1.GET("/{type}/{id}").To(curlyDummy)) - croutes := CurlyRouter{}.selectRoutes(ws1, tokenizePath("/network/12")) - if len(croutes) != 2 { - t.Fatal("expected 2 routes") - } - if got, want := croutes[0].route.Path, "/network/{id}"; got != want { - t.Errorf("got %v want %v", got, want) - } -} - -// clear && go test -v -test.run TestCurly_JsonHtml ...restful -func TestCurly_JsonHtml(t *testing.T) { - ws1 := new(WebService) - ws1.Path("/") - ws1.Route(ws1.GET("/some.html").To(curlyDummy).Consumes("*/*").Produces("text/html")) - req, _ := http.NewRequest("GET", "/some.html", nil) - req.Header.Set("Accept", "application/json") - _, route, err := CurlyRouter{}.SelectRoute([]*WebService{ws1}, req) - if err == nil { - t.Error("error expected") - } - if route != nil { - t.Error("no route expected") - } -} - -// go test -v -test.run TestCurly_ISSUE_137 ...restful -func TestCurly_ISSUE_137(t *testing.T) { - ws1 := new(WebService) - ws1.Route(ws1.GET("/hello").To(curlyDummy)) - ws1.Path("/") - req, _ := http.NewRequest("GET", "/", nil) - _, route, _ := CurlyRouter{}.SelectRoute([]*WebService{ws1}, req) - t.Log(route) - if route != nil { - t.Error("no route expected") - } -} - -// go test -v -test.run TestCurly_ISSUE_137_2 ...restful -func TestCurly_ISSUE_137_2(t *testing.T) { - ws1 := new(WebService) - ws1.Route(ws1.GET("/hello").To(curlyDummy)) - ws1.Path("/") - req, _ := http.NewRequest("GET", "/hello/bob", nil) - _, route, _ := CurlyRouter{}.SelectRoute([]*WebService{ws1}, req) - t.Log(route) - if route != nil { - t.Errorf("no route expected, got %v", route) - } -} - -func curlyDummy(req *Request, resp *Response) { io.WriteString(resp.ResponseWriter, "curlyDummy") } diff --git a/vendor/github.com/emicklei/go-restful/doc.go b/vendor/github.com/emicklei/go-restful/doc.go deleted file mode 100644 index f7c16b01..00000000 --- a/vendor/github.com/emicklei/go-restful/doc.go +++ /dev/null @@ -1,185 +0,0 @@ -/* -Package restful , a lean package for creating REST-style WebServices without magic. - -WebServices and Routes - -A WebService has a collection of Route objects that dispatch incoming Http Requests to a function calls. -Typically, a WebService has a root path (e.g. /users) and defines common MIME types for its routes. -WebServices must be added to a container (see below) in order to handler Http requests from a server. - -A Route is defined by a HTTP method, an URL path and (optionally) the MIME types it consumes (Content-Type) and produces (Accept). -This package has the logic to find the best matching Route and if found, call its Function. - - ws := new(restful.WebService) - ws. - Path("/users"). - Consumes(restful.MIME_JSON, restful.MIME_XML). - Produces(restful.MIME_JSON, restful.MIME_XML) - - ws.Route(ws.GET("/{user-id}").To(u.findUser)) // u is a UserResource - - ... - - // GET http://localhost:8080/users/1 - func (u UserResource) findUser(request *restful.Request, response *restful.Response) { - id := request.PathParameter("user-id") - ... - } - -The (*Request, *Response) arguments provide functions for reading information from the request and writing information back to the response. - -See the example https://github.com/emicklei/go-restful/blob/master/examples/restful-user-resource.go with a full implementation. - -Regular expression matching Routes - -A Route parameter can be specified using the format "uri/{var[:regexp]}" or the special version "uri/{var:*}" for matching the tail of the path. -For example, /persons/{name:[A-Z][A-Z]} can be used to restrict values for the parameter "name" to only contain capital alphabetic characters. -Regular expressions must use the standard Go syntax as described in the regexp package. (https://code.google.com/p/re2/wiki/Syntax) -This feature requires the use of a CurlyRouter. - -Containers - -A Container holds a collection of WebServices, Filters and a http.ServeMux for multiplexing http requests. -Using the statements "restful.Add(...) and restful.Filter(...)" will register WebServices and Filters to the Default Container. -The Default container of go-restful uses the http.DefaultServeMux. -You can create your own Container and create a new http.Server for that particular container. - - container := restful.NewContainer() - server := &http.Server{Addr: ":8081", Handler: container} - -Filters - -A filter dynamically intercepts requests and responses to transform or use the information contained in the requests or responses. -You can use filters to perform generic logging, measurement, authentication, redirect, set response headers etc. -In the restful package there are three hooks into the request,response flow where filters can be added. -Each filter must define a FilterFunction: - - func (req *restful.Request, resp *restful.Response, chain *restful.FilterChain) - -Use the following statement to pass the request,response pair to the next filter or RouteFunction - - chain.ProcessFilter(req, resp) - -Container Filters - -These are processed before any registered WebService. - - // install a (global) filter for the default container (processed before any webservice) - restful.Filter(globalLogging) - -WebService Filters - -These are processed before any Route of a WebService. - - // install a webservice filter (processed before any route) - ws.Filter(webserviceLogging).Filter(measureTime) - - -Route Filters - -These are processed before calling the function associated with the Route. - - // install 2 chained route filters (processed before calling findUser) - ws.Route(ws.GET("/{user-id}").Filter(routeLogging).Filter(NewCountFilter().routeCounter).To(findUser)) - -See the example https://github.com/emicklei/go-restful/blob/master/examples/restful-filters.go with full implementations. - -Response Encoding - -Two encodings are supported: gzip and deflate. To enable this for all responses: - - restful.DefaultContainer.EnableContentEncoding(true) - -If a Http request includes the Accept-Encoding header then the response content will be compressed using the specified encoding. -Alternatively, you can create a Filter that performs the encoding and install it per WebService or Route. - -See the example https://github.com/emicklei/go-restful/blob/master/examples/restful-encoding-filter.go - -OPTIONS support - -By installing a pre-defined container filter, your Webservice(s) can respond to the OPTIONS Http request. - - Filter(OPTIONSFilter()) - -CORS - -By installing the filter of a CrossOriginResourceSharing (CORS), your WebService(s) can handle CORS requests. - - cors := CrossOriginResourceSharing{ExposeHeaders: []string{"X-My-Header"}, CookiesAllowed: false, Container: DefaultContainer} - Filter(cors.Filter) - -Error Handling - -Unexpected things happen. If a request cannot be processed because of a failure, your service needs to tell via the response what happened and why. -For this reason HTTP status codes exist and it is important to use the correct code in every exceptional situation. - - 400: Bad Request - -If path or query parameters are not valid (content or type) then use http.StatusBadRequest. - - 404: Not Found - -Despite a valid URI, the resource requested may not be available - - 500: Internal Server Error - -If the application logic could not process the request (or write the response) then use http.StatusInternalServerError. - - 405: Method Not Allowed - -The request has a valid URL but the method (GET,PUT,POST,...) is not allowed. - - 406: Not Acceptable - -The request does not have or has an unknown Accept Header set for this operation. - - 415: Unsupported Media Type - -The request does not have or has an unknown Content-Type Header set for this operation. - -ServiceError - -In addition to setting the correct (error) Http status code, you can choose to write a ServiceError message on the response. - -Performance options - -This package has several options that affect the performance of your service. It is important to understand them and how you can change it. - - restful.DefaultContainer.DoNotRecover(false) - -DoNotRecover controls whether panics will be caught to return HTTP 500. -If set to false, the container will recover from panics. -Default value is true - - restful.SetCompressorProvider(NewBoundedCachedCompressors(20, 20)) - -If content encoding is enabled then the default strategy for getting new gzip/zlib writers and readers is to use a sync.Pool. -Because writers are expensive structures, performance is even more improved when using a preloaded cache. You can also inject your own implementation. - -Trouble shooting - -This package has the means to produce detail logging of the complete Http request matching process and filter invocation. -Enabling this feature requires you to set an implementation of restful.StdLogger (e.g. log.Logger) instance such as: - - restful.TraceLogger(log.New(os.Stdout, "[restful] ", log.LstdFlags|log.Lshortfile)) - -Logging - -The restful.SetLogger() method allows you to override the logger used by the package. By default restful -uses the standard library `log` package and logs to stdout. Different logging packages are supported as -long as they conform to `StdLogger` interface defined in the `log` sub-package, writing an adapter for your -preferred package is simple. - -Resources - -[project]: https://github.com/emicklei/go-restful - -[examples]: https://github.com/emicklei/go-restful/blob/master/examples - -[design]: http://ernestmicklei.com/2012/11/11/go-restful-api-design/ - -[showcases]: https://github.com/emicklei/mora, https://github.com/emicklei/landskape - -(c) 2012-2015, http://ernestmicklei.com. MIT License -*/ -package restful diff --git a/vendor/github.com/emicklei/go-restful/doc_examples_test.go b/vendor/github.com/emicklei/go-restful/doc_examples_test.go deleted file mode 100644 index 0af636e5..00000000 --- a/vendor/github.com/emicklei/go-restful/doc_examples_test.go +++ /dev/null @@ -1,41 +0,0 @@ -package restful - -import "net/http" - -func ExampleOPTIONSFilter() { - // Install the OPTIONS filter on the default Container - Filter(OPTIONSFilter()) -} -func ExampleContainer_OPTIONSFilter() { - // Install the OPTIONS filter on a Container - myContainer := new(Container) - myContainer.Filter(myContainer.OPTIONSFilter) -} - -func ExampleContainer() { - // The Default container of go-restful uses the http.DefaultServeMux. - // You can create your own Container using restful.NewContainer() and create a new http.Server for that particular container - - ws := new(WebService) - wsContainer := NewContainer() - wsContainer.Add(ws) - server := &http.Server{Addr: ":8080", Handler: wsContainer} - server.ListenAndServe() -} - -func ExampleCrossOriginResourceSharing() { - // To install this filter on the Default Container use: - cors := CrossOriginResourceSharing{ExposeHeaders: []string{"X-My-Header"}, CookiesAllowed: false, Container: DefaultContainer} - Filter(cors.Filter) -} - -func ExampleServiceError() { - resp := new(Response) - resp.WriteEntity(NewError(http.StatusBadRequest, "Non-integer {id} path parameter")) -} - -func ExampleBoundedCachedCompressors() { - // Register a compressor provider (gzip/deflate read/write) that uses - // a bounded cache with a maximum of 20 writers and 20 readers. - SetCompressorProvider(NewBoundedCachedCompressors(20, 20)) -} diff --git a/vendor/github.com/emicklei/go-restful/entity_accessors.go b/vendor/github.com/emicklei/go-restful/entity_accessors.go deleted file mode 100644 index 66dfc824..00000000 --- a/vendor/github.com/emicklei/go-restful/entity_accessors.go +++ /dev/null @@ -1,162 +0,0 @@ -package restful - -// Copyright 2015 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "encoding/xml" - "strings" - "sync" -) - -// EntityReaderWriter can read and write values using an encoding such as JSON,XML. -type EntityReaderWriter interface { - // Read a serialized version of the value from the request. - // The Request may have a decompressing reader. Depends on Content-Encoding. - Read(req *Request, v interface{}) error - - // Write a serialized version of the value on the response. - // The Response may have a compressing writer. Depends on Accept-Encoding. - // status should be a valid Http Status code - Write(resp *Response, status int, v interface{}) error -} - -// entityAccessRegistry is a singleton -var entityAccessRegistry = &entityReaderWriters{ - protection: new(sync.RWMutex), - accessors: map[string]EntityReaderWriter{}, -} - -// entityReaderWriters associates MIME to an EntityReaderWriter -type entityReaderWriters struct { - protection *sync.RWMutex - accessors map[string]EntityReaderWriter -} - -func init() { - RegisterEntityAccessor(MIME_JSON, NewEntityAccessorJSON(MIME_JSON)) - RegisterEntityAccessor(MIME_XML, NewEntityAccessorXML(MIME_XML)) -} - -// RegisterEntityAccessor add/overrides the ReaderWriter for encoding content with this MIME type. -func RegisterEntityAccessor(mime string, erw EntityReaderWriter) { - entityAccessRegistry.protection.Lock() - defer entityAccessRegistry.protection.Unlock() - entityAccessRegistry.accessors[mime] = erw -} - -// NewEntityAccessorJSON returns a new EntityReaderWriter for accessing JSON content. -// This package is already initialized with such an accessor using the MIME_JSON contentType. -func NewEntityAccessorJSON(contentType string) EntityReaderWriter { - return entityJSONAccess{ContentType: contentType} -} - -// NewEntityAccessorXML returns a new EntityReaderWriter for accessing XML content. -// This package is already initialized with such an accessor using the MIME_XML contentType. -func NewEntityAccessorXML(contentType string) EntityReaderWriter { - return entityXMLAccess{ContentType: contentType} -} - -// accessorAt returns the registered ReaderWriter for this MIME type. -func (r *entityReaderWriters) accessorAt(mime string) (EntityReaderWriter, bool) { - r.protection.RLock() - defer r.protection.RUnlock() - er, ok := r.accessors[mime] - if !ok { - // retry with reverse lookup - // more expensive but we are in an exceptional situation anyway - for k, v := range r.accessors { - if strings.Contains(mime, k) { - return v, true - } - } - } - return er, ok -} - -// entityXMLAccess is a EntityReaderWriter for XML encoding -type entityXMLAccess struct { - // This is used for setting the Content-Type header when writing - ContentType string -} - -// Read unmarshalls the value from XML -func (e entityXMLAccess) Read(req *Request, v interface{}) error { - return xml.NewDecoder(req.Request.Body).Decode(v) -} - -// Write marshalls the value to JSON and set the Content-Type Header. -func (e entityXMLAccess) Write(resp *Response, status int, v interface{}) error { - return writeXML(resp, status, e.ContentType, v) -} - -// writeXML marshalls the value to JSON and set the Content-Type Header. -func writeXML(resp *Response, status int, contentType string, v interface{}) error { - if v == nil { - resp.WriteHeader(status) - // do not write a nil representation - return nil - } - if resp.prettyPrint { - // pretty output must be created and written explicitly - output, err := xml.MarshalIndent(v, " ", " ") - if err != nil { - return err - } - resp.Header().Set(HEADER_ContentType, contentType) - resp.WriteHeader(status) - _, err = resp.Write([]byte(xml.Header)) - if err != nil { - return err - } - _, err = resp.Write(output) - return err - } - // not-so-pretty - resp.Header().Set(HEADER_ContentType, contentType) - resp.WriteHeader(status) - return xml.NewEncoder(resp).Encode(v) -} - -// entityJSONAccess is a EntityReaderWriter for JSON encoding -type entityJSONAccess struct { - // This is used for setting the Content-Type header when writing - ContentType string -} - -// Read unmarshalls the value from JSON -func (e entityJSONAccess) Read(req *Request, v interface{}) error { - decoder := NewDecoder(req.Request.Body) - decoder.UseNumber() - return decoder.Decode(v) -} - -// Write marshalls the value to JSON and set the Content-Type Header. -func (e entityJSONAccess) Write(resp *Response, status int, v interface{}) error { - return writeJSON(resp, status, e.ContentType, v) -} - -// write marshalls the value to JSON and set the Content-Type Header. -func writeJSON(resp *Response, status int, contentType string, v interface{}) error { - if v == nil { - resp.WriteHeader(status) - // do not write a nil representation - return nil - } - if resp.prettyPrint { - // pretty output must be created and written explicitly - output, err := MarshalIndent(v, "", " ") - if err != nil { - return err - } - resp.Header().Set(HEADER_ContentType, contentType) - resp.WriteHeader(status) - _, err = resp.Write(output) - return err - } - // not-so-pretty - resp.Header().Set(HEADER_ContentType, contentType) - resp.WriteHeader(status) - return NewEncoder(resp).Encode(v) -} diff --git a/vendor/github.com/emicklei/go-restful/entity_accessors_test.go b/vendor/github.com/emicklei/go-restful/entity_accessors_test.go deleted file mode 100644 index d1c1e158..00000000 --- a/vendor/github.com/emicklei/go-restful/entity_accessors_test.go +++ /dev/null @@ -1,69 +0,0 @@ -package restful - -import ( - "bytes" - "fmt" - "io" - "net/http" - "net/http/httptest" - "reflect" - "testing" -) - -type keyvalue struct { - readCalled bool - writeCalled bool -} - -func (kv *keyvalue) Read(req *Request, v interface{}) error { - //t := reflect.TypeOf(v) - //rv := reflect.ValueOf(v) - kv.readCalled = true - return nil -} - -func (kv *keyvalue) Write(resp *Response, status int, v interface{}) error { - t := reflect.TypeOf(v) - rv := reflect.ValueOf(v) - for ix := 0; ix < t.NumField(); ix++ { - sf := t.Field(ix) - io.WriteString(resp, sf.Name) - io.WriteString(resp, "=") - io.WriteString(resp, fmt.Sprintf("%v\n", rv.Field(ix).Interface())) - } - kv.writeCalled = true - return nil -} - -// go test -v -test.run TestKeyValueEncoding ...restful -func TestKeyValueEncoding(t *testing.T) { - type Book struct { - Title string - Author string - PublishedYear int - } - kv := new(keyvalue) - RegisterEntityAccessor("application/kv", kv) - b := Book{"Singing for Dummies", "john doe", 2015} - - // Write - httpWriter := httptest.NewRecorder() - // Accept Produces - resp := Response{ResponseWriter: httpWriter, requestAccept: "application/kv,*/*;q=0.8", routeProduces: []string{"application/kv"}, prettyPrint: true} - resp.WriteEntity(b) - t.Log(string(httpWriter.Body.Bytes())) - if !kv.writeCalled { - t.Error("Write never called") - } - - // Read - bodyReader := bytes.NewReader(httpWriter.Body.Bytes()) - httpRequest, _ := http.NewRequest("GET", "/test", bodyReader) - httpRequest.Header.Set("Content-Type", "application/kv; charset=UTF-8") - request := NewRequest(httpRequest) - var bb Book - request.ReadEntity(&bb) - if !kv.readCalled { - t.Error("Read never called") - } -} diff --git a/vendor/github.com/emicklei/go-restful/examples/.goconvey b/vendor/github.com/emicklei/go-restful/examples/.goconvey deleted file mode 100644 index 8485e986..00000000 --- a/vendor/github.com/emicklei/go-restful/examples/.goconvey +++ /dev/null @@ -1 +0,0 @@ -ignore \ No newline at end of file diff --git a/vendor/github.com/emicklei/go-restful/examples/google_app_engine/.goconvey b/vendor/github.com/emicklei/go-restful/examples/google_app_engine/.goconvey deleted file mode 100644 index 8485e986..00000000 --- a/vendor/github.com/emicklei/go-restful/examples/google_app_engine/.goconvey +++ /dev/null @@ -1 +0,0 @@ -ignore \ No newline at end of file diff --git a/vendor/github.com/emicklei/go-restful/examples/google_app_engine/app.yaml b/vendor/github.com/emicklei/go-restful/examples/google_app_engine/app.yaml deleted file mode 100644 index 362db6b0..00000000 --- a/vendor/github.com/emicklei/go-restful/examples/google_app_engine/app.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# -# Include your application ID here -# -application: -version: 1 -runtime: go -api_version: go1 - -handlers: -# -# Regex for all swagger files to make as static content. -# You should create the folder static/swagger and copy -# swagger-ui into it. -# -- url: /apidocs/(.*?)/(.*\.(js|html|css)) - static_files: static/swagger/\1/\2 - upload: static/swagger/(.*?)/(.*\.(js|html|css)) - -- url: /.* - script: _go_app diff --git a/vendor/github.com/emicklei/go-restful/examples/google_app_engine/datastore/.goconvey b/vendor/github.com/emicklei/go-restful/examples/google_app_engine/datastore/.goconvey deleted file mode 100644 index 8485e986..00000000 --- a/vendor/github.com/emicklei/go-restful/examples/google_app_engine/datastore/.goconvey +++ /dev/null @@ -1 +0,0 @@ -ignore \ No newline at end of file diff --git a/vendor/github.com/emicklei/go-restful/examples/google_app_engine/datastore/app.yaml b/vendor/github.com/emicklei/go-restful/examples/google_app_engine/datastore/app.yaml deleted file mode 100644 index 1ac9dca2..00000000 --- a/vendor/github.com/emicklei/go-restful/examples/google_app_engine/datastore/app.yaml +++ /dev/null @@ -1,18 +0,0 @@ -application: -version: 1 -runtime: go -api_version: go1 - -handlers: -# Regex for all swagger files to make as static content. -# You should create the folder static/swagger and copy -# swagger-ui into it. -# -- url: /apidocs/(.*?)/(.*\.(js|html|css)) - static_files: static/swagger/\1/\2 - upload: static/swagger/(.*?)/(.*\.(js|html|css)) - -# Catch all. -- url: /.* - script: _go_app - login: required diff --git a/vendor/github.com/emicklei/go-restful/examples/google_app_engine/datastore/main.go b/vendor/github.com/emicklei/go-restful/examples/google_app_engine/datastore/main.go deleted file mode 100644 index 33e5b2ea..00000000 --- a/vendor/github.com/emicklei/go-restful/examples/google_app_engine/datastore/main.go +++ /dev/null @@ -1,267 +0,0 @@ -package main - -import ( - "net/http" - "time" - - "github.com/emicklei/go-restful" - "github.com/emicklei/go-restful-swagger12" - "google.golang.org/appengine" - "google.golang.org/appengine/datastore" - "google.golang.org/appengine/user" -) - -// This example demonstrates a reasonably complete suite of RESTful operations backed -// by DataStore on Google App Engine. - -// Our simple example struct. -type Profile struct { - LastModified time.Time `json:"-" xml:"-"` - Email string `json:"-" xml:"-"` - FirstName string `json:"first_name" xml:"first-name"` - NickName string `json:"nick_name" xml:"nick-name"` - LastName string `json:"last_name" xml:"last-name"` -} - -type ProfileApi struct { - Path string -} - -func gaeUrl() string { - if appengine.IsDevAppServer() { - return "http://localhost:8080" - } else { - // Include your URL on App Engine here. - // I found no way to get AppID without appengine.Context and this always - // based on a http.Request. - return "http://federatedservices.appspot.com" - } -} - -func init() { - u := ProfileApi{Path: "/profiles"} - u.register() - - // Optionally, you can install the Swagger Service which provides a nice Web UI on your REST API - // You need to download the Swagger HTML5 assets and change the FilePath location in the config below. - // Open .appspot.com/apidocs and enter - // Place the Swagger UI files into a folder called static/swagger if you wish to use Swagger - // http://.appspot.com/apidocs.json in the api input field. - // For testing, you can use http://localhost:8080/apidocs.json - config := swagger.Config{ - // You control what services are visible - WebServices: restful.RegisteredWebServices(), - WebServicesUrl: gaeUrl(), - ApiPath: "/apidocs.json", - - // Optionally, specify where the UI is located - SwaggerPath: "/apidocs/", - - // GAE support static content which is configured in your app.yaml. - // This example expect the swagger-ui in static/swagger so you should place it there :) - SwaggerFilePath: "static/swagger"} - swagger.InstallSwaggerService(config) -} - -func (u ProfileApi) register() { - ws := new(restful.WebService) - - ws. - Path(u.Path). - // You can specify consumes and produces per route as well. - Consumes(restful.MIME_JSON, restful.MIME_XML). - Produces(restful.MIME_JSON, restful.MIME_XML) - - ws.Route(ws.POST("").To(u.insert). - // Swagger documentation. - Doc("insert a new profile"). - Param(ws.BodyParameter("Profile", "representation of a profile").DataType("main.Profile")). - Reads(Profile{})) - - ws.Route(ws.GET("/{profile-id}").To(u.read). - // Swagger documentation. - Doc("read a profile"). - Param(ws.PathParameter("profile-id", "identifier for a profile").DataType("string")). - Writes(Profile{})) - - ws.Route(ws.PUT("/{profile-id}").To(u.update). - // Swagger documentation. - Doc("update an existing profile"). - Param(ws.PathParameter("profile-id", "identifier for a profile").DataType("string")). - Param(ws.BodyParameter("Profile", "representation of a profile").DataType("main.Profile")). - Reads(Profile{})) - - ws.Route(ws.DELETE("/{profile-id}").To(u.remove). - // Swagger documentation. - Doc("remove a profile"). - Param(ws.PathParameter("profile-id", "identifier for a profile").DataType("string"))) - - restful.Add(ws) -} - -// POST http://localhost:8080/profiles -// {"first_name": "Ivan", "nick_name": "Socks", "last_name": "Hawkes"} -// -func (u *ProfileApi) insert(r *restful.Request, w *restful.Response) { - c := appengine.NewContext(r.Request) - - // Marshall the entity from the request into a struct. - p := new(Profile) - err := r.ReadEntity(&p) - if err != nil { - w.WriteError(http.StatusNotAcceptable, err) - return - } - - // Ensure we start with a sensible value for this field. - p.LastModified = time.Now() - - // The profile belongs to this user. - p.Email = user.Current(c).String() - - k, err := datastore.Put(c, datastore.NewIncompleteKey(c, "profiles", nil), p) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - - // Let them know the location of the newly created resource. - // TODO: Use a safe Url path append function. - w.AddHeader("Location", u.Path+"/"+k.Encode()) - - // Return the resultant entity. - w.WriteHeader(http.StatusCreated) - w.WriteEntity(p) -} - -// GET http://localhost:8080/profiles/ahdkZXZ-ZmVkZXJhdGlvbi1zZXJ2aWNlc3IVCxIIcHJvZmlsZXMYgICAgICAgAoM -// -func (u ProfileApi) read(r *restful.Request, w *restful.Response) { - c := appengine.NewContext(r.Request) - - // Decode the request parameter to determine the key for the entity. - k, err := datastore.DecodeKey(r.PathParameter("profile-id")) - if err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - - // Retrieve the entity from the datastore. - p := Profile{} - if err := datastore.Get(c, k, &p); err != nil { - if err.Error() == "datastore: no such entity" { - http.Error(w, err.Error(), http.StatusNotFound) - } else { - http.Error(w, err.Error(), http.StatusInternalServerError) - } - return - } - - // Check we own the profile before allowing them to view it. - // Optionally, return a 404 instead to help prevent guessing ids. - // TODO: Allow admins access. - if p.Email != user.Current(c).String() { - http.Error(w, "You do not have access to this resource", http.StatusForbidden) - return - } - - w.WriteEntity(p) -} - -// PUT http://localhost:8080/profiles/ahdkZXZ-ZmVkZXJhdGlvbi1zZXJ2aWNlc3IVCxIIcHJvZmlsZXMYgICAgICAgAoM -// {"first_name": "Ivan", "nick_name": "Socks", "last_name": "Hawkes"} -// -func (u *ProfileApi) update(r *restful.Request, w *restful.Response) { - c := appengine.NewContext(r.Request) - - // Decode the request parameter to determine the key for the entity. - k, err := datastore.DecodeKey(r.PathParameter("profile-id")) - if err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - - // Marshall the entity from the request into a struct. - p := new(Profile) - err = r.ReadEntity(&p) - if err != nil { - w.WriteError(http.StatusNotAcceptable, err) - return - } - - // Retrieve the old entity from the datastore. - old := Profile{} - if err := datastore.Get(c, k, &old); err != nil { - if err.Error() == "datastore: no such entity" { - http.Error(w, err.Error(), http.StatusNotFound) - } else { - http.Error(w, err.Error(), http.StatusInternalServerError) - } - return - } - - // Check we own the profile before allowing them to update it. - // Optionally, return a 404 instead to help prevent guessing ids. - // TODO: Allow admins access. - if old.Email != user.Current(c).String() { - http.Error(w, "You do not have access to this resource", http.StatusForbidden) - return - } - - // Since the whole entity is re-written, we need to assign any invariant fields again - // e.g. the owner of the entity. - p.Email = user.Current(c).String() - - // Keep track of the last modification date. - p.LastModified = time.Now() - - // Attempt to overwrite the old entity. - _, err = datastore.Put(c, k, p) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - - // Let them know it succeeded. - w.WriteHeader(http.StatusNoContent) -} - -// DELETE http://localhost:8080/profiles/ahdkZXZ-ZmVkZXJhdGlvbi1zZXJ2aWNlc3IVCxIIcHJvZmlsZXMYgICAgICAgAoM -// -func (u *ProfileApi) remove(r *restful.Request, w *restful.Response) { - c := appengine.NewContext(r.Request) - - // Decode the request parameter to determine the key for the entity. - k, err := datastore.DecodeKey(r.PathParameter("profile-id")) - if err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - - // Retrieve the old entity from the datastore. - old := Profile{} - if err := datastore.Get(c, k, &old); err != nil { - if err.Error() == "datastore: no such entity" { - http.Error(w, err.Error(), http.StatusNotFound) - } else { - http.Error(w, err.Error(), http.StatusInternalServerError) - } - return - } - - // Check we own the profile before allowing them to delete it. - // Optionally, return a 404 instead to help prevent guessing ids. - // TODO: Allow admins access. - if old.Email != user.Current(c).String() { - http.Error(w, "You do not have access to this resource", http.StatusForbidden) - return - } - - // Delete the entity. - if err := datastore.Delete(c, k); err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - } - - // Success notification. - w.WriteHeader(http.StatusNoContent) -} diff --git a/vendor/github.com/emicklei/go-restful/examples/google_app_engine/restful-appstats-integration.go b/vendor/github.com/emicklei/go-restful/examples/google_app_engine/restful-appstats-integration.go deleted file mode 100644 index a871133b..00000000 --- a/vendor/github.com/emicklei/go-restful/examples/google_app_engine/restful-appstats-integration.go +++ /dev/null @@ -1,12 +0,0 @@ -package main - -import ( - "github.com/mjibson/appstats" -) - -func stats(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) { - c := appstats.NewContext(req.Request) - chain.ProcessFilter(req, resp) - c.Stats.Status = resp.StatusCode() - c.Save() -} diff --git a/vendor/github.com/emicklei/go-restful/examples/google_app_engine/restful-user-service.go b/vendor/github.com/emicklei/go-restful/examples/google_app_engine/restful-user-service.go deleted file mode 100644 index e1b462c3..00000000 --- a/vendor/github.com/emicklei/go-restful/examples/google_app_engine/restful-user-service.go +++ /dev/null @@ -1,162 +0,0 @@ -package main - -import ( - "net/http" - - "github.com/emicklei/go-restful" - "github.com/emicklei/go-restful-swagger12" - "google.golang.org/appengine" - "google.golang.org/appengine/memcache" -) - -// This example is functionally the same as ../restful-user-service.go -// but it`s supposed to run on Goole App Engine (GAE) -// -// contributed by ivanhawkes - -type User struct { - Id, Name string -} - -type UserService struct { - // normally one would use DAO (data access object) - // but in this example we simple use memcache. -} - -func (u UserService) Register() { - ws := new(restful.WebService) - - ws. - Path("/users"). - Consumes(restful.MIME_XML, restful.MIME_JSON). - Produces(restful.MIME_JSON, restful.MIME_XML) // you can specify this per route as well - - ws.Route(ws.GET("/{user-id}").To(u.findUser). - // docs - Doc("get a user"). - Param(ws.PathParameter("user-id", "identifier of the user").DataType("string")). - Writes(User{})) // on the response - - ws.Route(ws.PATCH("").To(u.updateUser). - // docs - Doc("update a user"). - Reads(User{})) // from the request - - ws.Route(ws.PUT("/{user-id}").To(u.createUser). - // docs - Doc("create a user"). - Param(ws.PathParameter("user-id", "identifier of the user").DataType("string")). - Reads(User{})) // from the request - - ws.Route(ws.DELETE("/{user-id}").To(u.removeUser). - // docs - Doc("delete a user"). - Param(ws.PathParameter("user-id", "identifier of the user").DataType("string"))) - - restful.Add(ws) -} - -// GET http://localhost:8080/users/1 -// -func (u UserService) findUser(request *restful.Request, response *restful.Response) { - c := appengine.NewContext(request.Request) - id := request.PathParameter("user-id") - usr := new(User) - _, err := memcache.Gob.Get(c, id, &usr) - if err != nil || len(usr.Id) == 0 { - response.WriteErrorString(http.StatusNotFound, "User could not be found.") - } else { - response.WriteEntity(usr) - } -} - -// PATCH http://localhost:8080/users -// 1Melissa Raspberry -// -func (u *UserService) updateUser(request *restful.Request, response *restful.Response) { - c := appengine.NewContext(request.Request) - usr := new(User) - err := request.ReadEntity(&usr) - if err == nil { - item := &memcache.Item{ - Key: usr.Id, - Object: &usr, - } - err = memcache.Gob.Set(c, item) - if err != nil { - response.WriteError(http.StatusInternalServerError, err) - return - } - response.WriteEntity(usr) - } else { - response.WriteError(http.StatusInternalServerError, err) - } -} - -// PUT http://localhost:8080/users/1 -// 1Melissa -// -func (u *UserService) createUser(request *restful.Request, response *restful.Response) { - c := appengine.NewContext(request.Request) - usr := User{Id: request.PathParameter("user-id")} - err := request.ReadEntity(&usr) - if err == nil { - item := &memcache.Item{ - Key: usr.Id, - Object: &usr, - } - err = memcache.Gob.Add(c, item) - if err != nil { - response.WriteError(http.StatusInternalServerError, err) - return - } - response.WriteHeader(http.StatusCreated) - response.WriteEntity(usr) - } else { - response.WriteError(http.StatusInternalServerError, err) - } -} - -// DELETE http://localhost:8080/users/1 -// -func (u *UserService) removeUser(request *restful.Request, response *restful.Response) { - c := appengine.NewContext(request.Request) - id := request.PathParameter("user-id") - err := memcache.Delete(c, id) - if err != nil { - response.WriteError(http.StatusInternalServerError, err) - } -} - -func getGaeURL() string { - if appengine.IsDevAppServer() { - return "http://localhost:8080" - } else { - /** - * Include your URL on App Engine here. - * I found no way to get AppID without appengine.Context and this always - * based on a http.Request. - */ - return "http://.appspot.com" - } -} - -func init() { - u := UserService{} - u.Register() - - // Optionally, you can install the Swagger Service which provides a nice Web UI on your REST API - // You need to download the Swagger HTML5 assets and change the FilePath location in the config below. - // Open .appspot.com/apidocs and enter http://.appspot.com/apidocs.json in the api input field. - config := swagger.Config{ - WebServices: restful.RegisteredWebServices(), // you control what services are visible - WebServicesUrl: getGaeURL(), - ApiPath: "/apidocs.json", - - // Optionally, specify where the UI is located - SwaggerPath: "/apidocs/", - // GAE support static content which is configured in your app.yaml. - // This example expect the swagger-ui in static/swagger so you should place it there :) - SwaggerFilePath: "static/swagger"} - swagger.InstallSwaggerService(config) -} diff --git a/vendor/github.com/emicklei/go-restful/examples/home.html b/vendor/github.com/emicklei/go-restful/examples/home.html deleted file mode 100644 index e5d49b42..00000000 --- a/vendor/github.com/emicklei/go-restful/examples/home.html +++ /dev/null @@ -1,7 +0,0 @@ - - - - -

{{.Text}}

- - \ No newline at end of file diff --git a/vendor/github.com/emicklei/go-restful/examples/msgpack/msgpack_entity.go b/vendor/github.com/emicklei/go-restful/examples/msgpack/msgpack_entity.go deleted file mode 100644 index 330e4589..00000000 --- a/vendor/github.com/emicklei/go-restful/examples/msgpack/msgpack_entity.go +++ /dev/null @@ -1,34 +0,0 @@ -package restPack - -import ( - restful "github.com/emicklei/go-restful" - "gopkg.in/vmihailenco/msgpack.v2" -) - -const MIME_MSGPACK = "application/x-msgpack" // Accept or Content-Type used in Consumes() and/or Produces() - -// NewEntityAccessorMPack returns a new EntityReaderWriter for accessing MessagePack content. -// This package is not initialized with such an accessor using the MIME_MSGPACK contentType. -func NewEntityAccessorMsgPack() restful.EntityReaderWriter { - return entityMsgPackAccess{} -} - -// entityOctetAccess is a EntityReaderWriter for Octet encoding -type entityMsgPackAccess struct { -} - -// Read unmarshalls the value from byte slice and using msgpack to unmarshal -func (e entityMsgPackAccess) Read(req *restful.Request, v interface{}) error { - return msgpack.NewDecoder(req.Request.Body).Decode(v) -} - -// Write marshals the value to byte slice and set the Content-Type Header. -func (e entityMsgPackAccess) Write(resp *restful.Response, status int, v interface{}) error { - if v == nil { - resp.WriteHeader(status) - // do not write a nil representation - return nil - } - resp.WriteHeader(status) - return msgpack.NewEncoder(resp).Encode(v) -} diff --git a/vendor/github.com/emicklei/go-restful/examples/msgpack/msgpack_entity_test.go b/vendor/github.com/emicklei/go-restful/examples/msgpack/msgpack_entity_test.go deleted file mode 100644 index 6eb47465..00000000 --- a/vendor/github.com/emicklei/go-restful/examples/msgpack/msgpack_entity_test.go +++ /dev/null @@ -1,160 +0,0 @@ -package restPack - -import ( - "bytes" - "errors" - "log" - "net/http" - "net/http/httptest" - "reflect" - "testing" - "time" - - "io/ioutil" - - restful "github.com/emicklei/go-restful" -) - -func TestMsgPack(t *testing.T) { - - // register msg pack entity - restful.RegisterEntityAccessor(MIME_MSGPACK, NewEntityAccessorMsgPack()) - type Tool struct { - Name string - Vendor string - } - - // Write - httpWriter := httptest.NewRecorder() - mpack := &Tool{Name: "json", Vendor: "apple"} - resp := restful.NewResponse(httpWriter) - resp.SetRequestAccepts("application/x-msgpack,*/*;q=0.8") - - err := resp.WriteEntity(mpack) - if err != nil { - t.Errorf("err %v", err) - } - - // Read - bodyReader := bytes.NewReader(httpWriter.Body.Bytes()) - httpRequest, _ := http.NewRequest("GET", "/test", bodyReader) - httpRequest.Header.Set("Content-Type", MIME_MSGPACK) - request := restful.NewRequest(httpRequest) - readMsgPack := new(Tool) - err = request.ReadEntity(&readMsgPack) - if err != nil { - t.Errorf("err %v", err) - } - if equal := reflect.DeepEqual(mpack, readMsgPack); !equal { - t.Fatalf("should not be error") - } -} - -func TestWithWebService(t *testing.T) { - serverURL := "http://127.0.0.1:8090" - go func() { - runRestfulMsgPackRouterServer() - }() - if err := waitForServerUp(serverURL); err != nil { - t.Errorf("%v", err) - } - - // send a post request - userData := user{Id: "0001", Name: "Tony"} - msgPackData, err := msgpack.Marshal(userData) - req, err := http.NewRequest("POST", serverURL+"/test/msgpack", bytes.NewBuffer(msgPackData)) - req.Header.Set("Content-Type", MIME_MSGPACK) - - client := &http.Client{} - resp, err := client.Do(req) - if err != nil { - t.Errorf("unexpected error in sending req: %v", err) - } - if resp.StatusCode != http.StatusOK { - t.Errorf("unexpected response: %v, expected: %v", resp.StatusCode, http.StatusOK) - } - - ur := &userResponse{} - expectMsgPackDocument(t, resp, ur) - if ur.Status != statusActive { - t.Fatalf("should not error") - } - log.Printf("user response:%v", ur) -} - -func expectMsgPackDocument(t *testing.T, r *http.Response, doc interface{}) { - data, err := ioutil.ReadAll(r.Body) - defer r.Body.Close() - if err != nil { - t.Errorf("ExpectMsgPackDocument: unable to read response body :%v", err) - return - } - // put the body back for re-reads - r.Body = ioutil.NopCloser(bytes.NewReader(data)) - - err = msgpack.Unmarshal(data, doc) - if err != nil { - t.Errorf("ExpectMsgPackDocument: unable to unmarshal MsgPack:%v", err) - } -} - -func runRestfulMsgPackRouterServer() { - - container := restful.NewContainer() - register(container) - - log.Print("start listening on localhost:8090") - server := &http.Server{Addr: ":8090", Handler: container} - log.Fatal(server.ListenAndServe()) -} - -func waitForServerUp(serverURL string) error { - for start := time.Now(); time.Since(start) < time.Minute; time.Sleep(5 * time.Second) { - _, err := http.Get(serverURL + "/") - if err == nil { - return nil - } - } - return errors.New("waiting for server timed out") -} - -var ( - statusActive = "active" -) - -type user struct { - Id, Name string -} - -type userResponse struct { - Status string -} - -func register(container *restful.Container) { - restful.RegisterEntityAccessor(MIME_MSGPACK, NewEntityAccessorMsgPack()) - ws := new(restful.WebService) - ws. - Path("/test"). - Consumes(restful.MIME_JSON, MIME_MSGPACK). - Produces(restful.MIME_JSON, MIME_MSGPACK) - // route user api - ws.Route(ws.POST("/msgpack"). - To(do). - Reads(user{}). - Writes(userResponse{})) - container.Add(ws) -} - -func do(request *restful.Request, response *restful.Response) { - u := &user{} - err := request.ReadEntity(u) - if err != nil { - log.Printf("should be no error, got:%v", err) - } - log.Printf("got:%v", u) - - ur := &userResponse{Status: statusActive} - - response.SetRequestAccepts(MIME_MSGPACK) - response.WriteEntity(ur) -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-CORS-filter.go b/vendor/github.com/emicklei/go-restful/examples/restful-CORS-filter.go deleted file mode 100644 index d682d43e..00000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-CORS-filter.go +++ /dev/null @@ -1,68 +0,0 @@ -package main - -import ( - "io" - "log" - "net/http" - - "github.com/emicklei/go-restful" -) - -// Cross-origin resource sharing (CORS) is a mechanism that allows JavaScript on a web page -// to make XMLHttpRequests to another domain, not the domain the JavaScript originated from. -// -// http://en.wikipedia.org/wiki/Cross-origin_resource_sharing -// http://enable-cors.org/server.html -// -// GET http://localhost:8080/users -// -// GET http://localhost:8080/users/1 -// -// PUT http://localhost:8080/users/1 -// -// DELETE http://localhost:8080/users/1 -// -// OPTIONS http://localhost:8080/users/1 with Header "Origin" set to some domain and - -type UserResource struct{} - -func (u UserResource) RegisterTo(container *restful.Container) { - ws := new(restful.WebService) - ws. - Path("/users"). - Consumes("*/*"). - Produces("*/*") - - ws.Route(ws.GET("/{user-id}").To(u.nop)) - ws.Route(ws.POST("").To(u.nop)) - ws.Route(ws.PUT("/{user-id}").To(u.nop)) - ws.Route(ws.DELETE("/{user-id}").To(u.nop)) - - container.Add(ws) -} - -func (u UserResource) nop(request *restful.Request, response *restful.Response) { - io.WriteString(response.ResponseWriter, "this would be a normal response") -} - -func main() { - wsContainer := restful.NewContainer() - u := UserResource{} - u.RegisterTo(wsContainer) - - // Add container filter to enable CORS - cors := restful.CrossOriginResourceSharing{ - ExposeHeaders: []string{"X-My-Header"}, - AllowedHeaders: []string{"Content-Type", "Accept"}, - AllowedMethods: []string{"GET", "POST"}, - CookiesAllowed: false, - Container: wsContainer} - wsContainer.Filter(cors.Filter) - - // Add container filter to respond to OPTIONS - wsContainer.Filter(wsContainer.OPTIONSFilter) - - log.Print("start listening on localhost:8080") - server := &http.Server{Addr: ":8080", Handler: wsContainer} - log.Fatal(server.ListenAndServe()) -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-NCSA-logging.go b/vendor/github.com/emicklei/go-restful/examples/restful-NCSA-logging.go deleted file mode 100644 index 7066b96d..00000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-NCSA-logging.go +++ /dev/null @@ -1,54 +0,0 @@ -package main - -import ( - "github.com/emicklei/go-restful" - "io" - "log" - "net/http" - "os" - "strings" - "time" -) - -// This example shows how to create a filter that produces log lines -// according to the Common Log Format, also known as the NCSA standard. -// -// kindly contributed by leehambley -// -// GET http://localhost:8080/ping - -var logger *log.Logger = log.New(os.Stdout, "", 0) - -func NCSACommonLogFormatLogger() restful.FilterFunction { - return func(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) { - var username = "-" - if req.Request.URL.User != nil { - if name := req.Request.URL.User.Username(); name != "" { - username = name - } - } - chain.ProcessFilter(req, resp) - logger.Printf("%s - %s [%s] \"%s %s %s\" %d %d", - strings.Split(req.Request.RemoteAddr, ":")[0], - username, - time.Now().Format("02/Jan/2006:15:04:05 -0700"), - req.Request.Method, - req.Request.URL.RequestURI(), - req.Request.Proto, - resp.StatusCode(), - resp.ContentLength(), - ) - } -} - -func main() { - ws := new(restful.WebService) - ws.Filter(NCSACommonLogFormatLogger()) - ws.Route(ws.GET("/ping").To(hello)) - restful.Add(ws) - log.Fatal(http.ListenAndServe(":8080", nil)) -} - -func hello(req *restful.Request, resp *restful.Response) { - io.WriteString(resp, "pong") -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-basic-authentication.go b/vendor/github.com/emicklei/go-restful/examples/restful-basic-authentication.go deleted file mode 100644 index f4fd5ce1..00000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-basic-authentication.go +++ /dev/null @@ -1,35 +0,0 @@ -package main - -import ( - "github.com/emicklei/go-restful" - "io" - "log" - "net/http" -) - -// This example shows how to create a (Route) Filter that performs Basic Authentication on the Http request. -// -// GET http://localhost:8080/secret -// and use admin,admin for the credentials - -func main() { - ws := new(restful.WebService) - ws.Route(ws.GET("/secret").Filter(basicAuthenticate).To(secret)) - restful.Add(ws) - log.Fatal(http.ListenAndServe(":8080", nil)) -} - -func basicAuthenticate(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) { - // usr/pwd = admin/admin - u, p, ok := req.Request.BasicAuth() - if !ok || u != "admin" || p != "admin" { - resp.AddHeader("WWW-Authenticate", "Basic realm=Protected Area") - resp.WriteErrorString(401, "401: Not Authorized") - return - } - chain.ProcessFilter(req, resp) -} - -func secret(req *restful.Request, resp *restful.Response) { - io.WriteString(resp, "42") -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-cpuprofiler-service.go b/vendor/github.com/emicklei/go-restful/examples/restful-cpuprofiler-service.go deleted file mode 100644 index 9148213c..00000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-cpuprofiler-service.go +++ /dev/null @@ -1,65 +0,0 @@ -package main - -import ( - "github.com/emicklei/go-restful" - "io" - "log" - "os" - "runtime/pprof" -) - -// ProfilingService is a WebService that can start/stop a CPU profile and write results to a file -// GET /{rootPath}/start will activate CPU profiling -// GET /{rootPath}/stop will stop profiling -// -// NewProfileService("/profiler", "ace.prof").AddWebServiceTo(restful.DefaultContainer) -// -type ProfilingService struct { - rootPath string // the base (root) of the service, e.g. /profiler - cpuprofile string // the output filename to write profile results, e.g. myservice.prof - cpufile *os.File // if not nil, then profiling is active -} - -func NewProfileService(rootPath string, outputFilename string) *ProfilingService { - ps := new(ProfilingService) - ps.rootPath = rootPath - ps.cpuprofile = outputFilename - return ps -} - -// Add this ProfileService to a restful Container -func (p ProfilingService) AddWebServiceTo(container *restful.Container) { - ws := new(restful.WebService) - ws.Path(p.rootPath).Consumes("*/*").Produces(restful.MIME_JSON) - ws.Route(ws.GET("/start").To(p.startProfiler)) - ws.Route(ws.GET("/stop").To(p.stopProfiler)) - container.Add(ws) -} - -func (p *ProfilingService) startProfiler(req *restful.Request, resp *restful.Response) { - if p.cpufile != nil { - io.WriteString(resp.ResponseWriter, "[restful] CPU profiling already running") - return // error? - } - cpufile, err := os.Create(p.cpuprofile) - if err != nil { - log.Fatal(err) - } - // remember for close - p.cpufile = cpufile - pprof.StartCPUProfile(cpufile) - io.WriteString(resp.ResponseWriter, "[restful] CPU profiling started, writing on:"+p.cpuprofile) -} - -func (p *ProfilingService) stopProfiler(req *restful.Request, resp *restful.Response) { - if p.cpufile == nil { - io.WriteString(resp.ResponseWriter, "[restful] CPU profiling not active") - return // error? - } - pprof.StopCPUProfile() - p.cpufile.Close() - p.cpufile = nil - io.WriteString(resp.ResponseWriter, "[restful] CPU profiling stopped, closing:"+p.cpuprofile) -} - -func main() {} // exists for example compilation only diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-curly-router.go b/vendor/github.com/emicklei/go-restful/examples/restful-curly-router.go deleted file mode 100644 index 1bddb34a..00000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-curly-router.go +++ /dev/null @@ -1,107 +0,0 @@ -package main - -import ( - "log" - "net/http" - - "github.com/emicklei/go-restful" -) - -// This example has the same service definition as restful-user-resource -// but uses a different router (CurlyRouter) that does not use regular expressions -// -// POST http://localhost:8080/users -// 1Melissa Raspberry -// -// GET http://localhost:8080/users/1 -// -// PUT http://localhost:8080/users/1 -// 1Melissa -// -// DELETE http://localhost:8080/users/1 -// - -type User struct { - Id, Name string -} - -type UserResource struct { - // normally one would use DAO (data access object) - users map[string]User -} - -func (u UserResource) Register(container *restful.Container) { - ws := new(restful.WebService) - ws. - Path("/users"). - Consumes(restful.MIME_XML, restful.MIME_JSON). - Produces(restful.MIME_JSON, restful.MIME_XML) // you can specify this per route as well - - ws.Route(ws.GET("/{user-id}").To(u.findUser)) - ws.Route(ws.POST("").To(u.updateUser)) - ws.Route(ws.PUT("/{user-id}").To(u.createUser)) - ws.Route(ws.DELETE("/{user-id}").To(u.removeUser)) - - container.Add(ws) -} - -// GET http://localhost:8080/users/1 -// -func (u UserResource) findUser(request *restful.Request, response *restful.Response) { - id := request.PathParameter("user-id") - usr := u.users[id] - if len(usr.Id) == 0 { - response.AddHeader("Content-Type", "text/plain") - response.WriteErrorString(http.StatusNotFound, "User could not be found.") - } else { - response.WriteEntity(usr) - } -} - -// POST http://localhost:8080/users -// 1Melissa Raspberry -// -func (u *UserResource) updateUser(request *restful.Request, response *restful.Response) { - usr := new(User) - err := request.ReadEntity(&usr) - if err == nil { - u.users[usr.Id] = *usr - response.WriteEntity(usr) - } else { - response.AddHeader("Content-Type", "text/plain") - response.WriteErrorString(http.StatusInternalServerError, err.Error()) - } -} - -// PUT http://localhost:8080/users/1 -// 1Melissa -// -func (u *UserResource) createUser(request *restful.Request, response *restful.Response) { - usr := User{Id: request.PathParameter("user-id")} - err := request.ReadEntity(&usr) - if err == nil { - u.users[usr.Id] = usr - response.WriteHeaderAndEntity(http.StatusCreated, usr) - } else { - response.AddHeader("Content-Type", "text/plain") - response.WriteErrorString(http.StatusInternalServerError, err.Error()) - } -} - -// DELETE http://localhost:8080/users/1 -// -func (u *UserResource) removeUser(request *restful.Request, response *restful.Response) { - id := request.PathParameter("user-id") - delete(u.users, id) -} - -func main() { - wsContainer := restful.NewContainer() - wsContainer.Router(restful.CurlyRouter{}) - u := UserResource{map[string]User{}} - u.Register(wsContainer) - - log.Print("start listening on localhost:8080") - server := &http.Server{Addr: ":8080", Handler: wsContainer} - log.Fatal(server.ListenAndServe()) -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-curly-router_test.go b/vendor/github.com/emicklei/go-restful/examples/restful-curly-router_test.go deleted file mode 100644 index 87aed068..00000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-curly-router_test.go +++ /dev/null @@ -1,149 +0,0 @@ -package main - -import ( - "bytes" - "errors" - "log" - "net/http" - "testing" - "time" - - "github.com/emicklei/go-restful" -) - -type User struct { - Id, Name string -} - -type UserResource struct { - users map[string]User -} - -func (u UserResource) Register(container *restful.Container) { - ws := new(restful.WebService) - ws. - Path("/users"). - Consumes(restful.MIME_XML, restful.MIME_JSON). - Produces(restful.MIME_JSON, restful.MIME_XML) - - ws.Route(ws.GET("/{user-id}").To(u.findUser)) - ws.Route(ws.POST("").To(u.updateUser)) - ws.Route(ws.PUT("/{user-id}").To(u.createUser)) - ws.Route(ws.DELETE("/{user-id}").To(u.removeUser)) - - container.Add(ws) -} - -// GET http://localhost:8090/users/1 -// -func (u UserResource) findUser(request *restful.Request, response *restful.Response) { - id := request.PathParameter("user-id") - usr := u.users[id] - if len(usr.Id) == 0 { - response.AddHeader("Content-Type", "text/plain") - response.WriteErrorString(http.StatusNotFound, "User could not be found.") - } else { - response.WriteEntity(usr) - } -} - -// POST http://localhost:8090/users -// 1Melissa Raspberry -// -func (u *UserResource) updateUser(request *restful.Request, response *restful.Response) { - usr := new(User) - err := request.ReadEntity(&usr) - if err == nil { - u.users[usr.Id] = *usr - response.WriteEntity(usr) - } else { - response.AddHeader("Content-Type", "text/plain") - response.WriteErrorString(http.StatusInternalServerError, err.Error()) - } -} - -// PUT http://localhost:8090/users/1 -// 1Melissa -// -func (u *UserResource) createUser(request *restful.Request, response *restful.Response) { - usr := User{Id: request.PathParameter("user-id")} - err := request.ReadEntity(&usr) - if err == nil { - u.users[usr.Id] = usr - response.WriteHeader(http.StatusCreated) - response.WriteEntity(usr) - } else { - response.AddHeader("Content-Type", "text/plain") - response.WriteErrorString(http.StatusInternalServerError, err.Error()) - } -} - -// DELETE http://localhost:8090/users/1 -// -func (u *UserResource) removeUser(request *restful.Request, response *restful.Response) { - id := request.PathParameter("user-id") - delete(u.users, id) -} - -func RunRestfulCurlyRouterServer() { - wsContainer := restful.NewContainer() - wsContainer.Router(restful.CurlyRouter{}) - u := UserResource{map[string]User{}} - u.Register(wsContainer) - - log.Print("start listening on localhost:8090") - server := &http.Server{Addr: ":8090", Handler: wsContainer} - log.Fatal(server.ListenAndServe()) -} - -func waitForServerUp(serverURL string) error { - for start := time.Now(); time.Since(start) < time.Minute; time.Sleep(5 * time.Second) { - _, err := http.Get(serverURL + "/") - if err == nil { - return nil - } - } - return errors.New("waiting for server timed out") -} - -func TestServer(t *testing.T) { - serverURL := "http://localhost:8090" - go func() { - RunRestfulCurlyRouterServer() - }() - if err := waitForServerUp(serverURL); err != nil { - t.Errorf("%v", err) - } - - // GET should give a 405 - resp, err := http.Get(serverURL + "/users/") - if err != nil { - t.Errorf("unexpected error in GET /users/: %v", err) - } - if resp.StatusCode != http.StatusMethodNotAllowed { - t.Errorf("unexpected response: %v, expected: %v", resp.StatusCode, http.StatusOK) - } - - // Send a POST request. - var jsonStr = []byte(`{"id":"1","name":"user1"}`) - req, err := http.NewRequest("POST", serverURL+"/users/", bytes.NewBuffer(jsonStr)) - req.Header.Set("Content-Type", restful.MIME_JSON) - - client := &http.Client{} - resp, err = client.Do(req) - if err != nil { - t.Errorf("unexpected error in sending req: %v", err) - } - if resp.StatusCode != http.StatusOK { - t.Errorf("unexpected response: %v, expected: %v", resp.StatusCode, http.StatusOK) - } - - // Test that GET works. - resp, err = http.Get(serverURL + "/users/1") - if err != nil { - t.Errorf("unexpected error in GET /users/1: %v", err) - } - if resp.StatusCode != http.StatusOK { - t.Errorf("unexpected response: %v, expected: %v", resp.StatusCode, http.StatusOK) - } -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-encoding-filter.go b/vendor/github.com/emicklei/go-restful/examples/restful-encoding-filter.go deleted file mode 100644 index 177d5a99..00000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-encoding-filter.go +++ /dev/null @@ -1,61 +0,0 @@ -package main - -import ( - "github.com/emicklei/go-restful" - "log" - "net/http" -) - -type User struct { - Id, Name string -} - -type UserList struct { - Users []User -} - -// -// This example shows how to use the CompressingResponseWriter by a Filter -// such that encoding can be enabled per WebService or per Route (instead of per container) -// Using restful.DefaultContainer.EnableContentEncoding(true) will encode all responses served by WebServices in the DefaultContainer. -// -// Set Accept-Encoding to gzip or deflate -// GET http://localhost:8080/users/42 -// and look at the response headers - -func main() { - restful.Add(NewUserService()) - log.Print("start listening on localhost:8080") - log.Fatal(http.ListenAndServe(":8080", nil)) -} - -func NewUserService() *restful.WebService { - ws := new(restful.WebService) - ws. - Path("/users"). - Consumes(restful.MIME_XML, restful.MIME_JSON). - Produces(restful.MIME_JSON, restful.MIME_XML) - - // install a response encoding filter - ws.Route(ws.GET("/{user-id}").Filter(encodingFilter).To(findUser)) - return ws -} - -// Route Filter (defines FilterFunction) -func encodingFilter(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) { - log.Printf("[encoding-filter] %s,%s\n", req.Request.Method, req.Request.URL) - // wrap responseWriter into a compressing one - compress, _ := restful.NewCompressingResponseWriter(resp.ResponseWriter, restful.ENCODING_GZIP) - resp.ResponseWriter = compress - defer func() { - compress.Close() - }() - chain.ProcessFilter(req, resp) -} - -// GET http://localhost:8080/users/42 -// -func findUser(request *restful.Request, response *restful.Response) { - log.Print("findUser") - response.WriteEntity(User{"42", "Gandalf"}) -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-filters.go b/vendor/github.com/emicklei/go-restful/examples/restful-filters.go deleted file mode 100644 index aaadb9d2..00000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-filters.go +++ /dev/null @@ -1,114 +0,0 @@ -package main - -import ( - "github.com/emicklei/go-restful" - "log" - "net/http" - "time" -) - -type User struct { - Id, Name string -} - -type UserList struct { - Users []User -} - -// This example show how to create and use the three different Filters (Container,WebService and Route) -// When applied to the restful.DefaultContainer, we refer to them as a global filter. -// -// GET http://localhost:8080/users/42 -// and see the logging per filter (try repeating this request) - -func main() { - // install a global (=DefaultContainer) filter (processed before any webservice in the DefaultContainer) - restful.Filter(globalLogging) - - restful.Add(NewUserService()) - log.Print("start listening on localhost:8080") - log.Fatal(http.ListenAndServe(":8080", nil)) -} - -func NewUserService() *restful.WebService { - ws := new(restful.WebService) - ws. - Path("/users"). - Consumes(restful.MIME_XML, restful.MIME_JSON). - Produces(restful.MIME_JSON, restful.MIME_XML) - - // install a webservice filter (processed before any route) - ws.Filter(webserviceLogging).Filter(measureTime) - - // install a counter filter - ws.Route(ws.GET("").Filter(NewCountFilter().routeCounter).To(getAllUsers)) - - // install 2 chained route filters (processed before calling findUser) - ws.Route(ws.GET("/{user-id}").Filter(routeLogging).Filter(NewCountFilter().routeCounter).To(findUser)) - return ws -} - -// Global Filter -func globalLogging(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) { - log.Printf("[global-filter (logger)] %s,%s\n", req.Request.Method, req.Request.URL) - chain.ProcessFilter(req, resp) -} - -// WebService Filter -func webserviceLogging(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) { - log.Printf("[webservice-filter (logger)] %s,%s\n", req.Request.Method, req.Request.URL) - chain.ProcessFilter(req, resp) -} - -// WebService (post-process) Filter (as a struct that defines a FilterFunction) -func measureTime(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) { - now := time.Now() - chain.ProcessFilter(req, resp) - log.Printf("[webservice-filter (timer)] %v\n", time.Now().Sub(now)) -} - -// Route Filter (defines FilterFunction) -func routeLogging(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) { - log.Printf("[route-filter (logger)] %s,%s\n", req.Request.Method, req.Request.URL) - chain.ProcessFilter(req, resp) -} - -// Route Filter (as a struct that defines a FilterFunction) -// CountFilter implements a FilterFunction for counting requests. -type CountFilter struct { - count int - counter chan int // for go-routine safe count increments -} - -// NewCountFilter creates and initializes a new CountFilter. -func NewCountFilter() *CountFilter { - c := new(CountFilter) - c.counter = make(chan int) - go func() { - for { - c.count += <-c.counter - } - }() - return c -} - -// routeCounter increments the count of the filter (through a channel) -func (c *CountFilter) routeCounter(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) { - c.counter <- 1 - log.Printf("[route-filter (counter)] count:%d", c.count) - chain.ProcessFilter(req, resp) -} - -// GET http://localhost:8080/users -// -func getAllUsers(request *restful.Request, response *restful.Response) { - log.Print("getAllUsers") - response.WriteEntity(UserList{[]User{{"42", "Gandalf"}, {"3.14", "Pi"}}}) -} - -// GET http://localhost:8080/users/42 -// -func findUser(request *restful.Request, response *restful.Response) { - log.Print("findUser") - response.WriteEntity(User{"42", "Gandalf"}) -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-form-handling.go b/vendor/github.com/emicklei/go-restful/examples/restful-form-handling.go deleted file mode 100644 index e85608c9..00000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-form-handling.go +++ /dev/null @@ -1,63 +0,0 @@ -package main - -import ( - "fmt" - "github.com/emicklei/go-restful" - "github.com/gorilla/schema" - "io" - "log" - "net/http" -) - -// This example shows how to handle a POST of a HTML form that uses the standard x-www-form-urlencoded content-type. -// It uses the gorilla web tool kit schema package to decode the form data into a struct. -// -// GET http://localhost:8080/profiles -// - -type Profile struct { - Name string - Age int -} - -var decoder *schema.Decoder - -func main() { - decoder = schema.NewDecoder() - ws := new(restful.WebService) - ws.Route(ws.POST("/profiles").Consumes("application/x-www-form-urlencoded").To(postAdddress)) - ws.Route(ws.GET("/profiles").To(addresssForm)) - restful.Add(ws) - log.Fatal(http.ListenAndServe(":8080", nil)) -} - -func postAdddress(req *restful.Request, resp *restful.Response) { - err := req.Request.ParseForm() - if err != nil { - resp.WriteErrorString(http.StatusBadRequest, err.Error()) - return - } - p := new(Profile) - err = decoder.Decode(p, req.Request.PostForm) - if err != nil { - resp.WriteErrorString(http.StatusBadRequest, err.Error()) - return - } - io.WriteString(resp.ResponseWriter, fmt.Sprintf("Name=%s, Age=%d", p.Name, p.Age)) -} - -func addresssForm(req *restful.Request, resp *restful.Response) { - io.WriteString(resp.ResponseWriter, - ` - -

Enter Profile

-
- - - - - -
- - `) -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-hello-world.go b/vendor/github.com/emicklei/go-restful/examples/restful-hello-world.go deleted file mode 100644 index bf987b80..00000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-hello-world.go +++ /dev/null @@ -1,23 +0,0 @@ -package main - -import ( - "github.com/emicklei/go-restful" - "io" - "log" - "net/http" -) - -// This example shows the minimal code needed to get a restful.WebService working. -// -// GET http://localhost:8080/hello - -func main() { - ws := new(restful.WebService) - ws.Route(ws.GET("/hello").To(hello)) - restful.Add(ws) - log.Fatal(http.ListenAndServe(":8080", nil)) -} - -func hello(req *restful.Request, resp *restful.Response) { - io.WriteString(resp, "world") -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-html-template.go b/vendor/github.com/emicklei/go-restful/examples/restful-html-template.go deleted file mode 100644 index d76d9d1e..00000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-html-template.go +++ /dev/null @@ -1,35 +0,0 @@ -package main - -import ( - "log" - "net/http" - "text/template" - - "github.com/emicklei/go-restful" -) - -// This example shows how to serve a HTML page using the standard Go template engine. -// -// GET http://localhost:8080/ - -func main() { - ws := new(restful.WebService) - ws.Route(ws.GET("/").To(home)) - restful.Add(ws) - print("open browser on http://localhost:8080/\n") - log.Fatal(http.ListenAndServe(":8080", nil)) -} - -type Message struct { - Text string -} - -func home(req *restful.Request, resp *restful.Response) { - p := &Message{"restful-html-template demo"} - // you might want to cache compiled templates - t, err := template.ParseFiles("home.html") - if err != nil { - log.Fatalf("Template gave: %s", err) - } - t.Execute(resp.ResponseWriter, p) -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-multi-containers.go b/vendor/github.com/emicklei/go-restful/examples/restful-multi-containers.go deleted file mode 100644 index 3056d3ea..00000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-multi-containers.go +++ /dev/null @@ -1,43 +0,0 @@ -package main - -import ( - "github.com/emicklei/go-restful" - "io" - "log" - "net/http" -) - -// This example shows how to have a program with 2 WebServices containers -// each having a http server listening on its own port. -// -// The first "hello" is added to the restful.DefaultContainer (and uses DefaultServeMux) -// For the second "hello", a new container and ServeMux is created -// and requires a new http.Server with the container being the Handler. -// This first server is spawn in its own go-routine such that the program proceeds to create the second. -// -// GET http://localhost:8080/hello -// GET http://localhost:8081/hello - -func main() { - ws := new(restful.WebService) - ws.Route(ws.GET("/hello").To(hello)) - restful.Add(ws) - go func() { - log.Fatal(http.ListenAndServe(":8080", nil)) - }() - - container2 := restful.NewContainer() - ws2 := new(restful.WebService) - ws2.Route(ws2.GET("/hello").To(hello2)) - container2.Add(ws2) - server := &http.Server{Addr: ":8081", Handler: container2} - log.Fatal(server.ListenAndServe()) -} - -func hello(req *restful.Request, resp *restful.Response) { - io.WriteString(resp, "default world") -} - -func hello2(req *restful.Request, resp *restful.Response) { - io.WriteString(resp, "second world") -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-no-cache-filter.go b/vendor/github.com/emicklei/go-restful/examples/restful-no-cache-filter.go deleted file mode 100644 index 8e4540f4..00000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-no-cache-filter.go +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "io" - "log" - "net/http" - - "github.com/emicklei/go-restful" -) - -// This example shows how to use a WebService filter that passed the Http headers to disable browser cacheing. -// -// GET http://localhost:8080/hello - -func main() { - ws := new(restful.WebService) - ws.Filter(restful.NoBrowserCacheFilter) - ws.Route(ws.GET("/hello").To(hello)) - restful.Add(ws) - log.Fatal(http.ListenAndServe(":8080", nil)) -} - -func hello(req *restful.Request, resp *restful.Response) { - io.WriteString(resp, "world") -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-openapi.go b/vendor/github.com/emicklei/go-restful/examples/restful-openapi.go deleted file mode 100644 index b89e5e9b..00000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-openapi.go +++ /dev/null @@ -1,178 +0,0 @@ -package main - -// Note: this file is copied from https://github.com/emicklei/go-restful-openapi/blob/master/examples/user-resource.go - -import ( - "log" - "net/http" - - "github.com/emicklei/go-restful" - restfulspec "github.com/emicklei/go-restful-openapi" - "github.com/go-openapi/spec" -) - -type UserResource struct { - // normally one would use DAO (data access object) - users map[string]User -} - -func (u UserResource) WebService() *restful.WebService { - ws := new(restful.WebService) - ws. - Path("/users"). - Consumes(restful.MIME_XML, restful.MIME_JSON). - Produces(restful.MIME_JSON, restful.MIME_XML) // you can specify this per route as well - - tags := []string{"users"} - - ws.Route(ws.GET("/").To(u.findAllUsers). - // docs - Doc("get all users"). - Metadata(restfulspec.KeyOpenAPITags, tags). - Writes([]User{}). - Returns(200, "OK", []User{})) - - ws.Route(ws.GET("/{user-id}").To(u.findUser). - // docs - Doc("get a user"). - Param(ws.PathParameter("user-id", "identifier of the user").DataType("integer").DefaultValue("1")). - Metadata(restfulspec.KeyOpenAPITags, tags). - Writes(User{}). // on the response - Returns(200, "OK", User{}). - Returns(404, "Not Found", nil)) - - ws.Route(ws.PUT("/{user-id}").To(u.updateUser). - // docs - Doc("update a user"). - Param(ws.PathParameter("user-id", "identifier of the user").DataType("string")). - Metadata(restfulspec.KeyOpenAPITags, tags). - Reads(User{})) // from the request - - ws.Route(ws.PUT("").To(u.createUser). - // docs - Doc("create a user"). - Metadata(restfulspec.KeyOpenAPITags, tags). - Reads(User{})) // from the request - - ws.Route(ws.DELETE("/{user-id}").To(u.removeUser). - // docs - Doc("delete a user"). - Metadata(restfulspec.KeyOpenAPITags, tags). - Param(ws.PathParameter("user-id", "identifier of the user").DataType("string"))) - - return ws -} - -// GET http://localhost:8080/users -// -func (u UserResource) findAllUsers(request *restful.Request, response *restful.Response) { - list := []User{} - for _, each := range u.users { - list = append(list, each) - } - response.WriteEntity(list) -} - -// GET http://localhost:8080/users/1 -// -func (u UserResource) findUser(request *restful.Request, response *restful.Response) { - id := request.PathParameter("user-id") - usr := u.users[id] - if len(usr.ID) == 0 { - response.WriteErrorString(http.StatusNotFound, "User could not be found.") - } else { - response.WriteEntity(usr) - } -} - -// PUT http://localhost:8080/users/1 -// 1Melissa Raspberry -// -func (u *UserResource) updateUser(request *restful.Request, response *restful.Response) { - usr := new(User) - err := request.ReadEntity(&usr) - if err == nil { - u.users[usr.ID] = *usr - response.WriteEntity(usr) - } else { - response.WriteError(http.StatusInternalServerError, err) - } -} - -// PUT http://localhost:8080/users/1 -// 1Melissa -// -func (u *UserResource) createUser(request *restful.Request, response *restful.Response) { - usr := User{ID: request.PathParameter("user-id")} - err := request.ReadEntity(&usr) - if err == nil { - u.users[usr.ID] = usr - response.WriteHeaderAndEntity(http.StatusCreated, usr) - } else { - response.WriteError(http.StatusInternalServerError, err) - } -} - -// DELETE http://localhost:8080/users/1 -// -func (u *UserResource) removeUser(request *restful.Request, response *restful.Response) { - id := request.PathParameter("user-id") - delete(u.users, id) -} - -func main() { - u := UserResource{map[string]User{}} - restful.DefaultContainer.Add(u.WebService()) - - config := restfulspec.Config{ - WebServices: restful.RegisteredWebServices(), // you control what services are visible - APIPath: "/apidocs.json", - PostBuildSwaggerObjectHandler: enrichSwaggerObject} - restful.DefaultContainer.Add(restfulspec.NewOpenAPIService(config)) - - // Optionally, you can install the Swagger Service which provides a nice Web UI on your REST API - // You need to download the Swagger HTML5 assets and change the FilePath location in the config below. - // Open http://localhost:8080/apidocs/?url=http://localhost:8080/apidocs.json - http.Handle("/apidocs/", http.StripPrefix("/apidocs/", http.FileServer(http.Dir("/Users/emicklei/Projects/swagger-ui/dist")))) - - // Optionally, you may need to enable CORS for the UI to work. - cors := restful.CrossOriginResourceSharing{ - AllowedHeaders: []string{"Content-Type", "Accept"}, - AllowedMethods: []string{"GET", "POST", "PUT", "DELETE"}, - CookiesAllowed: false, - Container: restful.DefaultContainer} - restful.DefaultContainer.Filter(cors.Filter) - - log.Printf("Get the API using http://localhost:8080/apidocs.json") - log.Printf("Open Swagger UI using http://localhost:8080/apidocs/?url=http://localhost:8080/apidocs.json") - log.Fatal(http.ListenAndServe(":8080", nil)) -} - -func enrichSwaggerObject(swo *spec.Swagger) { - swo.Info = &spec.Info{ - InfoProps: spec.InfoProps{ - Title: "UserService", - Description: "Resource for managing Users", - Contact: &spec.ContactInfo{ - Name: "john", - Email: "john@doe.rp", - URL: "http://johndoe.org", - }, - License: &spec.License{ - Name: "MIT", - URL: "http://mit.org", - }, - Version: "1.0.0", - }, - } - swo.Tags = []spec.Tag{spec.Tag{TagProps: spec.TagProps{ - Name: "users", - Description: "Managing users"}}} -} - -// User is just a sample type -type User struct { - ID string `json:"id" description:"identifier of the user"` - Name string `json:"name" description:"name of the user" default:"john"` - Age int `json:"age" description:"age of the user" default:"21"` -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-options-filter.go b/vendor/github.com/emicklei/go-restful/examples/restful-options-filter.go deleted file mode 100644 index 79ccce55..00000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-options-filter.go +++ /dev/null @@ -1,51 +0,0 @@ -package main - -import ( - "github.com/emicklei/go-restful" - "io" - "log" - "net/http" -) - -// This example shows how to use the OPTIONSFilter on a Container -// -// OPTIONS http://localhost:8080/users -// -// OPTIONS http://localhost:8080/users/1 - -type UserResource struct{} - -func (u UserResource) RegisterTo(container *restful.Container) { - ws := new(restful.WebService) - ws. - Path("/users"). - Consumes("*/*"). - Produces("*/*") - - ws.Route(ws.GET("/{user-id}").To(u.nop)) - ws.Route(ws.POST("").To(u.nop)) - ws.Route(ws.PUT("/{user-id}").To(u.nop)) - ws.Route(ws.DELETE("/{user-id}").To(u.nop)) - - container.Add(ws) -} - -func (u UserResource) nop(request *restful.Request, response *restful.Response) { - io.WriteString(response.ResponseWriter, "this would be a normal response") -} - -func main() { - wsContainer := restful.NewContainer() - u := UserResource{} - u.RegisterTo(wsContainer) - - // Add container filter to respond to OPTIONS - wsContainer.Filter(wsContainer.OPTIONSFilter) - - // For use on the default container, you can write - // restful.Filter(restful.OPTIONSFilter()) - - log.Print("start listening on localhost:8080") - server := &http.Server{Addr: ":8080", Handler: wsContainer} - log.Fatal(server.ListenAndServe()) -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-path-tail.go b/vendor/github.com/emicklei/go-restful/examples/restful-path-tail.go deleted file mode 100644 index f30d6716..00000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-path-tail.go +++ /dev/null @@ -1,27 +0,0 @@ -package main - -import ( - . "github.com/emicklei/go-restful" - "io" - "log" - "net/http" -) - -// This example shows how to create a Route matching the "tail" of a path. -// Requires the use of a CurlyRouter and the star "*" path parameter pattern. -// -// GET http://localhost:8080/basepath/some/other/location/test.xml - -func main() { - DefaultContainer.Router(CurlyRouter{}) - ws := new(WebService) - ws.Route(ws.GET("/basepath/{resource:*}").To(staticFromPathParam)) - Add(ws) - - println("[go-restful] serve path tails from http://localhost:8080/basepath") - log.Fatal(http.ListenAndServe(":8080", nil)) -} - -func staticFromPathParam(req *Request, resp *Response) { - io.WriteString(resp, "Tail="+req.PathParameter("resource")) -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-pre-post-filters.go b/vendor/github.com/emicklei/go-restful/examples/restful-pre-post-filters.go deleted file mode 100644 index 0b55f149..00000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-pre-post-filters.go +++ /dev/null @@ -1,98 +0,0 @@ -package main - -import ( - "github.com/emicklei/go-restful" - "io" - "log" - "net/http" -) - -// This example shows how the different types of filters are called in the request-response flow. -// The call chain is logged on the console when sending an http request. -// -// GET http://localhost:8080/1 -// GET http://localhost:8080/2 - -var indentLevel int - -func container_filter_A(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) { - log.Printf("url path:%v\n", req.Request.URL) - trace("container_filter_A: before", 1) - chain.ProcessFilter(req, resp) - trace("container_filter_A: after", -1) -} - -func container_filter_B(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) { - trace("container_filter_B: before", 1) - chain.ProcessFilter(req, resp) - trace("container_filter_B: after", -1) -} - -func service_filter_A(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) { - trace("service_filter_A: before", 1) - chain.ProcessFilter(req, resp) - trace("service_filter_A: after", -1) -} - -func service_filter_B(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) { - trace("service_filter_B: before", 1) - chain.ProcessFilter(req, resp) - trace("service_filter_B: after", -1) -} - -func route_filter_A(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) { - trace("route_filter_A: before", 1) - chain.ProcessFilter(req, resp) - trace("route_filter_A: after", -1) -} - -func route_filter_B(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) { - trace("route_filter_B: before", 1) - chain.ProcessFilter(req, resp) - trace("route_filter_B: after", -1) -} - -func trace(what string, delta int) { - indented := what - if delta < 0 { - indentLevel += delta - } - for t := 0; t < indentLevel; t++ { - indented = "." + indented - } - log.Printf("%s", indented) - if delta > 0 { - indentLevel += delta - } -} - -func main() { - restful.Filter(container_filter_A) - restful.Filter(container_filter_B) - - ws1 := new(restful.WebService) - ws1.Path("/1") - ws1.Filter(service_filter_A) - ws1.Filter(service_filter_B) - ws1.Route(ws1.GET("").To(doit1).Filter(route_filter_A).Filter(route_filter_B)) - - ws2 := new(restful.WebService) - ws2.Path("/2") - ws2.Filter(service_filter_A) - ws2.Filter(service_filter_B) - ws2.Route(ws2.GET("").To(doit2).Filter(route_filter_A).Filter(route_filter_B)) - - restful.Add(ws1) - restful.Add(ws2) - - log.Print("go-restful example listing on http://localhost:8080/1 and http://localhost:8080/2") - log.Fatal(http.ListenAndServe(":8080", nil)) -} - -func doit1(req *restful.Request, resp *restful.Response) { - io.WriteString(resp, "nothing to see in 1") -} - -func doit2(req *restful.Request, resp *restful.Response) { - io.WriteString(resp, "nothing to see in 2") -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-resource-functions.go b/vendor/github.com/emicklei/go-restful/examples/restful-resource-functions.go deleted file mode 100644 index 09e6e566..00000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-resource-functions.go +++ /dev/null @@ -1,63 +0,0 @@ -package main - -import ( - "github.com/emicklei/go-restful" - "log" - "net/http" -) - -// This example shows how to use methods as RouteFunctions for WebServices. -// The ProductResource has a Register() method that creates and initializes -// a WebService to expose its methods as REST operations. -// The WebService is added to the restful.DefaultContainer. -// A ProductResource is typically created using some data access object. -// -// GET http://localhost:8080/products/1 -// POST http://localhost:8080/products -// 1The First - -type Product struct { - Id, Title string -} - -type ProductResource struct { - // typically reference a DAO (data-access-object) -} - -func (p ProductResource) getOne(req *restful.Request, resp *restful.Response) { - id := req.PathParameter("id") - log.Println("getting product with id:" + id) - resp.WriteEntity(Product{Id: id, Title: "test"}) -} - -func (p ProductResource) postOne(req *restful.Request, resp *restful.Response) { - updatedProduct := new(Product) - err := req.ReadEntity(updatedProduct) - if err != nil { // bad request - resp.WriteErrorString(http.StatusBadRequest, err.Error()) - return - } - log.Println("updating product with id:" + updatedProduct.Id) -} - -func (p ProductResource) Register() { - ws := new(restful.WebService) - ws.Path("/products") - ws.Consumes(restful.MIME_XML) - ws.Produces(restful.MIME_XML) - - ws.Route(ws.GET("/{id}").To(p.getOne). - Doc("get the product by its id"). - Param(ws.PathParameter("id", "identifier of the product").DataType("string"))) - - ws.Route(ws.POST("").To(p.postOne). - Doc("update or create a product"). - Param(ws.BodyParameter("Product", "a Product (XML)").DataType("main.Product"))) - - restful.Add(ws) -} - -func main() { - ProductResource{}.Register() - log.Fatal(http.ListenAndServe(":8080", nil)) -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-route_test.go b/vendor/github.com/emicklei/go-restful/examples/restful-route_test.go deleted file mode 100644 index 20c366bf..00000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-route_test.go +++ /dev/null @@ -1,39 +0,0 @@ -package main - -import ( - "net/http" - "net/http/httptest" - "strings" - "testing" - - "github.com/emicklei/go-restful" -) - -var ( - Result string -) - -func TestRouteExtractParameter(t *testing.T) { - // setup service - ws := new(restful.WebService) - ws.Consumes(restful.MIME_XML) - ws.Route(ws.GET("/test/{param}").To(DummyHandler)) - restful.Add(ws) - - // setup request + writer - bodyReader := strings.NewReader("42") - httpRequest, _ := http.NewRequest("GET", "/test/THIS", bodyReader) - httpRequest.Header.Set("Content-Type", restful.MIME_XML) - httpWriter := httptest.NewRecorder() - - // run - restful.DefaultContainer.ServeHTTP(httpWriter, httpRequest) - - if Result != "THIS" { - t.Fatalf("Result is actually: %s", Result) - } -} - -func DummyHandler(rq *restful.Request, rp *restful.Response) { - Result = rq.PathParameter("param") -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-routefunction_test.go b/vendor/github.com/emicklei/go-restful/examples/restful-routefunction_test.go deleted file mode 100644 index 957c0555..00000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-routefunction_test.go +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "net/http" - "net/http/httptest" - "testing" - - "github.com/emicklei/go-restful" -) - -// This example show how to test one particular RouteFunction (getIt) -// It uses the httptest.ResponseRecorder to capture output - -func getIt(req *restful.Request, resp *restful.Response) { - resp.WriteHeader(204) -} - -func TestCallFunction(t *testing.T) { - httpReq, _ := http.NewRequest("GET", "/", nil) - req := restful.NewRequest(httpReq) - - recorder := new(httptest.ResponseRecorder) - resp := restful.NewResponse(recorder) - - getIt(req, resp) - if recorder.Code != 204 { - t.Fatalf("Missing or wrong status code:%d", recorder.Code) - } -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-serve-static.go b/vendor/github.com/emicklei/go-restful/examples/restful-serve-static.go deleted file mode 100644 index 34faf607..00000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-serve-static.go +++ /dev/null @@ -1,47 +0,0 @@ -package main - -import ( - "fmt" - "net/http" - "path" - - "github.com/emicklei/go-restful" -) - -// This example shows how to define methods that serve static files -// It uses the standard http.ServeFile method -// -// GET http://localhost:8080/static/test.xml -// GET http://localhost:8080/static/ -// -// GET http://localhost:8080/static?resource=subdir/test.xml - -var rootdir = "/tmp" - -func main() { - restful.DefaultContainer.Router(restful.CurlyRouter{}) - - ws := new(restful.WebService) - ws.Route(ws.GET("/static/{subpath:*}").To(staticFromPathParam)) - ws.Route(ws.GET("/static").To(staticFromQueryParam)) - restful.Add(ws) - - println("[go-restful] serving files on http://localhost:8080/static from local /tmp") - log.Fatal(http.ListenAndServe(":8080", nil)) -} - -func staticFromPathParam(req *restful.Request, resp *restful.Response) { - actual := path.Join(rootdir, req.PathParameter("subpath")) - fmt.Printf("serving %s ... (from %s)\n", actual, req.PathParameter("subpath")) - http.ServeFile( - resp.ResponseWriter, - req.Request, - actual) -} - -func staticFromQueryParam(req *restful.Request, resp *restful.Response) { - http.ServeFile( - resp.ResponseWriter, - req.Request, - path.Join(rootdir, req.QueryParameter("resource"))) -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-swagger.go b/vendor/github.com/emicklei/go-restful/examples/restful-swagger.go deleted file mode 100644 index ecbd71b2..00000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-swagger.go +++ /dev/null @@ -1,61 +0,0 @@ -package main - -import ( - "log" - "net/http" - - "github.com/emicklei/go-restful" - "github.com/emicklei/go-restful-swagger12" -) - -type Book struct { - Title string - Author string -} - -func main() { - ws := new(restful.WebService) - ws.Path("/books") - ws.Consumes(restful.MIME_JSON, restful.MIME_XML) - ws.Produces(restful.MIME_JSON, restful.MIME_XML) - restful.Add(ws) - - ws.Route(ws.GET("/{medium}").To(noop). - Doc("Search all books"). - Param(ws.PathParameter("medium", "digital or paperback").DataType("string")). - Param(ws.QueryParameter("language", "en,nl,de").DataType("string")). - Param(ws.HeaderParameter("If-Modified-Since", "last known timestamp").DataType("datetime")). - Do(returns200, returns500)) - - ws.Route(ws.PUT("/{medium}").To(noop). - Doc("Add a new book"). - Param(ws.PathParameter("medium", "digital or paperback").DataType("string")). - Reads(Book{})) - - // You can install the Swagger Service which provides a nice Web UI on your REST API - // You need to download the Swagger HTML5 assets and change the FilePath location in the config below. - // Open http://localhost:8080/apidocs and enter http://localhost:8080/apidocs.json in the api input field. - config := swagger.Config{ - WebServices: restful.DefaultContainer.RegisteredWebServices(), // you control what services are visible - WebServicesUrl: "http://localhost:8080", - ApiPath: "/apidocs.json", - - // Optionally, specify where the UI is located - SwaggerPath: "/apidocs/", - SwaggerFilePath: "/Users/emicklei/xProjects/swagger-ui/dist"} - swagger.RegisterSwaggerService(config, restful.DefaultContainer) - - log.Print("start listening on localhost:8080") - server := &http.Server{Addr: ":8080", Handler: restful.DefaultContainer} - log.Fatal(server.ListenAndServe()) -} - -func noop(req *restful.Request, resp *restful.Response) {} - -func returns200(b *restful.RouteBuilder) { - b.Returns(http.StatusOK, "OK", Book{}) -} - -func returns500(b *restful.RouteBuilder) { - b.Returns(http.StatusInternalServerError, "Bummer, something went wrong", nil) -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-user-resource.go b/vendor/github.com/emicklei/go-restful/examples/restful-user-resource.go deleted file mode 100644 index f8d8c4c6..00000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-user-resource.go +++ /dev/null @@ -1,169 +0,0 @@ -package main - -import ( - "log" - "net/http" - - "github.com/emicklei/go-restful" - restfulspec "github.com/emicklei/go-restful-openapi" - "github.com/go-openapi/spec" -) - -// UserResource is the REST layer to the User domain -type UserResource struct { - // normally one would use DAO (data access object) - users map[string]User -} - -// WebService creates a new service that can handle REST requests for User resources. -func (u UserResource) WebService() *restful.WebService { - ws := new(restful.WebService) - ws. - Path("/users"). - Consumes(restful.MIME_XML, restful.MIME_JSON). - Produces(restful.MIME_JSON, restful.MIME_XML) // you can specify this per route as well - - tags := []string{"users"} - - ws.Route(ws.GET("/").To(u.findAllUsers). - // docs - Doc("get all users"). - Metadata(restfulspec.KeyOpenAPITags, tags). - Writes([]User{}). - Returns(200, "OK", []User{})) - - ws.Route(ws.GET("/{user-id}").To(u.findUser). - // docs - Doc("get a user"). - Param(ws.PathParameter("user-id", "identifier of the user").DataType("integer").DefaultValue("1")). - Metadata(restfulspec.KeyOpenAPITags, tags). - Writes(User{}). // on the response - Returns(200, "OK", User{}). - Returns(404, "Not Found", nil)) - - ws.Route(ws.PUT("/{user-id}").To(u.updateUser). - // docs - Doc("update a user"). - Param(ws.PathParameter("user-id", "identifier of the user").DataType("string")). - Metadata(restfulspec.KeyOpenAPITags, tags). - Reads(User{})) // from the request - - ws.Route(ws.PUT("").To(u.createUser). - // docs - Doc("create a user"). - Metadata(restfulspec.KeyOpenAPITags, tags). - Reads(User{})) // from the request - - ws.Route(ws.DELETE("/{user-id}").To(u.removeUser). - // docs - Doc("delete a user"). - Metadata(restfulspec.KeyOpenAPITags, tags). - Param(ws.PathParameter("user-id", "identifier of the user").DataType("string"))) - - return ws -} - -// GET http://localhost:8080/users -// -func (u UserResource) findAllUsers(request *restful.Request, response *restful.Response) { - list := []User{} - for _, each := range u.users { - list = append(list, each) - } - response.WriteEntity(list) -} - -// GET http://localhost:8080/users/1 -// -func (u UserResource) findUser(request *restful.Request, response *restful.Response) { - id := request.PathParameter("user-id") - usr := u.users[id] - if len(usr.ID) == 0 { - response.WriteErrorString(http.StatusNotFound, "User could not be found.") - } else { - response.WriteEntity(usr) - } -} - -// PUT http://localhost:8080/users/1 -// 1Melissa Raspberry -// -func (u *UserResource) updateUser(request *restful.Request, response *restful.Response) { - usr := new(User) - err := request.ReadEntity(&usr) - if err == nil { - u.users[usr.ID] = *usr - response.WriteEntity(usr) - } else { - response.WriteError(http.StatusInternalServerError, err) - } -} - -// PUT http://localhost:8080/users/1 -// 1Melissa -// -func (u *UserResource) createUser(request *restful.Request, response *restful.Response) { - usr := User{ID: request.PathParameter("user-id")} - err := request.ReadEntity(&usr) - if err == nil { - u.users[usr.ID] = usr - response.WriteHeaderAndEntity(http.StatusCreated, usr) - } else { - response.WriteError(http.StatusInternalServerError, err) - } -} - -// DELETE http://localhost:8080/users/1 -// -func (u *UserResource) removeUser(request *restful.Request, response *restful.Response) { - id := request.PathParameter("user-id") - delete(u.users, id) -} - -func main() { - u := UserResource{map[string]User{}} - restful.DefaultContainer.Add(u.WebService()) - - config := restfulspec.Config{ - WebServices: restful.RegisteredWebServices(), // you control what services are visible - APIPath: "/apidocs.json", - PostBuildSwaggerObjectHandler: enrichSwaggerObject} - restful.DefaultContainer.Add(restfulspec.NewOpenAPIService(config)) - - // Optionally, you can install the Swagger Service which provides a nice Web UI on your REST API - // You need to download the Swagger HTML5 assets and change the FilePath location in the config below. - // Open http://localhost:8080/apidocs/?url=http://localhost:8080/apidocs.json - http.Handle("/apidocs/", http.StripPrefix("/apidocs/", http.FileServer(http.Dir("/Users/emicklei/Projects/swagger-ui/dist")))) - - log.Printf("start listening on localhost:8080") - log.Fatal(http.ListenAndServe(":8080", nil)) -} - -func enrichSwaggerObject(swo *spec.Swagger) { - swo.Info = &spec.Info{ - InfoProps: spec.InfoProps{ - Title: "UserService", - Description: "Resource for managing Users", - Contact: &spec.ContactInfo{ - Name: "john", - Email: "john@doe.rp", - URL: "http://johndoe.org", - }, - License: &spec.License{ - Name: "MIT", - URL: "http://mit.org", - }, - Version: "1.0.0", - }, - } - swo.Tags = []spec.Tag{spec.Tag{TagProps: spec.TagProps{ - Name: "users", - Description: "Managing users"}}} -} - -// User is just a sample type -type User struct { - ID string `json:"id" description:"identifier of the user"` - Name string `json:"name" description:"name of the user" default:"john"` - Age int `json:"age" description:"age of the user" default:"21"` -} diff --git a/vendor/github.com/emicklei/go-restful/filter.go b/vendor/github.com/emicklei/go-restful/filter.go deleted file mode 100644 index c23bfb59..00000000 --- a/vendor/github.com/emicklei/go-restful/filter.go +++ /dev/null @@ -1,35 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -// FilterChain is a request scoped object to process one or more filters before calling the target RouteFunction. -type FilterChain struct { - Filters []FilterFunction // ordered list of FilterFunction - Index int // index into filters that is currently in progress - Target RouteFunction // function to call after passing all filters -} - -// ProcessFilter passes the request,response pair through the next of Filters. -// Each filter can decide to proceed to the next Filter or handle the Response itself. -func (f *FilterChain) ProcessFilter(request *Request, response *Response) { - if f.Index < len(f.Filters) { - f.Index++ - f.Filters[f.Index-1](request, response, f) - } else { - f.Target(request, response) - } -} - -// FilterFunction definitions must call ProcessFilter on the FilterChain to pass on the control and eventually call the RouteFunction -type FilterFunction func(*Request, *Response, *FilterChain) - -// NoBrowserCacheFilter is a filter function to set HTTP headers that disable browser caching -// See examples/restful-no-cache-filter.go for usage -func NoBrowserCacheFilter(req *Request, resp *Response, chain *FilterChain) { - resp.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate") // HTTP 1.1. - resp.Header().Set("Pragma", "no-cache") // HTTP 1.0. - resp.Header().Set("Expires", "0") // Proxies. - chain.ProcessFilter(req, resp) -} diff --git a/vendor/github.com/emicklei/go-restful/filter_test.go b/vendor/github.com/emicklei/go-restful/filter_test.go deleted file mode 100644 index fadfb570..00000000 --- a/vendor/github.com/emicklei/go-restful/filter_test.go +++ /dev/null @@ -1,141 +0,0 @@ -package restful - -import ( - "io" - "net/http" - "net/http/httptest" - "testing" -) - -func setupServices(addGlobalFilter bool, addServiceFilter bool, addRouteFilter bool) { - if addGlobalFilter { - Filter(globalFilter) - } - Add(newTestService(addServiceFilter, addRouteFilter)) -} - -func tearDown() { - DefaultContainer.webServices = []*WebService{} - DefaultContainer.isRegisteredOnRoot = true // this allows for setupServices multiple times - DefaultContainer.containerFilters = []FilterFunction{} -} - -func newTestService(addServiceFilter bool, addRouteFilter bool) *WebService { - ws := new(WebService).Path("") - if addServiceFilter { - ws.Filter(serviceFilter) - } - rb := ws.GET("/foo").To(foo) - if addRouteFilter { - rb.Filter(routeFilter) - } - ws.Route(rb) - ws.Route(ws.GET("/bar").To(bar)) - return ws -} - -func foo(req *Request, resp *Response) { - io.WriteString(resp.ResponseWriter, "foo") -} - -func bar(req *Request, resp *Response) { - io.WriteString(resp.ResponseWriter, "bar") -} - -func fail(req *Request, resp *Response) { - http.Error(resp.ResponseWriter, "something failed", http.StatusInternalServerError) -} - -func globalFilter(req *Request, resp *Response, chain *FilterChain) { - io.WriteString(resp.ResponseWriter, "global-") - chain.ProcessFilter(req, resp) -} - -func serviceFilter(req *Request, resp *Response, chain *FilterChain) { - io.WriteString(resp.ResponseWriter, "service-") - chain.ProcessFilter(req, resp) -} - -func routeFilter(req *Request, resp *Response, chain *FilterChain) { - io.WriteString(resp.ResponseWriter, "route-") - chain.ProcessFilter(req, resp) -} - -func TestNoFilter(t *testing.T) { - tearDown() - setupServices(false, false, false) - actual := sendIt("http://example.com/foo") - if "foo" != actual { - t.Fatal("expected: foo but got:" + actual) - } -} - -func TestGlobalFilter(t *testing.T) { - tearDown() - setupServices(true, false, false) - actual := sendIt("http://example.com/foo") - if "global-foo" != actual { - t.Fatal("expected: global-foo but got:" + actual) - } -} - -func TestWebServiceFilter(t *testing.T) { - tearDown() - setupServices(true, true, false) - actual := sendIt("http://example.com/foo") - if "global-service-foo" != actual { - t.Fatal("expected: global-service-foo but got:" + actual) - } -} - -func TestRouteFilter(t *testing.T) { - tearDown() - setupServices(true, true, true) - actual := sendIt("http://example.com/foo") - if "global-service-route-foo" != actual { - t.Fatal("expected: global-service-route-foo but got:" + actual) - } -} - -func TestRouteFilterOnly(t *testing.T) { - tearDown() - setupServices(false, false, true) - actual := sendIt("http://example.com/foo") - if "route-foo" != actual { - t.Fatal("expected: route-foo but got:" + actual) - } -} - -func TestBar(t *testing.T) { - tearDown() - setupServices(false, true, false) - actual := sendIt("http://example.com/bar") - if "service-bar" != actual { - t.Fatal("expected: service-bar but got:" + actual) - } -} - -func TestAllFiltersBar(t *testing.T) { - tearDown() - setupServices(true, true, true) - actual := sendIt("http://example.com/bar") - if "global-service-bar" != actual { - t.Fatal("expected: global-service-bar but got:" + actual) - } -} - -func sendIt(address string) string { - httpRequest, _ := http.NewRequest("GET", address, nil) - httpRequest.Header.Set("Accept", "*/*") - httpWriter := httptest.NewRecorder() - DefaultContainer.dispatch(httpWriter, httpRequest) - return httpWriter.Body.String() -} - -func sendItTo(address string, container *Container) string { - httpRequest, _ := http.NewRequest("GET", address, nil) - httpRequest.Header.Set("Accept", "*/*") - httpWriter := httptest.NewRecorder() - container.dispatch(httpWriter, httpRequest) - return httpWriter.Body.String() -} diff --git a/vendor/github.com/emicklei/go-restful/json.go b/vendor/github.com/emicklei/go-restful/json.go deleted file mode 100644 index 87116516..00000000 --- a/vendor/github.com/emicklei/go-restful/json.go +++ /dev/null @@ -1,11 +0,0 @@ -// +build !jsoniter - -package restful - -import "encoding/json" - -var ( - MarshalIndent = json.MarshalIndent - NewDecoder = json.NewDecoder - NewEncoder = json.NewEncoder -) diff --git a/vendor/github.com/emicklei/go-restful/jsoniter.go b/vendor/github.com/emicklei/go-restful/jsoniter.go deleted file mode 100644 index 11b8f8ae..00000000 --- a/vendor/github.com/emicklei/go-restful/jsoniter.go +++ /dev/null @@ -1,12 +0,0 @@ -// +build jsoniter - -package restful - -import "github.com/json-iterator/go" - -var ( - json = jsoniter.ConfigCompatibleWithStandardLibrary - MarshalIndent = json.MarshalIndent - NewDecoder = json.NewDecoder - NewEncoder = json.NewEncoder -) diff --git a/vendor/github.com/emicklei/go-restful/jsr311.go b/vendor/github.com/emicklei/go-restful/jsr311.go deleted file mode 100644 index 4360b492..00000000 --- a/vendor/github.com/emicklei/go-restful/jsr311.go +++ /dev/null @@ -1,293 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "errors" - "fmt" - "net/http" - "sort" -) - -// RouterJSR311 implements the flow for matching Requests to Routes (and consequently Resource Functions) -// as specified by the JSR311 http://jsr311.java.net/nonav/releases/1.1/spec/spec.html. -// RouterJSR311 implements the Router interface. -// Concept of locators is not implemented. -type RouterJSR311 struct{} - -// SelectRoute is part of the Router interface and returns the best match -// for the WebService and its Route for the given Request. -func (r RouterJSR311) SelectRoute( - webServices []*WebService, - httpRequest *http.Request) (selectedService *WebService, selectedRoute *Route, err error) { - - // Identify the root resource class (WebService) - dispatcher, finalMatch, err := r.detectDispatcher(httpRequest.URL.Path, webServices) - if err != nil { - return nil, nil, NewError(http.StatusNotFound, "") - } - // Obtain the set of candidate methods (Routes) - routes := r.selectRoutes(dispatcher, finalMatch) - if len(routes) == 0 { - return dispatcher, nil, NewError(http.StatusNotFound, "404: Page Not Found") - } - - // Identify the method (Route) that will handle the request - route, ok := r.detectRoute(routes, httpRequest) - return dispatcher, route, ok -} - -// ExtractParameters is used to obtain the path parameters from the route using the same matching -// engine as the JSR 311 router. -func (r RouterJSR311) ExtractParameters(route *Route, webService *WebService, urlPath string) map[string]string { - webServiceExpr := webService.pathExpr - webServiceMatches := webServiceExpr.Matcher.FindStringSubmatch(urlPath) - pathParameters := r.extractParams(webServiceExpr, webServiceMatches) - routeExpr := route.pathExpr - routeMatches := routeExpr.Matcher.FindStringSubmatch(webServiceMatches[len(webServiceMatches)-1]) - routeParams := r.extractParams(routeExpr, routeMatches) - for key, value := range routeParams { - pathParameters[key] = value - } - return pathParameters -} - -func (RouterJSR311) extractParams(pathExpr *pathExpression, matches []string) map[string]string { - params := map[string]string{} - for i := 1; i < len(matches); i++ { - if len(pathExpr.VarNames) >= i { - params[pathExpr.VarNames[i-1]] = matches[i] - } - } - return params -} - -// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-360003.7.2 -func (r RouterJSR311) detectRoute(routes []Route, httpRequest *http.Request) (*Route, error) { - ifOk := []Route{} - for _, each := range routes { - ok := true - for _, fn := range each.If { - if !fn(httpRequest) { - ok = false - break - } - } - if ok { - ifOk = append(ifOk, each) - } - } - if len(ifOk) == 0 { - if trace { - traceLogger.Printf("no Route found (from %d) that passes conditional checks", len(routes)) - } - return nil, NewError(http.StatusNotFound, "404: Not Found") - } - - // http method - methodOk := []Route{} - for _, each := range ifOk { - if httpRequest.Method == each.Method { - methodOk = append(methodOk, each) - } - } - if len(methodOk) == 0 { - if trace { - traceLogger.Printf("no Route found (in %d routes) that matches HTTP method %s\n", len(routes), httpRequest.Method) - } - return nil, NewError(http.StatusMethodNotAllowed, "405: Method Not Allowed") - } - inputMediaOk := methodOk - - // content-type - contentType := httpRequest.Header.Get(HEADER_ContentType) - inputMediaOk = []Route{} - for _, each := range methodOk { - if each.matchesContentType(contentType) { - inputMediaOk = append(inputMediaOk, each) - } - } - if len(inputMediaOk) == 0 { - if trace { - traceLogger.Printf("no Route found (from %d) that matches HTTP Content-Type: %s\n", len(methodOk), contentType) - } - return nil, NewError(http.StatusUnsupportedMediaType, "415: Unsupported Media Type") - } - - // accept - outputMediaOk := []Route{} - accept := httpRequest.Header.Get(HEADER_Accept) - if len(accept) == 0 { - accept = "*/*" - } - for _, each := range inputMediaOk { - if each.matchesAccept(accept) { - outputMediaOk = append(outputMediaOk, each) - } - } - if len(outputMediaOk) == 0 { - if trace { - traceLogger.Printf("no Route found (from %d) that matches HTTP Accept: %s\n", len(inputMediaOk), accept) - } - return nil, NewError(http.StatusNotAcceptable, "406: Not Acceptable") - } - // return r.bestMatchByMedia(outputMediaOk, contentType, accept), nil - return &outputMediaOk[0], nil -} - -// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-360003.7.2 -// n/m > n/* > */* -func (r RouterJSR311) bestMatchByMedia(routes []Route, contentType string, accept string) *Route { - // TODO - return &routes[0] -} - -// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-360003.7.2 (step 2) -func (r RouterJSR311) selectRoutes(dispatcher *WebService, pathRemainder string) []Route { - filtered := &sortableRouteCandidates{} - for _, each := range dispatcher.Routes() { - pathExpr := each.pathExpr - matches := pathExpr.Matcher.FindStringSubmatch(pathRemainder) - if matches != nil { - lastMatch := matches[len(matches)-1] - if len(lastMatch) == 0 || lastMatch == "/" { // do not include if value is neither empty nor ‘/’. - filtered.candidates = append(filtered.candidates, - routeCandidate{each, len(matches) - 1, pathExpr.LiteralCount, pathExpr.VarCount}) - } - } - } - if len(filtered.candidates) == 0 { - if trace { - traceLogger.Printf("WebService on path %s has no routes that match URL path remainder:%s\n", dispatcher.rootPath, pathRemainder) - } - return []Route{} - } - sort.Sort(sort.Reverse(filtered)) - - // select other routes from candidates whoes expression matches rmatch - matchingRoutes := []Route{filtered.candidates[0].route} - for c := 1; c < len(filtered.candidates); c++ { - each := filtered.candidates[c] - if each.route.pathExpr.Matcher.MatchString(pathRemainder) { - matchingRoutes = append(matchingRoutes, each.route) - } - } - return matchingRoutes -} - -// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-360003.7.2 (step 1) -func (r RouterJSR311) detectDispatcher(requestPath string, dispatchers []*WebService) (*WebService, string, error) { - filtered := &sortableDispatcherCandidates{} - for _, each := range dispatchers { - matches := each.pathExpr.Matcher.FindStringSubmatch(requestPath) - if matches != nil { - filtered.candidates = append(filtered.candidates, - dispatcherCandidate{each, matches[len(matches)-1], len(matches), each.pathExpr.LiteralCount, each.pathExpr.VarCount}) - } - } - if len(filtered.candidates) == 0 { - if trace { - traceLogger.Printf("no WebService was found to match URL path:%s\n", requestPath) - } - return nil, "", errors.New("not found") - } - sort.Sort(sort.Reverse(filtered)) - return filtered.candidates[0].dispatcher, filtered.candidates[0].finalMatch, nil -} - -// Types and functions to support the sorting of Routes - -type routeCandidate struct { - route Route - matchesCount int // the number of capturing groups - literalCount int // the number of literal characters (means those not resulting from template variable substitution) - nonDefaultCount int // the number of capturing groups with non-default regular expressions (i.e. not ‘([^ /]+?)’) -} - -func (r routeCandidate) expressionToMatch() string { - return r.route.pathExpr.Source -} - -func (r routeCandidate) String() string { - return fmt.Sprintf("(m=%d,l=%d,n=%d)", r.matchesCount, r.literalCount, r.nonDefaultCount) -} - -type sortableRouteCandidates struct { - candidates []routeCandidate -} - -func (rcs *sortableRouteCandidates) Len() int { - return len(rcs.candidates) -} -func (rcs *sortableRouteCandidates) Swap(i, j int) { - rcs.candidates[i], rcs.candidates[j] = rcs.candidates[j], rcs.candidates[i] -} -func (rcs *sortableRouteCandidates) Less(i, j int) bool { - ci := rcs.candidates[i] - cj := rcs.candidates[j] - // primary key - if ci.literalCount < cj.literalCount { - return true - } - if ci.literalCount > cj.literalCount { - return false - } - // secundary key - if ci.matchesCount < cj.matchesCount { - return true - } - if ci.matchesCount > cj.matchesCount { - return false - } - // tertiary key - if ci.nonDefaultCount < cj.nonDefaultCount { - return true - } - if ci.nonDefaultCount > cj.nonDefaultCount { - return false - } - // quaternary key ("source" is interpreted as Path) - return ci.route.Path < cj.route.Path -} - -// Types and functions to support the sorting of Dispatchers - -type dispatcherCandidate struct { - dispatcher *WebService - finalMatch string - matchesCount int // the number of capturing groups - literalCount int // the number of literal characters (means those not resulting from template variable substitution) - nonDefaultCount int // the number of capturing groups with non-default regular expressions (i.e. not ‘([^ /]+?)’) -} -type sortableDispatcherCandidates struct { - candidates []dispatcherCandidate -} - -func (dc *sortableDispatcherCandidates) Len() int { - return len(dc.candidates) -} -func (dc *sortableDispatcherCandidates) Swap(i, j int) { - dc.candidates[i], dc.candidates[j] = dc.candidates[j], dc.candidates[i] -} -func (dc *sortableDispatcherCandidates) Less(i, j int) bool { - ci := dc.candidates[i] - cj := dc.candidates[j] - // primary key - if ci.matchesCount < cj.matchesCount { - return true - } - if ci.matchesCount > cj.matchesCount { - return false - } - // secundary key - if ci.literalCount < cj.literalCount { - return true - } - if ci.literalCount > cj.literalCount { - return false - } - // tertiary key - return ci.nonDefaultCount < cj.nonDefaultCount -} diff --git a/vendor/github.com/emicklei/go-restful/jsr311_test.go b/vendor/github.com/emicklei/go-restful/jsr311_test.go deleted file mode 100644 index 15cb3333..00000000 --- a/vendor/github.com/emicklei/go-restful/jsr311_test.go +++ /dev/null @@ -1,332 +0,0 @@ -package restful - -import ( - "io" - "net/http" - "reflect" - "sort" - "testing" -) - -// -// Step 1 tests -// -var paths = []struct { - // url with path (1) is handled by service with root (2) and last capturing group has value final (3) - path, root, final string - params map[string]string -}{ - {"/", "/", "/", map[string]string{}}, - {"/p", "/p", "", map[string]string{}}, - {"/p/x", "/p/{q}", "", map[string]string{"q": "x"}}, - {"/q/x", "/q", "/x", map[string]string{}}, - {"/p/x/", "/p/{q}", "/", map[string]string{"q": "x"}}, - {"/p/x/y", "/p/{q}", "/y", map[string]string{"q": "x"}}, - {"/q/x/y", "/q", "/x/y", map[string]string{}}, - {"/z/q", "/{p}/q", "", map[string]string{"p": "z"}}, - {"/a/b/c/q", "/", "/a/b/c/q", map[string]string{}}, -} - -func TestDetectDispatcher(t *testing.T) { - ws1 := new(WebService).Path("/") - ws2 := new(WebService).Path("/p") - ws3 := new(WebService).Path("/q") - ws4 := new(WebService).Path("/p/q") - ws5 := new(WebService).Path("/p/{q}") - ws6 := new(WebService).Path("/p/{q}/") - ws7 := new(WebService).Path("/{p}/q") - var dispatchers = []*WebService{ws1, ws2, ws3, ws4, ws5, ws6, ws7} - - wc := NewContainer() - for _, each := range dispatchers { - each.Route(each.GET("").To(dummy)) - wc.Add(each) - } - - router := RouterJSR311{} - - ok := true - for i, fixture := range paths { - who, final, err := router.detectDispatcher(fixture.path, dispatchers) - if err != nil { - t.Logf("error in detection:%v", err) - ok = false - } - if who.RootPath() != fixture.root { - t.Logf("[line:%v] Unexpected dispatcher, expected:%v, actual:%v", i, fixture.root, who.RootPath()) - ok = false - } - if final != fixture.final { - t.Logf("[line:%v] Unexpected final, expected:%v, actual:%v", i, fixture.final, final) - ok = false - } - params := router.ExtractParameters(&who.Routes()[0], who, fixture.path) - if !reflect.DeepEqual(params, fixture.params) { - t.Logf("[line:%v] Unexpected params, expected:%v, actual:%v", i, fixture.params, params) - ok = false - } - } - if !ok { - t.Fail() - } -} - -// -// Step 2 tests -// - -// go test -v -test.run TestISSUE_179 ...restful -func TestISSUE_179(t *testing.T) { - ws1 := new(WebService) - ws1.Route(ws1.GET("/v1/category/{param:*}").To(dummy)) - routes := RouterJSR311{}.selectRoutes(ws1, "/v1/category/sub/sub") - t.Logf("%v", routes) -} - -// go test -v -test.run TestISSUE_30 ...restful -func TestISSUE_30(t *testing.T) { - ws1 := new(WebService).Path("/users") - ws1.Route(ws1.GET("/{id}").To(dummy)) - ws1.Route(ws1.POST("/login").To(dummy)) - routes := RouterJSR311{}.selectRoutes(ws1, "/login") - if len(routes) != 2 { - t.Fatal("expected 2 routes") - } - if routes[0].Path != "/users/login" { - t.Error("first is", routes[0].Path) - t.Logf("routes:%v", routes) - } -} - -// go test -v -test.run TestISSUE_34 ...restful -func TestISSUE_34(t *testing.T) { - ws1 := new(WebService).Path("/") - ws1.Route(ws1.GET("/{type}/{id}").To(dummy)) - ws1.Route(ws1.GET("/network/{id}").To(dummy)) - routes := RouterJSR311{}.selectRoutes(ws1, "/network/12") - if len(routes) != 2 { - t.Fatal("expected 2 routes") - } - if routes[0].Path != "/network/{id}" { - t.Error("first is", routes[0].Path) - t.Logf("routes:%v", routes) - } -} - -// go test -v -test.run TestISSUE_34_2 ...restful -func TestISSUE_34_2(t *testing.T) { - ws1 := new(WebService).Path("/") - // change the registration order - ws1.Route(ws1.GET("/network/{id}").To(dummy)) - ws1.Route(ws1.GET("/{type}/{id}").To(dummy)) - routes := RouterJSR311{}.selectRoutes(ws1, "/network/12") - if len(routes) != 2 { - t.Fatal("expected 2 routes") - } - if routes[0].Path != "/network/{id}" { - t.Error("first is", routes[0].Path) - } -} - -// go test -v -test.run TestISSUE_137 ...restful -func TestISSUE_137(t *testing.T) { - ws1 := new(WebService) - ws1.Route(ws1.GET("/hello").To(dummy)) - routes := RouterJSR311{}.selectRoutes(ws1, "/") - t.Log(routes) - if len(routes) > 0 { - t.Error("no route expected") - } -} - -func TestSelectRoutesSlash(t *testing.T) { - ws1 := new(WebService).Path("/") - ws1.Route(ws1.GET("").To(dummy)) - ws1.Route(ws1.GET("/").To(dummy)) - ws1.Route(ws1.GET("/u").To(dummy)) - ws1.Route(ws1.POST("/u").To(dummy)) - ws1.Route(ws1.POST("/u/v").To(dummy)) - ws1.Route(ws1.POST("/u/{w}").To(dummy)) - ws1.Route(ws1.POST("/u/{w}/z").To(dummy)) - routes := RouterJSR311{}.selectRoutes(ws1, "/u") - checkRoutesContains(routes, "/u", t) - checkRoutesContainsNo(routes, "/u/v", t) - checkRoutesContainsNo(routes, "/", t) - checkRoutesContainsNo(routes, "/u/{w}/z", t) -} -func TestSelectRoutesU(t *testing.T) { - ws1 := new(WebService).Path("/u") - ws1.Route(ws1.GET("").To(dummy)) - ws1.Route(ws1.GET("/").To(dummy)) - ws1.Route(ws1.GET("/v").To(dummy)) - ws1.Route(ws1.POST("/{w}").To(dummy)) - ws1.Route(ws1.POST("/{w}/z").To(dummy)) // so full path = /u/{w}/z - routes := RouterJSR311{}.selectRoutes(ws1, "/v") // test against /u/v - checkRoutesContains(routes, "/u/{w}", t) -} - -func TestSelectRoutesUsers1(t *testing.T) { - ws1 := new(WebService).Path("/users") - ws1.Route(ws1.POST("").To(dummy)) - ws1.Route(ws1.POST("/").To(dummy)) - ws1.Route(ws1.PUT("/{id}").To(dummy)) - routes := RouterJSR311{}.selectRoutes(ws1, "/1") - checkRoutesContains(routes, "/users/{id}", t) -} -func checkRoutesContains(routes []Route, path string, t *testing.T) { - if !containsRoutePath(routes, path, t) { - for _, r := range routes { - t.Logf("route %v %v", r.Method, r.Path) - } - t.Fatalf("routes should include [%v]:", path) - } -} -func checkRoutesContainsNo(routes []Route, path string, t *testing.T) { - if containsRoutePath(routes, path, t) { - for _, r := range routes { - t.Logf("route %v %v", r.Method, r.Path) - } - t.Fatalf("routes should not include [%v]:", path) - } -} -func containsRoutePath(routes []Route, path string, t *testing.T) bool { - for _, each := range routes { - if each.Path == path { - return true - } - } - return false -} - -// go test -v -test.run TestSortableRouteCandidates ...restful -func TestSortableRouteCandidates(t *testing.T) { - fixture := &sortableRouteCandidates{} - r1 := routeCandidate{matchesCount: 0, literalCount: 0, nonDefaultCount: 0} - r2 := routeCandidate{matchesCount: 0, literalCount: 0, nonDefaultCount: 1} - r3 := routeCandidate{matchesCount: 0, literalCount: 1, nonDefaultCount: 1} - r4 := routeCandidate{matchesCount: 1, literalCount: 1, nonDefaultCount: 0} - r5 := routeCandidate{matchesCount: 1, literalCount: 0, nonDefaultCount: 0} - fixture.candidates = append(fixture.candidates, r5, r4, r3, r2, r1) - sort.Sort(sort.Reverse(fixture)) - first := fixture.candidates[0] - if first.matchesCount != 1 && first.literalCount != 1 && first.nonDefaultCount != 0 { - t.Fatal("expected r4") - } - last := fixture.candidates[len(fixture.candidates)-1] - if last.matchesCount != 0 && last.literalCount != 0 && last.nonDefaultCount != 0 { - t.Fatal("expected r1") - } -} - -func TestDetectRouteReturns404IfNoRoutePassesConditions(t *testing.T) { - called := false - shouldNotBeCalledButWas := false - - routes := []Route{ - new(RouteBuilder).To(dummy). - If(func(req *http.Request) bool { return false }). - Build(), - - // check that condition functions are called in order - new(RouteBuilder). - To(dummy). - If(func(req *http.Request) bool { return true }). - If(func(req *http.Request) bool { called = true; return false }). - Build(), - - // check that condition functions short circuit - new(RouteBuilder). - To(dummy). - If(func(req *http.Request) bool { return false }). - If(func(req *http.Request) bool { shouldNotBeCalledButWas = true; return false }). - Build(), - } - - _, err := RouterJSR311{}.detectRoute(routes, (*http.Request)(nil)) - if se := err.(ServiceError); se.Code != 404 { - t.Fatalf("expected 404, got %d", se.Code) - } - - if !called { - t.Fatal("expected condition function to get called, but it wasn't") - } - - if shouldNotBeCalledButWas { - t.Fatal("expected condition function to not be called, but it was") - } -} - -var extractParams = []struct { - name string - routePath string - urlPath string - expectedParams map[string]string -}{ - {"wildcardLastPart", "/fixed/{var:*}", "/fixed/remainder", map[string]string{"var": "remainder"}}, - {"wildcardMultipleParts", "/fixed/{var:*}", "/fixed/remain/der", map[string]string{"var": "remain/der"}}, - {"wildcardManyParts", "/fixed/{var:*}", "/fixed/test/sub/hi.html", map[string]string{"var": "test/sub/hi.html"}}, - {"wildcardInMiddle", "/fixed/{var:*}/morefixed", "/fixed/middle/stuff/morefixed", map[string]string{"var": "middle/stuff"}}, - {"wildcardFollowedByVar", "/fixed/{var:*}/morefixed/{otherVar}", "/fixed/middle/stuff/morefixed/end", map[string]string{"var": "middle/stuff", "otherVar": "end"}}, - {"singleParam", "/fixed/{var}", "/fixed/remainder", map[string]string{"var": "remainder"}}, - {"slash", "/", "/", map[string]string{}}, - {"NoVars", "/fixed", "/fixed", map[string]string{}}, - {"TwoVars", "/from/{source}/to/{destination}", "/from/LHR/to/AMS", map[string]string{"source": "LHR", "destination": "AMS"}}, - {"VarOnFront", "/{what}/from/{source}", "/who/from/SOS", map[string]string{"what": "who", "source": "SOS"}}, -} - -func TestExtractParams(t *testing.T) { - for _, testCase := range extractParams { - t.Run(testCase.name, func(t *testing.T) { - ws1 := new(WebService).Path("/") - ws1.Route(ws1.GET(testCase.routePath).To(dummy)) - router := RouterJSR311{} - req, _ := http.NewRequest(http.MethodGet, testCase.urlPath, nil) - params := router.ExtractParameters(&ws1.Routes()[0], ws1, req.URL.Path) - if len(params) != len(testCase.expectedParams) { - t.Fatalf("Wrong length of params on selected route, expected: %v, got: %v", testCase.expectedParams, params) - } - for expectedParamKey, expectedParamValue := range testCase.expectedParams { - if expectedParamValue != params[expectedParamKey] { - t.Errorf("Wrong parameter for key '%v', expected: %v, got: %v", expectedParamKey, expectedParamValue, params[expectedParamKey]) - } - } - }) - } -} - -func TestSelectRouteInvalidMethod(t *testing.T) { - ws1 := new(WebService).Path("/") - ws1.Route(ws1.GET("/simple").To(dummy)) - router := RouterJSR311{} - req, _ := http.NewRequest(http.MethodPost, "/simple", nil) - _, _, err := router.SelectRoute([]*WebService{ws1}, req) - if err == nil { - t.Fatal("Expected an error as the wrong method is used but was nil") - } -} - -func TestParameterInWebService(t *testing.T) { - for _, testCase := range extractParams { - t.Run(testCase.name, func(t *testing.T) { - ws1 := new(WebService).Path("/{wsParam}") - ws1.Route(ws1.GET(testCase.routePath).To(dummy)) - router := RouterJSR311{} - req, _ := http.NewRequest(http.MethodGet, "/wsValue"+testCase.urlPath, nil) - params := router.ExtractParameters(&ws1.Routes()[0], ws1, req.URL.Path) - expectedParams := map[string]string{"wsParam": "wsValue"} - for key, value := range testCase.expectedParams { - expectedParams[key] = value - } - if len(params) != len(expectedParams) { - t.Fatalf("Wrong length of params on selected route, expected: %v, got: %v", testCase.expectedParams, params) - } - for expectedParamKey, expectedParamValue := range testCase.expectedParams { - if expectedParamValue != params[expectedParamKey] { - t.Errorf("Wrong parameter for key '%v', expected: %v, got: %v", expectedParamKey, expectedParamValue, params[expectedParamKey]) - } - } - }) - } -} - -func dummy(req *Request, resp *Response) { io.WriteString(resp.ResponseWriter, "dummy") } diff --git a/vendor/github.com/emicklei/go-restful/log/log.go b/vendor/github.com/emicklei/go-restful/log/log.go deleted file mode 100644 index 6cd44c7a..00000000 --- a/vendor/github.com/emicklei/go-restful/log/log.go +++ /dev/null @@ -1,34 +0,0 @@ -package log - -import ( - stdlog "log" - "os" -) - -// StdLogger corresponds to a minimal subset of the interface satisfied by stdlib log.Logger -type StdLogger interface { - Print(v ...interface{}) - Printf(format string, v ...interface{}) -} - -var Logger StdLogger - -func init() { - // default Logger - SetLogger(stdlog.New(os.Stderr, "[restful] ", stdlog.LstdFlags|stdlog.Lshortfile)) -} - -// SetLogger sets the logger for this package -func SetLogger(customLogger StdLogger) { - Logger = customLogger -} - -// Print delegates to the Logger -func Print(v ...interface{}) { - Logger.Print(v...) -} - -// Printf delegates to the Logger -func Printf(format string, v ...interface{}) { - Logger.Printf(format, v...) -} diff --git a/vendor/github.com/emicklei/go-restful/logger.go b/vendor/github.com/emicklei/go-restful/logger.go deleted file mode 100644 index 6595df00..00000000 --- a/vendor/github.com/emicklei/go-restful/logger.go +++ /dev/null @@ -1,32 +0,0 @@ -package restful - -// Copyright 2014 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. -import ( - "github.com/emicklei/go-restful/log" -) - -var trace bool = false -var traceLogger log.StdLogger - -func init() { - traceLogger = log.Logger // use the package logger by default -} - -// TraceLogger enables detailed logging of Http request matching and filter invocation. Default no logger is set. -// You may call EnableTracing() directly to enable trace logging to the package-wide logger. -func TraceLogger(logger log.StdLogger) { - traceLogger = logger - EnableTracing(logger != nil) -} - -// SetLogger exposes the setter for the global logger on the top-level package -func SetLogger(customLogger log.StdLogger) { - log.SetLogger(customLogger) -} - -// EnableTracing can be used to Trace logging on and off. -func EnableTracing(enabled bool) { - trace = enabled -} diff --git a/vendor/github.com/emicklei/go-restful/mime.go b/vendor/github.com/emicklei/go-restful/mime.go deleted file mode 100644 index d7ea2b61..00000000 --- a/vendor/github.com/emicklei/go-restful/mime.go +++ /dev/null @@ -1,45 +0,0 @@ -package restful - -import ( - "strconv" - "strings" -) - -type mime struct { - media string - quality float64 -} - -// insertMime adds a mime to a list and keeps it sorted by quality. -func insertMime(l []mime, e mime) []mime { - for i, each := range l { - // if current mime has lower quality then insert before - if e.quality > each.quality { - left := append([]mime{}, l[0:i]...) - return append(append(left, e), l[i:]...) - } - } - return append(l, e) -} - -// sortedMimes returns a list of mime sorted (desc) by its specified quality. -func sortedMimes(accept string) (sorted []mime) { - for _, each := range strings.Split(accept, ",") { - typeAndQuality := strings.Split(strings.Trim(each, " "), ";") - if len(typeAndQuality) == 1 { - sorted = insertMime(sorted, mime{typeAndQuality[0], 1.0}) - } else { - // take factor - parts := strings.Split(typeAndQuality[1], "=") - if len(parts) == 2 { - f, err := strconv.ParseFloat(parts[1], 64) - if err != nil { - traceLogger.Printf("unable to parse quality in %s, %v", each, err) - } else { - sorted = insertMime(sorted, mime{typeAndQuality[0], f}) - } - } - } - } - return -} diff --git a/vendor/github.com/emicklei/go-restful/mime_test.go b/vendor/github.com/emicklei/go-restful/mime_test.go deleted file mode 100644 index a910bb10..00000000 --- a/vendor/github.com/emicklei/go-restful/mime_test.go +++ /dev/null @@ -1,17 +0,0 @@ -package restful - -import ( - "fmt" - "testing" -) - -// go test -v -test.run TestSortMimes ...restful -func TestSortMimes(t *testing.T) { - accept := "text/html; q=0.8, text/plain, image/gif, */*; q=0.01, image/jpeg" - result := sortedMimes(accept) - got := fmt.Sprintf("%v", result) - want := "[{text/plain 1} {image/gif 1} {image/jpeg 1} {text/html 0.8} {*/* 0.01}]" - if got != want { - t.Errorf("bad sort order of mime types:%s", got) - } -} diff --git a/vendor/github.com/emicklei/go-restful/options_filter.go b/vendor/github.com/emicklei/go-restful/options_filter.go deleted file mode 100644 index 5c1b3425..00000000 --- a/vendor/github.com/emicklei/go-restful/options_filter.go +++ /dev/null @@ -1,34 +0,0 @@ -package restful - -import "strings" - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -// OPTIONSFilter is a filter function that inspects the Http Request for the OPTIONS method -// and provides the response with a set of allowed methods for the request URL Path. -// As for any filter, you can also install it for a particular WebService within a Container. -// Note: this filter is not needed when using CrossOriginResourceSharing (for CORS). -func (c *Container) OPTIONSFilter(req *Request, resp *Response, chain *FilterChain) { - if "OPTIONS" != req.Request.Method { - chain.ProcessFilter(req, resp) - return - } - - archs := req.Request.Header.Get(HEADER_AccessControlRequestHeaders) - methods := strings.Join(c.computeAllowedMethods(req), ",") - origin := req.Request.Header.Get(HEADER_Origin) - - resp.AddHeader(HEADER_Allow, methods) - resp.AddHeader(HEADER_AccessControlAllowOrigin, origin) - resp.AddHeader(HEADER_AccessControlAllowHeaders, archs) - resp.AddHeader(HEADER_AccessControlAllowMethods, methods) -} - -// OPTIONSFilter is a filter function that inspects the Http Request for the OPTIONS method -// and provides the response with a set of allowed methods for the request URL Path. -// Note: this filter is not needed when using CrossOriginResourceSharing (for CORS). -func OPTIONSFilter() FilterFunction { - return DefaultContainer.OPTIONSFilter -} diff --git a/vendor/github.com/emicklei/go-restful/options_filter_test.go b/vendor/github.com/emicklei/go-restful/options_filter_test.go deleted file mode 100644 index f0fceb83..00000000 --- a/vendor/github.com/emicklei/go-restful/options_filter_test.go +++ /dev/null @@ -1,34 +0,0 @@ -package restful - -import ( - "net/http" - "net/http/httptest" - "testing" -) - -// go test -v -test.run TestOptionsFilter ...restful -func TestOptionsFilter(t *testing.T) { - tearDown() - ws := new(WebService) - ws.Route(ws.GET("/candy/{kind}").To(dummy)) - ws.Route(ws.DELETE("/candy/{kind}").To(dummy)) - ws.Route(ws.POST("/candies").To(dummy)) - Add(ws) - Filter(OPTIONSFilter()) - - httpRequest, _ := http.NewRequest("OPTIONS", "http://here.io/candy/gum", nil) - httpWriter := httptest.NewRecorder() - DefaultContainer.dispatch(httpWriter, httpRequest) - actual := httpWriter.Header().Get(HEADER_Allow) - if "GET,DELETE" != actual { - t.Fatal("expected: GET,DELETE but got:" + actual) - } - - httpRequest, _ = http.NewRequest("OPTIONS", "http://here.io/candies", nil) - httpWriter = httptest.NewRecorder() - DefaultContainer.dispatch(httpWriter, httpRequest) - actual = httpWriter.Header().Get(HEADER_Allow) - if "POST" != actual { - t.Fatal("expected: POST but got:" + actual) - } -} diff --git a/vendor/github.com/emicklei/go-restful/parameter.go b/vendor/github.com/emicklei/go-restful/parameter.go deleted file mode 100644 index e8793304..00000000 --- a/vendor/github.com/emicklei/go-restful/parameter.go +++ /dev/null @@ -1,143 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -const ( - // PathParameterKind = indicator of Request parameter type "path" - PathParameterKind = iota - - // QueryParameterKind = indicator of Request parameter type "query" - QueryParameterKind - - // BodyParameterKind = indicator of Request parameter type "body" - BodyParameterKind - - // HeaderParameterKind = indicator of Request parameter type "header" - HeaderParameterKind - - // FormParameterKind = indicator of Request parameter type "form" - FormParameterKind - - // CollectionFormatCSV comma separated values `foo,bar` - CollectionFormatCSV = CollectionFormat("csv") - - // CollectionFormatSSV space separated values `foo bar` - CollectionFormatSSV = CollectionFormat("ssv") - - // CollectionFormatTSV tab separated values `foo\tbar` - CollectionFormatTSV = CollectionFormat("tsv") - - // CollectionFormatPipes pipe separated values `foo|bar` - CollectionFormatPipes = CollectionFormat("pipes") - - // CollectionFormatMulti corresponds to multiple parameter instances instead of multiple values for a single - // instance `foo=bar&foo=baz`. This is valid only for QueryParameters and FormParameters - CollectionFormatMulti = CollectionFormat("multi") -) - -type CollectionFormat string - -func (cf CollectionFormat) String() string { - return string(cf) -} - -// Parameter is for documententing the parameter used in a Http Request -// ParameterData kinds are Path,Query and Body -type Parameter struct { - data *ParameterData -} - -// ParameterData represents the state of a Parameter. -// It is made public to make it accessible to e.g. the Swagger package. -type ParameterData struct { - Name, Description, DataType, DataFormat string - Kind int - Required bool - AllowableValues map[string]string - AllowMultiple bool - DefaultValue string - CollectionFormat string -} - -// Data returns the state of the Parameter -func (p *Parameter) Data() ParameterData { - return *p.data -} - -// Kind returns the parameter type indicator (see const for valid values) -func (p *Parameter) Kind() int { - return p.data.Kind -} - -func (p *Parameter) bePath() *Parameter { - p.data.Kind = PathParameterKind - return p -} -func (p *Parameter) beQuery() *Parameter { - p.data.Kind = QueryParameterKind - return p -} -func (p *Parameter) beBody() *Parameter { - p.data.Kind = BodyParameterKind - return p -} - -func (p *Parameter) beHeader() *Parameter { - p.data.Kind = HeaderParameterKind - return p -} - -func (p *Parameter) beForm() *Parameter { - p.data.Kind = FormParameterKind - return p -} - -// Required sets the required field and returns the receiver -func (p *Parameter) Required(required bool) *Parameter { - p.data.Required = required - return p -} - -// AllowMultiple sets the allowMultiple field and returns the receiver -func (p *Parameter) AllowMultiple(multiple bool) *Parameter { - p.data.AllowMultiple = multiple - return p -} - -// AllowableValues sets the allowableValues field and returns the receiver -func (p *Parameter) AllowableValues(values map[string]string) *Parameter { - p.data.AllowableValues = values - return p -} - -// DataType sets the dataType field and returns the receiver -func (p *Parameter) DataType(typeName string) *Parameter { - p.data.DataType = typeName - return p -} - -// DataFormat sets the dataFormat field for Swagger UI -func (p *Parameter) DataFormat(formatName string) *Parameter { - p.data.DataFormat = formatName - return p -} - -// DefaultValue sets the default value field and returns the receiver -func (p *Parameter) DefaultValue(stringRepresentation string) *Parameter { - p.data.DefaultValue = stringRepresentation - return p -} - -// Description sets the description value field and returns the receiver -func (p *Parameter) Description(doc string) *Parameter { - p.data.Description = doc - return p -} - -// CollectionFormat sets the collection format for an array type -func (p *Parameter) CollectionFormat(format CollectionFormat) *Parameter { - p.data.CollectionFormat = format.String() - return p -} diff --git a/vendor/github.com/emicklei/go-restful/path_expression.go b/vendor/github.com/emicklei/go-restful/path_expression.go deleted file mode 100644 index 95a9a254..00000000 --- a/vendor/github.com/emicklei/go-restful/path_expression.go +++ /dev/null @@ -1,74 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "bytes" - "fmt" - "regexp" - "strings" -) - -// PathExpression holds a compiled path expression (RegExp) needed to match against -// Http request paths and to extract path parameter values. -type pathExpression struct { - LiteralCount int // the number of literal characters (means those not resulting from template variable substitution) - VarNames []string // the names of parameters (enclosed by {}) in the path - VarCount int // the number of named parameters (enclosed by {}) in the path - Matcher *regexp.Regexp - Source string // Path as defined by the RouteBuilder - tokens []string -} - -// NewPathExpression creates a PathExpression from the input URL path. -// Returns an error if the path is invalid. -func newPathExpression(path string) (*pathExpression, error) { - expression, literalCount, varNames, varCount, tokens := templateToRegularExpression(path) - compiled, err := regexp.Compile(expression) - if err != nil { - return nil, err - } - return &pathExpression{literalCount, varNames, varCount, compiled, expression, tokens}, nil -} - -// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-370003.7.3 -func templateToRegularExpression(template string) (expression string, literalCount int, varNames []string, varCount int, tokens []string) { - var buffer bytes.Buffer - buffer.WriteString("^") - //tokens = strings.Split(template, "/") - tokens = tokenizePath(template) - for _, each := range tokens { - if each == "" { - continue - } - buffer.WriteString("/") - if strings.HasPrefix(each, "{") { - // check for regular expression in variable - colon := strings.Index(each, ":") - var varName string - if colon != -1 { - // extract expression - varName = strings.TrimSpace(each[1:colon]) - paramExpr := strings.TrimSpace(each[colon+1 : len(each)-1]) - if paramExpr == "*" { // special case - buffer.WriteString("(.*)") - } else { - buffer.WriteString(fmt.Sprintf("(%s)", paramExpr)) // between colon and closing moustache - } - } else { - // plain var - varName = strings.TrimSpace(each[1 : len(each)-1]) - buffer.WriteString("([^/]+?)") - } - varNames = append(varNames, varName) - varCount += 1 - } else { - literalCount += len(each) - encoded := each // TODO URI encode - buffer.WriteString(regexp.QuoteMeta(encoded)) - } - } - return strings.TrimRight(buffer.String(), "/") + "(/.*)?$", literalCount, varNames, varCount, tokens -} diff --git a/vendor/github.com/emicklei/go-restful/path_expression_test.go b/vendor/github.com/emicklei/go-restful/path_expression_test.go deleted file mode 100644 index 073f1989..00000000 --- a/vendor/github.com/emicklei/go-restful/path_expression_test.go +++ /dev/null @@ -1,45 +0,0 @@ -package restful - -import ( - "reflect" - "testing" -) - -var tempregexs = []struct { - template, regex string - names []string - literalCount, varCount int -}{ - {"", "^(/.*)?$", nil, 0, 0}, - {"/a/{b}/c/", "^/a/([^/]+?)/c(/.*)?$", []string{"b"}, 2, 1}, - {"/{a}/{b}/{c-d-e}/", "^/([^/]+?)/([^/]+?)/([^/]+?)(/.*)?$", []string{"a", "b", "c-d-e"}, 0, 3}, - {"/{p}/abcde", "^/([^/]+?)/abcde(/.*)?$", []string{"p"}, 5, 1}, - {"/a/{b:*}", "^/a/(.*)(/.*)?$", []string{"b"}, 1, 1}, - {"/a/{b:[a-z]+}", "^/a/([a-z]+)(/.*)?$", []string{"b"}, 1, 1}, -} - -func TestTemplateToRegularExpression(t *testing.T) { - ok := true - for i, fixture := range tempregexs { - actual, lCount, varNames, vCount, _ := templateToRegularExpression(fixture.template) - if actual != fixture.regex { - t.Logf("regex mismatch, expected:%v , actual:%v, line:%v\n", fixture.regex, actual, i) // 11 = where the data starts - ok = false - } - if lCount != fixture.literalCount { - t.Logf("literal count mismatch, expected:%v , actual:%v, line:%v\n", fixture.literalCount, lCount, i) - ok = false - } - if vCount != fixture.varCount { - t.Logf("variable count mismatch, expected:%v , actual:%v, line:%v\n", fixture.varCount, vCount, i) - ok = false - } - if !reflect.DeepEqual(fixture.names, varNames) { - t.Logf("variable name mismatch, expected:%v , actual:%v, line:%v\n", fixture.names, varNames, i) - ok = false - } - } - if !ok { - t.Fatal("one or more expression did not match") - } -} diff --git a/vendor/github.com/emicklei/go-restful/path_processor.go b/vendor/github.com/emicklei/go-restful/path_processor.go deleted file mode 100644 index 357c723a..00000000 --- a/vendor/github.com/emicklei/go-restful/path_processor.go +++ /dev/null @@ -1,63 +0,0 @@ -package restful - -import ( - "bytes" - "strings" -) - -// Copyright 2018 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -// PathProcessor is extra behaviour that a Router can provide to extract path parameters from the path. -// If a Router does not implement this interface then the default behaviour will be used. -type PathProcessor interface { - // ExtractParameters gets the path parameters defined in the route and webService from the urlPath - ExtractParameters(route *Route, webService *WebService, urlPath string) map[string]string -} - -type defaultPathProcessor struct{} - -// Extract the parameters from the request url path -func (d defaultPathProcessor) ExtractParameters(r *Route, _ *WebService, urlPath string) map[string]string { - urlParts := tokenizePath(urlPath) - pathParameters := map[string]string{} - for i, key := range r.pathParts { - var value string - if i >= len(urlParts) { - value = "" - } else { - value = urlParts[i] - } - if strings.HasPrefix(key, "{") { // path-parameter - if colon := strings.Index(key, ":"); colon != -1 { - // extract by regex - regPart := key[colon+1 : len(key)-1] - keyPart := key[1:colon] - if regPart == "*" { - pathParameters[keyPart] = untokenizePath(i, urlParts) - break - } else { - pathParameters[keyPart] = value - } - } else { - // without enclosing {} - pathParameters[key[1:len(key)-1]] = value - } - } - } - return pathParameters -} - -// Untokenize back into an URL path using the slash separator -func untokenizePath(offset int, parts []string) string { - var buffer bytes.Buffer - for p := offset; p < len(parts); p++ { - buffer.WriteString(parts[p]) - // do not end - if p < len(parts)-1 { - buffer.WriteString("/") - } - } - return buffer.String() -} diff --git a/vendor/github.com/emicklei/go-restful/path_processor_test.go b/vendor/github.com/emicklei/go-restful/path_processor_test.go deleted file mode 100644 index fd1b07dd..00000000 --- a/vendor/github.com/emicklei/go-restful/path_processor_test.go +++ /dev/null @@ -1,55 +0,0 @@ -package restful - -import "testing" - -func TestMatchesPath_OneParam(t *testing.T) { - params := doExtractParams("/from/{source}", 2, "/from/here", t) - if params["source"] != "here" { - t.Errorf("parameter mismatch here") - } -} - -func TestMatchesPath_Slash(t *testing.T) { - params := doExtractParams("/", 0, "/", t) - if len(params) != 0 { - t.Errorf("expected empty parameters") - } -} - -func TestMatchesPath_SlashNonVar(t *testing.T) { - params := doExtractParams("/any", 1, "/any", t) - if len(params) != 0 { - t.Errorf("expected empty parameters") - } -} - -func TestMatchesPath_TwoVars(t *testing.T) { - params := doExtractParams("/from/{source}/to/{destination}", 4, "/from/AMS/to/NY", t) - if params["source"] != "AMS" { - t.Errorf("parameter mismatch AMS") - } -} - -func TestMatchesPath_VarOnFront(t *testing.T) { - params := doExtractParams("{what}/from/{source}/", 3, "who/from/SOS/", t) - if params["source"] != "SOS" { - t.Errorf("parameter mismatch SOS") - } -} - -func TestExtractParameters_EmptyValue(t *testing.T) { - params := doExtractParams("/fixed/{var}", 2, "/fixed/", t) - if params["var"] != "" { - t.Errorf("parameter mismatch var") - } -} - -func doExtractParams(routePath string, size int, urlPath string, t *testing.T) map[string]string { - r := Route{Path: routePath} - r.postBuild() - if len(r.pathParts) != size { - t.Fatalf("len not %v %v, but %v", size, r.pathParts, len(r.pathParts)) - } - pathProcessor := defaultPathProcessor{} - return pathProcessor.ExtractParameters(&r, nil, urlPath) -} diff --git a/vendor/github.com/emicklei/go-restful/request.go b/vendor/github.com/emicklei/go-restful/request.go deleted file mode 100644 index a20730fe..00000000 --- a/vendor/github.com/emicklei/go-restful/request.go +++ /dev/null @@ -1,118 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "compress/zlib" - "net/http" -) - -var defaultRequestContentType string - -// Request is a wrapper for a http Request that provides convenience methods -type Request struct { - Request *http.Request - pathParameters map[string]string - attributes map[string]interface{} // for storing request-scoped values - selectedRoutePath string // root path + route path that matched the request, e.g. /meetings/{id}/attendees -} - -func NewRequest(httpRequest *http.Request) *Request { - return &Request{ - Request: httpRequest, - pathParameters: map[string]string{}, - attributes: map[string]interface{}{}, - } // empty parameters, attributes -} - -// If ContentType is missing or */* is given then fall back to this type, otherwise -// a "Unable to unmarshal content of type:" response is returned. -// Valid values are restful.MIME_JSON and restful.MIME_XML -// Example: -// restful.DefaultRequestContentType(restful.MIME_JSON) -func DefaultRequestContentType(mime string) { - defaultRequestContentType = mime -} - -// PathParameter accesses the Path parameter value by its name -func (r *Request) PathParameter(name string) string { - return r.pathParameters[name] -} - -// PathParameters accesses the Path parameter values -func (r *Request) PathParameters() map[string]string { - return r.pathParameters -} - -// QueryParameter returns the (first) Query parameter value by its name -func (r *Request) QueryParameter(name string) string { - return r.Request.FormValue(name) -} - -// QueryParameters returns the all the query parameters values by name -func (r *Request) QueryParameters(name string) []string { - return r.Request.URL.Query()[name] -} - -// BodyParameter parses the body of the request (once for typically a POST or a PUT) and returns the value of the given name or an error. -func (r *Request) BodyParameter(name string) (string, error) { - err := r.Request.ParseForm() - if err != nil { - return "", err - } - return r.Request.PostFormValue(name), nil -} - -// HeaderParameter returns the HTTP Header value of a Header name or empty if missing -func (r *Request) HeaderParameter(name string) string { - return r.Request.Header.Get(name) -} - -// ReadEntity checks the Accept header and reads the content into the entityPointer. -func (r *Request) ReadEntity(entityPointer interface{}) (err error) { - contentType := r.Request.Header.Get(HEADER_ContentType) - contentEncoding := r.Request.Header.Get(HEADER_ContentEncoding) - - // check if the request body needs decompression - if ENCODING_GZIP == contentEncoding { - gzipReader := currentCompressorProvider.AcquireGzipReader() - defer currentCompressorProvider.ReleaseGzipReader(gzipReader) - gzipReader.Reset(r.Request.Body) - r.Request.Body = gzipReader - } else if ENCODING_DEFLATE == contentEncoding { - zlibReader, err := zlib.NewReader(r.Request.Body) - if err != nil { - return err - } - r.Request.Body = zlibReader - } - - // lookup the EntityReader, use defaultRequestContentType if needed and provided - entityReader, ok := entityAccessRegistry.accessorAt(contentType) - if !ok { - if len(defaultRequestContentType) != 0 { - entityReader, ok = entityAccessRegistry.accessorAt(defaultRequestContentType) - } - if !ok { - return NewError(http.StatusBadRequest, "Unable to unmarshal content of type:"+contentType) - } - } - return entityReader.Read(r, entityPointer) -} - -// SetAttribute adds or replaces the attribute with the given value. -func (r *Request) SetAttribute(name string, value interface{}) { - r.attributes[name] = value -} - -// Attribute returns the value associated to the given name. Returns nil if absent. -func (r Request) Attribute(name string) interface{} { - return r.attributes[name] -} - -// SelectedRoutePath root path + route path that matched the request, e.g. /meetings/{id}/attendees -func (r Request) SelectedRoutePath() string { - return r.selectedRoutePath -} diff --git a/vendor/github.com/emicklei/go-restful/request_test.go b/vendor/github.com/emicklei/go-restful/request_test.go deleted file mode 100644 index 3ab7e27e..00000000 --- a/vendor/github.com/emicklei/go-restful/request_test.go +++ /dev/null @@ -1,155 +0,0 @@ -package restful - -import ( - "encoding/json" - "net/http" - "net/url" - "strconv" - "strings" - "testing" -) - -func TestQueryParameter(t *testing.T) { - hreq := http.Request{Method: "GET"} - hreq.URL, _ = url.Parse("http://www.google.com/search?q=foo&q=bar") - rreq := Request{Request: &hreq} - if rreq.QueryParameter("q") != "foo" { - t.Errorf("q!=foo %#v", rreq) - } -} - -func TestQueryParameters(t *testing.T) { - hreq := http.Request{Method: "GET"} - hreq.URL, _ = url.Parse("http://www.google.com/search?q=foo&q=bar") - rreq := Request{Request: &hreq} - parameters := rreq.QueryParameters("q") - if len(parameters) != 2 { - t.Fatalf("len(q)!=2 %#v", rreq) - } else { - if parameters[0] != "foo" || parameters[1] != "bar" { - t.Fatalf("invalid content: required [\"foo\" \"bar\", got: %#v", parameters) - } - } -} - -type Anything map[string]interface{} - -type Number struct { - ValueFloat float64 - ValueInt int64 -} - -type Sample struct { - Value string -} - -func TestReadEntityJson(t *testing.T) { - bodyReader := strings.NewReader(`{"Value" : "42"}`) - httpRequest, _ := http.NewRequest("GET", "/test", bodyReader) - httpRequest.Header.Set("Content-Type", "application/json") - request := &Request{Request: httpRequest} - sam := new(Sample) - request.ReadEntity(sam) - if sam.Value != "42" { - t.Fatal("read failed") - } -} - -func TestReadEntityJsonCharset(t *testing.T) { - bodyReader := strings.NewReader(`{"Value" : "42"}`) - httpRequest, _ := http.NewRequest("GET", "/test", bodyReader) - httpRequest.Header.Set("Content-Type", "application/json; charset=UTF-8") - request := NewRequest(httpRequest) - sam := new(Sample) - request.ReadEntity(sam) - if sam.Value != "42" { - t.Fatal("read failed") - } -} - -func TestReadEntityJsonNumber(t *testing.T) { - bodyReader := strings.NewReader(`{"Value" : 4899710515899924123}`) - httpRequest, _ := http.NewRequest("GET", "/test", bodyReader) - httpRequest.Header.Set("Content-Type", "application/json") - request := &Request{Request: httpRequest} - any := make(Anything) - request.ReadEntity(&any) - number, ok := any["Value"].(json.Number) - if !ok { - t.Fatal("read failed") - } - vint, err := number.Int64() - if err != nil { - t.Fatal("convert failed") - } - if vint != 4899710515899924123 { - t.Fatal("read failed") - } - vfloat, err := number.Float64() - if err != nil { - t.Fatal("convert failed") - } - // match the default behaviour - vstring := strconv.FormatFloat(vfloat, 'e', 15, 64) - if vstring != "4.899710515899924e+18" { - t.Fatal("convert float64 failed") - } -} - -func TestReadEntityJsonLong(t *testing.T) { - bodyReader := strings.NewReader(`{"ValueFloat" : 4899710515899924123, "ValueInt": 4899710515899924123}`) - httpRequest, _ := http.NewRequest("GET", "/test", bodyReader) - httpRequest.Header.Set("Content-Type", "application/json") - request := &Request{Request: httpRequest} - number := new(Number) - request.ReadEntity(&number) - if number.ValueInt != 4899710515899924123 { - t.Fatal("read failed") - } - // match the default behaviour - vstring := strconv.FormatFloat(number.ValueFloat, 'e', 15, 64) - if vstring != "4.899710515899924e+18" { - t.Fatal("convert float64 failed") - } -} - -func TestBodyParameter(t *testing.T) { - bodyReader := strings.NewReader(`value1=42&value2=43`) - httpRequest, _ := http.NewRequest("POST", "/test?value1=44", bodyReader) // POST and PUT body parameters take precedence over URL query string - httpRequest.Header.Set("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8") - request := NewRequest(httpRequest) - v1, err := request.BodyParameter("value1") - if err != nil { - t.Error(err) - } - v2, err := request.BodyParameter("value2") - if err != nil { - t.Error(err) - } - if v1 != "42" || v2 != "43" { - t.Fatal("read failed") - } -} - -func TestReadEntityUnkown(t *testing.T) { - bodyReader := strings.NewReader("?") - httpRequest, _ := http.NewRequest("GET", "/test", bodyReader) - httpRequest.Header.Set("Content-Type", "application/rubbish") - request := NewRequest(httpRequest) - sam := new(Sample) - err := request.ReadEntity(sam) - if err == nil { - t.Fatal("read should be in error") - } -} - -func TestSetAttribute(t *testing.T) { - bodyReader := strings.NewReader("?") - httpRequest, _ := http.NewRequest("GET", "/test", bodyReader) - request := NewRequest(httpRequest) - request.SetAttribute("go", "there") - there := request.Attribute("go") - if there != "there" { - t.Fatalf("missing request attribute:%v", there) - } -} diff --git a/vendor/github.com/emicklei/go-restful/response.go b/vendor/github.com/emicklei/go-restful/response.go deleted file mode 100644 index 4d987d13..00000000 --- a/vendor/github.com/emicklei/go-restful/response.go +++ /dev/null @@ -1,250 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "bufio" - "errors" - "net" - "net/http" -) - -// DefaultResponseMimeType is DEPRECATED, use DefaultResponseContentType(mime) -var DefaultResponseMimeType string - -//PrettyPrintResponses controls the indentation feature of XML and JSON serialization -var PrettyPrintResponses = true - -// Response is a wrapper on the actual http ResponseWriter -// It provides several convenience methods to prepare and write response content. -type Response struct { - http.ResponseWriter - requestAccept string // mime-type what the Http Request says it wants to receive - routeProduces []string // mime-types what the Route says it can produce - statusCode int // HTTP status code that has been written explicitly (if zero then net/http has written 200) - contentLength int // number of bytes written for the response body - prettyPrint bool // controls the indentation feature of XML and JSON serialization. It is initialized using var PrettyPrintResponses. - err error // err property is kept when WriteError is called - hijacker http.Hijacker // if underlying ResponseWriter supports it -} - -// NewResponse creates a new response based on a http ResponseWriter. -func NewResponse(httpWriter http.ResponseWriter) *Response { - hijacker, _ := httpWriter.(http.Hijacker) - return &Response{ResponseWriter: httpWriter, routeProduces: []string{}, statusCode: http.StatusOK, prettyPrint: PrettyPrintResponses, hijacker: hijacker} -} - -// DefaultResponseContentType set a default. -// If Accept header matching fails, fall back to this type. -// Valid values are restful.MIME_JSON and restful.MIME_XML -// Example: -// restful.DefaultResponseContentType(restful.MIME_JSON) -func DefaultResponseContentType(mime string) { - DefaultResponseMimeType = mime -} - -// InternalServerError writes the StatusInternalServerError header. -// DEPRECATED, use WriteErrorString(http.StatusInternalServerError,reason) -func (r Response) InternalServerError() Response { - r.WriteHeader(http.StatusInternalServerError) - return r -} - -// Hijack implements the http.Hijacker interface. This expands -// the Response to fulfill http.Hijacker if the underlying -// http.ResponseWriter supports it. -func (r *Response) Hijack() (net.Conn, *bufio.ReadWriter, error) { - if r.hijacker == nil { - return nil, nil, errors.New("http.Hijacker not implemented by underlying http.ResponseWriter") - } - return r.hijacker.Hijack() -} - -// PrettyPrint changes whether this response must produce pretty (line-by-line, indented) JSON or XML output. -func (r *Response) PrettyPrint(bePretty bool) { - r.prettyPrint = bePretty -} - -// AddHeader is a shortcut for .Header().Add(header,value) -func (r Response) AddHeader(header string, value string) Response { - r.Header().Add(header, value) - return r -} - -// SetRequestAccepts tells the response what Mime-type(s) the HTTP request said it wants to accept. Exposed for testing. -func (r *Response) SetRequestAccepts(mime string) { - r.requestAccept = mime -} - -// EntityWriter returns the registered EntityWriter that the entity (requested resource) -// can write according to what the request wants (Accept) and what the Route can produce or what the restful defaults say. -// If called before WriteEntity and WriteHeader then a false return value can be used to write a 406: Not Acceptable. -func (r *Response) EntityWriter() (EntityReaderWriter, bool) { - sorted := sortedMimes(r.requestAccept) - for _, eachAccept := range sorted { - for _, eachProduce := range r.routeProduces { - if eachProduce == eachAccept.media { - if w, ok := entityAccessRegistry.accessorAt(eachAccept.media); ok { - return w, true - } - } - } - if eachAccept.media == "*/*" { - for _, each := range r.routeProduces { - if w, ok := entityAccessRegistry.accessorAt(each); ok { - return w, true - } - } - } - } - // if requestAccept is empty - writer, ok := entityAccessRegistry.accessorAt(r.requestAccept) - if !ok { - // if not registered then fallback to the defaults (if set) - if DefaultResponseMimeType == MIME_JSON { - return entityAccessRegistry.accessorAt(MIME_JSON) - } - if DefaultResponseMimeType == MIME_XML { - return entityAccessRegistry.accessorAt(MIME_XML) - } - // Fallback to whatever the route says it can produce. - // https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html - for _, each := range r.routeProduces { - if w, ok := entityAccessRegistry.accessorAt(each); ok { - return w, true - } - } - if trace { - traceLogger.Printf("no registered EntityReaderWriter found for %s", r.requestAccept) - } - } - return writer, ok -} - -// WriteEntity calls WriteHeaderAndEntity with Http Status OK (200) -func (r *Response) WriteEntity(value interface{}) error { - return r.WriteHeaderAndEntity(http.StatusOK, value) -} - -// WriteHeaderAndEntity marshals the value using the representation denoted by the Accept Header and the registered EntityWriters. -// If no Accept header is specified (or */*) then respond with the Content-Type as specified by the first in the Route.Produces. -// If an Accept header is specified then respond with the Content-Type as specified by the first in the Route.Produces that is matched with the Accept header. -// If the value is nil then no response is send except for the Http status. You may want to call WriteHeader(http.StatusNotFound) instead. -// If there is no writer available that can represent the value in the requested MIME type then Http Status NotAcceptable is written. -// Current implementation ignores any q-parameters in the Accept Header. -// Returns an error if the value could not be written on the response. -func (r *Response) WriteHeaderAndEntity(status int, value interface{}) error { - writer, ok := r.EntityWriter() - if !ok { - r.WriteHeader(http.StatusNotAcceptable) - return nil - } - return writer.Write(r, status, value) -} - -// WriteAsXml is a convenience method for writing a value in xml (requires Xml tags on the value) -// It uses the standard encoding/xml package for marshalling the value ; not using a registered EntityReaderWriter. -func (r *Response) WriteAsXml(value interface{}) error { - return writeXML(r, http.StatusOK, MIME_XML, value) -} - -// WriteHeaderAndXml is a convenience method for writing a status and value in xml (requires Xml tags on the value) -// It uses the standard encoding/xml package for marshalling the value ; not using a registered EntityReaderWriter. -func (r *Response) WriteHeaderAndXml(status int, value interface{}) error { - return writeXML(r, status, MIME_XML, value) -} - -// WriteAsJson is a convenience method for writing a value in json. -// It uses the standard encoding/json package for marshalling the value ; not using a registered EntityReaderWriter. -func (r *Response) WriteAsJson(value interface{}) error { - return writeJSON(r, http.StatusOK, MIME_JSON, value) -} - -// WriteJson is a convenience method for writing a value in Json with a given Content-Type. -// It uses the standard encoding/json package for marshalling the value ; not using a registered EntityReaderWriter. -func (r *Response) WriteJson(value interface{}, contentType string) error { - return writeJSON(r, http.StatusOK, contentType, value) -} - -// WriteHeaderAndJson is a convenience method for writing the status and a value in Json with a given Content-Type. -// It uses the standard encoding/json package for marshalling the value ; not using a registered EntityReaderWriter. -func (r *Response) WriteHeaderAndJson(status int, value interface{}, contentType string) error { - return writeJSON(r, status, contentType, value) -} - -// WriteError write the http status and the error string on the response. -func (r *Response) WriteError(httpStatus int, err error) error { - r.err = err - return r.WriteErrorString(httpStatus, err.Error()) -} - -// WriteServiceError is a convenience method for a responding with a status and a ServiceError -func (r *Response) WriteServiceError(httpStatus int, err ServiceError) error { - r.err = err - return r.WriteHeaderAndEntity(httpStatus, err) -} - -// WriteErrorString is a convenience method for an error status with the actual error -func (r *Response) WriteErrorString(httpStatus int, errorReason string) error { - if r.err == nil { - // if not called from WriteError - r.err = errors.New(errorReason) - } - r.WriteHeader(httpStatus) - if _, err := r.Write([]byte(errorReason)); err != nil { - return err - } - return nil -} - -// Flush implements http.Flusher interface, which sends any buffered data to the client. -func (r *Response) Flush() { - if f, ok := r.ResponseWriter.(http.Flusher); ok { - f.Flush() - } else if trace { - traceLogger.Printf("ResponseWriter %v doesn't support Flush", r) - } -} - -// WriteHeader is overridden to remember the Status Code that has been written. -// Changes to the Header of the response have no effect after this. -func (r *Response) WriteHeader(httpStatus int) { - r.statusCode = httpStatus - r.ResponseWriter.WriteHeader(httpStatus) -} - -// StatusCode returns the code that has been written using WriteHeader. -func (r Response) StatusCode() int { - if 0 == r.statusCode { - // no status code has been written yet; assume OK - return http.StatusOK - } - return r.statusCode -} - -// Write writes the data to the connection as part of an HTTP reply. -// Write is part of http.ResponseWriter interface. -func (r *Response) Write(bytes []byte) (int, error) { - written, err := r.ResponseWriter.Write(bytes) - r.contentLength += written - return written, err -} - -// ContentLength returns the number of bytes written for the response content. -// Note that this value is only correct if all data is written through the Response using its Write* methods. -// Data written directly using the underlying http.ResponseWriter is not accounted for. -func (r Response) ContentLength() int { - return r.contentLength -} - -// CloseNotify is part of http.CloseNotifier interface -func (r Response) CloseNotify() <-chan bool { - return r.ResponseWriter.(http.CloseNotifier).CloseNotify() -} - -// Error returns the err created by WriteError -func (r Response) Error() error { - return r.err -} diff --git a/vendor/github.com/emicklei/go-restful/response_test.go b/vendor/github.com/emicklei/go-restful/response_test.go deleted file mode 100644 index 832bc9ef..00000000 --- a/vendor/github.com/emicklei/go-restful/response_test.go +++ /dev/null @@ -1,213 +0,0 @@ -package restful - -import ( - "errors" - "net/http" - "net/http/httptest" - "strings" - "testing" -) - -func TestWriteHeader(t *testing.T) { - httpWriter := httptest.NewRecorder() - resp := Response{ResponseWriter: httpWriter, requestAccept: "*/*", routeProduces: []string{"*/*"}, prettyPrint: true} - resp.WriteHeader(123) - if resp.StatusCode() != 123 { - t.Errorf("Unexpected status code:%d", resp.StatusCode()) - } -} - -func TestNoWriteHeader(t *testing.T) { - httpWriter := httptest.NewRecorder() - resp := Response{ResponseWriter: httpWriter, requestAccept: "*/*", routeProduces: []string{"*/*"}, prettyPrint: true} - if resp.StatusCode() != http.StatusOK { - t.Errorf("Unexpected status code:%d", resp.StatusCode()) - } -} - -type food struct { - Kind string -} - -// go test -v -test.run TestMeasureContentLengthXml ...restful -func TestMeasureContentLengthXml(t *testing.T) { - httpWriter := httptest.NewRecorder() - resp := Response{ResponseWriter: httpWriter, requestAccept: "*/*", routeProduces: []string{"*/*"}, prettyPrint: true} - resp.WriteAsXml(food{"apple"}) - if resp.ContentLength() != 76 { - t.Errorf("Incorrect measured length:%d", resp.ContentLength()) - } -} - -// go test -v -test.run TestMeasureContentLengthJson ...restful -func TestMeasureContentLengthJson(t *testing.T) { - httpWriter := httptest.NewRecorder() - resp := Response{ResponseWriter: httpWriter, requestAccept: "*/*", routeProduces: []string{"*/*"}, prettyPrint: true} - resp.WriteAsJson(food{"apple"}) - if resp.ContentLength() != 20 { - t.Errorf("Incorrect measured length:%d", resp.ContentLength()) - } -} - -// go test -v -test.run TestMeasureContentLengthJsonNotPretty ...restful -func TestMeasureContentLengthJsonNotPretty(t *testing.T) { - httpWriter := httptest.NewRecorder() - resp := Response{ResponseWriter: httpWriter, requestAccept: "*/*", routeProduces: []string{"*/*"}} - resp.WriteAsJson(food{"apple"}) - if resp.ContentLength() != 17 { // 16+1 using the Encoder directly yields another /n - t.Errorf("Incorrect measured length:%d", resp.ContentLength()) - } -} - -// go test -v -test.run TestMeasureContentLengthWriteErrorString ...restful -func TestMeasureContentLengthWriteErrorString(t *testing.T) { - httpWriter := httptest.NewRecorder() - resp := Response{ResponseWriter: httpWriter, requestAccept: "*/*", routeProduces: []string{"*/*"}, prettyPrint: true} - resp.WriteErrorString(404, "Invalid") - if resp.ContentLength() != len("Invalid") { - t.Errorf("Incorrect measured length:%d", resp.ContentLength()) - } -} - -// go test -v -test.run TestStatusIsPassedToResponse ...restful -func TestStatusIsPassedToResponse(t *testing.T) { - for _, each := range []struct { - write, read int - }{ - {write: 204, read: 204}, - {write: 304, read: 304}, - {write: 200, read: 200}, - {write: 400, read: 400}, - } { - httpWriter := httptest.NewRecorder() - resp := Response{ResponseWriter: httpWriter, requestAccept: "*/*", routeProduces: []string{"*/*"}, prettyPrint: true} - resp.WriteHeader(each.write) - if got, want := httpWriter.Code, each.read; got != want { - t.Errorf("got %v want %v", got, want) - } - } -} - -// go test -v -test.run TestStatusCreatedAndContentTypeJson_Issue54 ...restful -func TestStatusCreatedAndContentTypeJson_Issue54(t *testing.T) { - httpWriter := httptest.NewRecorder() - resp := Response{ResponseWriter: httpWriter, requestAccept: "application/json", routeProduces: []string{"application/json"}, prettyPrint: true} - resp.WriteHeader(201) - resp.WriteAsJson(food{"Juicy"}) - if httpWriter.HeaderMap.Get("Content-Type") != "application/json" { - t.Errorf("Expected content type json but got:%s", httpWriter.HeaderMap.Get("Content-Type")) - } - if httpWriter.Code != 201 { - t.Errorf("Expected status 201 but got:%d", httpWriter.Code) - } -} - -type errorOnWriteRecorder struct { - *httptest.ResponseRecorder -} - -func (e errorOnWriteRecorder) Write(bytes []byte) (int, error) { - return 0, errors.New("fail") -} - -// go test -v -test.run TestLastWriteErrorCaught ...restful -func TestLastWriteErrorCaught(t *testing.T) { - httpWriter := errorOnWriteRecorder{httptest.NewRecorder()} - resp := Response{ResponseWriter: httpWriter, requestAccept: "application/json", routeProduces: []string{"application/json"}, prettyPrint: true} - err := resp.WriteAsJson(food{"Juicy"}) - if err.Error() != "fail" { - t.Errorf("Unexpected error message:%v", err) - } -} - -// go test -v -test.run TestAcceptStarStar_Issue83 ...restful -func TestAcceptStarStar_Issue83(t *testing.T) { - httpWriter := httptest.NewRecorder() - // Accept Produces - resp := Response{ResponseWriter: httpWriter, requestAccept: "application/bogus,*/*;q=0.8", routeProduces: []string{"application/json"}, prettyPrint: true} - resp.WriteEntity(food{"Juicy"}) - ct := httpWriter.Header().Get("Content-Type") - if "application/json" != ct { - t.Errorf("Unexpected content type:%s", ct) - } -} - -// go test -v -test.run TestAcceptSkipStarStar_Issue83 ...restful -func TestAcceptSkipStarStar_Issue83(t *testing.T) { - httpWriter := httptest.NewRecorder() - // Accept Produces - resp := Response{ResponseWriter: httpWriter, requestAccept: " application/xml ,*/* ; q=0.8", routeProduces: []string{"application/json", "application/xml"}, prettyPrint: true} - resp.WriteEntity(food{"Juicy"}) - ct := httpWriter.Header().Get("Content-Type") - if "application/xml" != ct { - t.Errorf("Unexpected content type:%s", ct) - } -} - -// go test -v -test.run TestAcceptXmlBeforeStarStar_Issue83 ...restful -func TestAcceptXmlBeforeStarStar_Issue83(t *testing.T) { - httpWriter := httptest.NewRecorder() - // Accept Produces - resp := Response{ResponseWriter: httpWriter, requestAccept: "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", routeProduces: []string{"application/json"}, prettyPrint: true} - resp.WriteEntity(food{"Juicy"}) - ct := httpWriter.Header().Get("Content-Type") - if "application/json" != ct { - t.Errorf("Unexpected content type:%s", ct) - } -} - -// go test -v -test.run TestWriteHeaderNoContent_Issue124 ...restful -func TestWriteHeaderNoContent_Issue124(t *testing.T) { - httpWriter := httptest.NewRecorder() - resp := Response{ResponseWriter: httpWriter, requestAccept: "text/plain", routeProduces: []string{"text/plain"}, prettyPrint: true} - resp.WriteHeader(http.StatusNoContent) - if httpWriter.Code != http.StatusNoContent { - t.Errorf("got %d want %d", httpWriter.Code, http.StatusNoContent) - } -} - -// go test -v -test.run TestStatusCreatedAndContentTypeJson_Issue163 ...restful -func TestStatusCreatedAndContentTypeJson_Issue163(t *testing.T) { - httpWriter := httptest.NewRecorder() - resp := Response{ResponseWriter: httpWriter, requestAccept: "application/json", routeProduces: []string{"application/json"}, prettyPrint: true} - resp.WriteHeader(http.StatusNotModified) - if httpWriter.Code != http.StatusNotModified { - t.Errorf("Got %d want %d", httpWriter.Code, http.StatusNotModified) - } -} - -func TestWriteHeaderAndEntity_Issue235(t *testing.T) { - httpWriter := httptest.NewRecorder() - resp := Response{ResponseWriter: httpWriter, requestAccept: "application/json", routeProduces: []string{"application/json"}, prettyPrint: true} - var pong = struct { - Foo string `json:"foo"` - }{Foo: "123"} - resp.WriteHeaderAndEntity(404, pong) - if httpWriter.Code != http.StatusNotFound { - t.Errorf("got %d want %d", httpWriter.Code, http.StatusNoContent) - } - if got, want := httpWriter.Header().Get("Content-Type"), "application/json"; got != want { - t.Errorf("got %v want %v", got, want) - } - if !strings.HasPrefix(httpWriter.Body.String(), "{") { - t.Errorf("expected pong struct in json:%s", httpWriter.Body.String()) - } -} - -func TestWriteEntityNoAcceptMatchWithProduces(t *testing.T) { - httpWriter := httptest.NewRecorder() - resp := Response{ResponseWriter: httpWriter, requestAccept: "application/bogus", routeProduces: []string{"application/json"}, prettyPrint: true} - resp.WriteEntity("done") - if httpWriter.Code != http.StatusOK { - t.Errorf("got %d want %d", httpWriter.Code, http.StatusOK) - } -} - -func TestWriteEntityNoAcceptMatchNoProduces(t *testing.T) { - httpWriter := httptest.NewRecorder() - resp := Response{ResponseWriter: httpWriter, requestAccept: "application/bogus", routeProduces: []string{}, prettyPrint: true} - resp.WriteEntity("done") - if httpWriter.Code != http.StatusNotAcceptable { - t.Errorf("got %d want %d", httpWriter.Code, http.StatusNotAcceptable) - } -} diff --git a/vendor/github.com/emicklei/go-restful/route.go b/vendor/github.com/emicklei/go-restful/route.go deleted file mode 100644 index f72bf985..00000000 --- a/vendor/github.com/emicklei/go-restful/route.go +++ /dev/null @@ -1,149 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "net/http" - "strings" -) - -// RouteFunction declares the signature of a function that can be bound to a Route. -type RouteFunction func(*Request, *Response) - -// RouteSelectionConditionFunction declares the signature of a function that -// can be used to add extra conditional logic when selecting whether the route -// matches the HTTP request. -type RouteSelectionConditionFunction func(httpRequest *http.Request) bool - -// Route binds a HTTP Method,Path,Consumes combination to a RouteFunction. -type Route struct { - Method string - Produces []string - Consumes []string - Path string // webservice root path + described path - Function RouteFunction - Filters []FilterFunction - If []RouteSelectionConditionFunction - - // cached values for dispatching - relativePath string - pathParts []string - pathExpr *pathExpression // cached compilation of relativePath as RegExp - - // documentation - Doc string - Notes string - Operation string - ParameterDocs []*Parameter - ResponseErrors map[int]ResponseError - ReadSample, WriteSample interface{} // structs that model an example request or response payload - - // Extra information used to store custom information about the route. - Metadata map[string]interface{} - - // marks a route as deprecated - Deprecated bool -} - -// Initialize for Route -func (r *Route) postBuild() { - r.pathParts = tokenizePath(r.Path) -} - -// Create Request and Response from their http versions -func (r *Route) wrapRequestResponse(httpWriter http.ResponseWriter, httpRequest *http.Request, pathParams map[string]string) (*Request, *Response) { - wrappedRequest := NewRequest(httpRequest) - wrappedRequest.pathParameters = pathParams - wrappedRequest.selectedRoutePath = r.Path - wrappedResponse := NewResponse(httpWriter) - wrappedResponse.requestAccept = httpRequest.Header.Get(HEADER_Accept) - wrappedResponse.routeProduces = r.Produces - return wrappedRequest, wrappedResponse -} - -// dispatchWithFilters call the function after passing through its own filters -func (r *Route) dispatchWithFilters(wrappedRequest *Request, wrappedResponse *Response) { - if len(r.Filters) > 0 { - chain := FilterChain{Filters: r.Filters, Target: r.Function} - chain.ProcessFilter(wrappedRequest, wrappedResponse) - } else { - // unfiltered - r.Function(wrappedRequest, wrappedResponse) - } -} - -// Return whether the mimeType matches to what this Route can produce. -func (r Route) matchesAccept(mimeTypesWithQuality string) bool { - parts := strings.Split(mimeTypesWithQuality, ",") - for _, each := range parts { - var withoutQuality string - if strings.Contains(each, ";") { - withoutQuality = strings.Split(each, ";")[0] - } else { - withoutQuality = each - } - // trim before compare - withoutQuality = strings.Trim(withoutQuality, " ") - if withoutQuality == "*/*" { - return true - } - for _, producibleType := range r.Produces { - if producibleType == "*/*" || producibleType == withoutQuality { - return true - } - } - } - return false -} - -// Return whether this Route can consume content with a type specified by mimeTypes (can be empty). -func (r Route) matchesContentType(mimeTypes string) bool { - - if len(r.Consumes) == 0 { - // did not specify what it can consume ; any media type (“*/*”) is assumed - return true - } - - if len(mimeTypes) == 0 { - // idempotent methods with (most-likely or guaranteed) empty content match missing Content-Type - m := r.Method - if m == "GET" || m == "HEAD" || m == "OPTIONS" || m == "DELETE" || m == "TRACE" { - return true - } - // proceed with default - mimeTypes = MIME_OCTET - } - - parts := strings.Split(mimeTypes, ",") - for _, each := range parts { - var contentType string - if strings.Contains(each, ";") { - contentType = strings.Split(each, ";")[0] - } else { - contentType = each - } - // trim before compare - contentType = strings.Trim(contentType, " ") - for _, consumeableType := range r.Consumes { - if consumeableType == "*/*" || consumeableType == contentType { - return true - } - } - } - return false -} - -// Tokenize an URL path using the slash separator ; the result does not have empty tokens -func tokenizePath(path string) []string { - if "/" == path { - return []string{} - } - return strings.Split(strings.Trim(path, "/"), "/") -} - -// for debugging -func (r Route) String() string { - return r.Method + " " + r.Path -} diff --git a/vendor/github.com/emicklei/go-restful/route_builder.go b/vendor/github.com/emicklei/go-restful/route_builder.go deleted file mode 100644 index 4ebecbd8..00000000 --- a/vendor/github.com/emicklei/go-restful/route_builder.go +++ /dev/null @@ -1,321 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "fmt" - "os" - "reflect" - "runtime" - "strings" - "sync/atomic" - - "github.com/emicklei/go-restful/log" -) - -// RouteBuilder is a helper to construct Routes. -type RouteBuilder struct { - rootPath string - currentPath string - produces []string - consumes []string - httpMethod string // required - function RouteFunction // required - filters []FilterFunction - conditions []RouteSelectionConditionFunction - - typeNameHandleFunc TypeNameHandleFunction // required - - // documentation - doc string - notes string - operation string - readSample, writeSample interface{} - parameters []*Parameter - errorMap map[int]ResponseError - metadata map[string]interface{} - deprecated bool -} - -// Do evaluates each argument with the RouteBuilder itself. -// This allows you to follow DRY principles without breaking the fluent programming style. -// Example: -// ws.Route(ws.DELETE("/{name}").To(t.deletePerson).Do(Returns200, Returns500)) -// -// func Returns500(b *RouteBuilder) { -// b.Returns(500, "Internal Server Error", restful.ServiceError{}) -// } -func (b *RouteBuilder) Do(oneArgBlocks ...func(*RouteBuilder)) *RouteBuilder { - for _, each := range oneArgBlocks { - each(b) - } - return b -} - -// To bind the route to a function. -// If this route is matched with the incoming Http Request then call this function with the *Request,*Response pair. Required. -func (b *RouteBuilder) To(function RouteFunction) *RouteBuilder { - b.function = function - return b -} - -// Method specifies what HTTP method to match. Required. -func (b *RouteBuilder) Method(method string) *RouteBuilder { - b.httpMethod = method - return b -} - -// Produces specifies what MIME types can be produced ; the matched one will appear in the Content-Type Http header. -func (b *RouteBuilder) Produces(mimeTypes ...string) *RouteBuilder { - b.produces = mimeTypes - return b -} - -// Consumes specifies what MIME types can be consumes ; the Accept Http header must matched any of these -func (b *RouteBuilder) Consumes(mimeTypes ...string) *RouteBuilder { - b.consumes = mimeTypes - return b -} - -// Path specifies the relative (w.r.t WebService root path) URL path to match. Default is "/". -func (b *RouteBuilder) Path(subPath string) *RouteBuilder { - b.currentPath = subPath - return b -} - -// Doc tells what this route is all about. Optional. -func (b *RouteBuilder) Doc(documentation string) *RouteBuilder { - b.doc = documentation - return b -} - -// Notes is a verbose explanation of the operation behavior. Optional. -func (b *RouteBuilder) Notes(notes string) *RouteBuilder { - b.notes = notes - return b -} - -// Reads tells what resource type will be read from the request payload. Optional. -// A parameter of type "body" is added ,required is set to true and the dataType is set to the qualified name of the sample's type. -func (b *RouteBuilder) Reads(sample interface{}, optionalDescription ...string) *RouteBuilder { - fn := b.typeNameHandleFunc - if fn == nil { - fn = reflectTypeName - } - typeAsName := fn(sample) - description := "" - if len(optionalDescription) > 0 { - description = optionalDescription[0] - } - b.readSample = sample - bodyParameter := &Parameter{&ParameterData{Name: "body", Description: description}} - bodyParameter.beBody() - bodyParameter.Required(true) - bodyParameter.DataType(typeAsName) - b.Param(bodyParameter) - return b -} - -// ParameterNamed returns a Parameter already known to the RouteBuilder. Returns nil if not. -// Use this to modify or extend information for the Parameter (through its Data()). -func (b RouteBuilder) ParameterNamed(name string) (p *Parameter) { - for _, each := range b.parameters { - if each.Data().Name == name { - return each - } - } - return p -} - -// Writes tells what resource type will be written as the response payload. Optional. -func (b *RouteBuilder) Writes(sample interface{}) *RouteBuilder { - b.writeSample = sample - return b -} - -// Param allows you to document the parameters of the Route. It adds a new Parameter (does not check for duplicates). -func (b *RouteBuilder) Param(parameter *Parameter) *RouteBuilder { - if b.parameters == nil { - b.parameters = []*Parameter{} - } - b.parameters = append(b.parameters, parameter) - return b -} - -// Operation allows you to document what the actual method/function call is of the Route. -// Unless called, the operation name is derived from the RouteFunction set using To(..). -func (b *RouteBuilder) Operation(name string) *RouteBuilder { - b.operation = name - return b -} - -// ReturnsError is deprecated, use Returns instead. -func (b *RouteBuilder) ReturnsError(code int, message string, model interface{}) *RouteBuilder { - log.Print("ReturnsError is deprecated, use Returns instead.") - return b.Returns(code, message, model) -} - -// Returns allows you to document what responses (errors or regular) can be expected. -// The model parameter is optional ; either pass a struct instance or use nil if not applicable. -func (b *RouteBuilder) Returns(code int, message string, model interface{}) *RouteBuilder { - err := ResponseError{ - Code: code, - Message: message, - Model: model, - IsDefault: false, - } - // lazy init because there is no NewRouteBuilder (yet) - if b.errorMap == nil { - b.errorMap = map[int]ResponseError{} - } - b.errorMap[code] = err - return b -} - -// DefaultReturns is a special Returns call that sets the default of the response ; the code is zero. -func (b *RouteBuilder) DefaultReturns(message string, model interface{}) *RouteBuilder { - b.Returns(0, message, model) - // Modify the ResponseError just added/updated - re := b.errorMap[0] - // errorMap is initialized - b.errorMap[0] = ResponseError{ - Code: re.Code, - Message: re.Message, - Model: re.Model, - IsDefault: true, - } - return b -} - -// Metadata adds or updates a key=value pair to the metadata map. -func (b *RouteBuilder) Metadata(key string, value interface{}) *RouteBuilder { - if b.metadata == nil { - b.metadata = map[string]interface{}{} - } - b.metadata[key] = value - return b -} - -// Deprecate sets the value of deprecated to true. Deprecated routes have a special UI treatment to warn against use -func (b *RouteBuilder) Deprecate() *RouteBuilder { - b.deprecated = true - return b -} - -// ResponseError represents a response; not necessarily an error. -type ResponseError struct { - Code int - Message string - Model interface{} - IsDefault bool -} - -func (b *RouteBuilder) servicePath(path string) *RouteBuilder { - b.rootPath = path - return b -} - -// Filter appends a FilterFunction to the end of filters for this Route to build. -func (b *RouteBuilder) Filter(filter FilterFunction) *RouteBuilder { - b.filters = append(b.filters, filter) - return b -} - -// If sets a condition function that controls matching the Route based on custom logic. -// The condition function is provided the HTTP request and should return true if the route -// should be considered. -// -// Efficiency note: the condition function is called before checking the method, produces, and -// consumes criteria, so that the correct HTTP status code can be returned. -// -// Lifecycle note: no filter functions have been called prior to calling the condition function, -// so the condition function should not depend on any context that might be set up by container -// or route filters. -func (b *RouteBuilder) If(condition RouteSelectionConditionFunction) *RouteBuilder { - b.conditions = append(b.conditions, condition) - return b -} - -// If no specific Route path then set to rootPath -// If no specific Produces then set to rootProduces -// If no specific Consumes then set to rootConsumes -func (b *RouteBuilder) copyDefaults(rootProduces, rootConsumes []string) { - if len(b.produces) == 0 { - b.produces = rootProduces - } - if len(b.consumes) == 0 { - b.consumes = rootConsumes - } -} - -// typeNameHandler sets the function that will convert types to strings in the parameter -// and model definitions. -func (b *RouteBuilder) typeNameHandler(handler TypeNameHandleFunction) *RouteBuilder { - b.typeNameHandleFunc = handler - return b -} - -// Build creates a new Route using the specification details collected by the RouteBuilder -func (b *RouteBuilder) Build() Route { - pathExpr, err := newPathExpression(b.currentPath) - if err != nil { - log.Printf("[restful] Invalid path:%s because:%v", b.currentPath, err) - os.Exit(1) - } - if b.function == nil { - log.Printf("[restful] No function specified for route:" + b.currentPath) - os.Exit(1) - } - operationName := b.operation - if len(operationName) == 0 && b.function != nil { - // extract from definition - operationName = nameOfFunction(b.function) - } - route := Route{ - Method: b.httpMethod, - Path: concatPath(b.rootPath, b.currentPath), - Produces: b.produces, - Consumes: b.consumes, - Function: b.function, - Filters: b.filters, - If: b.conditions, - relativePath: b.currentPath, - pathExpr: pathExpr, - Doc: b.doc, - Notes: b.notes, - Operation: operationName, - ParameterDocs: b.parameters, - ResponseErrors: b.errorMap, - ReadSample: b.readSample, - WriteSample: b.writeSample, - Metadata: b.metadata, - Deprecated: b.deprecated} - route.postBuild() - return route -} - -func concatPath(path1, path2 string) string { - return strings.TrimRight(path1, "/") + "/" + strings.TrimLeft(path2, "/") -} - -var anonymousFuncCount int32 - -// nameOfFunction returns the short name of the function f for documentation. -// It uses a runtime feature for debugging ; its value may change for later Go versions. -func nameOfFunction(f interface{}) string { - fun := runtime.FuncForPC(reflect.ValueOf(f).Pointer()) - tokenized := strings.Split(fun.Name(), ".") - last := tokenized[len(tokenized)-1] - last = strings.TrimSuffix(last, ")·fm") // < Go 1.5 - last = strings.TrimSuffix(last, ")-fm") // Go 1.5 - last = strings.TrimSuffix(last, "·fm") // < Go 1.5 - last = strings.TrimSuffix(last, "-fm") // Go 1.5 - if last == "func1" { // this could mean conflicts in API docs - val := atomic.AddInt32(&anonymousFuncCount, 1) - last = "func" + fmt.Sprintf("%d", val) - atomic.StoreInt32(&anonymousFuncCount, val) - } - return last -} diff --git a/vendor/github.com/emicklei/go-restful/route_builder_test.go b/vendor/github.com/emicklei/go-restful/route_builder_test.go deleted file mode 100644 index 25881d5e..00000000 --- a/vendor/github.com/emicklei/go-restful/route_builder_test.go +++ /dev/null @@ -1,76 +0,0 @@ -package restful - -import ( - "testing" - "time" -) - -func TestRouteBuilder_PathParameter(t *testing.T) { - p := &Parameter{&ParameterData{Name: "name", Description: "desc"}} - p.AllowMultiple(true) - p.DataType("int") - p.Required(true) - values := map[string]string{"a": "b"} - p.AllowableValues(values) - p.bePath() - - b := new(RouteBuilder) - b.function = dummy - b.Param(p) - r := b.Build() - if !r.ParameterDocs[0].Data().AllowMultiple { - t.Error("AllowMultiple invalid") - } - if r.ParameterDocs[0].Data().DataType != "int" { - t.Error("dataType invalid") - } - if !r.ParameterDocs[0].Data().Required { - t.Error("required invalid") - } - if r.ParameterDocs[0].Data().Kind != PathParameterKind { - t.Error("kind invalid") - } - if r.ParameterDocs[0].Data().AllowableValues["a"] != "b" { - t.Error("allowableValues invalid") - } - if b.ParameterNamed("name") == nil { - t.Error("access to parameter failed") - } -} - -func TestRouteBuilder(t *testing.T) { - json := "application/json" - b := new(RouteBuilder) - b.To(dummy) - b.Path("/routes").Method("HEAD").Consumes(json).Produces(json).Metadata("test", "test-value").DefaultReturns("default", time.Now()) - r := b.Build() - if r.Path != "/routes" { - t.Error("path invalid") - } - if r.Produces[0] != json { - t.Error("produces invalid") - } - if r.Consumes[0] != json { - t.Error("consumes invalid") - } - if r.Operation != "dummy" { - t.Error("Operation not set") - } - if r.Metadata["test"] != "test-value" { - t.Errorf("Metadata not set") - } - if _, ok := r.ResponseErrors[0]; !ok { - t.Fatal("expected default response") - } -} - -func TestAnonymousFuncNaming(t *testing.T) { - f1 := func() {} - f2 := func() {} - if got, want := nameOfFunction(f1), "func1"; got != want { - t.Errorf("got %v want %v", got, want) - } - if got, want := nameOfFunction(f2), "func2"; got != want { - t.Errorf("got %v want %v", got, want) - } -} diff --git a/vendor/github.com/emicklei/go-restful/route_test.go b/vendor/github.com/emicklei/go-restful/route_test.go deleted file mode 100644 index a687d8a4..00000000 --- a/vendor/github.com/emicklei/go-restful/route_test.go +++ /dev/null @@ -1,76 +0,0 @@ -package restful - -import ( - "testing" -) - -// accept should match produces -func TestMatchesAcceptPlainTextWhenProducePlainTextAsLast(t *testing.T) { - r := Route{Produces: []string{"application/json", "text/plain"}} - if !r.matchesAccept("text/plain") { - t.Errorf("accept should match text/plain") - } -} - -// accept should match produces -func TestMatchesAcceptStar(t *testing.T) { - r := Route{Produces: []string{"application/xml"}} - if !r.matchesAccept("*/*") { - t.Errorf("accept should match star") - } -} - -// accept should match produces -func TestMatchesAcceptIE(t *testing.T) { - r := Route{Produces: []string{"application/xml"}} - if !r.matchesAccept("text/html, application/xhtml+xml, */*") { - t.Errorf("accept should match star") - } -} - -// accept should match produces -func TestMatchesAcceptXml(t *testing.T) { - r := Route{Produces: []string{"application/xml"}} - if r.matchesAccept("application/json") { - t.Errorf("accept should not match json") - } - if !r.matchesAccept("application/xml") { - t.Errorf("accept should match xml") - } -} - -// accept should match produces -func TestMatchesAcceptAny(t *testing.T) { - r := Route{Produces: []string{"*/*"}} - if !r.matchesAccept("application/json") { - t.Errorf("accept should match json") - } - if !r.matchesAccept("application/xml") { - t.Errorf("accept should match xml") - } -} - -// content type should match consumes -func TestMatchesContentTypeXml(t *testing.T) { - r := Route{Consumes: []string{"application/xml"}} - if r.matchesContentType("application/json") { - t.Errorf("accept should not match json") - } - if !r.matchesContentType("application/xml") { - t.Errorf("accept should match xml") - } -} - -// content type should match consumes -func TestMatchesContentTypeCharsetInformation(t *testing.T) { - r := Route{Consumes: []string{"application/json"}} - if !r.matchesContentType("application/json; charset=UTF-8") { - t.Errorf("matchesContentType should ignore charset information") - } -} - -func TestTokenizePath(t *testing.T) { - if len(tokenizePath("/")) != 0 { - t.Errorf("not empty path tokens") - } -} diff --git a/vendor/github.com/emicklei/go-restful/router.go b/vendor/github.com/emicklei/go-restful/router.go deleted file mode 100644 index 19078af1..00000000 --- a/vendor/github.com/emicklei/go-restful/router.go +++ /dev/null @@ -1,20 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import "net/http" - -// A RouteSelector finds the best matching Route given the input HTTP Request -// RouteSelectors can optionally also implement the PathProcessor interface to also calculate the -// path parameters after the route has been selected. -type RouteSelector interface { - - // SelectRoute finds a Route given the input HTTP Request and a list of WebServices. - // It returns a selected Route and its containing WebService or an error indicating - // a problem. - SelectRoute( - webServices []*WebService, - httpRequest *http.Request) (selectedService *WebService, selected *Route, err error) -} diff --git a/vendor/github.com/emicklei/go-restful/service_error.go b/vendor/github.com/emicklei/go-restful/service_error.go deleted file mode 100644 index 62d1108b..00000000 --- a/vendor/github.com/emicklei/go-restful/service_error.go +++ /dev/null @@ -1,23 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import "fmt" - -// ServiceError is a transport object to pass information about a non-Http error occurred in a WebService while processing a request. -type ServiceError struct { - Code int - Message string -} - -// NewError returns a ServiceError using the code and reason -func NewError(code int, message string) ServiceError { - return ServiceError{Code: code, Message: message} -} - -// Error returns a text representation of the service error -func (s ServiceError) Error() string { - return fmt.Sprintf("[ServiceError:%v] %v", s.Code, s.Message) -} diff --git a/vendor/github.com/emicklei/go-restful/tracer_test.go b/vendor/github.com/emicklei/go-restful/tracer_test.go deleted file mode 100644 index 60c1e9fc..00000000 --- a/vendor/github.com/emicklei/go-restful/tracer_test.go +++ /dev/null @@ -1,18 +0,0 @@ -package restful - -import "testing" - -// Use like this: -// -// TraceLogger(testLogger{t}) -type testLogger struct { - t *testing.T -} - -func (l testLogger) Print(v ...interface{}) { - l.t.Log(v...) -} - -func (l testLogger) Printf(format string, v ...interface{}) { - l.t.Logf(format, v...) -} diff --git a/vendor/github.com/emicklei/go-restful/web_service.go b/vendor/github.com/emicklei/go-restful/web_service.go deleted file mode 100644 index f7e18a58..00000000 --- a/vendor/github.com/emicklei/go-restful/web_service.go +++ /dev/null @@ -1,290 +0,0 @@ -package restful - -import ( - "errors" - "os" - "reflect" - "sync" - - "github.com/emicklei/go-restful/log" -) - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -// WebService holds a collection of Route values that bind a Http Method + URL Path to a function. -type WebService struct { - rootPath string - pathExpr *pathExpression // cached compilation of rootPath as RegExp - routes []Route - produces []string - consumes []string - pathParameters []*Parameter - filters []FilterFunction - documentation string - apiVersion string - - typeNameHandleFunc TypeNameHandleFunction - - dynamicRoutes bool - - // protects 'routes' if dynamic routes are enabled - routesLock sync.RWMutex -} - -func (w *WebService) SetDynamicRoutes(enable bool) { - w.dynamicRoutes = enable -} - -// TypeNameHandleFunction declares functions that can handle translating the name of a sample object -// into the restful documentation for the service. -type TypeNameHandleFunction func(sample interface{}) string - -// TypeNameHandler sets the function that will convert types to strings in the parameter -// and model definitions. If not set, the web service will invoke -// reflect.TypeOf(object).String(). -func (w *WebService) TypeNameHandler(handler TypeNameHandleFunction) *WebService { - w.typeNameHandleFunc = handler - return w -} - -// reflectTypeName is the default TypeNameHandleFunction and for a given object -// returns the name that Go identifies it with (e.g. "string" or "v1.Object") via -// the reflection API. -func reflectTypeName(sample interface{}) string { - return reflect.TypeOf(sample).String() -} - -// compilePathExpression ensures that the path is compiled into a RegEx for those routers that need it. -func (w *WebService) compilePathExpression() { - compiled, err := newPathExpression(w.rootPath) - if err != nil { - log.Printf("[restful] invalid path:%s because:%v", w.rootPath, err) - os.Exit(1) - } - w.pathExpr = compiled -} - -// ApiVersion sets the API version for documentation purposes. -func (w *WebService) ApiVersion(apiVersion string) *WebService { - w.apiVersion = apiVersion - return w -} - -// Version returns the API version for documentation purposes. -func (w *WebService) Version() string { return w.apiVersion } - -// Path specifies the root URL template path of the WebService. -// All Routes will be relative to this path. -func (w *WebService) Path(root string) *WebService { - w.rootPath = root - if len(w.rootPath) == 0 { - w.rootPath = "/" - } - w.compilePathExpression() - return w -} - -// Param adds a PathParameter to document parameters used in the root path. -func (w *WebService) Param(parameter *Parameter) *WebService { - if w.pathParameters == nil { - w.pathParameters = []*Parameter{} - } - w.pathParameters = append(w.pathParameters, parameter) - return w -} - -// PathParameter creates a new Parameter of kind Path for documentation purposes. -// It is initialized as required with string as its DataType. -func (w *WebService) PathParameter(name, description string) *Parameter { - return PathParameter(name, description) -} - -// PathParameter creates a new Parameter of kind Path for documentation purposes. -// It is initialized as required with string as its DataType. -func PathParameter(name, description string) *Parameter { - p := &Parameter{&ParameterData{Name: name, Description: description, Required: true, DataType: "string"}} - p.bePath() - return p -} - -// QueryParameter creates a new Parameter of kind Query for documentation purposes. -// It is initialized as not required with string as its DataType. -func (w *WebService) QueryParameter(name, description string) *Parameter { - return QueryParameter(name, description) -} - -// QueryParameter creates a new Parameter of kind Query for documentation purposes. -// It is initialized as not required with string as its DataType. -func QueryParameter(name, description string) *Parameter { - p := &Parameter{&ParameterData{Name: name, Description: description, Required: false, DataType: "string", CollectionFormat: CollectionFormatCSV.String()}} - p.beQuery() - return p -} - -// BodyParameter creates a new Parameter of kind Body for documentation purposes. -// It is initialized as required without a DataType. -func (w *WebService) BodyParameter(name, description string) *Parameter { - return BodyParameter(name, description) -} - -// BodyParameter creates a new Parameter of kind Body for documentation purposes. -// It is initialized as required without a DataType. -func BodyParameter(name, description string) *Parameter { - p := &Parameter{&ParameterData{Name: name, Description: description, Required: true}} - p.beBody() - return p -} - -// HeaderParameter creates a new Parameter of kind (Http) Header for documentation purposes. -// It is initialized as not required with string as its DataType. -func (w *WebService) HeaderParameter(name, description string) *Parameter { - return HeaderParameter(name, description) -} - -// HeaderParameter creates a new Parameter of kind (Http) Header for documentation purposes. -// It is initialized as not required with string as its DataType. -func HeaderParameter(name, description string) *Parameter { - p := &Parameter{&ParameterData{Name: name, Description: description, Required: false, DataType: "string"}} - p.beHeader() - return p -} - -// FormParameter creates a new Parameter of kind Form (using application/x-www-form-urlencoded) for documentation purposes. -// It is initialized as required with string as its DataType. -func (w *WebService) FormParameter(name, description string) *Parameter { - return FormParameter(name, description) -} - -// FormParameter creates a new Parameter of kind Form (using application/x-www-form-urlencoded) for documentation purposes. -// It is initialized as required with string as its DataType. -func FormParameter(name, description string) *Parameter { - p := &Parameter{&ParameterData{Name: name, Description: description, Required: false, DataType: "string"}} - p.beForm() - return p -} - -// Route creates a new Route using the RouteBuilder and add to the ordered list of Routes. -func (w *WebService) Route(builder *RouteBuilder) *WebService { - w.routesLock.Lock() - defer w.routesLock.Unlock() - builder.copyDefaults(w.produces, w.consumes) - w.routes = append(w.routes, builder.Build()) - return w -} - -// RemoveRoute removes the specified route, looks for something that matches 'path' and 'method' -func (w *WebService) RemoveRoute(path, method string) error { - if !w.dynamicRoutes { - return errors.New("dynamic routes are not enabled.") - } - w.routesLock.Lock() - defer w.routesLock.Unlock() - newRoutes := make([]Route, (len(w.routes) - 1)) - current := 0 - for ix := range w.routes { - if w.routes[ix].Method == method && w.routes[ix].Path == path { - continue - } - newRoutes[current] = w.routes[ix] - current = current + 1 - } - w.routes = newRoutes - return nil -} - -// Method creates a new RouteBuilder and initialize its http method -func (w *WebService) Method(httpMethod string) *RouteBuilder { - return new(RouteBuilder).typeNameHandler(w.typeNameHandleFunc).servicePath(w.rootPath).Method(httpMethod) -} - -// Produces specifies that this WebService can produce one or more MIME types. -// Http requests must have one of these values set for the Accept header. -func (w *WebService) Produces(contentTypes ...string) *WebService { - w.produces = contentTypes - return w -} - -// Consumes specifies that this WebService can consume one or more MIME types. -// Http requests must have one of these values set for the Content-Type header. -func (w *WebService) Consumes(accepts ...string) *WebService { - w.consumes = accepts - return w -} - -// Routes returns the Routes associated with this WebService -func (w *WebService) Routes() []Route { - if !w.dynamicRoutes { - return w.routes - } - // Make a copy of the array to prevent concurrency problems - w.routesLock.RLock() - defer w.routesLock.RUnlock() - result := make([]Route, len(w.routes)) - for ix := range w.routes { - result[ix] = w.routes[ix] - } - return result -} - -// RootPath returns the RootPath associated with this WebService. Default "/" -func (w *WebService) RootPath() string { - return w.rootPath -} - -// PathParameters return the path parameter names for (shared among its Routes) -func (w *WebService) PathParameters() []*Parameter { - return w.pathParameters -} - -// Filter adds a filter function to the chain of filters applicable to all its Routes -func (w *WebService) Filter(filter FilterFunction) *WebService { - w.filters = append(w.filters, filter) - return w -} - -// Doc is used to set the documentation of this service. -func (w *WebService) Doc(plainText string) *WebService { - w.documentation = plainText - return w -} - -// Documentation returns it. -func (w *WebService) Documentation() string { - return w.documentation -} - -/* - Convenience methods -*/ - -// HEAD is a shortcut for .Method("HEAD").Path(subPath) -func (w *WebService) HEAD(subPath string) *RouteBuilder { - return new(RouteBuilder).typeNameHandler(w.typeNameHandleFunc).servicePath(w.rootPath).Method("HEAD").Path(subPath) -} - -// GET is a shortcut for .Method("GET").Path(subPath) -func (w *WebService) GET(subPath string) *RouteBuilder { - return new(RouteBuilder).typeNameHandler(w.typeNameHandleFunc).servicePath(w.rootPath).Method("GET").Path(subPath) -} - -// POST is a shortcut for .Method("POST").Path(subPath) -func (w *WebService) POST(subPath string) *RouteBuilder { - return new(RouteBuilder).typeNameHandler(w.typeNameHandleFunc).servicePath(w.rootPath).Method("POST").Path(subPath) -} - -// PUT is a shortcut for .Method("PUT").Path(subPath) -func (w *WebService) PUT(subPath string) *RouteBuilder { - return new(RouteBuilder).typeNameHandler(w.typeNameHandleFunc).servicePath(w.rootPath).Method("PUT").Path(subPath) -} - -// PATCH is a shortcut for .Method("PATCH").Path(subPath) -func (w *WebService) PATCH(subPath string) *RouteBuilder { - return new(RouteBuilder).typeNameHandler(w.typeNameHandleFunc).servicePath(w.rootPath).Method("PATCH").Path(subPath) -} - -// DELETE is a shortcut for .Method("DELETE").Path(subPath) -func (w *WebService) DELETE(subPath string) *RouteBuilder { - return new(RouteBuilder).typeNameHandler(w.typeNameHandleFunc).servicePath(w.rootPath).Method("DELETE").Path(subPath) -} diff --git a/vendor/github.com/emicklei/go-restful/web_service_container.go b/vendor/github.com/emicklei/go-restful/web_service_container.go deleted file mode 100644 index c9d31b06..00000000 --- a/vendor/github.com/emicklei/go-restful/web_service_container.go +++ /dev/null @@ -1,39 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "net/http" -) - -// DefaultContainer is a restful.Container that uses http.DefaultServeMux -var DefaultContainer *Container - -func init() { - DefaultContainer = NewContainer() - DefaultContainer.ServeMux = http.DefaultServeMux -} - -// If set the true then panics will not be caught to return HTTP 500. -// In that case, Route functions are responsible for handling any error situation. -// Default value is false = recover from panics. This has performance implications. -// OBSOLETE ; use restful.DefaultContainer.DoNotRecover(true) -var DoNotRecover = false - -// Add registers a new WebService add it to the DefaultContainer. -func Add(service *WebService) { - DefaultContainer.Add(service) -} - -// Filter appends a container FilterFunction from the DefaultContainer. -// These are called before dispatching a http.Request to a WebService. -func Filter(filter FilterFunction) { - DefaultContainer.Filter(filter) -} - -// RegisteredWebServices returns the collections of WebServices from the DefaultContainer -func RegisteredWebServices() []*WebService { - return DefaultContainer.RegisteredWebServices() -} diff --git a/vendor/github.com/emicklei/go-restful/web_service_test.go b/vendor/github.com/emicklei/go-restful/web_service_test.go deleted file mode 100644 index c1b756a9..00000000 --- a/vendor/github.com/emicklei/go-restful/web_service_test.go +++ /dev/null @@ -1,343 +0,0 @@ -package restful - -import ( - "net/http" - "net/http/httptest" - "testing" -) - -const ( - pathGetFriends = "/get/{userId}/friends" -) - -func TestParameter(t *testing.T) { - p := &Parameter{&ParameterData{Name: "name", Description: "desc"}} - p.AllowMultiple(true) - p.DataType("int") - p.Required(true) - values := map[string]string{"a": "b"} - p.AllowableValues(values) - p.bePath() - - ws := new(WebService) - ws.Param(p) - if ws.pathParameters[0].Data().Name != "name" { - t.Error("path parameter (or name) invalid") - } -} -func TestWebService_CanCreateParameterKinds(t *testing.T) { - ws := new(WebService) - if ws.BodyParameter("b", "b").Kind() != BodyParameterKind { - t.Error("body parameter expected") - } - if ws.PathParameter("p", "p").Kind() != PathParameterKind { - t.Error("path parameter expected") - } - if ws.QueryParameter("q", "q").Kind() != QueryParameterKind { - t.Error("query parameter expected") - } -} - -func TestCapturePanic(t *testing.T) { - tearDown() - Add(newPanicingService()) - httpRequest, _ := http.NewRequest("GET", "http://here.com/fire", nil) - httpRequest.Header.Set("Accept", "*/*") - httpWriter := httptest.NewRecorder() - // override the default here - DefaultContainer.DoNotRecover(false) - DefaultContainer.dispatch(httpWriter, httpRequest) - if 500 != httpWriter.Code { - t.Error("500 expected on fire") - } -} - -func TestCapturePanicWithEncoded(t *testing.T) { - tearDown() - Add(newPanicingService()) - DefaultContainer.EnableContentEncoding(true) - httpRequest, _ := http.NewRequest("GET", "http://here.com/fire", nil) - httpRequest.Header.Set("Accept", "*/*") - httpRequest.Header.Set("Accept-Encoding", "gzip") - httpWriter := httptest.NewRecorder() - DefaultContainer.dispatch(httpWriter, httpRequest) - if 500 != httpWriter.Code { - t.Error("500 expected on fire, got", httpWriter.Code) - } -} - -func TestNotFound(t *testing.T) { - tearDown() - httpRequest, _ := http.NewRequest("GET", "http://here.com/missing", nil) - httpRequest.Header.Set("Accept", "*/*") - httpWriter := httptest.NewRecorder() - DefaultContainer.dispatch(httpWriter, httpRequest) - if 404 != httpWriter.Code { - t.Error("404 expected on missing") - } -} - -func TestMethodNotAllowed(t *testing.T) { - tearDown() - Add(newGetOnlyService()) - httpRequest, _ := http.NewRequest("POST", "http://here.com/get", nil) - httpRequest.Header.Set("Accept", "*/*") - httpWriter := httptest.NewRecorder() - DefaultContainer.dispatch(httpWriter, httpRequest) - if 405 != httpWriter.Code { - t.Error("405 expected method not allowed") - } -} - -func TestSelectedRoutePath_Issue100(t *testing.T) { - tearDown() - Add(newSelectedRouteTestingService()) - httpRequest, _ := http.NewRequest("GET", "http://here.com/get/232452/friends", nil) - httpRequest.Header.Set("Accept", "*/*") - httpWriter := httptest.NewRecorder() - DefaultContainer.dispatch(httpWriter, httpRequest) - if http.StatusOK != httpWriter.Code { - t.Error(http.StatusOK, "expected,", httpWriter.Code, "received.") - } -} - -func TestContentType415_Issue170(t *testing.T) { - tearDown() - Add(newGetOnlyJsonOnlyService()) - httpRequest, _ := http.NewRequest("GET", "http://here.com/get", nil) - httpWriter := httptest.NewRecorder() - DefaultContainer.dispatch(httpWriter, httpRequest) - if 200 != httpWriter.Code { - t.Errorf("Expected 200, got %d", httpWriter.Code) - } -} - -func TestNoContentTypePOST(t *testing.T) { - tearDown() - Add(newPostNoConsumesService()) - httpRequest, _ := http.NewRequest("POST", "http://here.com/post", nil) - httpWriter := httptest.NewRecorder() - DefaultContainer.dispatch(httpWriter, httpRequest) - if 204 != httpWriter.Code { - t.Errorf("Expected 204, got %d", httpWriter.Code) - } -} - -func TestContentType415_POST_Issue170(t *testing.T) { - tearDown() - Add(newPostOnlyJsonOnlyService()) - httpRequest, _ := http.NewRequest("POST", "http://here.com/post", nil) - httpRequest.Header.Set("Content-Type", "application/json") - httpWriter := httptest.NewRecorder() - DefaultContainer.dispatch(httpWriter, httpRequest) - if 200 != httpWriter.Code { - t.Errorf("Expected 200, got %d", httpWriter.Code) - } -} - -// go test -v -test.run TestContentType406PlainJson ...restful -func TestContentType406PlainJson(t *testing.T) { - tearDown() - TraceLogger(testLogger{t}) - Add(newGetPlainTextOrJsonService()) - httpRequest, _ := http.NewRequest("GET", "http://here.com/get", nil) - httpRequest.Header.Set("Accept", "text/plain") - httpWriter := httptest.NewRecorder() - DefaultContainer.dispatch(httpWriter, httpRequest) - if got, want := httpWriter.Code, 200; got != want { - t.Errorf("got %v, want %v", got, want) - } -} - -func TestRemoveRoute(t *testing.T) { - tearDown() - TraceLogger(testLogger{t}) - ws := newGetPlainTextOrJsonService() - Add(ws) - httpRequest, _ := http.NewRequest("GET", "http://here.com/get", nil) - httpRequest.Header.Set("Accept", "text/plain") - httpWriter := httptest.NewRecorder() - DefaultContainer.dispatch(httpWriter, httpRequest) - if got, want := httpWriter.Code, 200; got != want { - t.Errorf("got %v, want %v", got, want) - } - - // dynamic apis are disabled, should error and do nothing - if err := ws.RemoveRoute("/get", "GET"); err == nil { - t.Error("unexpected non-error") - } - - httpWriter = httptest.NewRecorder() - DefaultContainer.dispatch(httpWriter, httpRequest) - if got, want := httpWriter.Code, 200; got != want { - t.Errorf("got %v, want %v", got, want) - } - - ws.SetDynamicRoutes(true) - if err := ws.RemoveRoute("/get", "GET"); err != nil { - t.Errorf("unexpected error %v", err) - } - - httpWriter = httptest.NewRecorder() - DefaultContainer.dispatch(httpWriter, httpRequest) - if got, want := httpWriter.Code, 404; got != want { - t.Errorf("got %v, want %v", got, want) - } -} -func TestRemoveLastRoute(t *testing.T) { - tearDown() - TraceLogger(testLogger{t}) - ws := newGetPlainTextOrJsonServiceMultiRoute() - Add(ws) - httpRequest, _ := http.NewRequest("GET", "http://here.com/get", nil) - httpRequest.Header.Set("Accept", "text/plain") - httpWriter := httptest.NewRecorder() - DefaultContainer.dispatch(httpWriter, httpRequest) - if got, want := httpWriter.Code, 200; got != want { - t.Errorf("got %v, want %v", got, want) - } - - // dynamic apis are disabled, should error and do nothing - if err := ws.RemoveRoute("/get", "GET"); err == nil { - t.Error("unexpected non-error") - } - - httpWriter = httptest.NewRecorder() - DefaultContainer.dispatch(httpWriter, httpRequest) - if got, want := httpWriter.Code, 200; got != want { - t.Errorf("got %v, want %v", got, want) - } - - ws.SetDynamicRoutes(true) - if err := ws.RemoveRoute("/get", "GET"); err != nil { - t.Errorf("unexpected error %v", err) - } - - httpWriter = httptest.NewRecorder() - DefaultContainer.dispatch(httpWriter, httpRequest) - if got, want := httpWriter.Code, 404; got != want { - t.Errorf("got %v, want %v", got, want) - } -} - -// go test -v -test.run TestContentTypeOctet_Issue170 ...restful -func TestContentTypeOctet_Issue170(t *testing.T) { - tearDown() - Add(newGetConsumingOctetStreamService()) - // with content-type - httpRequest, _ := http.NewRequest("GET", "http://here.com/get", nil) - httpRequest.Header.Set("Content-Type", MIME_OCTET) - httpWriter := httptest.NewRecorder() - DefaultContainer.dispatch(httpWriter, httpRequest) - if 200 != httpWriter.Code { - t.Errorf("Expected 200, got %d", httpWriter.Code) - } - // without content-type - httpRequest, _ = http.NewRequest("GET", "http://here.com/get", nil) - httpWriter = httptest.NewRecorder() - DefaultContainer.dispatch(httpWriter, httpRequest) - if 200 != httpWriter.Code { - t.Errorf("Expected 200, got %d", httpWriter.Code) - } -} - -type exampleBody struct{} - -func TestParameterDataTypeDefaults(t *testing.T) { - tearDown() - ws := new(WebService) - route := ws.POST("/post").Reads(&exampleBody{}, "") - if route.parameters[0].data.DataType != "*restful.exampleBody" { - t.Errorf("body parameter incorrect name: %#v", route.parameters[0].data) - } -} - -func TestParameterDataTypeCustomization(t *testing.T) { - tearDown() - ws := new(WebService) - ws.TypeNameHandler(func(sample interface{}) string { - return "my.custom.type.name" - }) - route := ws.POST("/post").Reads(&exampleBody{}, "") - if route.parameters[0].data.DataType != "my.custom.type.name" { - t.Errorf("body parameter incorrect name: %#v", route.parameters[0].data) - } -} - -func newPanicingService() *WebService { - ws := new(WebService).Path("") - ws.Route(ws.GET("/fire").To(doPanic)) - return ws -} - -func newGetOnlyService() *WebService { - ws := new(WebService).Path("") - ws.Route(ws.GET("/get").To(doPanic)) - return ws -} - -func newPostOnlyJsonOnlyService() *WebService { - ws := new(WebService).Path("") - ws.Consumes("application/json") - ws.Route(ws.POST("/post").To(doNothing)) - return ws -} - -func newGetOnlyJsonOnlyService() *WebService { - ws := new(WebService).Path("") - ws.Consumes("application/json") - ws.Route(ws.GET("/get").To(doNothing)) - return ws -} - -func newGetPlainTextOrJsonService() *WebService { - ws := new(WebService).Path("") - ws.Produces("text/plain", "application/json") - ws.Route(ws.GET("/get").To(doNothing)) - return ws -} - -func newGetPlainTextOrJsonServiceMultiRoute() *WebService { - ws := new(WebService).Path("") - ws.Produces("text/plain", "application/json") - ws.Route(ws.GET("/get").To(doNothing)) - ws.Route(ws.GET("/status").To(doNothing)) - return ws -} - -func newGetConsumingOctetStreamService() *WebService { - ws := new(WebService).Path("") - ws.Consumes("application/octet-stream") - ws.Route(ws.GET("/get").To(doNothing)) - return ws -} - -func newPostNoConsumesService() *WebService { - ws := new(WebService).Path("") - ws.Route(ws.POST("/post").To(return204)) - return ws -} - -func newSelectedRouteTestingService() *WebService { - ws := new(WebService).Path("") - ws.Route(ws.GET(pathGetFriends).To(selectedRouteChecker)) - return ws -} - -func selectedRouteChecker(req *Request, resp *Response) { - if req.SelectedRoutePath() != pathGetFriends { - resp.InternalServerError() - } -} - -func doPanic(req *Request, resp *Response) { - println("lightning...") - panic("fire") -} - -func doNothing(req *Request, resp *Response) { -} - -func return204(req *Request, resp *Response) { - resp.WriteHeader(204) -} diff --git a/vendor/github.com/ghodss/yaml/.travis.yml b/vendor/github.com/ghodss/yaml/.travis.yml deleted file mode 100644 index 0e9d6edc..00000000 --- a/vendor/github.com/ghodss/yaml/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: go -go: - - 1.3 - - 1.4 -script: - - go test - - go build diff --git a/vendor/github.com/go-openapi/jsonpointer/.editorconfig b/vendor/github.com/go-openapi/jsonpointer/.editorconfig deleted file mode 100644 index 3152da69..00000000 --- a/vendor/github.com/go-openapi/jsonpointer/.editorconfig +++ /dev/null @@ -1,26 +0,0 @@ -# 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 diff --git a/vendor/github.com/go-openapi/jsonpointer/.github/CONTRIBUTING.md b/vendor/github.com/go-openapi/jsonpointer/.github/CONTRIBUTING.md deleted file mode 100644 index 7dea4240..00000000 --- a/vendor/github.com/go-openapi/jsonpointer/.github/CONTRIBUTING.md +++ /dev/null @@ -1,117 +0,0 @@ -## 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`. diff --git a/vendor/github.com/go-openapi/jsonpointer/.gitignore b/vendor/github.com/go-openapi/jsonpointer/.gitignore deleted file mode 100644 index 769c2440..00000000 --- a/vendor/github.com/go-openapi/jsonpointer/.gitignore +++ /dev/null @@ -1 +0,0 @@ -secrets.yml diff --git a/vendor/github.com/go-openapi/jsonpointer/.travis.yml b/vendor/github.com/go-openapi/jsonpointer/.travis.yml deleted file mode 100644 index 3436c459..00000000 --- a/vendor/github.com/go-openapi/jsonpointer/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -after_success: -- bash <(curl -s https://codecov.io/bash) -go: -- '1.9' -- 1.10.x -- 1.11.x -install: -- go get -u github.com/stretchr/testify/assert -- go get -u github.com/go-openapi/swag -language: go -notifications: - slack: - secure: a5VgoiwB1G/AZqzmephPZIhEB9avMlsWSlVnM1dSAtYAwdrQHGTQxAmpOxYIoSPDhWNN5bfZmjd29++UlTwLcHSR+e0kJhH6IfDlsHj/HplNCJ9tyI0zYc7XchtdKgeMxMzBKCzgwFXGSbQGydXTliDNBo0HOzmY3cou/daMFTP60K+offcjS+3LRAYb1EroSRXZqrk1nuF/xDL3792DZUdPMiFR/L/Df6y74D6/QP4sTkTDFQitz4Wy/7jbsfj8dG6qK2zivgV6/l+w4OVjFkxVpPXogDWY10vVXNVynqxfJ7to2d1I9lNCHE2ilBCkWMIPdyJF7hjF8pKW+82yP4EzRh0vu8Xn0HT5MZpQxdRY/YMxNrWaG7SxsoEaO4q5uhgdzAqLYY3TRa7MjIK+7Ur+aqOeTXn6OKwVi0CjvZ6mIU3WUKSwiwkFZMbjRAkSb5CYwMEfGFO/z964xz83qGt6WAtBXNotqCQpTIiKtDHQeLOMfksHImCg6JLhQcWBVxamVgu0G3Pdh8Y6DyPnxraXY95+QDavbjqv7TeYT9T/FNnrkXaTTK0s4iWE5H4ACU0Qvz0wUYgfQrZv0/Hp7V17+rabUwnzYySHCy9SWX/7OV9Cfh31iMp9ZIffr76xmmThtOEqs8TrTtU6BWI3rWwvA9cXQipZTVtL0oswrGw= -script: -- go test -v -race -cover -coverprofile=coverage.txt -covermode=atomic ./... diff --git a/vendor/github.com/go-openapi/jsonpointer/CODE_OF_CONDUCT.md b/vendor/github.com/go-openapi/jsonpointer/CODE_OF_CONDUCT.md deleted file mode 100644 index 9322b065..00000000 --- a/vendor/github.com/go-openapi/jsonpointer/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,74 +0,0 @@ -# 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/ diff --git a/vendor/github.com/go-openapi/jsonpointer/LICENSE b/vendor/github.com/go-openapi/jsonpointer/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/vendor/github.com/go-openapi/jsonpointer/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - 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. diff --git a/vendor/github.com/go-openapi/jsonpointer/README.md b/vendor/github.com/go-openapi/jsonpointer/README.md deleted file mode 100644 index 813788af..00000000 --- a/vendor/github.com/go-openapi/jsonpointer/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# gojsonpointer [![Build Status](https://travis-ci.org/go-openapi/jsonpointer.svg?branch=master)](https://travis-ci.org/go-openapi/jsonpointer) [![codecov](https://codecov.io/gh/go-openapi/jsonpointer/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/jsonpointer) [![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io) - -[![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/jsonpointer/master/LICENSE) [![GoDoc](https://godoc.org/github.com/go-openapi/jsonpointer?status.svg)](http://godoc.org/github.com/go-openapi/jsonpointer) -An implementation of JSON Pointer - Go language - -## Status -Completed YES - -Tested YES - -## References -http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-07 - -### Note -The 4.Evaluation part of the previous reference, starting with 'If the currently referenced value is a JSON array, the reference token MUST contain either...' is not implemented. diff --git a/vendor/github.com/go-openapi/jsonpointer/go.mod b/vendor/github.com/go-openapi/jsonpointer/go.mod deleted file mode 100644 index eb4d623c..00000000 --- a/vendor/github.com/go-openapi/jsonpointer/go.mod +++ /dev/null @@ -1,10 +0,0 @@ -module github.com/go-openapi/jsonpointer - -require ( - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/go-openapi/swag v0.17.0 - github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/stretchr/testify v1.2.2 - gopkg.in/yaml.v2 v2.2.1 // indirect -) diff --git a/vendor/github.com/go-openapi/jsonpointer/go.sum b/vendor/github.com/go-openapi/jsonpointer/go.sum deleted file mode 100644 index c71f4d7a..00000000 --- a/vendor/github.com/go-openapi/jsonpointer/go.sum +++ /dev/null @@ -1,11 +0,0 @@ -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/go-openapi/swag v0.17.0 h1:7wu+dZ5k83kvUWeAb+WUkFiUhDzwGqzTR/NhWzeo1JU= -github.com/go-openapi/swag v0.17.0/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= -github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329 h1:2gxZ0XQIU/5z3Z3bUBu+FXuk2pFbkN6tcwi/pjyaDic= -github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/github.com/go-openapi/jsonpointer/pointer.go b/vendor/github.com/go-openapi/jsonpointer/pointer.go deleted file mode 100644 index fe2d6ee5..00000000 --- a/vendor/github.com/go-openapi/jsonpointer/pointer.go +++ /dev/null @@ -1,390 +0,0 @@ -// Copyright 2013 sigu-399 ( https://github.com/sigu-399 ) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// author sigu-399 -// author-github https://github.com/sigu-399 -// author-mail sigu.399@gmail.com -// -// repository-name jsonpointer -// repository-desc An implementation of JSON Pointer - Go language -// -// description Main and unique file. -// -// created 25-02-2013 - -package jsonpointer - -import ( - "errors" - "fmt" - "reflect" - "strconv" - "strings" - - "github.com/go-openapi/swag" -) - -const ( - emptyPointer = `` - pointerSeparator = `/` - - invalidStart = `JSON pointer must be empty or start with a "` + pointerSeparator -) - -var jsonPointableType = reflect.TypeOf(new(JSONPointable)).Elem() -var jsonSetableType = reflect.TypeOf(new(JSONSetable)).Elem() - -// JSONPointable is an interface for structs to implement when they need to customize the -// json pointer process -type JSONPointable interface { - JSONLookup(string) (interface{}, error) -} - -// JSONSetable is an interface for structs to implement when they need to customize the -// json pointer process -type JSONSetable interface { - JSONSet(string, interface{}) error -} - -// New creates a new json pointer for the given string -func New(jsonPointerString string) (Pointer, error) { - - var p Pointer - err := p.parse(jsonPointerString) - return p, err - -} - -// Pointer the json pointer reprsentation -type Pointer struct { - referenceTokens []string -} - -// "Constructor", parses the given string JSON pointer -func (p *Pointer) parse(jsonPointerString string) error { - - var err error - - if jsonPointerString != emptyPointer { - if !strings.HasPrefix(jsonPointerString, pointerSeparator) { - err = errors.New(invalidStart) - } else { - referenceTokens := strings.Split(jsonPointerString, pointerSeparator) - for _, referenceToken := range referenceTokens[1:] { - p.referenceTokens = append(p.referenceTokens, referenceToken) - } - } - } - - return err -} - -// Get uses the pointer to retrieve a value from a JSON document -func (p *Pointer) Get(document interface{}) (interface{}, reflect.Kind, error) { - return p.get(document, swag.DefaultJSONNameProvider) -} - -// Set uses the pointer to set a value from a JSON document -func (p *Pointer) Set(document interface{}, value interface{}) (interface{}, error) { - return document, p.set(document, value, swag.DefaultJSONNameProvider) -} - -// GetForToken gets a value for a json pointer token 1 level deep -func GetForToken(document interface{}, decodedToken string) (interface{}, reflect.Kind, error) { - return getSingleImpl(document, decodedToken, swag.DefaultJSONNameProvider) -} - -// SetForToken gets a value for a json pointer token 1 level deep -func SetForToken(document interface{}, decodedToken string, value interface{}) (interface{}, error) { - return document, setSingleImpl(document, value, decodedToken, swag.DefaultJSONNameProvider) -} - -func getSingleImpl(node interface{}, decodedToken string, nameProvider *swag.NameProvider) (interface{}, reflect.Kind, error) { - rValue := reflect.Indirect(reflect.ValueOf(node)) - kind := rValue.Kind() - - switch kind { - - case reflect.Struct: - if rValue.Type().Implements(jsonPointableType) { - r, err := node.(JSONPointable).JSONLookup(decodedToken) - if err != nil { - return nil, kind, err - } - return r, kind, nil - } - nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken) - if !ok { - return nil, kind, fmt.Errorf("object has no field %q", decodedToken) - } - fld := rValue.FieldByName(nm) - return fld.Interface(), kind, nil - - case reflect.Map: - kv := reflect.ValueOf(decodedToken) - mv := rValue.MapIndex(kv) - - if mv.IsValid() && !swag.IsZero(mv) { - return mv.Interface(), kind, nil - } - return nil, kind, fmt.Errorf("object has no key %q", decodedToken) - - case reflect.Slice: - tokenIndex, err := strconv.Atoi(decodedToken) - if err != nil { - return nil, kind, err - } - sLength := rValue.Len() - if tokenIndex < 0 || tokenIndex >= sLength { - return nil, kind, fmt.Errorf("index out of bounds array[0,%d] index '%d'", sLength-1, tokenIndex) - } - - elem := rValue.Index(tokenIndex) - return elem.Interface(), kind, nil - - default: - return nil, kind, fmt.Errorf("invalid token reference %q", decodedToken) - } - -} - -func setSingleImpl(node, data interface{}, decodedToken string, nameProvider *swag.NameProvider) error { - rValue := reflect.Indirect(reflect.ValueOf(node)) - switch rValue.Kind() { - - case reflect.Struct: - if ns, ok := node.(JSONSetable); ok { // pointer impl - return ns.JSONSet(decodedToken, data) - } - - if rValue.Type().Implements(jsonSetableType) { - return node.(JSONSetable).JSONSet(decodedToken, data) - } - - nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken) - if !ok { - return fmt.Errorf("object has no field %q", decodedToken) - } - fld := rValue.FieldByName(nm) - if fld.IsValid() { - fld.Set(reflect.ValueOf(data)) - } - return nil - - case reflect.Map: - kv := reflect.ValueOf(decodedToken) - rValue.SetMapIndex(kv, reflect.ValueOf(data)) - return nil - - case reflect.Slice: - tokenIndex, err := strconv.Atoi(decodedToken) - if err != nil { - return err - } - sLength := rValue.Len() - if tokenIndex < 0 || tokenIndex >= sLength { - return fmt.Errorf("index out of bounds array[0,%d] index '%d'", sLength, tokenIndex) - } - - elem := rValue.Index(tokenIndex) - if !elem.CanSet() { - return fmt.Errorf("can't set slice index %s to %v", decodedToken, data) - } - elem.Set(reflect.ValueOf(data)) - return nil - - default: - return fmt.Errorf("invalid token reference %q", decodedToken) - } - -} - -func (p *Pointer) get(node interface{}, nameProvider *swag.NameProvider) (interface{}, reflect.Kind, error) { - - if nameProvider == nil { - nameProvider = swag.DefaultJSONNameProvider - } - - kind := reflect.Invalid - - // Full document when empty - if len(p.referenceTokens) == 0 { - return node, kind, nil - } - - for _, token := range p.referenceTokens { - - decodedToken := Unescape(token) - - r, knd, err := getSingleImpl(node, decodedToken, nameProvider) - if err != nil { - return nil, knd, err - } - node, kind = r, knd - - } - - rValue := reflect.ValueOf(node) - kind = rValue.Kind() - - return node, kind, nil -} - -func (p *Pointer) set(node, data interface{}, nameProvider *swag.NameProvider) error { - knd := reflect.ValueOf(node).Kind() - - if knd != reflect.Ptr && knd != reflect.Struct && knd != reflect.Map && knd != reflect.Slice && knd != reflect.Array { - return fmt.Errorf("only structs, pointers, maps and slices are supported for setting values") - } - - if nameProvider == nil { - nameProvider = swag.DefaultJSONNameProvider - } - - // Full document when empty - if len(p.referenceTokens) == 0 { - return nil - } - - lastI := len(p.referenceTokens) - 1 - for i, token := range p.referenceTokens { - isLastToken := i == lastI - decodedToken := Unescape(token) - - if isLastToken { - - return setSingleImpl(node, data, decodedToken, nameProvider) - } - - rValue := reflect.Indirect(reflect.ValueOf(node)) - kind := rValue.Kind() - - switch kind { - - case reflect.Struct: - if rValue.Type().Implements(jsonPointableType) { - r, err := node.(JSONPointable).JSONLookup(decodedToken) - if err != nil { - return err - } - fld := reflect.ValueOf(r) - if fld.CanAddr() && fld.Kind() != reflect.Interface && fld.Kind() != reflect.Map && fld.Kind() != reflect.Slice && fld.Kind() != reflect.Ptr { - node = fld.Addr().Interface() - continue - } - node = r - continue - } - nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken) - if !ok { - return fmt.Errorf("object has no field %q", decodedToken) - } - fld := rValue.FieldByName(nm) - if fld.CanAddr() && fld.Kind() != reflect.Interface && fld.Kind() != reflect.Map && fld.Kind() != reflect.Slice && fld.Kind() != reflect.Ptr { - node = fld.Addr().Interface() - continue - } - node = fld.Interface() - - case reflect.Map: - kv := reflect.ValueOf(decodedToken) - mv := rValue.MapIndex(kv) - - if !mv.IsValid() { - return fmt.Errorf("object has no key %q", decodedToken) - } - if mv.CanAddr() && mv.Kind() != reflect.Interface && mv.Kind() != reflect.Map && mv.Kind() != reflect.Slice && mv.Kind() != reflect.Ptr { - node = mv.Addr().Interface() - continue - } - node = mv.Interface() - - case reflect.Slice: - tokenIndex, err := strconv.Atoi(decodedToken) - if err != nil { - return err - } - sLength := rValue.Len() - if tokenIndex < 0 || tokenIndex >= sLength { - return fmt.Errorf("index out of bounds array[0,%d] index '%d'", sLength, tokenIndex) - } - - elem := rValue.Index(tokenIndex) - if elem.CanAddr() && elem.Kind() != reflect.Interface && elem.Kind() != reflect.Map && elem.Kind() != reflect.Slice && elem.Kind() != reflect.Ptr { - node = elem.Addr().Interface() - continue - } - node = elem.Interface() - - default: - return fmt.Errorf("invalid token reference %q", decodedToken) - } - - } - - return nil -} - -// DecodedTokens returns the decoded tokens -func (p *Pointer) DecodedTokens() []string { - result := make([]string, 0, len(p.referenceTokens)) - for _, t := range p.referenceTokens { - result = append(result, Unescape(t)) - } - return result -} - -// IsEmpty returns true if this is an empty json pointer -// this indicates that it points to the root document -func (p *Pointer) IsEmpty() bool { - return len(p.referenceTokens) == 0 -} - -// Pointer to string representation function -func (p *Pointer) String() string { - - if len(p.referenceTokens) == 0 { - return emptyPointer - } - - pointerString := pointerSeparator + strings.Join(p.referenceTokens, pointerSeparator) - - return pointerString -} - -// Specific JSON pointer encoding here -// ~0 => ~ -// ~1 => / -// ... and vice versa - -const ( - encRefTok0 = `~0` - encRefTok1 = `~1` - decRefTok0 = `~` - decRefTok1 = `/` -) - -// Unescape unescapes a json pointer reference token string to the original representation -func Unescape(token string) string { - step1 := strings.Replace(token, encRefTok1, decRefTok1, -1) - step2 := strings.Replace(step1, encRefTok0, decRefTok0, -1) - return step2 -} - -// Escape escapes a pointer reference token string -func Escape(token string) string { - step1 := strings.Replace(token, decRefTok0, encRefTok0, -1) - step2 := strings.Replace(step1, decRefTok1, encRefTok1, -1) - return step2 -} diff --git a/vendor/github.com/go-openapi/jsonpointer/pointer_test.go b/vendor/github.com/go-openapi/jsonpointer/pointer_test.go deleted file mode 100644 index eabd5860..00000000 --- a/vendor/github.com/go-openapi/jsonpointer/pointer_test.go +++ /dev/null @@ -1,573 +0,0 @@ -// Copyright 2013 sigu-399 ( https://github.com/sigu-399 ) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// author sigu-399 -// author-github https://github.com/sigu-399 -// author-mail sigu.399@gmail.com -// -// repository-name jsonpointer -// repository-desc An implementation of JSON Pointer - Go language -// -// description Automated tests on package. -// -// created 03-03-2013 - -package jsonpointer - -import ( - "encoding/json" - "fmt" - "strconv" - "testing" - - "github.com/stretchr/testify/assert" -) - -const ( - TestDocumentNBItems = 11 - TestNodeObjNBItems = 4 - TestDocumentString = `{ -"foo": ["bar", "baz"], -"obj": { "a":1, "b":2, "c":[3,4], "d":[ {"e":9}, {"f":[50,51]} ] }, -"": 0, -"a/b": 1, -"c%d": 2, -"e^f": 3, -"g|h": 4, -"i\\j": 5, -"k\"l": 6, -" ": 7, -"m~n": 8 -}` -) - -var testDocumentJSON interface{} - -type testStructJSON struct { - Foo []string `json:"foo"` - Obj struct { - A int `json:"a"` - B int `json:"b"` - C []int `json:"c"` - D []struct { - E int `json:"e"` - F []int `json:"f"` - } `json:"d"` - } `json:"obj"` -} - -type aliasedMap map[string]interface{} - -var testStructJSONDoc testStructJSON -var testStructJSONPtr *testStructJSON - -func init() { - json.Unmarshal([]byte(TestDocumentString), &testDocumentJSON) - json.Unmarshal([]byte(TestDocumentString), &testStructJSONDoc) - testStructJSONPtr = &testStructJSONDoc -} - -func TestEscaping(t *testing.T) { - - ins := []string{`/`, `/`, `/a~1b`, `/a~1b`, `/c%d`, `/e^f`, `/g|h`, `/i\j`, `/k"l`, `/ `, `/m~0n`} - outs := []float64{0, 0, 1, 1, 2, 3, 4, 5, 6, 7, 8} - - for i := range ins { - p, err := New(ins[i]) - if assert.NoError(t, err, "input: %v", ins[i]) { - result, _, err := p.Get(testDocumentJSON) - if assert.NoError(t, err, "input: %v", ins[i]) { - assert.Equal(t, outs[i], result, "input: %v", ins[i]) - } - } - } - -} - -func TestFullDocument(t *testing.T) { - - in := `` - - p, err := New(in) - if err != nil { - t.Errorf("New(%v) error %v", in, err.Error()) - } - - result, _, err := p.Get(testDocumentJSON) - if err != nil { - t.Errorf("Get(%v) error %v", in, err.Error()) - } - - if len(result.(map[string]interface{})) != TestDocumentNBItems { - t.Errorf("Get(%v) = %v, expect full document", in, result) - } - - result, _, err = p.get(testDocumentJSON, nil) - if err != nil { - t.Errorf("Get(%v) error %v", in, err.Error()) - } - - if len(result.(map[string]interface{})) != TestDocumentNBItems { - t.Errorf("Get(%v) = %v, expect full document", in, result) - } -} - -func TestDecodedTokens(t *testing.T) { - p, err := New("/obj/a~1b") - assert.NoError(t, err) - assert.Equal(t, []string{"obj", "a/b"}, p.DecodedTokens()) -} - -func TestIsEmpty(t *testing.T) { - p, err := New("") - assert.NoError(t, err) - assert.True(t, p.IsEmpty()) - p, err = New("/obj") - assert.NoError(t, err) - assert.False(t, p.IsEmpty()) -} - -func TestGetSingle(t *testing.T) { - in := `/obj` - - _, err := New(in) - assert.NoError(t, err) - result, _, err := GetForToken(testDocumentJSON, "obj") - assert.NoError(t, err) - assert.Len(t, result, TestNodeObjNBItems) - - result, _, err = GetForToken(testStructJSONDoc, "Obj") - assert.Error(t, err) - assert.Nil(t, result) - - result, _, err = GetForToken(testStructJSONDoc, "Obj2") - assert.Error(t, err) - assert.Nil(t, result) -} - -type pointableImpl struct { - a string -} - -func (p pointableImpl) JSONLookup(token string) (interface{}, error) { - if token == "some" { - return p.a, nil - } - return nil, fmt.Errorf("object has no field %q", token) -} - -func TestPointableInterface(t *testing.T) { - p := &pointableImpl{"hello"} - - result, _, err := GetForToken(p, "some") - assert.NoError(t, err) - assert.Equal(t, p.a, result) - - result, _, err = GetForToken(p, "something") - assert.Error(t, err) - assert.Nil(t, result) -} - -func TestGetNode(t *testing.T) { - - in := `/obj` - - p, err := New(in) - assert.NoError(t, err) - result, _, err := p.Get(testDocumentJSON) - assert.NoError(t, err) - assert.Len(t, result, TestNodeObjNBItems) - - result, _, err = p.Get(aliasedMap(testDocumentJSON.(map[string]interface{}))) - assert.NoError(t, err) - assert.Len(t, result, TestNodeObjNBItems) - - result, _, err = p.Get(testStructJSONDoc) - assert.NoError(t, err) - assert.Equal(t, testStructJSONDoc.Obj, result) - - result, _, err = p.Get(testStructJSONPtr) - assert.NoError(t, err) - assert.Equal(t, testStructJSONDoc.Obj, result) -} - -func TestArray(t *testing.T) { - - ins := []string{`/foo/0`, `/foo/0`, `/foo/1`} - outs := []string{"bar", "bar", "baz"} - - for i := range ins { - p, err := New(ins[i]) - assert.NoError(t, err) - - result, _, err := p.Get(testStructJSONDoc) - assert.NoError(t, err) - assert.Equal(t, outs[i], result) - - result, _, err = p.Get(testStructJSONPtr) - assert.NoError(t, err) - assert.Equal(t, outs[i], result) - - result, _, err = p.Get(testDocumentJSON) - assert.NoError(t, err) - assert.Equal(t, outs[i], result) - } -} - -func TestOtherThings(t *testing.T) { - _, err := New("abc") - assert.Error(t, err) - - p, err := New("") - assert.NoError(t, err) - assert.Equal(t, "", p.String()) - - p, err = New("/obj/a") - assert.Equal(t, "/obj/a", p.String()) - - s := Escape("m~n") - assert.Equal(t, "m~0n", s) - s = Escape("m/n") - assert.Equal(t, "m~1n", s) - - p, err = New("/foo/3") - assert.NoError(t, err) - _, _, err = p.Get(testDocumentJSON) - assert.Error(t, err) - - p, err = New("/foo/a") - assert.NoError(t, err) - _, _, err = p.Get(testDocumentJSON) - assert.Error(t, err) - - p, err = New("/notthere") - assert.NoError(t, err) - _, _, err = p.Get(testDocumentJSON) - assert.Error(t, err) - - p, err = New("/invalid") - assert.NoError(t, err) - _, _, err = p.Get(1234) - assert.Error(t, err) - - p, err = New("/foo/1") - assert.NoError(t, err) - expected := "hello" - bbb := testDocumentJSON.(map[string]interface{})["foo"] - bbb.([]interface{})[1] = "hello" - - v, _, err := p.Get(testDocumentJSON) - assert.NoError(t, err) - assert.Equal(t, expected, v) - - esc := Escape("a/") - assert.Equal(t, "a~1", esc) - unesc := Unescape(esc) - assert.Equal(t, "a/", unesc) - - unesc = Unescape("~01") - assert.Equal(t, "~1", unesc) - assert.Equal(t, "~0~1", Escape("~/")) - assert.Equal(t, "~/", Unescape("~0~1")) -} - -func TestObject(t *testing.T) { - - ins := []string{`/obj/a`, `/obj/b`, `/obj/c/0`, `/obj/c/1`, `/obj/c/1`, `/obj/d/1/f/0`} - outs := []float64{1, 2, 3, 4, 4, 50} - - for i := range ins { - - p, err := New(ins[i]) - assert.NoError(t, err) - - result, _, err := p.Get(testDocumentJSON) - assert.NoError(t, err) - assert.Equal(t, outs[i], result) - - result, _, err = p.Get(testStructJSONDoc) - assert.NoError(t, err) - assert.EqualValues(t, outs[i], result) - - result, _, err = p.Get(testStructJSONPtr) - assert.NoError(t, err) - assert.EqualValues(t, outs[i], result) - } -} - -type setJsonDocEle struct { - B int `json:"b"` - C int `json:"c"` -} -type setJsonDoc struct { - A []struct { - B int `json:"b"` - C int `json:"c"` - } `json:"a"` - D int `json:"d"` -} - -type settableDoc struct { - Coll settableColl - Int settableInt -} - -func (s settableDoc) MarshalJSON() ([]byte, error) { - var res struct { - A settableColl `json:"a"` - D settableInt `json:"d"` - } - res.A = s.Coll - res.D = s.Int - return json.Marshal(res) -} -func (s *settableDoc) UnmarshalJSON(data []byte) error { - var res struct { - A settableColl `json:"a"` - D settableInt `json:"d"` - } - - if err := json.Unmarshal(data, &res); err != nil { - return err - } - s.Coll = res.A - s.Int = res.D - return nil -} - -// JSONLookup implements an interface to customize json pointer lookup -func (s settableDoc) JSONLookup(token string) (interface{}, error) { - switch token { - case "a": - return &s.Coll, nil - case "d": - return &s.Int, nil - default: - return nil, fmt.Errorf("%s is not a known field", token) - } -} - -// JSONLookup implements an interface to customize json pointer lookup -func (s *settableDoc) JSONSet(token string, data interface{}) error { - switch token { - case "a": - switch dt := data.(type) { - case settableColl: - s.Coll = dt - return nil - case *settableColl: - if dt != nil { - s.Coll = *dt - } else { - s.Coll = settableColl{} - } - return nil - case []settableCollItem: - s.Coll.Items = dt - return nil - } - case "d": - switch dt := data.(type) { - case settableInt: - s.Int = dt - return nil - case int: - s.Int.Value = dt - return nil - case int8: - s.Int.Value = int(dt) - return nil - case int16: - s.Int.Value = int(dt) - return nil - case int32: - s.Int.Value = int(dt) - return nil - case int64: - s.Int.Value = int(dt) - return nil - default: - return fmt.Errorf("invalid type %T for %s", data, token) - } - } - return fmt.Errorf("%s is not a known field", token) -} - -type settableColl struct { - Items []settableCollItem -} - -func (s settableColl) MarshalJSON() ([]byte, error) { - return json.Marshal(s.Items) -} -func (s *settableColl) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &s.Items) -} - -// JSONLookup implements an interface to customize json pointer lookup -func (s settableColl) JSONLookup(token string) (interface{}, error) { - if tok, err := strconv.Atoi(token); err == nil { - return &s.Items[tok], nil - } - return nil, fmt.Errorf("%s is not a valid index", token) -} - -// JSONLookup implements an interface to customize json pointer lookup -func (s *settableColl) JSONSet(token string, data interface{}) error { - if _, err := strconv.Atoi(token); err == nil { - _, err := SetForToken(s.Items, token, data) - return err - } - return fmt.Errorf("%s is not a valid index", token) -} - -type settableCollItem struct { - B int `json:"b"` - C int `json:"c"` -} - -type settableInt struct { - Value int -} - -func (s settableInt) MarshalJSON() ([]byte, error) { - return json.Marshal(s.Value) -} -func (s *settableInt) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &s.Value) -} - -func TestSetNode(t *testing.T) { - - jsonText := `{"a":[{"b": 1, "c": 2}], "d": 3}` - - var jsonDocument interface{} - if assert.NoError(t, json.Unmarshal([]byte(jsonText), &jsonDocument)) { - in := "/a/0/c" - p, err := New(in) - if assert.NoError(t, err) { - - _, err = p.Set(jsonDocument, 999) - assert.NoError(t, err) - - firstNode := jsonDocument.(map[string]interface{}) - assert.Len(t, firstNode, 2) - - sliceNode := firstNode["a"].([]interface{}) - assert.Len(t, sliceNode, 1) - - changedNode := sliceNode[0].(map[string]interface{}) - chNodeVI := changedNode["c"] - if assert.IsType(t, 0, chNodeVI) { - changedNodeValue := chNodeVI.(int) - if assert.Equal(t, 999, changedNodeValue) { - assert.Len(t, sliceNode, 1) - } - } - } - - v, err := New("/a/0") - if assert.NoError(t, err) { - _, err = v.Set(jsonDocument, map[string]interface{}{"b": 3, "c": 8}) - if assert.NoError(t, err) { - firstNode := jsonDocument.(map[string]interface{}) - assert.Len(t, firstNode, 2) - - sliceNode := firstNode["a"].([]interface{}) - assert.Len(t, sliceNode, 1) - changedNode := sliceNode[0].(map[string]interface{}) - assert.Equal(t, 3, changedNode["b"]) - assert.Equal(t, 8, changedNode["c"]) - } - } - } - - var structDoc setJsonDoc - if assert.NoError(t, json.Unmarshal([]byte(jsonText), &structDoc)) { - g, err := New("/a") - if assert.NoError(t, err) { - _, err = g.Set(&structDoc, []struct { - B int `json:"b"` - C int `json:"c"` - }{{B: 4, C: 7}}) - - if assert.NoError(t, err) { - assert.Len(t, structDoc.A, 1) - changedNode := structDoc.A[0] - assert.Equal(t, 4, changedNode.B) - assert.Equal(t, 7, changedNode.C) - } - } - - v, err := New("/a/0") - if assert.NoError(t, err) { - _, err = v.Set(structDoc, struct { - B int `json:"b"` - C int `json:"c"` - }{B: 3, C: 8}) - - if assert.NoError(t, err) { - assert.Len(t, structDoc.A, 1) - changedNode := structDoc.A[0] - assert.Equal(t, 3, changedNode.B) - assert.Equal(t, 8, changedNode.C) - } - } - - p, err := New("/a/0/c") - if assert.NoError(t, err) { - _, err = p.Set(&structDoc, 999) - assert.NoError(t, err) - if assert.Len(t, structDoc.A, 1) { - assert.Equal(t, 999, structDoc.A[0].C) - } - } - } - - var setDoc settableDoc - if assert.NoError(t, json.Unmarshal([]byte(jsonText), &setDoc)) { - g, err := New("/a") - if assert.NoError(t, err) { - _, err = g.Set(&setDoc, []settableCollItem{{B: 4, C: 7}}) - - if assert.NoError(t, err) { - assert.Len(t, setDoc.Coll.Items, 1) - changedNode := setDoc.Coll.Items[0] - assert.Equal(t, 4, changedNode.B) - assert.Equal(t, 7, changedNode.C) - } - } - - v, err := New("/a/0") - if assert.NoError(t, err) { - _, err = v.Set(setDoc, settableCollItem{B: 3, C: 8}) - - if assert.NoError(t, err) { - assert.Len(t, setDoc.Coll.Items, 1) - changedNode := setDoc.Coll.Items[0] - assert.Equal(t, 3, changedNode.B) - assert.Equal(t, 8, changedNode.C) - } - } - - p, err := New("/a/0/c") - if assert.NoError(t, err) { - _, err = p.Set(setDoc, 999) - assert.NoError(t, err) - if assert.Len(t, setDoc.Coll.Items, 1) { - assert.Equal(t, 999, setDoc.Coll.Items[0].C) - } - } - } -} diff --git a/vendor/github.com/go-openapi/jsonreference/.github/CONTRIBUTING.md b/vendor/github.com/go-openapi/jsonreference/.github/CONTRIBUTING.md deleted file mode 100644 index 7dea4240..00000000 --- a/vendor/github.com/go-openapi/jsonreference/.github/CONTRIBUTING.md +++ /dev/null @@ -1,117 +0,0 @@ -## 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`. diff --git a/vendor/github.com/go-openapi/jsonreference/.gitignore b/vendor/github.com/go-openapi/jsonreference/.gitignore deleted file mode 100644 index 769c2440..00000000 --- a/vendor/github.com/go-openapi/jsonreference/.gitignore +++ /dev/null @@ -1 +0,0 @@ -secrets.yml diff --git a/vendor/github.com/go-openapi/jsonreference/.travis.yml b/vendor/github.com/go-openapi/jsonreference/.travis.yml deleted file mode 100644 index 40034d28..00000000 --- a/vendor/github.com/go-openapi/jsonreference/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -after_success: -- bash <(curl -s https://codecov.io/bash) -go: -- '1.9' -- 1.10.x -- 1.11.x -install: -- go get -u github.com/stretchr/testify/assert -- go get -u github.com/PuerkitoBio/purell -- go get -u github.com/go-openapi/jsonpointer -language: go -notifications: - slack: - secure: OpQG/36F7DSF00HLm9WZMhyqFCYYyYTsVDObW226cWiR8PWYiNfLZiSEvIzT1Gx4dDjhigKTIqcLhG34CkL5iNXDjm9Yyo2RYhQPlK8NErNqUEXuBqn4RqYHW48VGhEhOyDd4Ei0E2FN5ZbgpvHgtpkdZ6XDi64r3Ac89isP9aPHXQTuv2Jog6b4/OKKiUTftLcTIst0p4Cp3gqOJWf1wnoj+IadWiECNVQT6zb47IYjtyw6+uV8iUjTzdKcRB6Zc6b4Dq7JAg1Zd7Jfxkql3hlKp4PNlRf9Cy7y5iA3G7MLyg3FcPX5z2kmcyPt2jOTRMBWUJ5zIQpOxizAcN8WsT3WWBL5KbuYK6k0PzujrIDLqdxGpNmjkkMfDBT9cKmZpm2FdW+oZgPFJP+oKmAo4u4KJz/vjiPTXgQlN5bmrLuRMCp+AwC5wkIohTqWZVPE2TK6ZSnMYcg/W39s+RP/9mJoyryAvPSpBOLTI+biCgaUCTOAZxNTWpMFc3tPYntc41WWkdKcooZ9JA5DwfcaVFyTGQ3YXz+HvX6G1z/gW0Q/A4dBi9mj2iE1xm7tRTT+4VQ2AXFvSEI1HJpfPgYnwAtwOD1v3Qm2EUHk9sCdtEDR4wVGEPIVn44GnwFMnGKx9JWppMPYwFu3SVDdHt+E+LOlhZUply11Aa+IVrT2KUQ= -script: -- go test -v -race -cover -coverprofile=coverage.txt -covermode=atomic ./... diff --git a/vendor/github.com/go-openapi/jsonreference/CODE_OF_CONDUCT.md b/vendor/github.com/go-openapi/jsonreference/CODE_OF_CONDUCT.md deleted file mode 100644 index 9322b065..00000000 --- a/vendor/github.com/go-openapi/jsonreference/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,74 +0,0 @@ -# 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/ diff --git a/vendor/github.com/go-openapi/jsonreference/LICENSE b/vendor/github.com/go-openapi/jsonreference/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/vendor/github.com/go-openapi/jsonreference/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - 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. diff --git a/vendor/github.com/go-openapi/jsonreference/README.md b/vendor/github.com/go-openapi/jsonreference/README.md deleted file mode 100644 index 66345f4c..00000000 --- a/vendor/github.com/go-openapi/jsonreference/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# gojsonreference [![Build Status](https://travis-ci.org/go-openapi/jsonreference.svg?branch=master)](https://travis-ci.org/go-openapi/jsonreference) [![codecov](https://codecov.io/gh/go-openapi/jsonreference/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/jsonreference) [![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/jsonreference/master/LICENSE) [![GoDoc](https://godoc.org/github.com/go-openapi/jsonreference?status.svg)](http://godoc.org/github.com/go-openapi/jsonreference) -An implementation of JSON Reference - Go language - -## Status -Work in progress ( 90% done ) - -## Dependencies -https://github.com/go-openapi/jsonpointer - -## References -http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-07 - -http://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03 diff --git a/vendor/github.com/go-openapi/jsonreference/go.mod b/vendor/github.com/go-openapi/jsonreference/go.mod deleted file mode 100644 index 6d15a705..00000000 --- a/vendor/github.com/go-openapi/jsonreference/go.mod +++ /dev/null @@ -1,15 +0,0 @@ -module github.com/go-openapi/jsonreference - -require ( - github.com/PuerkitoBio/purell v1.1.0 - github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/go-openapi/jsonpointer v0.17.0 - github.com/go-openapi/swag v0.17.0 // indirect - github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/stretchr/testify v1.2.2 - golang.org/x/net v0.0.0-20181005035420-146acd28ed58 // indirect - golang.org/x/text v0.3.0 // indirect - gopkg.in/yaml.v2 v2.2.1 // indirect -) diff --git a/vendor/github.com/go-openapi/jsonreference/go.sum b/vendor/github.com/go-openapi/jsonreference/go.sum deleted file mode 100644 index ec9bdbc2..00000000 --- a/vendor/github.com/go-openapi/jsonreference/go.sum +++ /dev/null @@ -1,20 +0,0 @@ -github.com/PuerkitoBio/purell v1.1.0 h1:rmGxhojJlM0tuKtfdvliR84CFHljx9ag64t2xmVkjK4= -github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/davecgh/go-spew v1.1.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.17.0 h1:Bpl2DtZ6k7wKqfFs7e+4P08+M9I3FQgn09a1UsRUQbk= -github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= -github.com/go-openapi/swag v0.17.0 h1:7wu+dZ5k83kvUWeAb+WUkFiUhDzwGqzTR/NhWzeo1JU= -github.com/go-openapi/swag v0.17.0/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= -github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329 h1:2gxZ0XQIU/5z3Z3bUBu+FXuk2pFbkN6tcwi/pjyaDic= -github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -golang.org/x/net v0.0.0-20181005035420-146acd28ed58 h1:otZG8yDCO4LVps5+9bxOeNiCvgmOyt96J3roHTYs7oE= -golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/github.com/go-openapi/jsonreference/reference.go b/vendor/github.com/go-openapi/jsonreference/reference.go deleted file mode 100644 index 3bc0a6e2..00000000 --- a/vendor/github.com/go-openapi/jsonreference/reference.go +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright 2013 sigu-399 ( https://github.com/sigu-399 ) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// author sigu-399 -// author-github https://github.com/sigu-399 -// author-mail sigu.399@gmail.com -// -// repository-name jsonreference -// repository-desc An implementation of JSON Reference - Go language -// -// description Main and unique file. -// -// created 26-02-2013 - -package jsonreference - -import ( - "errors" - "net/url" - "strings" - - "github.com/PuerkitoBio/purell" - "github.com/go-openapi/jsonpointer" -) - -const ( - fragmentRune = `#` -) - -// New creates a new reference for the given string -func New(jsonReferenceString string) (Ref, error) { - - var r Ref - err := r.parse(jsonReferenceString) - return r, err - -} - -// MustCreateRef parses the ref string and panics when it's invalid. -// Use the New method for a version that returns an error -func MustCreateRef(ref string) Ref { - r, err := New(ref) - if err != nil { - panic(err) - } - return r -} - -// Ref represents a json reference object -type Ref struct { - referenceURL *url.URL - referencePointer jsonpointer.Pointer - - HasFullURL bool - HasURLPathOnly bool - HasFragmentOnly bool - HasFileScheme bool - HasFullFilePath bool -} - -// GetURL gets the URL for this reference -func (r *Ref) GetURL() *url.URL { - return r.referenceURL -} - -// GetPointer gets the json pointer for this reference -func (r *Ref) GetPointer() *jsonpointer.Pointer { - return &r.referencePointer -} - -// String returns the best version of the url for this reference -func (r *Ref) String() string { - - if r.referenceURL != nil { - return r.referenceURL.String() - } - - if r.HasFragmentOnly { - return fragmentRune + r.referencePointer.String() - } - - return r.referencePointer.String() -} - -// IsRoot returns true if this reference is a root document -func (r *Ref) IsRoot() bool { - return r.referenceURL != nil && - !r.IsCanonical() && - !r.HasURLPathOnly && - r.referenceURL.Fragment == "" -} - -// IsCanonical returns true when this pointer starts with http(s):// or file:// -func (r *Ref) IsCanonical() bool { - return (r.HasFileScheme && r.HasFullFilePath) || (!r.HasFileScheme && r.HasFullURL) -} - -// "Constructor", parses the given string JSON reference -func (r *Ref) parse(jsonReferenceString string) error { - - parsed, err := url.Parse(jsonReferenceString) - if err != nil { - return err - } - - r.referenceURL, _ = url.Parse(purell.NormalizeURL(parsed, purell.FlagsSafe|purell.FlagRemoveDuplicateSlashes)) - refURL := r.referenceURL - - if refURL.Scheme != "" && refURL.Host != "" { - r.HasFullURL = true - } else { - if refURL.Path != "" { - r.HasURLPathOnly = true - } else if refURL.RawQuery == "" && refURL.Fragment != "" { - r.HasFragmentOnly = true - } - } - - r.HasFileScheme = refURL.Scheme == "file" - r.HasFullFilePath = strings.HasPrefix(refURL.Path, "/") - - // invalid json-pointer error means url has no json-pointer fragment. simply ignore error - r.referencePointer, _ = jsonpointer.New(refURL.Fragment) - - return nil -} - -// Inherits creates a new reference from a parent and a child -// If the child cannot inherit from the parent, an error is returned -func (r *Ref) Inherits(child Ref) (*Ref, error) { - childURL := child.GetURL() - parentURL := r.GetURL() - if childURL == nil { - return nil, errors.New("child url is nil") - } - if parentURL == nil { - return &child, nil - } - - ref, err := New(parentURL.ResolveReference(childURL).String()) - if err != nil { - return nil, err - } - return &ref, nil -} diff --git a/vendor/github.com/go-openapi/jsonreference/reference_test.go b/vendor/github.com/go-openapi/jsonreference/reference_test.go deleted file mode 100644 index 2bfadced..00000000 --- a/vendor/github.com/go-openapi/jsonreference/reference_test.go +++ /dev/null @@ -1,420 +0,0 @@ -// Copyright 2013 sigu-399 ( https://github.com/sigu-399 ) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// author sigu-399 -// author-github https://github.com/sigu-399 -// author-mail sigu.399@gmail.com -// -// repository-name jsonreference -// repository-desc An implementation of JSON Reference - Go language -// -// description Automated tests on package. -// -// created 03-03-2013 - -package jsonreference - -import ( - "testing" - - "github.com/go-openapi/jsonpointer" - "github.com/stretchr/testify/assert" -) - -func TestIsRoot(t *testing.T) { - in := "#" - r1, err := New(in) - assert.NoError(t, err) - assert.True(t, r1.IsRoot()) - - in = "#/ok" - r1 = MustCreateRef(in) - assert.False(t, r1.IsRoot()) - - assert.Panics(t, assert.PanicTestFunc(func() { - MustCreateRef("%2") - })) -} - -func TestFull(t *testing.T) { - - in := "http://host/path/a/b/c#/f/a/b" - - r1, err := New(in) - if err != nil { - t.Errorf("New(%v) error %s", in, err.Error()) - } - - if in != r1.String() { - t.Errorf("New(%v) = %v, expect %v", in, r1.String(), in) - } - - if r1.HasFragmentOnly != false { - t.Errorf("New(%v)::HasFragmentOnly %v expect %v", in, r1.HasFragmentOnly, false) - } - - if r1.HasFullURL != true { - t.Errorf("New(%v)::HasFullURL %v expect %v", in, r1.HasFullURL, true) - } - - if r1.HasURLPathOnly != false { - t.Errorf("New(%v)::HasURLPathOnly %v expect %v", in, r1.HasURLPathOnly, false) - } - - if r1.HasFileScheme != false { - t.Errorf("New(%v)::HasFileScheme %v expect %v", in, r1.HasFileScheme, false) - } - - if r1.GetPointer().String() != "/f/a/b" { - t.Errorf("New(%v)::GetPointer() %v expect %v", in, r1.GetPointer().String(), "/f/a/b") - } -} - -func TestFullURL(t *testing.T) { - - in := "http://host/path/a/b/c" - - r1, err := New(in) - if err != nil { - t.Errorf("New(%v) error %s", in, err.Error()) - } - - if in != r1.String() { - t.Errorf("New(%v) = %v, expect %v", in, r1.String(), in) - } - - if r1.HasFragmentOnly != false { - t.Errorf("New(%v)::HasFragmentOnly %v expect %v", in, r1.HasFragmentOnly, false) - } - - if r1.HasFullURL != true { - t.Errorf("New(%v)::HasFullURL %v expect %v", in, r1.HasFullURL, true) - } - - if r1.HasURLPathOnly != false { - t.Errorf("New(%v)::HasURLPathOnly %v expect %v", in, r1.HasURLPathOnly, false) - } - - if r1.HasFileScheme != false { - t.Errorf("New(%v)::HasFileScheme %v expect %v", in, r1.HasFileScheme, false) - } - - if r1.GetPointer().String() != "" { - t.Errorf("New(%v)::GetPointer() %v expect %v", in, r1.GetPointer().String(), "") - } -} - -func TestFragmentOnly(t *testing.T) { - - in := "#/fragment/only" - - r1, err := New(in) - if err != nil { - t.Errorf("New(%v) error %s", in, err.Error()) - } - - if in != r1.String() { - t.Errorf("New(%v) = %v, expect %v", in, r1.String(), in) - } - - if r1.HasFragmentOnly != true { - t.Errorf("New(%v)::HasFragmentOnly %v expect %v", in, r1.HasFragmentOnly, true) - } - - if r1.HasFullURL != false { - t.Errorf("New(%v)::HasFullURL %v expect %v", in, r1.HasFullURL, false) - } - - if r1.HasURLPathOnly != false { - t.Errorf("New(%v)::HasURLPathOnly %v expect %v", in, r1.HasURLPathOnly, false) - } - - if r1.HasFileScheme != false { - t.Errorf("New(%v)::HasFileScheme %v expect %v", in, r1.HasFileScheme, false) - } - - if r1.GetPointer().String() != "/fragment/only" { - t.Errorf("New(%v)::GetPointer() %v expect %v", in, r1.GetPointer().String(), "/fragment/only") - } - - p, _ := jsonpointer.New(r1.referenceURL.Fragment) - r2 := Ref{referencePointer: p, HasFragmentOnly: true} - assert.Equal(t, r2.String(), in) - - r3 := Ref{referencePointer: p, HasFragmentOnly: false} - assert.Equal(t, r3.String(), in[1:]) -} - -func TestURLPathOnly(t *testing.T) { - - in := "/documents/document.json" - - r1, err := New(in) - if err != nil { - t.Errorf("New(%v) error %s", in, err.Error()) - } - - if in != r1.String() { - t.Errorf("New(%v) = %v, expect %v", in, r1.String(), in) - } - - if r1.HasFragmentOnly != false { - t.Errorf("New(%v)::HasFragmentOnly %v expect %v", in, r1.HasFragmentOnly, false) - } - - if r1.HasFullURL != false { - t.Errorf("New(%v)::HasFullURL %v expect %v", in, r1.HasFullURL, false) - } - - if r1.HasURLPathOnly != true { - t.Errorf("New(%v)::HasURLPathOnly %v expect %v", in, r1.HasURLPathOnly, true) - } - - if r1.HasFileScheme != false { - t.Errorf("New(%v)::HasFileScheme %v expect %v", in, r1.HasFileScheme, false) - } - - if r1.GetPointer().String() != "" { - t.Errorf("New(%v)::GetPointer() %v expect %v", in, r1.GetPointer().String(), "") - } -} - -func TestURLRelativePathOnly(t *testing.T) { - - in := "document.json" - - r1, err := New(in) - if err != nil { - t.Errorf("New(%v) error %s", in, err.Error()) - } - - if in != r1.String() { - t.Errorf("New(%v) = %v, expect %v", in, r1.String(), in) - } - - if r1.HasFragmentOnly != false { - t.Errorf("New(%v)::HasFragmentOnly %v expect %v", in, r1.HasFragmentOnly, false) - } - - if r1.HasFullURL != false { - t.Errorf("New(%v)::HasFullURL %v expect %v", in, r1.HasFullURL, false) - } - - if r1.HasURLPathOnly != true { - t.Errorf("New(%v)::HasURLPathOnly %v expect %v", in, r1.HasURLPathOnly, true) - } - - if r1.HasFileScheme != false { - t.Errorf("New(%v)::HasFileScheme %v expect %v", in, r1.HasFileScheme, false) - } - - if r1.GetPointer().String() != "" { - t.Errorf("New(%v)::GetPointer() %v expect %v", in, r1.GetPointer().String(), "") - } -} - -func TestInheritsInValid(t *testing.T) { - in1 := "http://www.test.com/doc.json" - in2 := "#/a/b" - - r1, _ := New(in1) - r2 := Ref{} - result, err := r1.Inherits(r2) - assert.Error(t, err) - assert.Nil(t, result) - - r1 = Ref{} - r2, _ = New(in2) - result, err = r1.Inherits(r2) - assert.NoError(t, err) - assert.Equal(t, r2, *result) -} - -func TestInheritsValid(t *testing.T) { - - in1 := "http://www.test.com/doc.json" - in2 := "#/a/b" - out := in1 + in2 - - r1, _ := New(in1) - r2, _ := New(in2) - - result, err := r1.Inherits(r2) - if err != nil { - t.Errorf("Inherits(%s,%s) error %s", r1.String(), r2.String(), err.Error()) - } - - if result.String() != out { - t.Errorf("Inherits(%s,%s) = %s, expect %s", r1.String(), r2.String(), result.String(), out) - } - - if result.GetPointer().String() != "/a/b" { - t.Errorf("result(%v)::GetPointer() %v expect %v", result.String(), result.GetPointer().String(), "/a/b") - } -} - -func TestInheritsDifferentHost(t *testing.T) { - - in1 := "http://www.test.com/doc.json" - in2 := "http://www.test2.com/doc.json#bla" - - r1, _ := New(in1) - r2, _ := New(in2) - - result, err := r1.Inherits(r2) - - if err != nil { - t.Errorf("Inherits(%s,%s) should not fail. Error: %s", r1.String(), r2.String(), err.Error()) - } - - if result.String() != in2 { - t.Errorf("Inherits(%s,%s) should be %s but is %s", in1, in2, in2, result) - } - - if result.GetPointer().String() != "" { - t.Errorf("result(%v)::GetPointer() %v expect %v", result.String(), result.GetPointer().String(), "") - } -} - -func TestFileScheme(t *testing.T) { - - in1 := "file:///Users/mac/1.json#a" - in2 := "file:///Users/mac/2.json#b" - - r1, _ := New(in1) - r2, _ := New(in2) - - if r1.HasFragmentOnly != false { - t.Errorf("New(%v)::HasFragmentOnly %v expect %v", in1, r1.HasFragmentOnly, false) - } - - if r1.HasFileScheme != true { - t.Errorf("New(%v)::HasFileScheme %v expect %v", in1, r1.HasFileScheme, true) - } - - if r1.HasFullFilePath != true { - t.Errorf("New(%v)::HasFullFilePath %v expect %v", in1, r1.HasFullFilePath, true) - } - - if r1.IsCanonical() != true { - t.Errorf("New(%v)::IsCanonical %v expect %v", in1, r1.IsCanonical(), true) - } - - result, err := r1.Inherits(r2) - if err != nil { - t.Errorf("Inherits(%s,%s) should not fail. Error: %s", r1.String(), r2.String(), err.Error()) - } - if result.String() != in2 { - t.Errorf("Inherits(%s,%s) should be %s but is %s", in1, in2, in2, result) - } - - if result.GetPointer().String() != "" { - t.Errorf("result(%v)::GetPointer() %v expect %v", result.String(), result.GetPointer().String(), "") - } -} - -func TestReferenceResolution(t *testing.T) { - - // 5.4. Reference Resolution Examples - // http://tools.ietf.org/html/rfc3986#section-5.4 - - base := "http://a/b/c/d;p?q" - baseRef, err := New(base) - - if err != nil { - t.Errorf("New(%s) failed error: %s", base, err.Error()) - } - if baseRef.String() != base { - t.Errorf("New(%s) %s expected %s", base, baseRef.String(), base) - } - - checks := []string{ - // 5.4.1. Normal Examples - // http://tools.ietf.org/html/rfc3986#section-5.4.1 - - "g:h", "g:h", - "g", "http://a/b/c/g", - "./g", "http://a/b/c/g", - "g/", "http://a/b/c/g/", - "/g", "http://a/g", - "//g", "http://g", - "?y", "http://a/b/c/d;p?y", - "g?y", "http://a/b/c/g?y", - "#s", "http://a/b/c/d;p?q#s", - "g#s", "http://a/b/c/g#s", - "g?y#s", "http://a/b/c/g?y#s", - ";x", "http://a/b/c/;x", - "g;x", "http://a/b/c/g;x", - "g;x?y#s", "http://a/b/c/g;x?y#s", - "", "http://a/b/c/d;p?q", - ".", "http://a/b/c/", - "./", "http://a/b/c/", - "..", "http://a/b/", - "../", "http://a/b/", - "../g", "http://a/b/g", - "../..", "http://a/", - "../../", "http://a/", - "../../g", "http://a/g", - - // 5.4.2. Abnormal Examples - // http://tools.ietf.org/html/rfc3986#section-5.4.2 - - "../../../g", "http://a/g", - "../../../../g", "http://a/g", - - "/./g", "http://a/g", - "/../g", "http://a/g", - "g.", "http://a/b/c/g.", - ".g", "http://a/b/c/.g", - "g..", "http://a/b/c/g..", - "..g", "http://a/b/c/..g", - - "./../g", "http://a/b/g", - "./g/.", "http://a/b/c/g/", - "g/./h", "http://a/b/c/g/h", - "g/../h", "http://a/b/c/h", - "g;x=1/./y", "http://a/b/c/g;x=1/y", - "g;x=1/../y", "http://a/b/c/y", - - "g?y/./x", "http://a/b/c/g?y/./x", - "g?y/../x", "http://a/b/c/g?y/../x", - "g#s/./x", "http://a/b/c/g#s/./x", - "g#s/../x", "http://a/b/c/g#s/../x", - - "http:g", "http:g", // for strict parsers - //"http:g", "http://a/b/c/g", // for backward compatibility - - } - for i := 0; i < len(checks); i += 2 { - child := checks[i] - expected := checks[i+1] - // fmt.Printf("%d: %v -> %v\n", i/2, child, expected) - - childRef, e := New(child) - if e != nil { - t.Errorf("%d: New(%s) failed error: %s", i/2, child, e.Error()) - } - - res, e := baseRef.Inherits(childRef) - if res == nil { - t.Errorf("%d: Inherits(%s, %s) nil not expected", i/2, base, child) - } - if e != nil { - t.Errorf("%d: Inherits(%s) failed error: %s", i/2, child, e.Error()) - } - if res.String() != expected { - t.Errorf("%d: Inherits(%s, %s) %s expected %s", i/2, base, child, res.String(), expected) - } - } -} diff --git a/vendor/github.com/go-openapi/spec/.editorconfig b/vendor/github.com/go-openapi/spec/.editorconfig deleted file mode 100644 index 3152da69..00000000 --- a/vendor/github.com/go-openapi/spec/.editorconfig +++ /dev/null @@ -1,26 +0,0 @@ -# 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 diff --git a/vendor/github.com/go-openapi/spec/.github/CONTRIBUTING.md b/vendor/github.com/go-openapi/spec/.github/CONTRIBUTING.md deleted file mode 100644 index 7dea4240..00000000 --- a/vendor/github.com/go-openapi/spec/.github/CONTRIBUTING.md +++ /dev/null @@ -1,117 +0,0 @@ -## 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`. diff --git a/vendor/github.com/go-openapi/spec/.gitignore b/vendor/github.com/go-openapi/spec/.gitignore deleted file mode 100644 index dd91ed6a..00000000 --- a/vendor/github.com/go-openapi/spec/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -secrets.yml -coverage.out diff --git a/vendor/github.com/go-openapi/spec/.golangci.yml b/vendor/github.com/go-openapi/spec/.golangci.yml deleted file mode 100644 index ed53e5cd..00000000 --- a/vendor/github.com/go-openapi/spec/.golangci.yml +++ /dev/null @@ -1,21 +0,0 @@ -linters-settings: - govet: - check-shadowing: true - golint: - min-confidence: 0 - gocyclo: - min-complexity: 25 - maligned: - suggest-new: true - dupl: - threshold: 100 - goconst: - min-len: 2 - min-occurrences: 2 - -linters: - enable-all: true - disable: - - maligned - - unparam - - lll diff --git a/vendor/github.com/go-openapi/spec/.travis.yml b/vendor/github.com/go-openapi/spec/.travis.yml deleted file mode 100644 index a4f03484..00000000 --- a/vendor/github.com/go-openapi/spec/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -after_success: -- bash <(curl -s https://codecov.io/bash) -go: -- '1.9' -- 1.10.x -- 1.11.x -install: -- go get -u github.com/stretchr/testify -- go get -u github.com/go-openapi/swag -- go get -u gopkg.in/yaml.v2 -- go get -u github.com/go-openapi/jsonpointer -- go get -u github.com/go-openapi/jsonreference -language: go -notifications: - slack: - secure: QUWvCkBBK09GF7YtEvHHVt70JOkdlNBG0nIKu/5qc4/nW5HP8I2w0SEf/XR2je0eED1Qe3L/AfMCWwrEj+IUZc3l4v+ju8X8R3Lomhme0Eb0jd1MTMCuPcBT47YCj0M7RON7vXtbFfm1hFJ/jLe5+9FXz0hpXsR24PJc5ZIi/ogNwkaPqG4BmndzecpSh0vc2FJPZUD9LT0I09REY/vXR0oQAalLkW0asGD5taHZTUZq/kBpsNxaAFrLM23i4mUcf33M5fjLpvx5LRICrX/57XpBrDh2TooBU6Qj3CgoY0uPRYUmSNxbVx1czNzl2JtEpb5yjoxfVPQeg0BvQM00G8LJINISR+ohrjhkZmAqchDupAX+yFrxTtORa78CtnIL6z/aTNlgwwVD8kvL/1pFA/JWYmKDmz93mV/+6wubGzNSQCstzjkFA4/iZEKewKUoRIAi/fxyscP6L/rCpmY/4llZZvrnyTqVbt6URWpopUpH4rwYqreXAtJxJsfBJIeSmUIiDIOMGkCTvyTEW3fWGmGoqWtSHLoaWDyAIGb7azb+KvfpWtEcoPFWfSWU+LGee0A/YsUhBl7ADB9A0CJEuR8q4BPpKpfLwPKSiKSAXL7zDkyjExyhtgqbSl2jS+rKIHOZNL8JkCcTP2MKMVd563C5rC5FMKqu3S9m2b6380E= -script: -- go test -v -race -cover -coverprofile=coverage.txt -covermode=atomic ./... diff --git a/vendor/github.com/go-openapi/spec/CODE_OF_CONDUCT.md b/vendor/github.com/go-openapi/spec/CODE_OF_CONDUCT.md deleted file mode 100644 index 9322b065..00000000 --- a/vendor/github.com/go-openapi/spec/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,74 +0,0 @@ -# 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/ diff --git a/vendor/github.com/go-openapi/spec/LICENSE b/vendor/github.com/go-openapi/spec/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/vendor/github.com/go-openapi/spec/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - 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. diff --git a/vendor/github.com/go-openapi/spec/README.md b/vendor/github.com/go-openapi/spec/README.md deleted file mode 100644 index 6354742c..00000000 --- a/vendor/github.com/go-openapi/spec/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# OAI object model [![Build Status](https://travis-ci.org/go-openapi/spec.svg?branch=master)](https://travis-ci.org/go-openapi/spec) [![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) -[![GoDoc](https://godoc.org/github.com/go-openapi/spec?status.svg)](http://godoc.org/github.com/go-openapi/spec) -[![GolangCI](https://golangci.com/badges/github.com/go-openapi/spec.svg)](https://golangci.com) -[![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. - -Currently supports Swagger 2.0. diff --git a/vendor/github.com/go-openapi/spec/auth_test.go b/vendor/github.com/go-openapi/spec/auth_test.go deleted file mode 100644 index 5449fdec..00000000 --- a/vendor/github.com/go-openapi/spec/auth_test.go +++ /dev/null @@ -1,128 +0,0 @@ -// 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) - -} diff --git a/vendor/github.com/go-openapi/spec/bindata.go b/vendor/github.com/go-openapi/spec/bindata.go deleted file mode 100644 index 1717ea10..00000000 --- a/vendor/github.com/go-openapi/spec/bindata.go +++ /dev/null @@ -1,260 +0,0 @@ -// Code generated by go-bindata. -// sources: -// schemas/jsonschema-draft-04.json -// schemas/v2/schema.json -// DO NOT EDIT! - -package spec - -import ( - "bytes" - "compress/gzip" - "fmt" - "io" - "io/ioutil" - "os" - "path/filepath" - "strings" - "time" -) - -func bindataRead(data []byte, name string) ([]byte, error) { - gz, err := gzip.NewReader(bytes.NewBuffer(data)) - if err != nil { - return nil, fmt.Errorf("Read %q: %v", name, err) - } - - var buf bytes.Buffer - _, err = io.Copy(&buf, gz) - clErr := gz.Close() - - if err != nil { - return nil, fmt.Errorf("Read %q: %v", name, err) - } - if clErr != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -type asset struct { - bytes []byte - info os.FileInfo -} - -type bindataFileInfo struct { - name string - size int64 - mode os.FileMode - modTime time.Time -} - -func (fi bindataFileInfo) Name() string { - return fi.name -} -func (fi bindataFileInfo) Size() int64 { - return fi.size -} -func (fi bindataFileInfo) Mode() os.FileMode { - return fi.mode -} -func (fi bindataFileInfo) ModTime() time.Time { - return fi.modTime -} -func (fi bindataFileInfo) IsDir() bool { - return false -} -func (fi bindataFileInfo) Sys() interface{} { - return nil -} - -var _jsonschemaDraft04JSON = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x57\x3d\x6f\xdb\x3c\x10\xde\xf3\x2b\x08\x26\x63\xf2\x2a\x2f\xd0\xc9\x5b\xd1\x2e\x01\x5a\x34\x43\x37\x23\x03\x6d\x9d\x6c\x06\x14\xa9\x50\x54\x60\xc3\xd0\x7f\x2f\x28\x4a\x14\x29\x91\x92\x2d\xa7\x8d\x97\x28\xbc\xaf\xe7\x8e\xf7\xc5\xd3\x0d\x42\x08\x61\x9a\xe2\x15\xc2\x7b\xa5\x8a\x55\x92\xbc\x96\x82\x3f\x94\xdb\x3d\xe4\xe4\x3f\x21\x77\x49\x2a\x49\xa6\x1e\x1e\xbf\x24\xe6\xec\x16\xdf\x1b\xa1\x3b\xf3\xff\x02\xc9\x14\xca\xad\xa4\x85\xa2\x82\x6b\xe9\x6f\x42\x02\x32\x2c\x28\x07\x45\x5a\x15\x3d\x77\x46\x39\xd5\xcc\x25\x5e\x21\x83\xb8\x21\x18\xb6\xaf\x52\x92\xa3\x47\x68\x88\xea\x58\x80\x56\x4e\x1a\xf2\xbd\x4f\xcc\x29\x7f\x52\x90\x6b\x7d\xff\x0f\x48\xb4\x3d\x3f\x21\x7c\x27\x21\xd3\x2a\x6e\x31\xaa\x2d\x53\xdd\xf3\xe3\x42\x94\x54\xd1\x77\x78\xe2\x0a\x76\x20\xe3\x20\x68\xcb\x30\x86\x41\xf3\x2a\xc7\x2b\xf4\x78\x8e\xfe\xef\x90\x91\x8a\xa9\xc7\xb1\x1d\xc2\xd8\x2f\x0d\x75\xed\xc1\x4e\x9c\xc8\x25\x43\xac\xa8\xbe\xd7\xcc\xa9\xd1\xa9\x21\xa0\x1a\xbd\x04\x61\x94\x34\x2f\x18\xfc\x3e\x16\x50\x8e\x4d\x03\x6f\x1c\x58\xdb\x48\x23\xbc\x11\x82\x01\xe1\xfa\xd3\x3a\x8e\x30\xaf\x18\x33\x7f\xf3\x8d\x39\x11\x9b\x57\xd8\x2a\xfd\x55\x2a\x49\xf9\x0e\xc7\xec\x37\xd4\x25\xf7\xec\x5c\x66\xc7\xd7\x99\xaa\xcf\x4f\x89\x8a\xd3\xb7\x0a\x3a\xaa\x92\x15\xf4\x30\x6f\x1c\xb0\xd6\x46\xe7\x98\x39\x2d\xa4\x28\x40\x2a\x3a\x88\x9e\x29\xba\x88\x37\x2d\xca\x60\x38\xfa\xba\x5b\x20\xac\xa8\x62\xb0\x4c\xd4\xaf\xda\x45\x0a\xba\x5c\x3b\xb9\xc7\x79\xc5\x14\x2d\x18\x34\x19\x1c\x51\xdb\x25\x4d\xb4\x7e\x06\x14\x38\x6c\x59\x55\xd2\x77\xf8\x69\x59\xfc\x7b\x73\xed\x93\x43\xcb\x32\x6d\x3c\x28\xdc\x1b\x9a\xd3\x62\xab\xc2\x27\xf7\x41\xc9\x08\x2b\x23\x08\xad\x13\x57\x21\x9c\xd3\x72\x0d\x42\x72\xf8\x01\x7c\xa7\xf6\x83\xce\x39\xd7\x82\x3c\x1f\x2f\xd6\x60\x1b\xa2\xdf\x35\x89\x52\x20\xe7\x73\x74\xe0\x66\x26\x64\x4e\xb4\x97\x58\xc2\x0e\x0e\xe1\x60\x92\x34\x6d\xa0\x10\xd6\xb5\x83\x61\x27\xe6\x47\xd3\x89\xbd\x63\xfd\x3b\x8d\x03\x3d\x6c\x42\x2d\x5b\x70\xee\xe8\xdf\x4b\xf4\x66\x4e\xe1\x01\x45\x17\x80\x74\xad\x4f\xc3\xf3\xae\xc6\x1d\xc6\xd7\xc2\xce\xc9\xe1\x29\x30\x86\x2f\x4a\xa6\x4b\x15\x84\x73\xc9\x6f\xfd\x7f\xa5\x6e\x9e\xbd\xf1\xb0\xd4\xdd\x45\x5a\xc2\x3e\x4b\x78\xab\xa8\x84\x74\x4a\x91\x3b\x92\x23\x05\xf2\x1c\x1e\x7b\xf3\x09\xf8\xcf\xab\x24\xb6\x60\xa2\xe8\x4c\x9f\x75\x77\xaa\x8c\xe6\x01\x45\x36\x86\xcf\xc3\x63\x3a\xea\xd4\x8d\x7e\x06\xac\x14\x0a\xe0\x29\xf0\xed\x07\x22\x1a\x65\xda\x44\xae\xa2\x73\x1a\xe6\x90\x69\xa2\x8c\x46\xb2\x2f\xde\x49\x38\x08\xed\xfe\xfd\x41\xaf\x9f\xa9\x55\xd7\xdd\x22\x8d\xfa\x45\x63\xc5\x0f\x80\xf3\xb4\x08\xd6\x79\x30\x9e\x93\xee\x59\xa6\xd0\x4b\xee\x22\xe3\x33\xc1\x3a\x27\x68\x36\x78\x7e\x87\x0a\x06\xd5\x2e\x20\xd3\xaf\x15\xfb\xd8\x3b\x73\x14\xbb\x92\xed\x05\x5d\x2e\x29\x38\x2c\x94\xe4\x42\x45\x5e\xd3\xb5\x7d\xdf\x47\xca\x38\xb4\x5c\xaf\xfb\x7d\xdd\x6d\xf4\xa1\x2d\x77\xdd\x2f\xce\x6d\xc4\x7b\x8b\x4e\x67\xa9\x6f\xfe\x04\x00\x00\xff\xff\xb1\xd1\x27\x78\x05\x11\x00\x00") - -func jsonschemaDraft04JSONBytes() ([]byte, error) { - return bindataRead( - _jsonschemaDraft04JSON, - "jsonschema-draft-04.json", - ) -} - -func jsonschemaDraft04JSON() (*asset, error) { - bytes, err := jsonschemaDraft04JSONBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "jsonschema-draft-04.json", size: 4357, mode: os.FileMode(420), modTime: time.Unix(1523760398, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _v2SchemaJSON = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5d\x4f\x93\xdb\x36\xb2\xbf\xfb\x53\xa0\x14\x57\xd9\xae\xd8\x92\xe3\xf7\x2e\xcf\x97\xd4\xbc\xd8\x49\x66\x37\x5e\x4f\x79\x26\xbb\x87\x78\x5c\x05\x91\x2d\x09\x09\x09\x30\x00\x38\x33\x5a\xef\x7c\xf7\x2d\xf0\x9f\x08\x02\x20\x41\x8a\xd2\xc8\x0e\x0f\xa9\x78\x28\xa0\xd1\xdd\x68\x34\x7e\xdd\xf8\xf7\xf9\x11\x42\x33\x49\x64\x04\xb3\xd7\x68\x76\x86\xfe\x76\xf9\xfe\x1f\xe8\x32\xd8\x40\x8c\xd1\x8a\x71\x74\x79\x8b\xd7\x6b\xe0\xe8\xd5\xfc\x25\x3a\xbb\x38\x9f\xcf\x9e\xab\x0a\x24\x54\xa5\x37\x52\x26\xaf\x17\x0b\x91\x17\x99\x13\xb6\xb8\x79\xb5\x10\x59\xdd\xf9\xef\x82\xd1\x6f\xf2\xc2\x8f\xf3\x4f\xb5\x1a\xea\xc7\x17\x45\x41\xc6\xd7\x8b\x90\xe3\x95\x7c\xf1\xf2\x7f\x8b\xca\x45\x3d\xb9\x4d\x32\xa6\xd8\xf2\x77\x08\x64\xfe\x8d\xc3\x9f\x29\xe1\xa0\x9a\xff\xed\x11\x42\x08\xcd\x8a\xd6\xb3\x9f\x15\x67\x74\xc5\xca\x7f\x27\x58\x6e\xc4\xec\x11\x42\xd7\x59\x5d\x1c\x86\x44\x12\x46\x71\x74\xc1\x59\x02\x5c\x12\x10\xb3\xd7\x68\x85\x23\x01\x59\x81\x04\x4b\x09\x9c\x6a\xbf\x7e\xce\x49\x7d\xba\x7b\x51\xfd\xa1\x44\xe2\xb0\x52\xac\x7d\xb3\x08\x61\x45\x68\x46\x56\x2c\x6e\x80\x86\x8c\xbf\xbd\x93\x40\x05\x61\x74\x96\x95\xbe\x7f\x84\xd0\x7d\x4e\xde\x42\xb7\xe4\xbe\x46\xbb\x14\x5b\x48\x4e\xe8\xba\x90\x05\xa1\x19\xd0\x34\xae\xc4\xce\xbe\xbc\x9a\xbf\x9c\x15\x7f\x5d\x57\xc5\x42\x10\x01\x27\x89\xe2\x48\x51\xb9\xda\x40\xd5\x87\x37\xc0\x15\x5f\x88\xad\x90\xdc\x10\x81\x42\x16\xa4\x31\x50\x39\x2f\x38\xad\xab\xb0\x53\xd8\xac\x94\x56\x6f\xc3\x84\xf4\x11\xa4\x50\xb3\xfa\xe9\xd3\x6f\x9f\x3e\xdf\x2f\xd0\xeb\x8f\x1f\x3f\x7e\xbc\xfe\xf6\xe9\xf7\xaf\x5f\x7f\xfc\x18\x7e\xfb\xec\xfb\xc7\xb3\x36\x79\x54\x43\xe8\x29\xc5\x31\x20\xc6\x11\x49\x9e\xe5\x12\x41\x66\xa0\xe8\xed\x1d\x8e\x93\x08\x5e\xa3\x27\x3b\xc3\x7c\xa2\x73\xba\xc4\x02\x2e\xb0\xdc\xf4\xe5\x76\xd1\xca\x96\xa2\x8a\x94\xcd\x21\xc9\x6c\xec\x2c\x70\x42\x9e\x34\x74\x9d\x19\x7c\xcd\x20\x9c\xea\x2e\x0a\xfe\x42\x84\xd4\x29\x04\x8c\x8a\xb4\x41\xa2\xc1\xdc\x19\x8a\x88\x90\x4a\x49\xef\xce\xdf\xbd\x45\x4a\x52\x81\x70\x10\x40\x22\x21\x44\xcb\x6d\xc5\xec\x4e\x3c\x1c\x45\xef\x57\x9a\xb5\x7d\xae\xfe\xe5\xe4\x31\x86\x90\xe0\xab\x6d\x02\x3b\x2e\xcb\x11\x90\xd9\xa8\xc6\x77\xc2\x59\x98\x06\xfd\xf9\x2e\x78\x45\x01\xa6\xa8\xa0\x71\x5c\xbe\x33\xa7\xd2\xd9\x5f\x95\xef\xd9\xd5\xac\xfd\xdc\x5d\xbf\x5e\xb8\xd1\x3e\xc7\x31\x48\xe0\x5e\x4c\x14\x65\xdf\xb8\xa8\x71\x10\x09\xa3\xc2\xc7\x02\xcb\xa2\x4e\x5a\x02\x82\x94\x13\xb9\xf5\x30\xe6\xb2\xa4\xb5\xfe\x9b\x3e\x7a\xb2\x55\xd2\xa8\x4a\xbc\x16\xb6\x71\x8e\x39\xc7\xdb\x9d\xe1\x10\x09\x71\xbd\x9c\xb3\x41\x89\xd7\xa5\x89\xdc\x57\xb5\x53\x4a\xfe\x4c\xe1\xbc\xa0\x21\x79\x0a\x1a\x0f\x70\xa7\x5c\x08\x8e\xde\xb0\xc0\x43\x24\xad\x74\x63\x0e\xb1\xd9\x90\xe1\xb0\x2d\x13\xa7\x6d\x78\xfd\x04\x14\x38\x8e\x90\xaa\xce\x63\xac\x3e\x23\xbc\x64\xa9\xb4\xf8\x03\x63\xde\xcd\xbe\x16\x13\x4a\x55\xac\x82\x12\xc6\xac\xd4\x35\xf7\x22\xd4\x3a\xff\x22\x73\x0e\x6e\x51\xa0\x75\x1e\xae\x8f\xe8\x5d\xc7\x59\xe6\xe4\x9a\x18\x8d\xd6\x1c\x53\x84\x4d\xb7\x67\x28\x37\x09\x84\x69\x88\x12\x0e\x01\x11\x80\x32\xa2\xf5\xb9\xaa\xc6\xd9\x73\x53\xab\xfb\xb4\x2e\x20\xc6\x54\x92\xa0\x9a\xf3\x69\x1a\x2f\x81\x77\x37\xae\x53\x1a\xce\x40\xc4\xa8\x82\x1c\xb5\xef\xda\x24\x7d\xb9\x61\x69\x14\xa2\x25\xa0\x90\xac\x56\xc0\x81\x4a\xb4\xe2\x2c\xce\x4a\x64\x7a\x9a\x23\xf4\x13\x91\x3f\xa7\x4b\xf4\x63\x84\x6f\x18\x87\x10\xbd\xc3\xfc\x8f\x90\xdd\x52\x44\x04\xc2\x51\xc4\x6e\x21\x74\x48\x21\x81\xc7\xe2\xfd\xea\x12\xf8\x0d\x09\xf6\xe9\x47\x35\xaf\x67\xc4\x14\xf7\x22\x27\x97\xe1\xe2\x76\x2d\x06\x8c\x4a\x1c\x48\x3f\x73\x2d\x0b\x5b\x29\x45\x24\x00\x2a\x0c\x11\xec\x94\xca\xc2\xa6\xc1\x37\x21\x43\x83\x3b\x5f\x97\xf1\x43\x5e\x53\x73\x19\xa5\x36\xd8\x2d\x05\x2e\x34\x0b\xeb\x39\xfc\x1d\x63\x51\x01\xbd\x3d\xbb\x90\x84\x40\x25\x59\x6d\x09\x5d\xa3\x1c\x37\xe6\x5c\x16\x9a\x40\x09\x70\xc1\xe8\x82\xf1\x35\xa6\xe4\xdf\x99\x5c\x8e\x9e\x4d\x79\xb4\x27\x2f\xbf\x7e\xf8\x05\x25\x8c\x50\xa9\x98\x29\x90\x62\x60\xea\x75\xae\x13\xca\xbf\x2b\x1a\x29\x27\x76\xd6\x20\xc6\x64\x5f\xe6\x32\x1a\x08\x87\x21\x07\x21\xbc\xb4\xe4\xe0\x32\x67\xa6\xcd\xf3\x1e\xcd\xd9\x6b\xb6\x6f\x8e\x27\xa7\xed\xdb\xe7\xbc\xcc\x1a\x07\xce\x6f\x87\x33\xf0\xba\x51\x17\x22\x66\x78\x79\x8e\xce\xe5\x13\x81\x80\x06\x2c\xe5\x78\x0d\xa1\xb2\xb8\x54\xa8\x79\x09\xbd\xbf\x3c\x47\x01\x8b\x13\x2c\xc9\x32\xaa\xaa\x1d\xd5\xee\xab\x36\xbd\x6c\xfd\x54\x6c\xc8\x08\x01\x3c\xbd\xe7\x07\x88\xb0\x24\x37\x79\x90\x28\x4a\x1d\x10\x1a\x92\x1b\x12\xa6\x38\x42\x40\xc3\x4c\x43\x62\x8e\xae\x36\xb0\x45\x71\x2a\xa4\x9a\x23\x79\x59\xb1\xa8\xf2\xa4\x0c\x60\x9f\xcc\x8d\x40\xf5\x80\xca\xa8\x99\xc3\xa7\x85\x1f\x31\x25\xa9\x82\xc5\x6d\xbd\xd8\x36\x76\x7c\x02\x28\x97\xf6\x1d\x74\x3b\x11\x7e\x91\xae\x32\xf8\x6c\xf4\xe6\x7b\x9a\xa5\x1f\x62\xc6\x21\xcf\x9a\xe5\xed\x8b\x02\xf3\x2c\x33\x33\xdf\x00\xca\xc9\x09\xb4\x04\xf5\xa5\x08\xd7\xc3\x02\x18\x66\xf1\xab\x1e\x83\x37\x4c\xcd\x12\xc1\x1d\x50\xf6\xaa\xbd\xfe\xe2\x73\x48\x38\x08\xa0\x32\x9b\x18\x44\x86\x0b\x6a\xc1\xaa\x26\x96\x2d\x96\x3c\xa0\x54\x65\x73\x87\x15\xca\x15\xe5\xf5\x94\x46\x9f\x33\x1a\x0c\x9a\xb1\x5a\xd9\x6a\x95\xcd\xcb\x7e\xec\x9a\xc5\x94\x3b\x37\x26\x31\xd7\xfc\xe4\x1f\x13\x8c\x31\x75\x9c\xba\xf7\x87\x3c\xa1\xb7\x4f\x17\x1b\x09\x82\x98\xc4\x70\x95\xd3\xe8\x4c\x48\x5a\xa6\xd6\x2a\x3d\x56\x42\x80\x9f\xaf\xae\x2e\x50\x0c\x42\xe0\x35\x34\x3c\x8a\x62\x03\x37\xba\xb2\x27\x04\xda\x25\x8d\x06\xe2\xa0\x13\x8a\xf3\xf5\xec\x10\x72\x67\x88\x90\x3d\x4b\x64\xeb\xaa\xda\x8f\xf7\x5a\x75\x47\x9a\xa8\x51\x70\x26\xd2\x38\xc6\x7c\xbb\x57\xfc\xbd\xe4\x04\x56\xa8\xa0\x54\x9a\x45\xd5\xf7\x0f\x16\xfc\x57\x1c\x3c\xdf\x23\xba\x77\x38\xda\x16\x4b\x31\x53\x6a\x4d\x9a\x15\x63\xe7\xe1\x18\x69\x9f\x22\xe0\x24\xbb\x94\x4b\x97\xee\x2d\xf9\x70\x87\x72\x7b\xe6\xc4\x33\x2a\x66\x5e\x1c\x35\x72\xe3\x2d\xda\x73\xe4\xc7\x51\x6d\xa4\xa1\x2a\x4f\xde\x94\xcb\xb2\x3e\x31\x48\xae\x82\xce\xc9\xc8\x65\xcd\xc3\xb7\x34\xb6\x2b\xdf\x58\x65\x78\x6e\x73\xac\x5e\x24\x0d\x3f\xdc\x70\x23\xc6\xda\x52\x0b\x2d\x63\x7d\xa9\x49\x2d\x54\x48\x28\xc0\x12\x9c\xe3\x63\xc9\x58\x04\x98\x36\x07\xc8\x0a\xa7\x91\xd4\xf0\xbc\xc1\xa8\xb9\x70\xd0\xc6\xa9\xb6\x78\x80\x5a\xa3\xb4\x2c\xf4\x18\x0b\x8a\x9d\xd0\xb4\x55\x10\xee\x0d\xc5\xd6\xe0\x99\x93\xdc\xa1\x04\xbb\xf1\xa7\x23\xd1\xd1\x97\x8c\x87\x13\x0a\x21\x02\xe9\x99\x25\xed\x20\xc5\x92\x66\x3c\x32\x9c\xd6\x06\xb0\x31\x5c\x86\x29\x0a\xcb\x60\x33\x12\xa5\x91\xfc\x96\x75\xd0\x59\xd7\x13\xbd\xd3\x23\x79\xdd\x2a\x90\xa6\x38\x06\x91\x39\x7f\x20\x72\x03\x1c\x2d\x01\x61\xba\x45\x37\x38\x22\x61\x8e\x71\x85\xc4\x32\x15\x28\x60\x61\x16\xb8\x3d\x29\xdc\x4d\x3d\x2f\x12\x13\x7d\xc8\x7e\x37\xee\xa8\x7f\xfa\xdb\xcb\x17\xff\x77\xfd\xf9\x7f\xee\x9f\x3d\xfe\xcf\xa7\xa7\x45\xfb\xcf\x1e\xf7\xf3\xe0\xff\xc4\x51\x0a\x8e\x4c\xcb\x01\xdc\x0a\x65\xb2\x01\x83\xed\x3d\xe4\xa9\xa3\x4e\x2d\x59\xc5\xe8\x2f\x48\x7d\x5a\x6e\x37\xbf\x5c\x9f\x35\x13\x64\x14\xfa\xef\x0b\x68\xa6\x0d\xb4\x8e\xf1\xa8\xff\xbb\x60\xf4\x03\x64\xab\x5b\x81\x65\x51\xe6\xda\xca\xfa\xf0\xb0\xac\x3e\x9c\xca\x26\x0e\x1d\xdb\x57\x5b\xbb\xb4\x9a\xa6\xb6\x9b\x1a\x6b\xd1\x9a\x9e\x7e\x33\x9a\xec\x41\x69\x45\x22\xb8\xb4\x51\xeb\x04\x77\xca\x6f\x7b\x7b\xc8\xb2\xb0\x95\x92\x25\x5b\xd0\x42\xaa\x2a\xdd\x32\x78\x4f\x0c\xab\x68\x46\x6c\xea\x6d\xf4\x5c\x5e\xde\xc4\xac\xa5\xf9\xd1\x00\x9f\x7d\x98\x65\x24\xbd\xc7\x97\xd4\xb3\x3a\xa8\x2b\xa0\x34\x76\xf9\x65\x5f\x2d\x25\x95\x1b\xcf\xd6\xf4\x9b\x5f\x09\x95\xb0\x36\x3f\xdb\xd0\x39\x2a\x93\x1c\x9d\x03\xa2\x4a\xca\xf5\xf6\x10\xb6\x94\x89\x0b\x6a\x70\x12\x13\x49\x6e\x40\xe4\x29\x12\x2b\xbd\x80\x45\x11\x04\xaa\xc2\x8f\x56\x9e\x5c\x6b\xec\x8d\x5a\x0e\x14\x59\x06\x2b\x1e\x24\xcb\xc2\x56\x4a\x31\xbe\x23\x71\x1a\xfb\x51\x2a\x0b\x3b\x1c\x48\x10\xa5\x82\xdc\xc0\xbb\x3e\x24\x8d\x5a\x76\x2e\x09\xed\xc1\x65\x51\xb8\x83\xcb\x3e\x24\x8d\x5a\x2e\x5d\xfe\x02\x74\x2d\x3d\xf1\xef\xae\xb8\x4b\xe6\x5e\xd4\xaa\xe2\x2e\x5c\x5e\xec\x0e\xf5\x5b\x0c\xcb\x0a\xbb\xa4\x3c\xf7\x1f\x2a\x55\x69\x97\x8c\x7d\x68\x95\xa5\xad\xb4\xf4\x9c\xa5\x07\xb9\x7a\x05\xbb\xad\x50\x6f\xfb\xa0\x4e\x9b\x48\x23\x49\x92\x28\x87\x19\x3e\x32\xee\xca\x3b\x46\x7e\x7f\x18\x64\xcc\xcc\x0f\x34\xe9\x36\x8b\xb7\x6c\xa8\xa5\x5b\x54\x4c\x54\x5b\x15\x3a\xf1\x6c\x2d\xfe\x96\xc8\x0d\xba\x7b\x81\x88\xc8\x23\xab\xee\x7d\x3b\x92\xa7\x60\x29\xe3\xdc\xff\xb8\x64\xe1\xf6\xa2\x5a\x59\xdc\x6f\xeb\x45\x7d\x6a\xd1\x76\x1e\xea\xb8\xf1\xfa\x14\xd3\x36\x63\xe5\xd7\xf3\xe4\xbe\x25\xbd\x5e\x05\xeb\x73\x74\xb5\x21\x2a\x2e\x4e\xa3\x30\xdf\xbf\x43\x28\x2a\xd1\xa5\x2a\x9d\x8a\xfd\x76\xd8\x8d\xbc\x67\x65\xc7\xb8\x03\x45\xec\xa3\xb0\x37\x8a\x70\x4c\x68\x91\x51\x8e\x58\x80\xed\x4a\xf3\x81\x62\xca\x96\xbb\xf1\x52\xcd\x80\xfb\xe4\x4a\x5d\x6c\xdf\x6e\x20\x4b\x80\x30\x8e\x28\x93\xf9\xe9\x8d\x8a\x6d\xd5\x59\x65\x7b\xaa\x44\x9e\xc0\xc2\xd1\x7c\x40\x26\xd6\x1a\xce\xf9\xc5\x69\x7b\x6c\xec\xc8\x71\x7b\xe5\x21\x2e\xd3\xe5\x65\x93\x91\x53\x0b\x7b\x3a\xc7\xfa\x17\x6a\x01\xa7\x33\xd0\xf4\x40\x0f\x39\x87\xda\xe4\x54\x87\x3a\xd5\xe3\xc7\xa6\x8e\x20\xd4\x11\xb2\x4e\xb1\xe9\x14\x9b\x4e\xb1\xe9\x14\x9b\xfe\x15\x63\xd3\x47\xf5\xff\x97\x38\xe9\xcf\x14\xf8\x76\x82\x49\x13\x4c\xaa\x7d\xcd\x6c\x62\x42\x49\x87\x43\x49\x19\x33\x6f\xe3\x44\x6e\x9b\xab\x8a\x3e\x86\xaa\x99\x52\x1b\x5b\x59\x33\x02\x09\xa0\x21\xa1\x6b\x84\x6b\x66\xbb\xdc\x16\x0c\xd3\x68\xab\xec\x36\x4b\xd8\x60\x8a\x40\x31\x85\x6e\x14\x57\x13\xc2\xfb\x92\x10\xde\xbf\x88\xdc\xbc\x53\x5e\x7f\x82\x7a\x13\xd4\x9b\xa0\xde\x04\xf5\x90\x01\xf5\x94\xcb\x7b\x83\x25\x9e\xd0\xde\x84\xf6\x6a\x5f\x4b\xb3\x98\x00\xdf\x04\xf8\x6c\xbc\x7f\x19\x80\xaf\xf1\x71\x45\x22\x98\x40\xe0\x04\x02\x27\x10\xd8\x29\xf5\x04\x02\xff\x4a\x20\x30\xc1\x72\xf3\x65\x02\x40\xd7\xc1\xd1\xe2\x6b\xf1\xa9\x7b\xfb\xe4\x20\xc0\x68\x9d\xd4\xb4\xd3\x96\xb5\xa6\xd1\x41\x20\xe6\x89\xc3\x48\x65\x58\x13\x84\x9c\x56\x56\x3b\x0c\xe0\x6b\x83\x5c\x13\xd2\x9a\x90\xd6\x84\xb4\x26\xa4\x85\x0c\xa4\x45\x19\xfd\xff\x63\x6c\x52\xb5\x1f\x1e\x19\x74\x3a\xcd\xb9\x69\xce\xa6\x3a\x0f\x7a\x2d\x19\xc7\x81\x14\x5d\xcb\xd5\x03\xc9\x39\xd0\xb0\xd1\xb3\xcd\xfb\x7a\x2d\x5d\x3a\x48\xe1\xfa\x2e\xe6\x81\x42\x18\x86\xd6\xc1\xbe\xb1\x23\xd3\xf7\x34\xed\x19\x0a\x0b\xc4\x48\x44\xfd\x22\x50\xb6\x42\x58\xbb\xe5\x3d\xa7\x73\xd4\x8b\xc4\x8c\x70\x61\xec\x73\xee\xc3\x81\x8b\xf5\xe2\xd7\x52\x3e\xcf\xeb\xeb\x17\x3b\x71\x16\xda\x7d\xb8\xde\xf0\x7a\x8f\x06\x2d\xa7\x40\x7b\xc1\x9d\x41\x4d\xb6\x61\xa2\x4e\x9f\x3d\xa0\xc5\xae\xe3\x1c\x1d\x40\x6c\x48\x8b\x63\xa0\xb5\x01\xed\x8e\x02\xe9\x86\xc8\x3b\x06\xee\xdb\x4b\xde\xbd\xc0\xa1\x6f\xcb\xda\xfc\xc2\x44\x16\x87\x9c\x17\x31\xd3\x30\x20\x39\x42\xcb\x6f\xf2\xf1\xf4\x72\x10\xf8\x1c\xa0\xf3\xbd\x10\xea\x21\x35\x7d\xe8\x86\xdb\x15\xed\x81\x81\x07\x28\xbb\x13\x28\xc7\xf8\xce\x7d\x8d\xc2\x31\xb4\x7e\x94\xd6\xdb\x55\xef\x4a\xfb\xed\xc3\x40\x3e\xeb\x9f\xe9\x99\x0f\xdf\x08\x65\x88\x27\x73\x86\x31\x9d\x47\xdf\x55\x19\xba\x3d\xee\x15\x0a\xcd\x8c\xaa\x5e\xb9\xf6\x57\x33\x73\x5a\xa1\x89\x7b\x3b\xa0\xb2\xa4\xc2\xf6\xc1\x53\xb5\x00\xca\x23\xe5\xf4\x60\x6a\xb4\x2d\x74\xea\x4e\xed\x3b\xe3\x47\xfb\xed\x82\x3d\x19\xd4\x3b\x6b\xaf\xae\x2b\x2f\x57\xb3\x82\x68\xcb\xed\x88\x2e\xe1\x5c\xd7\x26\xfa\x0a\x65\xe7\xce\x11\x33\xb4\xdd\x66\xe3\x37\xf6\xfa\x70\xd6\x4f\xa1\x21\x51\xd8\x3c\x26\x14\x4b\xc6\x87\x44\x27\x1c\x70\xf8\x9e\x46\xce\xab\x21\x07\x5f\xc1\x76\x17\x1b\x77\xb4\xda\x75\xa0\x0a\x3a\x30\xe1\xf8\x97\x32\x16\x2b\x00\x75\x85\xee\x62\x46\xef\xd3\x85\xb5\x6b\x60\xbe\xf2\x30\x7a\x8c\x0b\x4b\xa6\xd0\xf9\x64\x42\xe7\x07\x41\x41\xe3\x2c\x5d\xf9\x6d\xe9\x39\x98\x3b\x3b\x5d\x67\xd4\x5c\xed\xf2\xf0\x48\x7b\xbd\x2d\x31\xdd\x3f\x34\xad\x44\x76\x51\x9a\x56\x22\xa7\x95\xc8\x69\x25\xf2\xe1\x56\x22\x1f\x00\x32\x6a\x73\x92\xed\xe1\xc6\x7d\x9f\x49\x2c\x69\x7e\xc8\x31\x4c\x0c\xb4\xf2\x54\x3b\x79\x3b\x9e\x4d\xb4\xd1\x18\x3e\x5f\x9a\x93\xa2\x11\xc3\xda\x27\x0b\xaf\x37\x2e\x5c\x37\xfb\xeb\x9a\xd6\xc3\xac\xc3\xcc\xf8\x1e\x5b\x9d\xac\x22\x64\xb7\xed\x26\xb8\xf3\xb9\x3c\xbb\x1f\xe2\xb0\x22\x77\x43\x6a\x62\x29\x39\x59\xa6\xe6\xe5\xcd\x7b\x83\xc0\x5b\x8e\x93\x64\xac\xeb\xca\x4f\x65\xac\x4a\xbc\x1e\xcd\x82\xfa\x3c\x70\x36\xb6\xb5\xed\x79\xef\xec\x68\x00\xff\x54\xfa\xb5\xe3\xf1\xdb\xe1\xbe\xce\x76\x17\xaf\x57\xb6\x6b\x89\x05\x09\xce\x52\xb9\x01\x2a\x49\xbe\xd9\xf4\xd2\xb8\x7a\xbf\x91\x02\xf3\x22\x8c\x13\xf2\x77\xd8\x8e\x43\x8b\xe1\x54\x6e\x5e\x9d\xc7\x49\x44\x02\x22\xc7\xa4\x79\x81\x85\xb8\x65\x3c\x1c\x93\xe6\x59\xa2\xf8\x1c\x51\x95\x05\xd9\x20\x00\x21\x7e\x60\x21\x58\xa9\x56\xff\xbe\xb6\x5a\x5e\x5b\x3f\x1f\xd6\xd3\x3c\xc4\x4d\xba\x99\xb4\x63\x6e\x7d\x3e\x3d\x57\xd2\x18\x5f\x47\xe8\xc3\x06\x8a\x68\x6c\x7f\x3b\x72\x0f\xe7\xe2\x77\x77\xf1\xd0\x99\xab\xdf\x2e\xfe\xd6\xbb\xcd\x1a\xb9\x90\xd1\xaf\xf2\x38\x3d\xdb\x74\xf8\xeb\xe3\xda\xe8\x2a\x62\xb7\xda\x1b\x07\xa9\xdc\x30\x5e\xbc\x68\xfb\x6b\x9f\x97\xf1\xc6\xb1\xd8\x5c\x29\x1e\x49\x30\xc5\xf7\xde\xad\x91\x42\xf9\xdd\xed\x89\x80\x25\xbe\x37\xd7\xe7\x32\x5c\xe6\x35\xac\xd4\x0c\x2d\xf7\x90\xc4\xe3\xf5\xe3\x2f\x7f\x54\x18\x88\xe3\x61\x47\x85\x64\x7f\xc0\xd7\x3f\x1a\x92\x42\xe9\xc7\x1e\x0d\x95\x76\xa7\x51\xa0\x8f\x02\x1b\x46\x9e\x06\x42\xd1\xf2\x01\x07\x02\xde\xe9\x7d\x1a\x0b\xa7\x32\x16\xcc\xc0\xee\xc4\x90\xd2\x5f\x6f\x98\x54\x5d\xf2\x95\xe1\xa7\x69\x10\x3a\x06\xe1\x65\xb3\x17\x47\x58\x78\xd0\x45\xd6\x5b\xd5\x5f\x25\x1d\x71\x49\xa6\x7a\x64\xda\xd0\x6f\xc7\x3a\x4c\xe3\x09\xc0\x6e\x96\x2c\xa7\xa7\x77\x34\x10\x05\x08\x21\x44\x92\x65\x77\xdf\x20\x5c\xbc\xe7\x97\x3f\xf4\x1a\x45\xd6\xe7\x27\x4a\xde\x74\x27\x66\x11\x7d\x70\xba\xd3\x78\xf9\x1e\x0d\xca\xc8\x39\xde\x7c\xb3\xa6\xe1\xbc\xd7\xc1\x6a\x6f\xb3\x0e\x52\xbe\xe4\x98\x8a\x15\x70\x94\x70\x26\x59\xc0\xa2\xf2\x1c\xfb\xd9\xc5\xf9\xbc\xd5\x92\x9c\xa3\xdf\xe6\x1e\xb3\x0d\x49\xba\x87\x50\x5f\x84\xfe\xe9\xd6\xf8\xbb\xe6\xf0\x7a\xeb\xa6\x65\x3b\x86\x8b\x79\x93\xf5\x59\x20\x6e\xb4\xa7\x44\xf4\x3f\xa5\xfe\x67\x42\x12\xdb\xd3\xe7\xbb\xa5\xa3\x8c\x5c\x2b\x97\xbb\xbb\x7f\x8e\xc5\x6e\xed\x43\x5c\xbf\x74\xc8\x8f\xff\xe6\xd6\xbe\x91\xb6\xf5\x95\xe4\xed\x93\xc4\xa8\x5b\xf9\x76\x4d\x35\xb7\xd8\x8c\xb6\x7d\xaf\x72\xe0\xb6\xbd\x01\x63\x9e\x76\xab\x1a\x32\x76\xe4\x8c\x76\xc2\xad\x6c\xa2\x65\xf7\xcf\xf8\xa7\xda\x2a\xb9\x8c\x3d\x3c\xa3\x9d\x64\x33\xe5\x1a\xb5\x2d\xfb\x86\xa2\x5a\x7f\x19\x5b\x7f\xc6\x3f\xd1\x53\xd3\xe2\x41\x5b\xd3\x4f\xf0\xec\xb0\x42\x73\x43\xd2\x68\x27\xd3\x6a\x6a\x34\xf6\x4e\x1e\x52\x8b\x87\x6c\xcc\xae\x44\xfb\x9e\xa7\x51\x4f\x9d\x55\x03\x81\x8e\x67\xfc\xb4\x69\xf0\x3a\x18\xf2\x40\xd0\xf6\xa8\x34\xe3\xc9\x98\xaf\xf6\xda\x24\xd3\xeb\x60\xb9\x0e\xd3\x1f\xa9\xff\xee\x1f\xfd\x37\x00\x00\xff\xff\x69\x5d\x0a\x6a\x39\x9d\x00\x00") - -func v2SchemaJSONBytes() ([]byte, error) { - return bindataRead( - _v2SchemaJSON, - "v2/schema.json", - ) -} - -func v2SchemaJSON() (*asset, error) { - bytes, err := v2SchemaJSONBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "v2/schema.json", size: 40249, mode: os.FileMode(420), modTime: time.Unix(1523760397, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -// Asset loads and returns the asset for the given name. -// It returns an error if the asset could not be found or -// could not be loaded. -func Asset(name string) ([]byte, error) { - cannonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[cannonicalName]; ok { - a, err := f() - if err != nil { - return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) - } - return a.bytes, nil - } - return nil, fmt.Errorf("Asset %s not found", name) -} - -// MustAsset is like Asset but panics when Asset would return an error. -// It simplifies safe initialization of global variables. -func MustAsset(name string) []byte { - a, err := Asset(name) - if err != nil { - panic("asset: Asset(" + name + "): " + err.Error()) - } - - return a -} - -// AssetInfo loads and returns the asset info for the given name. -// It returns an error if the asset could not be found or -// could not be loaded. -func AssetInfo(name string) (os.FileInfo, error) { - cannonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[cannonicalName]; ok { - a, err := f() - if err != nil { - return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) - } - return a.info, nil - } - return nil, fmt.Errorf("AssetInfo %s not found", name) -} - -// AssetNames returns the names of the assets. -func AssetNames() []string { - names := make([]string, 0, len(_bindata)) - for name := range _bindata { - names = append(names, name) - } - return names -} - -// _bindata is a table, holding each asset generator, mapped to its name. -var _bindata = map[string]func() (*asset, error){ - "jsonschema-draft-04.json": jsonschemaDraft04JSON, - "v2/schema.json": v2SchemaJSON, -} - -// AssetDir returns the file names below a certain -// directory embedded in the file by go-bindata. -// For example if you run go-bindata on data/... and data contains the -// following hierarchy: -// data/ -// foo.txt -// img/ -// a.png -// b.png -// then AssetDir("data") would return []string{"foo.txt", "img"} -// AssetDir("data/img") would return []string{"a.png", "b.png"} -// AssetDir("foo.txt") and AssetDir("notexist") would return an error -// AssetDir("") will return []string{"data"}. -func AssetDir(name string) ([]string, error) { - node := _bintree - if len(name) != 0 { - cannonicalName := strings.Replace(name, "\\", "/", -1) - pathList := strings.Split(cannonicalName, "/") - for _, p := range pathList { - node = node.Children[p] - if node == nil { - return nil, fmt.Errorf("Asset %s not found", name) - } - } - } - if node.Func != nil { - return nil, fmt.Errorf("Asset %s not found", name) - } - rv := make([]string, 0, len(node.Children)) - for childName := range node.Children { - rv = append(rv, childName) - } - return rv, nil -} - -type bintree struct { - Func func() (*asset, error) - Children map[string]*bintree -} - -var _bintree = &bintree{nil, map[string]*bintree{ - "jsonschema-draft-04.json": &bintree{jsonschemaDraft04JSON, map[string]*bintree{}}, - "v2": &bintree{nil, map[string]*bintree{ - "schema.json": &bintree{v2SchemaJSON, map[string]*bintree{}}, - }}, -}} - -// RestoreAsset restores an asset under the given directory -func RestoreAsset(dir, name string) error { - data, err := Asset(name) - if err != nil { - return err - } - info, err := AssetInfo(name) - if err != nil { - return err - } - err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755)) - if err != nil { - return err - } - err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode()) - if err != nil { - return err - } - err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) - if err != nil { - return err - } - return nil -} - -// RestoreAssets restores an asset under the given directory recursively -func RestoreAssets(dir, name string) error { - children, err := AssetDir(name) - // File - if err != nil { - return RestoreAsset(dir, name) - } - // Dir - for _, child := range children { - err = RestoreAssets(dir, filepath.Join(name, child)) - if err != nil { - return err - } - } - return nil -} - -func _filePath(dir, name string) string { - cannonicalName := strings.Replace(name, "\\", "/", -1) - return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...) -} diff --git a/vendor/github.com/go-openapi/spec/contact_info.go b/vendor/github.com/go-openapi/spec/contact_info.go deleted file mode 100644 index f285970a..00000000 --- a/vendor/github.com/go-openapi/spec/contact_info.go +++ /dev/null @@ -1,24 +0,0 @@ -// 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 - -// ContactInfo contact information for the exposed API. -// -// For more information: http://goo.gl/8us55a#contactObject -type ContactInfo struct { - Name string `json:"name,omitempty"` - URL string `json:"url,omitempty"` - Email string `json:"email,omitempty"` -} diff --git a/vendor/github.com/go-openapi/spec/contact_info_test.go b/vendor/github.com/go-openapi/spec/contact_info_test.go deleted file mode 100644 index 5e644d0f..00000000 --- a/vendor/github.com/go-openapi/spec/contact_info_test.go +++ /dev/null @@ -1,37 +0,0 @@ -// 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" -) - -var contactInfoJSON = `{"name":"wordnik api team","url":"http://developer.wordnik.com","email":"some@mailayada.dkdkd"}` -var contactInfoYAML = `name: wordnik api team -url: http://developer.wordnik.com -email: some@mailayada.dkdkd -` -var contactInfo = ContactInfo{ - Name: "wordnik api team", - URL: "http://developer.wordnik.com", - Email: "some@mailayada.dkdkd", -} - -func TestIntegrationContactInfo(t *testing.T) { - assertSerializeJSON(t, contactInfo, contactInfoJSON) - assertSerializeYAML(t, contactInfo, contactInfoYAML) - assertParsesJSON(t, contactInfoJSON, contactInfo) - assertParsesYAML(t, contactInfoYAML, contactInfo) -} diff --git a/vendor/github.com/go-openapi/spec/debug.go b/vendor/github.com/go-openapi/spec/debug.go deleted file mode 100644 index 7edb95a6..00000000 --- a/vendor/github.com/go-openapi/spec/debug.go +++ /dev/null @@ -1,47 +0,0 @@ -// 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/filepath" - "runtime" -) - -var ( - // Debug is true when the SWAGGER_DEBUG env var is not empty. - // It enables a more verbose logging of validators. - Debug = os.Getenv("SWAGGER_DEBUG") != "" - // validateLogger 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", filepath.Base(file1), pos1, fmt.Sprintf(msg, args...)) - } -} diff --git a/vendor/github.com/go-openapi/spec/debug_test.go b/vendor/github.com/go-openapi/spec/debug_test.go deleted file mode 100644 index 74c2a786..00000000 --- a/vendor/github.com/go-openapi/spec/debug_test.go +++ /dev/null @@ -1,59 +0,0 @@ -// 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 ( - "io/ioutil" - "os" - "sync" - "testing" - - "github.com/stretchr/testify/assert" -) - -var ( - logMutex = &sync.Mutex{} -) - -func TestDebug(t *testing.T) { - tmpFile, _ := ioutil.TempFile("", "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") -} diff --git a/vendor/github.com/go-openapi/spec/expander.go b/vendor/github.com/go-openapi/spec/expander.go deleted file mode 100644 index 456a9dd7..00000000 --- a/vendor/github.com/go-openapi/spec/expander.go +++ /dev/null @@ -1,1227 +0,0 @@ -// 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" - "os" - "path" - "path/filepath" - "reflect" - "strings" - "sync" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -// ExpandOptions provides options for expand. -type ExpandOptions struct { - RelativeBase string - SkipSchemas bool - ContinueOnError bool - AbsoluteCircularRef bool -} - -// 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{} -} - -var resCache ResolutionCache - -func init() { - resCache = initResolutionCache() -} - -// initResolutionCache initializes the URI resolution cache -func initResolutionCache() ResolutionCache { - return &simpleCache{store: map[string]interface{}{ - "http://swagger.io/v2/schema.json": MustLoadSwagger20Schema(), - "http://json-schema.org/draft-04/schema": MustLoadJSONSchemaDraft04(), - }} -} - -// 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, which allows shortcuts. - // NOTE: this is not just a performance improvement: it is required to figure out - // circular references which participate several cycles. - // 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 -} - -func newResolverContext(originalBasePath string) *resolverContext { - return &resolverContext{ - circulars: make(map[string]bool), - basePath: originalBasePath, // keep the root base path in context - } -} - -// Get retrieves a cached URI -func (s *simpleCache) Get(uri string) (interface{}, bool) { - debugLog("getting %q from resolution cache", uri) - s.lock.RLock() - v, ok := s.store[uri] - debugLog("got %q from resolution cache: %t", uri, ok) - - 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() -} - -// ResolveRefWithBase resolves a reference against a context root with preservation of base path -func ResolveRefWithBase(root interface{}, ref *Ref, opts *ExpandOptions) (*Schema, error) { - resolver, err := defaultSchemaLoader(root, opts, nil, nil) - if err != nil { - return nil, err - } - specBasePath := "" - if opts != nil && opts.RelativeBase != "" { - specBasePath, _ = absPath(opts.RelativeBase) - } - - result := new(Schema) - if err := resolver.Resolve(ref, result, specBasePath); err != nil { - return nil, err - } - return result, nil -} - -// ResolveRef resolves a reference 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 { - panic(err) - } - switch sch := res.(type) { - case Schema: - return &sch, nil - case *Schema: - return sch, nil - case map[string]interface{}: - b, _ := json.Marshal(sch) - newSch := new(Schema) - _ = json.Unmarshal(b, newSch) - return newSch, nil - default: - return nil, fmt.Errorf("unknown type for the resolved reference") - } -} - -// ResolveParameter resolves a parameter reference against a context root -func ResolveParameter(root interface{}, ref Ref) (*Parameter, error) { - return ResolveParameterWithBase(root, ref, nil) -} - -// ResolveParameterWithBase resolves a parameter reference against a context root and base path -func ResolveParameterWithBase(root interface{}, ref Ref, opts *ExpandOptions) (*Parameter, error) { - resolver, err := defaultSchemaLoader(root, opts, nil, nil) - if err != nil { - return nil, err - } - - result := new(Parameter) - if err := resolver.Resolve(&ref, result, ""); 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) -} - -// ResolveResponseWithBase resolves response a reference against a context root and base path -func ResolveResponseWithBase(root interface{}, ref Ref, opts *ExpandOptions) (*Response, error) { - resolver, err := defaultSchemaLoader(root, opts, nil, nil) - if err != nil { - return nil, err - } - - result := new(Response) - if err := resolver.Resolve(&ref, result, ""); err != nil { - return nil, err - } - return result, nil -} - -// ResolveItems resolves header and parameter items reference against a context root and base path -func ResolveItems(root interface{}, ref Ref, opts *ExpandOptions) (*Items, error) { - resolver, err := defaultSchemaLoader(root, opts, nil, nil) - if err != nil { - return nil, err - } - basePath := "" - if opts.RelativeBase != "" { - basePath = opts.RelativeBase - } - result := new(Items) - if err := resolver.Resolve(&ref, result, basePath); err != nil { - return nil, err - } - return result, nil -} - -// ResolvePathItem resolves response a path item against a context root and base path -func ResolvePathItem(root interface{}, ref Ref, opts *ExpandOptions) (*PathItem, error) { - resolver, err := defaultSchemaLoader(root, opts, nil, nil) - if err != nil { - return nil, err - } - basePath := "" - if opts.RelativeBase != "" { - basePath = opts.RelativeBase - } - result := new(PathItem) - if err := resolver.Resolve(&ref, result, basePath); err != nil { - return nil, err - } - return result, nil -} - -type schemaLoader struct { - root interface{} - options *ExpandOptions - cache ResolutionCache - context *resolverContext - loadDoc func(string) (json.RawMessage, error) -} - -var idPtr, _ = jsonpointer.New("/id") -var refPtr, _ = jsonpointer.New("/$ref") - -// PathLoader function to use when loading remote refs -var PathLoader func(string) (json.RawMessage, error) - -func init() { - PathLoader = func(path string) (json.RawMessage, error) { - data, err := swag.LoadFromFileOrHTTP(path) - if err != nil { - return nil, err - } - return json.RawMessage(data), nil - } -} - -func defaultSchemaLoader( - root interface{}, - expandOptions *ExpandOptions, - cache ResolutionCache, - context *resolverContext) (*schemaLoader, error) { - - if cache == nil { - cache = resCache - } - if expandOptions == nil { - expandOptions = &ExpandOptions{} - } - absBase, _ := absPath(expandOptions.RelativeBase) - if context == nil { - context = newResolverContext(absBase) - } - return &schemaLoader{ - root: root, - options: expandOptions, - cache: cache, - context: context, - loadDoc: func(path string) (json.RawMessage, error) { - debugLog("fetching document at %q", path) - return PathLoader(path) - }, - }, nil -} - -func idFromNode(node interface{}) (*Ref, error) { - if idValue, _, err := idPtr.Get(node); err == nil { - if refStr, ok := idValue.(string); ok && refStr != "" { - idRef, err := NewRef(refStr) - if err != nil { - return nil, err - } - return &idRef, nil - } - } - return nil, nil -} - -func nextRef(startingNode interface{}, startingRef *Ref, ptr *jsonpointer.Pointer) *Ref { - if startingRef == nil { - return nil - } - - if ptr == nil { - return startingRef - } - - ret := startingRef - var idRef *Ref - node := startingNode - - for _, tok := range ptr.DecodedTokens() { - node, _, _ = jsonpointer.GetForToken(node, tok) - if node == nil { - break - } - - idRef, _ = idFromNode(node) - if idRef != nil { - nw, err := ret.Inherits(*idRef) - if err != nil { - break - } - ret = nw - } - - refRef, _, _ := refPtr.Get(node) - if refRef != nil { - var rf Ref - switch value := refRef.(type) { - case string: - rf, _ = NewRef(value) - } - nw, err := ret.Inherits(rf) - if err != nil { - break - } - nwURL := nw.GetURL() - if nwURL.Scheme == "file" || (nwURL.Scheme == "" && nwURL.Host == "") { - nwpt := filepath.ToSlash(nwURL.Path) - if filepath.IsAbs(nwpt) { - _, err := os.Stat(nwpt) - if err != nil { - nwURL.Path = filepath.Join(".", nwpt) - } - } - } - - ret = nw - } - - } - - return ret -} - -// normalize absolute path for cache. -// on Windows, drive letters should be converted to lower as scheme in net/url.URL -func normalizeAbsPath(path string) string { - u, err := url.Parse(path) - if err != nil { - debugLog("normalize absolute path failed: %s", err) - return path - } - return u.String() -} - -// base or refPath could be a file path or a URL -// given a base absolute path and a ref path, return the absolute path of refPath -// 1) if refPath is absolute, return it -// 2) if refPath is relative, join it with basePath keeping the scheme, hosts, and ports if exists -// base could be a directory or a full file path -func normalizePaths(refPath, base string) string { - refURL, _ := url.Parse(refPath) - if path.IsAbs(refURL.Path) || filepath.IsAbs(refPath) { - // refPath is actually absolute - if refURL.Host != "" { - return refPath - } - parts := strings.Split(refPath, "#") - result := filepath.FromSlash(parts[0]) - if len(parts) == 2 { - result += "#" + parts[1] - } - return result - } - - // relative refPath - baseURL, _ := url.Parse(base) - if !strings.HasPrefix(refPath, "#") { - // combining paths - if baseURL.Host != "" { - baseURL.Path = path.Join(path.Dir(baseURL.Path), refURL.Path) - } else { // base is a file - newBase := fmt.Sprintf("%s#%s", filepath.Join(filepath.Dir(base), filepath.FromSlash(refURL.Path)), refURL.Fragment) - return newBase - } - - } - // copying fragment from ref to base - baseURL.Fragment = refURL.Fragment - return baseURL.String() -} - -// denormalizePaths returns to simplest notation on file $ref, -// i.e. strips the absolute path and sets a path relative to the base path. -// -// This is currently used when we rewrite ref after a circular ref has been detected -func denormalizeFileRef(ref *Ref, relativeBase, originalRelativeBase string) *Ref { - debugLog("denormalizeFileRef for: %s", ref.String()) - - if ref.String() == "" || ref.IsRoot() || ref.HasFragmentOnly { - return ref - } - // strip relativeBase from URI - relativeBaseURL, _ := url.Parse(relativeBase) - relativeBaseURL.Fragment = "" - - if relativeBaseURL.IsAbs() && strings.HasPrefix(ref.String(), relativeBase) { - // this should work for absolute URI (e.g. http://...): we have an exact match, just trim prefix - r, _ := NewRef(strings.TrimPrefix(ref.String(), relativeBase)) - return &r - } - - if relativeBaseURL.IsAbs() { - // other absolute URL get unchanged (i.e. with a non-empty scheme) - return ref - } - - // for relative file URIs: - originalRelativeBaseURL, _ := url.Parse(originalRelativeBase) - originalRelativeBaseURL.Fragment = "" - if strings.HasPrefix(ref.String(), originalRelativeBaseURL.String()) { - // the resulting ref is in the expanded spec: return a local ref - r, _ := NewRef(strings.TrimPrefix(ref.String(), originalRelativeBaseURL.String())) - return &r - } - - // check if we may set a relative path, considering the original base path for this spec. - // Example: - // spec is located at /mypath/spec.json - // my normalized ref points to: /mypath/item.json#/target - // expected result: item.json#/target - parts := strings.Split(ref.String(), "#") - relativePath, err := filepath.Rel(path.Dir(originalRelativeBaseURL.String()), parts[0]) - if err != nil { - // there is no common ancestor (e.g. different drives on windows) - // leaves the ref unchanged - return ref - } - if len(parts) == 2 { - relativePath += "#" + parts[1] - } - r, _ := NewRef(relativePath) - return &r -} - -// relativeBase could be an ABSOLUTE file path or an ABSOLUTE URL -func normalizeFileRef(ref *Ref, relativeBase string) *Ref { - // This is important for when the reference is pointing to the root schema - if ref.String() == "" { - r, _ := NewRef(relativeBase) - return &r - } - - debugLog("normalizing %s against %s", ref.String(), relativeBase) - - s := normalizePaths(ref.String(), relativeBase) - r, _ := NewRef(s) - return &r -} - -func (r *schemaLoader) resolveRef(ref *Ref, target interface{}, basePath string) error { - tgt := reflect.ValueOf(target) - if tgt.Kind() != reflect.Ptr { - return fmt.Errorf("resolve ref: target needs to be a pointer") - } - - refURL := ref.GetURL() - if refURL == nil { - return nil - } - - var res interface{} - var data interface{} - var 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 := normalizeFileRef(ref, basePath) - debugLog("current ref is: %s", ref.String()) - debugLog("current ref normalized file: %s", baseRef.String()) - 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 - } - } - if err := swag.DynamicJSONToStruct(res, target); err != nil { - return err - } - - return nil -} - -func (r *schemaLoader) load(refURL *url.URL) (interface{}, url.URL, bool, error) { - debugLog("loading schema from url: %s", refURL) - toFetch := *refURL - toFetch.Fragment = "" - - normalized := normalizeAbsPath(toFetch.String()) - - data, fromCache := r.cache.Get(normalized) - if !fromCache { - b, err := r.loadDoc(normalized) - if err != nil { - return nil, url.URL{}, false, err - } - - if err := json.Unmarshal(b, &data); err != nil { - return nil, url.URL{}, false, err - } - r.cache.Set(normalized, data) - } - - return data, toFetch, fromCache, nil -} - -// 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 that ref is referring to has more refs in it. 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) -} - -// absPath returns the absolute path of a file -func absPath(fname string) (string, error) { - if strings.HasPrefix(fname, "http") { - return fname, nil - } - if filepath.IsAbs(fname) { - return fname, nil - } - wd, err := os.Getwd() - return filepath.Join(wd, fname), err -} - -// ExpandSpec expands the references in a swagger spec -func ExpandSpec(spec *Swagger, options *ExpandOptions) error { - resolver, err := defaultSchemaLoader(spec, options, nil, nil) - // Just in case this ever returns an error. - if shouldStopOnError(err, resolver.options) { - return err - } - - // getting the base path of the spec to adjust all subsequent reference resolutions - specBasePath := "" - if options != nil && options.RelativeBase != "" { - specBasePath, _ = absPath(options.RelativeBase) - } - - if options == nil || !options.SkipSchemas { - for key, definition := range spec.Definitions { - var def *Schema - var err error - if def, err = expandSchema(definition, []string{fmt.Sprintf("#/definitions/%s", key)}, resolver, specBasePath); shouldStopOnError(err, resolver.options) { - return err - } - if def != nil { - spec.Definitions[key] = *def - } - } - } - - for key, parameter := range spec.Parameters { - if err := expandParameter(¶meter, resolver, specBasePath); shouldStopOnError(err, resolver.options) { - return err - } - spec.Parameters[key] = parameter - } - - for key, response := range spec.Responses { - if err := expandResponse(&response, resolver, specBasePath); shouldStopOnError(err, resolver.options) { - return err - } - spec.Responses[key] = response - } - - if spec.Paths != nil { - for key, path := range spec.Paths.Paths { - if err := expandPathItem(&path, resolver, specBasePath); shouldStopOnError(err, resolver.options) { - return err - } - spec.Paths.Paths[key] = path - } - } - - return nil -} - -func shouldStopOnError(err error, opts *ExpandOptions) bool { - if err != nil && !opts.ContinueOnError { - return true - } - - if err != nil { - log.Println(err) - } - - return false -} - -// 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 - const rootBase = "root" - if root != nil { - base, _ := absPath(rootBase) - normalizedBase := normalizeAbsPath(base) - debugLog("setting root doc in cache at: %s", normalizedBase) - if cache == nil { - cache = resCache - } - cache.Set(normalizedBase, root) - return rootBase - } - return "" -} - -// 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 file other than root -func ExpandSchema(schema *Schema, root interface{}, cache ResolutionCache) error { - 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, - // when no base path is specified, remaining $ref (circular) are rendered with an absolute path - AbsoluteCircularRef: true, - } - return ExpandSchemaWithBasePath(schema, cache, opts) -} - -// ExpandSchemaWithBasePath expands the refs in the schema object, base path configured through expand options -func ExpandSchemaWithBasePath(schema *Schema, cache ResolutionCache, opts *ExpandOptions) error { - if schema == nil { - return nil - } - - var basePath string - if opts.RelativeBase != "" { - basePath, _ = absPath(opts.RelativeBase) - } - - resolver, err := defaultSchemaLoader(nil, opts, cache, nil) - if err != nil { - return err - } - - refs := []string{""} - var s *Schema - if s, err = expandSchema(*schema, refs, resolver, basePath); err != nil { - return err - } - *schema = *s - return nil -} - -func expandItems(target Schema, parentRefs []string, resolver *schemaLoader, basePath string) (*Schema, error) { - if target.Items != nil { - if target.Items.Schema != nil { - t, err := expandSchema(*target.Items.Schema, parentRefs, resolver, basePath) - if err != nil { - return nil, err - } - *target.Items.Schema = *t - } - 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 -} - -// basePathFromSchemaID returns a new basePath based on an existing basePath and a schema ID -func basePathFromSchemaID(oldBasePath, id string) string { - u, err := url.Parse(oldBasePath) - if err != nil { - panic(err) - } - uid, err := url.Parse(id) - if err != nil { - panic(err) - } - - if path.IsAbs(uid.Path) { - return id - } - u.Path = path.Join(path.Dir(u.Path), uid.Path) - return u.String() -} - -// 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 := normalizePaths(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.ContainsStringsCI(parentRefs, normalizedRef) - if foundCycle { - r.context.circulars[normalizedRef] = true - } - return -} - -func updateBasePath(transitive *schemaLoader, resolver *schemaLoader, basePath string) string { - if transitive != resolver { - debugLog("got a new resolver") - if transitive.options != nil && transitive.options.RelativeBase != "" { - basePath, _ = absPath(transitive.options.RelativeBase) - debugLog("new basePath = %s", basePath) - } - } - - return basePath -} - -func expandSchema(target Schema, parentRefs []string, resolver *schemaLoader, basePath string) (*Schema, error) { - if target.Ref.String() == "" && target.Ref.IsRoot() { - // normalizing is important - newRef := normalizeFileRef(&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 */ - // important: ID can be relative path - if target.ID != "" { - debugLog("schema has ID: %s", target.ID) - // handling the case when id is a folder - // remember that basePath has to be a file - refPath := target.ID - if strings.HasSuffix(target.ID, "/") { - // path.Clean here would not work correctly if basepath is http - refPath = fmt.Sprintf("%s%s", refPath, "placeholder.json") - } - basePath = normalizePaths(refPath, basePath) - } - - /* Explain here what this function does */ - var t *Schema - /* if Ref is found, everything else doesn't matter */ - /* Ref also changes the resolution scope of children expandSchema */ - if target.Ref.String() != "" { - /* Here the resolution scope is changed because a $ref was encountered */ - normalizedRef := normalizeFileRef(&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("shortcut circular ref: basePath: %s, normalizedPath: %s, normalized ref: %s", - basePath, normalizedBasePath, normalizedRef.String()) - if !resolver.options.AbsoluteCircularRef { - target.Ref = *denormalizeFileRef(normalizedRef, normalizedBasePath, resolver.context.basePath) - } else { - target.Ref = *normalizedRef - } - return &target, nil - } - - debugLog("basePath: %s", basePath) - if Debug { - b, _ := json.Marshal(target) - debugLog("calling Resolve with target: %s", string(b)) - } - if err := resolver.Resolve(&target.Ref, &t, basePath); shouldStopOnError(err, resolver.options) { - return nil, err - } - - if t != nil { - parentRefs = append(parentRefs, normalizedRef.String()) - var err error - transitiveResolver, err := transitiveResolver(basePath, target.Ref, resolver) - if shouldStopOnError(err, resolver.options) { - return nil, err - } - - basePath = updateBasePath(transitiveResolver, resolver, normalizedBasePath) - - return expandSchema(*t, parentRefs, transitiveResolver, basePath) - } - } - - t, err := expandItems(target, parentRefs, resolver, basePath) - if shouldStopOnError(err, resolver.options) { - return &target, err - } - if t != nil { - target = *t - } - - for i := range target.AllOf { - t, err := expandSchema(target.AllOf[i], parentRefs, resolver, basePath) - if shouldStopOnError(err, resolver.options) { - return &target, err - } - target.AllOf[i] = *t - } - for i := range target.AnyOf { - t, err := expandSchema(target.AnyOf[i], parentRefs, resolver, basePath) - if shouldStopOnError(err, resolver.options) { - return &target, err - } - target.AnyOf[i] = *t - } - for i := range target.OneOf { - t, err := expandSchema(target.OneOf[i], parentRefs, resolver, basePath) - if shouldStopOnError(err, resolver.options) { - return &target, err - } - if t != nil { - target.OneOf[i] = *t - } - } - if target.Not != nil { - t, err := expandSchema(*target.Not, parentRefs, resolver, basePath) - if shouldStopOnError(err, resolver.options) { - return &target, err - } - if t != nil { - *target.Not = *t - } - } - for k := range target.Properties { - t, err := expandSchema(target.Properties[k], parentRefs, resolver, basePath) - if shouldStopOnError(err, resolver.options) { - 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 shouldStopOnError(err, resolver.options) { - 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 shouldStopOnError(err, resolver.options) { - 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 shouldStopOnError(err, resolver.options) { - 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 shouldStopOnError(err, resolver.options) { - return &target, err - } - if t != nil { - *target.AdditionalItems.Schema = *t - } - } - for k := range target.Definitions { - t, err := expandSchema(target.Definitions[k], parentRefs, resolver, basePath) - if shouldStopOnError(err, resolver.options) { - return &target, err - } - if t != nil { - target.Definitions[k] = *t - } - } - return &target, nil -} - -func derefPathItem(pathItem *PathItem, parentRefs []string, resolver *schemaLoader, basePath string) error { - curRef := pathItem.Ref.String() - if curRef != "" { - normalizedRef := normalizeFileRef(&pathItem.Ref, basePath) - normalizedBasePath := normalizedRef.RemoteURI() - - if resolver.isCircular(normalizedRef, basePath, parentRefs...) { - return nil - } - - if err := resolver.Resolve(&pathItem.Ref, pathItem, basePath); shouldStopOnError(err, resolver.options) { - return err - } - - if pathItem.Ref.String() != "" && pathItem.Ref.String() != curRef && basePath != normalizedBasePath { - parentRefs = append(parentRefs, normalizedRef.String()) - return derefPathItem(pathItem, parentRefs, resolver, normalizedBasePath) - } - } - - return nil -} - -func expandPathItem(pathItem *PathItem, resolver *schemaLoader, basePath string) error { - if pathItem == nil { - return nil - } - - parentRefs := []string{} - if err := derefPathItem(pathItem, parentRefs, resolver, basePath); shouldStopOnError(err, resolver.options) { - return err - } - if pathItem.Ref.String() != "" { - var err error - resolver, err = transitiveResolver(basePath, pathItem.Ref, resolver) - if shouldStopOnError(err, resolver.options) { - return err - } - } - pathItem.Ref = Ref{} - - // Currently unused: - //parentRefs = parentRefs[0:] - - for idx := range pathItem.Parameters { - if err := expandParameter(&(pathItem.Parameters[idx]), resolver, basePath); shouldStopOnError(err, resolver.options) { - return err - } - } - if err := expandOperation(pathItem.Get, resolver, basePath); shouldStopOnError(err, resolver.options) { - return err - } - if err := expandOperation(pathItem.Head, resolver, basePath); shouldStopOnError(err, resolver.options) { - return err - } - if err := expandOperation(pathItem.Options, resolver, basePath); shouldStopOnError(err, resolver.options) { - return err - } - if err := expandOperation(pathItem.Put, resolver, basePath); shouldStopOnError(err, resolver.options) { - return err - } - if err := expandOperation(pathItem.Post, resolver, basePath); shouldStopOnError(err, resolver.options) { - return err - } - if err := expandOperation(pathItem.Patch, resolver, basePath); shouldStopOnError(err, resolver.options) { - return err - } - if err := expandOperation(pathItem.Delete, resolver, basePath); shouldStopOnError(err, resolver.options) { - return err - } - return nil -} - -func expandOperation(op *Operation, resolver *schemaLoader, basePath string) error { - if op == nil { - return nil - } - - for i, param := range op.Parameters { - if err := expandParameter(¶m, resolver, basePath); shouldStopOnError(err, resolver.options) { - return err - } - op.Parameters[i] = param - } - - if op.Responses != nil { - responses := op.Responses - if err := expandResponse(responses.Default, resolver, basePath); shouldStopOnError(err, resolver.options) { - return err - } - for code, response := range responses.StatusCodeResponses { - if err := expandResponse(&response, resolver, basePath); shouldStopOnError(err, resolver.options) { - return err - } - responses.StatusCodeResponses[code] = response - } - } - return nil -} - -func transitiveResolver(basePath string, ref Ref, resolver *schemaLoader) (*schemaLoader, error) { - if ref.IsRoot() || ref.HasFragmentOnly { - return resolver, nil - } - - baseRef, _ := NewRef(basePath) - currentRef := normalizeFileRef(&ref, basePath) - // Set a new root to resolve against - if !strings.HasPrefix(currentRef.String(), baseRef.String()) { - rootURL := currentRef.GetURL() - rootURL.Fragment = "" - root, _ := resolver.cache.Get(rootURL.String()) - var err error - - // shallow copy of resolver options to set a new RelativeBase when - // traversing multiple documents - newOptions := resolver.options - newOptions.RelativeBase = rootURL.String() - debugLog("setting new root: %s", newOptions.RelativeBase) - resolver, err = defaultSchemaLoader(root, newOptions, resolver.cache, resolver.context) - if err != nil { - return nil, err - } - } - - return resolver, nil -} - -// ExpandResponseWithRoot expands a response based on a root document, not a fetchable document -func ExpandResponseWithRoot(response *Response, root interface{}, cache ResolutionCache) error { - opts := &ExpandOptions{ - RelativeBase: baseForRoot(root, cache), - SkipSchemas: false, - ContinueOnError: false, - // when no base path is specified, remaining $ref (circular) are rendered with an absolute path - AbsoluteCircularRef: true, - } - resolver, err := defaultSchemaLoader(root, opts, nil, nil) - if err != nil { - return err - } - - return expandResponse(response, resolver, opts.RelativeBase) -} - -// ExpandResponse expands a response based on a basepath -// This is the exported version of expandResponse -// all refs inside response will be resolved relative to basePath -func ExpandResponse(response *Response, basePath string) error { - var specBasePath string - if basePath != "" { - specBasePath, _ = absPath(basePath) - } - opts := &ExpandOptions{ - RelativeBase: specBasePath, - } - resolver, err := defaultSchemaLoader(nil, opts, nil, nil) - if err != nil { - return err - } - - return expandResponse(response, resolver, opts.RelativeBase) -} - -func derefResponse(response *Response, parentRefs []string, resolver *schemaLoader, basePath string) error { - curRef := response.Ref.String() - if curRef != "" { - /* Here the resolution scope is changed because a $ref was encountered */ - normalizedRef := normalizeFileRef(&response.Ref, basePath) - normalizedBasePath := normalizedRef.RemoteURI() - - if resolver.isCircular(normalizedRef, basePath, parentRefs...) { - return nil - } - - if err := resolver.Resolve(&response.Ref, response, basePath); shouldStopOnError(err, resolver.options) { - return err - } - - if response.Ref.String() != "" && response.Ref.String() != curRef && basePath != normalizedBasePath { - parentRefs = append(parentRefs, normalizedRef.String()) - return derefResponse(response, parentRefs, resolver, normalizedBasePath) - } - } - - return nil -} - -func expandResponse(response *Response, resolver *schemaLoader, basePath string) error { - if response == nil { - return nil - } - parentRefs := []string{} - if err := derefResponse(response, parentRefs, resolver, basePath); shouldStopOnError(err, resolver.options) { - return err - } - if response.Ref.String() != "" { - transitiveResolver, err := transitiveResolver(basePath, response.Ref, resolver) - if shouldStopOnError(err, transitiveResolver.options) { - return err - } - basePath = updateBasePath(transitiveResolver, resolver, basePath) - resolver = transitiveResolver - } - if response.Schema != nil && response.Schema.Ref.String() != "" { - // schema expanded to a $ref in another root - var ern error - response.Schema.Ref, ern = NewRef(normalizePaths(response.Schema.Ref.String(), response.Ref.RemoteURI())) - if ern != nil { - return ern - } - } - response.Ref = Ref{} - - parentRefs = parentRefs[0:] - if !resolver.options.SkipSchemas && response.Schema != nil { - // parentRefs = append(parentRefs, response.Schema.Ref.String()) - s, err := expandSchema(*response.Schema, parentRefs, resolver, basePath) - if shouldStopOnError(err, resolver.options) { - return err - } - *response.Schema = *s - } - - return nil -} - -// ExpandParameterWithRoot expands a parameter based on a root document, not a fetchable document -func ExpandParameterWithRoot(parameter *Parameter, root interface{}, cache ResolutionCache) error { - opts := &ExpandOptions{ - RelativeBase: baseForRoot(root, cache), - SkipSchemas: false, - ContinueOnError: false, - // when no base path is specified, remaining $ref (circular) are rendered with an absolute path - AbsoluteCircularRef: true, - } - resolver, err := defaultSchemaLoader(root, opts, nil, nil) - if err != nil { - return err - } - - return expandParameter(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 { - var specBasePath string - if basePath != "" { - specBasePath, _ = absPath(basePath) - } - opts := &ExpandOptions{ - RelativeBase: specBasePath, - } - resolver, err := defaultSchemaLoader(nil, opts, nil, nil) - if err != nil { - return err - } - - return expandParameter(parameter, resolver, opts.RelativeBase) -} - -func derefParameter(parameter *Parameter, parentRefs []string, resolver *schemaLoader, basePath string) error { - curRef := parameter.Ref.String() - if curRef != "" { - normalizedRef := normalizeFileRef(¶meter.Ref, basePath) - normalizedBasePath := normalizedRef.RemoteURI() - - if resolver.isCircular(normalizedRef, basePath, parentRefs...) { - return nil - } - - if err := resolver.Resolve(¶meter.Ref, parameter, basePath); shouldStopOnError(err, resolver.options) { - return err - } - - if parameter.Ref.String() != "" && parameter.Ref.String() != curRef && basePath != normalizedBasePath { - parentRefs = append(parentRefs, normalizedRef.String()) - return derefParameter(parameter, parentRefs, resolver, normalizedBasePath) - } - } - - return nil -} - -func expandParameter(parameter *Parameter, resolver *schemaLoader, basePath string) error { - if parameter == nil { - return nil - } - - parentRefs := []string{} - if err := derefParameter(parameter, parentRefs, resolver, basePath); shouldStopOnError(err, resolver.options) { - return err - } - if parameter.Ref.String() != "" { - transitiveResolver, err := transitiveResolver(basePath, parameter.Ref, resolver) - if shouldStopOnError(err, transitiveResolver.options) { - return err - } - basePath = updateBasePath(transitiveResolver, resolver, basePath) - resolver = transitiveResolver - } - - if parameter.Schema != nil && parameter.Schema.Ref.String() != "" { - // schema expanded to a $ref in another root - var ern error - parameter.Schema.Ref, ern = NewRef(normalizePaths(parameter.Schema.Ref.String(), parameter.Ref.RemoteURI())) - if ern != nil { - return ern - } - } - parameter.Ref = Ref{} - - parentRefs = parentRefs[0:] - if !resolver.options.SkipSchemas && parameter.Schema != nil { - s, err := expandSchema(*parameter.Schema, parentRefs, resolver, basePath) - if shouldStopOnError(err, resolver.options) { - return err - } - *parameter.Schema = *s - } - return nil -} diff --git a/vendor/github.com/go-openapi/spec/expander_test.go b/vendor/github.com/go-openapi/spec/expander_test.go deleted file mode 100644 index 1c408735..00000000 --- a/vendor/github.com/go-openapi/spec/expander_test.go +++ /dev/null @@ -1,1799 +0,0 @@ -// 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/ioutil" - "log" - "net/http" - "net/http/httptest" - "os" - "path/filepath" - "regexp" - "runtime" - "strings" - "testing" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" - "github.com/stretchr/testify/assert" -) - -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 -} - -// tests that paths are normalized correctly -func TestNormalizePaths(t *testing.T) { - type testNormalizePathsTestCases []struct { - refPath string - base string - expOutput string - } - testCases := func() testNormalizePathsTestCases { - testCases := testNormalizePathsTestCases{ - { - // 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", - }, - } - if runtime.GOOS == "windows" { - testCases = append(testCases, testNormalizePathsTestCases{ - { - // file basePath, absolute refPath, no fragment - refPath: `C:\another\base\path.json`, - base: `C:\base\path.json`, - expOutput: `C:\another\base\path.json`, - }, - { - // file basePath, absolute refPath - refPath: `C:\another\base\path.json#/definitions/Pet`, - base: `C:\base\path.json`, - expOutput: `C:\another\base\path.json#/definitions/Pet`, - }, - { - // file basePath, relative refPath - refPath: `another\base\path.json#/definitions/Pet`, - base: `C:\base\path.json`, - expOutput: `C:\base\another\base\path.json#/definitions/Pet`, - }, - }...) - return testCases - } - // linux case - testCases = append(testCases, testNormalizePathsTestCases{ - { - // file basePath, absolute refPath, no fragment - refPath: "/another/base/path.json", - base: "/base/path.json", - expOutput: "/another/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", - }, - }...) - return testCases - }() - - for _, tcase := range testCases { - out := normalizePaths(tcase.refPath, tcase.base) - assert.Equal(t, tcase.expOutput, out) - } -} - -func TestExpandsKnownRef(t *testing.T) { - schema := RefProperty("http://json-schema.org/draft-04/schema#") - if assert.NoError(t, ExpandSchema(schema, nil, nil)) { - assert.Equal(t, "Core schema meta-schema", schema.Description) - } -} - -func TestExpandResponseSchema(t *testing.T) { - fp := "./fixtures/local_expansion/spec.json" - b, err := jsonDoc(fp) - if assert.NoError(t, err) { - var spec Swagger - if err := json.Unmarshal(b, &spec); assert.NoError(t, err) { - err := ExpandSpec(&spec, &ExpandOptions{RelativeBase: fp}) - if assert.NoError(t, err) { - sch := spec.Paths.Paths["/item"].Get.Responses.StatusCodeResponses[200].Schema - if assert.NotNil(t, sch) { - assert.Empty(t, sch.Ref.String()) - assert.Contains(t, sch.Type, "object") - assert.Len(t, sch.Properties, 2) - } - } - } - } -} - -func TestSpecExpansion(t *testing.T) { - spec := new(Swagger) - // resolver, err := defaultSchemaLoader(spec, nil, nil,nil) - // assert.NoError(t, err) - - err := ExpandSpec(spec, nil) - assert.NoError(t, err) - - specDoc, err := jsonDoc("fixtures/expansion/all-the-things.json") - assert.NoError(t, err) - - specPath, _ := absPath("fixtures/expansion/all-the-things.json") - opts := &ExpandOptions{ - RelativeBase: specPath, - } - - spec = new(Swagger) - err = json.Unmarshal(specDoc, spec) - assert.NoError(t, err) - - 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"] - - err = ExpandSpec(spec, opts) - assert.NoError(t, err) - - 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 TestResolveRef(t *testing.T) { - var root interface{} - err := json.Unmarshal([]byte(PetStore20), &root) - assert.NoError(t, err) - ref, err := NewRef("#/definitions/Category") - assert.NoError(t, err) - sch, err := ResolveRef(root, &ref) - assert.NoError(t, err) - b, _ := sch.MarshalJSON() - assert.JSONEq(t, `{"id":"Category","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}}}`, string(b)) -} - -func TestResponseExpansion(t *testing.T) { - specDoc, err := jsonDoc("fixtures/expansion/all-the-things.json") - assert.NoError(t, err) - - basePath, err := absPath("fixtures/expansion/all-the-things.json") - assert.NoError(t, err) - - spec := new(Swagger) - err = json.Unmarshal(specDoc, spec) - assert.NoError(t, err) - - resolver, err := defaultSchemaLoader(spec, nil, nil, nil) - assert.NoError(t, err) - - resp := spec.Responses["anotherPet"] - expected := spec.Responses["petResponse"] - err = expandResponse(&expected, resolver, basePath) - assert.NoError(t, err) - - err = expandResponse(&resp, resolver, basePath) - // b, _ := resp.MarshalJSON() - // log.Printf(string(b)) - // b, _ = expected.MarshalJSON() - // log.Printf(string(b)) - assert.NoError(t, err) - assert.Equal(t, expected, resp) - - resp2 := spec.Paths.Paths["/"].Get.Responses.Default - expected = spec.Responses["stringResponse"] - - err = expandResponse(resp2, resolver, basePath) - assert.NoError(t, err) - assert.Equal(t, expected, *resp2) - - resp = spec.Paths.Paths["/"].Get.Responses.StatusCodeResponses[200] - expected = spec.Responses["petResponse"] - - err = expandResponse(&resp, resolver, basePath) - assert.NoError(t, err) - // assert.Equal(t, expected, resp) -} - -// test the exported version of ExpandResponse -func TestExportedResponseExpansion(t *testing.T) { - specDoc, err := jsonDoc("fixtures/expansion/all-the-things.json") - assert.NoError(t, err) - - basePath, err := absPath("fixtures/expansion/all-the-things.json") - assert.NoError(t, err) - - spec := new(Swagger) - err = json.Unmarshal(specDoc, spec) - assert.NoError(t, err) - - resp := spec.Responses["anotherPet"] - expected := spec.Responses["petResponse"] - err = ExpandResponse(&expected, basePath) - assert.NoError(t, err) - - err = ExpandResponse(&resp, basePath) - // b, _ := resp.MarshalJSON() - // log.Printf(string(b)) - // b, _ = expected.MarshalJSON() - // log.Printf(string(b)) - assert.NoError(t, err) - assert.Equal(t, expected, resp) - - resp2 := spec.Paths.Paths["/"].Get.Responses.Default - expected = spec.Responses["stringResponse"] - - err = ExpandResponse(resp2, basePath) - assert.NoError(t, err) - assert.Equal(t, expected, *resp2) - - resp = spec.Paths.Paths["/"].Get.Responses.StatusCodeResponses[200] - expected = spec.Responses["petResponse"] - - err = ExpandResponse(&resp, basePath) - assert.NoError(t, err) - // assert.Equal(t, expected, resp) -} - -func TestExpandResponseAndParamWithRoot(t *testing.T) { - specDoc, err := jsonDoc("fixtures/bugs/1614/gitea.json") - if !assert.NoError(t, err) { - t.FailNow() - return - } - var spec Swagger - _ = json.Unmarshal(specDoc, &spec) - - // check responses with $ref - resp := spec.Paths.Paths["/admin/users"].Post.Responses.StatusCodeResponses[201] - err = ExpandResponseWithRoot(&resp, spec, nil) - assert.NoError(t, err) - jazon, _ := json.MarshalIndent(resp, "", " ") - m := rex.FindAllStringSubmatch(string(jazon), -1) - assert.Nil(t, m) - - resp = spec.Paths.Paths["/admin/users"].Post.Responses.StatusCodeResponses[403] - err = ExpandResponseWithRoot(&resp, spec, nil) - assert.NoError(t, err) - jazon, _ = json.MarshalIndent(resp, "", " ") - m = rex.FindAllStringSubmatch(string(jazon), -1) - assert.Nil(t, m) - - // check param with $ref - param := spec.Paths.Paths["/admin/users"].Post.Parameters[0] - err = ExpandParameterWithRoot(¶m, spec, nil) - assert.NoError(t, err) - jazon, _ = json.MarshalIndent(param, "", " ") - m = rex.FindAllStringSubmatch(string(jazon), -1) - assert.Nil(t, m) -} - -func TestIssue3(t *testing.T) { - spec := new(Swagger) - specDoc, err := jsonDoc("fixtures/expansion/overflow.json") - assert.NoError(t, err) - - specPath, _ := absPath("fixtures/expansion/overflow.json") - opts := &ExpandOptions{ - RelativeBase: specPath, - } - - err = json.Unmarshal(specDoc, spec) - assert.NoError(t, err) - - assert.NotPanics(t, func() { - err = ExpandSpec(spec, opts) - assert.NoError(t, err) - }, "Calling expand spec with circular refs, should not panic!") -} - -func TestParameterExpansion(t *testing.T) { - paramDoc, err := jsonDoc("fixtures/expansion/params.json") - assert.NoError(t, err) - - spec := new(Swagger) - err = json.Unmarshal(paramDoc, spec) - assert.NoError(t, err) - - basePath, err := absPath("fixtures/expansion/params.json") - assert.NoError(t, err) - - resolver, err := defaultSchemaLoader(spec, nil, nil, nil) - assert.NoError(t, err) - - param := spec.Parameters["query"] - expected := spec.Parameters["tag"] - - err = expandParameter(¶m, resolver, basePath) - assert.NoError(t, err) - assert.Equal(t, expected, param) - - param = spec.Paths.Paths["/cars/{id}"].Parameters[0] - expected = spec.Parameters["id"] - - err = expandParameter(¶m, resolver, basePath) - assert.NoError(t, err) - assert.Equal(t, expected, param) -} - -func TestExportedParameterExpansion(t *testing.T) { - paramDoc, err := jsonDoc("fixtures/expansion/params.json") - assert.NoError(t, err) - - spec := new(Swagger) - err = json.Unmarshal(paramDoc, spec) - assert.NoError(t, err) - - basePath, err := absPath("fixtures/expansion/params.json") - assert.NoError(t, err) - - param := spec.Parameters["query"] - expected := spec.Parameters["tag"] - - err = ExpandParameter(¶m, basePath) - assert.NoError(t, err) - assert.Equal(t, expected, param) - - param = spec.Paths.Paths["/cars/{id}"].Parameters[0] - expected = spec.Parameters["id"] - - err = ExpandParameter(¶m, basePath) - assert.NoError(t, err) - assert.Equal(t, expected, param) -} - -func TestCircularRefsExpansion(t *testing.T) { - carsDoc, err := jsonDoc("fixtures/expansion/circularRefs.json") - assert.NoError(t, err) - - basePath, _ := absPath("fixtures/expansion/circularRefs.json") - - spec := new(Swagger) - err = json.Unmarshal(carsDoc, spec) - assert.NoError(t, err) - - resolver, err := defaultSchemaLoader(spec, &ExpandOptions{RelativeBase: basePath}, nil, nil) - assert.NoError(t, err) - schema := spec.Definitions["car"] - - assert.NotPanics(t, func() { - _, err := expandSchema(schema, []string{"#/definitions/car"}, resolver, basePath) - assert.NoError(t, err) - }, "Calling expand schema with circular refs, should not panic!") -} - -func TestCircularSpec2Expansion(t *testing.T) { - // TODO: assert repeatable results (see commented section below) - - fixturePath := filepath.Join("fixtures", "expansion", "circular-minimal.json") - jazon := expandThisOrDieTrying(t, fixturePath) - assert.NotEmpty(t, jazon) - // assert stripped $ref in result - assert.NotContainsf(t, jazon, "circular-minimal.json#/", - "expected %s to be expanded with stripped circular $ref", fixturePath) - - fixturePath = "fixtures/expansion/circularSpec2.json" - jazon = expandThisOrDieTrying(t, fixturePath) - assert.NotEmpty(t, jazon) - 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 spec (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 Test_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 := "fixtures/more_circulars/spec.json" - jazon := expandThisOrDieTrying(t, fixturePath) - m := rex.FindAllStringSubmatch(jazon, -1) - if assert.NotNil(t, m) { - for _, matched := range m { - subMatch := matched[1] - assert.True(t, strings.HasPrefix(subMatch, "item.json#/item"), - "expected $ref to be relative, got: %s", matched[0]) - } - } - - fixturePath = "fixtures/more_circulars/spec2.json" - jazon = expandThisOrDieTrying(t, fixturePath) - m = rex.FindAllStringSubmatch(jazon, -1) - if assert.NotNil(t, m) { - for _, matched := range m { - subMatch := matched[1] - assert.True(t, strings.HasPrefix(subMatch, "item2.json#/item"), - "expected $ref to be relative, got: %s", matched[0]) - } - } - - fixturePath = "fixtures/more_circulars/spec3.json" - jazon = expandThisOrDieTrying(t, fixturePath) - m = rex.FindAllStringSubmatch(jazon, -1) - if assert.NotNil(t, m) { - for _, matched := range m { - subMatch := matched[1] - assert.True(t, strings.HasPrefix(subMatch, "item.json#/item"), - "expected $ref to be relative, got: %s", matched[0]) - } - } - - fixturePath = "fixtures/more_circulars/spec4.json" - jazon = expandThisOrDieTrying(t, fixturePath) - m = rex.FindAllStringSubmatch(jazon, -1) - if assert.NotNil(t, m) { - for _, matched := range m { - subMatch := matched[1] - assert.True(t, strings.HasPrefix(subMatch, "item4.json#/item"), - "expected $ref to be relative, got: %s", matched[0]) - } - } -} - -func Test_Issue957(t *testing.T) { - fixturePath := "fixtures/bugs/957/fixture-957.json" - jazon := expandThisOrDieTrying(t, fixturePath) - if assert.NotEmpty(t, jazon) { - assert.NotContainsf(t, jazon, "fixture-957.json#/", - "expected %s to be expanded with stripped circular $ref", fixturePath) - m := rex.FindAllStringSubmatch(jazon, -1) - if assert.NotNil(t, m) { - for _, matched := range m { - subMatch := matched[1] - assert.True(t, strings.HasPrefix(subMatch, "#/definitions/"), - "expected $ref to be inlined, got: %s", matched[0]) - } - } - //t.Log(jazon) - } -} - -func Test_Bitbucket(t *testing.T) { - // Additional testcase for circular $ref (from bitbucket api) - - fixturePath := "fixtures/more_circulars/bitbucket.json" - jazon := expandThisOrDieTrying(t, fixturePath) - m := rex.FindAllStringSubmatch(jazon, -1) - if assert.NotNil(t, m) { - for _, matched := range m { - subMatch := matched[1] - assert.True(t, strings.HasPrefix(subMatch, "#/definitions/"), - "expected $ref to be inlined, got: %s", matched[0]) - } - } -} - -func Test_ExpandJSONSchemaDraft4(t *testing.T) { - fixturePath := filepath.Join("schemas", "jsonschema-draft-04.json") - jazon := expandThisSchemaOrDieTrying(t, fixturePath) - // assert all $ref maches "$ref": "http://json-schema.org/draft-04/something" - m := rex.FindAllStringSubmatch(jazon, -1) - if assert.NotNil(t, m) { - for _, matched := range m { - subMatch := matched[1] - assert.True(t, strings.HasPrefix(subMatch, "http://json-schema.org/draft-04/"), - "expected $ref to be remote, got: %s", matched[0]) - } - } -} - -func Test_ExpandSwaggerSchema(t *testing.T) { - fixturePath := filepath.Join("schemas", "v2", "schema.json") - jazon := expandThisSchemaOrDieTrying(t, fixturePath) - // assert all $ref maches "$ref": "#/definitions/something" - m := rex.FindAllStringSubmatch(jazon, -1) - if assert.NotNil(t, m) { - for _, matched := range m { - subMatch := matched[1] - assert.True(t, strings.HasPrefix(subMatch, "#/definitions/"), - "expected $ref to be inlined, got: %s", matched[0]) - } - } -} - -func expandThisSchemaOrDieTrying(t *testing.T, fixturePath string) string { - doc, err := jsonDoc(fixturePath) - if !assert.NoError(t, err) { - t.FailNow() - return "" - } - - specPath, _ := absPath(fixturePath) - - opts := &ExpandOptions{ - RelativeBase: specPath, - } - - sch := new(Schema) - err = json.Unmarshal(doc, sch) - if !assert.NoError(t, err) { - t.FailNow() - return "" - } - - assert.NotPanics(t, func() { - err = ExpandSchemaWithBasePath(sch, nil, opts) - assert.NoError(t, err) - }, "Calling expand schema circular refs, should not panic!") - - bbb, _ := json.MarshalIndent(sch, "", " ") - return string(bbb) -} - -func expandThisOrDieTrying(t *testing.T, fixturePath string) string { - doc, err := jsonDoc(fixturePath) - if !assert.NoError(t, err) { - t.FailNow() - return "" - } - - specPath, _ := absPath(fixturePath) - - opts := &ExpandOptions{ - RelativeBase: specPath, - } - - spec := new(Swagger) - err = json.Unmarshal(doc, spec) - if !assert.NoError(t, err) { - t.FailNow() - return "" - } - - assert.NotPanics(t, func() { - err = ExpandSpec(spec, opts) - assert.NoError(t, err) - }, "Calling expand spec with circular refs, should not panic!") - - bbb, _ := json.MarshalIndent(spec, "", " ") - return string(bbb) -} - -func TestContinueOnErrorExpansion(t *testing.T) { - defer log.SetOutput(os.Stdout) - log.SetOutput(ioutil.Discard) - - missingRefDoc, err := jsonDoc("fixtures/expansion/missingRef.json") - assert.NoError(t, err) - - specPath, _ := absPath("fixtures/expansion/missingRef.json") - - testCase := struct { - Input *Swagger `json:"input"` - Expected *Swagger `json:"expected"` - }{} - err = json.Unmarshal(missingRefDoc, &testCase) - assert.NoError(t, err) - - opts := &ExpandOptions{ - ContinueOnError: true, - RelativeBase: specPath, - } - err = ExpandSpec(testCase.Input, opts) - assert.NoError(t, err) - // b, _ := testCase.Input.MarshalJSON() - // log.Printf(string(b)) - assert.Equal(t, testCase.Input, testCase.Expected, "Should continue expanding spec when a definition can't be found.") - - doc, err := jsonDoc("fixtures/expansion/missingItemRef.json") - spec := new(Swagger) - err = json.Unmarshal(doc, spec) - assert.NoError(t, err) - - assert.NotPanics(t, func() { - err = ExpandSpec(spec, opts) - assert.NoError(t, err) - }, "Array of missing refs should not cause a panic, and continue to expand spec.") -} - -func TestIssue415(t *testing.T) { - doc, err := jsonDoc("fixtures/expansion/clickmeter.json") - assert.NoError(t, err) - - specPath, _ := absPath("fixtures/expansion/clickmeter.json") - - opts := &ExpandOptions{ - RelativeBase: specPath, - } - - spec := new(Swagger) - err = json.Unmarshal(doc, spec) - assert.NoError(t, err) - - assert.NotPanics(t, func() { - err = ExpandSpec(spec, opts) - assert.NoError(t, err) - }, "Calling expand spec with response schemas that have circular refs, should not panic!") -} - -func TestCircularSpecExpansion(t *testing.T) { - doc, err := jsonDoc("fixtures/expansion/circularSpec.json") - assert.NoError(t, err) - - specPath, _ := absPath("fixtures/expansion/circularSpec.json") - - opts := &ExpandOptions{ - RelativeBase: specPath, - } - - spec := new(Swagger) - err = json.Unmarshal(doc, spec) - assert.NoError(t, err) - - assert.NotPanics(t, func() { - err = ExpandSpec(spec, opts) - assert.NoError(t, err) - }, "Calling expand spec with circular refs, should not panic!") -} - -func TestItemsExpansion(t *testing.T) { - carsDoc, err := jsonDoc("fixtures/expansion/schemas2.json") - assert.NoError(t, err) - - basePath, _ := absPath("fixtures/expansion/schemas2.json") - - spec := new(Swagger) - err = json.Unmarshal(carsDoc, spec) - assert.NoError(t, err) - - resolver, err := defaultSchemaLoader(spec, nil, nil, nil) - assert.NoError(t, err) - - schema := spec.Definitions["car"] - oldBrand := schema.Properties["brand"] - assert.NotEmpty(t, oldBrand.Items.Schema.Ref.String()) - assert.NotEqual(t, spec.Definitions["brand"], oldBrand) - - _, err = expandSchema(schema, []string{"#/definitions/car"}, resolver, basePath) - assert.NoError(t, err) - - newBrand := schema.Properties["brand"] - assert.Empty(t, newBrand.Items.Schema.Ref.String()) - assert.Equal(t, spec.Definitions["brand"], *newBrand.Items.Schema) - - schema = spec.Definitions["truck"] - assert.NotEmpty(t, schema.Items.Schema.Ref.String()) - - s, err := expandSchema(schema, []string{"#/definitions/truck"}, resolver, basePath) - schema = *s - assert.NoError(t, err) - assert.Empty(t, schema.Items.Schema.Ref.String()) - assert.Equal(t, spec.Definitions["car"], *schema.Items.Schema) - - sch := new(Schema) - _, err = expandSchema(*sch, []string{""}, resolver, basePath) - assert.NoError(t, err) - - schema = spec.Definitions["batch"] - s, err = expandSchema(schema, []string{"#/definitions/batch"}, resolver, basePath) - schema = *s - assert.NoError(t, err) - assert.Empty(t, schema.Items.Schema.Items.Schema.Ref.String()) - assert.Equal(t, *schema.Items.Schema.Items.Schema, spec.Definitions["brand"]) - - schema = spec.Definitions["batch2"] - s, err = expandSchema(schema, []string{"#/definitions/batch2"}, resolver, basePath) - schema = *s - assert.NoError(t, err) - 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"]) - - schema = spec.Definitions["allofBoth"] - s, err = expandSchema(schema, []string{"#/definitions/allofBoth"}, resolver, basePath) - schema = *s - assert.NoError(t, err) - 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"]) - - schema = spec.Definitions["anyofBoth"] - s, err = expandSchema(schema, []string{"#/definitions/anyofBoth"}, resolver, basePath) - schema = *s - assert.NoError(t, err) - 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"]) - - schema = spec.Definitions["oneofBoth"] - s, err = expandSchema(schema, []string{"#/definitions/oneofBoth"}, resolver, basePath) - schema = *s - assert.NoError(t, err) - 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"]) - - schema = spec.Definitions["notSomething"] - s, err = expandSchema(schema, []string{"#/definitions/notSomething"}, resolver, basePath) - schema = *s - assert.NoError(t, err) - assert.Empty(t, schema.Not.Items.Schema.Ref.String()) - assert.Equal(t, *schema.Not.Items.Schema, spec.Definitions["tag"]) - - schema = spec.Definitions["withAdditional"] - s, err = expandSchema(schema, []string{"#/definitions/withAdditional"}, resolver, basePath) - schema = *s - assert.NoError(t, err) - assert.Empty(t, schema.AdditionalProperties.Schema.Items.Schema.Ref.String()) - assert.Equal(t, *schema.AdditionalProperties.Schema.Items.Schema, spec.Definitions["tag"]) - - schema = spec.Definitions["withAdditionalItems"] - s, err = expandSchema(schema, []string{"#/definitions/withAdditionalItems"}, resolver, basePath) - schema = *s - assert.NoError(t, err) - assert.Empty(t, schema.AdditionalItems.Schema.Items.Schema.Ref.String()) - assert.Equal(t, *schema.AdditionalItems.Schema.Items.Schema, spec.Definitions["tag"]) - - schema = spec.Definitions["withPattern"] - s, err = expandSchema(schema, []string{"#/definitions/withPattern"}, resolver, basePath) - schema = *s - assert.NoError(t, err) - prop := schema.PatternProperties["^x-ab"] - assert.Empty(t, prop.Items.Schema.Ref.String()) - assert.Equal(t, *prop.Items.Schema, spec.Definitions["tag"]) - - schema = spec.Definitions["deps"] - s, err = expandSchema(schema, []string{"#/definitions/deps"}, resolver, basePath) - schema = *s - assert.NoError(t, err) - prop2 := schema.Dependencies["something"] - assert.Empty(t, prop2.Schema.Items.Schema.Ref.String()) - assert.Equal(t, *prop2.Schema.Items.Schema, spec.Definitions["tag"]) - - schema = spec.Definitions["defined"] - s, err = expandSchema(schema, []string{"#/definitions/defined"}, resolver, basePath) - schema = *s - assert.NoError(t, err) - prop = schema.Definitions["something"] - assert.Empty(t, prop.Items.Schema.Ref.String()) - assert.Equal(t, *prop.Items.Schema, spec.Definitions["tag"]) -} - -func TestSchemaExpansion(t *testing.T) { - carsDoc, err := jsonDoc("fixtures/expansion/schemas1.json") - assert.NoError(t, err) - - basePath, _ := absPath("fixtures/expansion/schemas1.json") - - spec := new(Swagger) - err = json.Unmarshal(carsDoc, spec) - assert.NoError(t, err) - - resolver, err := defaultSchemaLoader(spec, nil, nil, nil) - assert.NoError(t, err) - - 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) - schema = *s - assert.NoError(t, err) - - 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) - schema = *s - assert.NoError(t, err) - assert.Empty(t, schema.Ref.String()) - assert.Equal(t, spec.Definitions["car"], schema) - - sch := new(Schema) - _, err = expandSchema(*sch, []string{""}, resolver, basePath) - assert.NoError(t, err) - - schema = spec.Definitions["batch"] - s, err = expandSchema(schema, []string{"#/definitions/batch"}, resolver, basePath) - schema = *s - assert.NoError(t, err) - 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) - schema = *s - assert.NoError(t, err) - 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) - schema = *s - assert.NoError(t, err) - 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) - schema = *s - assert.NoError(t, err) - 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) - schema = *s - assert.NoError(t, err) - 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) - schema = *s - assert.NoError(t, err) - 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) - schema = *s - assert.NoError(t, err) - 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) - schema = *s - assert.NoError(t, err) - 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) - schema = *s - assert.NoError(t, err) - 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) - schema = *s - assert.NoError(t, err) - 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) - schema = *s - assert.NoError(t, err) - prop = schema.Definitions["something"] - assert.Empty(t, prop.Ref.String()) - assert.Equal(t, prop, spec.Definitions["tag"]) - -} - -func TestDefaultResolutionCache(t *testing.T) { - - cache := initResolutionCache() - - 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) -} - -func TestRelativeBaseURI(t *testing.T) { - server := httptest.NewServer(http.FileServer(http.Dir("fixtures/remote"))) - defer server.Close() - - spec := new(Swagger) - // resolver, err := defaultSchemaLoader(spec, nil, nil,nil) - // assert.NoError(t, err) - - err := ExpandSpec(spec, nil) - assert.NoError(t, err) - - specDoc, err := jsonDoc("fixtures/remote/all-the-things.json") - assert.NoError(t, err) - - opts := &ExpandOptions{ - RelativeBase: server.URL + "/all-the-things.json", - } - - spec = new(Swagger) - err = json.Unmarshal(specDoc, spec) - assert.NoError(t, err) - - 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"] - anotherPet.Ref = MustCreateRef(server.URL + "/" + anotherPet.Ref.String()) - err = ExpandResponse(&anotherPet, opts.RelativeBase) - assert.NoError(t, err) - spec.Responses["anotherPet"] = anotherPet - - circularA := spec.Responses["circularA"] - circularA.Ref = MustCreateRef(server.URL + "/" + circularA.Ref.String()) - err = ExpandResponse(&circularA, opts.RelativeBase) - assert.NoError(t, err) - spec.Responses["circularA"] = circularA - - err = ExpandSpec(spec, opts) - assert.NoError(t, err) - - 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 resolutionContextServer() *httptest.Server { - var servedAt string - server := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) { - // fmt.Println("got a request for", req.URL.String()) - if req.URL.Path == "/resolution.json" { - - b, _ := ioutil.ReadFile("fixtures/specs/resolution.json") - var ctnt map[string]interface{} - json.Unmarshal(b, &ctnt) - ctnt["id"] = servedAt - - rw.Header().Set("Content-Type", "application/json") - rw.WriteHeader(200) - bb, _ := json.Marshal(ctnt) - rw.Write(bb) - return - } - if req.URL.Path == "/resolution2.json" { - b, _ := ioutil.ReadFile("fixtures/specs/resolution2.json") - var ctnt map[string]interface{} - json.Unmarshal(b, &ctnt) - ctnt["id"] = servedAt - - rw.Header().Set("Content-Type", "application/json") - rw.WriteHeader(200) - bb, _ := json.Marshal(ctnt) - rw.Write(bb) - return - } - - if req.URL.Path == "/boolProp.json" { - rw.Header().Set("Content-Type", "application/json") - rw.WriteHeader(200) - 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") - rw.WriteHeader(200) - 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") - rw.WriteHeader(200) - 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 TestResolveRemoteRef_RootSame(t *testing.T) { - specs := "fixtures/specs/" - fileserver := http.FileServer(http.Dir(specs)) - server := httptest.NewServer(fileserver) - defer server.Close() - - rootDoc := new(Swagger) - b, err := ioutil.ReadFile("fixtures/specs/refed.json") - // the filename doesn't matter because ref will eventually point to refed.json - specBase, _ := absPath("fixtures/specs/anyotherfile.json") - if assert.NoError(t, err) && assert.NoError(t, json.Unmarshal(b, rootDoc)) { - var result0 Swagger - ref0, _ := NewRef(server.URL + "/refed.json#") - resolver0, _ := defaultSchemaLoader(rootDoc, nil, nil, nil) - if assert.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) - if assert.NoError(t, resolver1.Resolve(&ref1, &result1, specBase)) { - assertSpecs(t, result1, *rootDoc) - } - } -} - -func TestResolveRemoteRef_FromFragment(t *testing.T) { - specs := "fixtures/specs" - fileserver := http.FileServer(http.Dir(specs)) - server := httptest.NewServer(fileserver) - defer server.Close() - - rootDoc := new(Swagger) - b, err := ioutil.ReadFile("fixtures/specs/refed.json") - - if assert.NoError(t, err) && assert.NoError(t, json.Unmarshal(b, rootDoc)) { - var tgt Schema - ref, err := NewRef(server.URL + "/refed.json#/definitions/pet") - if assert.NoError(t, err) { - resolver := &schemaLoader{root: rootDoc, cache: initResolutionCache(), loadDoc: jsonDoc} - if assert.NoError(t, resolver.Resolve(&ref, &tgt, "")) { - assert.Equal(t, []string{"id", "name"}, tgt.Required) - } - } - } -} - -func TestResolveRemoteRef_FromInvalidFragment(t *testing.T) { - specs := "fixtures/specs" - fileserver := http.FileServer(http.Dir(specs)) - server := httptest.NewServer(fileserver) - defer server.Close() - - rootDoc := new(Swagger) - b, err := ioutil.ReadFile("fixtures/specs/refed.json") - if assert.NoError(t, err) && assert.NoError(t, json.Unmarshal(b, rootDoc)) { - var tgt Schema - ref, err := NewRef(server.URL + "/refed.json#/definitions/NotThere") - if assert.NoError(t, err) { - resolver, _ := defaultSchemaLoader(rootDoc, nil, nil, nil) - assert.Error(t, resolver.Resolve(&ref, &tgt, "")) - } - } -} - -func TestResolveRemoteRef_WithResolutionContext(t *testing.T) { - server := resolutionContextServer() - defer server.Close() - - var tgt Schema - ref, err := NewRef(server.URL + "/resolution.json#/definitions/bool") - if assert.NoError(t, err) { - tgt.Ref = ref - ExpandSchema(&tgt, nil, nil) - assert.Equal(t, StringOrArray([]string{"boolean"}), tgt.Type) - } - -} - -func TestResolveRemoteRef_WithNestedResolutionContext(t *testing.T) { - server := resolutionContextServer() - defer server.Close() - - var tgt Schema - ref, err := NewRef(server.URL + "/resolution.json#/items") - if assert.NoError(t, err) { - tgt.Ref = ref - ExpandSchema(&tgt, nil, nil) - assert.Equal(t, StringOrArray([]string{"string"}), tgt.Items.Schema.Type) - } -} - -/* 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_WithNestedResolutionContext_WithParentID(t *testing.T) { -// server := resolutionContextServer() -// defer server.Close() - -// var tgt Schema -// ref, err := NewRef(server.URL + "/resolution.json#/items/items") -// if assert.NoError(t, err) { -// tgt.Ref = ref -// ExpandSchema(&tgt, nil, nil) -// assert.Equal(t, StringOrArray([]string{"string"}), tgt.Type) -// } -// } - -func TestResolveRemoteRef_WithNestedResolutionContextWithFragment(t *testing.T) { - server := resolutionContextServer() - defer server.Close() - - var tgt Schema - ref, err := NewRef(server.URL + "/resolution2.json#/items") - if assert.NoError(t, err) { - tgt.Ref = ref - ExpandSchema(&tgt, nil, nil) - assert.Equal(t, StringOrArray([]string{"file"}), tgt.Items.Schema.Type) - } - -} - -/* 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 := ioutil.ReadFile("fixtures/specs/refed.json") -// if assert.NoError(t, err) && assert.NoError(t, json.Unmarshal(b, rootDoc)) { -// var tgt Schema -// ref, err := NewRef(server.URL + "/resolution2.json#/items/items") -// if assert.NoError(t, err) { -// resolver, _ := defaultSchemaLoader(rootDoc, nil, nil,nil) -// if assert.NoError(t, resolver.Resolve(&ref, &tgt, "")) { -// assert.Equal(t, StringOrArray([]string{"file"}), tgt.Type) -// } -// } -// } -// } - -func TestResolveRemoteRef_ToParameter(t *testing.T) { - specs := "fixtures/specs" - fileserver := http.FileServer(http.Dir(specs)) - server := httptest.NewServer(fileserver) - defer server.Close() - - rootDoc := new(Swagger) - b, err := ioutil.ReadFile("fixtures/specs/refed.json") - if assert.NoError(t, err) && assert.NoError(t, json.Unmarshal(b, rootDoc)) { - var tgt Parameter - ref, err := NewRef(server.URL + "/refed.json#/parameters/idParam") - if assert.NoError(t, err) { - - resolver, _ := defaultSchemaLoader(rootDoc, nil, nil, nil) - if assert.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) { - specs := "fixtures/specs" - fileserver := http.FileServer(http.Dir(specs)) - server := httptest.NewServer(fileserver) - defer server.Close() - - rootDoc := new(Swagger) - b, err := ioutil.ReadFile("fixtures/specs/refed.json") - if assert.NoError(t, err) && assert.NoError(t, json.Unmarshal(b, rootDoc)) { - var tgt PathItem - ref, err := NewRef(server.URL + "/refed.json#/paths/" + jsonpointer.Escape("/pets/{id}")) - if assert.NoError(t, err) { - - resolver, _ := defaultSchemaLoader(rootDoc, nil, nil, nil) - if assert.NoError(t, resolver.Resolve(&ref, &tgt, "")) { - assert.Equal(t, rootDoc.Paths.Paths["/pets/{id}"].Get, tgt.Get) - } - } - } -} - -func TestResolveRemoteRef_ToResponse(t *testing.T) { - specs := "fixtures/specs" - fileserver := http.FileServer(http.Dir(specs)) - server := httptest.NewServer(fileserver) - defer server.Close() - - rootDoc := new(Swagger) - b, err := ioutil.ReadFile("fixtures/specs/refed.json") - if assert.NoError(t, err) && assert.NoError(t, json.Unmarshal(b, rootDoc)) { - var tgt Response - ref, err := NewRef(server.URL + "/refed.json#/responses/petResponse") - if assert.NoError(t, err) { - - resolver, _ := defaultSchemaLoader(rootDoc, nil, nil, nil) - if assert.NoError(t, resolver.Resolve(&ref, &tgt, "")) { - assert.Equal(t, rootDoc.Responses["petResponse"], tgt) - } - } - } -} - -func TestResolveLocalRef_SameRoot(t *testing.T) { - rootDoc := new(Swagger) - json.Unmarshal(PetStoreJSONMessage, rootDoc) - - result := new(Swagger) - ref, _ := NewRef("#") - resolver, _ := defaultSchemaLoader(rootDoc, nil, nil, nil) - err := resolver.Resolve(&ref, result, "") - if assert.NoError(t, err) { - assert.Equal(t, rootDoc, result) - } -} - -func TestResolveLocalRef_FromFragment(t *testing.T) { - rootDoc := new(Swagger) - json.Unmarshal(PetStoreJSONMessage, rootDoc) - - var tgt Schema - ref, err := NewRef("#/definitions/Category") - if assert.NoError(t, err) { - resolver, _ := defaultSchemaLoader(rootDoc, nil, nil, nil) - err := resolver.Resolve(&ref, &tgt, "") - if assert.NoError(t, err) { - assert.Equal(t, "Category", tgt.ID) - } - } -} - -func TestResolveLocalRef_FromInvalidFragment(t *testing.T) { - rootDoc := new(Swagger) - json.Unmarshal(PetStoreJSONMessage, rootDoc) - - var tgt Schema - ref, err := NewRef("#/definitions/NotThere") - if assert.NoError(t, err) { - resolver, _ := defaultSchemaLoader(rootDoc, nil, nil, nil) - err := resolver.Resolve(&ref, &tgt, "") - assert.Error(t, err) - } -} - -func TestResolveLocalRef_Parameter(t *testing.T) { - rootDoc := new(Swagger) - b, err := ioutil.ReadFile("fixtures/specs/refed.json") - basePath, _ := absPath("fixtures/specs/refed.json") - if assert.NoError(t, err) && assert.NoError(t, json.Unmarshal(b, rootDoc)) { - var tgt Parameter - ref, err := NewRef("#/parameters/idParam") - if assert.NoError(t, err) { - resolver, _ := defaultSchemaLoader(rootDoc, nil, nil, nil) - if assert.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 := ioutil.ReadFile("fixtures/specs/refed.json") - basePath, _ := absPath("fixtures/specs/refed.json") - if assert.NoError(t, err) && assert.NoError(t, json.Unmarshal(b, rootDoc)) { - var tgt PathItem - ref, err := NewRef("#/paths/" + jsonpointer.Escape("/pets/{id}")) - if assert.NoError(t, err) { - resolver, _ := defaultSchemaLoader(rootDoc, nil, nil, nil) - if assert.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 := ioutil.ReadFile("fixtures/specs/refed.json") - basePath, _ := absPath("fixtures/specs/refed.json") - if assert.NoError(t, err) && assert.NoError(t, json.Unmarshal(b, rootDoc)) { - var tgt Response - ref, err := NewRef("#/responses/petResponse") - if assert.NoError(t, err) { - resolver, _ := defaultSchemaLoader(rootDoc, nil, nil, nil) - if assert.NoError(t, resolver.Resolve(&ref, &tgt, basePath)) { - assert.Equal(t, rootDoc.Responses["petResponse"], tgt) - } - } - } -} - -func TestResolveForTransitiveRefs(t *testing.T) { - var spec *Swagger - rawSpec, err := ioutil.ReadFile("fixtures/specs/todos.json") - assert.NoError(t, err) - - basePath, err := absPath("fixtures/specs/todos.json") - assert.NoError(t, err) - - opts := &ExpandOptions{ - RelativeBase: basePath, - } - - err = json.Unmarshal(rawSpec, &spec) - assert.NoError(t, err) - - err = ExpandSpec(spec, opts) - assert.NoError(t, err) -} - -const ( - withoutSchemaID = "removed" - withSchemaID = "schema" -) - -func TestExpandSchemaWithRoot(t *testing.T) { - root := new(Swagger) - _ = 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 - //Debug = true - root.Definitions["Pet"] = origPet - expandRootWithID(t, root, withSchemaID) -} - -func expandRootWithID(t *testing.T, root *Swagger, testcase string) { - t.Logf("case: expanding $ref to schema without ID, with nested $ref with %s ID", testcase) - sch := &Schema{ - SchemaProps: SchemaProps{ - Ref: MustCreateRef("#/definitions/newPet"), - }, - } - err := ExpandSchema(sch, root, nil) - if testcase == withSchemaID { - assert.Errorf(t, err, "expected %s NOT to expand properly because of the ID in the parent schema", sch.Ref.String()) - } else { - assert.NoErrorf(t, err, "expected %s to expand properly", sch.Ref.String()) - } - if Debug { - bbb, _ := json.MarshalIndent(sch, "", " ") - t.Log(string(bbb)) - } - - t.Log("case: expanding $ref to schema without nested $ref") - sch = &Schema{ - SchemaProps: SchemaProps{ - Ref: MustCreateRef("#/definitions/Category"), - }, - } - err = ExpandSchema(sch, root, nil) - assert.NoErrorf(t, err, "expected %s to expand properly", sch.Ref.String()) - if Debug { - bbb, _ := json.MarshalIndent(sch, "", " ") - t.Log(string(bbb)) - } - t.Logf("case: expanding $ref to schema with %s ID and nested $ref", testcase) - sch = &Schema{ - SchemaProps: SchemaProps{ - Ref: MustCreateRef("#/definitions/Pet"), - }, - } - err = ExpandSchema(sch, root, nil) - if testcase == withSchemaID { - assert.Errorf(t, err, "expected %s NOT to expand properly because of the ID in the parent schema", sch.Ref.String()) - } else { - assert.NoErrorf(t, err, "expected %s to expand properly", sch.Ref.String()) - } - if Debug { - bbb, _ := json.MarshalIndent(sch, "", " ") - t.Log(string(bbb)) - } -} - -// PetStoreJSONMessage json raw message for Petstore20 -var PetStoreJSONMessage = json.RawMessage([]byte(PetStore20)) - -// 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" - } - } -} -` diff --git a/vendor/github.com/go-openapi/spec/external_docs.go b/vendor/github.com/go-openapi/spec/external_docs.go deleted file mode 100644 index 88add91b..00000000 --- a/vendor/github.com/go-openapi/spec/external_docs.go +++ /dev/null @@ -1,24 +0,0 @@ -// 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"` -} diff --git a/vendor/github.com/go-openapi/spec/external_docs_test.go b/vendor/github.com/go-openapi/spec/external_docs_test.go deleted file mode 100644 index 14c5ef15..00000000 --- a/vendor/github.com/go-openapi/spec/external_docs_test.go +++ /dev/null @@ -1,29 +0,0 @@ -// 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{"the name", "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) -} diff --git a/vendor/github.com/go-openapi/spec/fixtures/bugs/1429/remote/farther/farther.yaml b/vendor/github.com/go-openapi/spec/fixtures/bugs/1429/remote/farther/farther.yaml deleted file mode 100644 index 857268e4..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/bugs/1429/remote/farther/farther.yaml +++ /dev/null @@ -1,5 +0,0 @@ -farFarAway: - type: object - properties: - farFarAwayProp: - type: integer diff --git a/vendor/github.com/go-openapi/spec/fixtures/bugs/1429/remote/remote.yaml b/vendor/github.com/go-openapi/spec/fixtures/bugs/1429/remote/remote.yaml deleted file mode 100644 index 3e889453..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/bugs/1429/remote/remote.yaml +++ /dev/null @@ -1,11 +0,0 @@ -aRemotePlace: - type: object - properties: - remoteProp: - type: integer - fartherProp: - $ref: './farther/farther.yaml#/farFarAway' - -moreRemoteThanYouCanThink: - #$ref: './remote/remote.yaml#/farFarAway' - type: integer diff --git a/vendor/github.com/go-openapi/spec/fixtures/bugs/1429/remote/remote/remote.yaml b/vendor/github.com/go-openapi/spec/fixtures/bugs/1429/remote/remote/remote.yaml deleted file mode 100644 index 857268e4..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/bugs/1429/remote/remote/remote.yaml +++ /dev/null @@ -1,5 +0,0 @@ -farFarAway: - type: object - properties: - farFarAwayProp: - type: integer diff --git a/vendor/github.com/go-openapi/spec/fixtures/bugs/1429/responses.yaml b/vendor/github.com/go-openapi/spec/fixtures/bugs/1429/responses.yaml deleted file mode 100644 index 6db8e726..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/bugs/1429/responses.yaml +++ /dev/null @@ -1,104 +0,0 @@ -swagger: '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 diff --git a/vendor/github.com/go-openapi/spec/fixtures/bugs/1429/swagger.yaml b/vendor/github.com/go-openapi/spec/fixtures/bugs/1429/swagger.yaml deleted file mode 100644 index 6ae0aba8..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/bugs/1429/swagger.yaml +++ /dev/null @@ -1,39 +0,0 @@ -swagger: '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' diff --git a/vendor/github.com/go-openapi/spec/fixtures/bugs/1614/gitea.json b/vendor/github.com/go-openapi/spec/fixtures/bugs/1614/gitea.json deleted file mode 100644 index f75412b8..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/bugs/1614/gitea.json +++ /dev/null @@ -1,7916 +0,0 @@ -{ - "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": [] - } - ] -} diff --git a/vendor/github.com/go-openapi/spec/fixtures/bugs/1621/definitions.yaml b/vendor/github.com/go-openapi/spec/fixtures/bugs/1621/definitions.yaml deleted file mode 100644 index dcd4cf01..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/bugs/1621/definitions.yaml +++ /dev/null @@ -1,618 +0,0 @@ -definitions: - - # 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 - diff --git a/vendor/github.com/go-openapi/spec/fixtures/bugs/1621/fixture-1621.yaml b/vendor/github.com/go-openapi/spec/fixtures/bugs/1621/fixture-1621.yaml deleted file mode 100644 index 5d0b7029..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/bugs/1621/fixture-1621.yaml +++ /dev/null @@ -1,1310 +0,0 @@ -swagger: "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" - diff --git a/vendor/github.com/go-openapi/spec/fixtures/bugs/1621/parameters.yaml b/vendor/github.com/go-openapi/spec/fixtures/bugs/1621/parameters.yaml deleted file mode 100644 index de5de089..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/bugs/1621/parameters.yaml +++ /dev/null @@ -1,61 +0,0 @@ -parameters: - - 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 - diff --git a/vendor/github.com/go-openapi/spec/fixtures/bugs/1621/responses.yaml b/vendor/github.com/go-openapi/spec/fixtures/bugs/1621/responses.yaml deleted file mode 100644 index 5c0d49c8..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/bugs/1621/responses.yaml +++ /dev/null @@ -1,13 +0,0 @@ -responses: - - 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." - } - diff --git a/vendor/github.com/go-openapi/spec/fixtures/bugs/69/dapperbox.json b/vendor/github.com/go-openapi/spec/fixtures/bugs/69/dapperbox.json deleted file mode 100644 index 6a2fbe1c..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/bugs/69/dapperbox.json +++ /dev/null @@ -1,38329 +0,0 @@ -{ - "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 -} \ No newline at end of file diff --git a/vendor/github.com/go-openapi/spec/fixtures/bugs/957/fixture-957.json b/vendor/github.com/go-openapi/spec/fixtures/bugs/957/fixture-957.json deleted file mode 100644 index 2de6bb43..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/bugs/957/fixture-957.json +++ /dev/null @@ -1,3713 +0,0 @@ -{ - "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." - } - } -} diff --git a/vendor/github.com/go-openapi/spec/fixtures/expansion/all-the-things.json b/vendor/github.com/go-openapi/spec/fixtures/expansion/all-the-things.json deleted file mode 100644 index 42e6f24e..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/expansion/all-the-things.json +++ /dev/null @@ -1,254 +0,0 @@ -{ - "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" - } - } - } - } -} \ No newline at end of file diff --git a/vendor/github.com/go-openapi/spec/fixtures/expansion/circular-minimal.json b/vendor/github.com/go-openapi/spec/fixtures/expansion/circular-minimal.json deleted file mode 100644 index 56a066e9..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/expansion/circular-minimal.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "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" - } - } - } - } -} diff --git a/vendor/github.com/go-openapi/spec/fixtures/expansion/circularRefs.json b/vendor/github.com/go-openapi/spec/fixtures/expansion/circularRefs.json deleted file mode 100644 index f501aa14..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/expansion/circularRefs.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "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" - } - } - } - } -} diff --git a/vendor/github.com/go-openapi/spec/fixtures/expansion/circularSpec.json b/vendor/github.com/go-openapi/spec/fixtures/expansion/circularSpec.json deleted file mode 100644 index 7b39b999..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/expansion/circularSpec.json +++ /dev/null @@ -1 +0,0 @@ -{"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"]}}} diff --git a/vendor/github.com/go-openapi/spec/fixtures/expansion/circularSpec.yaml b/vendor/github.com/go-openapi/spec/fixtures/expansion/circularSpec.yaml deleted file mode 100644 index d43bd464..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/expansion/circularSpec.yaml +++ /dev/null @@ -1,67 +0,0 @@ ---- -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 diff --git a/vendor/github.com/go-openapi/spec/fixtures/expansion/circularSpec2.json b/vendor/github.com/go-openapi/spec/fixtures/expansion/circularSpec2.json deleted file mode 100644 index e535418d..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/expansion/circularSpec2.json +++ /dev/null @@ -1,330 +0,0 @@ -{ - "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" - } - } -} diff --git a/vendor/github.com/go-openapi/spec/fixtures/expansion/clickmeter.json b/vendor/github.com/go-openapi/spec/fixtures/expansion/clickmeter.json deleted file mode 100644 index 27e819aa..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/expansion/clickmeter.json +++ /dev/null @@ -1 +0,0 @@ -{"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"}}} diff --git a/vendor/github.com/go-openapi/spec/fixtures/expansion/clickmeter.yaml b/vendor/github.com/go-openapi/spec/fixtures/expansion/clickmeter.yaml deleted file mode 100644 index 0ce32b1a..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/expansion/clickmeter.yaml +++ /dev/null @@ -1,6461 +0,0 @@ -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 diff --git a/vendor/github.com/go-openapi/spec/fixtures/expansion/invalid-refs.json b/vendor/github.com/go-openapi/spec/fixtures/expansion/invalid-refs.json deleted file mode 100644 index d636d458..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/expansion/invalid-refs.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "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" - } - } - } - } -} diff --git a/vendor/github.com/go-openapi/spec/fixtures/expansion/missingItemRef.json b/vendor/github.com/go-openapi/spec/fixtures/expansion/missingItemRef.json deleted file mode 100644 index f3908d52..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/expansion/missingItemRef.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "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" - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/vendor/github.com/go-openapi/spec/fixtures/expansion/missingRef.json b/vendor/github.com/go-openapi/spec/fixtures/expansion/missingRef.json deleted file mode 100644 index d5979469..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/expansion/missingRef.json +++ /dev/null @@ -1,165 +0,0 @@ -{ - "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" - } - } - } - } - } -} diff --git a/vendor/github.com/go-openapi/spec/fixtures/expansion/overflow.json b/vendor/github.com/go-openapi/spec/fixtures/expansion/overflow.json deleted file mode 100644 index 5a2a9f3d..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/expansion/overflow.json +++ /dev/null @@ -1,124 +0,0 @@ -{ - "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" - ] - } - } -} diff --git a/vendor/github.com/go-openapi/spec/fixtures/expansion/params.json b/vendor/github.com/go-openapi/spec/fixtures/expansion/params.json deleted file mode 100644 index 76e7b418..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/expansion/params.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "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"} - ] - } - } -} \ No newline at end of file diff --git a/vendor/github.com/go-openapi/spec/fixtures/expansion/schemas1.json b/vendor/github.com/go-openapi/spec/fixtures/expansion/schemas1.json deleted file mode 100644 index e53a412e..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/expansion/schemas1.json +++ /dev/null @@ -1,127 +0,0 @@ -{ - "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" - } - } - } - } -} \ No newline at end of file diff --git a/vendor/github.com/go-openapi/spec/fixtures/expansion/schemas2.json b/vendor/github.com/go-openapi/spec/fixtures/expansion/schemas2.json deleted file mode 100644 index fe885fd9..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/expansion/schemas2.json +++ /dev/null @@ -1,161 +0,0 @@ -{ - "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" - } - } - } - } - } -} diff --git a/vendor/github.com/go-openapi/spec/fixtures/local_expansion/item.json b/vendor/github.com/go-openapi/spec/fixtures/local_expansion/item.json deleted file mode 100644 index f042fdd7..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/local_expansion/item.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "properties": { - "id": { - "format": "int64", - "readOnly": true, - "type": "integer" - }, - "title": { - "maxLength": 80, - "minLength": 2, - "type": "string" - } - }, - "required": [ - "title" - ], - "type": "object" -} diff --git a/vendor/github.com/go-openapi/spec/fixtures/local_expansion/item2.yaml b/vendor/github.com/go-openapi/spec/fixtures/local_expansion/item2.yaml deleted file mode 100644 index 87803b59..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/local_expansion/item2.yaml +++ /dev/null @@ -1,12 +0,0 @@ -type: object -required: - - title -properties: - id: - type: integer - format: uint64 - readOnly: true - title: - type: string - minLength: 2 - maxLength: 80 diff --git a/vendor/github.com/go-openapi/spec/fixtures/local_expansion/spec.json b/vendor/github.com/go-openapi/spec/fixtures/local_expansion/spec.json deleted file mode 100644 index 5c653bca..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/local_expansion/spec.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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" -} diff --git a/vendor/github.com/go-openapi/spec/fixtures/local_expansion/spec2.yaml b/vendor/github.com/go-openapi/spec/fixtures/local_expansion/spec2.yaml deleted file mode 100644 index dced7592..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/local_expansion/spec2.yaml +++ /dev/null @@ -1,30 +0,0 @@ ---- -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" diff --git a/vendor/github.com/go-openapi/spec/fixtures/more_circulars/bitbucket.json b/vendor/github.com/go-openapi/spec/fixtures/more_circulars/bitbucket.json deleted file mode 100644 index 49e40521..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/more_circulars/bitbucket.json +++ /dev/null @@ -1,8322 +0,0 @@ -{ - "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" - ] -} diff --git a/vendor/github.com/go-openapi/spec/fixtures/more_circulars/item.json b/vendor/github.com/go-openapi/spec/fixtures/more_circulars/item.json deleted file mode 100644 index 34504a64..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/more_circulars/item.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "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" - } - } - } -} diff --git a/vendor/github.com/go-openapi/spec/fixtures/more_circulars/item2.json b/vendor/github.com/go-openapi/spec/fixtures/more_circulars/item2.json deleted file mode 100644 index 99e8820a..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/more_circulars/item2.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "item": { - "type": "object", - "required": [ - "title" - ], - "properties": { - "id": { - "type": "integer", - "format": "uint64", - "readOnly": true - }, - "title": { - "type": "string", - "minLength": 2, - "maxLength": 80 - }, - "subitem": { - "$ref": "#/item" - } - } - } -} diff --git a/vendor/github.com/go-openapi/spec/fixtures/more_circulars/item4.json b/vendor/github.com/go-openapi/spec/fixtures/more_circulars/item4.json deleted file mode 100644 index a90c3713..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/more_circulars/item4.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "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" - } - } - } -} diff --git a/vendor/github.com/go-openapi/spec/fixtures/more_circulars/spec.json b/vendor/github.com/go-openapi/spec/fixtures/more_circulars/spec.json deleted file mode 100644 index 74756f9b..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/more_circulars/spec.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "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" - } - } - } - } - } -} diff --git a/vendor/github.com/go-openapi/spec/fixtures/more_circulars/spec2.json b/vendor/github.com/go-openapi/spec/fixtures/more_circulars/spec2.json deleted file mode 100644 index 40138300..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/more_circulars/spec2.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "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" - } - } - } - } - } -} diff --git a/vendor/github.com/go-openapi/spec/fixtures/more_circulars/spec3.json b/vendor/github.com/go-openapi/spec/fixtures/more_circulars/spec3.json deleted file mode 100644 index 3c2f0e9b..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/more_circulars/spec3.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "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" - } - } -} diff --git a/vendor/github.com/go-openapi/spec/fixtures/more_circulars/spec4.json b/vendor/github.com/go-openapi/spec/fixtures/more_circulars/spec4.json deleted file mode 100644 index 9db6ba94..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/more_circulars/spec4.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "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", - "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" - } - } - } - } - } - } -} diff --git a/vendor/github.com/go-openapi/spec/fixtures/remote/all-the-things.json b/vendor/github.com/go-openapi/spec/fixtures/remote/all-the-things.json deleted file mode 100644 index f8e615d3..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/remote/all-the-things.json +++ /dev/null @@ -1,245 +0,0 @@ -{ - "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" - } - }, - "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" - } - } - } - } -} diff --git a/vendor/github.com/go-openapi/spec/fixtures/remote/pet/pet.json b/vendor/github.com/go-openapi/spec/fixtures/remote/pet/pet.json deleted file mode 100644 index 7b631f3e..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/remote/pet/pet.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "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" - }, - "anotherPet": { - "$ref": "#/responses/petResponse" - } - }, - "definitions": { - "pet": { - "required": ["id", "name"], - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "name": { - "type": "string" - }, - "tag": { - "type": "string" - } - } - } - } -} diff --git a/vendor/github.com/go-openapi/spec/fixtures/specs/deeper/arrayProp.json b/vendor/github.com/go-openapi/spec/fixtures/specs/deeper/arrayProp.json deleted file mode 100644 index 8f8dbf6b..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/specs/deeper/arrayProp.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "type":"array", - "items": { - "type": "string" - } -} \ No newline at end of file diff --git a/vendor/github.com/go-openapi/spec/fixtures/specs/deeper/stringProp.json b/vendor/github.com/go-openapi/spec/fixtures/specs/deeper/stringProp.json deleted file mode 100644 index 169a0d70..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/specs/deeper/stringProp.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "string" -} \ No newline at end of file diff --git a/vendor/github.com/go-openapi/spec/fixtures/specs/refed.json b/vendor/github.com/go-openapi/spec/fixtures/specs/refed.json deleted file mode 100644 index 142be8bb..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/specs/refed.json +++ /dev/null @@ -1,224 +0,0 @@ -{ - "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" - } - } - } - } -} \ No newline at end of file diff --git a/vendor/github.com/go-openapi/spec/fixtures/specs/resolution.json b/vendor/github.com/go-openapi/spec/fixtures/specs/resolution.json deleted file mode 100644 index 43cabe85..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/specs/resolution.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "id": "http://localhost:1234", - "items": { - "id": "deeper/", - "items": { - "$ref": "stringProp.json" - } - }, - "definitions": { - "bool": { - "$ref": "boolProp.json" - } - } -} \ No newline at end of file diff --git a/vendor/github.com/go-openapi/spec/fixtures/specs/resolution2.json b/vendor/github.com/go-openapi/spec/fixtures/specs/resolution2.json deleted file mode 100644 index 5d7a0056..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/specs/resolution2.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "id": "http://localhost:1234", - "items": { - "id": "deeper/", - "items": { - "$ref": "arrayProp.json#/items" - } - } -} \ No newline at end of file diff --git a/vendor/github.com/go-openapi/spec/fixtures/specs/todos.common.json b/vendor/github.com/go-openapi/spec/fixtures/specs/todos.common.json deleted file mode 100644 index 1c43908a..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/specs/todos.common.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "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"] - } - } -} diff --git a/vendor/github.com/go-openapi/spec/fixtures/specs/todos.json b/vendor/github.com/go-openapi/spec/fixtures/specs/todos.json deleted file mode 100644 index b9460bdc..00000000 --- a/vendor/github.com/go-openapi/spec/fixtures/specs/todos.json +++ /dev/null @@ -1,346 +0,0 @@ -{ - "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" - }] -} diff --git a/vendor/github.com/go-openapi/spec/go.mod b/vendor/github.com/go-openapi/spec/go.mod deleted file mode 100644 index 5af64c10..00000000 --- a/vendor/github.com/go-openapi/spec/go.mod +++ /dev/null @@ -1,16 +0,0 @@ -module github.com/go-openapi/spec - -require ( - github.com/PuerkitoBio/purell v1.1.0 // indirect - github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/go-openapi/jsonpointer v0.17.0 - github.com/go-openapi/jsonreference v0.17.0 - github.com/go-openapi/swag v0.17.0 - github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/stretchr/testify v1.2.2 - golang.org/x/net v0.0.0-20181005035420-146acd28ed58 // indirect - golang.org/x/text v0.3.0 // indirect - gopkg.in/yaml.v2 v2.2.1 -) diff --git a/vendor/github.com/go-openapi/spec/go.sum b/vendor/github.com/go-openapi/spec/go.sum deleted file mode 100644 index ab6bfb60..00000000 --- a/vendor/github.com/go-openapi/spec/go.sum +++ /dev/null @@ -1,22 +0,0 @@ -github.com/PuerkitoBio/purell v1.1.0 h1:rmGxhojJlM0tuKtfdvliR84CFHljx9ag64t2xmVkjK4= -github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/davecgh/go-spew v1.1.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.17.0 h1:Bpl2DtZ6k7wKqfFs7e+4P08+M9I3FQgn09a1UsRUQbk= -github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= -github.com/go-openapi/jsonreference v0.17.0 h1:d/o7/fsLWWQZACbihvZxcyLQ59jfUVs7WOJv/ak7T7A= -github.com/go-openapi/jsonreference v0.17.0/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= -github.com/go-openapi/swag v0.17.0 h1:7wu+dZ5k83kvUWeAb+WUkFiUhDzwGqzTR/NhWzeo1JU= -github.com/go-openapi/swag v0.17.0/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= -github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329 h1:2gxZ0XQIU/5z3Z3bUBu+FXuk2pFbkN6tcwi/pjyaDic= -github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -golang.org/x/net v0.0.0-20181005035420-146acd28ed58 h1:otZG8yDCO4LVps5+9bxOeNiCvgmOyt96J3roHTYs7oE= -golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/github.com/go-openapi/spec/header.go b/vendor/github.com/go-openapi/spec/header.go deleted file mode 100644 index 82f77f77..00000000 --- a/vendor/github.com/go-openapi/spec/header.go +++ /dev/null @@ -1,193 +0,0 @@ -// 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" -) - -// 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 = "array" - 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 -} - -// 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 -} diff --git a/vendor/github.com/go-openapi/spec/header_test.go b/vendor/github.com/go-openapi/spec/header_test.go deleted file mode 100644 index bf4e4bf2..00000000 --- a/vendor/github.com/go-openapi/spec/header_test.go +++ /dev/null @@ -1,126 +0,0 @@ -// 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" -) - -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"}, - }, -} - -var 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 - if assert.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") - if !assert.NoError(t, err) || !assert.NotNil(t, res) || !assert.IsType(t, def, res) { - t.FailNow() - return - } - def = res.(string) - assert.Equal(t, "8", def) - - var x *interface{} - res, err = header.JSONLookup("x-framework") - if !assert.NoError(t, err) || !assert.NotNil(t, res) || !assert.IsType(t, x, res) { - t.FailNow() - return - } - - x = res.(*interface{}) - assert.EqualValues(t, "swagger-go", *x) - - res, err = header.JSONLookup("unknown") - if !assert.Error(t, err) || !assert.Nil(t, res) { - t.FailNow() - return - } - - var max *float64 - res, err = header.JSONLookup("maximum") - if !assert.NoError(t, err) || !assert.NotNil(t, res) || !assert.IsType(t, max, res) { - t.FailNow() - return - } - max = res.(*float64) - assert.Equal(t, float64(100), *max) -} diff --git a/vendor/github.com/go-openapi/spec/info.go b/vendor/github.com/go-openapi/spec/info.go deleted file mode 100644 index cfb37ec1..00000000 --- a/vendor/github.com/go-openapi/spec/info.go +++ /dev/null @@ -1,168 +0,0 @@ -// 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" -) - -// 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 -} - -// 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 - } - if err := json.Unmarshal(data, &i.VendorExtensible); err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/go-openapi/spec/info_test.go b/vendor/github.com/go-openapi/spec/info_test.go deleted file mode 100644 index fc40c163..00000000 --- a/vendor/github.com/go-openapi/spec/info_test.go +++ /dev/null @@ -1,65 +0,0 @@ -// 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" -) - -var 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{Name: "wordnik api team", URL: "http://developer.wordnik.com"}, - License: &License{Name: "Creative Commons 4.0 International", URL: "http://creativecommons.org/licenses/by/4.0/"}, - }, - VendorExtensible: VendorExtensible{map[string]interface{}{"x-framework": "go-swagger"}}, -} - -func TestIntegrationInfo_Serialize(t *testing.T) { - b, err := json.MarshalIndent(info, "", "\t") - if assert.NoError(t, err) { - assert.Equal(t, infoJSON, string(b)) - } -} - -func TestIntegrationInfo_Deserialize(t *testing.T) { - actual := Info{} - err := json.Unmarshal([]byte(infoJSON), &actual) - if assert.NoError(t, err) { - assert.EqualValues(t, info, actual) - } -} diff --git a/vendor/github.com/go-openapi/spec/items.go b/vendor/github.com/go-openapi/spec/items.go deleted file mode 100644 index cf429897..00000000 --- a/vendor/github.com/go-openapi/spec/items.go +++ /dev/null @@ -1,233 +0,0 @@ -// 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" -) - -// SimpleSchema describe swagger simple schemas for parameters and headers -type SimpleSchema struct { - Type string `json:"type,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() -} - -// 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"` -} - -// 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 -} - -// CollectionOf a fluent builder method for an array item -func (i *Items) CollectionOf(items *Items, format string) *Items { - i.Type = "array" - 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 -} - -// 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 == "$ref" { - 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 -} diff --git a/vendor/github.com/go-openapi/spec/items_test.go b/vendor/github.com/go-openapi/spec/items_test.go deleted file mode 100644 index 1f2dfd85..00000000 --- a/vendor/github.com/go-openapi/spec/items_test.go +++ /dev/null @@ -1,141 +0,0 @@ -// 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" -) - -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", - }, -} - -var 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 - if assert.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()) -} - -func TestJSONLookupItems(t *testing.T) { - res, err := items.JSONLookup("$ref") - if !assert.NoError(t, err) { - t.FailNow() - return - } - if assert.IsType(t, &Ref{}, res) { - ref := res.(*Ref) - assert.EqualValues(t, MustCreateRef("Dog"), *ref) - } - - var max *float64 - res, err = items.JSONLookup("maximum") - if !assert.NoError(t, err) || !assert.NotNil(t, res) || !assert.IsType(t, max, res) { - t.FailNow() - return - } - max = res.(*float64) - assert.Equal(t, float64(100), *max) - - var f string - res, err = items.JSONLookup("collectionFormat") - if !assert.NoError(t, err) || !assert.NotNil(t, res) || !assert.IsType(t, f, res) { - t.FailNow() - return - } - f = res.(string) - assert.Equal(t, "csv", f) - - res, err = items.JSONLookup("unknown") - if !assert.Error(t, err) || !assert.Nil(t, res) { - t.FailNow() - return - } -} diff --git a/vendor/github.com/go-openapi/spec/license.go b/vendor/github.com/go-openapi/spec/license.go deleted file mode 100644 index f20961b4..00000000 --- a/vendor/github.com/go-openapi/spec/license.go +++ /dev/null @@ -1,23 +0,0 @@ -// 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 - -// License information for the exposed API. -// -// For more information: http://goo.gl/8us55a#licenseObject -type License struct { - Name string `json:"name,omitempty"` - URL string `json:"url,omitempty"` -} diff --git a/vendor/github.com/go-openapi/spec/license_test.go b/vendor/github.com/go-openapi/spec/license_test.go deleted file mode 100644 index 8ed51a35..00000000 --- a/vendor/github.com/go-openapi/spec/license_test.go +++ /dev/null @@ -1,28 +0,0 @@ -// 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 TestIntegrationLicense(t *testing.T) { - license := License{"the name", "the url"} - const licenseJSON = `{"name":"the name","url":"the url"}` - const licenseYAML = "name: the name\nurl: the url\n" - - assertSerializeJSON(t, license, licenseJSON) - assertSerializeYAML(t, license, licenseYAML) - assertParsesJSON(t, licenseJSON, license) - assertParsesYAML(t, licenseYAML, license) -} diff --git a/vendor/github.com/go-openapi/spec/operation.go b/vendor/github.com/go-openapi/spec/operation.go deleted file mode 100644 index 32f7d8fe..00000000 --- a/vendor/github.com/go-openapi/spec/operation.go +++ /dev/null @@ -1,259 +0,0 @@ -// 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" -) - -// OperationProps describes an operation -type OperationProps struct { - Description string `json:"description,omitempty"` - Consumes []string `json:"consumes,omitempty"` - Produces []string `json:"produces,omitempty"` - Schemes []string `json:"schemes,omitempty"` // the scheme, when present must be from [http, https, ws, wss] - 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"` //Special case, see MarshalJSON function - 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 - } - - for k, v := range o.Responses.StatusCodeResponses { - if k/100 == 2 { - return &v, k, 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 - } - if err := json.Unmarshal(data, &o.VendorExtensible); err != nil { - return err - } - return nil -} - -// 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 := append(o.Parameters[:i], *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 == name { - 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 -} diff --git a/vendor/github.com/go-openapi/spec/operation_test.go b/vendor/github.com/go-openapi/spec/operation_test.go deleted file mode 100644 index 0bc721d8..00000000 --- a/vendor/github.com/go-openapi/spec/operation_test.go +++ /dev/null @@ -1,107 +0,0 @@ -// 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" -) - -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", - }, - }, - }, - }, - }, -} - -var 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 TestIntegrationOperation(t *testing.T) { - var actual Operation - if assert.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) - if assert.NoError(t, err) { - assert.NotContains(t, string(jsonResult), "security", "security key should be omitted when unset") - } - - //Ensure we preseve the security key when it contains an empty (zero length) slice - securityContainsEmptyArray := OperationProps{ - Security: []map[string][]string{}, - } - jsonResult, err = json.Marshal(securityContainsEmptyArray) - if assert.NoError(t, err) { - var props OperationProps - if assert.NoError(t, json.Unmarshal(jsonResult, &props)) { - assert.Equal(t, securityContainsEmptyArray, props) - } - } - -} diff --git a/vendor/github.com/go-openapi/spec/parameter.go b/vendor/github.com/go-openapi/spec/parameter.go deleted file mode 100644 index cb1a88d2..00000000 --- a/vendor/github.com/go-openapi/spec/parameter.go +++ /dev/null @@ -1,302 +0,0 @@ -// 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}, SimpleSchema: SimpleSchema{Type: "object"}} -} - -// 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: "array", CollectionFormat: "csv", Items: &Items{SimpleSchema: SimpleSchema{Type: "string", 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 -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"` // when in == "body" - AllowEmptyValue bool `json:"allowEmptyValue,omitempty"` // when in == "query" || "formData" -} - -// 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 == "$ref" { - 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 = "array" - 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 -} - -// 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 - } - if err := json.Unmarshal(data, &p.ParamProps); err != nil { - return err - } - return nil -} - -// 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 -} diff --git a/vendor/github.com/go-openapi/spec/parameters_test.go b/vendor/github.com/go-openapi/spec/parameters_test.go deleted file mode 100644 index 043b859e..00000000 --- a/vendor/github.com/go-openapi/spec/parameters_test.go +++ /dev/null @@ -1,156 +0,0 @@ -// 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" -) - -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 - if assert.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), - `{"type":"object","in":"body","schema":{"properties":{"name":{"type":"string"}}}}`) - - assertSerializeJSON(t, - BodyParam("", refSchema), - `{"type":"object","in":"body","schema":{"$ref":"Cat"}}`) - - // array body param - assertSerializeJSON(t, - BodyParam("", ArrayProperty(RefProperty("Cat"))), - `{"type":"object","in":"body","schema":{"type":"array","items":{"$ref":"Cat"}}}`) - -} diff --git a/vendor/github.com/go-openapi/spec/path_item.go b/vendor/github.com/go-openapi/spec/path_item.go deleted file mode 100644 index a8ae63ec..00000000 --- a/vendor/github.com/go-openapi/spec/path_item.go +++ /dev/null @@ -1,90 +0,0 @@ -// 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 == "$ref" { - 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 - } - if err := json.Unmarshal(data, &p.PathItemProps); err != nil { - return err - } - return nil -} - -// 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 -} diff --git a/vendor/github.com/go-openapi/spec/path_item_test.go b/vendor/github.com/go-openapi/spec/path_item_test.go deleted file mode 100644 index 0cd76f60..00000000 --- a/vendor/github.com/go-openapi/spec/path_item_test.go +++ /dev/null @@ -1,81 +0,0 @@ -// 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" -) - -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"}, - }, - }, - }, -} - -var 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 - if assert.NoError(t, json.Unmarshal([]byte(pathItemJSON), &actual)) { - assert.EqualValues(t, actual, pathItem) - } - - assertParsesJSON(t, pathItemJSON, pathItem) -} diff --git a/vendor/github.com/go-openapi/spec/paths.go b/vendor/github.com/go-openapi/spec/paths.go deleted file mode 100644 index 9dc82a29..00000000 --- a/vendor/github.com/go-openapi/spec/paths.go +++ /dev/null @@ -1,97 +0,0 @@ -// 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 -} diff --git a/vendor/github.com/go-openapi/spec/paths_test.go b/vendor/github.com/go-openapi/spec/paths_test.go deleted file mode 100644 index 025ddf4c..00000000 --- a/vendor/github.com/go-openapi/spec/paths_test.go +++ /dev/null @@ -1,43 +0,0 @@ -// 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" -) - -var paths = Paths{ - VendorExtensible: VendorExtensible{Extensions: map[string]interface{}{"x-framework": "go-swagger"}}, - Paths: map[string]PathItem{ - "/": { - Refable: Refable{Ref: MustCreateRef("cats")}, - }, - }, -} - -var pathsJSON = `{"x-framework":"go-swagger","/":{"$ref":"cats"}}` - -func TestIntegrationPaths(t *testing.T) { - var actual Paths - if assert.NoError(t, json.Unmarshal([]byte(pathsJSON), &actual)) { - assert.EqualValues(t, actual, paths) - } - - assertParsesJSON(t, pathsJSON, paths) - -} diff --git a/vendor/github.com/go-openapi/spec/properties_test.go b/vendor/github.com/go-openapi/spec/properties_test.go deleted file mode 100644 index d860843d..00000000 --- a/vendor/github.com/go-openapi/spec/properties_test.go +++ /dev/null @@ -1,58 +0,0 @@ -// 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) - } - -} diff --git a/vendor/github.com/go-openapi/spec/ref.go b/vendor/github.com/go-openapi/spec/ref.go deleted file mode 100644 index 1405bfd8..00000000 --- a/vendor/github.com/go-openapi/spec/ref.go +++ /dev/null @@ -1,167 +0,0 @@ -// 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" - "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 r.String() - } - - 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 { - rr, err := http.Get(v) - if err != nil { - return false - } - - 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) -} - -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 -} diff --git a/vendor/github.com/go-openapi/spec/response.go b/vendor/github.com/go-openapi/spec/response.go deleted file mode 100644 index 586db0d7..00000000 --- a/vendor/github.com/go-openapi/spec/response.go +++ /dev/null @@ -1,134 +0,0 @@ -// 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,omitempty"` - 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 - } - if err := json.Unmarshal(data, &r.VendorExtensible); err != nil { - return err - } - return nil -} - -// MarshalJSON converts this items object to JSON -func (r Response) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(r.ResponseProps) - 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 -} diff --git a/vendor/github.com/go-openapi/spec/response_test.go b/vendor/github.com/go-openapi/spec/response_test.go deleted file mode 100644 index ba89a491..00000000 --- a/vendor/github.com/go-openapi/spec/response_test.go +++ /dev/null @@ -1,90 +0,0 @@ -// 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" -) - -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"}}}, - }, -} - -var responseJSON = `{ - "$ref": "Dog", - "x-go-name": "PutDogExists", - "description": "Dog exists", - "schema": { - "type": "string" - } -}` - -func TestIntegrationResponse(t *testing.T) { - var actual Response - if assert.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") - if !assert.NoError(t, err) { - t.FailNow() - return - } - if assert.IsType(t, &Ref{}, res) { - ref := res.(*Ref) - assert.EqualValues(t, MustCreateRef("Dog"), *ref) - } - - var def string - res, err = response.JSONLookup("description") - if !assert.NoError(t, err) || !assert.NotNil(t, res) || !assert.IsType(t, def, res) { - t.FailNow() - return - } - def = res.(string) - assert.Equal(t, "Dog exists", def) - - var x *interface{} - res, err = response.JSONLookup("x-go-name") - if !assert.NoError(t, err) || !assert.NotNil(t, res) || !assert.IsType(t, x, res) { - t.FailNow() - return - } - - x = res.(*interface{}) - assert.EqualValues(t, "PutDogExists", *x) - - res, err = response.JSONLookup("unknown") - if !assert.Error(t, err) || !assert.Nil(t, res) { - t.FailNow() - return - } -} diff --git a/vendor/github.com/go-openapi/spec/responses.go b/vendor/github.com/go-openapi/spec/responses.go deleted file mode 100644 index 4efb6f86..00000000 --- a/vendor/github.com/go-openapi/spec/responses.go +++ /dev/null @@ -1,127 +0,0 @@ -// 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" - - "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]Response - if err := json.Unmarshal(data, &res); err != nil { - return nil - } - if v, ok := res["default"]; ok { - r.Default = &v - delete(res, "default") - } - for k, v := range res { - if nk, err := strconv.Atoi(k); err == nil { - if r.StatusCodeResponses == nil { - r.StatusCodeResponses = map[int]Response{} - } - r.StatusCodeResponses[nk] = v - } - } - return nil -} diff --git a/vendor/github.com/go-openapi/spec/schema.go b/vendor/github.com/go-openapi/spec/schema.go deleted file mode 100644 index b9481e29..00000000 --- a/vendor/github.com/go-openapi/spec/schema.go +++ /dev/null @@ -1,636 +0,0 @@ -// 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" - "net/url" - "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 := url.Parse(str) - if err != nil { - return err - } - - *r = SchemaURL(u.String()) - } - } - return nil -} - -// type ExtraSchemaProps map[string]interface{} - -// // JSONSchema represents a structure that is a json schema draft 04 -// type JSONSchema struct { -// SchemaProps -// ExtraSchemaProps -// } - -// // MarshalJSON marshal this to JSON -// func (s JSONSchema) MarshalJSON() ([]byte, error) { -// b1, err := json.Marshal(s.SchemaProps) -// if err != nil { -// return nil, err -// } -// b2, err := s.Ref.MarshalJSON() -// if err != nil { -// return nil, err -// } -// b3, err := s.Schema.MarshalJSON() -// if err != nil { -// return nil, err -// } -// b4, err := json.Marshal(s.ExtraSchemaProps) -// if err != nil { -// return nil, err -// } -// return swag.ConcatJSON(b1, b2, b3, b4), nil -// } - -// // UnmarshalJSON marshal this from JSON -// func (s *JSONSchema) UnmarshalJSON(data []byte) error { -// var sch JSONSchema -// if err := json.Unmarshal(data, &sch.SchemaProps); err != nil { -// return err -// } -// if err := json.Unmarshal(data, &sch.Ref); err != nil { -// return err -// } -// if err := json.Unmarshal(data, &sch.Schema); err != nil { -// return err -// } -// if err := json.Unmarshal(data, &sch.ExtraSchemaProps); err != nil { -// return err -// } -// *s = sch -// 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"` - 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 map[string]Schema `json:"properties,omitempty"` - AdditionalProperties *SchemaOrBool `json:"additionalProperties,omitempty"` - PatternProperties map[string]Schema `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 -} - -// CollectionOf a fluent builder method for an array parameter -func (s *Schema) CollectionOf(items Schema) *Schema { - s.Type = []string{"array"} - 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 -} - -// 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 -} diff --git a/vendor/github.com/go-openapi/spec/schema_test.go b/vendor/github.com/go-openapi/spec/schema_test.go deleted file mode 100644 index b6e3dad3..00000000 --- a/vendor/github.com/go-openapi/spec/schema_test.go +++ /dev/null @@ -1,212 +0,0 @@ -// 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" -) - -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{"sch", "io", "sw", true, 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) - if assert.NoError(t, err) { - var actual map[string]interface{} - json.Unmarshal(b, &actual) - assert.Equal(t, expected, actual) - } - - actual2 := Schema{} - if assert.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)) - } -} diff --git a/vendor/github.com/go-openapi/spec/schemas/jsonschema-draft-04.json b/vendor/github.com/go-openapi/spec/schemas/jsonschema-draft-04.json deleted file mode 100644 index bcbb8474..00000000 --- a/vendor/github.com/go-openapi/spec/schemas/jsonschema-draft-04.json +++ /dev/null @@ -1,149 +0,0 @@ -{ - "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": {} -} diff --git a/vendor/github.com/go-openapi/spec/schemas/v2/README.md b/vendor/github.com/go-openapi/spec/schemas/v2/README.md deleted file mode 100644 index 32c1b929..00000000 --- a/vendor/github.com/go-openapi/spec/schemas/v2/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# 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.0 \ No newline at end of file diff --git a/vendor/github.com/go-openapi/spec/schemas/v2/schema.json b/vendor/github.com/go-openapi/spec/schemas/v2/schema.json deleted file mode 100644 index 4dfccd07..00000000 --- a/vendor/github.com/go-openapi/spec/schemas/v2/schema.json +++ /dev/null @@ -1,1607 +0,0 @@ -{ - "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 parameters" - }, - "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" - } - } - } - } -} diff --git a/vendor/github.com/go-openapi/spec/security_scheme.go b/vendor/github.com/go-openapi/spec/security_scheme.go deleted file mode 100644 index 9f1b454e..00000000 --- a/vendor/github.com/go-openapi/spec/security_scheme.go +++ /dev/null @@ -1,143 +0,0 @@ -// 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,omitempty"` // 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) { - b1, err := json.Marshal(s.SecuritySchemeProps) - 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 - } - if err := json.Unmarshal(data, &s.VendorExtensible); err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/go-openapi/spec/spec.go b/vendor/github.com/go-openapi/spec/spec.go deleted file mode 100644 index 0bb045bc..00000000 --- a/vendor/github.com/go-openapi/spec/spec.go +++ /dev/null @@ -1,86 +0,0 @@ -// 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 schema - JSONSchemaURL = "http://json-schema.org/draft-04/schema#" -) - -var ( - jsonSchema *Schema - swaggerSchema *Schema -) - -func init() { - jsonSchema = MustLoadJSONSchemaDraft04() - swaggerSchema = MustLoadSwagger20Schema() -} - -// 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 := Asset("jsonschema-draft-04.json") - 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 := Asset("v2/schema.json") - if err != nil { - return nil, err - } - - schema := new(Schema) - if err := json.Unmarshal(b, schema); err != nil { - return nil, err - } - return schema, nil -} diff --git a/vendor/github.com/go-openapi/spec/spec_test.go b/vendor/github.com/go-openapi/spec/spec_test.go deleted file mode 100644 index cdcb2982..00000000 --- a/vendor/github.com/go-openapi/spec/spec_test.go +++ /dev/null @@ -1,269 +0,0 @@ -// 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 ( - "encoding/json" - "os" - "path/filepath" - "regexp" - "strings" - "testing" - - "github.com/go-openapi/spec" - "github.com/go-openapi/swag" - "github.com/stretchr/testify/assert" -) - -// mimics what the go-openapi/load does -var ( - yamlLoader = swag.YAMLDoc - rex = regexp.MustCompile(`"\$ref":\s*"(.+)"`) -) - -func loadOrFail(t *testing.T, path string) *spec.Swagger { - raw, erl := yamlLoader(path) - if erl != nil { - t.Logf("can't load fixture %s: %v", path, erl) - t.FailNow() - return nil - } - swspec := new(spec.Swagger) - if err := json.Unmarshal(raw, swspec); err != nil { - t.FailNow() - return nil - } - return swspec -} - -// Test unitary fixture for dev and bug fixing -func Test_Issue1429(t *testing.T) { - prevPathLoader := spec.PathLoader - defer func() { - spec.PathLoader = prevPathLoader - }() - spec.PathLoader = yamlLoader - 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}) - if !assert.NoError(t, err) { - t.FailNow() - return - } - - // assert well expanded - if !assert.Truef(t, (sp.Paths != nil && sp.Paths.Paths != nil), "expected paths to be available in fixture") { - t.FailNow() - return - } - for _, pi := range sp.Paths.Paths { - for _, param := range pi.Get.Parameters { - if assert.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 - } - if assert.NotNilf(t, response.Schema, "expected response schema not to be nil") { - assert.Equal(t, "", response.Schema.Ref.String()) - } - } - } - for _, def := range sp.Definitions { - assert.Equal(t, "", def.Ref.String()) - } - - // reload and SkipSchemas: true - sp = loadOrFail(t, path) - err = spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: true}) - if !assert.NoError(t, err) { - t.FailNow() - return - } - - // assert well resolved - if !assert.Truef(t, (sp.Paths != nil && sp.Paths.Paths != nil), "expected paths to be available in fixture") { - t.FailNow() - return - } - for _, pi := range sp.Paths.Paths { - for _, param := range pi.Get.Parameters { - if assert.NotNilf(t, param.Schema, "expected param schema not to be nil") { - // all param fixtures are body param with schema - if param.Name == "plainRequest" { - // this one is expanded - assert.Equal(t, "", param.Schema.Ref.String()) - continue - } - if param.Name == "nestedBody" { - // this one is local - assert.True(t, strings.HasPrefix(param.Schema.Ref.String(), "#/definitions/")) - continue - } - if param.Name == "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 - if code == 200 { - assert.Nilf(t, response.Schema, "expected response schema to be nil") - continue - } - if code == 204 { - assert.Contains(t, response.Schema.Ref.String(), "remote/remote.yaml#/") - continue - } - if code == 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) - } - } - for _, def := range sp.Definitions { - assert.Contains(t, def.Ref.String(), "responses.yaml#/") - } -} - -func Test_MoreLocalExpansion(t *testing.T) { - prevPathLoader := spec.PathLoader - defer func() { - spec.PathLoader = prevPathLoader - }() - spec.PathLoader = yamlLoader - path := filepath.Join("fixtures", "local_expansion", "spec2.yaml") - - // load and full expand - sp := loadOrFail(t, path) - err := spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: false}) - if !assert.NoError(t, err) { - t.FailNow() - return - } - // asserts all $ref expanded - jazon, _ := json.MarshalIndent(sp, "", " ") - assert.NotContains(t, jazon, `"$ref"`) - //t.Log(string(jazon)) -} - -func Test_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) - err := spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: false}) - if !assert.NoError(t, err) { - t.FailNow() - return - } - // asserts all $ref expanded - jazon, _ := json.MarshalIndent(sp, "", " ") - - // assert all $ref maches "$ref": "#/definitions/something" - m := rex.FindAllStringSubmatch(string(jazon), -1) - if assert.NotNil(t, m) { - for _, matched := range m { - subMatch := matched[1] - assert.True(t, strings.HasPrefix(subMatch, "#/definitions/"), - "expected $ref to be inlined, got: %s", matched[0]) - } - } -} - -func Test_Issue1621(t *testing.T) { - prevPathLoader := spec.PathLoader - defer func() { - spec.PathLoader = prevPathLoader - }() - spec.PathLoader = yamlLoader - 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}) - if !assert.NoError(t, err) { - t.FailNow() - return - } - // asserts all $ref expanded - jazon, _ := json.MarshalIndent(sp, "", " ") - m := rex.FindAllStringSubmatch(string(jazon), -1) - assert.Nil(t, m) -} - -func Test_Issue1614(t *testing.T) { - - path := filepath.Join("fixtures", "bugs", "1614", "gitea.json") - - // expand with relative path - // load and expand - sp := loadOrFail(t, path) - err := spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: false}) - if !assert.NoError(t, err) { - t.FailNow() - return - } - // asserts all $ref expanded - jazon, _ := json.MarshalIndent(sp, "", " ") - - // assert all $ref maches "$ref": "#/definitions/something" - m := rex.FindAllStringSubmatch(string(jazon), -1) - if assert.NotNil(t, m) { - for _, matched := range m { - subMatch := matched[1] - assert.True(t, strings.HasPrefix(subMatch, "#/definitions/"), - "expected $ref to be inlined, got: %s", matched[0]) - } - } - - // now with option CircularRefAbsolute - sp = loadOrFail(t, path) - err = spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: false, AbsoluteCircularRef: true}) - if !assert.NoError(t, err) { - t.FailNow() - return - } - // asserts all $ref expanded - jazon, _ = json.MarshalIndent(sp, "", " ") - - // assert all $ref maches "$ref": "{file path}#/definitions/something" - refPath, _ := os.Getwd() - refPath = filepath.Join(refPath, path) - m = rex.FindAllStringSubmatch(string(jazon), -1) - if assert.NotNil(t, m) { - for _, matched := range m { - subMatch := matched[1] - assert.True(t, strings.HasPrefix(subMatch, refPath+"#/definitions/"), - "expected $ref to be inlined, got: %s", matched[0]) - } - } -} diff --git a/vendor/github.com/go-openapi/spec/structs_test.go b/vendor/github.com/go-openapi/spec/structs_test.go deleted file mode 100644 index be231eba..00000000 --- a/vendor/github.com/go-openapi/spec/structs_test.go +++ /dev/null @@ -1,116 +0,0 @@ -// 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.v2" -) - -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, string(ser), expected) -} - -func assertParsesJSON(t testing.TB, actual string, expected interface{}) bool { - tpe := reflect.TypeOf(expected) - var pointed bool - if tpe.Kind() == reflect.Ptr { - tpe = tpe.Elem() - pointed = true - } - - parsed := reflect.New(tpe) - 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 !pointed { - act = reflect.Indirect(parsed).Interface() - } - return assert.Equal(t, act, expected) -} - -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, string(ser), expected) -} - -func assertParsesYAML(t testing.TB, actual string, expected interface{}) bool { - tpe := reflect.TypeOf(expected) - var pointed bool - if tpe.Kind() == reflect.Ptr { - tpe = tpe.Elem() - pointed = true - } - parsed := reflect.New(tpe) - 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 !pointed { - act = reflect.Indirect(parsed).Interface() - } - return assert.EqualValues(t, act, expected) -} - -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{}) -} diff --git a/vendor/github.com/go-openapi/spec/swagger.go b/vendor/github.com/go-openapi/spec/swagger.go deleted file mode 100644 index 4586a21c..00000000 --- a/vendor/github.com/go-openapi/spec/swagger.go +++ /dev/null @@ -1,318 +0,0 @@ -// 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" - "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 -} - -// SwaggerProps captures the top-level properties of an Api specification -type SwaggerProps struct { - ID string `json:"id,omitempty"` - Consumes []string `json:"consumes,omitempty"` - Produces []string `json:"produces,omitempty"` - Schemes []string `json:"schemes,omitempty"` // the scheme, when present must be from [http, https, ws, wss] - Swagger string `json:"swagger,omitempty"` - Info *Info `json:"info,omitempty"` - Host string `json:"host,omitempty"` - BasePath string `json:"basePath,omitempty"` // must start with a leading "/" - Paths *Paths `json:"paths"` // required - 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"` -} - -// 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) >= 4 { - if data[0] == '{' { - var sch Schema - if err := json.Unmarshal(data, &sch); err != nil { - return err - } - nw.Schema = &sch - } - nw.Allows = !(data[0] == 'f' && data[1] == 'a' && data[2] == 'l' && data[3] == 's' && data[4] == 'e') - } - *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 single.(type) { - case string: - *s = StringOrArray([]string{single.(string)}) - 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: diff --git a/vendor/github.com/go-openapi/spec/swagger_test.go b/vendor/github.com/go-openapi/spec/swagger_test.go deleted file mode 100644 index 87531b1f..00000000 --- a/vendor/github.com/go-openapi/spec/swagger_test.go +++ /dev/null @@ -1,389 +0,0 @@ -// 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/require" - - "github.com/stretchr/testify/assert" -) - -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{"the name", "the url"}, - }, - VendorExtensible: VendorExtensible{map[string]interface{}{ - "x-some-extension": "vendor", - "x-schemes": []interface{}{"unix", "amqp"}, - }}, -} - -var 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: '%T(%#v)'\nActual: '%T(%#v)'\n(Should be equivalent)!" - return assert.Fail(t, errFmt, expected, expected, actual, 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: '%T(%#v)'\nActual: '%T(%#v)'\n(Should be equivalent)!" - return fmt.Sprintf(errFmt, expected, expected, actual, 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, actual, expected) -} - -/* -// 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, actual, expected) -} -*/ - -func TestSwaggerSpec_Serialize(t *testing.T) { - expected := make(map[string]interface{}) - json.Unmarshal([]byte(specJSON), &expected) - b, err := json.MarshalIndent(spec, "", " ") - if assert.NoError(t, err) { - var actual map[string]interface{} - err := json.Unmarshal(b, &actual) - if assert.NoError(t, err) { - assert.EqualValues(t, actual, expected) - } - } -} - -func TestSwaggerSpec_Deserialize(t *testing.T) { - var actual Swagger - err := json.Unmarshal([]byte(specJSON), &actual) - if assert.NoError(t, err) { - assert.EqualValues(t, actual, spec) - } -} - -func TestVendorExtensionStringSlice(t *testing.T) { - var actual Swagger - err := json.Unmarshal([]byte(specJSON), &actual) - if assert.NoError(t, err) { - schemes, ok := actual.Extensions.GetStringSlice("x-schemes") - if assert.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) - if assert.NoError(t, err) { - bytes, err := json.Marshal(&minimalSpec) - if assert.NoError(t, err) { - var ms map[string]interface{} - if err := json.Unmarshal(bytes, &ms); assert.NoError(t, err) { - 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") - } - } - } -} - -func TestSecurityRequirements(t *testing.T) { - 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" - } - } - } - } - } - }`) - - var minimalSpec Swagger - err := json.Unmarshal(minimalJSONSpec, &minimalSpec) - if assert.NoError(t, err) { - 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") - } -} diff --git a/vendor/github.com/go-openapi/spec/tag.go b/vendor/github.com/go-openapi/spec/tag.go deleted file mode 100644 index 25256c4b..00000000 --- a/vendor/github.com/go-openapi/spec/tag.go +++ /dev/null @@ -1,74 +0,0 @@ -// 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, name, 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) -} diff --git a/vendor/github.com/go-openapi/spec/xml_object.go b/vendor/github.com/go-openapi/spec/xml_object.go deleted file mode 100644 index 945a4670..00000000 --- a/vendor/github.com/go-openapi/spec/xml_object.go +++ /dev/null @@ -1,68 +0,0 @@ -// 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 -} diff --git a/vendor/github.com/go-openapi/spec/xml_object_test.go b/vendor/github.com/go-openapi/spec/xml_object_test.go deleted file mode 100644 index fda3b108..00000000 --- a/vendor/github.com/go-openapi/spec/xml_object_test.go +++ /dev/null @@ -1,65 +0,0 @@ -// 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" -) - -func TestXmlObject_Serialize(t *testing.T) { - obj1 := XMLObject{} - actual, err := json.Marshal(obj1) - if assert.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) - if assert.NoError(t, err) { - var ad map[string]interface{} - if assert.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{} - if assert.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{"the name", "the namespace", "the prefix", true, true} - actual = XMLObject{} - if assert.NoError(t, json.Unmarshal([]byte(completed), &actual)) { - assert.Equal(t, expected, actual) - } -} diff --git a/vendor/github.com/go-openapi/swag/.editorconfig b/vendor/github.com/go-openapi/swag/.editorconfig deleted file mode 100644 index 3152da69..00000000 --- a/vendor/github.com/go-openapi/swag/.editorconfig +++ /dev/null @@ -1,26 +0,0 @@ -# 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 diff --git a/vendor/github.com/go-openapi/swag/.github/CONTRIBUTING.md b/vendor/github.com/go-openapi/swag/.github/CONTRIBUTING.md deleted file mode 100644 index 7dea4240..00000000 --- a/vendor/github.com/go-openapi/swag/.github/CONTRIBUTING.md +++ /dev/null @@ -1,117 +0,0 @@ -## 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`. diff --git a/vendor/github.com/go-openapi/swag/.gitignore b/vendor/github.com/go-openapi/swag/.gitignore deleted file mode 100644 index 5862205e..00000000 --- a/vendor/github.com/go-openapi/swag/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -secrets.yml -vendor -Godeps diff --git a/vendor/github.com/go-openapi/swag/.golangci.yml b/vendor/github.com/go-openapi/swag/.golangci.yml deleted file mode 100644 index 6b237e4a..00000000 --- a/vendor/github.com/go-openapi/swag/.golangci.yml +++ /dev/null @@ -1,20 +0,0 @@ -linters-settings: - govet: - check-shadowing: true - golint: - min-confidence: 0 - gocyclo: - min-complexity: 25 - maligned: - suggest-new: true - dupl: - threshold: 100 - goconst: - min-len: 3 - min-occurrences: 2 - -linters: - enable-all: true - disable: - - maligned - - lll diff --git a/vendor/github.com/go-openapi/swag/.travis.yml b/vendor/github.com/go-openapi/swag/.travis.yml deleted file mode 100644 index bd3a2e52..00000000 --- a/vendor/github.com/go-openapi/swag/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -after_success: -- bash <(curl -s https://codecov.io/bash) -go: -- '1.9' -- 1.10.x -- 1.11.x -install: -- go get -u github.com/stretchr/testify -- go get -u github.com/mailru/easyjson -- go get -u gopkg.in/yaml.v2 -language: go -notifications: - slack: - secure: QUWvCkBBK09GF7YtEvHHVt70JOkdlNBG0nIKu/5qc4/nW5HP8I2w0SEf/XR2je0eED1Qe3L/AfMCWwrEj+IUZc3l4v+ju8X8R3Lomhme0Eb0jd1MTMCuPcBT47YCj0M7RON7vXtbFfm1hFJ/jLe5+9FXz0hpXsR24PJc5ZIi/ogNwkaPqG4BmndzecpSh0vc2FJPZUD9LT0I09REY/vXR0oQAalLkW0asGD5taHZTUZq/kBpsNxaAFrLM23i4mUcf33M5fjLpvx5LRICrX/57XpBrDh2TooBU6Qj3CgoY0uPRYUmSNxbVx1czNzl2JtEpb5yjoxfVPQeg0BvQM00G8LJINISR+ohrjhkZmAqchDupAX+yFrxTtORa78CtnIL6z/aTNlgwwVD8kvL/1pFA/JWYmKDmz93mV/+6wubGzNSQCstzjkFA4/iZEKewKUoRIAi/fxyscP6L/rCpmY/4llZZvrnyTqVbt6URWpopUpH4rwYqreXAtJxJsfBJIeSmUIiDIOMGkCTvyTEW3fWGmGoqWtSHLoaWDyAIGb7azb+KvfpWtEcoPFWfSWU+LGee0A/YsUhBl7ADB9A0CJEuR8q4BPpKpfLwPKSiKSAXL7zDkyjExyhtgqbSl2jS+rKIHOZNL8JkCcTP2MKMVd563C5rC5FMKqu3S9m2b6380E= -script: -- go test -v -race -cover -coverprofile=coverage.txt -covermode=atomic ./... diff --git a/vendor/github.com/go-openapi/swag/CODE_OF_CONDUCT.md b/vendor/github.com/go-openapi/swag/CODE_OF_CONDUCT.md deleted file mode 100644 index 9322b065..00000000 --- a/vendor/github.com/go-openapi/swag/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,74 +0,0 @@ -# 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/ diff --git a/vendor/github.com/go-openapi/swag/LICENSE b/vendor/github.com/go-openapi/swag/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/vendor/github.com/go-openapi/swag/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - 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. diff --git a/vendor/github.com/go-openapi/swag/README.md b/vendor/github.com/go-openapi/swag/README.md deleted file mode 100644 index 459a3e18..00000000 --- a/vendor/github.com/go-openapi/swag/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# Swag [![Build Status](https://travis-ci.org/go-openapi/swag.svg?branch=master)](https://travis-ci.org/go-openapi/swag) [![codecov](https://codecov.io/gh/go-openapi/swag/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/swag) [![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/swag/master/LICENSE) -[![GoDoc](https://godoc.org/github.com/go-openapi/swag?status.svg)](http://godoc.org/github.com/go-openapi/swag) -[![GolangCI](https://golangci.com/badges/github.com/go-openapi/swag.svg)](https://golangci.com) -[![Go Report Card](https://goreportcard.com/badge/github.com/go-openapi/swag)](https://goreportcard.com/report/github.com/go-openapi/swag) - -Contains a bunch of helper functions for go-openapi and go-swagger projects. - -You may also use it standalone for your projects. - -* convert between value and pointers for builtin types -* convert from string to builtin types (wraps strconv) -* fast json concatenation -* search in path -* load from file or http -* name mangling - - -This repo has only few dependencies outside of the standard library: - -* JSON utilities depend on github.com/mailru/easyjson -* YAML utilities depend on gopkg.in/yaml.v2 diff --git a/vendor/github.com/go-openapi/swag/convert.go b/vendor/github.com/go-openapi/swag/convert.go deleted file mode 100644 index 4e446ff7..00000000 --- a/vendor/github.com/go-openapi/swag/convert.go +++ /dev/null @@ -1,207 +0,0 @@ -// 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 swag - -import ( - "math" - "strconv" - "strings" -) - -// same as ECMA Number.MAX_SAFE_INTEGER and Number.MIN_SAFE_INTEGER -const ( - maxJSONFloat = float64(1<<53 - 1) // 9007199254740991.0 2^53 - 1 - minJSONFloat = -float64(1<<53 - 1) //-9007199254740991.0 -2^53 - 1 - epsilon float64 = 1e-9 -) - -// IsFloat64AJSONInteger allow for integers [-2^53, 2^53-1] inclusive -func IsFloat64AJSONInteger(f float64) bool { - if math.IsNaN(f) || math.IsInf(f, 0) || f < minJSONFloat || f > maxJSONFloat { - return false - } - fa := math.Abs(f) - g := float64(uint64(f)) - ga := math.Abs(g) - - diff := math.Abs(f - g) - - // more info: https://floating-point-gui.de/errors/comparison/#look-out-for-edge-cases - if f == g { // best case - return true - } else if f == float64(int64(f)) || f == float64(uint64(f)) { // optimistic case - return true - } else if f == 0 || g == 0 || diff < math.SmallestNonzeroFloat64 { // very close to 0 values - return diff < (epsilon * math.SmallestNonzeroFloat64) - } - // check the relative error - return diff/math.Min(fa+ga, math.MaxFloat64) < epsilon -} - -var evaluatesAsTrue map[string]struct{} - -func init() { - evaluatesAsTrue = map[string]struct{}{ - "true": {}, - "1": {}, - "yes": {}, - "ok": {}, - "y": {}, - "on": {}, - "selected": {}, - "checked": {}, - "t": {}, - "enabled": {}, - } -} - -// ConvertBool turn a string into a boolean -func ConvertBool(str string) (bool, error) { - _, ok := evaluatesAsTrue[strings.ToLower(str)] - return ok, nil -} - -// ConvertFloat32 turn a string into a float32 -func ConvertFloat32(str string) (float32, error) { - f, err := strconv.ParseFloat(str, 32) - if err != nil { - return 0, err - } - return float32(f), nil -} - -// ConvertFloat64 turn a string into a float64 -func ConvertFloat64(str string) (float64, error) { - return strconv.ParseFloat(str, 64) -} - -// ConvertInt8 turn a string into int8 boolean -func ConvertInt8(str string) (int8, error) { - i, err := strconv.ParseInt(str, 10, 8) - if err != nil { - return 0, err - } - return int8(i), nil -} - -// ConvertInt16 turn a string into a int16 -func ConvertInt16(str string) (int16, error) { - i, err := strconv.ParseInt(str, 10, 16) - if err != nil { - return 0, err - } - return int16(i), nil -} - -// ConvertInt32 turn a string into a int32 -func ConvertInt32(str string) (int32, error) { - i, err := strconv.ParseInt(str, 10, 32) - if err != nil { - return 0, err - } - return int32(i), nil -} - -// ConvertInt64 turn a string into a int64 -func ConvertInt64(str string) (int64, error) { - return strconv.ParseInt(str, 10, 64) -} - -// ConvertUint8 turn a string into a uint8 -func ConvertUint8(str string) (uint8, error) { - i, err := strconv.ParseUint(str, 10, 8) - if err != nil { - return 0, err - } - return uint8(i), nil -} - -// ConvertUint16 turn a string into a uint16 -func ConvertUint16(str string) (uint16, error) { - i, err := strconv.ParseUint(str, 10, 16) - if err != nil { - return 0, err - } - return uint16(i), nil -} - -// ConvertUint32 turn a string into a uint32 -func ConvertUint32(str string) (uint32, error) { - i, err := strconv.ParseUint(str, 10, 32) - if err != nil { - return 0, err - } - return uint32(i), nil -} - -// ConvertUint64 turn a string into a uint64 -func ConvertUint64(str string) (uint64, error) { - return strconv.ParseUint(str, 10, 64) -} - -// FormatBool turns a boolean into a string -func FormatBool(value bool) string { - return strconv.FormatBool(value) -} - -// FormatFloat32 turns a float32 into a string -func FormatFloat32(value float32) string { - return strconv.FormatFloat(float64(value), 'f', -1, 32) -} - -// FormatFloat64 turns a float64 into a string -func FormatFloat64(value float64) string { - return strconv.FormatFloat(value, 'f', -1, 64) -} - -// FormatInt8 turns an int8 into a string -func FormatInt8(value int8) string { - return strconv.FormatInt(int64(value), 10) -} - -// FormatInt16 turns an int16 into a string -func FormatInt16(value int16) string { - return strconv.FormatInt(int64(value), 10) -} - -// FormatInt32 turns an int32 into a string -func FormatInt32(value int32) string { - return strconv.Itoa(int(value)) -} - -// FormatInt64 turns an int64 into a string -func FormatInt64(value int64) string { - return strconv.FormatInt(value, 10) -} - -// FormatUint8 turns an uint8 into a string -func FormatUint8(value uint8) string { - return strconv.FormatUint(uint64(value), 10) -} - -// FormatUint16 turns an uint16 into a string -func FormatUint16(value uint16) string { - return strconv.FormatUint(uint64(value), 10) -} - -// FormatUint32 turns an uint32 into a string -func FormatUint32(value uint32) string { - return strconv.FormatUint(uint64(value), 10) -} - -// FormatUint64 turns an uint64 into a string -func FormatUint64(value uint64) string { - return strconv.FormatUint(value, 10) -} diff --git a/vendor/github.com/go-openapi/swag/convert_test.go b/vendor/github.com/go-openapi/swag/convert_test.go deleted file mode 100644 index f54ae236..00000000 --- a/vendor/github.com/go-openapi/swag/convert_test.go +++ /dev/null @@ -1,216 +0,0 @@ -// 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 swag - -import ( - "math" - "strconv" - "testing" - - "github.com/stretchr/testify/assert" -) - -// These are really dumb tests - -func TestConvertBool(t *testing.T) { - for k := range evaluatesAsTrue { - r, err := ConvertBool(k) - if assert.NoError(t, err) { - assert.True(t, r) - } - } - for _, k := range []string{"a", "", "0", "false", "unchecked"} { - r, err := ConvertBool(k) - if assert.NoError(t, err) { - assert.False(t, r) - } - } -} - -func TestConvertFloat32(t *testing.T) { - validFloats := []float32{1.0, -1, math.MaxFloat32, math.SmallestNonzeroFloat32, 0, 5.494430303} - invalidFloats := []string{"a", strconv.FormatFloat(math.MaxFloat64, 'f', -1, 64), "true"} - - for _, f := range validFloats { - c, err := ConvertFloat32(FormatFloat32(f)) - if assert.NoError(t, err) { - assert.EqualValues(t, f, c) - } - } - for _, f := range invalidFloats { - _, err := ConvertFloat32(f) - assert.Error(t, err, "expected '"+f+"' to generate an error") - } -} - -func TestConvertFloat64(t *testing.T) { - validFloats := []float64{1.0, -1, float64(math.MaxFloat32), float64(math.SmallestNonzeroFloat32), math.MaxFloat64, math.SmallestNonzeroFloat64, 0, 5.494430303} - invalidFloats := []string{"a", "true"} - - for _, f := range validFloats { - c, err := ConvertFloat64(FormatFloat64(f)) - if assert.NoError(t, err) { - assert.EqualValues(t, f, c) - } - } - for _, f := range invalidFloats { - _, err := ConvertFloat64(f) - assert.Error(t, err, "expected '"+f+"' to generate an error") - } -} - -func TestConvertInt8(t *testing.T) { - validInts := []int8{0, 1, -1, math.MaxInt8, math.MinInt8} - invalidInts := []string{"1.233", "a", "false", strconv.Itoa(int(math.MaxInt64))} - - for _, f := range validInts { - c, err := ConvertInt8(FormatInt8(f)) - if assert.NoError(t, err) { - assert.EqualValues(t, f, c) - } - } - for _, f := range invalidInts { - _, err := ConvertInt8(f) - assert.Error(t, err, "expected '"+f+"' to generate an error") - } -} - -func TestConvertInt16(t *testing.T) { - validInts := []int16{0, 1, -1, math.MaxInt8, math.MinInt8, math.MaxInt16, math.MinInt16} - invalidInts := []string{"1.233", "a", "false", strconv.Itoa(int(math.MaxInt64))} - - for _, f := range validInts { - c, err := ConvertInt16(FormatInt16(f)) - if assert.NoError(t, err) { - assert.EqualValues(t, f, c) - } - } - for _, f := range invalidInts { - _, err := ConvertInt16(f) - assert.Error(t, err, "expected '"+f+"' to generate an error") - } -} - -func TestConvertInt32(t *testing.T) { - validInts := []int32{0, 1, -1, math.MaxInt8, math.MinInt8, math.MaxInt16, math.MinInt16, math.MinInt32, math.MaxInt32} - invalidInts := []string{"1.233", "a", "false", strconv.Itoa(int(math.MaxInt64))} - - for _, f := range validInts { - c, err := ConvertInt32(FormatInt32(f)) - if assert.NoError(t, err) { - assert.EqualValues(t, f, c) - } - } - for _, f := range invalidInts { - _, err := ConvertInt32(f) - assert.Error(t, err, "expected '"+f+"' to generate an error") - } -} - -func TestConvertInt64(t *testing.T) { - validInts := []int64{0, 1, -1, math.MaxInt8, math.MinInt8, math.MaxInt16, math.MinInt16, math.MinInt32, math.MaxInt32, math.MaxInt64, math.MinInt64} - invalidInts := []string{"1.233", "a", "false"} - - for _, f := range validInts { - c, err := ConvertInt64(FormatInt64(f)) - if assert.NoError(t, err) { - assert.EqualValues(t, f, c) - } - } - for _, f := range invalidInts { - _, err := ConvertInt64(f) - assert.Error(t, err, "expected '"+f+"' to generate an error") - } -} - -func TestConvertUint8(t *testing.T) { - validInts := []uint8{0, 1, math.MaxUint8} - invalidInts := []string{"1.233", "a", "false", strconv.FormatUint(math.MaxUint64, 10)} - - for _, f := range validInts { - c, err := ConvertUint8(FormatUint8(f)) - if assert.NoError(t, err) { - assert.EqualValues(t, f, c) - } - } - for _, f := range invalidInts { - _, err := ConvertUint8(f) - assert.Error(t, err, "expected '"+f+"' to generate an error") - } -} - -func TestConvertUint16(t *testing.T) { - validUints := []uint16{0, 1, math.MaxUint8, math.MaxUint16} - invalidUints := []string{"1.233", "a", "false", strconv.FormatUint(math.MaxUint64, 10)} - - for _, f := range validUints { - c, err := ConvertUint16(FormatUint16(f)) - if assert.NoError(t, err) { - assert.EqualValues(t, f, c) - } - } - for _, f := range invalidUints { - _, err := ConvertUint16(f) - assert.Error(t, err, "expected '"+f+"' to generate an error") - } -} - -func TestConvertUint32(t *testing.T) { - validUints := []uint32{0, 1, math.MaxUint8, math.MaxUint16, math.MaxUint32} - invalidUints := []string{"1.233", "a", "false", strconv.FormatUint(math.MaxUint64, 10)} - - for _, f := range validUints { - c, err := ConvertUint32(FormatUint32(f)) - if assert.NoError(t, err) { - assert.EqualValues(t, f, c) - } - } - for _, f := range invalidUints { - _, err := ConvertUint32(f) - assert.Error(t, err, "expected '"+f+"' to generate an error") - } -} - -func TestConvertUint64(t *testing.T) { - validUints := []uint64{0, 1, math.MaxUint8, math.MaxUint16, math.MaxUint32, math.MaxUint64} - invalidUints := []string{"1.233", "a", "false"} - - for _, f := range validUints { - c, err := ConvertUint64(FormatUint64(f)) - if assert.NoError(t, err) { - assert.EqualValues(t, f, c) - } - } - for _, f := range invalidUints { - _, err := ConvertUint64(f) - assert.Error(t, err, "expected '"+f+"' to generate an error") - } -} - -func TestIsFloat64AJSONInteger(t *testing.T) { - assert.False(t, IsFloat64AJSONInteger(math.Inf(1))) - assert.False(t, IsFloat64AJSONInteger(maxJSONFloat+1)) - - assert.False(t, IsFloat64AJSONInteger(minJSONFloat-1)) - assert.True(t, IsFloat64AJSONInteger(1.0)) - assert.True(t, IsFloat64AJSONInteger(maxJSONFloat)) - assert.True(t, IsFloat64AJSONInteger(minJSONFloat)) - assert.True(t, IsFloat64AJSONInteger(1/0.01*67.15000001)) -} - -func TestFormatBool(t *testing.T) { - assert.Equal(t, "true", FormatBool(true)) - assert.Equal(t, "false", FormatBool(false)) -} diff --git a/vendor/github.com/go-openapi/swag/convert_types.go b/vendor/github.com/go-openapi/swag/convert_types.go deleted file mode 100644 index c95e4e78..00000000 --- a/vendor/github.com/go-openapi/swag/convert_types.go +++ /dev/null @@ -1,595 +0,0 @@ -package swag - -import "time" - -// This file was taken from the aws go sdk - -// String returns a pointer to of the string value passed in. -func String(v string) *string { - return &v -} - -// StringValue returns the value of the string pointer passed in or -// "" if the pointer is nil. -func StringValue(v *string) string { - if v != nil { - return *v - } - return "" -} - -// StringSlice converts a slice of string values into a slice of -// string pointers -func StringSlice(src []string) []*string { - dst := make([]*string, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// StringValueSlice converts a slice of string pointers into a slice of -// string values -func StringValueSlice(src []*string) []string { - dst := make([]string, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// StringMap converts a string map of string values into a string -// map of string pointers -func StringMap(src map[string]string) map[string]*string { - dst := make(map[string]*string) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// StringValueMap converts a string map of string pointers into a string -// map of string values -func StringValueMap(src map[string]*string) map[string]string { - dst := make(map[string]string) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Bool returns a pointer to of the bool value passed in. -func Bool(v bool) *bool { - return &v -} - -// BoolValue returns the value of the bool pointer passed in or -// false if the pointer is nil. -func BoolValue(v *bool) bool { - if v != nil { - return *v - } - return false -} - -// BoolSlice converts a slice of bool values into a slice of -// bool pointers -func BoolSlice(src []bool) []*bool { - dst := make([]*bool, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// BoolValueSlice converts a slice of bool pointers into a slice of -// bool values -func BoolValueSlice(src []*bool) []bool { - dst := make([]bool, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// BoolMap converts a string map of bool values into a string -// map of bool pointers -func BoolMap(src map[string]bool) map[string]*bool { - dst := make(map[string]*bool) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// BoolValueMap converts a string map of bool pointers into a string -// map of bool values -func BoolValueMap(src map[string]*bool) map[string]bool { - dst := make(map[string]bool) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Int returns a pointer to of the int value passed in. -func Int(v int) *int { - return &v -} - -// IntValue returns the value of the int pointer passed in or -// 0 if the pointer is nil. -func IntValue(v *int) int { - if v != nil { - return *v - } - return 0 -} - -// IntSlice converts a slice of int values into a slice of -// int pointers -func IntSlice(src []int) []*int { - dst := make([]*int, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// IntValueSlice converts a slice of int pointers into a slice of -// int values -func IntValueSlice(src []*int) []int { - dst := make([]int, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// IntMap converts a string map of int values into a string -// map of int pointers -func IntMap(src map[string]int) map[string]*int { - dst := make(map[string]*int) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// IntValueMap converts a string map of int pointers into a string -// map of int values -func IntValueMap(src map[string]*int) map[string]int { - dst := make(map[string]int) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Int32 returns a pointer to of the int64 value passed in. -func Int32(v int32) *int32 { - return &v -} - -// Int32Value returns the value of the int64 pointer passed in or -// 0 if the pointer is nil. -func Int32Value(v *int32) int32 { - if v != nil { - return *v - } - return 0 -} - -// Int32Slice converts a slice of int64 values into a slice of -// int32 pointers -func Int32Slice(src []int32) []*int32 { - dst := make([]*int32, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// Int32ValueSlice converts a slice of int32 pointers into a slice of -// int32 values -func Int32ValueSlice(src []*int32) []int32 { - dst := make([]int32, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// Int32Map converts a string map of int32 values into a string -// map of int32 pointers -func Int32Map(src map[string]int32) map[string]*int32 { - dst := make(map[string]*int32) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// Int32ValueMap converts a string map of int32 pointers into a string -// map of int32 values -func Int32ValueMap(src map[string]*int32) map[string]int32 { - dst := make(map[string]int32) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Int64 returns a pointer to of the int64 value passed in. -func Int64(v int64) *int64 { - return &v -} - -// Int64Value returns the value of the int64 pointer passed in or -// 0 if the pointer is nil. -func Int64Value(v *int64) int64 { - if v != nil { - return *v - } - return 0 -} - -// Int64Slice converts a slice of int64 values into a slice of -// int64 pointers -func Int64Slice(src []int64) []*int64 { - dst := make([]*int64, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// Int64ValueSlice converts a slice of int64 pointers into a slice of -// int64 values -func Int64ValueSlice(src []*int64) []int64 { - dst := make([]int64, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// Int64Map converts a string map of int64 values into a string -// map of int64 pointers -func Int64Map(src map[string]int64) map[string]*int64 { - dst := make(map[string]*int64) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// Int64ValueMap converts a string map of int64 pointers into a string -// map of int64 values -func Int64ValueMap(src map[string]*int64) map[string]int64 { - dst := make(map[string]int64) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Uint returns a pouinter to of the uint value passed in. -func Uint(v uint) *uint { - return &v -} - -// UintValue returns the value of the uint pouinter passed in or -// 0 if the pouinter is nil. -func UintValue(v *uint) uint { - if v != nil { - return *v - } - return 0 -} - -// UintSlice converts a slice of uint values uinto a slice of -// uint pouinters -func UintSlice(src []uint) []*uint { - dst := make([]*uint, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// UintValueSlice converts a slice of uint pouinters uinto a slice of -// uint values -func UintValueSlice(src []*uint) []uint { - dst := make([]uint, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// UintMap converts a string map of uint values uinto a string -// map of uint pouinters -func UintMap(src map[string]uint) map[string]*uint { - dst := make(map[string]*uint) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// UintValueMap converts a string map of uint pouinters uinto a string -// map of uint values -func UintValueMap(src map[string]*uint) map[string]uint { - dst := make(map[string]uint) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Uint32 returns a pouinter to of the uint64 value passed in. -func Uint32(v uint32) *uint32 { - return &v -} - -// Uint32Value returns the value of the uint64 pouinter passed in or -// 0 if the pouinter is nil. -func Uint32Value(v *uint32) uint32 { - if v != nil { - return *v - } - return 0 -} - -// Uint32Slice converts a slice of uint64 values uinto a slice of -// uint32 pouinters -func Uint32Slice(src []uint32) []*uint32 { - dst := make([]*uint32, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// Uint32ValueSlice converts a slice of uint32 pouinters uinto a slice of -// uint32 values -func Uint32ValueSlice(src []*uint32) []uint32 { - dst := make([]uint32, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// Uint32Map converts a string map of uint32 values uinto a string -// map of uint32 pouinters -func Uint32Map(src map[string]uint32) map[string]*uint32 { - dst := make(map[string]*uint32) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// Uint32ValueMap converts a string map of uint32 pouinters uinto a string -// map of uint32 values -func Uint32ValueMap(src map[string]*uint32) map[string]uint32 { - dst := make(map[string]uint32) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Uint64 returns a pouinter to of the uint64 value passed in. -func Uint64(v uint64) *uint64 { - return &v -} - -// Uint64Value returns the value of the uint64 pouinter passed in or -// 0 if the pouinter is nil. -func Uint64Value(v *uint64) uint64 { - if v != nil { - return *v - } - return 0 -} - -// Uint64Slice converts a slice of uint64 values uinto a slice of -// uint64 pouinters -func Uint64Slice(src []uint64) []*uint64 { - dst := make([]*uint64, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// Uint64ValueSlice converts a slice of uint64 pouinters uinto a slice of -// uint64 values -func Uint64ValueSlice(src []*uint64) []uint64 { - dst := make([]uint64, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// Uint64Map converts a string map of uint64 values uinto a string -// map of uint64 pouinters -func Uint64Map(src map[string]uint64) map[string]*uint64 { - dst := make(map[string]*uint64) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// Uint64ValueMap converts a string map of uint64 pouinters uinto a string -// map of uint64 values -func Uint64ValueMap(src map[string]*uint64) map[string]uint64 { - dst := make(map[string]uint64) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Float64 returns a pointer to of the float64 value passed in. -func Float64(v float64) *float64 { - return &v -} - -// Float64Value returns the value of the float64 pointer passed in or -// 0 if the pointer is nil. -func Float64Value(v *float64) float64 { - if v != nil { - return *v - } - return 0 -} - -// Float64Slice converts a slice of float64 values into a slice of -// float64 pointers -func Float64Slice(src []float64) []*float64 { - dst := make([]*float64, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// Float64ValueSlice converts a slice of float64 pointers into a slice of -// float64 values -func Float64ValueSlice(src []*float64) []float64 { - dst := make([]float64, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// Float64Map converts a string map of float64 values into a string -// map of float64 pointers -func Float64Map(src map[string]float64) map[string]*float64 { - dst := make(map[string]*float64) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// Float64ValueMap converts a string map of float64 pointers into a string -// map of float64 values -func Float64ValueMap(src map[string]*float64) map[string]float64 { - dst := make(map[string]float64) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Time returns a pointer to of the time.Time value passed in. -func Time(v time.Time) *time.Time { - return &v -} - -// TimeValue returns the value of the time.Time pointer passed in or -// time.Time{} if the pointer is nil. -func TimeValue(v *time.Time) time.Time { - if v != nil { - return *v - } - return time.Time{} -} - -// TimeSlice converts a slice of time.Time values into a slice of -// time.Time pointers -func TimeSlice(src []time.Time) []*time.Time { - dst := make([]*time.Time, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// TimeValueSlice converts a slice of time.Time pointers into a slice of -// time.Time values -func TimeValueSlice(src []*time.Time) []time.Time { - dst := make([]time.Time, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// TimeMap converts a string map of time.Time values into a string -// map of time.Time pointers -func TimeMap(src map[string]time.Time) map[string]*time.Time { - dst := make(map[string]*time.Time) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// TimeValueMap converts a string map of time.Time pointers into a string -// map of time.Time values -func TimeValueMap(src map[string]*time.Time) map[string]time.Time { - dst := make(map[string]time.Time) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} diff --git a/vendor/github.com/go-openapi/swag/convert_types_test.go b/vendor/github.com/go-openapi/swag/convert_types_test.go deleted file mode 100644 index 681b2cf2..00000000 --- a/vendor/github.com/go-openapi/swag/convert_types_test.go +++ /dev/null @@ -1,703 +0,0 @@ -package swag - -import ( - "reflect" - "testing" - "time" - - "github.com/stretchr/testify/assert" -) - -func assertSingleValue(t *testing.T, inElem, elem reflect.Value, expectPointer bool, idx int) { - if !assert.Truef(t, - (elem.Kind() == reflect.Ptr) == expectPointer, - "Unexpected expectPointer=%t value type", expectPointer) { - return - } - if inElem.Kind() == reflect.Ptr && !inElem.IsNil() { - inElem = reflect.Indirect(inElem) - } - if elem.Kind() == reflect.Ptr && !elem.IsNil() { - elem = reflect.Indirect(elem) - } - - if !assert.Truef(t, - (elem.Kind() == reflect.Ptr && elem.IsNil()) || IsZero(elem.Interface()) == - (inElem.Kind() == reflect.Ptr && inElem.IsNil()) || IsZero(inElem.Interface()), - "Unexpected nil pointer at idx %d", idx) { - return - } - - if !((elem.Kind() == reflect.Ptr && elem.IsNil()) || IsZero(elem.Interface())) { - if !assert.IsTypef(t, inElem.Interface(), elem.Interface(), "Expected in/out to match types") { - return - } - assert.EqualValuesf(t, inElem.Interface(), elem.Interface(), "Unexpected value at idx %d: %v", idx, elem.Interface()) - } -} - -// assertValues checks equivalent representation pointer vs values for single var, slices and maps -func assertValues(t *testing.T, in, out interface{}, expectPointer bool, idx int) { - vin := reflect.ValueOf(in) - vout := reflect.ValueOf(out) - switch vin.Kind() { - case reflect.Slice, reflect.Map: - if !assert.Equalf(t, vin.Kind(), vout.Kind(), "Unexpected output type at idx %d", idx) || - !assert.Equalf(t, vin.Len(), vout.Len(), "Unexpected len at idx %d", idx) { - break - } - var elem, inElem reflect.Value - for i := 0; i < vin.Len(); i++ { - if vin.Kind() == reflect.Slice { - elem = vout.Index(i) - inElem = vin.Index(i) - } else if vin.Kind() == reflect.Map { - keys := vin.MapKeys() - elem = vout.MapIndex(keys[i]) - inElem = vout.MapIndex(keys[i]) - } - assertSingleValue(t, inElem, elem, expectPointer, idx) - } - default: - inElem := vin - elem := vout - assertSingleValue(t, inElem, elem, expectPointer, idx) - } -} - -var testCasesStringSlice = [][]string{ - {"a", "b", "c", "d", "e"}, - {"a", "b", "", "", "e"}, -} - -func TestStringSlice(t *testing.T) { - for idx, in := range testCasesStringSlice { - if in == nil { - continue - } - out := StringSlice(in) - assertValues(t, in, out, true, idx) - - out2 := StringValueSlice(out) - assertValues(t, in, out2, false, idx) - } -} - -var testCasesStringValueSlice = [][]*string{ - {String("a"), String("b"), nil, String("c")}, -} - -func TestStringValueSlice(t *testing.T) { - for idx, in := range testCasesStringValueSlice { - if in == nil { - continue - } - out := StringValueSlice(in) - assertValues(t, in, out, false, idx) - - out2 := StringSlice(out) - assertValues(t, in, out2, true, idx) - } -} - -var testCasesStringMap = []map[string]string{ - {"a": "1", "b": "2", "c": "3"}, -} - -func TestStringMap(t *testing.T) { - for idx, in := range testCasesStringMap { - if in == nil { - continue - } - out := StringMap(in) - assertValues(t, in, out, true, idx) - - out2 := StringValueMap(out) - assertValues(t, in, out2, false, idx) - } -} - -var testCasesBoolSlice = [][]bool{ - {true, true, false, false}, -} - -func TestBoolSlice(t *testing.T) { - for idx, in := range testCasesBoolSlice { - if in == nil { - continue - } - out := BoolSlice(in) - assertValues(t, in, out, true, idx) - - out2 := BoolValueSlice(out) - assertValues(t, in, out2, false, idx) - } -} - -var testCasesBoolValueSlice = [][]*bool{ - {Bool(true), Bool(true), Bool(false), Bool(false)}, -} - -func TestBoolValueSlice(t *testing.T) { - for idx, in := range testCasesBoolValueSlice { - if in == nil { - continue - } - out := BoolValueSlice(in) - assertValues(t, in, out, false, idx) - - out2 := BoolSlice(out) - assertValues(t, in, out2, true, idx) - } -} - -var testCasesBoolMap = []map[string]bool{ - {"a": true, "b": false, "c": true}, -} - -func TestBoolMap(t *testing.T) { - for idx, in := range testCasesBoolMap { - if in == nil { - continue - } - out := BoolMap(in) - assertValues(t, in, out, true, idx) - - out2 := BoolValueMap(out) - assertValues(t, in, out2, false, idx) - } -} - -var testCasesIntSlice = [][]int{ - {1, 2, 3, 4}, -} - -func TestIntSlice(t *testing.T) { - for idx, in := range testCasesIntSlice { - if in == nil { - continue - } - out := IntSlice(in) - assertValues(t, in, out, true, idx) - - out2 := IntValueSlice(out) - assertValues(t, in, out2, false, idx) - } -} - -var testCasesIntValueSlice = [][]*int{ - {Int(1), Int(2), Int(3), Int(4)}, -} - -func TestIntValueSlice(t *testing.T) { - for idx, in := range testCasesIntValueSlice { - if in == nil { - continue - } - out := IntValueSlice(in) - assertValues(t, in, out, false, idx) - - out2 := IntSlice(out) - assertValues(t, in, out2, true, idx) - } -} - -var testCasesIntMap = []map[string]int{ - {"a": 3, "b": 2, "c": 1}, -} - -func TestIntMap(t *testing.T) { - for idx, in := range testCasesIntMap { - if in == nil { - continue - } - out := IntMap(in) - assertValues(t, in, out, true, idx) - - out2 := IntValueMap(out) - assertValues(t, in, out2, false, idx) - } -} - -var testCasesInt64Slice = [][]int64{ - {1, 2, 3, 4}, -} - -func TestInt64Slice(t *testing.T) { - for idx, in := range testCasesInt64Slice { - if in == nil { - continue - } - out := Int64Slice(in) - assertValues(t, in, out, true, idx) - - out2 := Int64ValueSlice(out) - assertValues(t, in, out2, false, idx) - } -} - -var testCasesInt64ValueSlice = [][]*int64{ - {Int64(1), Int64(2), Int64(3), Int64(4)}, -} - -func TestInt64ValueSlice(t *testing.T) { - for idx, in := range testCasesInt64ValueSlice { - if in == nil { - continue - } - out := Int64ValueSlice(in) - assertValues(t, in, out, false, idx) - - out2 := Int64Slice(out) - assertValues(t, in, out2, true, idx) - } -} - -var testCasesInt64Map = []map[string]int64{ - {"a": 3, "b": 2, "c": 1}, -} - -func TestInt64Map(t *testing.T) { - for idx, in := range testCasesInt64Map { - if in == nil { - continue - } - out := Int64Map(in) - assertValues(t, in, out, true, idx) - - out2 := Int64ValueMap(out) - assertValues(t, in, out2, false, idx) - } -} - -var testCasesFloat64Slice = [][]float64{ - {1, 2, 3, 4}, -} - -func TestFloat64Slice(t *testing.T) { - for idx, in := range testCasesFloat64Slice { - if in == nil { - continue - } - out := Float64Slice(in) - assertValues(t, in, out, true, idx) - - out2 := Float64ValueSlice(out) - assertValues(t, in, out2, false, idx) - } -} - -var testCasesUintSlice = [][]uint{ - {1, 2, 3, 4}, -} - -func TestUintSlice(t *testing.T) { - for idx, in := range testCasesUintSlice { - if in == nil { - continue - } - out := UintSlice(in) - assertValues(t, in, out, true, idx) - - out2 := UintValueSlice(out) - assertValues(t, in, out2, false, idx) - } -} - -var testCasesUintValueSlice = [][]*uint{} - -func TestUintValueSlice(t *testing.T) { - for idx, in := range testCasesUintValueSlice { - if in == nil { - continue - } - out := UintValueSlice(in) - assertValues(t, in, out, true, idx) - - out2 := UintSlice(out) - assertValues(t, in, out2, false, idx) - } -} - -var testCasesUintMap = []map[string]uint{ - {"a": 3, "b": 2, "c": 1}, -} - -func TestUintMap(t *testing.T) { - for idx, in := range testCasesUintMap { - if in == nil { - continue - } - out := UintMap(in) - assertValues(t, in, out, true, idx) - - out2 := UintValueMap(out) - assertValues(t, in, out2, false, idx) - } -} - -var testCasesUint64Slice = [][]uint64{ - {1, 2, 3, 4}, -} - -func TestUint64Slice(t *testing.T) { - for idx, in := range testCasesUint64Slice { - if in == nil { - continue - } - out := Uint64Slice(in) - assertValues(t, in, out, true, idx) - - out2 := Uint64ValueSlice(out) - assertValues(t, in, out2, false, idx) - } -} - -var testCasesUint64ValueSlice = [][]*uint64{} - -func TestUint64ValueSlice(t *testing.T) { - for idx, in := range testCasesUint64ValueSlice { - if in == nil { - continue - } - out := Uint64ValueSlice(in) - assertValues(t, in, out, true, idx) - - out2 := Uint64Slice(out) - assertValues(t, in, out2, false, idx) - } -} - -var testCasesUint64Map = []map[string]uint64{ - {"a": 3, "b": 2, "c": 1}, -} - -func TestUint64Map(t *testing.T) { - for idx, in := range testCasesUint64Map { - if in == nil { - continue - } - out := Uint64Map(in) - assertValues(t, in, out, true, idx) - - out2 := Uint64ValueMap(out) - assertValues(t, in, out2, false, idx) - } -} - -var testCasesFloat64ValueSlice = [][]*float64{} - -func TestFloat64ValueSlice(t *testing.T) { - for idx, in := range testCasesFloat64ValueSlice { - if in == nil { - continue - } - out := Float64ValueSlice(in) - assertValues(t, in, out, true, idx) - - out2 := Float64Slice(out) - assertValues(t, in, out2, false, idx) - } -} - -var testCasesFloat64Map = []map[string]float64{ - {"a": 3, "b": 2, "c": 1}, -} - -func TestFloat64Map(t *testing.T) { - for idx, in := range testCasesFloat64Map { - if in == nil { - continue - } - out := Float64Map(in) - assertValues(t, in, out, true, idx) - - out2 := Float64ValueMap(out) - assertValues(t, in, out2, false, idx) - } -} - -var testCasesTimeSlice = [][]time.Time{ - {time.Now(), time.Now().AddDate(100, 0, 0)}, -} - -func TestTimeSlice(t *testing.T) { - for idx, in := range testCasesTimeSlice { - if in == nil { - continue - } - out := TimeSlice(in) - assertValues(t, in, out, true, idx) - - out2 := TimeValueSlice(out) - assertValues(t, in, out2, false, idx) - } -} - -var testCasesTimeValueSlice = [][]*time.Time{ - {Time(time.Now()), Time(time.Now().AddDate(100, 0, 0))}, -} - -func TestTimeValueSlice(t *testing.T) { - for idx, in := range testCasesTimeValueSlice { - if in == nil { - continue - } - out := TimeValueSlice(in) - assertValues(t, in, out, false, idx) - - out2 := TimeSlice(out) - assertValues(t, in, out2, true, idx) - } -} - -var testCasesTimeMap = []map[string]time.Time{ - {"a": time.Now().AddDate(-100, 0, 0), "b": time.Now()}, -} - -func TestTimeMap(t *testing.T) { - for idx, in := range testCasesTimeMap { - if in == nil { - continue - } - out := TimeMap(in) - assertValues(t, in, out, true, idx) - - out2 := TimeValueMap(out) - assertValues(t, in, out2, false, idx) - } -} - -var testCasesInt32Slice = [][]int32{ - {1, 2, 3, 4}, -} - -func TestInt32Slice(t *testing.T) { - for idx, in := range testCasesInt32Slice { - if in == nil { - continue - } - out := Int32Slice(in) - assertValues(t, in, out, true, idx) - - out2 := Int32ValueSlice(out) - assertValues(t, in, out2, false, idx) - } -} - -var testCasesInt32ValueSlice = [][]*int32{ - {Int32(1), Int32(2), Int32(3), Int32(4)}, -} - -func TestInt32ValueSlice(t *testing.T) { - for idx, in := range testCasesInt32ValueSlice { - if in == nil { - continue - } - out := Int32ValueSlice(in) - assertValues(t, in, out, false, idx) - - out2 := Int32Slice(out) - assertValues(t, in, out2, true, idx) - } -} - -var testCasesInt32Map = []map[string]int32{ - {"a": 3, "b": 2, "c": 1}, -} - -func TestInt32Map(t *testing.T) { - for idx, in := range testCasesInt32Map { - if in == nil { - continue - } - out := Int32Map(in) - assertValues(t, in, out, true, idx) - - out2 := Int32ValueMap(out) - assertValues(t, in, out2, false, idx) - } -} - -var testCasesUint32Slice = [][]uint32{ - {1, 2, 3, 4}, -} - -func TestUint32Slice(t *testing.T) { - for idx, in := range testCasesUint32Slice { - if in == nil { - continue - } - out := Uint32Slice(in) - assertValues(t, in, out, true, idx) - - out2 := Uint32ValueSlice(out) - assertValues(t, in, out2, false, idx) - } -} - -var testCasesUint32ValueSlice = [][]*uint32{ - {Uint32(1), Uint32(2), Uint32(3), Uint32(4)}, -} - -func TestUint32ValueSlice(t *testing.T) { - for idx, in := range testCasesUint32ValueSlice { - if in == nil { - continue - } - out := Uint32ValueSlice(in) - assertValues(t, in, out, false, idx) - - out2 := Uint32Slice(out) - assertValues(t, in, out2, true, idx) - } -} - -var testCasesUint32Map = []map[string]uint32{ - {"a": 3, "b": 2, "c": 1}, -} - -func TestUint32Map(t *testing.T) { - for idx, in := range testCasesUint32Map { - if in == nil { - continue - } - out := Uint32Map(in) - assertValues(t, in, out, true, idx) - - out2 := Uint32ValueMap(out) - assertValues(t, in, out2, false, idx) - } -} - -var testCasesString = []string{"a", "b", "c", "d", "e", ""} - -func TestStringValue(t *testing.T) { - for idx, in := range testCasesString { - out := String(in) - assertValues(t, in, out, true, idx) - - out2 := StringValue(out) - assertValues(t, in, out2, false, idx) - } - assert.Zerof(t, StringValue(nil), "expected conversion from nil to return zero value") -} - -var testCasesBool = []bool{true, false} - -func TestBoolValue(t *testing.T) { - for idx, in := range testCasesBool { - out := Bool(in) - assertValues(t, in, out, true, idx) - - out2 := BoolValue(out) - assertValues(t, in, out2, false, idx) - } - assert.Zerof(t, BoolValue(nil), "expected conversion from nil to return zero value") -} - -var testCasesInt = []int{1, 2, 3, 0} - -func TestIntValue(t *testing.T) { - for idx, in := range testCasesInt { - out := Int(in) - assertValues(t, in, out, true, idx) - - out2 := IntValue(out) - assertValues(t, in, out2, false, idx) - } - assert.Zerof(t, IntValue(nil), "expected conversion from nil to return zero value") -} - -var testCasesInt32 = []int32{1, 2, 3, 0} - -func TestInt32Value(t *testing.T) { - for idx, in := range testCasesInt32 { - out := Int32(in) - assertValues(t, in, out, true, idx) - - out2 := Int32Value(out) - assertValues(t, in, out2, false, idx) - } - assert.Zerof(t, Int32Value(nil), "expected conversion from nil to return zero value") -} - -var testCasesInt64 = []int64{1, 2, 3, 0} - -func TestInt64Value(t *testing.T) { - for idx, in := range testCasesInt64 { - out := Int64(in) - assertValues(t, in, out, true, idx) - - out2 := Int64Value(out) - assertValues(t, in, out2, false, idx) - } - assert.Zerof(t, Int64Value(nil), "expected conversion from nil to return zero value") -} - -var testCasesUint = []uint{1, 2, 3, 0} - -func TestUintValue(t *testing.T) { - for idx, in := range testCasesUint { - out := Uint(in) - assertValues(t, in, out, true, idx) - - out2 := UintValue(out) - assertValues(t, in, out2, false, idx) - } - assert.Zerof(t, UintValue(nil), "expected conversion from nil to return zero value") -} - -var testCasesUint32 = []uint32{1, 2, 3, 0} - -func TestUint32Value(t *testing.T) { - for idx, in := range testCasesUint32 { - out := Uint32(in) - assertValues(t, in, out, true, idx) - - out2 := Uint32Value(out) - assertValues(t, in, out2, false, idx) - } - assert.Zerof(t, Uint32Value(nil), "expected conversion from nil to return zero value") -} - -var testCasesUint64 = []uint64{1, 2, 3, 0} - -func TestUint64Value(t *testing.T) { - for idx, in := range testCasesUint64 { - out := Uint64(in) - assertValues(t, in, out, true, idx) - - out2 := Uint64Value(out) - assertValues(t, in, out2, false, idx) - } - assert.Zerof(t, Uint64Value(nil), "expected conversion from nil to return zero value") -} - -var testCasesFloat64 = []float64{1, 2, 3, 0} - -func TestFloat64Value(t *testing.T) { - for idx, in := range testCasesFloat64 { - out := Float64(in) - assertValues(t, in, out, true, idx) - - out2 := Float64Value(out) - assertValues(t, in, out2, false, idx) - } - assert.Zerof(t, Float64Value(nil), "expected conversion from nil to return zero value") -} - -var testCasesTime = []time.Time{ - time.Now().AddDate(-100, 0, 0), time.Now(), -} - -func TestTimeValue(t *testing.T) { - for idx, in := range testCasesTime { - out := Time(in) - assertValues(t, in, out, true, idx) - - out2 := TimeValue(out) - assertValues(t, in, out2, false, idx) - } - assert.Zerof(t, TimeValue(nil), "expected conversion from nil to return zero value") -} diff --git a/vendor/github.com/go-openapi/swag/doc.go b/vendor/github.com/go-openapi/swag/doc.go deleted file mode 100644 index e01e1a02..00000000 --- a/vendor/github.com/go-openapi/swag/doc.go +++ /dev/null @@ -1,33 +0,0 @@ -// 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 swag contains a bunch of helper functions for go-openapi and go-swagger projects. - -You may also use it standalone for your projects. - - * convert between value and pointers for builtin types - * convert from string to builtin types (wraps strconv) - * fast json concatenation - * search in path - * load from file or http - * name mangling - - -This repo has only few dependencies outside of the standard library: - - * JSON utilities depend on github.com/mailru/easyjson - * YAML utilities depend on gopkg.in/yaml.v2 -*/ -package swag diff --git a/vendor/github.com/go-openapi/swag/go.mod b/vendor/github.com/go-openapi/swag/go.mod deleted file mode 100644 index 9eb936a1..00000000 --- a/vendor/github.com/go-openapi/swag/go.mod +++ /dev/null @@ -1,9 +0,0 @@ -module github.com/go-openapi/swag - -require ( - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329 - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/stretchr/testify v1.2.2 - gopkg.in/yaml.v2 v2.2.1 -) diff --git a/vendor/github.com/go-openapi/swag/go.sum b/vendor/github.com/go-openapi/swag/go.sum deleted file mode 100644 index d6e717bd..00000000 --- a/vendor/github.com/go-openapi/swag/go.sum +++ /dev/null @@ -1,9 +0,0 @@ -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329 h1:2gxZ0XQIU/5z3Z3bUBu+FXuk2pFbkN6tcwi/pjyaDic= -github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/github.com/go-openapi/swag/json.go b/vendor/github.com/go-openapi/swag/json.go deleted file mode 100644 index 33da5e4e..00000000 --- a/vendor/github.com/go-openapi/swag/json.go +++ /dev/null @@ -1,311 +0,0 @@ -// 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 swag - -import ( - "bytes" - "encoding/json" - "log" - "reflect" - "strings" - "sync" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// nullJSON represents a JSON object with null type -var nullJSON = []byte("null") - -// DefaultJSONNameProvider the default cache for types -var DefaultJSONNameProvider = NewNameProvider() - -const comma = byte(',') - -var closers map[byte]byte - -func init() { - closers = map[byte]byte{ - '{': '}', - '[': ']', - } -} - -type ejMarshaler interface { - MarshalEasyJSON(w *jwriter.Writer) -} - -type ejUnmarshaler interface { - UnmarshalEasyJSON(w *jlexer.Lexer) -} - -// WriteJSON writes json data, prefers finding an appropriate interface to short-circuit the marshaller -// so it takes the fastest option available. -func WriteJSON(data interface{}) ([]byte, error) { - if d, ok := data.(ejMarshaler); ok { - jw := new(jwriter.Writer) - d.MarshalEasyJSON(jw) - return jw.BuildBytes() - } - if d, ok := data.(json.Marshaler); ok { - return d.MarshalJSON() - } - return json.Marshal(data) -} - -// ReadJSON reads json data, prefers finding an appropriate interface to short-circuit the unmarshaller -// so it takes the fastes option available -func ReadJSON(data []byte, value interface{}) error { - if d, ok := value.(ejUnmarshaler); ok { - jl := &jlexer.Lexer{Data: data} - d.UnmarshalEasyJSON(jl) - return jl.Error() - } - if d, ok := value.(json.Unmarshaler); ok { - return d.UnmarshalJSON(data) - } - return json.Unmarshal(data, value) -} - -// DynamicJSONToStruct converts an untyped json structure into a struct -func DynamicJSONToStruct(data interface{}, target interface{}) error { - // TODO: convert straight to a json typed map (mergo + iterate?) - b, err := WriteJSON(data) - if err != nil { - return err - } - return ReadJSON(b, target) -} - -// ConcatJSON concatenates multiple json objects efficiently -func ConcatJSON(blobs ...[]byte) []byte { - if len(blobs) == 0 { - return nil - } - - last := len(blobs) - 1 - for blobs[last] == nil || bytes.Equal(blobs[last], nullJSON) { - // strips trailing null objects - last = last - 1 - if last < 0 { - // there was nothing but "null"s or nil... - return nil - } - } - if last == 0 { - return blobs[0] - } - - var opening, closing byte - var idx, a int - buf := bytes.NewBuffer(nil) - - for i, b := range blobs[:last+1] { - if b == nil || bytes.Equal(b, nullJSON) { - // a null object is in the list: skip it - continue - } - if len(b) > 0 && opening == 0 { // is this an array or an object? - opening, closing = b[0], closers[b[0]] - } - - if opening != '{' && opening != '[' { - continue // don't know how to concatenate non container objects - } - - if len(b) < 3 { // yep empty but also the last one, so closing this thing - if i == last && a > 0 { - if err := buf.WriteByte(closing); err != nil { - log.Println(err) - } - } - continue - } - - idx = 0 - if a > 0 { // we need to join with a comma for everything beyond the first non-empty item - if err := buf.WriteByte(comma); err != nil { - log.Println(err) - } - idx = 1 // this is not the first or the last so we want to drop the leading bracket - } - - if i != last { // not the last one, strip brackets - if _, err := buf.Write(b[idx : len(b)-1]); err != nil { - log.Println(err) - } - } else { // last one, strip only the leading bracket - if _, err := buf.Write(b[idx:]); err != nil { - log.Println(err) - } - } - a++ - } - // somehow it ended up being empty, so provide a default value - if buf.Len() == 0 { - if err := buf.WriteByte(opening); err != nil { - log.Println(err) - } - if err := buf.WriteByte(closing); err != nil { - log.Println(err) - } - } - return buf.Bytes() -} - -// ToDynamicJSON turns an object into a properly JSON typed structure -func ToDynamicJSON(data interface{}) interface{} { - // TODO: convert straight to a json typed map (mergo + iterate?) - b, err := json.Marshal(data) - if err != nil { - log.Println(err) - } - var res interface{} - if err := json.Unmarshal(b, &res); err != nil { - log.Println(err) - } - return res -} - -// FromDynamicJSON turns an object into a properly JSON typed structure -func FromDynamicJSON(data, target interface{}) error { - b, err := json.Marshal(data) - if err != nil { - log.Println(err) - } - return json.Unmarshal(b, target) -} - -// NameProvider represents an object capabale of translating from go property names -// to json property names -// This type is thread-safe. -type NameProvider struct { - lock *sync.Mutex - index map[reflect.Type]nameIndex -} - -type nameIndex struct { - jsonNames map[string]string - goNames map[string]string -} - -// NewNameProvider creates a new name provider -func NewNameProvider() *NameProvider { - return &NameProvider{ - lock: &sync.Mutex{}, - index: make(map[reflect.Type]nameIndex), - } -} - -func buildnameIndex(tpe reflect.Type, idx, reverseIdx map[string]string) { - for i := 0; i < tpe.NumField(); i++ { - targetDes := tpe.Field(i) - - if targetDes.PkgPath != "" { // unexported - continue - } - - if targetDes.Anonymous { // walk embedded structures tree down first - buildnameIndex(targetDes.Type, idx, reverseIdx) - continue - } - - if tag := targetDes.Tag.Get("json"); tag != "" { - - parts := strings.Split(tag, ",") - if len(parts) == 0 { - continue - } - - nm := parts[0] - if nm == "-" { - continue - } - if nm == "" { // empty string means we want to use the Go name - nm = targetDes.Name - } - - idx[nm] = targetDes.Name - reverseIdx[targetDes.Name] = nm - } - } -} - -func newNameIndex(tpe reflect.Type) nameIndex { - var idx = make(map[string]string, tpe.NumField()) - var reverseIdx = make(map[string]string, tpe.NumField()) - - buildnameIndex(tpe, idx, reverseIdx) - return nameIndex{jsonNames: idx, goNames: reverseIdx} -} - -// GetJSONNames gets all the json property names for a type -func (n *NameProvider) GetJSONNames(subject interface{}) []string { - n.lock.Lock() - defer n.lock.Unlock() - tpe := reflect.Indirect(reflect.ValueOf(subject)).Type() - names, ok := n.index[tpe] - if !ok { - names = n.makeNameIndex(tpe) - } - - res := make([]string, 0, len(names.jsonNames)) - for k := range names.jsonNames { - res = append(res, k) - } - return res -} - -// GetJSONName gets the json name for a go property name -func (n *NameProvider) GetJSONName(subject interface{}, name string) (string, bool) { - tpe := reflect.Indirect(reflect.ValueOf(subject)).Type() - return n.GetJSONNameForType(tpe, name) -} - -// GetJSONNameForType gets the json name for a go property name on a given type -func (n *NameProvider) GetJSONNameForType(tpe reflect.Type, name string) (string, bool) { - n.lock.Lock() - defer n.lock.Unlock() - names, ok := n.index[tpe] - if !ok { - names = n.makeNameIndex(tpe) - } - nme, ok := names.goNames[name] - return nme, ok -} - -func (n *NameProvider) makeNameIndex(tpe reflect.Type) nameIndex { - names := newNameIndex(tpe) - n.index[tpe] = names - return names -} - -// GetGoName gets the go name for a json property name -func (n *NameProvider) GetGoName(subject interface{}, name string) (string, bool) { - tpe := reflect.Indirect(reflect.ValueOf(subject)).Type() - return n.GetGoNameForType(tpe, name) -} - -// GetGoNameForType gets the go name for a given type for a json property name -func (n *NameProvider) GetGoNameForType(tpe reflect.Type, name string) (string, bool) { - n.lock.Lock() - defer n.lock.Unlock() - names, ok := n.index[tpe] - if !ok { - names = n.makeNameIndex(tpe) - } - nme, ok := names.jsonNames[name] - return nme, ok -} diff --git a/vendor/github.com/go-openapi/swag/json_test.go b/vendor/github.com/go-openapi/swag/json_test.go deleted file mode 100644 index 853c672c..00000000 --- a/vendor/github.com/go-openapi/swag/json_test.go +++ /dev/null @@ -1,169 +0,0 @@ -// 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 swag - -import ( - "reflect" - "testing" - - "github.com/stretchr/testify/assert" -) - -type testNameStruct struct { - Name string `json:"name"` - NotTheSame int64 `json:"plain"` - Ignored string `json:"-"` -} - -func TestNameProvider(t *testing.T) { - - provider := NewNameProvider() - - var obj = testNameStruct{} - - nm, ok := provider.GetGoName(obj, "name") - assert.True(t, ok) - assert.Equal(t, "Name", nm) - - nm, ok = provider.GetGoName(obj, "plain") - assert.True(t, ok) - assert.Equal(t, "NotTheSame", nm) - - nm, ok = provider.GetGoName(obj, "doesNotExist") - assert.False(t, ok) - assert.Empty(t, nm) - - nm, ok = provider.GetGoName(obj, "ignored") - assert.False(t, ok) - assert.Empty(t, nm) - - tpe := reflect.TypeOf(obj) - nm, ok = provider.GetGoNameForType(tpe, "name") - assert.True(t, ok) - assert.Equal(t, "Name", nm) - - nm, ok = provider.GetGoNameForType(tpe, "plain") - assert.True(t, ok) - assert.Equal(t, "NotTheSame", nm) - - nm, ok = provider.GetGoNameForType(tpe, "doesNotExist") - assert.False(t, ok) - assert.Empty(t, nm) - - nm, ok = provider.GetGoNameForType(tpe, "ignored") - assert.False(t, ok) - assert.Empty(t, nm) - - ptr := &obj - nm, ok = provider.GetGoName(ptr, "name") - assert.True(t, ok) - assert.Equal(t, "Name", nm) - - nm, ok = provider.GetGoName(ptr, "plain") - assert.True(t, ok) - assert.Equal(t, "NotTheSame", nm) - - nm, ok = provider.GetGoName(ptr, "doesNotExist") - assert.False(t, ok) - assert.Empty(t, nm) - - nm, ok = provider.GetGoName(ptr, "ignored") - assert.False(t, ok) - assert.Empty(t, nm) - - nm, ok = provider.GetJSONName(obj, "Name") - assert.True(t, ok) - assert.Equal(t, "name", nm) - - nm, ok = provider.GetJSONName(obj, "NotTheSame") - assert.True(t, ok) - assert.Equal(t, "plain", nm) - - nm, ok = provider.GetJSONName(obj, "DoesNotExist") - assert.False(t, ok) - assert.Empty(t, nm) - - nm, ok = provider.GetJSONName(obj, "Ignored") - assert.False(t, ok) - assert.Empty(t, nm) - - nm, ok = provider.GetJSONNameForType(tpe, "Name") - assert.True(t, ok) - assert.Equal(t, "name", nm) - - nm, ok = provider.GetJSONNameForType(tpe, "NotTheSame") - assert.True(t, ok) - assert.Equal(t, "plain", nm) - - nm, ok = provider.GetJSONNameForType(tpe, "doesNotExist") - assert.False(t, ok) - assert.Empty(t, nm) - - nm, ok = provider.GetJSONNameForType(tpe, "Ignored") - assert.False(t, ok) - assert.Empty(t, nm) - - nm, ok = provider.GetJSONName(ptr, "Name") - assert.True(t, ok) - assert.Equal(t, "name", nm) - - nm, ok = provider.GetJSONName(ptr, "NotTheSame") - assert.True(t, ok) - assert.Equal(t, "plain", nm) - - nm, ok = provider.GetJSONName(ptr, "doesNotExist") - assert.False(t, ok) - assert.Empty(t, nm) - - nm, ok = provider.GetJSONName(ptr, "Ignored") - assert.False(t, ok) - assert.Empty(t, nm) - - nms := provider.GetJSONNames(ptr) - assert.Len(t, nms, 2) - - assert.Len(t, provider.index, 1) - -} - -func TestJSONConcatenation(t *testing.T) { - assert.Nil(t, ConcatJSON()) - assert.Equal(t, ConcatJSON([]byte(`{"id":1}`)), []byte(`{"id":1}`)) - assert.Equal(t, ConcatJSON([]byte(`{}`), []byte(`{}`)), []byte(`{}`)) - assert.Equal(t, ConcatJSON([]byte(`[]`), []byte(`[]`)), []byte(`[]`)) - assert.Equal(t, ConcatJSON([]byte(`{"id":1}`), []byte(`{"name":"Rachel"}`)), []byte(`{"id":1,"name":"Rachel"}`)) - assert.Equal(t, ConcatJSON([]byte(`[{"id":1}]`), []byte(`[{"name":"Rachel"}]`)), []byte(`[{"id":1},{"name":"Rachel"}]`)) - assert.Equal(t, ConcatJSON([]byte(`{}`), []byte(`{"name":"Rachel"}`)), []byte(`{"name":"Rachel"}`)) - assert.Equal(t, ConcatJSON([]byte(`[]`), []byte(`[{"name":"Rachel"}]`)), []byte(`[{"name":"Rachel"}]`)) - assert.Equal(t, ConcatJSON([]byte(`{"id":1}`), []byte(`{}`)), []byte(`{"id":1}`)) - assert.Equal(t, ConcatJSON([]byte(`[{"id":1}]`), []byte(`[]`)), []byte(`[{"id":1}]`)) - assert.Equal(t, ConcatJSON([]byte(`{}`), []byte(`{}`), []byte(`{}`)), []byte(`{}`)) - assert.Equal(t, ConcatJSON([]byte(`[]`), []byte(`[]`), []byte(`[]`)), []byte(`[]`)) - assert.Equal(t, ConcatJSON([]byte(`{"id":1}`), []byte(`{"name":"Rachel"}`), []byte(`{"age":32}`)), []byte(`{"id":1,"name":"Rachel","age":32}`)) - assert.Equal(t, ConcatJSON([]byte(`[{"id":1}]`), []byte(`[{"name":"Rachel"}]`), []byte(`[{"age":32}]`)), []byte(`[{"id":1},{"name":"Rachel"},{"age":32}]`)) - assert.Equal(t, ConcatJSON([]byte(`{}`), []byte(`{"name":"Rachel"}`), []byte(`{"age":32}`)), []byte(`{"name":"Rachel","age":32}`)) - assert.Equal(t, ConcatJSON([]byte(`[]`), []byte(`[{"name":"Rachel"}]`), []byte(`[{"age":32}]`)), []byte(`[{"name":"Rachel"},{"age":32}]`)) - assert.Equal(t, ConcatJSON([]byte(`{"id":1}`), []byte(`{}`), []byte(`{"age":32}`)), []byte(`{"id":1,"age":32}`)) - assert.Equal(t, ConcatJSON([]byte(`[{"id":1}]`), []byte(`[]`), []byte(`[{"age":32}]`)), []byte(`[{"id":1},{"age":32}]`)) - assert.Equal(t, ConcatJSON([]byte(`{"id":1}`), []byte(`{"name":"Rachel"}`), []byte(`{}`)), []byte(`{"id":1,"name":"Rachel"}`)) - assert.Equal(t, ConcatJSON([]byte(`[{"id":1}]`), []byte(`[{"name":"Rachel"}]`), []byte(`[]`)), []byte(`[{"id":1},{"name":"Rachel"}]`)) - - // add test on null - assert.Equal(t, ConcatJSON([]byte(nil)), []byte(nil)) - assert.Equal(t, ConcatJSON([]byte(`null`)), []byte(nil)) - assert.Equal(t, ConcatJSON([]byte(nil), []byte(`null`)), []byte(nil)) - assert.Equal(t, ConcatJSON([]byte(`{"id":null}`), []byte(`null`)), []byte(`{"id":null}`)) - assert.Equal(t, ConcatJSON([]byte(`{"id":null}`), []byte(`null`), []byte(`{"name":"Rachel"}`)), []byte(`{"id":null,"name":"Rachel"}`)) -} diff --git a/vendor/github.com/go-openapi/swag/loading.go b/vendor/github.com/go-openapi/swag/loading.go deleted file mode 100644 index 70f4fb36..00000000 --- a/vendor/github.com/go-openapi/swag/loading.go +++ /dev/null @@ -1,80 +0,0 @@ -// 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 swag - -import ( - "fmt" - "io/ioutil" - "log" - "net/http" - "path/filepath" - "strings" - "time" -) - -// LoadHTTPTimeout the default timeout for load requests -var LoadHTTPTimeout = 30 * time.Second - -// LoadFromFileOrHTTP loads the bytes from a file or a remote http server based on the path passed in -func LoadFromFileOrHTTP(path string) ([]byte, error) { - return LoadStrategy(path, ioutil.ReadFile, loadHTTPBytes(LoadHTTPTimeout))(path) -} - -// LoadFromFileOrHTTPWithTimeout loads the bytes from a file or a remote http server based on the path passed in -// timeout arg allows for per request overriding of the request timeout -func LoadFromFileOrHTTPWithTimeout(path string, timeout time.Duration) ([]byte, error) { - return LoadStrategy(path, ioutil.ReadFile, loadHTTPBytes(timeout))(path) -} - -// LoadStrategy returns a loader function for a given path or uri -func LoadStrategy(path string, local, remote func(string) ([]byte, error)) func(string) ([]byte, error) { - if strings.HasPrefix(path, "http") { - return remote - } - return func(pth string) ([]byte, error) { - upth, err := pathUnescape(pth) - if err != nil { - return nil, err - } - return local(filepath.FromSlash(upth)) - } -} - -func loadHTTPBytes(timeout time.Duration) func(path string) ([]byte, error) { - return func(path string) ([]byte, error) { - client := &http.Client{Timeout: timeout} - req, err := http.NewRequest("GET", path, nil) - if err != nil { - return nil, err - } - resp, err := client.Do(req) - defer func() { - if resp != nil { - if e := resp.Body.Close(); e != nil { - log.Println(e) - } - } - }() - if err != nil { - return nil, err - } - - if resp.StatusCode != http.StatusOK { - return nil, fmt.Errorf("could not access document at %q [%s] ", path, resp.Status) - } - - return ioutil.ReadAll(resp.Body) - } -} diff --git a/vendor/github.com/go-openapi/swag/loading_test.go b/vendor/github.com/go-openapi/swag/loading_test.go deleted file mode 100644 index accb1c55..00000000 --- a/vendor/github.com/go-openapi/swag/loading_test.go +++ /dev/null @@ -1,47 +0,0 @@ -// 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 swag - -import ( - "net/http" - "net/http/httptest" - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestLoadFromHTTP(t *testing.T) { - - _, err := LoadFromFileOrHTTP("httx://12394:abd") - assert.Error(t, err) - - serv := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - rw.WriteHeader(http.StatusNotFound) - })) - defer serv.Close() - - _, err = LoadFromFileOrHTTP(serv.URL) - assert.Error(t, err) - - ts2 := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - rw.WriteHeader(http.StatusOK) - _, _ = rw.Write([]byte("the content")) - })) - defer ts2.Close() - - d, err := LoadFromFileOrHTTP(ts2.URL) - assert.NoError(t, err) - assert.Equal(t, []byte("the content"), d) -} diff --git a/vendor/github.com/go-openapi/swag/net.go b/vendor/github.com/go-openapi/swag/net.go deleted file mode 100644 index 8323fa37..00000000 --- a/vendor/github.com/go-openapi/swag/net.go +++ /dev/null @@ -1,24 +0,0 @@ -package swag - -import ( - "net" - "strconv" -) - -// SplitHostPort splits a network address into a host and a port. -// The port is -1 when there is no port to be found -func SplitHostPort(addr string) (host string, port int, err error) { - h, p, err := net.SplitHostPort(addr) - if err != nil { - return "", -1, err - } - if p == "" { - return "", -1, &net.AddrError{Err: "missing port in address", Addr: addr} - } - - pi, err := strconv.Atoi(p) - if err != nil { - return "", -1, err - } - return h, pi, nil -} diff --git a/vendor/github.com/go-openapi/swag/net_test.go b/vendor/github.com/go-openapi/swag/net_test.go deleted file mode 100644 index 041db60a..00000000 --- a/vendor/github.com/go-openapi/swag/net_test.go +++ /dev/null @@ -1,30 +0,0 @@ -package swag - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestSplitHostPort(t *testing.T) { - data := []struct { - Input string - Host string - Port int - Err bool - }{ - {"localhost:3933", "localhost", 3933, false}, - {"localhost:yellow", "", -1, true}, - {"localhost", "", -1, true}, - {"localhost:", "", -1, true}, - {"localhost:3933", "localhost", 3933, false}, - } - - for _, e := range data { - h, p, err := SplitHostPort(e.Input) - if (!e.Err && assert.NoError(t, err)) || (e.Err && assert.Error(t, err)) { - assert.Equal(t, e.Host, h) - assert.Equal(t, e.Port, p) - } - } -} diff --git a/vendor/github.com/go-openapi/swag/path.go b/vendor/github.com/go-openapi/swag/path.go deleted file mode 100644 index 941bd017..00000000 --- a/vendor/github.com/go-openapi/swag/path.go +++ /dev/null @@ -1,59 +0,0 @@ -// 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 swag - -import ( - "os" - "path/filepath" - "runtime" - "strings" -) - -const ( - // GOPATHKey represents the env key for gopath - GOPATHKey = "GOPATH" -) - -// FindInSearchPath finds a package in a provided lists of paths -func FindInSearchPath(searchPath, pkg string) string { - pathsList := filepath.SplitList(searchPath) - for _, path := range pathsList { - if evaluatedPath, err := filepath.EvalSymlinks(filepath.Join(path, "src", pkg)); err == nil { - if _, err := os.Stat(evaluatedPath); err == nil { - return evaluatedPath - } - } - } - return "" -} - -// FindInGoSearchPath finds a package in the $GOPATH:$GOROOT -func FindInGoSearchPath(pkg string) string { - return FindInSearchPath(FullGoSearchPath(), pkg) -} - -// FullGoSearchPath gets the search paths for finding packages -func FullGoSearchPath() string { - allPaths := os.Getenv(GOPATHKey) - if allPaths == "" { - allPaths = filepath.Join(os.Getenv("HOME"), "go") - } - if allPaths != "" { - allPaths = strings.Join([]string{allPaths, runtime.GOROOT()}, ":") - } else { - allPaths = runtime.GOROOT() - } - return allPaths -} diff --git a/vendor/github.com/go-openapi/swag/path_test.go b/vendor/github.com/go-openapi/swag/path_test.go deleted file mode 100644 index 7f7dd107..00000000 --- a/vendor/github.com/go-openapi/swag/path_test.go +++ /dev/null @@ -1,118 +0,0 @@ -// 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 swag - -import ( - "io/ioutil" - "os" - "path" - "path/filepath" - "runtime" - "testing" - - "github.com/stretchr/testify/assert" -) - -func makeDirStructure(tgt string) (string, string, error) { - if tgt == "" { - tgt = "pkgpaths" - } - td, err := ioutil.TempDir("", tgt) - if err != nil { - return "", "", err - } - td2, err := ioutil.TempDir("", tgt+"-2") - if err != nil { - return "", "", err - } - realPath := filepath.Join(td, "src", "foo", "bar") - if err := os.MkdirAll(realPath, os.ModePerm); err != nil { - return "", "", err - } - linkPathBase := filepath.Join(td, "src", "baz") - if err := os.MkdirAll(linkPathBase, os.ModePerm); err != nil { - return "", "", err - } - linkPath := filepath.Join(linkPathBase, "das") - if err := os.Symlink(realPath, linkPath); err != nil { - return "", "", err - } - - realPath = filepath.Join(td2, "src", "fuu", "bir") - if err := os.MkdirAll(realPath, os.ModePerm); err != nil { - return "", "", err - } - linkPathBase = filepath.Join(td2, "src", "biz") - if err := os.MkdirAll(linkPathBase, os.ModePerm); err != nil { - return "", "", err - } - linkPath = filepath.Join(linkPathBase, "dis") - if err := os.Symlink(realPath, linkPath); err != nil { - return "", "", err - } - return td, td2, nil -} - -func TestFindPackage(t *testing.T) { - pth, pth2, err := makeDirStructure("") - if err != nil { - t.Fatal(err) - } - defer func() { - os.RemoveAll(pth) - os.RemoveAll(pth2) - }() - - searchPath := pth + string(filepath.ListSeparator) + pth2 - // finds package when real name mentioned - pkg := FindInSearchPath(searchPath, "foo/bar") - assert.NotEmpty(t, pkg) - assertPath(t, path.Join(pth, "src", "foo", "bar"), pkg) - // finds package when real name is mentioned in secondary - pkg = FindInSearchPath(searchPath, "fuu/bir") - assert.NotEmpty(t, pkg) - assertPath(t, path.Join(pth2, "src", "fuu", "bir"), pkg) - // finds package when symlinked - pkg = FindInSearchPath(searchPath, "baz/das") - assert.NotEmpty(t, pkg) - assertPath(t, path.Join(pth, "src", "foo", "bar"), pkg) - // finds package when symlinked in secondary - pkg = FindInSearchPath(searchPath, "biz/dis") - assert.NotEmpty(t, pkg) - assertPath(t, path.Join(pth2, "src", "fuu", "bir"), pkg) - // return empty string when nothing is found - pkg = FindInSearchPath(searchPath, "not/there") - assert.Empty(t, pkg) -} - -func assertPath(t testing.TB, expected, actual string) bool { - fp, err := filepath.EvalSymlinks(expected) - if assert.NoError(t, err) { - return assert.Equal(t, fp, actual) - } - return true -} - -func TestFullGOPATH(t *testing.T) { - os.Unsetenv(GOPATHKey) - ngp := "/some/where:/other/place" - os.Setenv(GOPATHKey, ngp) - - ogp := os.Getenv(GOPATHKey) - defer os.Setenv(GOPATHKey, ogp) - - expected := ngp + ":" + runtime.GOROOT() - assert.Equal(t, expected, FullGoSearchPath()) -} diff --git a/vendor/github.com/go-openapi/swag/post_go18.go b/vendor/github.com/go-openapi/swag/post_go18.go deleted file mode 100644 index ef48086d..00000000 --- a/vendor/github.com/go-openapi/swag/post_go18.go +++ /dev/null @@ -1,9 +0,0 @@ -// +build go1.8 - -package swag - -import "net/url" - -func pathUnescape(path string) (string, error) { - return url.PathUnescape(path) -} diff --git a/vendor/github.com/go-openapi/swag/post_go19.go b/vendor/github.com/go-openapi/swag/post_go19.go deleted file mode 100644 index 567680c7..00000000 --- a/vendor/github.com/go-openapi/swag/post_go19.go +++ /dev/null @@ -1,53 +0,0 @@ -// +build go1.9 - -package swag - -import ( - "sort" - "sync" -) - -// indexOfInitialisms is a thread-safe implementation of the sorted index of initialisms. -// Since go1.9, this may be implemented with sync.Map. -type indexOfInitialisms struct { - sortMutex *sync.Mutex - index *sync.Map -} - -func newIndexOfInitialisms() *indexOfInitialisms { - return &indexOfInitialisms{ - sortMutex: new(sync.Mutex), - index: new(sync.Map), - } -} - -func (m *indexOfInitialisms) load(initial map[string]bool) *indexOfInitialisms { - m.sortMutex.Lock() - defer m.sortMutex.Unlock() - for k, v := range initial { - m.index.Store(k, v) - } - return m -} - -func (m *indexOfInitialisms) isInitialism(key string) bool { - _, ok := m.index.Load(key) - return ok -} - -func (m *indexOfInitialisms) add(key string) *indexOfInitialisms { - m.index.Store(key, true) - return m -} - -func (m *indexOfInitialisms) sorted() (result []string) { - m.sortMutex.Lock() - defer m.sortMutex.Unlock() - m.index.Range(func(key, value interface{}) bool { - k := key.(string) - result = append(result, k) - return true - }) - sort.Sort(sort.Reverse(byLength(result))) - return -} diff --git a/vendor/github.com/go-openapi/swag/pre_go18.go b/vendor/github.com/go-openapi/swag/pre_go18.go deleted file mode 100644 index 860bb2bb..00000000 --- a/vendor/github.com/go-openapi/swag/pre_go18.go +++ /dev/null @@ -1,9 +0,0 @@ -// +build !go1.8 - -package swag - -import "net/url" - -func pathUnescape(path string) (string, error) { - return url.QueryUnescape(path) -} diff --git a/vendor/github.com/go-openapi/swag/pre_go19.go b/vendor/github.com/go-openapi/swag/pre_go19.go deleted file mode 100644 index 72c48ae7..00000000 --- a/vendor/github.com/go-openapi/swag/pre_go19.go +++ /dev/null @@ -1,55 +0,0 @@ -// +build !go1.9 - -package swag - -import ( - "sort" - "sync" -) - -// indexOfInitialisms is a thread-safe implementation of the sorted index of initialisms. -// Before go1.9, this may be implemented with a mutex on the map. -type indexOfInitialisms struct { - getMutex *sync.Mutex - index map[string]bool -} - -func newIndexOfInitialisms() *indexOfInitialisms { - return &indexOfInitialisms{ - getMutex: new(sync.Mutex), - index: make(map[string]bool, 50), - } -} - -func (m *indexOfInitialisms) load(initial map[string]bool) *indexOfInitialisms { - m.getMutex.Lock() - defer m.getMutex.Unlock() - for k, v := range initial { - m.index[k] = v - } - return m -} - -func (m *indexOfInitialisms) isInitialism(key string) bool { - m.getMutex.Lock() - defer m.getMutex.Unlock() - _, ok := m.index[key] - return ok -} - -func (m *indexOfInitialisms) add(key string) *indexOfInitialisms { - m.getMutex.Lock() - defer m.getMutex.Unlock() - m.index[key] = true - return m -} - -func (m *indexOfInitialisms) sorted() (result []string) { - m.getMutex.Lock() - defer m.getMutex.Unlock() - for k := range m.index { - result = append(result, k) - } - sort.Sort(sort.Reverse(byLength(result))) - return -} diff --git a/vendor/github.com/go-openapi/swag/util.go b/vendor/github.com/go-openapi/swag/util.go deleted file mode 100644 index e659968f..00000000 --- a/vendor/github.com/go-openapi/swag/util.go +++ /dev/null @@ -1,405 +0,0 @@ -// 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 swag - -import ( - "math" - "reflect" - "regexp" - "strings" - "sync" - "unicode" -) - -// commonInitialisms are common acronyms that are kept as whole uppercased words. -var commonInitialisms *indexOfInitialisms - -// initialisms is a slice of sorted initialisms -var initialisms []string - -var once sync.Once - -var isInitialism func(string) bool - -func init() { - // Taken from https://github.com/golang/lint/blob/3390df4df2787994aea98de825b964ac7944b817/lint.go#L732-L769 - var configuredInitialisms = map[string]bool{ - "ACL": true, - "API": true, - "ASCII": true, - "CPU": true, - "CSS": true, - "DNS": true, - "EOF": true, - "GUID": true, - "HTML": true, - "HTTPS": true, - "HTTP": true, - "ID": true, - "IP": true, - "JSON": true, - "LHS": true, - "OAI": true, - "QPS": true, - "RAM": true, - "RHS": true, - "RPC": true, - "SLA": true, - "SMTP": true, - "SQL": true, - "SSH": true, - "TCP": true, - "TLS": true, - "TTL": true, - "UDP": true, - "UI": true, - "UID": true, - "UUID": true, - "URI": true, - "URL": true, - "UTF8": true, - "VM": true, - "XML": true, - "XMPP": true, - "XSRF": true, - "XSS": true, - } - - // a thread-safe index of initialisms - commonInitialisms = newIndexOfInitialisms().load(configuredInitialisms) - - // a test function - isInitialism = commonInitialisms.isInitialism -} - -func ensureSorted() { - initialisms = commonInitialisms.sorted() -} - -const ( - //collectionFormatComma = "csv" - collectionFormatSpace = "ssv" - collectionFormatTab = "tsv" - collectionFormatPipe = "pipes" - collectionFormatMulti = "multi" -) - -// JoinByFormat joins a string array by a known format (e.g. swagger's collectionFormat attribute): -// ssv: space separated value -// tsv: tab separated value -// pipes: pipe (|) separated value -// csv: comma separated value (default) -func JoinByFormat(data []string, format string) []string { - if len(data) == 0 { - return data - } - var sep string - switch format { - case collectionFormatSpace: - sep = " " - case collectionFormatTab: - sep = "\t" - case collectionFormatPipe: - sep = "|" - case collectionFormatMulti: - return data - default: - sep = "," - } - return []string{strings.Join(data, sep)} -} - -// SplitByFormat splits a string by a known format: -// ssv: space separated value -// tsv: tab separated value -// pipes: pipe (|) separated value -// csv: comma separated value (default) -// -func SplitByFormat(data, format string) []string { - if data == "" { - return nil - } - var sep string - switch format { - case collectionFormatSpace: - sep = " " - case collectionFormatTab: - sep = "\t" - case collectionFormatPipe: - sep = "|" - case collectionFormatMulti: - return nil - default: - sep = "," - } - var result []string - for _, s := range strings.Split(data, sep) { - if ts := strings.TrimSpace(s); ts != "" { - result = append(result, ts) - } - } - return result -} - -type byLength []string - -func (s byLength) Len() int { - return len(s) -} -func (s byLength) Swap(i, j int) { - s[i], s[j] = s[j], s[i] -} -func (s byLength) Less(i, j int) bool { - return len(s[i]) < len(s[j]) -} - -// Prepares strings by splitting by caps, spaces, dashes, and underscore -func split(str string) []string { - repl := strings.NewReplacer( - "@", "At ", - "&", "And ", - "|", "Pipe ", - "$", "Dollar ", - "!", "Bang ", - "-", " ", - "_", " ", - ) - - rex1 := regexp.MustCompile(`(\p{Lu})`) - rex2 := regexp.MustCompile(`(\pL|\pM|\pN|\p{Pc})+`) - - str = trim(str) - - // Convert dash and underscore to spaces - str = repl.Replace(str) - - // Split when uppercase is found (needed for Snake) - str = rex1.ReplaceAllString(str, " $1") - - // check if consecutive single char things make up an initialism - once.Do(ensureSorted) - for _, k := range initialisms { - str = strings.Replace(str, rex1.ReplaceAllString(k, " $1"), " "+k, -1) - } - // Get the final list of words - //words = rex2.FindAllString(str, -1) - return rex2.FindAllString(str, -1) -} - -// Removes leading whitespaces -func trim(str string) string { - return strings.Trim(str, " ") -} - -// Shortcut to strings.ToUpper() -func upper(str string) string { - return strings.ToUpper(trim(str)) -} - -// Shortcut to strings.ToLower() -func lower(str string) string { - return strings.ToLower(trim(str)) -} - -// Camelize an uppercased word -func Camelize(word string) (camelized string) { - for pos, ru := range word { - if pos > 0 { - camelized += string(unicode.ToLower(ru)) - } else { - camelized += string(unicode.ToUpper(ru)) - } - } - return -} - -// ToFileName lowercases and underscores a go type name -func ToFileName(name string) string { - in := split(name) - out := make([]string, 0, len(in)) - - for _, w := range in { - out = append(out, lower(w)) - } - - return strings.Join(out, "_") -} - -// ToCommandName lowercases and underscores a go type name -func ToCommandName(name string) string { - in := split(name) - out := make([]string, 0, len(in)) - - for _, w := range in { - out = append(out, lower(w)) - } - return strings.Join(out, "-") -} - -// ToHumanNameLower represents a code name as a human series of words -func ToHumanNameLower(name string) string { - in := split(name) - out := make([]string, 0, len(in)) - - for _, w := range in { - if !isInitialism(upper(w)) { - out = append(out, lower(w)) - } else { - out = append(out, w) - } - } - return strings.Join(out, " ") -} - -// ToHumanNameTitle represents a code name as a human series of words with the first letters titleized -func ToHumanNameTitle(name string) string { - in := split(name) - out := make([]string, 0, len(in)) - - for _, w := range in { - uw := upper(w) - if !isInitialism(uw) { - out = append(out, upper(w[:1])+lower(w[1:])) - } else { - out = append(out, w) - } - } - return strings.Join(out, " ") -} - -// ToJSONName camelcases a name which can be underscored or pascal cased -func ToJSONName(name string) string { - in := split(name) - out := make([]string, 0, len(in)) - - for i, w := range in { - if i == 0 { - out = append(out, lower(w)) - continue - } - out = append(out, upper(w[:1])+lower(w[1:])) - } - return strings.Join(out, "") -} - -// ToVarName camelcases a name which can be underscored or pascal cased -func ToVarName(name string) string { - res := ToGoName(name) - if isInitialism(res) { - return lower(res) - } - if len(res) <= 1 { - return lower(res) - } - return lower(res[:1]) + res[1:] -} - -// ToGoName translates a swagger name which can be underscored or camel cased to a name that golint likes -func ToGoName(name string) string { - in := split(name) - out := make([]string, 0, len(in)) - - for _, w := range in { - uw := upper(w) - mod := int(math.Min(float64(len(uw)), 2)) - if !isInitialism(uw) && !isInitialism(uw[:len(uw)-mod]) { - uw = upper(w[:1]) + lower(w[1:]) - } - out = append(out, uw) - } - - result := strings.Join(out, "") - if len(result) > 0 { - ud := upper(result[:1]) - ru := []rune(ud) - if unicode.IsUpper(ru[0]) { - result = ud + result[1:] - } else { - result = "X" + ud + result[1:] - } - } - return result -} - -// ContainsStrings searches a slice of strings for a case-sensitive match -func ContainsStrings(coll []string, item string) bool { - for _, a := range coll { - if a == item { - return true - } - } - return false -} - -// ContainsStringsCI searches a slice of strings for a case-insensitive match -func ContainsStringsCI(coll []string, item string) bool { - for _, a := range coll { - if strings.EqualFold(a, item) { - return true - } - } - return false -} - -type zeroable interface { - IsZero() bool -} - -// IsZero returns true when the value passed into the function is a zero value. -// This allows for safer checking of interface values. -func IsZero(data interface{}) bool { - // check for things that have an IsZero method instead - if vv, ok := data.(zeroable); ok { - return vv.IsZero() - } - // continue with slightly more complex reflection - v := reflect.ValueOf(data) - switch v.Kind() { - case reflect.String: - return v.Len() == 0 - case reflect.Bool: - return !v.Bool() - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return v.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return v.Uint() == 0 - case reflect.Float32, reflect.Float64: - return v.Float() == 0 - case reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice: - return v.IsNil() - case reflect.Struct, reflect.Array: - return reflect.DeepEqual(data, reflect.Zero(v.Type()).Interface()) - case reflect.Invalid: - return true - } - return false -} - -// AddInitialisms add additional initialisms -func AddInitialisms(words ...string) { - for _, word := range words { - //commonInitialisms[upper(word)] = true - commonInitialisms.add(upper(word)) - } - // sort again - initialisms = commonInitialisms.sorted() -} - -// CommandLineOptionsGroup represents a group of user-defined command line options -type CommandLineOptionsGroup struct { - ShortDescription string - LongDescription string - Options interface{} -} diff --git a/vendor/github.com/go-openapi/swag/util_test.go b/vendor/github.com/go-openapi/swag/util_test.go deleted file mode 100644 index fa633602..00000000 --- a/vendor/github.com/go-openapi/swag/util_test.go +++ /dev/null @@ -1,375 +0,0 @@ -// 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 swag - -import ( - "fmt" - "strings" - "testing" - "time" - - "github.com/stretchr/testify/assert" -) - -type translationSample struct { - str, out string -} - -func titleize(s string) string { return strings.ToTitle(s[:1]) + lower(s[1:]) } - -func init() { - AddInitialisms("elb", "cap", "capwd", "wd") -} - -func TestToGoName(t *testing.T) { - samples := []translationSample{ - {"sample text", "SampleText"}, - {"sample-text", "SampleText"}, - {"sample_text", "SampleText"}, - {"sampleText", "SampleText"}, - {"sample 2 Text", "Sample2Text"}, - {"findThingById", "FindThingByID"}, - {"日本語sample 2 Text", "X日本語sample2Text"}, - {"日本語findThingById", "X日本語findThingByID"}, - {"findTHINGSbyID", "FindTHINGSbyID"}, - } - - for _, k := range commonInitialisms.sorted() { - samples = append(samples, - translationSample{"sample " + lower(k) + " text", "Sample" + k + "Text"}, - translationSample{"sample-" + lower(k) + "-text", "Sample" + k + "Text"}, - translationSample{"sample_" + lower(k) + "_text", "Sample" + k + "Text"}, - translationSample{"sample" + titleize(k) + "Text", "Sample" + k + "Text"}, - translationSample{"sample " + lower(k), "Sample" + k}, - translationSample{"sample-" + lower(k), "Sample" + k}, - translationSample{"sample_" + lower(k), "Sample" + k}, - translationSample{"sample" + titleize(k), "Sample" + k}, - translationSample{"sample " + titleize(k) + " text", "Sample" + k + "Text"}, - translationSample{"sample-" + titleize(k) + "-text", "Sample" + k + "Text"}, - translationSample{"sample_" + titleize(k) + "_text", "Sample" + k + "Text"}, - ) - } - - for _, sample := range samples { - assert.Equal(t, sample.out, ToGoName(sample.str)) - } -} - -func TestContainsStringsCI(t *testing.T) { - list := []string{"hello", "world", "and", "such"} - - assert.True(t, ContainsStringsCI(list, "hELLo")) - assert.True(t, ContainsStringsCI(list, "world")) - assert.True(t, ContainsStringsCI(list, "AND")) - assert.False(t, ContainsStringsCI(list, "nuts")) -} - -func TestContainsStrings(t *testing.T) { - list := []string{"hello", "world", "and", "such"} - - assert.True(t, ContainsStrings(list, "hello")) - assert.False(t, ContainsStrings(list, "hELLo")) - assert.True(t, ContainsStrings(list, "world")) - assert.False(t, ContainsStrings(list, "World")) - assert.True(t, ContainsStrings(list, "and")) - assert.False(t, ContainsStrings(list, "AND")) - assert.False(t, ContainsStrings(list, "nuts")) -} - -const ( - collectionFormatComma = "csv" -) - -func TestSplitByFormat(t *testing.T) { - expected := []string{"one", "two", "three"} - for _, fmt := range []string{collectionFormatComma, collectionFormatPipe, collectionFormatTab, collectionFormatSpace, collectionFormatMulti} { - - var actual []string - switch fmt { - case collectionFormatMulti: - assert.Nil(t, SplitByFormat("", fmt)) - assert.Nil(t, SplitByFormat("blah", fmt)) - case collectionFormatSpace: - actual = SplitByFormat(strings.Join(expected, " "), fmt) - assert.EqualValues(t, expected, actual) - case collectionFormatPipe: - actual = SplitByFormat(strings.Join(expected, "|"), fmt) - assert.EqualValues(t, expected, actual) - case collectionFormatTab: - actual = SplitByFormat(strings.Join(expected, "\t"), fmt) - assert.EqualValues(t, expected, actual) - default: - actual = SplitByFormat(strings.Join(expected, ","), fmt) - assert.EqualValues(t, expected, actual) - } - } -} - -func TestJoinByFormat(t *testing.T) { - for _, fmt := range []string{collectionFormatComma, collectionFormatPipe, collectionFormatTab, collectionFormatSpace, collectionFormatMulti} { - - lval := []string{"one", "two", "three"} - var expected []string - switch fmt { - case collectionFormatMulti: - expected = lval - case collectionFormatSpace: - expected = []string{strings.Join(lval, " ")} - case collectionFormatPipe: - expected = []string{strings.Join(lval, "|")} - case collectionFormatTab: - expected = []string{strings.Join(lval, "\t")} - default: - expected = []string{strings.Join(lval, ",")} - } - assert.Nil(t, JoinByFormat(nil, fmt)) - assert.EqualValues(t, expected, JoinByFormat(lval, fmt)) - } -} - -func TestToFileName(t *testing.T) { - samples := []translationSample{ - {"SampleText", "sample_text"}, - {"FindThingByID", "find_thing_by_id"}, - {"CAPWD.folwdBylc", "capwd_folwd_bylc"}, - {"CAPWDfolwdBylc", "capwdfolwd_bylc"}, - {"CAP_WD_folwdBylc", "cap_wd_folwd_bylc"}, - {"TypeOAI_alias", "type_oai_alias"}, - {"Type_OAI_alias", "type_oai_alias"}, - {"Type_OAIAlias", "type_oai_alias"}, - {"ELB.HTTPLoadBalancer", "elb_http_load_balancer"}, - {"elbHTTPLoadBalancer", "elb_http_load_balancer"}, - {"ELBHTTPLoadBalancer", "elb_http_load_balancer"}, - } - for _, k := range commonInitialisms.sorted() { - samples = append(samples, - translationSample{"Sample" + k + "Text", "sample_" + lower(k) + "_text"}, - ) - } - - for _, sample := range samples { - assert.Equal(t, sample.out, ToFileName(sample.str)) - } -} - -func TestToCommandName(t *testing.T) { - samples := []translationSample{ - {"SampleText", "sample-text"}, - {"FindThingByID", "find-thing-by-id"}, - {"elbHTTPLoadBalancer", "elb-http-load-balancer"}, - } - - for _, k := range commonInitialisms.sorted() { - samples = append(samples, - translationSample{"Sample" + k + "Text", "sample-" + lower(k) + "-text"}, - ) - } - - for _, sample := range samples { - assert.Equal(t, sample.out, ToCommandName(sample.str)) - } -} - -func TestToHumanName(t *testing.T) { - samples := []translationSample{ - {"SampleText", "sample text"}, - {"FindThingByID", "find thing by ID"}, - {"elbHTTPLoadBalancer", "elb HTTP load balancer"}, - } - - for _, k := range commonInitialisms.sorted() { - samples = append(samples, - translationSample{"Sample" + k + "Text", "sample " + k + " text"}, - ) - } - - for _, sample := range samples { - assert.Equal(t, sample.out, ToHumanNameLower(sample.str)) - } -} - -func TestToJSONName(t *testing.T) { - samples := []translationSample{ - {"SampleText", "sampleText"}, - {"FindThingByID", "findThingById"}, - {"elbHTTPLoadBalancer", "elbHttpLoadBalancer"}, - } - - for _, k := range commonInitialisms.sorted() { - samples = append(samples, - translationSample{"Sample" + k + "Text", "sample" + titleize(k) + "Text"}, - ) - } - - for _, sample := range samples { - assert.Equal(t, sample.out, ToJSONName(sample.str)) - } -} - -type SimpleZeroes struct { - ID string - Name string -} -type ZeroesWithTime struct { - Time time.Time -} - -func TestIsZero(t *testing.T) { - var strs [5]string - var strss []string - var a int - var b int8 - var c int16 - var d int32 - var e int64 - var f uint - var g uint8 - var h uint16 - var i uint32 - var j uint64 - var k map[string]string - var l interface{} - var m *SimpleZeroes - var n string - var o SimpleZeroes - var p ZeroesWithTime - var q time.Time - data := []struct { - Data interface{} - Expected bool - }{ - {a, true}, - {b, true}, - {c, true}, - {d, true}, - {e, true}, - {f, true}, - {g, true}, - {h, true}, - {i, true}, - {j, true}, - {k, true}, - {l, true}, - {m, true}, - {n, true}, - {o, true}, - {p, true}, - {q, true}, - {strss, true}, - {strs, true}, - {"", true}, - {nil, true}, - {1, false}, - {0, true}, - {int8(1), false}, - {int8(0), true}, - {int16(1), false}, - {int16(0), true}, - {int32(1), false}, - {int32(0), true}, - {int64(1), false}, - {int64(0), true}, - {uint(1), false}, - {uint(0), true}, - {uint8(1), false}, - {uint8(0), true}, - {uint16(1), false}, - {uint16(0), true}, - {uint32(1), false}, - {uint32(0), true}, - {uint64(1), false}, - {uint64(0), true}, - {0.0, true}, - {0.1, false}, - {float32(0.0), true}, - {float32(0.1), false}, - {float64(0.0), true}, - {float64(0.1), false}, - {[...]string{}, true}, - {[...]string{"hello"}, false}, - {[]string(nil), true}, - {[]string{"a"}, false}, - } - - for _, it := range data { - assert.Equal(t, it.Expected, IsZero(it.Data), fmt.Sprintf("%#v", it.Data)) - } -} - -func TestCamelize(t *testing.T) { - samples := []translationSample{ - {"SampleText", "Sampletext"}, - {"FindThingByID", "Findthingbyid"}, - {"CAPWD.folwdBylc", "Capwd.folwdbylc"}, - {"CAPWDfolwdBylc", "Capwdfolwdbylc"}, - {"CAP_WD_folwdBylc", "Cap_wd_folwdbylc"}, - {"TypeOAI_alias", "Typeoai_alias"}, - {"Type_OAI_alias", "Type_oai_alias"}, - {"Type_OAIAlias", "Type_oaialias"}, - {"ELB.HTTPLoadBalancer", "Elb.httploadbalancer"}, - {"elbHTTPLoadBalancer", "Elbhttploadbalancer"}, - {"ELBHTTPLoadBalancer", "Elbhttploadbalancer"}, - } - - for _, sample := range samples { - res := Camelize(sample.str) - assert.Equalf(t, sample.out, res, "expected Camelize(%q)=%q, got %q", sample.str, sample.out, res) - } -} - -func TestToHumanNameTitle(t *testing.T) { - samples := []translationSample{ - {"SampleText", "Sample Text"}, - {"FindThingByID", "Find Thing By ID"}, - {"CAPWD.folwdBylc", "CAPWD Folwd Bylc"}, - {"CAPWDfolwdBylc", "Capwdfolwd Bylc"}, - {"CAP_WD_folwdBylc", "CAP WD Folwd Bylc"}, - {"TypeOAI_alias", "Type OAI Alias"}, - {"Type_OAI_alias", "Type OAI Alias"}, - {"Type_OAIAlias", "Type OAI Alias"}, - {"ELB.HTTPLoadBalancer", "ELB HTTP Load Balancer"}, - {"elbHTTPLoadBalancer", "elb HTTP Load Balancer"}, - {"ELBHTTPLoadBalancer", "ELB HTTP Load Balancer"}, - } - - for _, sample := range samples { - res := ToHumanNameTitle(sample.str) - assert.Equalf(t, sample.out, res, "expected ToHumanNameTitle(%q)=%q, got %q", sample.str, sample.out, res) - } -} - -func TestToVarName(t *testing.T) { - samples := []translationSample{ - {"SampleText", "sampleText"}, - {"FindThingByID", "findThingByID"}, - {"CAPWD.folwdBylc", "cAPWDFolwdBylc"}, - {"CAPWDfolwdBylc", "capwdfolwdBylc"}, - {"CAP_WD_folwdBylc", "cAPWDFolwdBylc"}, - {"TypeOAI_alias", "typeOAIAlias"}, - {"Type_OAI_alias", "typeOAIAlias"}, - {"Type_OAIAlias", "typeOAIAlias"}, - {"ELB.HTTPLoadBalancer", "eLBHTTPLoadBalancer"}, - {"elbHTTPLoadBalancer", "eLBHTTPLoadBalancer"}, - {"ELBHTTPLoadBalancer", "eLBHTTPLoadBalancer"}, - {"Id", "id"}, - {"HTTP", "http"}, - {"A", "a"}, - } - - for _, sample := range samples { - res := ToVarName(sample.str) - assert.Equalf(t, sample.out, res, "expected ToVarName(%q)=%q, got %q", sample.str, sample.out, res) - } -} diff --git a/vendor/github.com/go-openapi/swag/yaml.go b/vendor/github.com/go-openapi/swag/yaml.go deleted file mode 100644 index f458c81a..00000000 --- a/vendor/github.com/go-openapi/swag/yaml.go +++ /dev/null @@ -1,228 +0,0 @@ -// 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 swag - -import ( - "encoding/json" - "fmt" - "path/filepath" - "strconv" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" - - yaml "gopkg.in/yaml.v2" -) - -// YAMLMatcher matches yaml -func YAMLMatcher(path string) bool { - ext := filepath.Ext(path) - return ext == ".yaml" || ext == ".yml" -} - -// YAMLToJSON converts YAML unmarshaled data into json compatible data -func YAMLToJSON(data interface{}) (json.RawMessage, error) { - jm, err := transformData(data) - if err != nil { - return nil, err - } - b, err := WriteJSON(jm) - return json.RawMessage(b), err -} - -// BytesToYAMLDoc converts a byte slice into a YAML document -func BytesToYAMLDoc(data []byte) (interface{}, error) { - var canary map[interface{}]interface{} // validate this is an object and not a different type - if err := yaml.Unmarshal(data, &canary); err != nil { - return nil, err - } - - var document yaml.MapSlice // preserve order that is present in the document - if err := yaml.Unmarshal(data, &document); err != nil { - return nil, err - } - return document, nil -} - -// JSONMapSlice represent a JSON object, with the order of keys maintained -type JSONMapSlice []JSONMapItem - -// MarshalJSON renders a JSONMapSlice as JSON -func (s JSONMapSlice) MarshalJSON() ([]byte, error) { - w := &jwriter.Writer{Flags: jwriter.NilMapAsEmpty | jwriter.NilSliceAsEmpty} - s.MarshalEasyJSON(w) - return w.BuildBytes() -} - -// MarshalEasyJSON renders a JSONMapSlice as JSON, using easyJSON -func (s JSONMapSlice) MarshalEasyJSON(w *jwriter.Writer) { - w.RawByte('{') - - ln := len(s) - last := ln - 1 - for i := 0; i < ln; i++ { - s[i].MarshalEasyJSON(w) - if i != last { // last item - w.RawByte(',') - } - } - - w.RawByte('}') -} - -// UnmarshalJSON makes a JSONMapSlice from JSON -func (s *JSONMapSlice) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - s.UnmarshalEasyJSON(&l) - return l.Error() -} - -// UnmarshalEasyJSON makes a JSONMapSlice from JSON, using easyJSON -func (s *JSONMapSlice) UnmarshalEasyJSON(in *jlexer.Lexer) { - if in.IsNull() { - in.Skip() - return - } - - var result JSONMapSlice - in.Delim('{') - for !in.IsDelim('}') { - var mi JSONMapItem - mi.UnmarshalEasyJSON(in) - result = append(result, mi) - } - *s = result -} - -// JSONMapItem represents the value of a key in a JSON object held by JSONMapSlice -type JSONMapItem struct { - Key string - Value interface{} -} - -// MarshalJSON renders a JSONMapItem as JSON -func (s JSONMapItem) MarshalJSON() ([]byte, error) { - w := &jwriter.Writer{Flags: jwriter.NilMapAsEmpty | jwriter.NilSliceAsEmpty} - s.MarshalEasyJSON(w) - return w.BuildBytes() -} - -// MarshalEasyJSON renders a JSONMapItem as JSON, using easyJSON -func (s JSONMapItem) MarshalEasyJSON(w *jwriter.Writer) { - w.String(s.Key) - w.RawByte(':') - w.Raw(WriteJSON(s.Value)) -} - -// UnmarshalJSON makes a JSONMapItem from JSON -func (s *JSONMapItem) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - s.UnmarshalEasyJSON(&l) - return l.Error() -} - -// UnmarshalEasyJSON makes a JSONMapItem from JSON, using easyJSON -func (s *JSONMapItem) UnmarshalEasyJSON(in *jlexer.Lexer) { - key := in.UnsafeString() - in.WantColon() - value := in.Interface() - in.WantComma() - s.Key = key - s.Value = value -} - -func transformData(input interface{}) (out interface{}, err error) { - switch in := input.(type) { - case yaml.MapSlice: - - o := make(JSONMapSlice, len(in)) - for i, mi := range in { - var nmi JSONMapItem - switch k := mi.Key.(type) { - case string: - nmi.Key = k - case int: - nmi.Key = strconv.Itoa(k) - default: - return nil, fmt.Errorf("types don't match expect map key string or int got: %T", mi.Key) - } - - v, ert := transformData(mi.Value) - if ert != nil { - return nil, ert - } - nmi.Value = v - o[i] = nmi - } - return o, nil - case map[interface{}]interface{}: - o := make(JSONMapSlice, 0, len(in)) - for ke, va := range in { - var nmi JSONMapItem - switch k := ke.(type) { - case string: - nmi.Key = k - case int: - nmi.Key = strconv.Itoa(k) - default: - return nil, fmt.Errorf("types don't match expect map key string or int got: %T", ke) - } - - v, ert := transformData(va) - if ert != nil { - return nil, ert - } - nmi.Value = v - o = append(o, nmi) - } - return o, nil - case []interface{}: - len1 := len(in) - o := make([]interface{}, len1) - for i := 0; i < len1; i++ { - o[i], err = transformData(in[i]) - if err != nil { - return nil, err - } - } - return o, nil - } - return input, nil -} - -// YAMLDoc loads a yaml document from either http or a file and converts it to json -func YAMLDoc(path string) (json.RawMessage, error) { - yamlDoc, err := YAMLData(path) - if err != nil { - return nil, err - } - - data, err := YAMLToJSON(yamlDoc) - if err != nil { - return nil, err - } - - return data, nil -} - -// YAMLData loads a yaml document from either http or a file -func YAMLData(path string) (interface{}, error) { - data, err := LoadFromFileOrHTTP(path) - if err != nil { - return nil, err - } - - return BytesToYAMLDoc(data) -} diff --git a/vendor/github.com/go-openapi/swag/yaml_test.go b/vendor/github.com/go-openapi/swag/yaml_test.go deleted file mode 100644 index b504f0f4..00000000 --- a/vendor/github.com/go-openapi/swag/yaml_test.go +++ /dev/null @@ -1,445 +0,0 @@ -// 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 swag - -import ( - "encoding/json" - "net/http" - "net/http/httptest" - "testing" - - yaml "gopkg.in/yaml.v2" - - "github.com/stretchr/testify/assert" -) - -/* currently unused: -type failJSONMarshal struct { -} - -func (f failJSONMarshal) MarshalJSON() ([]byte, error) { - return nil, errors.New("expected") -} -*/ - -func TestLoadHTTPBytes(t *testing.T) { - _, err := LoadFromFileOrHTTP("httx://12394:abd") - assert.Error(t, err) - - serv := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - rw.WriteHeader(http.StatusNotFound) - })) - defer serv.Close() - - _, err = LoadFromFileOrHTTP(serv.URL) - assert.Error(t, err) - - ts2 := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - rw.WriteHeader(http.StatusOK) - _, _ = rw.Write([]byte("the content")) - })) - defer ts2.Close() - - d, err := LoadFromFileOrHTTP(ts2.URL) - assert.NoError(t, err) - assert.Equal(t, []byte("the content"), d) -} - -func TestYAMLToJSON(t *testing.T) { - - sd := `--- -1: the int key value -name: a string value -'y': some value -` - var data yaml.MapSlice - _ = yaml.Unmarshal([]byte(sd), &data) - - d, err := YAMLToJSON(data) - if assert.NoError(t, err) { - assert.Equal(t, `{"1":"the int key value","name":"a string value","y":"some value"}`, string(d)) - } - - data = append(data, yaml.MapItem{Key: true, Value: "the bool value"}) - d, err = YAMLToJSON(data) - assert.Error(t, err) - assert.Nil(t, d) - - data = data[:len(data)-1] - - tag := yaml.MapSlice{{Key: "name", Value: "tag name"}} - data = append(data, yaml.MapItem{Key: "tag", Value: tag}) - - d, err = YAMLToJSON(data) - assert.NoError(t, err) - assert.Equal(t, `{"1":"the int key value","name":"a string value","y":"some value","tag":{"name":"tag name"}}`, string(d)) - - tag = yaml.MapSlice{{Key: true, Value: "bool tag name"}} - data = append(data[:len(data)-1], yaml.MapItem{Key: "tag", Value: tag}) - - d, err = YAMLToJSON(data) - assert.Error(t, err) - assert.Nil(t, d) - - var lst []interface{} - lst = append(lst, "hello") - - d, err = YAMLToJSON(lst) - assert.NoError(t, err) - assert.Equal(t, []byte(`["hello"]`), []byte(d)) - - lst = append(lst, data) - - d, err = YAMLToJSON(lst) - assert.Error(t, err) - assert.Nil(t, d) - - // _, err := yamlToJSON(failJSONMarhal{}) - // assert.Error(t, err) - - _, err = BytesToYAMLDoc([]byte("- name: hello\n")) - assert.Error(t, err) - - dd, err := BytesToYAMLDoc([]byte("description: 'object created'\n")) - assert.NoError(t, err) - - d, err = YAMLToJSON(dd) - assert.NoError(t, err) - assert.Equal(t, json.RawMessage(`{"description":"object created"}`), d) -} - -func TestLoadStrategy(t *testing.T) { - - loader := func(p string) ([]byte, error) { - return []byte(yamlPetStore), nil - } - remLoader := func(p string) ([]byte, error) { - return []byte("not it"), nil - } - - ld := LoadStrategy("blah", loader, remLoader) - b, _ := ld("") - assert.Equal(t, []byte(yamlPetStore), b) - - serv := httptest.NewServer(http.HandlerFunc(yamlPestoreServer)) - defer serv.Close() - - s, err := YAMLDoc(serv.URL) - assert.NoError(t, err) - assert.NotNil(t, s) - - ts2 := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - rw.WriteHeader(http.StatusNotFound) - _, _ = rw.Write([]byte("\n")) - })) - defer ts2.Close() - _, err = YAMLDoc(ts2.URL) - assert.Error(t, err) -} - -var yamlPestoreServer = func(rw http.ResponseWriter, r *http.Request) { - rw.WriteHeader(http.StatusOK) - _, _ = rw.Write([]byte(yamlPetStore)) -} - -func TestWithYKey(t *testing.T) { - doc, err := BytesToYAMLDoc([]byte(withYKey)) - if assert.NoError(t, err) { - _, err := YAMLToJSON(doc) - if assert.Error(t, err) { - doc, err := BytesToYAMLDoc([]byte(withQuotedYKey)) - if assert.NoError(t, err) { - jsond, err := YAMLToJSON(doc) - if assert.NoError(t, err) { - var yt struct { - Definitions struct { - Viewbox struct { - Properties struct { - Y struct { - Type string `json:"type"` - } `json:"y"` - } `json:"properties"` - } `json:"viewbox"` - } `json:"definitions"` - } - if assert.NoError(t, json.Unmarshal(jsond, &yt)) { - assert.Equal(t, "integer", yt.Definitions.Viewbox.Properties.Y.Type) - } - } - } - } - - } -} - -const withQuotedYKey = `consumes: -- application/json -definitions: - viewBox: - type: object - properties: - x: - type: integer - format: int16 - # y -> types don't match: expect map key string or int get: bool - "y": - type: integer - format: int16 - width: - type: integer - format: int16 - height: - type: integer - format: int16 -info: - description: Test RESTful APIs - title: Test Server - version: 1.0.0 -basePath: /api -paths: - /test: - get: - operationId: findAll - parameters: - - name: since - in: query - type: integer - format: int64 - - name: limit - in: query - type: integer - format: int32 - default: 20 - responses: - 200: - description: Array[Trigger] - schema: - type: array - items: - $ref: "#/definitions/viewBox" -produces: -- application/json -schemes: -- https -swagger: "2.0" -` - -const withYKey = `consumes: -- application/json -definitions: - viewBox: - type: object - properties: - x: - type: integer - format: int16 - # y -> types don't match: expect map key string or int get: bool - y: - type: integer - format: int16 - width: - type: integer - format: int16 - height: - type: integer - format: int16 -info: - description: Test RESTful APIs - title: Test Server - version: 1.0.0 -basePath: /api -paths: - /test: - get: - operationId: findAll - parameters: - - name: since - in: query - type: integer - format: int64 - - name: limit - in: query - type: integer - format: int32 - default: 20 - responses: - 200: - description: Array[Trigger] - schema: - type: array - items: - $ref: "#/definitions/viewBox" -produces: -- application/json -schemes: -- https -swagger: "2.0" -` - -const yamlPetStore = `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: Swagger API team - email: foo@example.com - url: http://swagger.io - license: - name: MIT - url: http://opensource.org/licenses/MIT -host: petstore.swagger.wordnik.com -basePath: /api -schemes: - - http -consumes: - - application/json -produces: - - application/json -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/newPet' - responses: - '200': - description: pet response - schema: - $ref: '#/definitions/pet' - 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: - - name: id - in: path - description: ID of pet to fetch - required: true - type: integer - format: int64 - responses: - '200': - description: pet response - schema: - $ref: '#/definitions/pet' - default: - description: unexpected error - schema: - $ref: '#/definitions/errorModel' - delete: - description: deletes a single pet based on the ID supplied - 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/errorModel' -definitions: - pet: - required: - - id - - name - properties: - id: - type: integer - format: int64 - name: - type: string - tag: - type: string - newPet: - allOf: - - $ref: '#/definitions/pet' - - required: - - name - properties: - id: - type: integer - format: int64 - name: - type: string - errorModel: - required: - - code - - message - properties: - code: - type: integer - format: int32 - message: - type: string -` diff --git a/vendor/github.com/mailru/easyjson/.gitignore b/vendor/github.com/mailru/easyjson/.gitignore deleted file mode 100644 index 26156fb4..00000000 --- a/vendor/github.com/mailru/easyjson/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -.root -*_easyjson.go -*.iml -.idea -*.swp diff --git a/vendor/github.com/mailru/easyjson/.travis.yml b/vendor/github.com/mailru/easyjson/.travis.yml deleted file mode 100644 index 884f8bbd..00000000 --- a/vendor/github.com/mailru/easyjson/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: go - -go: - - tip -install: - - go get github.com/ugorji/go/codec - - go get github.com/pquerna/ffjson/fflib/v1 - - go get github.com/json-iterator/go - - go get github.com/golang/lint/golint diff --git a/vendor/github.com/mailru/easyjson/LICENSE b/vendor/github.com/mailru/easyjson/LICENSE deleted file mode 100644 index fbff658f..00000000 --- a/vendor/github.com/mailru/easyjson/LICENSE +++ /dev/null @@ -1,7 +0,0 @@ -Copyright (c) 2016 Mail.Ru Group - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/mailru/easyjson/Makefile b/vendor/github.com/mailru/easyjson/Makefile deleted file mode 100644 index 7cfec87b..00000000 --- a/vendor/github.com/mailru/easyjson/Makefile +++ /dev/null @@ -1,61 +0,0 @@ -PKG=github.com/mailru/easyjson -GOPATH:=$(PWD)/.root:$(GOPATH) -export GOPATH - -all: test - -.root/src/$(PKG): - mkdir -p $@ - for i in $$PWD/* ; do ln -s $$i $@/`basename $$i` ; done - -root: .root/src/$(PKG) - -clean: - rm -rf .root - rm -rf tests/*_easyjson.go - -build: - go build -i -o .root/bin/easyjson $(PKG)/easyjson - -generate: root build - .root/bin/easyjson -stubs \ - .root/src/$(PKG)/tests/snake.go \ - .root/src/$(PKG)/tests/data.go \ - .root/src/$(PKG)/tests/omitempty.go \ - .root/src/$(PKG)/tests/nothing.go \ - .root/src/$(PKG)/tests/named_type.go \ - .root/src/$(PKG)/tests/custom_map_key_type.go \ - .root/src/$(PKG)/tests/embedded_type.go - - .root/bin/easyjson -all .root/src/$(PKG)/tests/data.go - .root/bin/easyjson -all .root/src/$(PKG)/tests/nothing.go - .root/bin/easyjson -all .root/src/$(PKG)/tests/errors.go - .root/bin/easyjson -snake_case .root/src/$(PKG)/tests/snake.go - .root/bin/easyjson -omit_empty .root/src/$(PKG)/tests/omitempty.go - .root/bin/easyjson -build_tags=use_easyjson .root/src/$(PKG)/benchmark/data.go - .root/bin/easyjson .root/src/$(PKG)/tests/nested_easy.go - .root/bin/easyjson .root/src/$(PKG)/tests/named_type.go - .root/bin/easyjson .root/src/$(PKG)/tests/custom_map_key_type.go - .root/bin/easyjson .root/src/$(PKG)/tests/embedded_type.go - .root/bin/easyjson -disallow_unknown_fields .root/src/$(PKG)/tests/disallow_unknown.go - -test: generate root - go test \ - $(PKG)/tests \ - $(PKG)/jlexer \ - $(PKG)/gen \ - $(PKG)/buffer - go test -benchmem -tags use_easyjson -bench . $(PKG)/benchmark - golint -set_exit_status .root/src/$(PKG)/tests/*_easyjson.go - -bench-other: generate root - @go test -benchmem -bench . $(PKG)/benchmark - @go test -benchmem -tags use_ffjson -bench . $(PKG)/benchmark - @go test -benchmem -tags use_jsoniter -bench . $(PKG)/benchmark - @go test -benchmem -tags use_codec -bench . $(PKG)/benchmark - -bench-python: - benchmark/ujson.sh - - -.PHONY: root clean generate test build diff --git a/vendor/github.com/mailru/easyjson/README.md b/vendor/github.com/mailru/easyjson/README.md deleted file mode 100644 index 7fd76865..00000000 --- a/vendor/github.com/mailru/easyjson/README.md +++ /dev/null @@ -1,333 +0,0 @@ -# easyjson [![Build Status](https://travis-ci.org/mailru/easyjson.svg?branch=master)](https://travis-ci.org/mailru/easyjson) [![Go Report Card](https://goreportcard.com/badge/github.com/mailru/easyjson)](https://goreportcard.com/report/github.com/mailru/easyjson) - -Package easyjson provides a fast and easy way to marshal/unmarshal Go structs -to/from JSON without the use of reflection. In performance tests, easyjson -outperforms the standard `encoding/json` package by a factor of 4-5x, and other -JSON encoding packages by a factor of 2-3x. - -easyjson aims to keep generated Go code simple enough so that it can be easily -optimized or fixed. Another goal is to provide users with the ability to -customize the generated code by providing options not available with the -standard `encoding/json` package, such as generating "snake_case" names or -enabling `omitempty` behavior by default. - -## Usage -```sh -# install -go get -u github.com/mailru/easyjson/... - -# run -easyjson -all .go -``` - -The above will generate `_easyjson.go` containing the appropriate marshaler and -unmarshaler funcs for all structs contained in `.go`. - -Please note that easyjson requires a full Go build environment and the `GOPATH` -environment variable to be set. This is because easyjson code generation -invokes `go run` on a temporary file (an approach to code generation borrowed -from [ffjson](https://github.com/pquerna/ffjson)). - -## Options -```txt -Usage of easyjson: - -all - generate marshaler/unmarshalers for all structs in a file - -build_tags string - build tags to add to generated file - -leave_temps - do not delete temporary files - -no_std_marshalers - don't generate MarshalJSON/UnmarshalJSON funcs - -noformat - do not run 'gofmt -w' on output file - -omit_empty - omit empty fields by default - -output_filename string - specify the filename of the output - -pkg - process the whole package instead of just the given file - -snake_case - use snake_case names instead of CamelCase by default - -lower_camel_case - use lowerCamelCase instead of CamelCase by default - -stubs - only generate stubs for marshaler/unmarshaler funcs - -disallow_unknown_fields - return error if some unknown field in json appeared -``` - -Using `-all` will generate marshalers/unmarshalers for all Go structs in the -file. If `-all` is not provided, then only those structs whose preceding -comment starts with `easyjson:json` will have marshalers/unmarshalers -generated. For example: - -```go -//easyjson:json -type A struct {} -``` - -Additional option notes: - -* `-snake_case` tells easyjson to generate snake\_case field names by default - (unless overridden by a field tag). The CamelCase to snake\_case conversion - algorithm should work in most cases (ie, HTTPVersion will be converted to - "http_version"). - -* `-build_tags` will add the specified build tags to generated Go sources. - -## Generated Marshaler/Unmarshaler Funcs - -For Go struct types, easyjson generates the funcs `MarshalEasyJSON` / -`UnmarshalEasyJSON` for marshaling/unmarshaling JSON. In turn, these satisify -the `easyjson.Marshaler` and `easyjson.Unmarshaler` interfaces and when used in -conjunction with `easyjson.Marshal` / `easyjson.Unmarshal` avoid unnecessary -reflection / type assertions during marshaling/unmarshaling to/from JSON for Go -structs. - -easyjson also generates `MarshalJSON` and `UnmarshalJSON` funcs for Go struct -types compatible with the standard `json.Marshaler` and `json.Unmarshaler` -interfaces. Please be aware that using the standard `json.Marshal` / -`json.Unmarshal` for marshaling/unmarshaling will incur a significant -performance penalty when compared to using `easyjson.Marshal` / -`easyjson.Unmarshal`. - -Additionally, easyjson exposes utility funcs that use the `MarshalEasyJSON` and -`UnmarshalEasyJSON` for marshaling/unmarshaling to and from standard readers -and writers. For example, easyjson provides `easyjson.MarshalToHTTPResponseWriter` -which marshals to the standard `http.ResponseWriter`. Please see the [GoDoc -listing](https://godoc.org/github.com/mailru/easyjson) for the full listing of -utility funcs that are available. - -## Controlling easyjson Marshaling and Unmarshaling Behavior - -Go types can provide their own `MarshalEasyJSON` and `UnmarshalEasyJSON` funcs -that satisify the `easyjson.Marshaler` / `easyjson.Unmarshaler` interfaces. -These will be used by `easyjson.Marshal` and `easyjson.Unmarshal` when defined -for a Go type. - -Go types can also satisify the `easyjson.Optional` interface, which allows the -type to define its own `omitempty` logic. - -## Type Wrappers - -easyjson provides additional type wrappers defined in the `easyjson/opt` -package. These wrap the standard Go primitives and in turn satisify the -easyjson interfaces. - -The `easyjson/opt` type wrappers are useful when needing to distinguish between -a missing value and/or when needing to specifying a default value. Type -wrappers allow easyjson to avoid additional pointers and heap allocations and -can significantly increase performance when used properly. - -## Memory Pooling - -easyjson uses a buffer pool that allocates data in increasing chunks from 128 -to 32768 bytes. Chunks of 512 bytes and larger will be reused with the help of -`sync.Pool`. The maximum size of a chunk is bounded to reduce redundant memory -allocation and to allow larger reusable buffers. - -easyjson's custom allocation buffer pool is defined in the `easyjson/buffer` -package, and the default behavior pool behavior can be modified (if necessary) -through a call to `buffer.Init()` prior to any marshaling or unmarshaling. -Please see the [GoDoc listing](https://godoc.org/github.com/mailru/easyjson/buffer) -for more information. - -## Issues, Notes, and Limitations - -* easyjson is still early in its development. As such, there are likely to be - bugs and missing features when compared to `encoding/json`. In the case of a - missing feature or bug, please create a GitHub issue. Pull requests are - welcome! - -* Unlike `encoding/json`, object keys are case-sensitive. Case-insensitive - matching is not currently provided due to the significant performance hit - when doing case-insensitive key matching. In the future, case-insensitive - object key matching may be provided via an option to the generator. - -* easyjson makes use of `unsafe`, which simplifies the code and - provides significant performance benefits by allowing no-copy - conversion from `[]byte` to `string`. That said, `unsafe` is used - only when unmarshaling and parsing JSON, and any `unsafe` operations - / memory allocations done will be safely deallocated by - easyjson. Set the build tag `easyjson_nounsafe` to compile it - without `unsafe`. - -* easyjson is compatible with Google App Engine. The `appengine` build - tag (set by App Engine's environment) will automatically disable the - use of `unsafe`, which is not allowed in App Engine's Standard - Environment. Note that the use with App Engine is still experimental. - -* Floats are formatted using the default precision from Go's `strconv` package. - As such, easyjson will not correctly handle high precision floats when - marshaling/unmarshaling JSON. Note, however, that there are very few/limited - uses where this behavior is not sufficient for general use. That said, a - different package may be needed if precise marshaling/unmarshaling of high - precision floats to/from JSON is required. - -* While unmarshaling, the JSON parser does the minimal amount of work needed to - skip over unmatching parens, and as such full validation is not done for the - entire JSON value being unmarshaled/parsed. - -* Currently there is no true streaming support for encoding/decoding as - typically for many uses/protocols the final, marshaled length of the JSON - needs to be known prior to sending the data. Currently this is not possible - with easyjson's architecture. - -## Benchmarks - -Most benchmarks were done using the example -[13kB example JSON](https://dev.twitter.com/rest/reference/get/search/tweets) -(9k after eliminating whitespace). This example is similar to real-world data, -is well-structured, and contains a healthy variety of different types, making -it ideal for JSON serialization benchmarks. - -Note: - -* For small request benchmarks, an 80 byte portion of the above example was - used. - -* For large request marshaling benchmarks, a struct containing 50 regular - samples was used, making a ~500kB output JSON. - -* Benchmarks are showing the results of easyjson's default behaviour, - which makes use of `unsafe`. - -Benchmarks are available in the repository and can be run by invoking `make`. - -### easyjson vs. encoding/json - -easyjson is roughly 5-6 times faster than the standard `encoding/json` for -unmarshaling, and 3-4 times faster for non-concurrent marshaling. Concurrent -marshaling is 6-7x faster if marshaling to a writer. - -### easyjson vs. ffjson - -easyjson uses the same approach for JSON marshaling as -[ffjson](https://github.com/pquerna/ffjson), but takes a significantly -different approach to lexing and parsing JSON during unmarshaling. This means -easyjson is roughly 2-3x faster for unmarshaling and 1.5-2x faster for -non-concurrent unmarshaling. - -As of this writing, `ffjson` seems to have issues when used concurrently: -specifically, large request pooling hurts `ffjson`'s performance and causes -scalability issues. These issues with `ffjson` can likely be fixed, but as of -writing remain outstanding/known issues with `ffjson`. - -easyjson and `ffjson` have similar performance for small requests, however -easyjson outperforms `ffjson` by roughly 2-5x times for large requests when -used with a writer. - -### easyjson vs. go/codec - -[go/codec](https://github.com/ugorji/go) provides -compile-time helpers for JSON generation. In this case, helpers do not work -like marshalers as they are encoding-independent. - -easyjson is generally 2x faster than `go/codec` for non-concurrent benchmarks -and about 3x faster for concurrent encoding (without marshaling to a writer). - -In an attempt to measure marshaling performance of `go/codec` (as opposed to -allocations/memcpy/writer interface invocations), a benchmark was done with -resetting length of a byte slice rather than resetting the whole slice to nil. -However, the optimization in this exact form may not be applicable in practice, -since the memory is not freed between marshaling operations. - -### easyjson vs 'ujson' python module - -[ujson](https://github.com/esnme/ultrajson) is using C code for parsing, so it -is interesting to see how plain golang compares to that. It is imporant to note -that the resulting object for python is slower to access, since the library -parses JSON object into dictionaries. - -easyjson is slightly faster for unmarshaling and 2-3x faster than `ujson` for -marshaling. - -### Benchmark Results - -`ffjson` results are from February 4th, 2016, using the latest `ffjson` and go1.6. -`go/codec` results are from March 4th, 2016, using the latest `go/codec` and go1.6. - -#### Unmarshaling - -| lib | json size | MB/s | allocs/op | B/op | -|:---------|:----------|-----:|----------:|------:| -| standard | regular | 22 | 218 | 10229 | -| standard | small | 9.7 | 14 | 720 | -| | | | | | -| easyjson | regular | 125 | 128 | 9794 | -| easyjson | small | 67 | 3 | 128 | -| | | | | | -| ffjson | regular | 66 | 141 | 9985 | -| ffjson | small | 17.6 | 10 | 488 | -| | | | | | -| codec | regular | 55 | 434 | 19299 | -| codec | small | 29 | 7 | 336 | -| | | | | | -| ujson | regular | 103 | N/A | N/A | - -#### Marshaling, one goroutine. - -| lib | json size | MB/s | allocs/op | B/op | -|:----------|:----------|-----:|----------:|------:| -| standard | regular | 75 | 9 | 23256 | -| standard | small | 32 | 3 | 328 | -| standard | large | 80 | 17 | 1.2M | -| | | | | | -| easyjson | regular | 213 | 9 | 10260 | -| easyjson* | regular | 263 | 8 | 742 | -| easyjson | small | 125 | 1 | 128 | -| easyjson | large | 212 | 33 | 490k | -| easyjson* | large | 262 | 25 | 2879 | -| | | | | | -| ffjson | regular | 122 | 153 | 21340 | -| ffjson** | regular | 146 | 152 | 4897 | -| ffjson | small | 36 | 5 | 384 | -| ffjson** | small | 64 | 4 | 128 | -| ffjson | large | 134 | 7317 | 818k | -| ffjson** | large | 125 | 7320 | 827k | -| | | | | | -| codec | regular | 80 | 17 | 33601 | -| codec*** | regular | 108 | 9 | 1153 | -| codec | small | 42 | 3 | 304 | -| codec*** | small | 56 | 1 | 48 | -| codec | large | 73 | 483 | 2.5M | -| codec*** | large | 103 | 451 | 66007 | -| | | | | | -| ujson | regular | 92 | N/A | N/A | - -\* marshaling to a writer, -\*\* using `ffjson.Pool()`, -\*\*\* reusing output slice instead of resetting it to nil - -#### Marshaling, concurrent. - -| lib | json size | MB/s | allocs/op | B/op | -|:----------|:----------|-----:|----------:|------:| -| standard | regular | 252 | 9 | 23257 | -| standard | small | 124 | 3 | 328 | -| standard | large | 289 | 17 | 1.2M | -| | | | | | -| easyjson | regular | 792 | 9 | 10597 | -| easyjson* | regular | 1748 | 8 | 779 | -| easyjson | small | 333 | 1 | 128 | -| easyjson | large | 718 | 36 | 548k | -| easyjson* | large | 2134 | 25 | 4957 | -| | | | | | -| ffjson | regular | 301 | 153 | 21629 | -| ffjson** | regular | 707 | 152 | 5148 | -| ffjson | small | 62 | 5 | 384 | -| ffjson** | small | 282 | 4 | 128 | -| ffjson | large | 438 | 7330 | 1.0M | -| ffjson** | large | 131 | 7319 | 820k | -| | | | | | -| codec | regular | 183 | 17 | 33603 | -| codec*** | regular | 671 | 9 | 1157 | -| codec | small | 147 | 3 | 304 | -| codec*** | small | 299 | 1 | 48 | -| codec | large | 190 | 483 | 2.5M | -| codec*** | large | 752 | 451 | 77574 | - -\* marshaling to a writer, -\*\* using `ffjson.Pool()`, -\*\*\* reusing output slice instead of resetting it to nil diff --git a/vendor/github.com/mailru/easyjson/benchmark/codec_test.go b/vendor/github.com/mailru/easyjson/benchmark/codec_test.go deleted file mode 100644 index 5c77072e..00000000 --- a/vendor/github.com/mailru/easyjson/benchmark/codec_test.go +++ /dev/null @@ -1,279 +0,0 @@ -// +build use_codec - -package benchmark - -import ( - "testing" - - "github.com/ugorji/go/codec" -) - -func BenchmarkCodec_Unmarshal_M(b *testing.B) { - var h codec.Handle = new(codec.JsonHandle) - dec := codec.NewDecoderBytes(nil, h) - - b.SetBytes(int64(len(largeStructText))) - for i := 0; i < b.N; i++ { - var s LargeStruct - dec.ResetBytes(largeStructText) - if err := dec.Decode(&s); err != nil { - b.Error(err) - } - } -} - -func BenchmarkCodec_Unmarshal_S(b *testing.B) { - var h codec.Handle = new(codec.JsonHandle) - dec := codec.NewDecoderBytes(nil, h) - - b.SetBytes(int64(len(smallStructText))) - for i := 0; i < b.N; i++ { - var s LargeStruct - dec.ResetBytes(smallStructText) - if err := dec.Decode(&s); err != nil { - b.Error(err) - } - } -} - -func BenchmarkCodec_Marshal_S(b *testing.B) { - var h codec.Handle = new(codec.JsonHandle) - - var out []byte - enc := codec.NewEncoderBytes(&out, h) - - var l int64 - for i := 0; i < b.N; i++ { - enc.ResetBytes(&out) - if err := enc.Encode(&smallStructData); err != nil { - b.Error(err) - } - l = int64(len(out)) - out = nil - } - - b.SetBytes(l) -} - -func BenchmarkCodec_Marshal_M(b *testing.B) { - var h codec.Handle = new(codec.JsonHandle) - - var out []byte - enc := codec.NewEncoderBytes(&out, h) - - var l int64 - for i := 0; i < b.N; i++ { - enc.ResetBytes(&out) - if err := enc.Encode(&largeStructData); err != nil { - b.Error(err) - } - l = int64(len(out)) - out = nil - } - - b.SetBytes(l) -} - -func BenchmarkCodec_Marshal_L(b *testing.B) { - var h codec.Handle = new(codec.JsonHandle) - - var out []byte - enc := codec.NewEncoderBytes(&out, h) - - var l int64 - for i := 0; i < b.N; i++ { - enc.ResetBytes(&out) - if err := enc.Encode(&xlStructData); err != nil { - b.Error(err) - } - l = int64(len(out)) - out = nil - } - - b.SetBytes(l) -} - -func BenchmarkCodec_Marshal_S_Reuse(b *testing.B) { - var h codec.Handle = new(codec.JsonHandle) - - var out []byte - enc := codec.NewEncoderBytes(&out, h) - - var l int64 - for i := 0; i < b.N; i++ { - enc.ResetBytes(&out) - if err := enc.Encode(&smallStructData); err != nil { - b.Error(err) - } - l = int64(len(out)) - out = out[:0] - } - - b.SetBytes(l) -} - -func BenchmarkCodec_Marshal_M_Reuse(b *testing.B) { - var h codec.Handle = new(codec.JsonHandle) - - var out []byte - enc := codec.NewEncoderBytes(&out, h) - - var l int64 - for i := 0; i < b.N; i++ { - enc.ResetBytes(&out) - if err := enc.Encode(&largeStructData); err != nil { - b.Error(err) - } - l = int64(len(out)) - out = out[:0] - } - - b.SetBytes(l) -} - -func BenchmarkCodec_Marshal_L_Reuse(b *testing.B) { - var h codec.Handle = new(codec.JsonHandle) - - var out []byte - enc := codec.NewEncoderBytes(&out, h) - - var l int64 - for i := 0; i < b.N; i++ { - enc.ResetBytes(&out) - if err := enc.Encode(&xlStructData); err != nil { - b.Error(err) - } - l = int64(len(out)) - out = out[:0] - } - - b.SetBytes(l) -} - -func BenchmarkCodec_Marshal_S_Parallel(b *testing.B) { - var l int64 - - b.RunParallel(func(pb *testing.PB) { - var out []byte - - var h codec.Handle = new(codec.JsonHandle) - enc := codec.NewEncoderBytes(&out, h) - - for pb.Next() { - enc.ResetBytes(&out) - if err := enc.Encode(&smallStructData); err != nil { - b.Error(err) - } - l = int64(len(out)) - out = nil - } - }) - - b.SetBytes(l) -} - -func BenchmarkCodec_Marshal_M_Parallel(b *testing.B) { - var l int64 - - b.RunParallel(func(pb *testing.PB) { - var h codec.Handle = new(codec.JsonHandle) - - var out []byte - enc := codec.NewEncoderBytes(&out, h) - - for pb.Next() { - enc.ResetBytes(&out) - if err := enc.Encode(&largeStructData); err != nil { - b.Error(err) - } - l = int64(len(out)) - out = nil - } - }) - b.SetBytes(l) -} - -func BenchmarkCodec_Marshal_L_Parallel(b *testing.B) { - var l int64 - - b.RunParallel(func(pb *testing.PB) { - var h codec.Handle = new(codec.JsonHandle) - - var out []byte - enc := codec.NewEncoderBytes(&out, h) - - for pb.Next() { - enc.ResetBytes(&out) - if err := enc.Encode(&xlStructData); err != nil { - b.Error(err) - } - l = int64(len(out)) - out = nil - } - }) - b.SetBytes(l) -} - -func BenchmarkCodec_Marshal_S_Parallel_Reuse(b *testing.B) { - var l int64 - - b.RunParallel(func(pb *testing.PB) { - var out []byte - - var h codec.Handle = new(codec.JsonHandle) - enc := codec.NewEncoderBytes(&out, h) - - for pb.Next() { - enc.ResetBytes(&out) - if err := enc.Encode(&smallStructData); err != nil { - b.Error(err) - } - l = int64(len(out)) - out = out[:0] - } - }) - - b.SetBytes(l) -} - -func BenchmarkCodec_Marshal_M_Parallel_Reuse(b *testing.B) { - var l int64 - - b.RunParallel(func(pb *testing.PB) { - var h codec.Handle = new(codec.JsonHandle) - - var out []byte - enc := codec.NewEncoderBytes(&out, h) - - for pb.Next() { - enc.ResetBytes(&out) - if err := enc.Encode(&largeStructData); err != nil { - b.Error(err) - } - l = int64(len(out)) - out = out[:0] - } - }) - b.SetBytes(l) -} - -func BenchmarkCodec_Marshal_L_Parallel_Reuse(b *testing.B) { - var l int64 - - b.RunParallel(func(pb *testing.PB) { - var h codec.Handle = new(codec.JsonHandle) - - var out []byte - enc := codec.NewEncoderBytes(&out, h) - - for pb.Next() { - enc.ResetBytes(&out) - if err := enc.Encode(&xlStructData); err != nil { - b.Error(err) - } - l = int64(len(out)) - out = out[:0] - } - }) - b.SetBytes(l) -} diff --git a/vendor/github.com/mailru/easyjson/benchmark/data.go b/vendor/github.com/mailru/easyjson/benchmark/data.go deleted file mode 100644 index 71eb91a9..00000000 --- a/vendor/github.com/mailru/easyjson/benchmark/data.go +++ /dev/null @@ -1,148 +0,0 @@ -// Package benchmark provides a simple benchmark for easyjson against default serialization and ffjson. -// The data example is taken from https://dev.twitter.com/rest/reference/get/search/tweets -package benchmark - -import ( - "io/ioutil" -) - -var largeStructText, _ = ioutil.ReadFile("example.json") -var xlStructData XLStruct - -func init() { - for i := 0; i < 50; i++ { - xlStructData.Data = append(xlStructData.Data, largeStructData) - } -} - -var smallStructText = []byte(`{"hashtags":[{"indices":[5, 10],"text":"some-text"}],"urls":[],"user_mentions":[]}`) -var smallStructData = Entities{ - Hashtags: []Hashtag{{Indices: []int{5, 10}, Text: "some-text"}}, - Urls: []*string{}, - UserMentions: []*string{}, -} - -type SearchMetadata struct { - CompletedIn float64 `json:"completed_in"` - Count int `json:"count"` - MaxID int64 `json:"max_id"` - MaxIDStr string `json:"max_id_str"` - NextResults string `json:"next_results"` - Query string `json:"query"` - RefreshURL string `json:"refresh_url"` - SinceID int64 `json:"since_id"` - SinceIDStr string `json:"since_id_str"` -} - -type Hashtag struct { - Indices []int `json:"indices"` - Text string `json:"text"` -} - -//easyjson:json -type Entities struct { - Hashtags []Hashtag `json:"hashtags"` - Urls []*string `json:"urls"` - UserMentions []*string `json:"user_mentions"` -} - -type UserEntityDescription struct { - Urls []*string `json:"urls"` -} - -type URL struct { - ExpandedURL *string `json:"expanded_url"` - Indices []int `json:"indices"` - URL string `json:"url"` -} - -type UserEntityURL struct { - Urls []URL `json:"urls"` -} - -type UserEntities struct { - Description UserEntityDescription `json:"description"` - URL UserEntityURL `json:"url"` -} - -type User struct { - ContributorsEnabled bool `json:"contributors_enabled"` - CreatedAt string `json:"created_at"` - DefaultProfile bool `json:"default_profile"` - DefaultProfileImage bool `json:"default_profile_image"` - Description string `json:"description"` - Entities UserEntities `json:"entities"` - FavouritesCount int `json:"favourites_count"` - FollowRequestSent *string `json:"follow_request_sent"` - FollowersCount int `json:"followers_count"` - Following *string `json:"following"` - FriendsCount int `json:"friends_count"` - GeoEnabled bool `json:"geo_enabled"` - ID int `json:"id"` - IDStr string `json:"id_str"` - IsTranslator bool `json:"is_translator"` - Lang string `json:"lang"` - ListedCount int `json:"listed_count"` - Location string `json:"location"` - Name string `json:"name"` - Notifications *string `json:"notifications"` - ProfileBackgroundColor string `json:"profile_background_color"` - ProfileBackgroundImageURL string `json:"profile_background_image_url"` - ProfileBackgroundImageURLHTTPS string `json:"profile_background_image_url_https"` - ProfileBackgroundTile bool `json:"profile_background_tile"` - ProfileImageURL string `json:"profile_image_url"` - ProfileImageURLHTTPS string `json:"profile_image_url_https"` - ProfileLinkColor string `json:"profile_link_color"` - ProfileSidebarBorderColor string `json:"profile_sidebar_border_color"` - ProfileSidebarFillColor string `json:"profile_sidebar_fill_color"` - ProfileTextColor string `json:"profile_text_color"` - ProfileUseBackgroundImage bool `json:"profile_use_background_image"` - Protected bool `json:"protected"` - ScreenName string `json:"screen_name"` - ShowAllInlineMedia bool `json:"show_all_inline_media"` - StatusesCount int `json:"statuses_count"` - TimeZone string `json:"time_zone"` - URL *string `json:"url"` - UtcOffset int `json:"utc_offset"` - Verified bool `json:"verified"` -} - -type StatusMetadata struct { - IsoLanguageCode string `json:"iso_language_code"` - ResultType string `json:"result_type"` -} - -type Status struct { - Contributors *string `json:"contributors"` - Coordinates *string `json:"coordinates"` - CreatedAt string `json:"created_at"` - Entities Entities `json:"entities"` - Favorited bool `json:"favorited"` - Geo *string `json:"geo"` - ID int64 `json:"id"` - IDStr string `json:"id_str"` - InReplyToScreenName *string `json:"in_reply_to_screen_name"` - InReplyToStatusID *string `json:"in_reply_to_status_id"` - InReplyToStatusIDStr *string `json:"in_reply_to_status_id_str"` - InReplyToUserID *string `json:"in_reply_to_user_id"` - InReplyToUserIDStr *string `json:"in_reply_to_user_id_str"` - Metadata StatusMetadata `json:"metadata"` - Place *string `json:"place"` - RetweetCount int `json:"retweet_count"` - Retweeted bool `json:"retweeted"` - Source string `json:"source"` - Text string `json:"text"` - Truncated bool `json:"truncated"` - User User `json:"user"` -} - -//easyjson:json -type LargeStruct struct { - SearchMetadata SearchMetadata `json:"search_metadata"` - Statuses []Status `json:"statuses"` -} - -//easyjson:json -type XLStruct struct { - Data []LargeStruct -} diff --git a/vendor/github.com/mailru/easyjson/benchmark/data_codec.go b/vendor/github.com/mailru/easyjson/benchmark/data_codec.go deleted file mode 100644 index d2d83fac..00000000 --- a/vendor/github.com/mailru/easyjson/benchmark/data_codec.go +++ /dev/null @@ -1,6914 +0,0 @@ -//+build use_codec -//+build !easyjson_nounsafe -//+build !appengine - -// ************************************************************ -// DO NOT EDIT. -// THIS FILE IS AUTO-GENERATED BY codecgen. -// ************************************************************ - -package benchmark - -import ( - "errors" - "fmt" - "reflect" - "runtime" - "unsafe" - - codec1978 "github.com/ugorji/go/codec" -) - -const ( - // ----- content types ---- - codecSelferC_UTF89225 = 1 - codecSelferC_RAW9225 = 0 - // ----- value types used ---- - codecSelferValueTypeArray9225 = 10 - codecSelferValueTypeMap9225 = 9 - // ----- containerStateValues ---- - codecSelfer_containerMapKey9225 = 2 - codecSelfer_containerMapValue9225 = 3 - codecSelfer_containerMapEnd9225 = 4 - codecSelfer_containerArrayElem9225 = 6 - codecSelfer_containerArrayEnd9225 = 7 -) - -var ( - codecSelferBitsize9225 = uint8(reflect.TypeOf(uint(0)).Bits()) - codecSelferOnlyMapOrArrayEncodeToStructErr9225 = errors.New(`only encoded map or array can be decoded into a struct`) -) - -type codecSelferUnsafeString9225 struct { - Data uintptr - Len int -} - -type codecSelfer9225 struct{} - -func init() { - if codec1978.GenVersion != 5 { - _, file, _, _ := runtime.Caller(0) - err := fmt.Errorf("codecgen version mismatch: current: %v, need %v. Re-generate file: %v", - 5, codec1978.GenVersion, file) - panic(err) - } - if false { // reference the types, but skip this branch at build/run time - var v0 unsafe.Pointer - _ = v0 - } -} - -func (x *SearchMetadata) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [9]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(9) - } else { - yynn2 = 9 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeFloat64(float64(x.CompletedIn)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("completed_in")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeFloat64(float64(x.CompletedIn)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeInt(int64(x.Count)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("count")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeInt(int64(x.Count)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeInt(int64(x.MaxID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("max_id")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeInt(int64(x.MaxID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.MaxIDStr)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("max_id_str")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.MaxIDStr)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.NextResults)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("next_results")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.NextResults)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.Query)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("query")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym20 := z.EncBinary() - _ = yym20 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.Query)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym22 := z.EncBinary() - _ = yym22 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.RefreshURL)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("refresh_url")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym23 := z.EncBinary() - _ = yym23 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.RefreshURL)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym25 := z.EncBinary() - _ = yym25 - if false { - } else { - r.EncodeInt(int64(x.SinceID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("since_id")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym26 := z.EncBinary() - _ = yym26 - if false { - } else { - r.EncodeInt(int64(x.SinceID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym28 := z.EncBinary() - _ = yym28 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.SinceIDStr)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("since_id_str")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym29 := z.EncBinary() - _ = yym29 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.SinceIDStr)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd9225) - } - } - } -} - -func (x *SearchMetadata) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap9225 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd9225) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray9225 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr9225) - } - } -} - -func (x *SearchMetadata) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey9225) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3SlcHdr := codecSelferUnsafeString9225{uintptr(unsafe.Pointer(&yys3Slc[0])), len(yys3Slc)} - yys3 := *(*string)(unsafe.Pointer(&yys3SlcHdr)) - z.DecSendContainerState(codecSelfer_containerMapValue9225) - switch yys3 { - case "completed_in": - if r.TryDecodeAsNil() { - x.CompletedIn = 0 - } else { - yyv4 := &x.CompletedIn - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*float64)(yyv4)) = float64(r.DecodeFloat(false)) - } - } - case "count": - if r.TryDecodeAsNil() { - x.Count = 0 - } else { - yyv6 := &x.Count - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*int)(yyv6)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - case "max_id": - if r.TryDecodeAsNil() { - x.MaxID = 0 - } else { - yyv8 := &x.MaxID - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*int)(yyv8)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - case "max_id_str": - if r.TryDecodeAsNil() { - x.MaxIDStr = "" - } else { - yyv10 := &x.MaxIDStr - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*string)(yyv10)) = r.DecodeString() - } - } - case "next_results": - if r.TryDecodeAsNil() { - x.NextResults = "" - } else { - yyv12 := &x.NextResults - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*string)(yyv12)) = r.DecodeString() - } - } - case "query": - if r.TryDecodeAsNil() { - x.Query = "" - } else { - yyv14 := &x.Query - yym15 := z.DecBinary() - _ = yym15 - if false { - } else { - *((*string)(yyv14)) = r.DecodeString() - } - } - case "refresh_url": - if r.TryDecodeAsNil() { - x.RefreshURL = "" - } else { - yyv16 := &x.RefreshURL - yym17 := z.DecBinary() - _ = yym17 - if false { - } else { - *((*string)(yyv16)) = r.DecodeString() - } - } - case "since_id": - if r.TryDecodeAsNil() { - x.SinceID = 0 - } else { - yyv18 := &x.SinceID - yym19 := z.DecBinary() - _ = yym19 - if false { - } else { - *((*int)(yyv18)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - case "since_id_str": - if r.TryDecodeAsNil() { - x.SinceIDStr = "" - } else { - yyv20 := &x.SinceIDStr - yym21 := z.DecBinary() - _ = yym21 - if false { - } else { - *((*string)(yyv20)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd9225) -} - -func (x *SearchMetadata) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj22 int - var yyb22 bool - var yyhl22 bool = l >= 0 - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.CompletedIn = 0 - } else { - yyv23 := &x.CompletedIn - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*float64)(yyv23)) = float64(r.DecodeFloat(false)) - } - } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Count = 0 - } else { - yyv25 := &x.Count - yym26 := z.DecBinary() - _ = yym26 - if false { - } else { - *((*int)(yyv25)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.MaxID = 0 - } else { - yyv27 := &x.MaxID - yym28 := z.DecBinary() - _ = yym28 - if false { - } else { - *((*int)(yyv27)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.MaxIDStr = "" - } else { - yyv29 := &x.MaxIDStr - yym30 := z.DecBinary() - _ = yym30 - if false { - } else { - *((*string)(yyv29)) = r.DecodeString() - } - } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.NextResults = "" - } else { - yyv31 := &x.NextResults - yym32 := z.DecBinary() - _ = yym32 - if false { - } else { - *((*string)(yyv31)) = r.DecodeString() - } - } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Query = "" - } else { - yyv33 := &x.Query - yym34 := z.DecBinary() - _ = yym34 - if false { - } else { - *((*string)(yyv33)) = r.DecodeString() - } - } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.RefreshURL = "" - } else { - yyv35 := &x.RefreshURL - yym36 := z.DecBinary() - _ = yym36 - if false { - } else { - *((*string)(yyv35)) = r.DecodeString() - } - } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.SinceID = 0 - } else { - yyv37 := &x.SinceID - yym38 := z.DecBinary() - _ = yym38 - if false { - } else { - *((*int)(yyv37)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.SinceIDStr = "" - } else { - yyv39 := &x.SinceIDStr - yym40 := z.DecBinary() - _ = yym40 - if false { - } else { - *((*string)(yyv39)) = r.DecodeString() - } - } - for { - yyj22++ - if yyhl22 { - yyb22 = yyj22 > l - } else { - yyb22 = r.CheckBreak() - } - if yyb22 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - z.DecStructFieldNotFound(yyj22-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) -} - -func (x *Hashtag) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [2]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(2) - } else { - yynn2 = 2 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.Indices == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - z.F.EncSliceIntV(x.Indices, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("indices")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.Indices == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - z.F.EncSliceIntV(x.Indices, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.Text)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("text")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.Text)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd9225) - } - } - } -} - -func (x *Hashtag) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap9225 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd9225) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray9225 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr9225) - } - } -} - -func (x *Hashtag) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey9225) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3SlcHdr := codecSelferUnsafeString9225{uintptr(unsafe.Pointer(&yys3Slc[0])), len(yys3Slc)} - yys3 := *(*string)(unsafe.Pointer(&yys3SlcHdr)) - z.DecSendContainerState(codecSelfer_containerMapValue9225) - switch yys3 { - case "indices": - if r.TryDecodeAsNil() { - x.Indices = nil - } else { - yyv4 := &x.Indices - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - z.F.DecSliceIntX(yyv4, false, d) - } - } - case "text": - if r.TryDecodeAsNil() { - x.Text = "" - } else { - yyv6 := &x.Text - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd9225) -} - -func (x *Hashtag) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj8 int - var yyb8 bool - var yyhl8 bool = l >= 0 - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Indices = nil - } else { - yyv9 := &x.Indices - yym10 := z.DecBinary() - _ = yym10 - if false { - } else { - z.F.DecSliceIntX(yyv9, false, d) - } - } - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Text = "" - } else { - yyv11 := &x.Text - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*string)(yyv11)) = r.DecodeString() - } - } - for { - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - z.DecStructFieldNotFound(yyj8-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) -} - -func (x *Entities) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [3]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(3) - } else { - yynn2 = 3 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.Hashtags == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - h.encSliceHashtag(([]Hashtag)(x.Hashtags), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("hashtags")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.Hashtags == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - h.encSliceHashtag(([]Hashtag)(x.Hashtags), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.Urls == nil { - r.EncodeNil() - } else { - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - h.encSlicePtrtostring(([]*string)(x.Urls), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("urls")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.Urls == nil { - r.EncodeNil() - } else { - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - h.encSlicePtrtostring(([]*string)(x.Urls), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.UserMentions == nil { - r.EncodeNil() - } else { - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - h.encSlicePtrtostring(([]*string)(x.UserMentions), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("user_mentions")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.UserMentions == nil { - r.EncodeNil() - } else { - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - h.encSlicePtrtostring(([]*string)(x.UserMentions), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd9225) - } - } - } -} - -func (x *Entities) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap9225 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd9225) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray9225 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr9225) - } - } -} - -func (x *Entities) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey9225) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3SlcHdr := codecSelferUnsafeString9225{uintptr(unsafe.Pointer(&yys3Slc[0])), len(yys3Slc)} - yys3 := *(*string)(unsafe.Pointer(&yys3SlcHdr)) - z.DecSendContainerState(codecSelfer_containerMapValue9225) - switch yys3 { - case "hashtags": - if r.TryDecodeAsNil() { - x.Hashtags = nil - } else { - yyv4 := &x.Hashtags - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - h.decSliceHashtag((*[]Hashtag)(yyv4), d) - } - } - case "urls": - if r.TryDecodeAsNil() { - x.Urls = nil - } else { - yyv6 := &x.Urls - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - h.decSlicePtrtostring((*[]*string)(yyv6), d) - } - } - case "user_mentions": - if r.TryDecodeAsNil() { - x.UserMentions = nil - } else { - yyv8 := &x.UserMentions - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - h.decSlicePtrtostring((*[]*string)(yyv8), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd9225) -} - -func (x *Entities) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj10 int - var yyb10 bool - var yyhl10 bool = l >= 0 - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Hashtags = nil - } else { - yyv11 := &x.Hashtags - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - h.decSliceHashtag((*[]Hashtag)(yyv11), d) - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Urls = nil - } else { - yyv13 := &x.Urls - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - h.decSlicePtrtostring((*[]*string)(yyv13), d) - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.UserMentions = nil - } else { - yyv15 := &x.UserMentions - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - h.decSlicePtrtostring((*[]*string)(yyv15), d) - } - } - for { - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - z.DecStructFieldNotFound(yyj10-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) -} - -func (x *UserEntityDescription) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [1]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(1) - } else { - yynn2 = 1 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.Urls == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - h.encSlicePtrtostring(([]*string)(x.Urls), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("urls")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.Urls == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - h.encSlicePtrtostring(([]*string)(x.Urls), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd9225) - } - } - } -} - -func (x *UserEntityDescription) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap9225 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd9225) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray9225 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr9225) - } - } -} - -func (x *UserEntityDescription) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey9225) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3SlcHdr := codecSelferUnsafeString9225{uintptr(unsafe.Pointer(&yys3Slc[0])), len(yys3Slc)} - yys3 := *(*string)(unsafe.Pointer(&yys3SlcHdr)) - z.DecSendContainerState(codecSelfer_containerMapValue9225) - switch yys3 { - case "urls": - if r.TryDecodeAsNil() { - x.Urls = nil - } else { - yyv4 := &x.Urls - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - h.decSlicePtrtostring((*[]*string)(yyv4), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd9225) -} - -func (x *UserEntityDescription) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj6 int - var yyb6 bool - var yyhl6 bool = l >= 0 - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Urls = nil - } else { - yyv7 := &x.Urls - yym8 := z.DecBinary() - _ = yym8 - if false { - } else { - h.decSlicePtrtostring((*[]*string)(yyv7), d) - } - } - for { - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - z.DecStructFieldNotFound(yyj6-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) -} - -func (x *URL) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [3]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(3) - } else { - yynn2 = 3 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.ExpandedURL == nil { - r.EncodeNil() - } else { - yy4 := *x.ExpandedURL - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy4)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("expanded_url")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.ExpandedURL == nil { - r.EncodeNil() - } else { - yy6 := *x.ExpandedURL - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy6)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.Indices == nil { - r.EncodeNil() - } else { - yym9 := z.EncBinary() - _ = yym9 - if false { - } else { - z.F.EncSliceIntV(x.Indices, false, e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("indices")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.Indices == nil { - r.EncodeNil() - } else { - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - z.F.EncSliceIntV(x.Indices, false, e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym12 := z.EncBinary() - _ = yym12 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.URL)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("url")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.URL)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd9225) - } - } - } -} - -func (x *URL) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap9225 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd9225) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray9225 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr9225) - } - } -} - -func (x *URL) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey9225) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3SlcHdr := codecSelferUnsafeString9225{uintptr(unsafe.Pointer(&yys3Slc[0])), len(yys3Slc)} - yys3 := *(*string)(unsafe.Pointer(&yys3SlcHdr)) - z.DecSendContainerState(codecSelfer_containerMapValue9225) - switch yys3 { - case "expanded_url": - if r.TryDecodeAsNil() { - if x.ExpandedURL != nil { - x.ExpandedURL = nil - } - } else { - if x.ExpandedURL == nil { - x.ExpandedURL = new(string) - } - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(x.ExpandedURL)) = r.DecodeString() - } - } - case "indices": - if r.TryDecodeAsNil() { - x.Indices = nil - } else { - yyv6 := &x.Indices - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - z.F.DecSliceIntX(yyv6, false, d) - } - } - case "url": - if r.TryDecodeAsNil() { - x.URL = "" - } else { - yyv8 := &x.URL - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd9225) -} - -func (x *URL) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj10 int - var yyb10 bool - var yyhl10 bool = l >= 0 - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - if x.ExpandedURL != nil { - x.ExpandedURL = nil - } - } else { - if x.ExpandedURL == nil { - x.ExpandedURL = new(string) - } - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*string)(x.ExpandedURL)) = r.DecodeString() - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Indices = nil - } else { - yyv13 := &x.Indices - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - z.F.DecSliceIntX(yyv13, false, d) - } - } - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.URL = "" - } else { - yyv15 := &x.URL - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*string)(yyv15)) = r.DecodeString() - } - } - for { - yyj10++ - if yyhl10 { - yyb10 = yyj10 > l - } else { - yyb10 = r.CheckBreak() - } - if yyb10 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - z.DecStructFieldNotFound(yyj10-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) -} - -func (x *UserEntityURL) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [1]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(1) - } else { - yynn2 = 1 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.Urls == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - h.encSliceURL(([]URL)(x.Urls), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("urls")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.Urls == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - h.encSliceURL(([]URL)(x.Urls), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd9225) - } - } - } -} - -func (x *UserEntityURL) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap9225 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd9225) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray9225 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr9225) - } - } -} - -func (x *UserEntityURL) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey9225) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3SlcHdr := codecSelferUnsafeString9225{uintptr(unsafe.Pointer(&yys3Slc[0])), len(yys3Slc)} - yys3 := *(*string)(unsafe.Pointer(&yys3SlcHdr)) - z.DecSendContainerState(codecSelfer_containerMapValue9225) - switch yys3 { - case "urls": - if r.TryDecodeAsNil() { - x.Urls = nil - } else { - yyv4 := &x.Urls - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - h.decSliceURL((*[]URL)(yyv4), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd9225) -} - -func (x *UserEntityURL) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj6 int - var yyb6 bool - var yyhl6 bool = l >= 0 - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Urls = nil - } else { - yyv7 := &x.Urls - yym8 := z.DecBinary() - _ = yym8 - if false { - } else { - h.decSliceURL((*[]URL)(yyv7), d) - } - } - for { - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - z.DecStructFieldNotFound(yyj6-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) -} - -func (x *UserEntities) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [2]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(2) - } else { - yynn2 = 2 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yy4 := &x.Description - yy4.CodecEncodeSelf(e) - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("description")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yy6 := &x.Description - yy6.CodecEncodeSelf(e) - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yy9 := &x.URL - yy9.CodecEncodeSelf(e) - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("url")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yy11 := &x.URL - yy11.CodecEncodeSelf(e) - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd9225) - } - } - } -} - -func (x *UserEntities) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap9225 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd9225) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray9225 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr9225) - } - } -} - -func (x *UserEntities) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey9225) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3SlcHdr := codecSelferUnsafeString9225{uintptr(unsafe.Pointer(&yys3Slc[0])), len(yys3Slc)} - yys3 := *(*string)(unsafe.Pointer(&yys3SlcHdr)) - z.DecSendContainerState(codecSelfer_containerMapValue9225) - switch yys3 { - case "description": - if r.TryDecodeAsNil() { - x.Description = UserEntityDescription{} - } else { - yyv4 := &x.Description - yyv4.CodecDecodeSelf(d) - } - case "url": - if r.TryDecodeAsNil() { - x.URL = UserEntityURL{} - } else { - yyv5 := &x.URL - yyv5.CodecDecodeSelf(d) - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd9225) -} - -func (x *UserEntities) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj6 int - var yyb6 bool - var yyhl6 bool = l >= 0 - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Description = UserEntityDescription{} - } else { - yyv7 := &x.Description - yyv7.CodecDecodeSelf(d) - } - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.URL = UserEntityURL{} - } else { - yyv8 := &x.URL - yyv8.CodecDecodeSelf(d) - } - for { - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - z.DecStructFieldNotFound(yyj6-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) -} - -func (x *User) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [39]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(39) - } else { - yynn2 = 39 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeBool(bool(x.ContributorsEnabled)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("contributors_enabled")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeBool(bool(x.ContributorsEnabled)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.CreatedAt)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("created_at")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.CreatedAt)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeBool(bool(x.DefaultProfile)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("default_profile")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeBool(bool(x.DefaultProfile)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeBool(bool(x.DefaultProfileImage)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("default_profile_image")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeBool(bool(x.DefaultProfileImage)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym16 := z.EncBinary() - _ = yym16 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.Description)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("description")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.Description)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yy19 := &x.Entities - yy19.CodecEncodeSelf(e) - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("entities")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yy21 := &x.Entities - yy21.CodecEncodeSelf(e) - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym24 := z.EncBinary() - _ = yym24 - if false { - } else { - r.EncodeInt(int64(x.FavouritesCount)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("favourites_count")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym25 := z.EncBinary() - _ = yym25 - if false { - } else { - r.EncodeInt(int64(x.FavouritesCount)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.FollowRequestSent == nil { - r.EncodeNil() - } else { - yy27 := *x.FollowRequestSent - yym28 := z.EncBinary() - _ = yym28 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy27)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("follow_request_sent")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.FollowRequestSent == nil { - r.EncodeNil() - } else { - yy29 := *x.FollowRequestSent - yym30 := z.EncBinary() - _ = yym30 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy29)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym32 := z.EncBinary() - _ = yym32 - if false { - } else { - r.EncodeInt(int64(x.FollowersCount)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("followers_count")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym33 := z.EncBinary() - _ = yym33 - if false { - } else { - r.EncodeInt(int64(x.FollowersCount)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.Following == nil { - r.EncodeNil() - } else { - yy35 := *x.Following - yym36 := z.EncBinary() - _ = yym36 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy35)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("following")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.Following == nil { - r.EncodeNil() - } else { - yy37 := *x.Following - yym38 := z.EncBinary() - _ = yym38 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy37)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym40 := z.EncBinary() - _ = yym40 - if false { - } else { - r.EncodeInt(int64(x.FriendsCount)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("friends_count")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym41 := z.EncBinary() - _ = yym41 - if false { - } else { - r.EncodeInt(int64(x.FriendsCount)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym43 := z.EncBinary() - _ = yym43 - if false { - } else { - r.EncodeBool(bool(x.GeoEnabled)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("geo_enabled")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym44 := z.EncBinary() - _ = yym44 - if false { - } else { - r.EncodeBool(bool(x.GeoEnabled)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym46 := z.EncBinary() - _ = yym46 - if false { - } else { - r.EncodeInt(int64(x.ID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("id")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym47 := z.EncBinary() - _ = yym47 - if false { - } else { - r.EncodeInt(int64(x.ID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym49 := z.EncBinary() - _ = yym49 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.IDStr)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("id_str")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym50 := z.EncBinary() - _ = yym50 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.IDStr)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym52 := z.EncBinary() - _ = yym52 - if false { - } else { - r.EncodeBool(bool(x.IsTranslator)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("is_translator")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym53 := z.EncBinary() - _ = yym53 - if false { - } else { - r.EncodeBool(bool(x.IsTranslator)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym55 := z.EncBinary() - _ = yym55 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.Lang)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("lang")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym56 := z.EncBinary() - _ = yym56 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.Lang)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym58 := z.EncBinary() - _ = yym58 - if false { - } else { - r.EncodeInt(int64(x.ListedCount)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("listed_count")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym59 := z.EncBinary() - _ = yym59 - if false { - } else { - r.EncodeInt(int64(x.ListedCount)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym61 := z.EncBinary() - _ = yym61 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.Location)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("location")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym62 := z.EncBinary() - _ = yym62 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.Location)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym64 := z.EncBinary() - _ = yym64 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.Name)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("name")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym65 := z.EncBinary() - _ = yym65 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.Name)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.Notifications == nil { - r.EncodeNil() - } else { - yy67 := *x.Notifications - yym68 := z.EncBinary() - _ = yym68 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy67)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("notifications")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.Notifications == nil { - r.EncodeNil() - } else { - yy69 := *x.Notifications - yym70 := z.EncBinary() - _ = yym70 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy69)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym72 := z.EncBinary() - _ = yym72 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileBackgroundColor)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("profile_background_color")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym73 := z.EncBinary() - _ = yym73 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileBackgroundColor)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym75 := z.EncBinary() - _ = yym75 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileBackgroundImageURL)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("profile_background_image_url")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym76 := z.EncBinary() - _ = yym76 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileBackgroundImageURL)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym78 := z.EncBinary() - _ = yym78 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileBackgroundImageURLHTTPS)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("profile_background_image_url_https")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym79 := z.EncBinary() - _ = yym79 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileBackgroundImageURLHTTPS)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym81 := z.EncBinary() - _ = yym81 - if false { - } else { - r.EncodeBool(bool(x.ProfileBackgroundTile)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("profile_background_tile")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym82 := z.EncBinary() - _ = yym82 - if false { - } else { - r.EncodeBool(bool(x.ProfileBackgroundTile)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym84 := z.EncBinary() - _ = yym84 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileImageURL)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("profile_image_url")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym85 := z.EncBinary() - _ = yym85 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileImageURL)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym87 := z.EncBinary() - _ = yym87 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileImageURLHTTPS)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("profile_image_url_https")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym88 := z.EncBinary() - _ = yym88 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileImageURLHTTPS)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym90 := z.EncBinary() - _ = yym90 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileLinkColor)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("profile_link_color")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym91 := z.EncBinary() - _ = yym91 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileLinkColor)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym93 := z.EncBinary() - _ = yym93 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileSidebarBorderColor)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("profile_sidebar_border_color")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym94 := z.EncBinary() - _ = yym94 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileSidebarBorderColor)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym96 := z.EncBinary() - _ = yym96 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileSidebarFillColor)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("profile_sidebar_fill_color")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym97 := z.EncBinary() - _ = yym97 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileSidebarFillColor)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym99 := z.EncBinary() - _ = yym99 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileTextColor)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("profile_text_color")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym100 := z.EncBinary() - _ = yym100 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ProfileTextColor)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym102 := z.EncBinary() - _ = yym102 - if false { - } else { - r.EncodeBool(bool(x.ProfileUseBackgroundImage)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("profile_use_background_image")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym103 := z.EncBinary() - _ = yym103 - if false { - } else { - r.EncodeBool(bool(x.ProfileUseBackgroundImage)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym105 := z.EncBinary() - _ = yym105 - if false { - } else { - r.EncodeBool(bool(x.Protected)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("protected")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym106 := z.EncBinary() - _ = yym106 - if false { - } else { - r.EncodeBool(bool(x.Protected)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym108 := z.EncBinary() - _ = yym108 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ScreenName)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("screen_name")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym109 := z.EncBinary() - _ = yym109 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ScreenName)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym111 := z.EncBinary() - _ = yym111 - if false { - } else { - r.EncodeBool(bool(x.ShowAllInlineMedia)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("show_all_inline_media")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym112 := z.EncBinary() - _ = yym112 - if false { - } else { - r.EncodeBool(bool(x.ShowAllInlineMedia)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym114 := z.EncBinary() - _ = yym114 - if false { - } else { - r.EncodeInt(int64(x.StatusesCount)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("statuses_count")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym115 := z.EncBinary() - _ = yym115 - if false { - } else { - r.EncodeInt(int64(x.StatusesCount)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym117 := z.EncBinary() - _ = yym117 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.TimeZone)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("time_zone")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym118 := z.EncBinary() - _ = yym118 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.TimeZone)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.URL == nil { - r.EncodeNil() - } else { - yy120 := *x.URL - yym121 := z.EncBinary() - _ = yym121 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy120)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("url")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.URL == nil { - r.EncodeNil() - } else { - yy122 := *x.URL - yym123 := z.EncBinary() - _ = yym123 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy122)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym125 := z.EncBinary() - _ = yym125 - if false { - } else { - r.EncodeInt(int64(x.UtcOffset)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("utc_offset")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym126 := z.EncBinary() - _ = yym126 - if false { - } else { - r.EncodeInt(int64(x.UtcOffset)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym128 := z.EncBinary() - _ = yym128 - if false { - } else { - r.EncodeBool(bool(x.Verified)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("verified")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym129 := z.EncBinary() - _ = yym129 - if false { - } else { - r.EncodeBool(bool(x.Verified)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd9225) - } - } - } -} - -func (x *User) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap9225 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd9225) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray9225 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr9225) - } - } -} - -func (x *User) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey9225) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3SlcHdr := codecSelferUnsafeString9225{uintptr(unsafe.Pointer(&yys3Slc[0])), len(yys3Slc)} - yys3 := *(*string)(unsafe.Pointer(&yys3SlcHdr)) - z.DecSendContainerState(codecSelfer_containerMapValue9225) - switch yys3 { - case "contributors_enabled": - if r.TryDecodeAsNil() { - x.ContributorsEnabled = false - } else { - yyv4 := &x.ContributorsEnabled - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*bool)(yyv4)) = r.DecodeBool() - } - } - case "created_at": - if r.TryDecodeAsNil() { - x.CreatedAt = "" - } else { - yyv6 := &x.CreatedAt - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - case "default_profile": - if r.TryDecodeAsNil() { - x.DefaultProfile = false - } else { - yyv8 := &x.DefaultProfile - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*bool)(yyv8)) = r.DecodeBool() - } - } - case "default_profile_image": - if r.TryDecodeAsNil() { - x.DefaultProfileImage = false - } else { - yyv10 := &x.DefaultProfileImage - yym11 := z.DecBinary() - _ = yym11 - if false { - } else { - *((*bool)(yyv10)) = r.DecodeBool() - } - } - case "description": - if r.TryDecodeAsNil() { - x.Description = "" - } else { - yyv12 := &x.Description - yym13 := z.DecBinary() - _ = yym13 - if false { - } else { - *((*string)(yyv12)) = r.DecodeString() - } - } - case "entities": - if r.TryDecodeAsNil() { - x.Entities = UserEntities{} - } else { - yyv14 := &x.Entities - yyv14.CodecDecodeSelf(d) - } - case "favourites_count": - if r.TryDecodeAsNil() { - x.FavouritesCount = 0 - } else { - yyv15 := &x.FavouritesCount - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*int)(yyv15)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - case "follow_request_sent": - if r.TryDecodeAsNil() { - if x.FollowRequestSent != nil { - x.FollowRequestSent = nil - } - } else { - if x.FollowRequestSent == nil { - x.FollowRequestSent = new(string) - } - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*string)(x.FollowRequestSent)) = r.DecodeString() - } - } - case "followers_count": - if r.TryDecodeAsNil() { - x.FollowersCount = 0 - } else { - yyv19 := &x.FollowersCount - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*int)(yyv19)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - case "following": - if r.TryDecodeAsNil() { - if x.Following != nil { - x.Following = nil - } - } else { - if x.Following == nil { - x.Following = new(string) - } - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*string)(x.Following)) = r.DecodeString() - } - } - case "friends_count": - if r.TryDecodeAsNil() { - x.FriendsCount = 0 - } else { - yyv23 := &x.FriendsCount - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*int)(yyv23)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - case "geo_enabled": - if r.TryDecodeAsNil() { - x.GeoEnabled = false - } else { - yyv25 := &x.GeoEnabled - yym26 := z.DecBinary() - _ = yym26 - if false { - } else { - *((*bool)(yyv25)) = r.DecodeBool() - } - } - case "id": - if r.TryDecodeAsNil() { - x.ID = 0 - } else { - yyv27 := &x.ID - yym28 := z.DecBinary() - _ = yym28 - if false { - } else { - *((*int)(yyv27)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - case "id_str": - if r.TryDecodeAsNil() { - x.IDStr = "" - } else { - yyv29 := &x.IDStr - yym30 := z.DecBinary() - _ = yym30 - if false { - } else { - *((*string)(yyv29)) = r.DecodeString() - } - } - case "is_translator": - if r.TryDecodeAsNil() { - x.IsTranslator = false - } else { - yyv31 := &x.IsTranslator - yym32 := z.DecBinary() - _ = yym32 - if false { - } else { - *((*bool)(yyv31)) = r.DecodeBool() - } - } - case "lang": - if r.TryDecodeAsNil() { - x.Lang = "" - } else { - yyv33 := &x.Lang - yym34 := z.DecBinary() - _ = yym34 - if false { - } else { - *((*string)(yyv33)) = r.DecodeString() - } - } - case "listed_count": - if r.TryDecodeAsNil() { - x.ListedCount = 0 - } else { - yyv35 := &x.ListedCount - yym36 := z.DecBinary() - _ = yym36 - if false { - } else { - *((*int)(yyv35)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - case "location": - if r.TryDecodeAsNil() { - x.Location = "" - } else { - yyv37 := &x.Location - yym38 := z.DecBinary() - _ = yym38 - if false { - } else { - *((*string)(yyv37)) = r.DecodeString() - } - } - case "name": - if r.TryDecodeAsNil() { - x.Name = "" - } else { - yyv39 := &x.Name - yym40 := z.DecBinary() - _ = yym40 - if false { - } else { - *((*string)(yyv39)) = r.DecodeString() - } - } - case "notifications": - if r.TryDecodeAsNil() { - if x.Notifications != nil { - x.Notifications = nil - } - } else { - if x.Notifications == nil { - x.Notifications = new(string) - } - yym42 := z.DecBinary() - _ = yym42 - if false { - } else { - *((*string)(x.Notifications)) = r.DecodeString() - } - } - case "profile_background_color": - if r.TryDecodeAsNil() { - x.ProfileBackgroundColor = "" - } else { - yyv43 := &x.ProfileBackgroundColor - yym44 := z.DecBinary() - _ = yym44 - if false { - } else { - *((*string)(yyv43)) = r.DecodeString() - } - } - case "profile_background_image_url": - if r.TryDecodeAsNil() { - x.ProfileBackgroundImageURL = "" - } else { - yyv45 := &x.ProfileBackgroundImageURL - yym46 := z.DecBinary() - _ = yym46 - if false { - } else { - *((*string)(yyv45)) = r.DecodeString() - } - } - case "profile_background_image_url_https": - if r.TryDecodeAsNil() { - x.ProfileBackgroundImageURLHTTPS = "" - } else { - yyv47 := &x.ProfileBackgroundImageURLHTTPS - yym48 := z.DecBinary() - _ = yym48 - if false { - } else { - *((*string)(yyv47)) = r.DecodeString() - } - } - case "profile_background_tile": - if r.TryDecodeAsNil() { - x.ProfileBackgroundTile = false - } else { - yyv49 := &x.ProfileBackgroundTile - yym50 := z.DecBinary() - _ = yym50 - if false { - } else { - *((*bool)(yyv49)) = r.DecodeBool() - } - } - case "profile_image_url": - if r.TryDecodeAsNil() { - x.ProfileImageURL = "" - } else { - yyv51 := &x.ProfileImageURL - yym52 := z.DecBinary() - _ = yym52 - if false { - } else { - *((*string)(yyv51)) = r.DecodeString() - } - } - case "profile_image_url_https": - if r.TryDecodeAsNil() { - x.ProfileImageURLHTTPS = "" - } else { - yyv53 := &x.ProfileImageURLHTTPS - yym54 := z.DecBinary() - _ = yym54 - if false { - } else { - *((*string)(yyv53)) = r.DecodeString() - } - } - case "profile_link_color": - if r.TryDecodeAsNil() { - x.ProfileLinkColor = "" - } else { - yyv55 := &x.ProfileLinkColor - yym56 := z.DecBinary() - _ = yym56 - if false { - } else { - *((*string)(yyv55)) = r.DecodeString() - } - } - case "profile_sidebar_border_color": - if r.TryDecodeAsNil() { - x.ProfileSidebarBorderColor = "" - } else { - yyv57 := &x.ProfileSidebarBorderColor - yym58 := z.DecBinary() - _ = yym58 - if false { - } else { - *((*string)(yyv57)) = r.DecodeString() - } - } - case "profile_sidebar_fill_color": - if r.TryDecodeAsNil() { - x.ProfileSidebarFillColor = "" - } else { - yyv59 := &x.ProfileSidebarFillColor - yym60 := z.DecBinary() - _ = yym60 - if false { - } else { - *((*string)(yyv59)) = r.DecodeString() - } - } - case "profile_text_color": - if r.TryDecodeAsNil() { - x.ProfileTextColor = "" - } else { - yyv61 := &x.ProfileTextColor - yym62 := z.DecBinary() - _ = yym62 - if false { - } else { - *((*string)(yyv61)) = r.DecodeString() - } - } - case "profile_use_background_image": - if r.TryDecodeAsNil() { - x.ProfileUseBackgroundImage = false - } else { - yyv63 := &x.ProfileUseBackgroundImage - yym64 := z.DecBinary() - _ = yym64 - if false { - } else { - *((*bool)(yyv63)) = r.DecodeBool() - } - } - case "protected": - if r.TryDecodeAsNil() { - x.Protected = false - } else { - yyv65 := &x.Protected - yym66 := z.DecBinary() - _ = yym66 - if false { - } else { - *((*bool)(yyv65)) = r.DecodeBool() - } - } - case "screen_name": - if r.TryDecodeAsNil() { - x.ScreenName = "" - } else { - yyv67 := &x.ScreenName - yym68 := z.DecBinary() - _ = yym68 - if false { - } else { - *((*string)(yyv67)) = r.DecodeString() - } - } - case "show_all_inline_media": - if r.TryDecodeAsNil() { - x.ShowAllInlineMedia = false - } else { - yyv69 := &x.ShowAllInlineMedia - yym70 := z.DecBinary() - _ = yym70 - if false { - } else { - *((*bool)(yyv69)) = r.DecodeBool() - } - } - case "statuses_count": - if r.TryDecodeAsNil() { - x.StatusesCount = 0 - } else { - yyv71 := &x.StatusesCount - yym72 := z.DecBinary() - _ = yym72 - if false { - } else { - *((*int)(yyv71)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - case "time_zone": - if r.TryDecodeAsNil() { - x.TimeZone = "" - } else { - yyv73 := &x.TimeZone - yym74 := z.DecBinary() - _ = yym74 - if false { - } else { - *((*string)(yyv73)) = r.DecodeString() - } - } - case "url": - if r.TryDecodeAsNil() { - if x.URL != nil { - x.URL = nil - } - } else { - if x.URL == nil { - x.URL = new(string) - } - yym76 := z.DecBinary() - _ = yym76 - if false { - } else { - *((*string)(x.URL)) = r.DecodeString() - } - } - case "utc_offset": - if r.TryDecodeAsNil() { - x.UtcOffset = 0 - } else { - yyv77 := &x.UtcOffset - yym78 := z.DecBinary() - _ = yym78 - if false { - } else { - *((*int)(yyv77)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - case "verified": - if r.TryDecodeAsNil() { - x.Verified = false - } else { - yyv79 := &x.Verified - yym80 := z.DecBinary() - _ = yym80 - if false { - } else { - *((*bool)(yyv79)) = r.DecodeBool() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd9225) -} - -func (x *User) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj81 int - var yyb81 bool - var yyhl81 bool = l >= 0 - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ContributorsEnabled = false - } else { - yyv82 := &x.ContributorsEnabled - yym83 := z.DecBinary() - _ = yym83 - if false { - } else { - *((*bool)(yyv82)) = r.DecodeBool() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.CreatedAt = "" - } else { - yyv84 := &x.CreatedAt - yym85 := z.DecBinary() - _ = yym85 - if false { - } else { - *((*string)(yyv84)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.DefaultProfile = false - } else { - yyv86 := &x.DefaultProfile - yym87 := z.DecBinary() - _ = yym87 - if false { - } else { - *((*bool)(yyv86)) = r.DecodeBool() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.DefaultProfileImage = false - } else { - yyv88 := &x.DefaultProfileImage - yym89 := z.DecBinary() - _ = yym89 - if false { - } else { - *((*bool)(yyv88)) = r.DecodeBool() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Description = "" - } else { - yyv90 := &x.Description - yym91 := z.DecBinary() - _ = yym91 - if false { - } else { - *((*string)(yyv90)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Entities = UserEntities{} - } else { - yyv92 := &x.Entities - yyv92.CodecDecodeSelf(d) - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.FavouritesCount = 0 - } else { - yyv93 := &x.FavouritesCount - yym94 := z.DecBinary() - _ = yym94 - if false { - } else { - *((*int)(yyv93)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - if x.FollowRequestSent != nil { - x.FollowRequestSent = nil - } - } else { - if x.FollowRequestSent == nil { - x.FollowRequestSent = new(string) - } - yym96 := z.DecBinary() - _ = yym96 - if false { - } else { - *((*string)(x.FollowRequestSent)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.FollowersCount = 0 - } else { - yyv97 := &x.FollowersCount - yym98 := z.DecBinary() - _ = yym98 - if false { - } else { - *((*int)(yyv97)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - if x.Following != nil { - x.Following = nil - } - } else { - if x.Following == nil { - x.Following = new(string) - } - yym100 := z.DecBinary() - _ = yym100 - if false { - } else { - *((*string)(x.Following)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.FriendsCount = 0 - } else { - yyv101 := &x.FriendsCount - yym102 := z.DecBinary() - _ = yym102 - if false { - } else { - *((*int)(yyv101)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.GeoEnabled = false - } else { - yyv103 := &x.GeoEnabled - yym104 := z.DecBinary() - _ = yym104 - if false { - } else { - *((*bool)(yyv103)) = r.DecodeBool() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ID = 0 - } else { - yyv105 := &x.ID - yym106 := z.DecBinary() - _ = yym106 - if false { - } else { - *((*int)(yyv105)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.IDStr = "" - } else { - yyv107 := &x.IDStr - yym108 := z.DecBinary() - _ = yym108 - if false { - } else { - *((*string)(yyv107)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.IsTranslator = false - } else { - yyv109 := &x.IsTranslator - yym110 := z.DecBinary() - _ = yym110 - if false { - } else { - *((*bool)(yyv109)) = r.DecodeBool() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Lang = "" - } else { - yyv111 := &x.Lang - yym112 := z.DecBinary() - _ = yym112 - if false { - } else { - *((*string)(yyv111)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ListedCount = 0 - } else { - yyv113 := &x.ListedCount - yym114 := z.DecBinary() - _ = yym114 - if false { - } else { - *((*int)(yyv113)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Location = "" - } else { - yyv115 := &x.Location - yym116 := z.DecBinary() - _ = yym116 - if false { - } else { - *((*string)(yyv115)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Name = "" - } else { - yyv117 := &x.Name - yym118 := z.DecBinary() - _ = yym118 - if false { - } else { - *((*string)(yyv117)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - if x.Notifications != nil { - x.Notifications = nil - } - } else { - if x.Notifications == nil { - x.Notifications = new(string) - } - yym120 := z.DecBinary() - _ = yym120 - if false { - } else { - *((*string)(x.Notifications)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ProfileBackgroundColor = "" - } else { - yyv121 := &x.ProfileBackgroundColor - yym122 := z.DecBinary() - _ = yym122 - if false { - } else { - *((*string)(yyv121)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ProfileBackgroundImageURL = "" - } else { - yyv123 := &x.ProfileBackgroundImageURL - yym124 := z.DecBinary() - _ = yym124 - if false { - } else { - *((*string)(yyv123)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ProfileBackgroundImageURLHTTPS = "" - } else { - yyv125 := &x.ProfileBackgroundImageURLHTTPS - yym126 := z.DecBinary() - _ = yym126 - if false { - } else { - *((*string)(yyv125)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ProfileBackgroundTile = false - } else { - yyv127 := &x.ProfileBackgroundTile - yym128 := z.DecBinary() - _ = yym128 - if false { - } else { - *((*bool)(yyv127)) = r.DecodeBool() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ProfileImageURL = "" - } else { - yyv129 := &x.ProfileImageURL - yym130 := z.DecBinary() - _ = yym130 - if false { - } else { - *((*string)(yyv129)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ProfileImageURLHTTPS = "" - } else { - yyv131 := &x.ProfileImageURLHTTPS - yym132 := z.DecBinary() - _ = yym132 - if false { - } else { - *((*string)(yyv131)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ProfileLinkColor = "" - } else { - yyv133 := &x.ProfileLinkColor - yym134 := z.DecBinary() - _ = yym134 - if false { - } else { - *((*string)(yyv133)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ProfileSidebarBorderColor = "" - } else { - yyv135 := &x.ProfileSidebarBorderColor - yym136 := z.DecBinary() - _ = yym136 - if false { - } else { - *((*string)(yyv135)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ProfileSidebarFillColor = "" - } else { - yyv137 := &x.ProfileSidebarFillColor - yym138 := z.DecBinary() - _ = yym138 - if false { - } else { - *((*string)(yyv137)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ProfileTextColor = "" - } else { - yyv139 := &x.ProfileTextColor - yym140 := z.DecBinary() - _ = yym140 - if false { - } else { - *((*string)(yyv139)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ProfileUseBackgroundImage = false - } else { - yyv141 := &x.ProfileUseBackgroundImage - yym142 := z.DecBinary() - _ = yym142 - if false { - } else { - *((*bool)(yyv141)) = r.DecodeBool() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Protected = false - } else { - yyv143 := &x.Protected - yym144 := z.DecBinary() - _ = yym144 - if false { - } else { - *((*bool)(yyv143)) = r.DecodeBool() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ScreenName = "" - } else { - yyv145 := &x.ScreenName - yym146 := z.DecBinary() - _ = yym146 - if false { - } else { - *((*string)(yyv145)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ShowAllInlineMedia = false - } else { - yyv147 := &x.ShowAllInlineMedia - yym148 := z.DecBinary() - _ = yym148 - if false { - } else { - *((*bool)(yyv147)) = r.DecodeBool() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.StatusesCount = 0 - } else { - yyv149 := &x.StatusesCount - yym150 := z.DecBinary() - _ = yym150 - if false { - } else { - *((*int)(yyv149)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.TimeZone = "" - } else { - yyv151 := &x.TimeZone - yym152 := z.DecBinary() - _ = yym152 - if false { - } else { - *((*string)(yyv151)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - if x.URL != nil { - x.URL = nil - } - } else { - if x.URL == nil { - x.URL = new(string) - } - yym154 := z.DecBinary() - _ = yym154 - if false { - } else { - *((*string)(x.URL)) = r.DecodeString() - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.UtcOffset = 0 - } else { - yyv155 := &x.UtcOffset - yym156 := z.DecBinary() - _ = yym156 - if false { - } else { - *((*int)(yyv155)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Verified = false - } else { - yyv157 := &x.Verified - yym158 := z.DecBinary() - _ = yym158 - if false { - } else { - *((*bool)(yyv157)) = r.DecodeBool() - } - } - for { - yyj81++ - if yyhl81 { - yyb81 = yyj81 > l - } else { - yyb81 = r.CheckBreak() - } - if yyb81 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - z.DecStructFieldNotFound(yyj81-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) -} - -func (x *StatusMetadata) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [2]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(2) - } else { - yynn2 = 2 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.IsoLanguageCode)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("iso_language_code")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.IsoLanguageCode)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ResultType)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("result_type")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.ResultType)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd9225) - } - } - } -} - -func (x *StatusMetadata) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap9225 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd9225) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray9225 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr9225) - } - } -} - -func (x *StatusMetadata) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey9225) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3SlcHdr := codecSelferUnsafeString9225{uintptr(unsafe.Pointer(&yys3Slc[0])), len(yys3Slc)} - yys3 := *(*string)(unsafe.Pointer(&yys3SlcHdr)) - z.DecSendContainerState(codecSelfer_containerMapValue9225) - switch yys3 { - case "iso_language_code": - if r.TryDecodeAsNil() { - x.IsoLanguageCode = "" - } else { - yyv4 := &x.IsoLanguageCode - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyv4)) = r.DecodeString() - } - } - case "result_type": - if r.TryDecodeAsNil() { - x.ResultType = "" - } else { - yyv6 := &x.ResultType - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyv6)) = r.DecodeString() - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd9225) -} - -func (x *StatusMetadata) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj8 int - var yyb8 bool - var yyhl8 bool = l >= 0 - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.IsoLanguageCode = "" - } else { - yyv9 := &x.IsoLanguageCode - yym10 := z.DecBinary() - _ = yym10 - if false { - } else { - *((*string)(yyv9)) = r.DecodeString() - } - } - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ResultType = "" - } else { - yyv11 := &x.ResultType - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*string)(yyv11)) = r.DecodeString() - } - } - for { - yyj8++ - if yyhl8 { - yyb8 = yyj8 > l - } else { - yyb8 = r.CheckBreak() - } - if yyb8 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - z.DecStructFieldNotFound(yyj8-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) -} - -func (x *Status) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [21]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(21) - } else { - yynn2 = 21 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.Contributors == nil { - r.EncodeNil() - } else { - yy4 := *x.Contributors - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy4)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("contributors")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.Contributors == nil { - r.EncodeNil() - } else { - yy6 := *x.Contributors - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy6)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.Coordinates == nil { - r.EncodeNil() - } else { - yy9 := *x.Coordinates - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy9)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("coordinates")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.Coordinates == nil { - r.EncodeNil() - } else { - yy11 := *x.Coordinates - yym12 := z.EncBinary() - _ = yym12 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy11)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.CreatedAt)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("created_at")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym15 := z.EncBinary() - _ = yym15 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.CreatedAt)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yy17 := &x.Entities - yy17.CodecEncodeSelf(e) - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("entities")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yy19 := &x.Entities - yy19.CodecEncodeSelf(e) - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym22 := z.EncBinary() - _ = yym22 - if false { - } else { - r.EncodeBool(bool(x.Favorited)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("favorited")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym23 := z.EncBinary() - _ = yym23 - if false { - } else { - r.EncodeBool(bool(x.Favorited)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.Geo == nil { - r.EncodeNil() - } else { - yy25 := *x.Geo - yym26 := z.EncBinary() - _ = yym26 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy25)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("geo")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.Geo == nil { - r.EncodeNil() - } else { - yy27 := *x.Geo - yym28 := z.EncBinary() - _ = yym28 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy27)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym30 := z.EncBinary() - _ = yym30 - if false { - } else { - r.EncodeInt(int64(x.ID)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("id")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym31 := z.EncBinary() - _ = yym31 - if false { - } else { - r.EncodeInt(int64(x.ID)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym33 := z.EncBinary() - _ = yym33 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.IDStr)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("id_str")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym34 := z.EncBinary() - _ = yym34 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.IDStr)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.InReplyToScreenName == nil { - r.EncodeNil() - } else { - yy36 := *x.InReplyToScreenName - yym37 := z.EncBinary() - _ = yym37 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy36)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("in_reply_to_screen_name")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.InReplyToScreenName == nil { - r.EncodeNil() - } else { - yy38 := *x.InReplyToScreenName - yym39 := z.EncBinary() - _ = yym39 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy38)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.InReplyToStatusID == nil { - r.EncodeNil() - } else { - yy41 := *x.InReplyToStatusID - yym42 := z.EncBinary() - _ = yym42 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy41)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("in_reply_to_status_id")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.InReplyToStatusID == nil { - r.EncodeNil() - } else { - yy43 := *x.InReplyToStatusID - yym44 := z.EncBinary() - _ = yym44 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy43)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.InReplyToStatusIDStr == nil { - r.EncodeNil() - } else { - yy46 := *x.InReplyToStatusIDStr - yym47 := z.EncBinary() - _ = yym47 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy46)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("in_reply_to_status_id_str")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.InReplyToStatusIDStr == nil { - r.EncodeNil() - } else { - yy48 := *x.InReplyToStatusIDStr - yym49 := z.EncBinary() - _ = yym49 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy48)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.InReplyToUserID == nil { - r.EncodeNil() - } else { - yy51 := *x.InReplyToUserID - yym52 := z.EncBinary() - _ = yym52 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy51)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("in_reply_to_user_id")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.InReplyToUserID == nil { - r.EncodeNil() - } else { - yy53 := *x.InReplyToUserID - yym54 := z.EncBinary() - _ = yym54 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy53)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.InReplyToUserIDStr == nil { - r.EncodeNil() - } else { - yy56 := *x.InReplyToUserIDStr - yym57 := z.EncBinary() - _ = yym57 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy56)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("in_reply_to_user_id_str")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.InReplyToUserIDStr == nil { - r.EncodeNil() - } else { - yy58 := *x.InReplyToUserIDStr - yym59 := z.EncBinary() - _ = yym59 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy58)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yy61 := &x.Metadata - yy61.CodecEncodeSelf(e) - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yy63 := &x.Metadata - yy63.CodecEncodeSelf(e) - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.Place == nil { - r.EncodeNil() - } else { - yy66 := *x.Place - yym67 := z.EncBinary() - _ = yym67 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy66)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("place")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.Place == nil { - r.EncodeNil() - } else { - yy68 := *x.Place - yym69 := z.EncBinary() - _ = yym69 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy68)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym71 := z.EncBinary() - _ = yym71 - if false { - } else { - r.EncodeInt(int64(x.RetweetCount)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("retweet_count")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym72 := z.EncBinary() - _ = yym72 - if false { - } else { - r.EncodeInt(int64(x.RetweetCount)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym74 := z.EncBinary() - _ = yym74 - if false { - } else { - r.EncodeBool(bool(x.Retweeted)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("retweeted")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym75 := z.EncBinary() - _ = yym75 - if false { - } else { - r.EncodeBool(bool(x.Retweeted)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym77 := z.EncBinary() - _ = yym77 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.Source)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("source")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym78 := z.EncBinary() - _ = yym78 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.Source)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym80 := z.EncBinary() - _ = yym80 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.Text)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("text")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym81 := z.EncBinary() - _ = yym81 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(x.Text)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yym83 := z.EncBinary() - _ = yym83 - if false { - } else { - r.EncodeBool(bool(x.Truncated)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("truncated")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yym84 := z.EncBinary() - _ = yym84 - if false { - } else { - r.EncodeBool(bool(x.Truncated)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yy86 := &x.User - yy86.CodecEncodeSelf(e) - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("user")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yy88 := &x.User - yy88.CodecEncodeSelf(e) - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd9225) - } - } - } -} - -func (x *Status) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap9225 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd9225) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray9225 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr9225) - } - } -} - -func (x *Status) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey9225) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3SlcHdr := codecSelferUnsafeString9225{uintptr(unsafe.Pointer(&yys3Slc[0])), len(yys3Slc)} - yys3 := *(*string)(unsafe.Pointer(&yys3SlcHdr)) - z.DecSendContainerState(codecSelfer_containerMapValue9225) - switch yys3 { - case "contributors": - if r.TryDecodeAsNil() { - if x.Contributors != nil { - x.Contributors = nil - } - } else { - if x.Contributors == nil { - x.Contributors = new(string) - } - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(x.Contributors)) = r.DecodeString() - } - } - case "coordinates": - if r.TryDecodeAsNil() { - if x.Coordinates != nil { - x.Coordinates = nil - } - } else { - if x.Coordinates == nil { - x.Coordinates = new(string) - } - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(x.Coordinates)) = r.DecodeString() - } - } - case "created_at": - if r.TryDecodeAsNil() { - x.CreatedAt = "" - } else { - yyv8 := &x.CreatedAt - yym9 := z.DecBinary() - _ = yym9 - if false { - } else { - *((*string)(yyv8)) = r.DecodeString() - } - } - case "entities": - if r.TryDecodeAsNil() { - x.Entities = Entities{} - } else { - yyv10 := &x.Entities - yyv10.CodecDecodeSelf(d) - } - case "favorited": - if r.TryDecodeAsNil() { - x.Favorited = false - } else { - yyv11 := &x.Favorited - yym12 := z.DecBinary() - _ = yym12 - if false { - } else { - *((*bool)(yyv11)) = r.DecodeBool() - } - } - case "geo": - if r.TryDecodeAsNil() { - if x.Geo != nil { - x.Geo = nil - } - } else { - if x.Geo == nil { - x.Geo = new(string) - } - yym14 := z.DecBinary() - _ = yym14 - if false { - } else { - *((*string)(x.Geo)) = r.DecodeString() - } - } - case "id": - if r.TryDecodeAsNil() { - x.ID = 0 - } else { - yyv15 := &x.ID - yym16 := z.DecBinary() - _ = yym16 - if false { - } else { - *((*int64)(yyv15)) = int64(r.DecodeInt(64)) - } - } - case "id_str": - if r.TryDecodeAsNil() { - x.IDStr = "" - } else { - yyv17 := &x.IDStr - yym18 := z.DecBinary() - _ = yym18 - if false { - } else { - *((*string)(yyv17)) = r.DecodeString() - } - } - case "in_reply_to_screen_name": - if r.TryDecodeAsNil() { - if x.InReplyToScreenName != nil { - x.InReplyToScreenName = nil - } - } else { - if x.InReplyToScreenName == nil { - x.InReplyToScreenName = new(string) - } - yym20 := z.DecBinary() - _ = yym20 - if false { - } else { - *((*string)(x.InReplyToScreenName)) = r.DecodeString() - } - } - case "in_reply_to_status_id": - if r.TryDecodeAsNil() { - if x.InReplyToStatusID != nil { - x.InReplyToStatusID = nil - } - } else { - if x.InReplyToStatusID == nil { - x.InReplyToStatusID = new(string) - } - yym22 := z.DecBinary() - _ = yym22 - if false { - } else { - *((*string)(x.InReplyToStatusID)) = r.DecodeString() - } - } - case "in_reply_to_status_id_str": - if r.TryDecodeAsNil() { - if x.InReplyToStatusIDStr != nil { - x.InReplyToStatusIDStr = nil - } - } else { - if x.InReplyToStatusIDStr == nil { - x.InReplyToStatusIDStr = new(string) - } - yym24 := z.DecBinary() - _ = yym24 - if false { - } else { - *((*string)(x.InReplyToStatusIDStr)) = r.DecodeString() - } - } - case "in_reply_to_user_id": - if r.TryDecodeAsNil() { - if x.InReplyToUserID != nil { - x.InReplyToUserID = nil - } - } else { - if x.InReplyToUserID == nil { - x.InReplyToUserID = new(string) - } - yym26 := z.DecBinary() - _ = yym26 - if false { - } else { - *((*string)(x.InReplyToUserID)) = r.DecodeString() - } - } - case "in_reply_to_user_id_str": - if r.TryDecodeAsNil() { - if x.InReplyToUserIDStr != nil { - x.InReplyToUserIDStr = nil - } - } else { - if x.InReplyToUserIDStr == nil { - x.InReplyToUserIDStr = new(string) - } - yym28 := z.DecBinary() - _ = yym28 - if false { - } else { - *((*string)(x.InReplyToUserIDStr)) = r.DecodeString() - } - } - case "metadata": - if r.TryDecodeAsNil() { - x.Metadata = StatusMetadata{} - } else { - yyv29 := &x.Metadata - yyv29.CodecDecodeSelf(d) - } - case "place": - if r.TryDecodeAsNil() { - if x.Place != nil { - x.Place = nil - } - } else { - if x.Place == nil { - x.Place = new(string) - } - yym31 := z.DecBinary() - _ = yym31 - if false { - } else { - *((*string)(x.Place)) = r.DecodeString() - } - } - case "retweet_count": - if r.TryDecodeAsNil() { - x.RetweetCount = 0 - } else { - yyv32 := &x.RetweetCount - yym33 := z.DecBinary() - _ = yym33 - if false { - } else { - *((*int)(yyv32)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - case "retweeted": - if r.TryDecodeAsNil() { - x.Retweeted = false - } else { - yyv34 := &x.Retweeted - yym35 := z.DecBinary() - _ = yym35 - if false { - } else { - *((*bool)(yyv34)) = r.DecodeBool() - } - } - case "source": - if r.TryDecodeAsNil() { - x.Source = "" - } else { - yyv36 := &x.Source - yym37 := z.DecBinary() - _ = yym37 - if false { - } else { - *((*string)(yyv36)) = r.DecodeString() - } - } - case "text": - if r.TryDecodeAsNil() { - x.Text = "" - } else { - yyv38 := &x.Text - yym39 := z.DecBinary() - _ = yym39 - if false { - } else { - *((*string)(yyv38)) = r.DecodeString() - } - } - case "truncated": - if r.TryDecodeAsNil() { - x.Truncated = false - } else { - yyv40 := &x.Truncated - yym41 := z.DecBinary() - _ = yym41 - if false { - } else { - *((*bool)(yyv40)) = r.DecodeBool() - } - } - case "user": - if r.TryDecodeAsNil() { - x.User = User{} - } else { - yyv42 := &x.User - yyv42.CodecDecodeSelf(d) - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd9225) -} - -func (x *Status) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj43 int - var yyb43 bool - var yyhl43 bool = l >= 0 - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - if x.Contributors != nil { - x.Contributors = nil - } - } else { - if x.Contributors == nil { - x.Contributors = new(string) - } - yym45 := z.DecBinary() - _ = yym45 - if false { - } else { - *((*string)(x.Contributors)) = r.DecodeString() - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - if x.Coordinates != nil { - x.Coordinates = nil - } - } else { - if x.Coordinates == nil { - x.Coordinates = new(string) - } - yym47 := z.DecBinary() - _ = yym47 - if false { - } else { - *((*string)(x.Coordinates)) = r.DecodeString() - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.CreatedAt = "" - } else { - yyv48 := &x.CreatedAt - yym49 := z.DecBinary() - _ = yym49 - if false { - } else { - *((*string)(yyv48)) = r.DecodeString() - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Entities = Entities{} - } else { - yyv50 := &x.Entities - yyv50.CodecDecodeSelf(d) - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Favorited = false - } else { - yyv51 := &x.Favorited - yym52 := z.DecBinary() - _ = yym52 - if false { - } else { - *((*bool)(yyv51)) = r.DecodeBool() - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - if x.Geo != nil { - x.Geo = nil - } - } else { - if x.Geo == nil { - x.Geo = new(string) - } - yym54 := z.DecBinary() - _ = yym54 - if false { - } else { - *((*string)(x.Geo)) = r.DecodeString() - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.ID = 0 - } else { - yyv55 := &x.ID - yym56 := z.DecBinary() - _ = yym56 - if false { - } else { - *((*int64)(yyv55)) = int64(r.DecodeInt(64)) - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.IDStr = "" - } else { - yyv57 := &x.IDStr - yym58 := z.DecBinary() - _ = yym58 - if false { - } else { - *((*string)(yyv57)) = r.DecodeString() - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - if x.InReplyToScreenName != nil { - x.InReplyToScreenName = nil - } - } else { - if x.InReplyToScreenName == nil { - x.InReplyToScreenName = new(string) - } - yym60 := z.DecBinary() - _ = yym60 - if false { - } else { - *((*string)(x.InReplyToScreenName)) = r.DecodeString() - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - if x.InReplyToStatusID != nil { - x.InReplyToStatusID = nil - } - } else { - if x.InReplyToStatusID == nil { - x.InReplyToStatusID = new(string) - } - yym62 := z.DecBinary() - _ = yym62 - if false { - } else { - *((*string)(x.InReplyToStatusID)) = r.DecodeString() - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - if x.InReplyToStatusIDStr != nil { - x.InReplyToStatusIDStr = nil - } - } else { - if x.InReplyToStatusIDStr == nil { - x.InReplyToStatusIDStr = new(string) - } - yym64 := z.DecBinary() - _ = yym64 - if false { - } else { - *((*string)(x.InReplyToStatusIDStr)) = r.DecodeString() - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - if x.InReplyToUserID != nil { - x.InReplyToUserID = nil - } - } else { - if x.InReplyToUserID == nil { - x.InReplyToUserID = new(string) - } - yym66 := z.DecBinary() - _ = yym66 - if false { - } else { - *((*string)(x.InReplyToUserID)) = r.DecodeString() - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - if x.InReplyToUserIDStr != nil { - x.InReplyToUserIDStr = nil - } - } else { - if x.InReplyToUserIDStr == nil { - x.InReplyToUserIDStr = new(string) - } - yym68 := z.DecBinary() - _ = yym68 - if false { - } else { - *((*string)(x.InReplyToUserIDStr)) = r.DecodeString() - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Metadata = StatusMetadata{} - } else { - yyv69 := &x.Metadata - yyv69.CodecDecodeSelf(d) - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - if x.Place != nil { - x.Place = nil - } - } else { - if x.Place == nil { - x.Place = new(string) - } - yym71 := z.DecBinary() - _ = yym71 - if false { - } else { - *((*string)(x.Place)) = r.DecodeString() - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.RetweetCount = 0 - } else { - yyv72 := &x.RetweetCount - yym73 := z.DecBinary() - _ = yym73 - if false { - } else { - *((*int)(yyv72)) = int(r.DecodeInt(codecSelferBitsize9225)) - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Retweeted = false - } else { - yyv74 := &x.Retweeted - yym75 := z.DecBinary() - _ = yym75 - if false { - } else { - *((*bool)(yyv74)) = r.DecodeBool() - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Source = "" - } else { - yyv76 := &x.Source - yym77 := z.DecBinary() - _ = yym77 - if false { - } else { - *((*string)(yyv76)) = r.DecodeString() - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Text = "" - } else { - yyv78 := &x.Text - yym79 := z.DecBinary() - _ = yym79 - if false { - } else { - *((*string)(yyv78)) = r.DecodeString() - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Truncated = false - } else { - yyv80 := &x.Truncated - yym81 := z.DecBinary() - _ = yym81 - if false { - } else { - *((*bool)(yyv80)) = r.DecodeBool() - } - } - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.User = User{} - } else { - yyv82 := &x.User - yyv82.CodecDecodeSelf(d) - } - for { - yyj43++ - if yyhl43 { - yyb43 = yyj43 > l - } else { - yyb43 = r.CheckBreak() - } - if yyb43 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - z.DecStructFieldNotFound(yyj43-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) -} - -func (x *LargeStruct) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [2]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(2) - } else { - yynn2 = 2 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yy4 := &x.SearchMetadata - yy4.CodecEncodeSelf(e) - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("search_metadata")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - yy6 := &x.SearchMetadata - yy6.CodecEncodeSelf(e) - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.Statuses == nil { - r.EncodeNil() - } else { - yym9 := z.EncBinary() - _ = yym9 - if false { - } else { - h.encSliceStatus(([]Status)(x.Statuses), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("statuses")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.Statuses == nil { - r.EncodeNil() - } else { - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - h.encSliceStatus(([]Status)(x.Statuses), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd9225) - } - } - } -} - -func (x *LargeStruct) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap9225 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd9225) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray9225 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr9225) - } - } -} - -func (x *LargeStruct) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey9225) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3SlcHdr := codecSelferUnsafeString9225{uintptr(unsafe.Pointer(&yys3Slc[0])), len(yys3Slc)} - yys3 := *(*string)(unsafe.Pointer(&yys3SlcHdr)) - z.DecSendContainerState(codecSelfer_containerMapValue9225) - switch yys3 { - case "search_metadata": - if r.TryDecodeAsNil() { - x.SearchMetadata = SearchMetadata{} - } else { - yyv4 := &x.SearchMetadata - yyv4.CodecDecodeSelf(d) - } - case "statuses": - if r.TryDecodeAsNil() { - x.Statuses = nil - } else { - yyv5 := &x.Statuses - yym6 := z.DecBinary() - _ = yym6 - if false { - } else { - h.decSliceStatus((*[]Status)(yyv5), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd9225) -} - -func (x *LargeStruct) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj7 int - var yyb7 bool - var yyhl7 bool = l >= 0 - yyj7++ - if yyhl7 { - yyb7 = yyj7 > l - } else { - yyb7 = r.CheckBreak() - } - if yyb7 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.SearchMetadata = SearchMetadata{} - } else { - yyv8 := &x.SearchMetadata - yyv8.CodecDecodeSelf(d) - } - yyj7++ - if yyhl7 { - yyb7 = yyj7 > l - } else { - yyb7 = r.CheckBreak() - } - if yyb7 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Statuses = nil - } else { - yyv9 := &x.Statuses - yym10 := z.DecBinary() - _ = yym10 - if false { - } else { - h.decSliceStatus((*[]Status)(yyv9), d) - } - } - for { - yyj7++ - if yyhl7 { - yyb7 = yyj7 > l - } else { - yyb7 = r.CheckBreak() - } - if yyb7 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - z.DecStructFieldNotFound(yyj7-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) -} - -func (x *XLStruct) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [1]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(1) - } else { - yynn2 = 1 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if x.Data == nil { - r.EncodeNil() - } else { - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - h.encSliceLargeStruct(([]LargeStruct)(x.Data), e) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey9225) - r.EncodeString(codecSelferC_UTF89225, string("Data")) - z.EncSendContainerState(codecSelfer_containerMapValue9225) - if x.Data == nil { - r.EncodeNil() - } else { - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - h.encSliceLargeStruct(([]LargeStruct)(x.Data), e) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd9225) - } - } - } -} - -func (x *XLStruct) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym1 := z.DecBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct2 := r.ContainerType() - if yyct2 == codecSelferValueTypeMap9225 { - yyl2 := r.ReadMapStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd9225) - } else { - x.codecDecodeSelfFromMap(yyl2, d) - } - } else if yyct2 == codecSelferValueTypeArray9225 { - yyl2 := r.ReadArrayStart() - if yyl2 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - } else { - x.codecDecodeSelfFromArray(yyl2, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr9225) - } - } -} - -func (x *XLStruct) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys3Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys3Slc - var yyhl3 bool = l >= 0 - for yyj3 := 0; ; yyj3++ { - if yyhl3 { - if yyj3 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey9225) - yys3Slc = r.DecodeBytes(yys3Slc, true, true) - yys3SlcHdr := codecSelferUnsafeString9225{uintptr(unsafe.Pointer(&yys3Slc[0])), len(yys3Slc)} - yys3 := *(*string)(unsafe.Pointer(&yys3SlcHdr)) - z.DecSendContainerState(codecSelfer_containerMapValue9225) - switch yys3 { - case "Data": - if r.TryDecodeAsNil() { - x.Data = nil - } else { - yyv4 := &x.Data - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - h.decSliceLargeStruct((*[]LargeStruct)(yyv4), d) - } - } - default: - z.DecStructFieldNotFound(-1, yys3) - } // end switch yys3 - } // end for yyj3 - z.DecSendContainerState(codecSelfer_containerMapEnd9225) -} - -func (x *XLStruct) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj6 int - var yyb6 bool - var yyhl6 bool = l >= 0 - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - if r.TryDecodeAsNil() { - x.Data = nil - } else { - yyv7 := &x.Data - yym8 := z.DecBinary() - _ = yym8 - if false { - } else { - h.decSliceLargeStruct((*[]LargeStruct)(yyv7), d) - } - } - for { - yyj6++ - if yyhl6 { - yyb6 = yyj6 > l - } else { - yyb6 = r.CheckBreak() - } - if yyb6 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem9225) - z.DecStructFieldNotFound(yyj6-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd9225) -} - -func (x codecSelfer9225) encSliceHashtag(v []Hashtag, e *codec1978.Encoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yy2 := &yyv1 - yy2.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd9225) -} - -func (x codecSelfer9225) decSliceHashtag(v *[]Hashtag, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyh1, yyl1 := z.DecSliceHelperStart() - var yyc1 bool - _ = yyc1 - if yyl1 == 0 { - if yyv1 == nil { - yyv1 = []Hashtag{} - yyc1 = true - } else if len(yyv1) != 0 { - yyv1 = yyv1[:0] - yyc1 = true - } - } else if yyl1 > 0 { - var yyrr1, yyrl1 int - var yyrt1 bool - _, _ = yyrl1, yyrt1 - yyrr1 = yyl1 // len(yyv1) - if yyl1 > cap(yyv1) { - - yyrg1 := len(yyv1) > 0 - yyv21 := yyv1 - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 40) - if yyrt1 { - if yyrl1 <= cap(yyv1) { - yyv1 = yyv1[:yyrl1] - } else { - yyv1 = make([]Hashtag, yyrl1) - } - } else { - yyv1 = make([]Hashtag, yyrl1) - } - yyc1 = true - yyrr1 = len(yyv1) - if yyrg1 { - copy(yyv1, yyv21) - } - } else if yyl1 != len(yyv1) { - yyv1 = yyv1[:yyl1] - yyc1 = true - } - yyj1 := 0 - for ; yyj1 < yyrr1; yyj1++ { - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - yyv1[yyj1] = Hashtag{} - } else { - yyv2 := &yyv1[yyj1] - yyv2.CodecDecodeSelf(d) - } - - } - if yyrt1 { - for ; yyj1 < yyl1; yyj1++ { - yyv1 = append(yyv1, Hashtag{}) - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - yyv1[yyj1] = Hashtag{} - } else { - yyv3 := &yyv1[yyj1] - yyv3.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj1 := 0 - for ; !r.CheckBreak(); yyj1++ { - - if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, Hashtag{}) // var yyz1 Hashtag - yyc1 = true - } - yyh1.ElemContainerState(yyj1) - if yyj1 < len(yyv1) { - if r.TryDecodeAsNil() { - yyv1[yyj1] = Hashtag{} - } else { - yyv4 := &yyv1[yyj1] - yyv4.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj1 < len(yyv1) { - yyv1 = yyv1[:yyj1] - yyc1 = true - } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []Hashtag{} - yyc1 = true - } - } - yyh1.End() - if yyc1 { - *v = yyv1 - } -} - -func (x codecSelfer9225) encSlicePtrtostring(v []*string, e *codec1978.Encoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - if yyv1 == nil { - r.EncodeNil() - } else { - yy2 := *yyv1 - yym3 := z.EncBinary() - _ = yym3 - if false { - } else { - r.EncodeString(codecSelferC_UTF89225, string(yy2)) - } - } - } - z.EncSendContainerState(codecSelfer_containerArrayEnd9225) -} - -func (x codecSelfer9225) decSlicePtrtostring(v *[]*string, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyh1, yyl1 := z.DecSliceHelperStart() - var yyc1 bool - _ = yyc1 - if yyl1 == 0 { - if yyv1 == nil { - yyv1 = []*string{} - yyc1 = true - } else if len(yyv1) != 0 { - yyv1 = yyv1[:0] - yyc1 = true - } - } else if yyl1 > 0 { - var yyrr1, yyrl1 int - var yyrt1 bool - _, _ = yyrl1, yyrt1 - yyrr1 = yyl1 // len(yyv1) - if yyl1 > cap(yyv1) { - - yyrg1 := len(yyv1) > 0 - yyv21 := yyv1 - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8) - if yyrt1 { - if yyrl1 <= cap(yyv1) { - yyv1 = yyv1[:yyrl1] - } else { - yyv1 = make([]*string, yyrl1) - } - } else { - yyv1 = make([]*string, yyrl1) - } - yyc1 = true - yyrr1 = len(yyv1) - if yyrg1 { - copy(yyv1, yyv21) - } - } else if yyl1 != len(yyv1) { - yyv1 = yyv1[:yyl1] - yyc1 = true - } - yyj1 := 0 - for ; yyj1 < yyrr1; yyj1++ { - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = "" - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(string) - } - yyw2 := yyv1[yyj1] - yym3 := z.DecBinary() - _ = yym3 - if false { - } else { - *((*string)(yyw2)) = r.DecodeString() - } - } - - } - if yyrt1 { - for ; yyj1 < yyl1; yyj1++ { - yyv1 = append(yyv1, nil) - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = "" - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(string) - } - yyw4 := yyv1[yyj1] - yym5 := z.DecBinary() - _ = yym5 - if false { - } else { - *((*string)(yyw4)) = r.DecodeString() - } - } - - } - } - - } else { - yyj1 := 0 - for ; !r.CheckBreak(); yyj1++ { - - if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, nil) // var yyz1 *string - yyc1 = true - } - yyh1.ElemContainerState(yyj1) - if yyj1 < len(yyv1) { - if r.TryDecodeAsNil() { - if yyv1[yyj1] != nil { - *yyv1[yyj1] = "" - } - } else { - if yyv1[yyj1] == nil { - yyv1[yyj1] = new(string) - } - yyw6 := yyv1[yyj1] - yym7 := z.DecBinary() - _ = yym7 - if false { - } else { - *((*string)(yyw6)) = r.DecodeString() - } - } - - } else { - z.DecSwallow() - } - - } - if yyj1 < len(yyv1) { - yyv1 = yyv1[:yyj1] - yyc1 = true - } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []*string{} - yyc1 = true - } - } - yyh1.End() - if yyc1 { - *v = yyv1 - } -} - -func (x codecSelfer9225) encSliceURL(v []URL, e *codec1978.Encoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yy2 := &yyv1 - yy2.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd9225) -} - -func (x codecSelfer9225) decSliceURL(v *[]URL, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyh1, yyl1 := z.DecSliceHelperStart() - var yyc1 bool - _ = yyc1 - if yyl1 == 0 { - if yyv1 == nil { - yyv1 = []URL{} - yyc1 = true - } else if len(yyv1) != 0 { - yyv1 = yyv1[:0] - yyc1 = true - } - } else if yyl1 > 0 { - var yyrr1, yyrl1 int - var yyrt1 bool - _, _ = yyrl1, yyrt1 - yyrr1 = yyl1 // len(yyv1) - if yyl1 > cap(yyv1) { - - yyrg1 := len(yyv1) > 0 - yyv21 := yyv1 - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 48) - if yyrt1 { - if yyrl1 <= cap(yyv1) { - yyv1 = yyv1[:yyrl1] - } else { - yyv1 = make([]URL, yyrl1) - } - } else { - yyv1 = make([]URL, yyrl1) - } - yyc1 = true - yyrr1 = len(yyv1) - if yyrg1 { - copy(yyv1, yyv21) - } - } else if yyl1 != len(yyv1) { - yyv1 = yyv1[:yyl1] - yyc1 = true - } - yyj1 := 0 - for ; yyj1 < yyrr1; yyj1++ { - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - yyv1[yyj1] = URL{} - } else { - yyv2 := &yyv1[yyj1] - yyv2.CodecDecodeSelf(d) - } - - } - if yyrt1 { - for ; yyj1 < yyl1; yyj1++ { - yyv1 = append(yyv1, URL{}) - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - yyv1[yyj1] = URL{} - } else { - yyv3 := &yyv1[yyj1] - yyv3.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj1 := 0 - for ; !r.CheckBreak(); yyj1++ { - - if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, URL{}) // var yyz1 URL - yyc1 = true - } - yyh1.ElemContainerState(yyj1) - if yyj1 < len(yyv1) { - if r.TryDecodeAsNil() { - yyv1[yyj1] = URL{} - } else { - yyv4 := &yyv1[yyj1] - yyv4.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj1 < len(yyv1) { - yyv1 = yyv1[:yyj1] - yyc1 = true - } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []URL{} - yyc1 = true - } - } - yyh1.End() - if yyc1 { - *v = yyv1 - } -} - -func (x codecSelfer9225) encSliceStatus(v []Status, e *codec1978.Encoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yy2 := &yyv1 - yy2.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd9225) -} - -func (x codecSelfer9225) decSliceStatus(v *[]Status, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyh1, yyl1 := z.DecSliceHelperStart() - var yyc1 bool - _ = yyc1 - if yyl1 == 0 { - if yyv1 == nil { - yyv1 = []Status{} - yyc1 = true - } else if len(yyv1) != 0 { - yyv1 = yyv1[:0] - yyc1 = true - } - } else if yyl1 > 0 { - var yyrr1, yyrl1 int - var yyrt1 bool - _, _ = yyrl1, yyrt1 - yyrr1 = yyl1 // len(yyv1) - if yyl1 > cap(yyv1) { - - yyrg1 := len(yyv1) > 0 - yyv21 := yyv1 - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 752) - if yyrt1 { - if yyrl1 <= cap(yyv1) { - yyv1 = yyv1[:yyrl1] - } else { - yyv1 = make([]Status, yyrl1) - } - } else { - yyv1 = make([]Status, yyrl1) - } - yyc1 = true - yyrr1 = len(yyv1) - if yyrg1 { - copy(yyv1, yyv21) - } - } else if yyl1 != len(yyv1) { - yyv1 = yyv1[:yyl1] - yyc1 = true - } - yyj1 := 0 - for ; yyj1 < yyrr1; yyj1++ { - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - yyv1[yyj1] = Status{} - } else { - yyv2 := &yyv1[yyj1] - yyv2.CodecDecodeSelf(d) - } - - } - if yyrt1 { - for ; yyj1 < yyl1; yyj1++ { - yyv1 = append(yyv1, Status{}) - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - yyv1[yyj1] = Status{} - } else { - yyv3 := &yyv1[yyj1] - yyv3.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj1 := 0 - for ; !r.CheckBreak(); yyj1++ { - - if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, Status{}) // var yyz1 Status - yyc1 = true - } - yyh1.ElemContainerState(yyj1) - if yyj1 < len(yyv1) { - if r.TryDecodeAsNil() { - yyv1[yyj1] = Status{} - } else { - yyv4 := &yyv1[yyj1] - yyv4.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj1 < len(yyv1) { - yyv1 = yyv1[:yyj1] - yyc1 = true - } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []Status{} - yyc1 = true - } - } - yyh1.End() - if yyc1 { - *v = yyv1 - } -} - -func (x codecSelfer9225) encSliceLargeStruct(v []LargeStruct, e *codec1978.Encoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - r.EncodeArrayStart(len(v)) - for _, yyv1 := range v { - z.EncSendContainerState(codecSelfer_containerArrayElem9225) - yy2 := &yyv1 - yy2.CodecEncodeSelf(e) - } - z.EncSendContainerState(codecSelfer_containerArrayEnd9225) -} - -func (x codecSelfer9225) decSliceLargeStruct(v *[]LargeStruct, d *codec1978.Decoder) { - var h codecSelfer9225 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - - yyv1 := *v - yyh1, yyl1 := z.DecSliceHelperStart() - var yyc1 bool - _ = yyc1 - if yyl1 == 0 { - if yyv1 == nil { - yyv1 = []LargeStruct{} - yyc1 = true - } else if len(yyv1) != 0 { - yyv1 = yyv1[:0] - yyc1 = true - } - } else if yyl1 > 0 { - var yyrr1, yyrl1 int - var yyrt1 bool - _, _ = yyrl1, yyrt1 - yyrr1 = yyl1 // len(yyv1) - if yyl1 > cap(yyv1) { - - yyrg1 := len(yyv1) > 0 - yyv21 := yyv1 - yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 136) - if yyrt1 { - if yyrl1 <= cap(yyv1) { - yyv1 = yyv1[:yyrl1] - } else { - yyv1 = make([]LargeStruct, yyrl1) - } - } else { - yyv1 = make([]LargeStruct, yyrl1) - } - yyc1 = true - yyrr1 = len(yyv1) - if yyrg1 { - copy(yyv1, yyv21) - } - } else if yyl1 != len(yyv1) { - yyv1 = yyv1[:yyl1] - yyc1 = true - } - yyj1 := 0 - for ; yyj1 < yyrr1; yyj1++ { - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - yyv1[yyj1] = LargeStruct{} - } else { - yyv2 := &yyv1[yyj1] - yyv2.CodecDecodeSelf(d) - } - - } - if yyrt1 { - for ; yyj1 < yyl1; yyj1++ { - yyv1 = append(yyv1, LargeStruct{}) - yyh1.ElemContainerState(yyj1) - if r.TryDecodeAsNil() { - yyv1[yyj1] = LargeStruct{} - } else { - yyv3 := &yyv1[yyj1] - yyv3.CodecDecodeSelf(d) - } - - } - } - - } else { - yyj1 := 0 - for ; !r.CheckBreak(); yyj1++ { - - if yyj1 >= len(yyv1) { - yyv1 = append(yyv1, LargeStruct{}) // var yyz1 LargeStruct - yyc1 = true - } - yyh1.ElemContainerState(yyj1) - if yyj1 < len(yyv1) { - if r.TryDecodeAsNil() { - yyv1[yyj1] = LargeStruct{} - } else { - yyv4 := &yyv1[yyj1] - yyv4.CodecDecodeSelf(d) - } - - } else { - z.DecSwallow() - } - - } - if yyj1 < len(yyv1) { - yyv1 = yyv1[:yyj1] - yyc1 = true - } else if yyj1 == 0 && yyv1 == nil { - yyv1 = []LargeStruct{} - yyc1 = true - } - } - yyh1.End() - if yyc1 { - *v = yyv1 - } -} diff --git a/vendor/github.com/mailru/easyjson/benchmark/data_ffjson.go b/vendor/github.com/mailru/easyjson/benchmark/data_ffjson.go deleted file mode 100644 index 9f000d3a..00000000 --- a/vendor/github.com/mailru/easyjson/benchmark/data_ffjson.go +++ /dev/null @@ -1,6723 +0,0 @@ -// +build use_ffjson - -// DO NOT EDIT! -// Code generated by ffjson -// source: .root/src/github.com/mailru/easyjson/benchmark/data.go -// DO NOT EDIT! - -package benchmark - -import ( - "bytes" - "errors" - "fmt" - fflib "github.com/pquerna/ffjson/fflib/v1" -) - -func (mj *Entities) MarshalJSON() ([]byte, error) { - var buf fflib.Buffer - if mj == nil { - buf.WriteString("null") - return buf.Bytes(), nil - } - err := mj.MarshalJSONBuf(&buf) - if err != nil { - return nil, err - } - return buf.Bytes(), nil -} -func (mj *Entities) MarshalJSONBuf(buf fflib.EncodingBuffer) error { - if mj == nil { - buf.WriteString("null") - return nil - } - var err error - var obj []byte - _ = obj - _ = err - buf.WriteString(`{"hashtags":`) - if mj.Hashtags != nil { - buf.WriteString(`[`) - for i, v := range mj.Hashtags { - if i != 0 { - buf.WriteString(`,`) - } - - { - - err = v.MarshalJSONBuf(buf) - if err != nil { - return err - } - - } - } - buf.WriteString(`]`) - } else { - buf.WriteString(`null`) - } - buf.WriteString(`,"urls":`) - if mj.Urls != nil { - buf.WriteString(`[`) - for i, v := range mj.Urls { - if i != 0 { - buf.WriteString(`,`) - } - if v != nil { - fflib.WriteJsonString(buf, string(*v)) - } else { - buf.WriteString(`null`) - } - } - buf.WriteString(`]`) - } else { - buf.WriteString(`null`) - } - buf.WriteString(`,"user_mentions":`) - if mj.UserMentions != nil { - buf.WriteString(`[`) - for i, v := range mj.UserMentions { - if i != 0 { - buf.WriteString(`,`) - } - if v != nil { - fflib.WriteJsonString(buf, string(*v)) - } else { - buf.WriteString(`null`) - } - } - buf.WriteString(`]`) - } else { - buf.WriteString(`null`) - } - buf.WriteByte('}') - return nil -} - -const ( - ffj_t_Entitiesbase = iota - ffj_t_Entitiesno_such_key - - ffj_t_Entities_Hashtags - - ffj_t_Entities_Urls - - ffj_t_Entities_UserMentions -) - -var ffj_key_Entities_Hashtags = []byte("hashtags") - -var ffj_key_Entities_Urls = []byte("urls") - -var ffj_key_Entities_UserMentions = []byte("user_mentions") - -func (uj *Entities) UnmarshalJSON(input []byte) error { - fs := fflib.NewFFLexer(input) - return uj.UnmarshalJSONFFLexer(fs, fflib.FFParse_map_start) -} - -func (uj *Entities) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error { - var err error = nil - currentKey := ffj_t_Entitiesbase - _ = currentKey - tok := fflib.FFTok_init - wantedTok := fflib.FFTok_init - -mainparse: - for { - tok = fs.Scan() - // println(fmt.Sprintf("debug: tok: %v state: %v", tok, state)) - if tok == fflib.FFTok_error { - goto tokerror - } - - switch state { - - case fflib.FFParse_map_start: - if tok != fflib.FFTok_left_bracket { - wantedTok = fflib.FFTok_left_bracket - goto wrongtokenerror - } - state = fflib.FFParse_want_key - continue - - case fflib.FFParse_after_value: - if tok == fflib.FFTok_comma { - state = fflib.FFParse_want_key - } else if tok == fflib.FFTok_right_bracket { - goto done - } else { - wantedTok = fflib.FFTok_comma - goto wrongtokenerror - } - - case fflib.FFParse_want_key: - // json {} ended. goto exit. woo. - if tok == fflib.FFTok_right_bracket { - goto done - } - if tok != fflib.FFTok_string { - wantedTok = fflib.FFTok_string - goto wrongtokenerror - } - - kn := fs.Output.Bytes() - if len(kn) <= 0 { - // "" case. hrm. - currentKey = ffj_t_Entitiesno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } else { - switch kn[0] { - - case 'h': - - if bytes.Equal(ffj_key_Entities_Hashtags, kn) { - currentKey = ffj_t_Entities_Hashtags - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'u': - - if bytes.Equal(ffj_key_Entities_Urls, kn) { - currentKey = ffj_t_Entities_Urls - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_Entities_UserMentions, kn) { - currentKey = ffj_t_Entities_UserMentions - state = fflib.FFParse_want_colon - goto mainparse - } - - } - - if fflib.EqualFoldRight(ffj_key_Entities_UserMentions, kn) { - currentKey = ffj_t_Entities_UserMentions - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_Entities_Urls, kn) { - currentKey = ffj_t_Entities_Urls - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_Entities_Hashtags, kn) { - currentKey = ffj_t_Entities_Hashtags - state = fflib.FFParse_want_colon - goto mainparse - } - - currentKey = ffj_t_Entitiesno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } - - case fflib.FFParse_want_colon: - if tok != fflib.FFTok_colon { - wantedTok = fflib.FFTok_colon - goto wrongtokenerror - } - state = fflib.FFParse_want_value - continue - case fflib.FFParse_want_value: - - if tok == fflib.FFTok_left_brace || tok == fflib.FFTok_left_bracket || tok == fflib.FFTok_integer || tok == fflib.FFTok_double || tok == fflib.FFTok_string || tok == fflib.FFTok_bool || tok == fflib.FFTok_null { - switch currentKey { - - case ffj_t_Entities_Hashtags: - goto handle_Hashtags - - case ffj_t_Entities_Urls: - goto handle_Urls - - case ffj_t_Entities_UserMentions: - goto handle_UserMentions - - case ffj_t_Entitiesno_such_key: - err = fs.SkipField(tok) - if err != nil { - return fs.WrapErr(err) - } - state = fflib.FFParse_after_value - goto mainparse - } - } else { - goto wantedvalue - } - } - } - -handle_Hashtags: - - /* handler: uj.Hashtags type=[]benchmark.Hashtag kind=slice quoted=false*/ - - { - - { - if tok != fflib.FFTok_left_brace && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for ", tok)) - } - } - - if tok == fflib.FFTok_null { - uj.Hashtags = nil - } else { - - uj.Hashtags = make([]Hashtag, 0) - - wantVal := true - - for { - - var tmp_uj__Hashtags Hashtag - - tok = fs.Scan() - if tok == fflib.FFTok_error { - goto tokerror - } - if tok == fflib.FFTok_right_brace { - break - } - - if tok == fflib.FFTok_comma { - if wantVal == true { - // TODO(pquerna): this isn't an ideal error message, this handles - // things like [,,,] as an array value. - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) - } - continue - } else { - wantVal = true - } - - /* handler: tmp_uj__Hashtags type=benchmark.Hashtag kind=struct quoted=false*/ - - { - if tok == fflib.FFTok_null { - - state = fflib.FFParse_after_value - goto mainparse - } - - err = tmp_uj__Hashtags.UnmarshalJSONFFLexer(fs, fflib.FFParse_want_key) - if err != nil { - return err - } - state = fflib.FFParse_after_value - } - - uj.Hashtags = append(uj.Hashtags, tmp_uj__Hashtags) - wantVal = false - } - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Urls: - - /* handler: uj.Urls type=[]*string kind=slice quoted=false*/ - - { - - { - if tok != fflib.FFTok_left_brace && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for ", tok)) - } - } - - if tok == fflib.FFTok_null { - uj.Urls = nil - } else { - - uj.Urls = make([]*string, 0) - - wantVal := true - - for { - - var tmp_uj__Urls *string - - tok = fs.Scan() - if tok == fflib.FFTok_error { - goto tokerror - } - if tok == fflib.FFTok_right_brace { - break - } - - if tok == fflib.FFTok_comma { - if wantVal == true { - // TODO(pquerna): this isn't an ideal error message, this handles - // things like [,,,] as an array value. - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) - } - continue - } else { - wantVal = true - } - - /* handler: tmp_uj__Urls type=*string kind=ptr quoted=false*/ - - { - - if tok == fflib.FFTok_null { - tmp_uj__Urls = nil - } else { - if tmp_uj__Urls == nil { - tmp_uj__Urls = new(string) - } - - /* handler: tmp_uj__Urls type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - tmp_uj__Urls = nil - - } else { - - var tval string - outBuf := fs.Output.Bytes() - - tval = string(string(outBuf)) - tmp_uj__Urls = &tval - - } - } - - } - } - - uj.Urls = append(uj.Urls, tmp_uj__Urls) - wantVal = false - } - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_UserMentions: - - /* handler: uj.UserMentions type=[]*string kind=slice quoted=false*/ - - { - - { - if tok != fflib.FFTok_left_brace && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for ", tok)) - } - } - - if tok == fflib.FFTok_null { - uj.UserMentions = nil - } else { - - uj.UserMentions = make([]*string, 0) - - wantVal := true - - for { - - var tmp_uj__UserMentions *string - - tok = fs.Scan() - if tok == fflib.FFTok_error { - goto tokerror - } - if tok == fflib.FFTok_right_brace { - break - } - - if tok == fflib.FFTok_comma { - if wantVal == true { - // TODO(pquerna): this isn't an ideal error message, this handles - // things like [,,,] as an array value. - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) - } - continue - } else { - wantVal = true - } - - /* handler: tmp_uj__UserMentions type=*string kind=ptr quoted=false*/ - - { - - if tok == fflib.FFTok_null { - tmp_uj__UserMentions = nil - } else { - if tmp_uj__UserMentions == nil { - tmp_uj__UserMentions = new(string) - } - - /* handler: tmp_uj__UserMentions type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - tmp_uj__UserMentions = nil - - } else { - - var tval string - outBuf := fs.Output.Bytes() - - tval = string(string(outBuf)) - tmp_uj__UserMentions = &tval - - } - } - - } - } - - uj.UserMentions = append(uj.UserMentions, tmp_uj__UserMentions) - wantVal = false - } - } - } - - state = fflib.FFParse_after_value - goto mainparse - -wantedvalue: - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) -wrongtokenerror: - return fs.WrapErr(fmt.Errorf("ffjson: wanted token: %v, but got token: %v output=%s", wantedTok, tok, fs.Output.String())) -tokerror: - if fs.BigError != nil { - return fs.WrapErr(fs.BigError) - } - err = fs.Error.ToError() - if err != nil { - return fs.WrapErr(err) - } - panic("ffjson-generated: unreachable, please report bug.") -done: - return nil -} - -func (mj *Hashtag) MarshalJSON() ([]byte, error) { - var buf fflib.Buffer - if mj == nil { - buf.WriteString("null") - return buf.Bytes(), nil - } - err := mj.MarshalJSONBuf(&buf) - if err != nil { - return nil, err - } - return buf.Bytes(), nil -} -func (mj *Hashtag) MarshalJSONBuf(buf fflib.EncodingBuffer) error { - if mj == nil { - buf.WriteString("null") - return nil - } - var err error - var obj []byte - _ = obj - _ = err - buf.WriteString(`{"indices":`) - if mj.Indices != nil { - buf.WriteString(`[`) - for i, v := range mj.Indices { - if i != 0 { - buf.WriteString(`,`) - } - fflib.FormatBits2(buf, uint64(v), 10, v < 0) - } - buf.WriteString(`]`) - } else { - buf.WriteString(`null`) - } - buf.WriteString(`,"text":`) - fflib.WriteJsonString(buf, string(mj.Text)) - buf.WriteByte('}') - return nil -} - -const ( - ffj_t_Hashtagbase = iota - ffj_t_Hashtagno_such_key - - ffj_t_Hashtag_Indices - - ffj_t_Hashtag_Text -) - -var ffj_key_Hashtag_Indices = []byte("indices") - -var ffj_key_Hashtag_Text = []byte("text") - -func (uj *Hashtag) UnmarshalJSON(input []byte) error { - fs := fflib.NewFFLexer(input) - return uj.UnmarshalJSONFFLexer(fs, fflib.FFParse_map_start) -} - -func (uj *Hashtag) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error { - var err error = nil - currentKey := ffj_t_Hashtagbase - _ = currentKey - tok := fflib.FFTok_init - wantedTok := fflib.FFTok_init - -mainparse: - for { - tok = fs.Scan() - // println(fmt.Sprintf("debug: tok: %v state: %v", tok, state)) - if tok == fflib.FFTok_error { - goto tokerror - } - - switch state { - - case fflib.FFParse_map_start: - if tok != fflib.FFTok_left_bracket { - wantedTok = fflib.FFTok_left_bracket - goto wrongtokenerror - } - state = fflib.FFParse_want_key - continue - - case fflib.FFParse_after_value: - if tok == fflib.FFTok_comma { - state = fflib.FFParse_want_key - } else if tok == fflib.FFTok_right_bracket { - goto done - } else { - wantedTok = fflib.FFTok_comma - goto wrongtokenerror - } - - case fflib.FFParse_want_key: - // json {} ended. goto exit. woo. - if tok == fflib.FFTok_right_bracket { - goto done - } - if tok != fflib.FFTok_string { - wantedTok = fflib.FFTok_string - goto wrongtokenerror - } - - kn := fs.Output.Bytes() - if len(kn) <= 0 { - // "" case. hrm. - currentKey = ffj_t_Hashtagno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } else { - switch kn[0] { - - case 'i': - - if bytes.Equal(ffj_key_Hashtag_Indices, kn) { - currentKey = ffj_t_Hashtag_Indices - state = fflib.FFParse_want_colon - goto mainparse - } - - case 't': - - if bytes.Equal(ffj_key_Hashtag_Text, kn) { - currentKey = ffj_t_Hashtag_Text - state = fflib.FFParse_want_colon - goto mainparse - } - - } - - if fflib.SimpleLetterEqualFold(ffj_key_Hashtag_Text, kn) { - currentKey = ffj_t_Hashtag_Text - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_Hashtag_Indices, kn) { - currentKey = ffj_t_Hashtag_Indices - state = fflib.FFParse_want_colon - goto mainparse - } - - currentKey = ffj_t_Hashtagno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } - - case fflib.FFParse_want_colon: - if tok != fflib.FFTok_colon { - wantedTok = fflib.FFTok_colon - goto wrongtokenerror - } - state = fflib.FFParse_want_value - continue - case fflib.FFParse_want_value: - - if tok == fflib.FFTok_left_brace || tok == fflib.FFTok_left_bracket || tok == fflib.FFTok_integer || tok == fflib.FFTok_double || tok == fflib.FFTok_string || tok == fflib.FFTok_bool || tok == fflib.FFTok_null { - switch currentKey { - - case ffj_t_Hashtag_Indices: - goto handle_Indices - - case ffj_t_Hashtag_Text: - goto handle_Text - - case ffj_t_Hashtagno_such_key: - err = fs.SkipField(tok) - if err != nil { - return fs.WrapErr(err) - } - state = fflib.FFParse_after_value - goto mainparse - } - } else { - goto wantedvalue - } - } - } - -handle_Indices: - - /* handler: uj.Indices type=[]int kind=slice quoted=false*/ - - { - - { - if tok != fflib.FFTok_left_brace && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for ", tok)) - } - } - - if tok == fflib.FFTok_null { - uj.Indices = nil - } else { - - uj.Indices = make([]int, 0) - - wantVal := true - - for { - - var tmp_uj__Indices int - - tok = fs.Scan() - if tok == fflib.FFTok_error { - goto tokerror - } - if tok == fflib.FFTok_right_brace { - break - } - - if tok == fflib.FFTok_comma { - if wantVal == true { - // TODO(pquerna): this isn't an ideal error message, this handles - // things like [,,,] as an array value. - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) - } - continue - } else { - wantVal = true - } - - /* handler: tmp_uj__Indices type=int kind=int quoted=false*/ - - { - if tok != fflib.FFTok_integer && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for int", tok)) - } - } - - { - - if tok == fflib.FFTok_null { - - } else { - - tval, err := fflib.ParseInt(fs.Output.Bytes(), 10, 64) - - if err != nil { - return fs.WrapErr(err) - } - - tmp_uj__Indices = int(tval) - - } - } - - uj.Indices = append(uj.Indices, tmp_uj__Indices) - wantVal = false - } - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Text: - - /* handler: uj.Text type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.Text = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -wantedvalue: - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) -wrongtokenerror: - return fs.WrapErr(fmt.Errorf("ffjson: wanted token: %v, but got token: %v output=%s", wantedTok, tok, fs.Output.String())) -tokerror: - if fs.BigError != nil { - return fs.WrapErr(fs.BigError) - } - err = fs.Error.ToError() - if err != nil { - return fs.WrapErr(err) - } - panic("ffjson-generated: unreachable, please report bug.") -done: - return nil -} - -func (mj *LargeStruct) MarshalJSON() ([]byte, error) { - var buf fflib.Buffer - if mj == nil { - buf.WriteString("null") - return buf.Bytes(), nil - } - err := mj.MarshalJSONBuf(&buf) - if err != nil { - return nil, err - } - return buf.Bytes(), nil -} -func (mj *LargeStruct) MarshalJSONBuf(buf fflib.EncodingBuffer) error { - if mj == nil { - buf.WriteString("null") - return nil - } - var err error - var obj []byte - _ = obj - _ = err - buf.WriteString(`{"search_metadata":`) - - { - - err = mj.SearchMetadata.MarshalJSONBuf(buf) - if err != nil { - return err - } - - } - buf.WriteString(`,"statuses":`) - if mj.Statuses != nil { - buf.WriteString(`[`) - for i, v := range mj.Statuses { - if i != 0 { - buf.WriteString(`,`) - } - - { - - err = v.MarshalJSONBuf(buf) - if err != nil { - return err - } - - } - } - buf.WriteString(`]`) - } else { - buf.WriteString(`null`) - } - buf.WriteByte('}') - return nil -} - -const ( - ffj_t_LargeStructbase = iota - ffj_t_LargeStructno_such_key - - ffj_t_LargeStruct_SearchMetadata - - ffj_t_LargeStruct_Statuses -) - -var ffj_key_LargeStruct_SearchMetadata = []byte("search_metadata") - -var ffj_key_LargeStruct_Statuses = []byte("statuses") - -func (uj *LargeStruct) UnmarshalJSON(input []byte) error { - fs := fflib.NewFFLexer(input) - return uj.UnmarshalJSONFFLexer(fs, fflib.FFParse_map_start) -} - -func (uj *LargeStruct) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error { - var err error = nil - currentKey := ffj_t_LargeStructbase - _ = currentKey - tok := fflib.FFTok_init - wantedTok := fflib.FFTok_init - -mainparse: - for { - tok = fs.Scan() - // println(fmt.Sprintf("debug: tok: %v state: %v", tok, state)) - if tok == fflib.FFTok_error { - goto tokerror - } - - switch state { - - case fflib.FFParse_map_start: - if tok != fflib.FFTok_left_bracket { - wantedTok = fflib.FFTok_left_bracket - goto wrongtokenerror - } - state = fflib.FFParse_want_key - continue - - case fflib.FFParse_after_value: - if tok == fflib.FFTok_comma { - state = fflib.FFParse_want_key - } else if tok == fflib.FFTok_right_bracket { - goto done - } else { - wantedTok = fflib.FFTok_comma - goto wrongtokenerror - } - - case fflib.FFParse_want_key: - // json {} ended. goto exit. woo. - if tok == fflib.FFTok_right_bracket { - goto done - } - if tok != fflib.FFTok_string { - wantedTok = fflib.FFTok_string - goto wrongtokenerror - } - - kn := fs.Output.Bytes() - if len(kn) <= 0 { - // "" case. hrm. - currentKey = ffj_t_LargeStructno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } else { - switch kn[0] { - - case 's': - - if bytes.Equal(ffj_key_LargeStruct_SearchMetadata, kn) { - currentKey = ffj_t_LargeStruct_SearchMetadata - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_LargeStruct_Statuses, kn) { - currentKey = ffj_t_LargeStruct_Statuses - state = fflib.FFParse_want_colon - goto mainparse - } - - } - - if fflib.EqualFoldRight(ffj_key_LargeStruct_Statuses, kn) { - currentKey = ffj_t_LargeStruct_Statuses - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_LargeStruct_SearchMetadata, kn) { - currentKey = ffj_t_LargeStruct_SearchMetadata - state = fflib.FFParse_want_colon - goto mainparse - } - - currentKey = ffj_t_LargeStructno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } - - case fflib.FFParse_want_colon: - if tok != fflib.FFTok_colon { - wantedTok = fflib.FFTok_colon - goto wrongtokenerror - } - state = fflib.FFParse_want_value - continue - case fflib.FFParse_want_value: - - if tok == fflib.FFTok_left_brace || tok == fflib.FFTok_left_bracket || tok == fflib.FFTok_integer || tok == fflib.FFTok_double || tok == fflib.FFTok_string || tok == fflib.FFTok_bool || tok == fflib.FFTok_null { - switch currentKey { - - case ffj_t_LargeStruct_SearchMetadata: - goto handle_SearchMetadata - - case ffj_t_LargeStruct_Statuses: - goto handle_Statuses - - case ffj_t_LargeStructno_such_key: - err = fs.SkipField(tok) - if err != nil { - return fs.WrapErr(err) - } - state = fflib.FFParse_after_value - goto mainparse - } - } else { - goto wantedvalue - } - } - } - -handle_SearchMetadata: - - /* handler: uj.SearchMetadata type=benchmark.SearchMetadata kind=struct quoted=false*/ - - { - if tok == fflib.FFTok_null { - - state = fflib.FFParse_after_value - goto mainparse - } - - err = uj.SearchMetadata.UnmarshalJSONFFLexer(fs, fflib.FFParse_want_key) - if err != nil { - return err - } - state = fflib.FFParse_after_value - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Statuses: - - /* handler: uj.Statuses type=[]benchmark.Status kind=slice quoted=false*/ - - { - - { - if tok != fflib.FFTok_left_brace && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for ", tok)) - } - } - - if tok == fflib.FFTok_null { - uj.Statuses = nil - } else { - - uj.Statuses = make([]Status, 0) - - wantVal := true - - for { - - var tmp_uj__Statuses Status - - tok = fs.Scan() - if tok == fflib.FFTok_error { - goto tokerror - } - if tok == fflib.FFTok_right_brace { - break - } - - if tok == fflib.FFTok_comma { - if wantVal == true { - // TODO(pquerna): this isn't an ideal error message, this handles - // things like [,,,] as an array value. - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) - } - continue - } else { - wantVal = true - } - - /* handler: tmp_uj__Statuses type=benchmark.Status kind=struct quoted=false*/ - - { - if tok == fflib.FFTok_null { - - state = fflib.FFParse_after_value - goto mainparse - } - - err = tmp_uj__Statuses.UnmarshalJSONFFLexer(fs, fflib.FFParse_want_key) - if err != nil { - return err - } - state = fflib.FFParse_after_value - } - - uj.Statuses = append(uj.Statuses, tmp_uj__Statuses) - wantVal = false - } - } - } - - state = fflib.FFParse_after_value - goto mainparse - -wantedvalue: - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) -wrongtokenerror: - return fs.WrapErr(fmt.Errorf("ffjson: wanted token: %v, but got token: %v output=%s", wantedTok, tok, fs.Output.String())) -tokerror: - if fs.BigError != nil { - return fs.WrapErr(fs.BigError) - } - err = fs.Error.ToError() - if err != nil { - return fs.WrapErr(err) - } - panic("ffjson-generated: unreachable, please report bug.") -done: - return nil -} - -func (mj *SearchMetadata) MarshalJSON() ([]byte, error) { - var buf fflib.Buffer - if mj == nil { - buf.WriteString("null") - return buf.Bytes(), nil - } - err := mj.MarshalJSONBuf(&buf) - if err != nil { - return nil, err - } - return buf.Bytes(), nil -} -func (mj *SearchMetadata) MarshalJSONBuf(buf fflib.EncodingBuffer) error { - if mj == nil { - buf.WriteString("null") - return nil - } - var err error - var obj []byte - _ = obj - _ = err - buf.WriteString(`{"completed_in":`) - fflib.AppendFloat(buf, float64(mj.CompletedIn), 'g', -1, 64) - buf.WriteString(`,"count":`) - fflib.FormatBits2(buf, uint64(mj.Count), 10, mj.Count < 0) - buf.WriteString(`,"max_id":`) - fflib.FormatBits2(buf, uint64(mj.MaxID), 10, mj.MaxID < 0) - buf.WriteString(`,"max_id_str":`) - fflib.WriteJsonString(buf, string(mj.MaxIDStr)) - buf.WriteString(`,"next_results":`) - fflib.WriteJsonString(buf, string(mj.NextResults)) - buf.WriteString(`,"query":`) - fflib.WriteJsonString(buf, string(mj.Query)) - buf.WriteString(`,"refresh_url":`) - fflib.WriteJsonString(buf, string(mj.RefreshURL)) - buf.WriteString(`,"since_id":`) - fflib.FormatBits2(buf, uint64(mj.SinceID), 10, mj.SinceID < 0) - buf.WriteString(`,"since_id_str":`) - fflib.WriteJsonString(buf, string(mj.SinceIDStr)) - buf.WriteByte('}') - return nil -} - -const ( - ffj_t_SearchMetadatabase = iota - ffj_t_SearchMetadatano_such_key - - ffj_t_SearchMetadata_CompletedIn - - ffj_t_SearchMetadata_Count - - ffj_t_SearchMetadata_MaxID - - ffj_t_SearchMetadata_MaxIDStr - - ffj_t_SearchMetadata_NextResults - - ffj_t_SearchMetadata_Query - - ffj_t_SearchMetadata_RefreshURL - - ffj_t_SearchMetadata_SinceID - - ffj_t_SearchMetadata_SinceIDStr -) - -var ffj_key_SearchMetadata_CompletedIn = []byte("completed_in") - -var ffj_key_SearchMetadata_Count = []byte("count") - -var ffj_key_SearchMetadata_MaxID = []byte("max_id") - -var ffj_key_SearchMetadata_MaxIDStr = []byte("max_id_str") - -var ffj_key_SearchMetadata_NextResults = []byte("next_results") - -var ffj_key_SearchMetadata_Query = []byte("query") - -var ffj_key_SearchMetadata_RefreshURL = []byte("refresh_url") - -var ffj_key_SearchMetadata_SinceID = []byte("since_id") - -var ffj_key_SearchMetadata_SinceIDStr = []byte("since_id_str") - -func (uj *SearchMetadata) UnmarshalJSON(input []byte) error { - fs := fflib.NewFFLexer(input) - return uj.UnmarshalJSONFFLexer(fs, fflib.FFParse_map_start) -} - -func (uj *SearchMetadata) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error { - var err error = nil - currentKey := ffj_t_SearchMetadatabase - _ = currentKey - tok := fflib.FFTok_init - wantedTok := fflib.FFTok_init - -mainparse: - for { - tok = fs.Scan() - // println(fmt.Sprintf("debug: tok: %v state: %v", tok, state)) - if tok == fflib.FFTok_error { - goto tokerror - } - - switch state { - - case fflib.FFParse_map_start: - if tok != fflib.FFTok_left_bracket { - wantedTok = fflib.FFTok_left_bracket - goto wrongtokenerror - } - state = fflib.FFParse_want_key - continue - - case fflib.FFParse_after_value: - if tok == fflib.FFTok_comma { - state = fflib.FFParse_want_key - } else if tok == fflib.FFTok_right_bracket { - goto done - } else { - wantedTok = fflib.FFTok_comma - goto wrongtokenerror - } - - case fflib.FFParse_want_key: - // json {} ended. goto exit. woo. - if tok == fflib.FFTok_right_bracket { - goto done - } - if tok != fflib.FFTok_string { - wantedTok = fflib.FFTok_string - goto wrongtokenerror - } - - kn := fs.Output.Bytes() - if len(kn) <= 0 { - // "" case. hrm. - currentKey = ffj_t_SearchMetadatano_such_key - state = fflib.FFParse_want_colon - goto mainparse - } else { - switch kn[0] { - - case 'c': - - if bytes.Equal(ffj_key_SearchMetadata_CompletedIn, kn) { - currentKey = ffj_t_SearchMetadata_CompletedIn - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_SearchMetadata_Count, kn) { - currentKey = ffj_t_SearchMetadata_Count - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'm': - - if bytes.Equal(ffj_key_SearchMetadata_MaxID, kn) { - currentKey = ffj_t_SearchMetadata_MaxID - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_SearchMetadata_MaxIDStr, kn) { - currentKey = ffj_t_SearchMetadata_MaxIDStr - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'n': - - if bytes.Equal(ffj_key_SearchMetadata_NextResults, kn) { - currentKey = ffj_t_SearchMetadata_NextResults - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'q': - - if bytes.Equal(ffj_key_SearchMetadata_Query, kn) { - currentKey = ffj_t_SearchMetadata_Query - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'r': - - if bytes.Equal(ffj_key_SearchMetadata_RefreshURL, kn) { - currentKey = ffj_t_SearchMetadata_RefreshURL - state = fflib.FFParse_want_colon - goto mainparse - } - - case 's': - - if bytes.Equal(ffj_key_SearchMetadata_SinceID, kn) { - currentKey = ffj_t_SearchMetadata_SinceID - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_SearchMetadata_SinceIDStr, kn) { - currentKey = ffj_t_SearchMetadata_SinceIDStr - state = fflib.FFParse_want_colon - goto mainparse - } - - } - - if fflib.EqualFoldRight(ffj_key_SearchMetadata_SinceIDStr, kn) { - currentKey = ffj_t_SearchMetadata_SinceIDStr - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_SearchMetadata_SinceID, kn) { - currentKey = ffj_t_SearchMetadata_SinceID - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_SearchMetadata_RefreshURL, kn) { - currentKey = ffj_t_SearchMetadata_RefreshURL - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.SimpleLetterEqualFold(ffj_key_SearchMetadata_Query, kn) { - currentKey = ffj_t_SearchMetadata_Query - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_SearchMetadata_NextResults, kn) { - currentKey = ffj_t_SearchMetadata_NextResults - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_SearchMetadata_MaxIDStr, kn) { - currentKey = ffj_t_SearchMetadata_MaxIDStr - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.AsciiEqualFold(ffj_key_SearchMetadata_MaxID, kn) { - currentKey = ffj_t_SearchMetadata_MaxID - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.SimpleLetterEqualFold(ffj_key_SearchMetadata_Count, kn) { - currentKey = ffj_t_SearchMetadata_Count - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.AsciiEqualFold(ffj_key_SearchMetadata_CompletedIn, kn) { - currentKey = ffj_t_SearchMetadata_CompletedIn - state = fflib.FFParse_want_colon - goto mainparse - } - - currentKey = ffj_t_SearchMetadatano_such_key - state = fflib.FFParse_want_colon - goto mainparse - } - - case fflib.FFParse_want_colon: - if tok != fflib.FFTok_colon { - wantedTok = fflib.FFTok_colon - goto wrongtokenerror - } - state = fflib.FFParse_want_value - continue - case fflib.FFParse_want_value: - - if tok == fflib.FFTok_left_brace || tok == fflib.FFTok_left_bracket || tok == fflib.FFTok_integer || tok == fflib.FFTok_double || tok == fflib.FFTok_string || tok == fflib.FFTok_bool || tok == fflib.FFTok_null { - switch currentKey { - - case ffj_t_SearchMetadata_CompletedIn: - goto handle_CompletedIn - - case ffj_t_SearchMetadata_Count: - goto handle_Count - - case ffj_t_SearchMetadata_MaxID: - goto handle_MaxID - - case ffj_t_SearchMetadata_MaxIDStr: - goto handle_MaxIDStr - - case ffj_t_SearchMetadata_NextResults: - goto handle_NextResults - - case ffj_t_SearchMetadata_Query: - goto handle_Query - - case ffj_t_SearchMetadata_RefreshURL: - goto handle_RefreshURL - - case ffj_t_SearchMetadata_SinceID: - goto handle_SinceID - - case ffj_t_SearchMetadata_SinceIDStr: - goto handle_SinceIDStr - - case ffj_t_SearchMetadatano_such_key: - err = fs.SkipField(tok) - if err != nil { - return fs.WrapErr(err) - } - state = fflib.FFParse_after_value - goto mainparse - } - } else { - goto wantedvalue - } - } - } - -handle_CompletedIn: - - /* handler: uj.CompletedIn type=float64 kind=float64 quoted=false*/ - - { - if tok != fflib.FFTok_double && tok != fflib.FFTok_integer && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for float64", tok)) - } - } - - { - - if tok == fflib.FFTok_null { - - } else { - - tval, err := fflib.ParseFloat(fs.Output.Bytes(), 64) - - if err != nil { - return fs.WrapErr(err) - } - - uj.CompletedIn = float64(tval) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Count: - - /* handler: uj.Count type=int kind=int quoted=false*/ - - { - if tok != fflib.FFTok_integer && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for int", tok)) - } - } - - { - - if tok == fflib.FFTok_null { - - } else { - - tval, err := fflib.ParseInt(fs.Output.Bytes(), 10, 64) - - if err != nil { - return fs.WrapErr(err) - } - - uj.Count = int(tval) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_MaxID: - - /* handler: uj.MaxID type=int kind=int quoted=false*/ - - { - if tok != fflib.FFTok_integer && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for int", tok)) - } - } - - { - - if tok == fflib.FFTok_null { - - } else { - - tval, err := fflib.ParseInt(fs.Output.Bytes(), 10, 64) - - if err != nil { - return fs.WrapErr(err) - } - - uj.MaxID = int(tval) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_MaxIDStr: - - /* handler: uj.MaxIDStr type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.MaxIDStr = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_NextResults: - - /* handler: uj.NextResults type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.NextResults = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Query: - - /* handler: uj.Query type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.Query = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_RefreshURL: - - /* handler: uj.RefreshURL type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.RefreshURL = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_SinceID: - - /* handler: uj.SinceID type=int kind=int quoted=false*/ - - { - if tok != fflib.FFTok_integer && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for int", tok)) - } - } - - { - - if tok == fflib.FFTok_null { - - } else { - - tval, err := fflib.ParseInt(fs.Output.Bytes(), 10, 64) - - if err != nil { - return fs.WrapErr(err) - } - - uj.SinceID = int(tval) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_SinceIDStr: - - /* handler: uj.SinceIDStr type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.SinceIDStr = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -wantedvalue: - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) -wrongtokenerror: - return fs.WrapErr(fmt.Errorf("ffjson: wanted token: %v, but got token: %v output=%s", wantedTok, tok, fs.Output.String())) -tokerror: - if fs.BigError != nil { - return fs.WrapErr(fs.BigError) - } - err = fs.Error.ToError() - if err != nil { - return fs.WrapErr(err) - } - panic("ffjson-generated: unreachable, please report bug.") -done: - return nil -} - -func (mj *Status) MarshalJSON() ([]byte, error) { - var buf fflib.Buffer - if mj == nil { - buf.WriteString("null") - return buf.Bytes(), nil - } - err := mj.MarshalJSONBuf(&buf) - if err != nil { - return nil, err - } - return buf.Bytes(), nil -} -func (mj *Status) MarshalJSONBuf(buf fflib.EncodingBuffer) error { - if mj == nil { - buf.WriteString("null") - return nil - } - var err error - var obj []byte - _ = obj - _ = err - if mj.Contributors != nil { - buf.WriteString(`{"contributors":`) - fflib.WriteJsonString(buf, string(*mj.Contributors)) - } else { - buf.WriteString(`{"contributors":null`) - } - if mj.Coordinates != nil { - buf.WriteString(`,"coordinates":`) - fflib.WriteJsonString(buf, string(*mj.Coordinates)) - } else { - buf.WriteString(`,"coordinates":null`) - } - buf.WriteString(`,"created_at":`) - fflib.WriteJsonString(buf, string(mj.CreatedAt)) - buf.WriteString(`,"entities":`) - - { - - err = mj.Entities.MarshalJSONBuf(buf) - if err != nil { - return err - } - - } - if mj.Favorited { - buf.WriteString(`,"favorited":true`) - } else { - buf.WriteString(`,"favorited":false`) - } - if mj.Geo != nil { - buf.WriteString(`,"geo":`) - fflib.WriteJsonString(buf, string(*mj.Geo)) - } else { - buf.WriteString(`,"geo":null`) - } - buf.WriteString(`,"id":`) - fflib.FormatBits2(buf, uint64(mj.ID), 10, mj.ID < 0) - buf.WriteString(`,"id_str":`) - fflib.WriteJsonString(buf, string(mj.IDStr)) - if mj.InReplyToScreenName != nil { - buf.WriteString(`,"in_reply_to_screen_name":`) - fflib.WriteJsonString(buf, string(*mj.InReplyToScreenName)) - } else { - buf.WriteString(`,"in_reply_to_screen_name":null`) - } - if mj.InReplyToStatusID != nil { - buf.WriteString(`,"in_reply_to_status_id":`) - fflib.WriteJsonString(buf, string(*mj.InReplyToStatusID)) - } else { - buf.WriteString(`,"in_reply_to_status_id":null`) - } - if mj.InReplyToStatusIDStr != nil { - buf.WriteString(`,"in_reply_to_status_id_str":`) - fflib.WriteJsonString(buf, string(*mj.InReplyToStatusIDStr)) - } else { - buf.WriteString(`,"in_reply_to_status_id_str":null`) - } - if mj.InReplyToUserID != nil { - buf.WriteString(`,"in_reply_to_user_id":`) - fflib.WriteJsonString(buf, string(*mj.InReplyToUserID)) - } else { - buf.WriteString(`,"in_reply_to_user_id":null`) - } - if mj.InReplyToUserIDStr != nil { - buf.WriteString(`,"in_reply_to_user_id_str":`) - fflib.WriteJsonString(buf, string(*mj.InReplyToUserIDStr)) - } else { - buf.WriteString(`,"in_reply_to_user_id_str":null`) - } - buf.WriteString(`,"metadata":`) - - { - - err = mj.Metadata.MarshalJSONBuf(buf) - if err != nil { - return err - } - - } - if mj.Place != nil { - buf.WriteString(`,"place":`) - fflib.WriteJsonString(buf, string(*mj.Place)) - } else { - buf.WriteString(`,"place":null`) - } - buf.WriteString(`,"retweet_count":`) - fflib.FormatBits2(buf, uint64(mj.RetweetCount), 10, mj.RetweetCount < 0) - if mj.Retweeted { - buf.WriteString(`,"retweeted":true`) - } else { - buf.WriteString(`,"retweeted":false`) - } - buf.WriteString(`,"source":`) - fflib.WriteJsonString(buf, string(mj.Source)) - buf.WriteString(`,"text":`) - fflib.WriteJsonString(buf, string(mj.Text)) - if mj.Truncated { - buf.WriteString(`,"truncated":true`) - } else { - buf.WriteString(`,"truncated":false`) - } - buf.WriteString(`,"user":`) - - { - - err = mj.User.MarshalJSONBuf(buf) - if err != nil { - return err - } - - } - buf.WriteByte('}') - return nil -} - -const ( - ffj_t_Statusbase = iota - ffj_t_Statusno_such_key - - ffj_t_Status_Contributors - - ffj_t_Status_Coordinates - - ffj_t_Status_CreatedAt - - ffj_t_Status_Entities - - ffj_t_Status_Favorited - - ffj_t_Status_Geo - - ffj_t_Status_ID - - ffj_t_Status_IDStr - - ffj_t_Status_InReplyToScreenName - - ffj_t_Status_InReplyToStatusID - - ffj_t_Status_InReplyToStatusIDStr - - ffj_t_Status_InReplyToUserID - - ffj_t_Status_InReplyToUserIDStr - - ffj_t_Status_Metadata - - ffj_t_Status_Place - - ffj_t_Status_RetweetCount - - ffj_t_Status_Retweeted - - ffj_t_Status_Source - - ffj_t_Status_Text - - ffj_t_Status_Truncated - - ffj_t_Status_User -) - -var ffj_key_Status_Contributors = []byte("contributors") - -var ffj_key_Status_Coordinates = []byte("coordinates") - -var ffj_key_Status_CreatedAt = []byte("created_at") - -var ffj_key_Status_Entities = []byte("entities") - -var ffj_key_Status_Favorited = []byte("favorited") - -var ffj_key_Status_Geo = []byte("geo") - -var ffj_key_Status_ID = []byte("id") - -var ffj_key_Status_IDStr = []byte("id_str") - -var ffj_key_Status_InReplyToScreenName = []byte("in_reply_to_screen_name") - -var ffj_key_Status_InReplyToStatusID = []byte("in_reply_to_status_id") - -var ffj_key_Status_InReplyToStatusIDStr = []byte("in_reply_to_status_id_str") - -var ffj_key_Status_InReplyToUserID = []byte("in_reply_to_user_id") - -var ffj_key_Status_InReplyToUserIDStr = []byte("in_reply_to_user_id_str") - -var ffj_key_Status_Metadata = []byte("metadata") - -var ffj_key_Status_Place = []byte("place") - -var ffj_key_Status_RetweetCount = []byte("retweet_count") - -var ffj_key_Status_Retweeted = []byte("retweeted") - -var ffj_key_Status_Source = []byte("source") - -var ffj_key_Status_Text = []byte("text") - -var ffj_key_Status_Truncated = []byte("truncated") - -var ffj_key_Status_User = []byte("user") - -func (uj *Status) UnmarshalJSON(input []byte) error { - fs := fflib.NewFFLexer(input) - return uj.UnmarshalJSONFFLexer(fs, fflib.FFParse_map_start) -} - -func (uj *Status) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error { - var err error = nil - currentKey := ffj_t_Statusbase - _ = currentKey - tok := fflib.FFTok_init - wantedTok := fflib.FFTok_init - -mainparse: - for { - tok = fs.Scan() - // println(fmt.Sprintf("debug: tok: %v state: %v", tok, state)) - if tok == fflib.FFTok_error { - goto tokerror - } - - switch state { - - case fflib.FFParse_map_start: - if tok != fflib.FFTok_left_bracket { - wantedTok = fflib.FFTok_left_bracket - goto wrongtokenerror - } - state = fflib.FFParse_want_key - continue - - case fflib.FFParse_after_value: - if tok == fflib.FFTok_comma { - state = fflib.FFParse_want_key - } else if tok == fflib.FFTok_right_bracket { - goto done - } else { - wantedTok = fflib.FFTok_comma - goto wrongtokenerror - } - - case fflib.FFParse_want_key: - // json {} ended. goto exit. woo. - if tok == fflib.FFTok_right_bracket { - goto done - } - if tok != fflib.FFTok_string { - wantedTok = fflib.FFTok_string - goto wrongtokenerror - } - - kn := fs.Output.Bytes() - if len(kn) <= 0 { - // "" case. hrm. - currentKey = ffj_t_Statusno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } else { - switch kn[0] { - - case 'c': - - if bytes.Equal(ffj_key_Status_Contributors, kn) { - currentKey = ffj_t_Status_Contributors - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_Status_Coordinates, kn) { - currentKey = ffj_t_Status_Coordinates - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_Status_CreatedAt, kn) { - currentKey = ffj_t_Status_CreatedAt - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'e': - - if bytes.Equal(ffj_key_Status_Entities, kn) { - currentKey = ffj_t_Status_Entities - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'f': - - if bytes.Equal(ffj_key_Status_Favorited, kn) { - currentKey = ffj_t_Status_Favorited - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'g': - - if bytes.Equal(ffj_key_Status_Geo, kn) { - currentKey = ffj_t_Status_Geo - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'i': - - if bytes.Equal(ffj_key_Status_ID, kn) { - currentKey = ffj_t_Status_ID - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_Status_IDStr, kn) { - currentKey = ffj_t_Status_IDStr - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_Status_InReplyToScreenName, kn) { - currentKey = ffj_t_Status_InReplyToScreenName - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_Status_InReplyToStatusID, kn) { - currentKey = ffj_t_Status_InReplyToStatusID - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_Status_InReplyToStatusIDStr, kn) { - currentKey = ffj_t_Status_InReplyToStatusIDStr - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_Status_InReplyToUserID, kn) { - currentKey = ffj_t_Status_InReplyToUserID - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_Status_InReplyToUserIDStr, kn) { - currentKey = ffj_t_Status_InReplyToUserIDStr - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'm': - - if bytes.Equal(ffj_key_Status_Metadata, kn) { - currentKey = ffj_t_Status_Metadata - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'p': - - if bytes.Equal(ffj_key_Status_Place, kn) { - currentKey = ffj_t_Status_Place - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'r': - - if bytes.Equal(ffj_key_Status_RetweetCount, kn) { - currentKey = ffj_t_Status_RetweetCount - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_Status_Retweeted, kn) { - currentKey = ffj_t_Status_Retweeted - state = fflib.FFParse_want_colon - goto mainparse - } - - case 's': - - if bytes.Equal(ffj_key_Status_Source, kn) { - currentKey = ffj_t_Status_Source - state = fflib.FFParse_want_colon - goto mainparse - } - - case 't': - - if bytes.Equal(ffj_key_Status_Text, kn) { - currentKey = ffj_t_Status_Text - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_Status_Truncated, kn) { - currentKey = ffj_t_Status_Truncated - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'u': - - if bytes.Equal(ffj_key_Status_User, kn) { - currentKey = ffj_t_Status_User - state = fflib.FFParse_want_colon - goto mainparse - } - - } - - if fflib.EqualFoldRight(ffj_key_Status_User, kn) { - currentKey = ffj_t_Status_User - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.SimpleLetterEqualFold(ffj_key_Status_Truncated, kn) { - currentKey = ffj_t_Status_Truncated - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.SimpleLetterEqualFold(ffj_key_Status_Text, kn) { - currentKey = ffj_t_Status_Text - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_Status_Source, kn) { - currentKey = ffj_t_Status_Source - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.SimpleLetterEqualFold(ffj_key_Status_Retweeted, kn) { - currentKey = ffj_t_Status_Retweeted - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.AsciiEqualFold(ffj_key_Status_RetweetCount, kn) { - currentKey = ffj_t_Status_RetweetCount - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.SimpleLetterEqualFold(ffj_key_Status_Place, kn) { - currentKey = ffj_t_Status_Place - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.SimpleLetterEqualFold(ffj_key_Status_Metadata, kn) { - currentKey = ffj_t_Status_Metadata - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_Status_InReplyToUserIDStr, kn) { - currentKey = ffj_t_Status_InReplyToUserIDStr - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_Status_InReplyToUserID, kn) { - currentKey = ffj_t_Status_InReplyToUserID - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_Status_InReplyToStatusIDStr, kn) { - currentKey = ffj_t_Status_InReplyToStatusIDStr - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_Status_InReplyToStatusID, kn) { - currentKey = ffj_t_Status_InReplyToStatusID - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_Status_InReplyToScreenName, kn) { - currentKey = ffj_t_Status_InReplyToScreenName - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_Status_IDStr, kn) { - currentKey = ffj_t_Status_IDStr - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.SimpleLetterEqualFold(ffj_key_Status_ID, kn) { - currentKey = ffj_t_Status_ID - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.SimpleLetterEqualFold(ffj_key_Status_Geo, kn) { - currentKey = ffj_t_Status_Geo - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.SimpleLetterEqualFold(ffj_key_Status_Favorited, kn) { - currentKey = ffj_t_Status_Favorited - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_Status_Entities, kn) { - currentKey = ffj_t_Status_Entities - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.AsciiEqualFold(ffj_key_Status_CreatedAt, kn) { - currentKey = ffj_t_Status_CreatedAt - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_Status_Coordinates, kn) { - currentKey = ffj_t_Status_Coordinates - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_Status_Contributors, kn) { - currentKey = ffj_t_Status_Contributors - state = fflib.FFParse_want_colon - goto mainparse - } - - currentKey = ffj_t_Statusno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } - - case fflib.FFParse_want_colon: - if tok != fflib.FFTok_colon { - wantedTok = fflib.FFTok_colon - goto wrongtokenerror - } - state = fflib.FFParse_want_value - continue - case fflib.FFParse_want_value: - - if tok == fflib.FFTok_left_brace || tok == fflib.FFTok_left_bracket || tok == fflib.FFTok_integer || tok == fflib.FFTok_double || tok == fflib.FFTok_string || tok == fflib.FFTok_bool || tok == fflib.FFTok_null { - switch currentKey { - - case ffj_t_Status_Contributors: - goto handle_Contributors - - case ffj_t_Status_Coordinates: - goto handle_Coordinates - - case ffj_t_Status_CreatedAt: - goto handle_CreatedAt - - case ffj_t_Status_Entities: - goto handle_Entities - - case ffj_t_Status_Favorited: - goto handle_Favorited - - case ffj_t_Status_Geo: - goto handle_Geo - - case ffj_t_Status_ID: - goto handle_ID - - case ffj_t_Status_IDStr: - goto handle_IDStr - - case ffj_t_Status_InReplyToScreenName: - goto handle_InReplyToScreenName - - case ffj_t_Status_InReplyToStatusID: - goto handle_InReplyToStatusID - - case ffj_t_Status_InReplyToStatusIDStr: - goto handle_InReplyToStatusIDStr - - case ffj_t_Status_InReplyToUserID: - goto handle_InReplyToUserID - - case ffj_t_Status_InReplyToUserIDStr: - goto handle_InReplyToUserIDStr - - case ffj_t_Status_Metadata: - goto handle_Metadata - - case ffj_t_Status_Place: - goto handle_Place - - case ffj_t_Status_RetweetCount: - goto handle_RetweetCount - - case ffj_t_Status_Retweeted: - goto handle_Retweeted - - case ffj_t_Status_Source: - goto handle_Source - - case ffj_t_Status_Text: - goto handle_Text - - case ffj_t_Status_Truncated: - goto handle_Truncated - - case ffj_t_Status_User: - goto handle_User - - case ffj_t_Statusno_such_key: - err = fs.SkipField(tok) - if err != nil { - return fs.WrapErr(err) - } - state = fflib.FFParse_after_value - goto mainparse - } - } else { - goto wantedvalue - } - } - } - -handle_Contributors: - - /* handler: uj.Contributors type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - uj.Contributors = nil - - } else { - - var tval string - outBuf := fs.Output.Bytes() - - tval = string(string(outBuf)) - uj.Contributors = &tval - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Coordinates: - - /* handler: uj.Coordinates type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - uj.Coordinates = nil - - } else { - - var tval string - outBuf := fs.Output.Bytes() - - tval = string(string(outBuf)) - uj.Coordinates = &tval - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_CreatedAt: - - /* handler: uj.CreatedAt type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.CreatedAt = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Entities: - - /* handler: uj.Entities type=benchmark.Entities kind=struct quoted=false*/ - - { - if tok == fflib.FFTok_null { - - state = fflib.FFParse_after_value - goto mainparse - } - - err = uj.Entities.UnmarshalJSONFFLexer(fs, fflib.FFParse_want_key) - if err != nil { - return err - } - state = fflib.FFParse_after_value - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Favorited: - - /* handler: uj.Favorited type=bool kind=bool quoted=false*/ - - { - if tok != fflib.FFTok_bool && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for bool", tok)) - } - } - - { - if tok == fflib.FFTok_null { - - } else { - tmpb := fs.Output.Bytes() - - if bytes.Compare([]byte{'t', 'r', 'u', 'e'}, tmpb) == 0 { - - uj.Favorited = true - - } else if bytes.Compare([]byte{'f', 'a', 'l', 's', 'e'}, tmpb) == 0 { - - uj.Favorited = false - - } else { - err = errors.New("unexpected bytes for true/false value") - return fs.WrapErr(err) - } - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Geo: - - /* handler: uj.Geo type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - uj.Geo = nil - - } else { - - var tval string - outBuf := fs.Output.Bytes() - - tval = string(string(outBuf)) - uj.Geo = &tval - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_ID: - - /* handler: uj.ID type=int64 kind=int64 quoted=false*/ - - { - if tok != fflib.FFTok_integer && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for int64", tok)) - } - } - - { - - if tok == fflib.FFTok_null { - - } else { - - tval, err := fflib.ParseInt(fs.Output.Bytes(), 10, 64) - - if err != nil { - return fs.WrapErr(err) - } - - uj.ID = int64(tval) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_IDStr: - - /* handler: uj.IDStr type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.IDStr = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_InReplyToScreenName: - - /* handler: uj.InReplyToScreenName type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - uj.InReplyToScreenName = nil - - } else { - - var tval string - outBuf := fs.Output.Bytes() - - tval = string(string(outBuf)) - uj.InReplyToScreenName = &tval - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_InReplyToStatusID: - - /* handler: uj.InReplyToStatusID type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - uj.InReplyToStatusID = nil - - } else { - - var tval string - outBuf := fs.Output.Bytes() - - tval = string(string(outBuf)) - uj.InReplyToStatusID = &tval - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_InReplyToStatusIDStr: - - /* handler: uj.InReplyToStatusIDStr type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - uj.InReplyToStatusIDStr = nil - - } else { - - var tval string - outBuf := fs.Output.Bytes() - - tval = string(string(outBuf)) - uj.InReplyToStatusIDStr = &tval - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_InReplyToUserID: - - /* handler: uj.InReplyToUserID type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - uj.InReplyToUserID = nil - - } else { - - var tval string - outBuf := fs.Output.Bytes() - - tval = string(string(outBuf)) - uj.InReplyToUserID = &tval - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_InReplyToUserIDStr: - - /* handler: uj.InReplyToUserIDStr type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - uj.InReplyToUserIDStr = nil - - } else { - - var tval string - outBuf := fs.Output.Bytes() - - tval = string(string(outBuf)) - uj.InReplyToUserIDStr = &tval - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Metadata: - - /* handler: uj.Metadata type=benchmark.StatusMetadata kind=struct quoted=false*/ - - { - if tok == fflib.FFTok_null { - - state = fflib.FFParse_after_value - goto mainparse - } - - err = uj.Metadata.UnmarshalJSONFFLexer(fs, fflib.FFParse_want_key) - if err != nil { - return err - } - state = fflib.FFParse_after_value - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Place: - - /* handler: uj.Place type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - uj.Place = nil - - } else { - - var tval string - outBuf := fs.Output.Bytes() - - tval = string(string(outBuf)) - uj.Place = &tval - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_RetweetCount: - - /* handler: uj.RetweetCount type=int kind=int quoted=false*/ - - { - if tok != fflib.FFTok_integer && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for int", tok)) - } - } - - { - - if tok == fflib.FFTok_null { - - } else { - - tval, err := fflib.ParseInt(fs.Output.Bytes(), 10, 64) - - if err != nil { - return fs.WrapErr(err) - } - - uj.RetweetCount = int(tval) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Retweeted: - - /* handler: uj.Retweeted type=bool kind=bool quoted=false*/ - - { - if tok != fflib.FFTok_bool && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for bool", tok)) - } - } - - { - if tok == fflib.FFTok_null { - - } else { - tmpb := fs.Output.Bytes() - - if bytes.Compare([]byte{'t', 'r', 'u', 'e'}, tmpb) == 0 { - - uj.Retweeted = true - - } else if bytes.Compare([]byte{'f', 'a', 'l', 's', 'e'}, tmpb) == 0 { - - uj.Retweeted = false - - } else { - err = errors.New("unexpected bytes for true/false value") - return fs.WrapErr(err) - } - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Source: - - /* handler: uj.Source type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.Source = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Text: - - /* handler: uj.Text type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.Text = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Truncated: - - /* handler: uj.Truncated type=bool kind=bool quoted=false*/ - - { - if tok != fflib.FFTok_bool && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for bool", tok)) - } - } - - { - if tok == fflib.FFTok_null { - - } else { - tmpb := fs.Output.Bytes() - - if bytes.Compare([]byte{'t', 'r', 'u', 'e'}, tmpb) == 0 { - - uj.Truncated = true - - } else if bytes.Compare([]byte{'f', 'a', 'l', 's', 'e'}, tmpb) == 0 { - - uj.Truncated = false - - } else { - err = errors.New("unexpected bytes for true/false value") - return fs.WrapErr(err) - } - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_User: - - /* handler: uj.User type=benchmark.User kind=struct quoted=false*/ - - { - if tok == fflib.FFTok_null { - - state = fflib.FFParse_after_value - goto mainparse - } - - err = uj.User.UnmarshalJSONFFLexer(fs, fflib.FFParse_want_key) - if err != nil { - return err - } - state = fflib.FFParse_after_value - } - - state = fflib.FFParse_after_value - goto mainparse - -wantedvalue: - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) -wrongtokenerror: - return fs.WrapErr(fmt.Errorf("ffjson: wanted token: %v, but got token: %v output=%s", wantedTok, tok, fs.Output.String())) -tokerror: - if fs.BigError != nil { - return fs.WrapErr(fs.BigError) - } - err = fs.Error.ToError() - if err != nil { - return fs.WrapErr(err) - } - panic("ffjson-generated: unreachable, please report bug.") -done: - return nil -} - -func (mj *StatusMetadata) MarshalJSON() ([]byte, error) { - var buf fflib.Buffer - if mj == nil { - buf.WriteString("null") - return buf.Bytes(), nil - } - err := mj.MarshalJSONBuf(&buf) - if err != nil { - return nil, err - } - return buf.Bytes(), nil -} -func (mj *StatusMetadata) MarshalJSONBuf(buf fflib.EncodingBuffer) error { - if mj == nil { - buf.WriteString("null") - return nil - } - var err error - var obj []byte - _ = obj - _ = err - buf.WriteString(`{"iso_language_code":`) - fflib.WriteJsonString(buf, string(mj.IsoLanguageCode)) - buf.WriteString(`,"result_type":`) - fflib.WriteJsonString(buf, string(mj.ResultType)) - buf.WriteByte('}') - return nil -} - -const ( - ffj_t_StatusMetadatabase = iota - ffj_t_StatusMetadatano_such_key - - ffj_t_StatusMetadata_IsoLanguageCode - - ffj_t_StatusMetadata_ResultType -) - -var ffj_key_StatusMetadata_IsoLanguageCode = []byte("iso_language_code") - -var ffj_key_StatusMetadata_ResultType = []byte("result_type") - -func (uj *StatusMetadata) UnmarshalJSON(input []byte) error { - fs := fflib.NewFFLexer(input) - return uj.UnmarshalJSONFFLexer(fs, fflib.FFParse_map_start) -} - -func (uj *StatusMetadata) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error { - var err error = nil - currentKey := ffj_t_StatusMetadatabase - _ = currentKey - tok := fflib.FFTok_init - wantedTok := fflib.FFTok_init - -mainparse: - for { - tok = fs.Scan() - // println(fmt.Sprintf("debug: tok: %v state: %v", tok, state)) - if tok == fflib.FFTok_error { - goto tokerror - } - - switch state { - - case fflib.FFParse_map_start: - if tok != fflib.FFTok_left_bracket { - wantedTok = fflib.FFTok_left_bracket - goto wrongtokenerror - } - state = fflib.FFParse_want_key - continue - - case fflib.FFParse_after_value: - if tok == fflib.FFTok_comma { - state = fflib.FFParse_want_key - } else if tok == fflib.FFTok_right_bracket { - goto done - } else { - wantedTok = fflib.FFTok_comma - goto wrongtokenerror - } - - case fflib.FFParse_want_key: - // json {} ended. goto exit. woo. - if tok == fflib.FFTok_right_bracket { - goto done - } - if tok != fflib.FFTok_string { - wantedTok = fflib.FFTok_string - goto wrongtokenerror - } - - kn := fs.Output.Bytes() - if len(kn) <= 0 { - // "" case. hrm. - currentKey = ffj_t_StatusMetadatano_such_key - state = fflib.FFParse_want_colon - goto mainparse - } else { - switch kn[0] { - - case 'i': - - if bytes.Equal(ffj_key_StatusMetadata_IsoLanguageCode, kn) { - currentKey = ffj_t_StatusMetadata_IsoLanguageCode - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'r': - - if bytes.Equal(ffj_key_StatusMetadata_ResultType, kn) { - currentKey = ffj_t_StatusMetadata_ResultType - state = fflib.FFParse_want_colon - goto mainparse - } - - } - - if fflib.EqualFoldRight(ffj_key_StatusMetadata_ResultType, kn) { - currentKey = ffj_t_StatusMetadata_ResultType - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_StatusMetadata_IsoLanguageCode, kn) { - currentKey = ffj_t_StatusMetadata_IsoLanguageCode - state = fflib.FFParse_want_colon - goto mainparse - } - - currentKey = ffj_t_StatusMetadatano_such_key - state = fflib.FFParse_want_colon - goto mainparse - } - - case fflib.FFParse_want_colon: - if tok != fflib.FFTok_colon { - wantedTok = fflib.FFTok_colon - goto wrongtokenerror - } - state = fflib.FFParse_want_value - continue - case fflib.FFParse_want_value: - - if tok == fflib.FFTok_left_brace || tok == fflib.FFTok_left_bracket || tok == fflib.FFTok_integer || tok == fflib.FFTok_double || tok == fflib.FFTok_string || tok == fflib.FFTok_bool || tok == fflib.FFTok_null { - switch currentKey { - - case ffj_t_StatusMetadata_IsoLanguageCode: - goto handle_IsoLanguageCode - - case ffj_t_StatusMetadata_ResultType: - goto handle_ResultType - - case ffj_t_StatusMetadatano_such_key: - err = fs.SkipField(tok) - if err != nil { - return fs.WrapErr(err) - } - state = fflib.FFParse_after_value - goto mainparse - } - } else { - goto wantedvalue - } - } - } - -handle_IsoLanguageCode: - - /* handler: uj.IsoLanguageCode type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.IsoLanguageCode = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_ResultType: - - /* handler: uj.ResultType type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.ResultType = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -wantedvalue: - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) -wrongtokenerror: - return fs.WrapErr(fmt.Errorf("ffjson: wanted token: %v, but got token: %v output=%s", wantedTok, tok, fs.Output.String())) -tokerror: - if fs.BigError != nil { - return fs.WrapErr(fs.BigError) - } - err = fs.Error.ToError() - if err != nil { - return fs.WrapErr(err) - } - panic("ffjson-generated: unreachable, please report bug.") -done: - return nil -} - -func (mj *URL) MarshalJSON() ([]byte, error) { - var buf fflib.Buffer - if mj == nil { - buf.WriteString("null") - return buf.Bytes(), nil - } - err := mj.MarshalJSONBuf(&buf) - if err != nil { - return nil, err - } - return buf.Bytes(), nil -} -func (mj *URL) MarshalJSONBuf(buf fflib.EncodingBuffer) error { - if mj == nil { - buf.WriteString("null") - return nil - } - var err error - var obj []byte - _ = obj - _ = err - if mj.ExpandedURL != nil { - buf.WriteString(`{"expanded_url":`) - fflib.WriteJsonString(buf, string(*mj.ExpandedURL)) - } else { - buf.WriteString(`{"expanded_url":null`) - } - buf.WriteString(`,"indices":`) - if mj.Indices != nil { - buf.WriteString(`[`) - for i, v := range mj.Indices { - if i != 0 { - buf.WriteString(`,`) - } - fflib.FormatBits2(buf, uint64(v), 10, v < 0) - } - buf.WriteString(`]`) - } else { - buf.WriteString(`null`) - } - buf.WriteString(`,"url":`) - fflib.WriteJsonString(buf, string(mj.URL)) - buf.WriteByte('}') - return nil -} - -const ( - ffj_t_URLbase = iota - ffj_t_URLno_such_key - - ffj_t_URL_ExpandedURL - - ffj_t_URL_Indices - - ffj_t_URL_URL -) - -var ffj_key_URL_ExpandedURL = []byte("expanded_url") - -var ffj_key_URL_Indices = []byte("indices") - -var ffj_key_URL_URL = []byte("url") - -func (uj *URL) UnmarshalJSON(input []byte) error { - fs := fflib.NewFFLexer(input) - return uj.UnmarshalJSONFFLexer(fs, fflib.FFParse_map_start) -} - -func (uj *URL) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error { - var err error = nil - currentKey := ffj_t_URLbase - _ = currentKey - tok := fflib.FFTok_init - wantedTok := fflib.FFTok_init - -mainparse: - for { - tok = fs.Scan() - // println(fmt.Sprintf("debug: tok: %v state: %v", tok, state)) - if tok == fflib.FFTok_error { - goto tokerror - } - - switch state { - - case fflib.FFParse_map_start: - if tok != fflib.FFTok_left_bracket { - wantedTok = fflib.FFTok_left_bracket - goto wrongtokenerror - } - state = fflib.FFParse_want_key - continue - - case fflib.FFParse_after_value: - if tok == fflib.FFTok_comma { - state = fflib.FFParse_want_key - } else if tok == fflib.FFTok_right_bracket { - goto done - } else { - wantedTok = fflib.FFTok_comma - goto wrongtokenerror - } - - case fflib.FFParse_want_key: - // json {} ended. goto exit. woo. - if tok == fflib.FFTok_right_bracket { - goto done - } - if tok != fflib.FFTok_string { - wantedTok = fflib.FFTok_string - goto wrongtokenerror - } - - kn := fs.Output.Bytes() - if len(kn) <= 0 { - // "" case. hrm. - currentKey = ffj_t_URLno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } else { - switch kn[0] { - - case 'e': - - if bytes.Equal(ffj_key_URL_ExpandedURL, kn) { - currentKey = ffj_t_URL_ExpandedURL - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'i': - - if bytes.Equal(ffj_key_URL_Indices, kn) { - currentKey = ffj_t_URL_Indices - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'u': - - if bytes.Equal(ffj_key_URL_URL, kn) { - currentKey = ffj_t_URL_URL - state = fflib.FFParse_want_colon - goto mainparse - } - - } - - if fflib.SimpleLetterEqualFold(ffj_key_URL_URL, kn) { - currentKey = ffj_t_URL_URL - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_URL_Indices, kn) { - currentKey = ffj_t_URL_Indices - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.AsciiEqualFold(ffj_key_URL_ExpandedURL, kn) { - currentKey = ffj_t_URL_ExpandedURL - state = fflib.FFParse_want_colon - goto mainparse - } - - currentKey = ffj_t_URLno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } - - case fflib.FFParse_want_colon: - if tok != fflib.FFTok_colon { - wantedTok = fflib.FFTok_colon - goto wrongtokenerror - } - state = fflib.FFParse_want_value - continue - case fflib.FFParse_want_value: - - if tok == fflib.FFTok_left_brace || tok == fflib.FFTok_left_bracket || tok == fflib.FFTok_integer || tok == fflib.FFTok_double || tok == fflib.FFTok_string || tok == fflib.FFTok_bool || tok == fflib.FFTok_null { - switch currentKey { - - case ffj_t_URL_ExpandedURL: - goto handle_ExpandedURL - - case ffj_t_URL_Indices: - goto handle_Indices - - case ffj_t_URL_URL: - goto handle_URL - - case ffj_t_URLno_such_key: - err = fs.SkipField(tok) - if err != nil { - return fs.WrapErr(err) - } - state = fflib.FFParse_after_value - goto mainparse - } - } else { - goto wantedvalue - } - } - } - -handle_ExpandedURL: - - /* handler: uj.ExpandedURL type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - uj.ExpandedURL = nil - - } else { - - var tval string - outBuf := fs.Output.Bytes() - - tval = string(string(outBuf)) - uj.ExpandedURL = &tval - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Indices: - - /* handler: uj.Indices type=[]int kind=slice quoted=false*/ - - { - - { - if tok != fflib.FFTok_left_brace && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for ", tok)) - } - } - - if tok == fflib.FFTok_null { - uj.Indices = nil - } else { - - uj.Indices = make([]int, 0) - - wantVal := true - - for { - - var tmp_uj__Indices int - - tok = fs.Scan() - if tok == fflib.FFTok_error { - goto tokerror - } - if tok == fflib.FFTok_right_brace { - break - } - - if tok == fflib.FFTok_comma { - if wantVal == true { - // TODO(pquerna): this isn't an ideal error message, this handles - // things like [,,,] as an array value. - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) - } - continue - } else { - wantVal = true - } - - /* handler: tmp_uj__Indices type=int kind=int quoted=false*/ - - { - if tok != fflib.FFTok_integer && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for int", tok)) - } - } - - { - - if tok == fflib.FFTok_null { - - } else { - - tval, err := fflib.ParseInt(fs.Output.Bytes(), 10, 64) - - if err != nil { - return fs.WrapErr(err) - } - - tmp_uj__Indices = int(tval) - - } - } - - uj.Indices = append(uj.Indices, tmp_uj__Indices) - wantVal = false - } - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_URL: - - /* handler: uj.URL type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.URL = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -wantedvalue: - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) -wrongtokenerror: - return fs.WrapErr(fmt.Errorf("ffjson: wanted token: %v, but got token: %v output=%s", wantedTok, tok, fs.Output.String())) -tokerror: - if fs.BigError != nil { - return fs.WrapErr(fs.BigError) - } - err = fs.Error.ToError() - if err != nil { - return fs.WrapErr(err) - } - panic("ffjson-generated: unreachable, please report bug.") -done: - return nil -} - -func (mj *User) MarshalJSON() ([]byte, error) { - var buf fflib.Buffer - if mj == nil { - buf.WriteString("null") - return buf.Bytes(), nil - } - err := mj.MarshalJSONBuf(&buf) - if err != nil { - return nil, err - } - return buf.Bytes(), nil -} -func (mj *User) MarshalJSONBuf(buf fflib.EncodingBuffer) error { - if mj == nil { - buf.WriteString("null") - return nil - } - var err error - var obj []byte - _ = obj - _ = err - if mj.ContributorsEnabled { - buf.WriteString(`{"contributors_enabled":true`) - } else { - buf.WriteString(`{"contributors_enabled":false`) - } - buf.WriteString(`,"created_at":`) - fflib.WriteJsonString(buf, string(mj.CreatedAt)) - if mj.DefaultProfile { - buf.WriteString(`,"default_profile":true`) - } else { - buf.WriteString(`,"default_profile":false`) - } - if mj.DefaultProfileImage { - buf.WriteString(`,"default_profile_image":true`) - } else { - buf.WriteString(`,"default_profile_image":false`) - } - buf.WriteString(`,"description":`) - fflib.WriteJsonString(buf, string(mj.Description)) - buf.WriteString(`,"entities":`) - - { - - err = mj.Entities.MarshalJSONBuf(buf) - if err != nil { - return err - } - - } - buf.WriteString(`,"favourites_count":`) - fflib.FormatBits2(buf, uint64(mj.FavouritesCount), 10, mj.FavouritesCount < 0) - if mj.FollowRequestSent != nil { - buf.WriteString(`,"follow_request_sent":`) - fflib.WriteJsonString(buf, string(*mj.FollowRequestSent)) - } else { - buf.WriteString(`,"follow_request_sent":null`) - } - buf.WriteString(`,"followers_count":`) - fflib.FormatBits2(buf, uint64(mj.FollowersCount), 10, mj.FollowersCount < 0) - if mj.Following != nil { - buf.WriteString(`,"following":`) - fflib.WriteJsonString(buf, string(*mj.Following)) - } else { - buf.WriteString(`,"following":null`) - } - buf.WriteString(`,"friends_count":`) - fflib.FormatBits2(buf, uint64(mj.FriendsCount), 10, mj.FriendsCount < 0) - if mj.GeoEnabled { - buf.WriteString(`,"geo_enabled":true`) - } else { - buf.WriteString(`,"geo_enabled":false`) - } - buf.WriteString(`,"id":`) - fflib.FormatBits2(buf, uint64(mj.ID), 10, mj.ID < 0) - buf.WriteString(`,"id_str":`) - fflib.WriteJsonString(buf, string(mj.IDStr)) - if mj.IsTranslator { - buf.WriteString(`,"is_translator":true`) - } else { - buf.WriteString(`,"is_translator":false`) - } - buf.WriteString(`,"lang":`) - fflib.WriteJsonString(buf, string(mj.Lang)) - buf.WriteString(`,"listed_count":`) - fflib.FormatBits2(buf, uint64(mj.ListedCount), 10, mj.ListedCount < 0) - buf.WriteString(`,"location":`) - fflib.WriteJsonString(buf, string(mj.Location)) - buf.WriteString(`,"name":`) - fflib.WriteJsonString(buf, string(mj.Name)) - if mj.Notifications != nil { - buf.WriteString(`,"notifications":`) - fflib.WriteJsonString(buf, string(*mj.Notifications)) - } else { - buf.WriteString(`,"notifications":null`) - } - buf.WriteString(`,"profile_background_color":`) - fflib.WriteJsonString(buf, string(mj.ProfileBackgroundColor)) - buf.WriteString(`,"profile_background_image_url":`) - fflib.WriteJsonString(buf, string(mj.ProfileBackgroundImageURL)) - buf.WriteString(`,"profile_background_image_url_https":`) - fflib.WriteJsonString(buf, string(mj.ProfileBackgroundImageURLHTTPS)) - if mj.ProfileBackgroundTile { - buf.WriteString(`,"profile_background_tile":true`) - } else { - buf.WriteString(`,"profile_background_tile":false`) - } - buf.WriteString(`,"profile_image_url":`) - fflib.WriteJsonString(buf, string(mj.ProfileImageURL)) - buf.WriteString(`,"profile_image_url_https":`) - fflib.WriteJsonString(buf, string(mj.ProfileImageURLHTTPS)) - buf.WriteString(`,"profile_link_color":`) - fflib.WriteJsonString(buf, string(mj.ProfileLinkColor)) - buf.WriteString(`,"profile_sidebar_border_color":`) - fflib.WriteJsonString(buf, string(mj.ProfileSidebarBorderColor)) - buf.WriteString(`,"profile_sidebar_fill_color":`) - fflib.WriteJsonString(buf, string(mj.ProfileSidebarFillColor)) - buf.WriteString(`,"profile_text_color":`) - fflib.WriteJsonString(buf, string(mj.ProfileTextColor)) - if mj.ProfileUseBackgroundImage { - buf.WriteString(`,"profile_use_background_image":true`) - } else { - buf.WriteString(`,"profile_use_background_image":false`) - } - if mj.Protected { - buf.WriteString(`,"protected":true`) - } else { - buf.WriteString(`,"protected":false`) - } - buf.WriteString(`,"screen_name":`) - fflib.WriteJsonString(buf, string(mj.ScreenName)) - if mj.ShowAllInlineMedia { - buf.WriteString(`,"show_all_inline_media":true`) - } else { - buf.WriteString(`,"show_all_inline_media":false`) - } - buf.WriteString(`,"statuses_count":`) - fflib.FormatBits2(buf, uint64(mj.StatusesCount), 10, mj.StatusesCount < 0) - buf.WriteString(`,"time_zone":`) - fflib.WriteJsonString(buf, string(mj.TimeZone)) - if mj.URL != nil { - buf.WriteString(`,"url":`) - fflib.WriteJsonString(buf, string(*mj.URL)) - } else { - buf.WriteString(`,"url":null`) - } - buf.WriteString(`,"utc_offset":`) - fflib.FormatBits2(buf, uint64(mj.UtcOffset), 10, mj.UtcOffset < 0) - if mj.Verified { - buf.WriteString(`,"verified":true`) - } else { - buf.WriteString(`,"verified":false`) - } - buf.WriteByte('}') - return nil -} - -const ( - ffj_t_Userbase = iota - ffj_t_Userno_such_key - - ffj_t_User_ContributorsEnabled - - ffj_t_User_CreatedAt - - ffj_t_User_DefaultProfile - - ffj_t_User_DefaultProfileImage - - ffj_t_User_Description - - ffj_t_User_Entities - - ffj_t_User_FavouritesCount - - ffj_t_User_FollowRequestSent - - ffj_t_User_FollowersCount - - ffj_t_User_Following - - ffj_t_User_FriendsCount - - ffj_t_User_GeoEnabled - - ffj_t_User_ID - - ffj_t_User_IDStr - - ffj_t_User_IsTranslator - - ffj_t_User_Lang - - ffj_t_User_ListedCount - - ffj_t_User_Location - - ffj_t_User_Name - - ffj_t_User_Notifications - - ffj_t_User_ProfileBackgroundColor - - ffj_t_User_ProfileBackgroundImageURL - - ffj_t_User_ProfileBackgroundImageURLHTTPS - - ffj_t_User_ProfileBackgroundTile - - ffj_t_User_ProfileImageURL - - ffj_t_User_ProfileImageURLHTTPS - - ffj_t_User_ProfileLinkColor - - ffj_t_User_ProfileSidebarBorderColor - - ffj_t_User_ProfileSidebarFillColor - - ffj_t_User_ProfileTextColor - - ffj_t_User_ProfileUseBackgroundImage - - ffj_t_User_Protected - - ffj_t_User_ScreenName - - ffj_t_User_ShowAllInlineMedia - - ffj_t_User_StatusesCount - - ffj_t_User_TimeZone - - ffj_t_User_URL - - ffj_t_User_UtcOffset - - ffj_t_User_Verified -) - -var ffj_key_User_ContributorsEnabled = []byte("contributors_enabled") - -var ffj_key_User_CreatedAt = []byte("created_at") - -var ffj_key_User_DefaultProfile = []byte("default_profile") - -var ffj_key_User_DefaultProfileImage = []byte("default_profile_image") - -var ffj_key_User_Description = []byte("description") - -var ffj_key_User_Entities = []byte("entities") - -var ffj_key_User_FavouritesCount = []byte("favourites_count") - -var ffj_key_User_FollowRequestSent = []byte("follow_request_sent") - -var ffj_key_User_FollowersCount = []byte("followers_count") - -var ffj_key_User_Following = []byte("following") - -var ffj_key_User_FriendsCount = []byte("friends_count") - -var ffj_key_User_GeoEnabled = []byte("geo_enabled") - -var ffj_key_User_ID = []byte("id") - -var ffj_key_User_IDStr = []byte("id_str") - -var ffj_key_User_IsTranslator = []byte("is_translator") - -var ffj_key_User_Lang = []byte("lang") - -var ffj_key_User_ListedCount = []byte("listed_count") - -var ffj_key_User_Location = []byte("location") - -var ffj_key_User_Name = []byte("name") - -var ffj_key_User_Notifications = []byte("notifications") - -var ffj_key_User_ProfileBackgroundColor = []byte("profile_background_color") - -var ffj_key_User_ProfileBackgroundImageURL = []byte("profile_background_image_url") - -var ffj_key_User_ProfileBackgroundImageURLHTTPS = []byte("profile_background_image_url_https") - -var ffj_key_User_ProfileBackgroundTile = []byte("profile_background_tile") - -var ffj_key_User_ProfileImageURL = []byte("profile_image_url") - -var ffj_key_User_ProfileImageURLHTTPS = []byte("profile_image_url_https") - -var ffj_key_User_ProfileLinkColor = []byte("profile_link_color") - -var ffj_key_User_ProfileSidebarBorderColor = []byte("profile_sidebar_border_color") - -var ffj_key_User_ProfileSidebarFillColor = []byte("profile_sidebar_fill_color") - -var ffj_key_User_ProfileTextColor = []byte("profile_text_color") - -var ffj_key_User_ProfileUseBackgroundImage = []byte("profile_use_background_image") - -var ffj_key_User_Protected = []byte("protected") - -var ffj_key_User_ScreenName = []byte("screen_name") - -var ffj_key_User_ShowAllInlineMedia = []byte("show_all_inline_media") - -var ffj_key_User_StatusesCount = []byte("statuses_count") - -var ffj_key_User_TimeZone = []byte("time_zone") - -var ffj_key_User_URL = []byte("url") - -var ffj_key_User_UtcOffset = []byte("utc_offset") - -var ffj_key_User_Verified = []byte("verified") - -func (uj *User) UnmarshalJSON(input []byte) error { - fs := fflib.NewFFLexer(input) - return uj.UnmarshalJSONFFLexer(fs, fflib.FFParse_map_start) -} - -func (uj *User) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error { - var err error = nil - currentKey := ffj_t_Userbase - _ = currentKey - tok := fflib.FFTok_init - wantedTok := fflib.FFTok_init - -mainparse: - for { - tok = fs.Scan() - // println(fmt.Sprintf("debug: tok: %v state: %v", tok, state)) - if tok == fflib.FFTok_error { - goto tokerror - } - - switch state { - - case fflib.FFParse_map_start: - if tok != fflib.FFTok_left_bracket { - wantedTok = fflib.FFTok_left_bracket - goto wrongtokenerror - } - state = fflib.FFParse_want_key - continue - - case fflib.FFParse_after_value: - if tok == fflib.FFTok_comma { - state = fflib.FFParse_want_key - } else if tok == fflib.FFTok_right_bracket { - goto done - } else { - wantedTok = fflib.FFTok_comma - goto wrongtokenerror - } - - case fflib.FFParse_want_key: - // json {} ended. goto exit. woo. - if tok == fflib.FFTok_right_bracket { - goto done - } - if tok != fflib.FFTok_string { - wantedTok = fflib.FFTok_string - goto wrongtokenerror - } - - kn := fs.Output.Bytes() - if len(kn) <= 0 { - // "" case. hrm. - currentKey = ffj_t_Userno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } else { - switch kn[0] { - - case 'c': - - if bytes.Equal(ffj_key_User_ContributorsEnabled, kn) { - currentKey = ffj_t_User_ContributorsEnabled - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_CreatedAt, kn) { - currentKey = ffj_t_User_CreatedAt - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'd': - - if bytes.Equal(ffj_key_User_DefaultProfile, kn) { - currentKey = ffj_t_User_DefaultProfile - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_DefaultProfileImage, kn) { - currentKey = ffj_t_User_DefaultProfileImage - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_Description, kn) { - currentKey = ffj_t_User_Description - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'e': - - if bytes.Equal(ffj_key_User_Entities, kn) { - currentKey = ffj_t_User_Entities - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'f': - - if bytes.Equal(ffj_key_User_FavouritesCount, kn) { - currentKey = ffj_t_User_FavouritesCount - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_FollowRequestSent, kn) { - currentKey = ffj_t_User_FollowRequestSent - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_FollowersCount, kn) { - currentKey = ffj_t_User_FollowersCount - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_Following, kn) { - currentKey = ffj_t_User_Following - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_FriendsCount, kn) { - currentKey = ffj_t_User_FriendsCount - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'g': - - if bytes.Equal(ffj_key_User_GeoEnabled, kn) { - currentKey = ffj_t_User_GeoEnabled - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'i': - - if bytes.Equal(ffj_key_User_ID, kn) { - currentKey = ffj_t_User_ID - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_IDStr, kn) { - currentKey = ffj_t_User_IDStr - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_IsTranslator, kn) { - currentKey = ffj_t_User_IsTranslator - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'l': - - if bytes.Equal(ffj_key_User_Lang, kn) { - currentKey = ffj_t_User_Lang - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_ListedCount, kn) { - currentKey = ffj_t_User_ListedCount - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_Location, kn) { - currentKey = ffj_t_User_Location - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'n': - - if bytes.Equal(ffj_key_User_Name, kn) { - currentKey = ffj_t_User_Name - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_Notifications, kn) { - currentKey = ffj_t_User_Notifications - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'p': - - if bytes.Equal(ffj_key_User_ProfileBackgroundColor, kn) { - currentKey = ffj_t_User_ProfileBackgroundColor - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_ProfileBackgroundImageURL, kn) { - currentKey = ffj_t_User_ProfileBackgroundImageURL - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_ProfileBackgroundImageURLHTTPS, kn) { - currentKey = ffj_t_User_ProfileBackgroundImageURLHTTPS - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_ProfileBackgroundTile, kn) { - currentKey = ffj_t_User_ProfileBackgroundTile - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_ProfileImageURL, kn) { - currentKey = ffj_t_User_ProfileImageURL - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_ProfileImageURLHTTPS, kn) { - currentKey = ffj_t_User_ProfileImageURLHTTPS - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_ProfileLinkColor, kn) { - currentKey = ffj_t_User_ProfileLinkColor - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_ProfileSidebarBorderColor, kn) { - currentKey = ffj_t_User_ProfileSidebarBorderColor - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_ProfileSidebarFillColor, kn) { - currentKey = ffj_t_User_ProfileSidebarFillColor - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_ProfileTextColor, kn) { - currentKey = ffj_t_User_ProfileTextColor - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_ProfileUseBackgroundImage, kn) { - currentKey = ffj_t_User_ProfileUseBackgroundImage - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_Protected, kn) { - currentKey = ffj_t_User_Protected - state = fflib.FFParse_want_colon - goto mainparse - } - - case 's': - - if bytes.Equal(ffj_key_User_ScreenName, kn) { - currentKey = ffj_t_User_ScreenName - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_ShowAllInlineMedia, kn) { - currentKey = ffj_t_User_ShowAllInlineMedia - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_StatusesCount, kn) { - currentKey = ffj_t_User_StatusesCount - state = fflib.FFParse_want_colon - goto mainparse - } - - case 't': - - if bytes.Equal(ffj_key_User_TimeZone, kn) { - currentKey = ffj_t_User_TimeZone - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'u': - - if bytes.Equal(ffj_key_User_URL, kn) { - currentKey = ffj_t_User_URL - state = fflib.FFParse_want_colon - goto mainparse - - } else if bytes.Equal(ffj_key_User_UtcOffset, kn) { - currentKey = ffj_t_User_UtcOffset - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'v': - - if bytes.Equal(ffj_key_User_Verified, kn) { - currentKey = ffj_t_User_Verified - state = fflib.FFParse_want_colon - goto mainparse - } - - } - - if fflib.SimpleLetterEqualFold(ffj_key_User_Verified, kn) { - currentKey = ffj_t_User_Verified - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_UtcOffset, kn) { - currentKey = ffj_t_User_UtcOffset - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.SimpleLetterEqualFold(ffj_key_User_URL, kn) { - currentKey = ffj_t_User_URL - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.AsciiEqualFold(ffj_key_User_TimeZone, kn) { - currentKey = ffj_t_User_TimeZone - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_StatusesCount, kn) { - currentKey = ffj_t_User_StatusesCount - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_ShowAllInlineMedia, kn) { - currentKey = ffj_t_User_ShowAllInlineMedia - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_ScreenName, kn) { - currentKey = ffj_t_User_ScreenName - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.SimpleLetterEqualFold(ffj_key_User_Protected, kn) { - currentKey = ffj_t_User_Protected - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_ProfileUseBackgroundImage, kn) { - currentKey = ffj_t_User_ProfileUseBackgroundImage - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.AsciiEqualFold(ffj_key_User_ProfileTextColor, kn) { - currentKey = ffj_t_User_ProfileTextColor - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_ProfileSidebarFillColor, kn) { - currentKey = ffj_t_User_ProfileSidebarFillColor - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_ProfileSidebarBorderColor, kn) { - currentKey = ffj_t_User_ProfileSidebarBorderColor - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_ProfileLinkColor, kn) { - currentKey = ffj_t_User_ProfileLinkColor - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_ProfileImageURLHTTPS, kn) { - currentKey = ffj_t_User_ProfileImageURLHTTPS - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.AsciiEqualFold(ffj_key_User_ProfileImageURL, kn) { - currentKey = ffj_t_User_ProfileImageURL - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_ProfileBackgroundTile, kn) { - currentKey = ffj_t_User_ProfileBackgroundTile - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_ProfileBackgroundImageURLHTTPS, kn) { - currentKey = ffj_t_User_ProfileBackgroundImageURLHTTPS - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_ProfileBackgroundImageURL, kn) { - currentKey = ffj_t_User_ProfileBackgroundImageURL - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_ProfileBackgroundColor, kn) { - currentKey = ffj_t_User_ProfileBackgroundColor - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_Notifications, kn) { - currentKey = ffj_t_User_Notifications - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.SimpleLetterEqualFold(ffj_key_User_Name, kn) { - currentKey = ffj_t_User_Name - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.SimpleLetterEqualFold(ffj_key_User_Location, kn) { - currentKey = ffj_t_User_Location - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_ListedCount, kn) { - currentKey = ffj_t_User_ListedCount - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.SimpleLetterEqualFold(ffj_key_User_Lang, kn) { - currentKey = ffj_t_User_Lang - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_IsTranslator, kn) { - currentKey = ffj_t_User_IsTranslator - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_IDStr, kn) { - currentKey = ffj_t_User_IDStr - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.SimpleLetterEqualFold(ffj_key_User_ID, kn) { - currentKey = ffj_t_User_ID - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.AsciiEqualFold(ffj_key_User_GeoEnabled, kn) { - currentKey = ffj_t_User_GeoEnabled - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_FriendsCount, kn) { - currentKey = ffj_t_User_FriendsCount - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.SimpleLetterEqualFold(ffj_key_User_Following, kn) { - currentKey = ffj_t_User_Following - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_FollowersCount, kn) { - currentKey = ffj_t_User_FollowersCount - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_FollowRequestSent, kn) { - currentKey = ffj_t_User_FollowRequestSent - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_FavouritesCount, kn) { - currentKey = ffj_t_User_FavouritesCount - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_Entities, kn) { - currentKey = ffj_t_User_Entities - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_Description, kn) { - currentKey = ffj_t_User_Description - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.AsciiEqualFold(ffj_key_User_DefaultProfileImage, kn) { - currentKey = ffj_t_User_DefaultProfileImage - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.AsciiEqualFold(ffj_key_User_DefaultProfile, kn) { - currentKey = ffj_t_User_DefaultProfile - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.AsciiEqualFold(ffj_key_User_CreatedAt, kn) { - currentKey = ffj_t_User_CreatedAt - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_User_ContributorsEnabled, kn) { - currentKey = ffj_t_User_ContributorsEnabled - state = fflib.FFParse_want_colon - goto mainparse - } - - currentKey = ffj_t_Userno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } - - case fflib.FFParse_want_colon: - if tok != fflib.FFTok_colon { - wantedTok = fflib.FFTok_colon - goto wrongtokenerror - } - state = fflib.FFParse_want_value - continue - case fflib.FFParse_want_value: - - if tok == fflib.FFTok_left_brace || tok == fflib.FFTok_left_bracket || tok == fflib.FFTok_integer || tok == fflib.FFTok_double || tok == fflib.FFTok_string || tok == fflib.FFTok_bool || tok == fflib.FFTok_null { - switch currentKey { - - case ffj_t_User_ContributorsEnabled: - goto handle_ContributorsEnabled - - case ffj_t_User_CreatedAt: - goto handle_CreatedAt - - case ffj_t_User_DefaultProfile: - goto handle_DefaultProfile - - case ffj_t_User_DefaultProfileImage: - goto handle_DefaultProfileImage - - case ffj_t_User_Description: - goto handle_Description - - case ffj_t_User_Entities: - goto handle_Entities - - case ffj_t_User_FavouritesCount: - goto handle_FavouritesCount - - case ffj_t_User_FollowRequestSent: - goto handle_FollowRequestSent - - case ffj_t_User_FollowersCount: - goto handle_FollowersCount - - case ffj_t_User_Following: - goto handle_Following - - case ffj_t_User_FriendsCount: - goto handle_FriendsCount - - case ffj_t_User_GeoEnabled: - goto handle_GeoEnabled - - case ffj_t_User_ID: - goto handle_ID - - case ffj_t_User_IDStr: - goto handle_IDStr - - case ffj_t_User_IsTranslator: - goto handle_IsTranslator - - case ffj_t_User_Lang: - goto handle_Lang - - case ffj_t_User_ListedCount: - goto handle_ListedCount - - case ffj_t_User_Location: - goto handle_Location - - case ffj_t_User_Name: - goto handle_Name - - case ffj_t_User_Notifications: - goto handle_Notifications - - case ffj_t_User_ProfileBackgroundColor: - goto handle_ProfileBackgroundColor - - case ffj_t_User_ProfileBackgroundImageURL: - goto handle_ProfileBackgroundImageURL - - case ffj_t_User_ProfileBackgroundImageURLHTTPS: - goto handle_ProfileBackgroundImageURLHTTPS - - case ffj_t_User_ProfileBackgroundTile: - goto handle_ProfileBackgroundTile - - case ffj_t_User_ProfileImageURL: - goto handle_ProfileImageURL - - case ffj_t_User_ProfileImageURLHTTPS: - goto handle_ProfileImageURLHTTPS - - case ffj_t_User_ProfileLinkColor: - goto handle_ProfileLinkColor - - case ffj_t_User_ProfileSidebarBorderColor: - goto handle_ProfileSidebarBorderColor - - case ffj_t_User_ProfileSidebarFillColor: - goto handle_ProfileSidebarFillColor - - case ffj_t_User_ProfileTextColor: - goto handle_ProfileTextColor - - case ffj_t_User_ProfileUseBackgroundImage: - goto handle_ProfileUseBackgroundImage - - case ffj_t_User_Protected: - goto handle_Protected - - case ffj_t_User_ScreenName: - goto handle_ScreenName - - case ffj_t_User_ShowAllInlineMedia: - goto handle_ShowAllInlineMedia - - case ffj_t_User_StatusesCount: - goto handle_StatusesCount - - case ffj_t_User_TimeZone: - goto handle_TimeZone - - case ffj_t_User_URL: - goto handle_URL - - case ffj_t_User_UtcOffset: - goto handle_UtcOffset - - case ffj_t_User_Verified: - goto handle_Verified - - case ffj_t_Userno_such_key: - err = fs.SkipField(tok) - if err != nil { - return fs.WrapErr(err) - } - state = fflib.FFParse_after_value - goto mainparse - } - } else { - goto wantedvalue - } - } - } - -handle_ContributorsEnabled: - - /* handler: uj.ContributorsEnabled type=bool kind=bool quoted=false*/ - - { - if tok != fflib.FFTok_bool && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for bool", tok)) - } - } - - { - if tok == fflib.FFTok_null { - - } else { - tmpb := fs.Output.Bytes() - - if bytes.Compare([]byte{'t', 'r', 'u', 'e'}, tmpb) == 0 { - - uj.ContributorsEnabled = true - - } else if bytes.Compare([]byte{'f', 'a', 'l', 's', 'e'}, tmpb) == 0 { - - uj.ContributorsEnabled = false - - } else { - err = errors.New("unexpected bytes for true/false value") - return fs.WrapErr(err) - } - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_CreatedAt: - - /* handler: uj.CreatedAt type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.CreatedAt = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_DefaultProfile: - - /* handler: uj.DefaultProfile type=bool kind=bool quoted=false*/ - - { - if tok != fflib.FFTok_bool && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for bool", tok)) - } - } - - { - if tok == fflib.FFTok_null { - - } else { - tmpb := fs.Output.Bytes() - - if bytes.Compare([]byte{'t', 'r', 'u', 'e'}, tmpb) == 0 { - - uj.DefaultProfile = true - - } else if bytes.Compare([]byte{'f', 'a', 'l', 's', 'e'}, tmpb) == 0 { - - uj.DefaultProfile = false - - } else { - err = errors.New("unexpected bytes for true/false value") - return fs.WrapErr(err) - } - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_DefaultProfileImage: - - /* handler: uj.DefaultProfileImage type=bool kind=bool quoted=false*/ - - { - if tok != fflib.FFTok_bool && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for bool", tok)) - } - } - - { - if tok == fflib.FFTok_null { - - } else { - tmpb := fs.Output.Bytes() - - if bytes.Compare([]byte{'t', 'r', 'u', 'e'}, tmpb) == 0 { - - uj.DefaultProfileImage = true - - } else if bytes.Compare([]byte{'f', 'a', 'l', 's', 'e'}, tmpb) == 0 { - - uj.DefaultProfileImage = false - - } else { - err = errors.New("unexpected bytes for true/false value") - return fs.WrapErr(err) - } - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Description: - - /* handler: uj.Description type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.Description = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Entities: - - /* handler: uj.Entities type=benchmark.UserEntities kind=struct quoted=false*/ - - { - if tok == fflib.FFTok_null { - - state = fflib.FFParse_after_value - goto mainparse - } - - err = uj.Entities.UnmarshalJSONFFLexer(fs, fflib.FFParse_want_key) - if err != nil { - return err - } - state = fflib.FFParse_after_value - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_FavouritesCount: - - /* handler: uj.FavouritesCount type=int kind=int quoted=false*/ - - { - if tok != fflib.FFTok_integer && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for int", tok)) - } - } - - { - - if tok == fflib.FFTok_null { - - } else { - - tval, err := fflib.ParseInt(fs.Output.Bytes(), 10, 64) - - if err != nil { - return fs.WrapErr(err) - } - - uj.FavouritesCount = int(tval) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_FollowRequestSent: - - /* handler: uj.FollowRequestSent type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - uj.FollowRequestSent = nil - - } else { - - var tval string - outBuf := fs.Output.Bytes() - - tval = string(string(outBuf)) - uj.FollowRequestSent = &tval - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_FollowersCount: - - /* handler: uj.FollowersCount type=int kind=int quoted=false*/ - - { - if tok != fflib.FFTok_integer && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for int", tok)) - } - } - - { - - if tok == fflib.FFTok_null { - - } else { - - tval, err := fflib.ParseInt(fs.Output.Bytes(), 10, 64) - - if err != nil { - return fs.WrapErr(err) - } - - uj.FollowersCount = int(tval) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Following: - - /* handler: uj.Following type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - uj.Following = nil - - } else { - - var tval string - outBuf := fs.Output.Bytes() - - tval = string(string(outBuf)) - uj.Following = &tval - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_FriendsCount: - - /* handler: uj.FriendsCount type=int kind=int quoted=false*/ - - { - if tok != fflib.FFTok_integer && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for int", tok)) - } - } - - { - - if tok == fflib.FFTok_null { - - } else { - - tval, err := fflib.ParseInt(fs.Output.Bytes(), 10, 64) - - if err != nil { - return fs.WrapErr(err) - } - - uj.FriendsCount = int(tval) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_GeoEnabled: - - /* handler: uj.GeoEnabled type=bool kind=bool quoted=false*/ - - { - if tok != fflib.FFTok_bool && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for bool", tok)) - } - } - - { - if tok == fflib.FFTok_null { - - } else { - tmpb := fs.Output.Bytes() - - if bytes.Compare([]byte{'t', 'r', 'u', 'e'}, tmpb) == 0 { - - uj.GeoEnabled = true - - } else if bytes.Compare([]byte{'f', 'a', 'l', 's', 'e'}, tmpb) == 0 { - - uj.GeoEnabled = false - - } else { - err = errors.New("unexpected bytes for true/false value") - return fs.WrapErr(err) - } - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_ID: - - /* handler: uj.ID type=int kind=int quoted=false*/ - - { - if tok != fflib.FFTok_integer && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for int", tok)) - } - } - - { - - if tok == fflib.FFTok_null { - - } else { - - tval, err := fflib.ParseInt(fs.Output.Bytes(), 10, 64) - - if err != nil { - return fs.WrapErr(err) - } - - uj.ID = int(tval) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_IDStr: - - /* handler: uj.IDStr type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.IDStr = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_IsTranslator: - - /* handler: uj.IsTranslator type=bool kind=bool quoted=false*/ - - { - if tok != fflib.FFTok_bool && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for bool", tok)) - } - } - - { - if tok == fflib.FFTok_null { - - } else { - tmpb := fs.Output.Bytes() - - if bytes.Compare([]byte{'t', 'r', 'u', 'e'}, tmpb) == 0 { - - uj.IsTranslator = true - - } else if bytes.Compare([]byte{'f', 'a', 'l', 's', 'e'}, tmpb) == 0 { - - uj.IsTranslator = false - - } else { - err = errors.New("unexpected bytes for true/false value") - return fs.WrapErr(err) - } - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Lang: - - /* handler: uj.Lang type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.Lang = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_ListedCount: - - /* handler: uj.ListedCount type=int kind=int quoted=false*/ - - { - if tok != fflib.FFTok_integer && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for int", tok)) - } - } - - { - - if tok == fflib.FFTok_null { - - } else { - - tval, err := fflib.ParseInt(fs.Output.Bytes(), 10, 64) - - if err != nil { - return fs.WrapErr(err) - } - - uj.ListedCount = int(tval) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Location: - - /* handler: uj.Location type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.Location = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Name: - - /* handler: uj.Name type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.Name = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Notifications: - - /* handler: uj.Notifications type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - uj.Notifications = nil - - } else { - - var tval string - outBuf := fs.Output.Bytes() - - tval = string(string(outBuf)) - uj.Notifications = &tval - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_ProfileBackgroundColor: - - /* handler: uj.ProfileBackgroundColor type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.ProfileBackgroundColor = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_ProfileBackgroundImageURL: - - /* handler: uj.ProfileBackgroundImageURL type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.ProfileBackgroundImageURL = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_ProfileBackgroundImageURLHTTPS: - - /* handler: uj.ProfileBackgroundImageURLHTTPS type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.ProfileBackgroundImageURLHTTPS = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_ProfileBackgroundTile: - - /* handler: uj.ProfileBackgroundTile type=bool kind=bool quoted=false*/ - - { - if tok != fflib.FFTok_bool && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for bool", tok)) - } - } - - { - if tok == fflib.FFTok_null { - - } else { - tmpb := fs.Output.Bytes() - - if bytes.Compare([]byte{'t', 'r', 'u', 'e'}, tmpb) == 0 { - - uj.ProfileBackgroundTile = true - - } else if bytes.Compare([]byte{'f', 'a', 'l', 's', 'e'}, tmpb) == 0 { - - uj.ProfileBackgroundTile = false - - } else { - err = errors.New("unexpected bytes for true/false value") - return fs.WrapErr(err) - } - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_ProfileImageURL: - - /* handler: uj.ProfileImageURL type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.ProfileImageURL = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_ProfileImageURLHTTPS: - - /* handler: uj.ProfileImageURLHTTPS type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.ProfileImageURLHTTPS = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_ProfileLinkColor: - - /* handler: uj.ProfileLinkColor type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.ProfileLinkColor = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_ProfileSidebarBorderColor: - - /* handler: uj.ProfileSidebarBorderColor type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.ProfileSidebarBorderColor = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_ProfileSidebarFillColor: - - /* handler: uj.ProfileSidebarFillColor type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.ProfileSidebarFillColor = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_ProfileTextColor: - - /* handler: uj.ProfileTextColor type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.ProfileTextColor = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_ProfileUseBackgroundImage: - - /* handler: uj.ProfileUseBackgroundImage type=bool kind=bool quoted=false*/ - - { - if tok != fflib.FFTok_bool && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for bool", tok)) - } - } - - { - if tok == fflib.FFTok_null { - - } else { - tmpb := fs.Output.Bytes() - - if bytes.Compare([]byte{'t', 'r', 'u', 'e'}, tmpb) == 0 { - - uj.ProfileUseBackgroundImage = true - - } else if bytes.Compare([]byte{'f', 'a', 'l', 's', 'e'}, tmpb) == 0 { - - uj.ProfileUseBackgroundImage = false - - } else { - err = errors.New("unexpected bytes for true/false value") - return fs.WrapErr(err) - } - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Protected: - - /* handler: uj.Protected type=bool kind=bool quoted=false*/ - - { - if tok != fflib.FFTok_bool && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for bool", tok)) - } - } - - { - if tok == fflib.FFTok_null { - - } else { - tmpb := fs.Output.Bytes() - - if bytes.Compare([]byte{'t', 'r', 'u', 'e'}, tmpb) == 0 { - - uj.Protected = true - - } else if bytes.Compare([]byte{'f', 'a', 'l', 's', 'e'}, tmpb) == 0 { - - uj.Protected = false - - } else { - err = errors.New("unexpected bytes for true/false value") - return fs.WrapErr(err) - } - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_ScreenName: - - /* handler: uj.ScreenName type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.ScreenName = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_ShowAllInlineMedia: - - /* handler: uj.ShowAllInlineMedia type=bool kind=bool quoted=false*/ - - { - if tok != fflib.FFTok_bool && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for bool", tok)) - } - } - - { - if tok == fflib.FFTok_null { - - } else { - tmpb := fs.Output.Bytes() - - if bytes.Compare([]byte{'t', 'r', 'u', 'e'}, tmpb) == 0 { - - uj.ShowAllInlineMedia = true - - } else if bytes.Compare([]byte{'f', 'a', 'l', 's', 'e'}, tmpb) == 0 { - - uj.ShowAllInlineMedia = false - - } else { - err = errors.New("unexpected bytes for true/false value") - return fs.WrapErr(err) - } - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_StatusesCount: - - /* handler: uj.StatusesCount type=int kind=int quoted=false*/ - - { - if tok != fflib.FFTok_integer && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for int", tok)) - } - } - - { - - if tok == fflib.FFTok_null { - - } else { - - tval, err := fflib.ParseInt(fs.Output.Bytes(), 10, 64) - - if err != nil { - return fs.WrapErr(err) - } - - uj.StatusesCount = int(tval) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_TimeZone: - - /* handler: uj.TimeZone type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - } else { - - outBuf := fs.Output.Bytes() - - uj.TimeZone = string(string(outBuf)) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_URL: - - /* handler: uj.URL type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - uj.URL = nil - - } else { - - var tval string - outBuf := fs.Output.Bytes() - - tval = string(string(outBuf)) - uj.URL = &tval - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_UtcOffset: - - /* handler: uj.UtcOffset type=int kind=int quoted=false*/ - - { - if tok != fflib.FFTok_integer && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for int", tok)) - } - } - - { - - if tok == fflib.FFTok_null { - - } else { - - tval, err := fflib.ParseInt(fs.Output.Bytes(), 10, 64) - - if err != nil { - return fs.WrapErr(err) - } - - uj.UtcOffset = int(tval) - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_Verified: - - /* handler: uj.Verified type=bool kind=bool quoted=false*/ - - { - if tok != fflib.FFTok_bool && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for bool", tok)) - } - } - - { - if tok == fflib.FFTok_null { - - } else { - tmpb := fs.Output.Bytes() - - if bytes.Compare([]byte{'t', 'r', 'u', 'e'}, tmpb) == 0 { - - uj.Verified = true - - } else if bytes.Compare([]byte{'f', 'a', 'l', 's', 'e'}, tmpb) == 0 { - - uj.Verified = false - - } else { - err = errors.New("unexpected bytes for true/false value") - return fs.WrapErr(err) - } - - } - } - - state = fflib.FFParse_after_value - goto mainparse - -wantedvalue: - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) -wrongtokenerror: - return fs.WrapErr(fmt.Errorf("ffjson: wanted token: %v, but got token: %v output=%s", wantedTok, tok, fs.Output.String())) -tokerror: - if fs.BigError != nil { - return fs.WrapErr(fs.BigError) - } - err = fs.Error.ToError() - if err != nil { - return fs.WrapErr(err) - } - panic("ffjson-generated: unreachable, please report bug.") -done: - return nil -} - -func (mj *UserEntities) MarshalJSON() ([]byte, error) { - var buf fflib.Buffer - if mj == nil { - buf.WriteString("null") - return buf.Bytes(), nil - } - err := mj.MarshalJSONBuf(&buf) - if err != nil { - return nil, err - } - return buf.Bytes(), nil -} -func (mj *UserEntities) MarshalJSONBuf(buf fflib.EncodingBuffer) error { - if mj == nil { - buf.WriteString("null") - return nil - } - var err error - var obj []byte - _ = obj - _ = err - buf.WriteString(`{"description":`) - - { - - err = mj.Description.MarshalJSONBuf(buf) - if err != nil { - return err - } - - } - buf.WriteString(`,"url":`) - - { - - err = mj.URL.MarshalJSONBuf(buf) - if err != nil { - return err - } - - } - buf.WriteByte('}') - return nil -} - -const ( - ffj_t_UserEntitiesbase = iota - ffj_t_UserEntitiesno_such_key - - ffj_t_UserEntities_Description - - ffj_t_UserEntities_URL -) - -var ffj_key_UserEntities_Description = []byte("description") - -var ffj_key_UserEntities_URL = []byte("url") - -func (uj *UserEntities) UnmarshalJSON(input []byte) error { - fs := fflib.NewFFLexer(input) - return uj.UnmarshalJSONFFLexer(fs, fflib.FFParse_map_start) -} - -func (uj *UserEntities) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error { - var err error = nil - currentKey := ffj_t_UserEntitiesbase - _ = currentKey - tok := fflib.FFTok_init - wantedTok := fflib.FFTok_init - -mainparse: - for { - tok = fs.Scan() - // println(fmt.Sprintf("debug: tok: %v state: %v", tok, state)) - if tok == fflib.FFTok_error { - goto tokerror - } - - switch state { - - case fflib.FFParse_map_start: - if tok != fflib.FFTok_left_bracket { - wantedTok = fflib.FFTok_left_bracket - goto wrongtokenerror - } - state = fflib.FFParse_want_key - continue - - case fflib.FFParse_after_value: - if tok == fflib.FFTok_comma { - state = fflib.FFParse_want_key - } else if tok == fflib.FFTok_right_bracket { - goto done - } else { - wantedTok = fflib.FFTok_comma - goto wrongtokenerror - } - - case fflib.FFParse_want_key: - // json {} ended. goto exit. woo. - if tok == fflib.FFTok_right_bracket { - goto done - } - if tok != fflib.FFTok_string { - wantedTok = fflib.FFTok_string - goto wrongtokenerror - } - - kn := fs.Output.Bytes() - if len(kn) <= 0 { - // "" case. hrm. - currentKey = ffj_t_UserEntitiesno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } else { - switch kn[0] { - - case 'd': - - if bytes.Equal(ffj_key_UserEntities_Description, kn) { - currentKey = ffj_t_UserEntities_Description - state = fflib.FFParse_want_colon - goto mainparse - } - - case 'u': - - if bytes.Equal(ffj_key_UserEntities_URL, kn) { - currentKey = ffj_t_UserEntities_URL - state = fflib.FFParse_want_colon - goto mainparse - } - - } - - if fflib.SimpleLetterEqualFold(ffj_key_UserEntities_URL, kn) { - currentKey = ffj_t_UserEntities_URL - state = fflib.FFParse_want_colon - goto mainparse - } - - if fflib.EqualFoldRight(ffj_key_UserEntities_Description, kn) { - currentKey = ffj_t_UserEntities_Description - state = fflib.FFParse_want_colon - goto mainparse - } - - currentKey = ffj_t_UserEntitiesno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } - - case fflib.FFParse_want_colon: - if tok != fflib.FFTok_colon { - wantedTok = fflib.FFTok_colon - goto wrongtokenerror - } - state = fflib.FFParse_want_value - continue - case fflib.FFParse_want_value: - - if tok == fflib.FFTok_left_brace || tok == fflib.FFTok_left_bracket || tok == fflib.FFTok_integer || tok == fflib.FFTok_double || tok == fflib.FFTok_string || tok == fflib.FFTok_bool || tok == fflib.FFTok_null { - switch currentKey { - - case ffj_t_UserEntities_Description: - goto handle_Description - - case ffj_t_UserEntities_URL: - goto handle_URL - - case ffj_t_UserEntitiesno_such_key: - err = fs.SkipField(tok) - if err != nil { - return fs.WrapErr(err) - } - state = fflib.FFParse_after_value - goto mainparse - } - } else { - goto wantedvalue - } - } - } - -handle_Description: - - /* handler: uj.Description type=benchmark.UserEntityDescription kind=struct quoted=false*/ - - { - if tok == fflib.FFTok_null { - - state = fflib.FFParse_after_value - goto mainparse - } - - err = uj.Description.UnmarshalJSONFFLexer(fs, fflib.FFParse_want_key) - if err != nil { - return err - } - state = fflib.FFParse_after_value - } - - state = fflib.FFParse_after_value - goto mainparse - -handle_URL: - - /* handler: uj.URL type=benchmark.UserEntityURL kind=struct quoted=false*/ - - { - if tok == fflib.FFTok_null { - - state = fflib.FFParse_after_value - goto mainparse - } - - err = uj.URL.UnmarshalJSONFFLexer(fs, fflib.FFParse_want_key) - if err != nil { - return err - } - state = fflib.FFParse_after_value - } - - state = fflib.FFParse_after_value - goto mainparse - -wantedvalue: - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) -wrongtokenerror: - return fs.WrapErr(fmt.Errorf("ffjson: wanted token: %v, but got token: %v output=%s", wantedTok, tok, fs.Output.String())) -tokerror: - if fs.BigError != nil { - return fs.WrapErr(fs.BigError) - } - err = fs.Error.ToError() - if err != nil { - return fs.WrapErr(err) - } - panic("ffjson-generated: unreachable, please report bug.") -done: - return nil -} - -func (mj *UserEntityDescription) MarshalJSON() ([]byte, error) { - var buf fflib.Buffer - if mj == nil { - buf.WriteString("null") - return buf.Bytes(), nil - } - err := mj.MarshalJSONBuf(&buf) - if err != nil { - return nil, err - } - return buf.Bytes(), nil -} -func (mj *UserEntityDescription) MarshalJSONBuf(buf fflib.EncodingBuffer) error { - if mj == nil { - buf.WriteString("null") - return nil - } - var err error - var obj []byte - _ = obj - _ = err - buf.WriteString(`{"urls":`) - if mj.Urls != nil { - buf.WriteString(`[`) - for i, v := range mj.Urls { - if i != 0 { - buf.WriteString(`,`) - } - if v != nil { - fflib.WriteJsonString(buf, string(*v)) - } else { - buf.WriteString(`null`) - } - } - buf.WriteString(`]`) - } else { - buf.WriteString(`null`) - } - buf.WriteByte('}') - return nil -} - -const ( - ffj_t_UserEntityDescriptionbase = iota - ffj_t_UserEntityDescriptionno_such_key - - ffj_t_UserEntityDescription_Urls -) - -var ffj_key_UserEntityDescription_Urls = []byte("urls") - -func (uj *UserEntityDescription) UnmarshalJSON(input []byte) error { - fs := fflib.NewFFLexer(input) - return uj.UnmarshalJSONFFLexer(fs, fflib.FFParse_map_start) -} - -func (uj *UserEntityDescription) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error { - var err error = nil - currentKey := ffj_t_UserEntityDescriptionbase - _ = currentKey - tok := fflib.FFTok_init - wantedTok := fflib.FFTok_init - -mainparse: - for { - tok = fs.Scan() - // println(fmt.Sprintf("debug: tok: %v state: %v", tok, state)) - if tok == fflib.FFTok_error { - goto tokerror - } - - switch state { - - case fflib.FFParse_map_start: - if tok != fflib.FFTok_left_bracket { - wantedTok = fflib.FFTok_left_bracket - goto wrongtokenerror - } - state = fflib.FFParse_want_key - continue - - case fflib.FFParse_after_value: - if tok == fflib.FFTok_comma { - state = fflib.FFParse_want_key - } else if tok == fflib.FFTok_right_bracket { - goto done - } else { - wantedTok = fflib.FFTok_comma - goto wrongtokenerror - } - - case fflib.FFParse_want_key: - // json {} ended. goto exit. woo. - if tok == fflib.FFTok_right_bracket { - goto done - } - if tok != fflib.FFTok_string { - wantedTok = fflib.FFTok_string - goto wrongtokenerror - } - - kn := fs.Output.Bytes() - if len(kn) <= 0 { - // "" case. hrm. - currentKey = ffj_t_UserEntityDescriptionno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } else { - switch kn[0] { - - case 'u': - - if bytes.Equal(ffj_key_UserEntityDescription_Urls, kn) { - currentKey = ffj_t_UserEntityDescription_Urls - state = fflib.FFParse_want_colon - goto mainparse - } - - } - - if fflib.EqualFoldRight(ffj_key_UserEntityDescription_Urls, kn) { - currentKey = ffj_t_UserEntityDescription_Urls - state = fflib.FFParse_want_colon - goto mainparse - } - - currentKey = ffj_t_UserEntityDescriptionno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } - - case fflib.FFParse_want_colon: - if tok != fflib.FFTok_colon { - wantedTok = fflib.FFTok_colon - goto wrongtokenerror - } - state = fflib.FFParse_want_value - continue - case fflib.FFParse_want_value: - - if tok == fflib.FFTok_left_brace || tok == fflib.FFTok_left_bracket || tok == fflib.FFTok_integer || tok == fflib.FFTok_double || tok == fflib.FFTok_string || tok == fflib.FFTok_bool || tok == fflib.FFTok_null { - switch currentKey { - - case ffj_t_UserEntityDescription_Urls: - goto handle_Urls - - case ffj_t_UserEntityDescriptionno_such_key: - err = fs.SkipField(tok) - if err != nil { - return fs.WrapErr(err) - } - state = fflib.FFParse_after_value - goto mainparse - } - } else { - goto wantedvalue - } - } - } - -handle_Urls: - - /* handler: uj.Urls type=[]*string kind=slice quoted=false*/ - - { - - { - if tok != fflib.FFTok_left_brace && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for ", tok)) - } - } - - if tok == fflib.FFTok_null { - uj.Urls = nil - } else { - - uj.Urls = make([]*string, 0) - - wantVal := true - - for { - - var tmp_uj__Urls *string - - tok = fs.Scan() - if tok == fflib.FFTok_error { - goto tokerror - } - if tok == fflib.FFTok_right_brace { - break - } - - if tok == fflib.FFTok_comma { - if wantVal == true { - // TODO(pquerna): this isn't an ideal error message, this handles - // things like [,,,] as an array value. - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) - } - continue - } else { - wantVal = true - } - - /* handler: tmp_uj__Urls type=*string kind=ptr quoted=false*/ - - { - - if tok == fflib.FFTok_null { - tmp_uj__Urls = nil - } else { - if tmp_uj__Urls == nil { - tmp_uj__Urls = new(string) - } - - /* handler: tmp_uj__Urls type=string kind=string quoted=false*/ - - { - - { - if tok != fflib.FFTok_string && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for string", tok)) - } - } - - if tok == fflib.FFTok_null { - - tmp_uj__Urls = nil - - } else { - - var tval string - outBuf := fs.Output.Bytes() - - tval = string(string(outBuf)) - tmp_uj__Urls = &tval - - } - } - - } - } - - uj.Urls = append(uj.Urls, tmp_uj__Urls) - wantVal = false - } - } - } - - state = fflib.FFParse_after_value - goto mainparse - -wantedvalue: - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) -wrongtokenerror: - return fs.WrapErr(fmt.Errorf("ffjson: wanted token: %v, but got token: %v output=%s", wantedTok, tok, fs.Output.String())) -tokerror: - if fs.BigError != nil { - return fs.WrapErr(fs.BigError) - } - err = fs.Error.ToError() - if err != nil { - return fs.WrapErr(err) - } - panic("ffjson-generated: unreachable, please report bug.") -done: - return nil -} - -func (mj *UserEntityURL) MarshalJSON() ([]byte, error) { - var buf fflib.Buffer - if mj == nil { - buf.WriteString("null") - return buf.Bytes(), nil - } - err := mj.MarshalJSONBuf(&buf) - if err != nil { - return nil, err - } - return buf.Bytes(), nil -} -func (mj *UserEntityURL) MarshalJSONBuf(buf fflib.EncodingBuffer) error { - if mj == nil { - buf.WriteString("null") - return nil - } - var err error - var obj []byte - _ = obj - _ = err - buf.WriteString(`{"urls":`) - if mj.Urls != nil { - buf.WriteString(`[`) - for i, v := range mj.Urls { - if i != 0 { - buf.WriteString(`,`) - } - - { - - err = v.MarshalJSONBuf(buf) - if err != nil { - return err - } - - } - } - buf.WriteString(`]`) - } else { - buf.WriteString(`null`) - } - buf.WriteByte('}') - return nil -} - -const ( - ffj_t_UserEntityURLbase = iota - ffj_t_UserEntityURLno_such_key - - ffj_t_UserEntityURL_Urls -) - -var ffj_key_UserEntityURL_Urls = []byte("urls") - -func (uj *UserEntityURL) UnmarshalJSON(input []byte) error { - fs := fflib.NewFFLexer(input) - return uj.UnmarshalJSONFFLexer(fs, fflib.FFParse_map_start) -} - -func (uj *UserEntityURL) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error { - var err error = nil - currentKey := ffj_t_UserEntityURLbase - _ = currentKey - tok := fflib.FFTok_init - wantedTok := fflib.FFTok_init - -mainparse: - for { - tok = fs.Scan() - // println(fmt.Sprintf("debug: tok: %v state: %v", tok, state)) - if tok == fflib.FFTok_error { - goto tokerror - } - - switch state { - - case fflib.FFParse_map_start: - if tok != fflib.FFTok_left_bracket { - wantedTok = fflib.FFTok_left_bracket - goto wrongtokenerror - } - state = fflib.FFParse_want_key - continue - - case fflib.FFParse_after_value: - if tok == fflib.FFTok_comma { - state = fflib.FFParse_want_key - } else if tok == fflib.FFTok_right_bracket { - goto done - } else { - wantedTok = fflib.FFTok_comma - goto wrongtokenerror - } - - case fflib.FFParse_want_key: - // json {} ended. goto exit. woo. - if tok == fflib.FFTok_right_bracket { - goto done - } - if tok != fflib.FFTok_string { - wantedTok = fflib.FFTok_string - goto wrongtokenerror - } - - kn := fs.Output.Bytes() - if len(kn) <= 0 { - // "" case. hrm. - currentKey = ffj_t_UserEntityURLno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } else { - switch kn[0] { - - case 'u': - - if bytes.Equal(ffj_key_UserEntityURL_Urls, kn) { - currentKey = ffj_t_UserEntityURL_Urls - state = fflib.FFParse_want_colon - goto mainparse - } - - } - - if fflib.EqualFoldRight(ffj_key_UserEntityURL_Urls, kn) { - currentKey = ffj_t_UserEntityURL_Urls - state = fflib.FFParse_want_colon - goto mainparse - } - - currentKey = ffj_t_UserEntityURLno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } - - case fflib.FFParse_want_colon: - if tok != fflib.FFTok_colon { - wantedTok = fflib.FFTok_colon - goto wrongtokenerror - } - state = fflib.FFParse_want_value - continue - case fflib.FFParse_want_value: - - if tok == fflib.FFTok_left_brace || tok == fflib.FFTok_left_bracket || tok == fflib.FFTok_integer || tok == fflib.FFTok_double || tok == fflib.FFTok_string || tok == fflib.FFTok_bool || tok == fflib.FFTok_null { - switch currentKey { - - case ffj_t_UserEntityURL_Urls: - goto handle_Urls - - case ffj_t_UserEntityURLno_such_key: - err = fs.SkipField(tok) - if err != nil { - return fs.WrapErr(err) - } - state = fflib.FFParse_after_value - goto mainparse - } - } else { - goto wantedvalue - } - } - } - -handle_Urls: - - /* handler: uj.Urls type=[]benchmark.URL kind=slice quoted=false*/ - - { - - { - if tok != fflib.FFTok_left_brace && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for ", tok)) - } - } - - if tok == fflib.FFTok_null { - uj.Urls = nil - } else { - - uj.Urls = make([]URL, 0) - - wantVal := true - - for { - - var tmp_uj__Urls URL - - tok = fs.Scan() - if tok == fflib.FFTok_error { - goto tokerror - } - if tok == fflib.FFTok_right_brace { - break - } - - if tok == fflib.FFTok_comma { - if wantVal == true { - // TODO(pquerna): this isn't an ideal error message, this handles - // things like [,,,] as an array value. - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) - } - continue - } else { - wantVal = true - } - - /* handler: tmp_uj__Urls type=benchmark.URL kind=struct quoted=false*/ - - { - if tok == fflib.FFTok_null { - - state = fflib.FFParse_after_value - goto mainparse - } - - err = tmp_uj__Urls.UnmarshalJSONFFLexer(fs, fflib.FFParse_want_key) - if err != nil { - return err - } - state = fflib.FFParse_after_value - } - - uj.Urls = append(uj.Urls, tmp_uj__Urls) - wantVal = false - } - } - } - - state = fflib.FFParse_after_value - goto mainparse - -wantedvalue: - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) -wrongtokenerror: - return fs.WrapErr(fmt.Errorf("ffjson: wanted token: %v, but got token: %v output=%s", wantedTok, tok, fs.Output.String())) -tokerror: - if fs.BigError != nil { - return fs.WrapErr(fs.BigError) - } - err = fs.Error.ToError() - if err != nil { - return fs.WrapErr(err) - } - panic("ffjson-generated: unreachable, please report bug.") -done: - return nil -} - -func (mj *XLStruct) MarshalJSON() ([]byte, error) { - var buf fflib.Buffer - if mj == nil { - buf.WriteString("null") - return buf.Bytes(), nil - } - err := mj.MarshalJSONBuf(&buf) - if err != nil { - return nil, err - } - return buf.Bytes(), nil -} -func (mj *XLStruct) MarshalJSONBuf(buf fflib.EncodingBuffer) error { - if mj == nil { - buf.WriteString("null") - return nil - } - var err error - var obj []byte - _ = obj - _ = err - buf.WriteString(`{"Data":`) - if mj.Data != nil { - buf.WriteString(`[`) - for i, v := range mj.Data { - if i != 0 { - buf.WriteString(`,`) - } - - { - - err = v.MarshalJSONBuf(buf) - if err != nil { - return err - } - - } - } - buf.WriteString(`]`) - } else { - buf.WriteString(`null`) - } - buf.WriteByte('}') - return nil -} - -const ( - ffj_t_XLStructbase = iota - ffj_t_XLStructno_such_key - - ffj_t_XLStruct_Data -) - -var ffj_key_XLStruct_Data = []byte("Data") - -func (uj *XLStruct) UnmarshalJSON(input []byte) error { - fs := fflib.NewFFLexer(input) - return uj.UnmarshalJSONFFLexer(fs, fflib.FFParse_map_start) -} - -func (uj *XLStruct) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error { - var err error = nil - currentKey := ffj_t_XLStructbase - _ = currentKey - tok := fflib.FFTok_init - wantedTok := fflib.FFTok_init - -mainparse: - for { - tok = fs.Scan() - // println(fmt.Sprintf("debug: tok: %v state: %v", tok, state)) - if tok == fflib.FFTok_error { - goto tokerror - } - - switch state { - - case fflib.FFParse_map_start: - if tok != fflib.FFTok_left_bracket { - wantedTok = fflib.FFTok_left_bracket - goto wrongtokenerror - } - state = fflib.FFParse_want_key - continue - - case fflib.FFParse_after_value: - if tok == fflib.FFTok_comma { - state = fflib.FFParse_want_key - } else if tok == fflib.FFTok_right_bracket { - goto done - } else { - wantedTok = fflib.FFTok_comma - goto wrongtokenerror - } - - case fflib.FFParse_want_key: - // json {} ended. goto exit. woo. - if tok == fflib.FFTok_right_bracket { - goto done - } - if tok != fflib.FFTok_string { - wantedTok = fflib.FFTok_string - goto wrongtokenerror - } - - kn := fs.Output.Bytes() - if len(kn) <= 0 { - // "" case. hrm. - currentKey = ffj_t_XLStructno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } else { - switch kn[0] { - - case 'D': - - if bytes.Equal(ffj_key_XLStruct_Data, kn) { - currentKey = ffj_t_XLStruct_Data - state = fflib.FFParse_want_colon - goto mainparse - } - - } - - if fflib.SimpleLetterEqualFold(ffj_key_XLStruct_Data, kn) { - currentKey = ffj_t_XLStruct_Data - state = fflib.FFParse_want_colon - goto mainparse - } - - currentKey = ffj_t_XLStructno_such_key - state = fflib.FFParse_want_colon - goto mainparse - } - - case fflib.FFParse_want_colon: - if tok != fflib.FFTok_colon { - wantedTok = fflib.FFTok_colon - goto wrongtokenerror - } - state = fflib.FFParse_want_value - continue - case fflib.FFParse_want_value: - - if tok == fflib.FFTok_left_brace || tok == fflib.FFTok_left_bracket || tok == fflib.FFTok_integer || tok == fflib.FFTok_double || tok == fflib.FFTok_string || tok == fflib.FFTok_bool || tok == fflib.FFTok_null { - switch currentKey { - - case ffj_t_XLStruct_Data: - goto handle_Data - - case ffj_t_XLStructno_such_key: - err = fs.SkipField(tok) - if err != nil { - return fs.WrapErr(err) - } - state = fflib.FFParse_after_value - goto mainparse - } - } else { - goto wantedvalue - } - } - } - -handle_Data: - - /* handler: uj.Data type=[]benchmark.LargeStruct kind=slice quoted=false*/ - - { - - { - if tok != fflib.FFTok_left_brace && tok != fflib.FFTok_null { - return fs.WrapErr(fmt.Errorf("cannot unmarshal %s into Go value for ", tok)) - } - } - - if tok == fflib.FFTok_null { - uj.Data = nil - } else { - - uj.Data = make([]LargeStruct, 0) - - wantVal := true - - for { - - var tmp_uj__Data LargeStruct - - tok = fs.Scan() - if tok == fflib.FFTok_error { - goto tokerror - } - if tok == fflib.FFTok_right_brace { - break - } - - if tok == fflib.FFTok_comma { - if wantVal == true { - // TODO(pquerna): this isn't an ideal error message, this handles - // things like [,,,] as an array value. - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) - } - continue - } else { - wantVal = true - } - - /* handler: tmp_uj__Data type=benchmark.LargeStruct kind=struct quoted=false*/ - - { - if tok == fflib.FFTok_null { - - state = fflib.FFParse_after_value - goto mainparse - } - - err = tmp_uj__Data.UnmarshalJSONFFLexer(fs, fflib.FFParse_want_key) - if err != nil { - return err - } - state = fflib.FFParse_after_value - } - - uj.Data = append(uj.Data, tmp_uj__Data) - wantVal = false - } - } - } - - state = fflib.FFParse_after_value - goto mainparse - -wantedvalue: - return fs.WrapErr(fmt.Errorf("wanted value token, but got token: %v", tok)) -wrongtokenerror: - return fs.WrapErr(fmt.Errorf("ffjson: wanted token: %v, but got token: %v output=%s", wantedTok, tok, fs.Output.String())) -tokerror: - if fs.BigError != nil { - return fs.WrapErr(fs.BigError) - } - err = fs.Error.ToError() - if err != nil { - return fs.WrapErr(err) - } - panic("ffjson-generated: unreachable, please report bug.") -done: - return nil -} diff --git a/vendor/github.com/mailru/easyjson/benchmark/data_var.go b/vendor/github.com/mailru/easyjson/benchmark/data_var.go deleted file mode 100644 index ea4202db..00000000 --- a/vendor/github.com/mailru/easyjson/benchmark/data_var.go +++ /dev/null @@ -1,350 +0,0 @@ -package benchmark - -var largeStructData = LargeStruct{ - SearchMetadata: SearchMetadata{ - CompletedIn: 0.035, - Count: 4, - MaxID: 250126199840518145, - MaxIDStr: "250126199840518145", - NextResults: "?max_id=249279667666817023&q=%23freebandnames&count=4&include_entities=1&result_type=mixed", - Query: "%23freebandnames", - RefreshURL: "?since_id=250126199840518145&q=%23freebandnames&result_type=mixed&include_entities=1", - SinceID: 24012619984051000, - SinceIDStr: "24012619984051000", - }, - Statuses: []Status{ - { - Contributors: nil, - Coordinates: nil, - CreatedAt: "Mon Sep 24 03:35:21 +0000 2012", - Entities: Entities{ - Hashtags: []Hashtag{{ - Indices: []int{20, 34}, - Text: "freebandnames"}, - }, - Urls: []*string{}, - UserMentions: []*string{}, - }, - Favorited: false, - Geo: nil, - ID: 250075927172759552, - IDStr: "250075927172759552", - InReplyToScreenName: nil, - InReplyToStatusID: nil, - InReplyToStatusIDStr: nil, - InReplyToUserID: nil, - InReplyToUserIDStr: nil, - Metadata: StatusMetadata{ - IsoLanguageCode: "en", - ResultType: "recent", - }, - Place: nil, - RetweetCount: 0, - Retweeted: false, - Source: "Twitter for Mac", - Text: "Aggressive Ponytail #freebandnames", - Truncated: false, - User: User{ - ContributorsEnabled: false, - CreatedAt: "Mon Apr 26 06:01:55 +0000 2010", - DefaultProfile: true, - DefaultProfileImage: false, - Description: "Born 330 Live 310", - Entities: UserEntities{ - Description: UserEntityDescription{ - Urls: []*string{}, - }, - URL: UserEntityURL{ - Urls: []URL{{ - ExpandedURL: nil, - Indices: []int{0, 0}, - URL: "", - }}, - }, - }, - FavouritesCount: 0, - FollowRequestSent: nil, - FollowersCount: 70, - Following: nil, - FriendsCount: 110, - GeoEnabled: true, - ID: 137238150, - IDStr: "137238150", - IsTranslator: false, - Lang: "en", - ListedCount: 2, - Location: "LA, CA", - Name: "Sean Cummings", - Notifications: nil, - ProfileBackgroundColor: "C0DEED", - ProfileBackgroundImageURL: "http://a0.twimg.com/images/themes/theme1/bg.png", - ProfileBackgroundImageURLHTTPS: "https://si0.twimg.com/images/themes/theme1/bg.png", - ProfileBackgroundTile: false, - ProfileImageURL: "http://a0.twimg.com/profile_images/2359746665/1v6zfgqo8g0d3mk7ii5s_normal.jpeg", - ProfileImageURLHTTPS: "https://si0.twimg.com/profile_images/2359746665/1v6zfgqo8g0d3mk7ii5s_normal.jpeg", - ProfileLinkColor: "0084B4", - ProfileSidebarBorderColor: "C0DEED", - ProfileSidebarFillColor: "DDEEF6", - ProfileTextColor: "333333", - ProfileUseBackgroundImage: true, - Protected: false, - ScreenName: "sean_cummings", - ShowAllInlineMedia: false, - StatusesCount: 579, - TimeZone: "Pacific Time (US & Canada)", - URL: nil, - UtcOffset: -28800, - Verified: false, - }, - }, - { - Contributors: nil, - Coordinates: nil, - CreatedAt: "Fri Sep 21 23:40:54 +0000 2012", - Entities: Entities{ - Hashtags: []Hashtag{{ - Indices: []int{20, 34}, - Text: "FreeBandNames", - }}, - Urls: []*string{}, - UserMentions: []*string{}, - }, - Favorited: false, - Geo: nil, - ID: 249292149810667520, - IDStr: "249292149810667520", - InReplyToScreenName: nil, - InReplyToStatusID: nil, - InReplyToStatusIDStr: nil, - InReplyToUserID: nil, - InReplyToUserIDStr: nil, - Metadata: StatusMetadata{ - IsoLanguageCode: "pl", - ResultType: "recent", - }, - Place: nil, - RetweetCount: 0, - Retweeted: false, - Source: "web", - Text: "Thee Namaste Nerdz. #FreeBandNames", - Truncated: false, - User: User{ - ContributorsEnabled: false, - CreatedAt: "Tue Apr 07 19:05:07 +0000 2009", - DefaultProfile: false, - DefaultProfileImage: false, - Description: "You will come to Durham, North Carolina. I will sell you some records then, here in Durham, North Carolina. Fun will happen.", - Entities: UserEntities{ - Description: UserEntityDescription{Urls: []*string{}}, - URL: UserEntityURL{ - Urls: []URL{{ - ExpandedURL: nil, - Indices: []int{0, 32}, - URL: "http://bullcityrecords.com/wnng/"}}, - }, - }, - FavouritesCount: 8, - FollowRequestSent: nil, - FollowersCount: 2052, - Following: nil, - FriendsCount: 348, - GeoEnabled: false, - ID: 29516238, - IDStr: "29516238", - IsTranslator: false, - Lang: "en", - ListedCount: 118, - Location: "Durham, NC", - Name: "Chaz Martenstein", - Notifications: nil, - ProfileBackgroundColor: "9AE4E8", - ProfileBackgroundImageURL: "http://a0.twimg.com/profile_background_images/9423277/background_tile.bmp", - ProfileBackgroundImageURLHTTPS: "https://si0.twimg.com/profile_background_images/9423277/background_tile.bmp", - ProfileBackgroundTile: true, - ProfileImageURL: "http://a0.twimg.com/profile_images/447958234/Lichtenstein_normal.jpg", - ProfileImageURLHTTPS: "https://si0.twimg.com/profile_images/447958234/Lichtenstein_normal.jpg", - ProfileLinkColor: "0084B4", - ProfileSidebarBorderColor: "BDDCAD", - ProfileSidebarFillColor: "DDFFCC", - ProfileTextColor: "333333", - ProfileUseBackgroundImage: true, - Protected: false, - ScreenName: "bullcityrecords", - ShowAllInlineMedia: true, - StatusesCount: 7579, - TimeZone: "Eastern Time (US & Canada)", - URL: nil, - UtcOffset: -18000, - Verified: false, - }, - }, - Status{ - Contributors: nil, - Coordinates: nil, - CreatedAt: "Fri Sep 21 23:30:20 +0000 2012", - Entities: Entities{ - Hashtags: []Hashtag{{ - Indices: []int{29, 43}, - Text: "freebandnames", - }}, - Urls: []*string{}, - UserMentions: []*string{}, - }, - Favorited: false, - Geo: nil, - ID: 249289491129438208, - IDStr: "249289491129438208", - InReplyToScreenName: nil, - InReplyToStatusID: nil, - InReplyToStatusIDStr: nil, - InReplyToUserID: nil, - InReplyToUserIDStr: nil, - Metadata: StatusMetadata{ - IsoLanguageCode: "en", - ResultType: "recent", - }, - Place: nil, - RetweetCount: 0, - Retweeted: false, - Source: "web", - Text: "Mexican Heaven, Mexican Hell #freebandnames", - Truncated: false, - User: User{ - ContributorsEnabled: false, - CreatedAt: "Tue Sep 01 21:21:35 +0000 2009", - DefaultProfile: false, - DefaultProfileImage: false, - Description: "Science Fiction Writer, sort of. Likes Superheroes, Mole People, Alt. Timelines.", - Entities: UserEntities{ - Description: UserEntityDescription{ - Urls: nil, - }, - URL: UserEntityURL{ - Urls: []URL{{ - ExpandedURL: nil, - Indices: []int{0, 0}, - URL: "", - }}, - }, - }, - FavouritesCount: 19, - FollowRequestSent: nil, - FollowersCount: 63, - Following: nil, - FriendsCount: 63, - GeoEnabled: false, - ID: 70789458, - IDStr: "70789458", - IsTranslator: false, - Lang: "en", - ListedCount: 1, - Location: "Kingston New York", - Name: "Thomas John Wakeman", - Notifications: nil, - ProfileBackgroundColor: "352726", - ProfileBackgroundImageURL: "http://a0.twimg.com/images/themes/theme5/bg.gif", - ProfileBackgroundImageURLHTTPS: "https://si0.twimg.com/images/themes/theme5/bg.gif", - ProfileBackgroundTile: false, - ProfileImageURL: "http://a0.twimg.com/profile_images/2219333930/Froggystyle_normal.png", - ProfileImageURLHTTPS: "https://si0.twimg.com/profile_images/2219333930/Froggystyle_normal.png", - ProfileLinkColor: "D02B55", - ProfileSidebarBorderColor: "829D5E", - ProfileSidebarFillColor: "99CC33", - ProfileTextColor: "3E4415", - ProfileUseBackgroundImage: true, - Protected: false, - ScreenName: "MonkiesFist", - ShowAllInlineMedia: false, - StatusesCount: 1048, - TimeZone: "Eastern Time (US & Canada)", - URL: nil, - UtcOffset: -18000, - Verified: false, - }, - }, - Status{ - Contributors: nil, - Coordinates: nil, - CreatedAt: "Fri Sep 21 22:51:18 +0000 2012", - Entities: Entities{ - Hashtags: []Hashtag{{ - Indices: []int{20, 34}, - Text: "freebandnames", - }}, - Urls: []*string{}, - UserMentions: []*string{}, - }, - Favorited: false, - Geo: nil, - ID: 249279667666817024, - IDStr: "249279667666817024", - InReplyToScreenName: nil, - InReplyToStatusID: nil, - InReplyToStatusIDStr: nil, - InReplyToUserID: nil, - InReplyToUserIDStr: nil, - Metadata: StatusMetadata{ - IsoLanguageCode: "en", - ResultType: "recent", - }, - Place: nil, - RetweetCount: 0, - Retweeted: false, - Source: "Twitter for iPhone", - Text: "The Foolish Mortals #freebandnames", - Truncated: false, - User: User{ - ContributorsEnabled: false, - CreatedAt: "Mon May 04 00:05:00 +0000 2009", - DefaultProfile: false, - DefaultProfileImage: false, - Description: "Cartoonist, Illustrator, and T-Shirt connoisseur", - Entities: UserEntities{ - Description: UserEntityDescription{ - Urls: []*string{}, - }, - URL: UserEntityURL{ - Urls: []URL{{ - ExpandedURL: nil, - Indices: []int{0, 24}, - URL: "http://www.omnitarian.me", - }}, - }, - }, - FavouritesCount: 647, - FollowRequestSent: nil, - FollowersCount: 608, - Following: nil, - FriendsCount: 249, - GeoEnabled: false, - ID: 37539828, - IDStr: "37539828", - IsTranslator: false, - Lang: "en", - ListedCount: 52, - Location: "Wisconsin, USA", - Name: "Marty Elmer", - Notifications: nil, - ProfileBackgroundColor: "EEE3C4", - ProfileBackgroundImageURL: "http://a0.twimg.com/profile_background_images/106455659/rect6056-9.png", - ProfileBackgroundImageURLHTTPS: "https://si0.twimg.com/profile_background_images/106455659/rect6056-9.png", - ProfileBackgroundTile: true, - ProfileImageURL: "http://a0.twimg.com/profile_images/1629790393/shrinker_2000_trans_normal.png", - ProfileImageURLHTTPS: "https://si0.twimg.com/profile_images/1629790393/shrinker_2000_trans_normal.png", - ProfileLinkColor: "3B2A26", - ProfileSidebarBorderColor: "615A44", - ProfileSidebarFillColor: "BFAC83", - ProfileTextColor: "000000", - ProfileUseBackgroundImage: true, - Protected: false, - ScreenName: "Omnitarian", - ShowAllInlineMedia: true, - StatusesCount: 3575, - TimeZone: "Central Time (US & Canada)", - URL: nil, - UtcOffset: -21600, - Verified: false, - }, - }, - }, -} diff --git a/vendor/github.com/mailru/easyjson/benchmark/default_test.go b/vendor/github.com/mailru/easyjson/benchmark/default_test.go deleted file mode 100644 index 68b37910..00000000 --- a/vendor/github.com/mailru/easyjson/benchmark/default_test.go +++ /dev/null @@ -1,118 +0,0 @@ -// +build !use_easyjson,!use_ffjson,!use_codec,!use_jsoniter - -package benchmark - -import ( - "encoding/json" - "testing" -) - -func BenchmarkStd_Unmarshal_M(b *testing.B) { - b.SetBytes(int64(len(largeStructText))) - for i := 0; i < b.N; i++ { - var s LargeStruct - err := json.Unmarshal(largeStructText, &s) - if err != nil { - b.Error(err) - } - } -} - -func BenchmarkStd_Unmarshal_S(b *testing.B) { - for i := 0; i < b.N; i++ { - var s Entities - err := json.Unmarshal(smallStructText, &s) - if err != nil { - b.Error(err) - } - } - b.SetBytes(int64(len(smallStructText))) -} - -func BenchmarkStd_Marshal_M(b *testing.B) { - var l int64 - for i := 0; i < b.N; i++ { - data, err := json.Marshal(&largeStructData) - if err != nil { - b.Error(err) - } - l = int64(len(data)) - } - b.SetBytes(l) -} - -func BenchmarkStd_Marshal_L(b *testing.B) { - var l int64 - for i := 0; i < b.N; i++ { - data, err := json.Marshal(&xlStructData) - if err != nil { - b.Error(err) - } - l = int64(len(data)) - } - b.SetBytes(l) -} - -func BenchmarkStd_Marshal_M_Parallel(b *testing.B) { - var l int64 - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - data, err := json.Marshal(&largeStructData) - if err != nil { - b.Error(err) - } - l = int64(len(data)) - } - }) - b.SetBytes(l) -} - -func BenchmarkStd_Marshal_L_Parallel(b *testing.B) { - var l int64 - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - data, err := json.Marshal(&xlStructData) - if err != nil { - b.Error(err) - } - l = int64(len(data)) - } - }) - b.SetBytes(l) -} - -func BenchmarkStd_Marshal_S(b *testing.B) { - var l int64 - for i := 0; i < b.N; i++ { - data, err := json.Marshal(&smallStructData) - if err != nil { - b.Error(err) - } - l = int64(len(data)) - } - b.SetBytes(l) -} - -func BenchmarkStd_Marshal_S_Parallel(b *testing.B) { - var l int64 - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - data, err := json.Marshal(&smallStructData) - if err != nil { - b.Error(err) - } - l = int64(len(data)) - } - }) - b.SetBytes(l) -} - -func BenchmarkStd_Marshal_M_ToWriter(b *testing.B) { - enc := json.NewEncoder(&DummyWriter{}) - for i := 0; i < b.N; i++ { - err := enc.Encode(&largeStructData) - if err != nil { - b.Error(err) - } - } -} diff --git a/vendor/github.com/mailru/easyjson/benchmark/dummy_test.go b/vendor/github.com/mailru/easyjson/benchmark/dummy_test.go deleted file mode 100644 index 3d928ca7..00000000 --- a/vendor/github.com/mailru/easyjson/benchmark/dummy_test.go +++ /dev/null @@ -1,11 +0,0 @@ -package benchmark - -import ( - "testing" -) - -type DummyWriter struct{} - -func (w DummyWriter) Write(data []byte) (int, error) { return len(data), nil } - -func TestToSuppressNoTestsWarning(t *testing.T) {} diff --git a/vendor/github.com/mailru/easyjson/benchmark/easyjson_test.go b/vendor/github.com/mailru/easyjson/benchmark/easyjson_test.go deleted file mode 100644 index 16b670b2..00000000 --- a/vendor/github.com/mailru/easyjson/benchmark/easyjson_test.go +++ /dev/null @@ -1,184 +0,0 @@ -// +build use_easyjson - -package benchmark - -import ( - "testing" - - "github.com/mailru/easyjson" - "github.com/mailru/easyjson/jwriter" -) - -func BenchmarkEJ_Unmarshal_M(b *testing.B) { - b.SetBytes(int64(len(largeStructText))) - for i := 0; i < b.N; i++ { - var s LargeStruct - err := s.UnmarshalJSON(largeStructText) - if err != nil { - b.Error(err) - } - } -} - -func BenchmarkEJ_Unmarshal_S(b *testing.B) { - b.SetBytes(int64(len(smallStructText))) - - for i := 0; i < b.N; i++ { - var s Entities - err := s.UnmarshalJSON(smallStructText) - if err != nil { - b.Error(err) - } - } -} - -func BenchmarkEJ_Marshal_M(b *testing.B) { - var l int64 - for i := 0; i < b.N; i++ { - data, err := easyjson.Marshal(&largeStructData) - if err != nil { - b.Error(err) - } - l = int64(len(data)) - } - b.SetBytes(l) -} - -func BenchmarkEJ_Marshal_L(b *testing.B) { - var l int64 - for i := 0; i < b.N; i++ { - data, err := easyjson.Marshal(&xlStructData) - if err != nil { - b.Error(err) - } - l = int64(len(data)) - } - b.SetBytes(l) -} - -func BenchmarkEJ_Marshal_L_ToWriter(b *testing.B) { - var l int64 - out := &DummyWriter{} - for i := 0; i < b.N; i++ { - w := jwriter.Writer{} - xlStructData.MarshalEasyJSON(&w) - if w.Error != nil { - b.Error(w.Error) - } - - l = int64(w.Size()) - w.DumpTo(out) - } - b.SetBytes(l) - -} -func BenchmarkEJ_Marshal_M_Parallel(b *testing.B) { - b.SetBytes(int64(len(largeStructText))) - - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - _, err := largeStructData.MarshalJSON() - if err != nil { - b.Error(err) - } - } - }) -} - -func BenchmarkEJ_Marshal_M_ToWriter(b *testing.B) { - var l int64 - out := &DummyWriter{} - for i := 0; i < b.N; i++ { - w := jwriter.Writer{} - largeStructData.MarshalEasyJSON(&w) - if w.Error != nil { - b.Error(w.Error) - } - - l = int64(w.Size()) - w.DumpTo(out) - } - b.SetBytes(l) - -} -func BenchmarkEJ_Marshal_M_ToWriter_Parallel(b *testing.B) { - out := &DummyWriter{} - - b.RunParallel(func(pb *testing.PB) { - var l int64 - for pb.Next() { - w := jwriter.Writer{} - largeStructData.MarshalEasyJSON(&w) - if w.Error != nil { - b.Error(w.Error) - } - - l = int64(w.Size()) - w.DumpTo(out) - } - if l > 0 { - b.SetBytes(l) - } - }) - -} - -func BenchmarkEJ_Marshal_L_Parallel(b *testing.B) { - var l int64 - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - data, err := xlStructData.MarshalJSON() - if err != nil { - b.Error(err) - } - l = int64(len(data)) - } - }) - b.SetBytes(l) -} - -func BenchmarkEJ_Marshal_L_ToWriter_Parallel(b *testing.B) { - out := &DummyWriter{} - b.RunParallel(func(pb *testing.PB) { - var l int64 - for pb.Next() { - w := jwriter.Writer{} - - xlStructData.MarshalEasyJSON(&w) - if w.Error != nil { - b.Error(w.Error) - } - l = int64(w.Size()) - w.DumpTo(out) - } - if l > 0 { - b.SetBytes(l) - } - }) -} - -func BenchmarkEJ_Marshal_S(b *testing.B) { - var l int64 - for i := 0; i < b.N; i++ { - data, err := smallStructData.MarshalJSON() - if err != nil { - b.Error(err) - } - l = int64(len(data)) - } - b.SetBytes(l) -} - -func BenchmarkEJ_Marshal_S_Parallel(b *testing.B) { - var l int64 - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - data, err := smallStructData.MarshalJSON() - if err != nil { - b.Error(err) - } - l = int64(len(data)) - } - }) - b.SetBytes(l) -} diff --git a/vendor/github.com/mailru/easyjson/benchmark/example.json b/vendor/github.com/mailru/easyjson/benchmark/example.json deleted file mode 100644 index 2405022c..00000000 --- a/vendor/github.com/mailru/easyjson/benchmark/example.json +++ /dev/null @@ -1,415 +0,0 @@ -{ - "statuses": [ - { - "coordinates": null, - "favorited": false, - "truncated": false, - "created_at": "Mon Sep 24 03:35:21 +0000 2012", - "id_str": "250075927172759552", - "entities": { - "urls": [ - - ], - "hashtags": [ - { - "text": "freebandnames", - "indices": [ - 20, - 34 - ] - } - ], - "user_mentions": [ - - ] - }, - "in_reply_to_user_id_str": null, - "contributors": null, - "text": "Aggressive Ponytail #freebandnames", - "metadata": { - "iso_language_code": "en", - "result_type": "recent" - }, - "retweet_count": 0, - "in_reply_to_status_id_str": null, - "id": 250075927172759552, - "geo": null, - "retweeted": false, - "in_reply_to_user_id": null, - "place": null, - "user": { - "profile_sidebar_fill_color": "DDEEF6", - "profile_sidebar_border_color": "C0DEED", - "profile_background_tile": false, - "name": "Sean Cummings", - "profile_image_url": "http://a0.twimg.com/profile_images/2359746665/1v6zfgqo8g0d3mk7ii5s_normal.jpeg", - "created_at": "Mon Apr 26 06:01:55 +0000 2010", - "location": "LA, CA", - "follow_request_sent": null, - "profile_link_color": "0084B4", - "is_translator": false, - "id_str": "137238150", - "entities": { - "url": { - "urls": [ - { - "expanded_url": null, - "url": "", - "indices": [ - 0, - 0 - ] - } - ] - }, - "description": { - "urls": [ - - ] - } - }, - "default_profile": true, - "contributors_enabled": false, - "favourites_count": 0, - "url": null, - "profile_image_url_https": "https://si0.twimg.com/profile_images/2359746665/1v6zfgqo8g0d3mk7ii5s_normal.jpeg", - "utc_offset": -28800, - "id": 137238150, - "profile_use_background_image": true, - "listed_count": 2, - "profile_text_color": "333333", - "lang": "en", - "followers_count": 70, - "protected": false, - "notifications": null, - "profile_background_image_url_https": "https://si0.twimg.com/images/themes/theme1/bg.png", - "profile_background_color": "C0DEED", - "verified": false, - "geo_enabled": true, - "time_zone": "Pacific Time (US & Canada)", - "description": "Born 330 Live 310", - "default_profile_image": false, - "profile_background_image_url": "http://a0.twimg.com/images/themes/theme1/bg.png", - "statuses_count": 579, - "friends_count": 110, - "following": null, - "show_all_inline_media": false, - "screen_name": "sean_cummings" - }, - "in_reply_to_screen_name": null, - "source": "Twitter for Mac", - "in_reply_to_status_id": null - }, - { - "coordinates": null, - "favorited": false, - "truncated": false, - "created_at": "Fri Sep 21 23:40:54 +0000 2012", - "id_str": "249292149810667520", - "entities": { - "urls": [ - - ], - "hashtags": [ - { - "text": "FreeBandNames", - "indices": [ - 20, - 34 - ] - } - ], - "user_mentions": [ - - ] - }, - "in_reply_to_user_id_str": null, - "contributors": null, - "text": "Thee Namaste Nerdz. #FreeBandNames", - "metadata": { - "iso_language_code": "pl", - "result_type": "recent" - }, - "retweet_count": 0, - "in_reply_to_status_id_str": null, - "id": 249292149810667520, - "geo": null, - "retweeted": false, - "in_reply_to_user_id": null, - "place": null, - "user": { - "profile_sidebar_fill_color": "DDFFCC", - "profile_sidebar_border_color": "BDDCAD", - "profile_background_tile": true, - "name": "Chaz Martenstein", - "profile_image_url": "http://a0.twimg.com/profile_images/447958234/Lichtenstein_normal.jpg", - "created_at": "Tue Apr 07 19:05:07 +0000 2009", - "location": "Durham, NC", - "follow_request_sent": null, - "profile_link_color": "0084B4", - "is_translator": false, - "id_str": "29516238", - "entities": { - "url": { - "urls": [ - { - "expanded_url": null, - "url": "http://bullcityrecords.com/wnng/", - "indices": [ - 0, - 32 - ] - } - ] - }, - "description": { - "urls": [ - - ] - } - }, - "default_profile": false, - "contributors_enabled": false, - "favourites_count": 8, - "url": "http://bullcityrecords.com/wnng/", - "profile_image_url_https": "https://si0.twimg.com/profile_images/447958234/Lichtenstein_normal.jpg", - "utc_offset": -18000, - "id": 29516238, - "profile_use_background_image": true, - "listed_count": 118, - "profile_text_color": "333333", - "lang": "en", - "followers_count": 2052, - "protected": false, - "notifications": null, - "profile_background_image_url_https": "https://si0.twimg.com/profile_background_images/9423277/background_tile.bmp", - "profile_background_color": "9AE4E8", - "verified": false, - "geo_enabled": false, - "time_zone": "Eastern Time (US & Canada)", - "description": "You will come to Durham, North Carolina. I will sell you some records then, here in Durham, North Carolina. Fun will happen.", - "default_profile_image": false, - "profile_background_image_url": "http://a0.twimg.com/profile_background_images/9423277/background_tile.bmp", - "statuses_count": 7579, - "friends_count": 348, - "following": null, - "show_all_inline_media": true, - "screen_name": "bullcityrecords" - }, - "in_reply_to_screen_name": null, - "source": "web", - "in_reply_to_status_id": null - }, - { - "coordinates": null, - "favorited": false, - "truncated": false, - "created_at": "Fri Sep 21 23:30:20 +0000 2012", - "id_str": "249289491129438208", - "entities": { - "urls": [ - - ], - "hashtags": [ - { - "text": "freebandnames", - "indices": [ - 29, - 43 - ] - } - ], - "user_mentions": [ - - ] - }, - "in_reply_to_user_id_str": null, - "contributors": null, - "text": "Mexican Heaven, Mexican Hell #freebandnames", - "metadata": { - "iso_language_code": "en", - "result_type": "recent" - }, - "retweet_count": 0, - "in_reply_to_status_id_str": null, - "id": 249289491129438208, - "geo": null, - "retweeted": false, - "in_reply_to_user_id": null, - "place": null, - "user": { - "profile_sidebar_fill_color": "99CC33", - "profile_sidebar_border_color": "829D5E", - "profile_background_tile": false, - "name": "Thomas John Wakeman", - "profile_image_url": "http://a0.twimg.com/profile_images/2219333930/Froggystyle_normal.png", - "created_at": "Tue Sep 01 21:21:35 +0000 2009", - "location": "Kingston New York", - "follow_request_sent": null, - "profile_link_color": "D02B55", - "is_translator": false, - "id_str": "70789458", - "entities": { - "url": { - "urls": [ - { - "expanded_url": null, - "url": "", - "indices": [ - 0, - 0 - ] - } - ] - }, - "description": { - "urls": [ - - ] - } - }, - "default_profile": false, - "contributors_enabled": false, - "favourites_count": 19, - "url": null, - "profile_image_url_https": "https://si0.twimg.com/profile_images/2219333930/Froggystyle_normal.png", - "utc_offset": -18000, - "id": 70789458, - "profile_use_background_image": true, - "listed_count": 1, - "profile_text_color": "3E4415", - "lang": "en", - "followers_count": 63, - "protected": false, - "notifications": null, - "profile_background_image_url_https": "https://si0.twimg.com/images/themes/theme5/bg.gif", - "profile_background_color": "352726", - "verified": false, - "geo_enabled": false, - "time_zone": "Eastern Time (US & Canada)", - "description": "Science Fiction Writer, sort of. Likes Superheroes, Mole People, Alt. Timelines.", - "default_profile_image": false, - "profile_background_image_url": "http://a0.twimg.com/images/themes/theme5/bg.gif", - "statuses_count": 1048, - "friends_count": 63, - "following": null, - "show_all_inline_media": false, - "screen_name": "MonkiesFist" - }, - "in_reply_to_screen_name": null, - "source": "web", - "in_reply_to_status_id": null - }, - { - "coordinates": null, - "favorited": false, - "truncated": false, - "created_at": "Fri Sep 21 22:51:18 +0000 2012", - "id_str": "249279667666817024", - "entities": { - "urls": [ - - ], - "hashtags": [ - { - "text": "freebandnames", - "indices": [ - 20, - 34 - ] - } - ], - "user_mentions": [ - - ] - }, - "in_reply_to_user_id_str": null, - "contributors": null, - "text": "The Foolish Mortals #freebandnames", - "metadata": { - "iso_language_code": "en", - "result_type": "recent" - }, - "retweet_count": 0, - "in_reply_to_status_id_str": null, - "id": 249279667666817024, - "geo": null, - "retweeted": false, - "in_reply_to_user_id": null, - "place": null, - "user": { - "profile_sidebar_fill_color": "BFAC83", - "profile_sidebar_border_color": "615A44", - "profile_background_tile": true, - "name": "Marty Elmer", - "profile_image_url": "http://a0.twimg.com/profile_images/1629790393/shrinker_2000_trans_normal.png", - "created_at": "Mon May 04 00:05:00 +0000 2009", - "location": "Wisconsin, USA", - "follow_request_sent": null, - "profile_link_color": "3B2A26", - "is_translator": false, - "id_str": "37539828", - "entities": { - "url": { - "urls": [ - { - "expanded_url": null, - "url": "http://www.omnitarian.me", - "indices": [ - 0, - 24 - ] - } - ] - }, - "description": { - "urls": [ - - ] - } - }, - "default_profile": false, - "contributors_enabled": false, - "favourites_count": 647, - "url": "http://www.omnitarian.me", - "profile_image_url_https": "https://si0.twimg.com/profile_images/1629790393/shrinker_2000_trans_normal.png", - "utc_offset": -21600, - "id": 37539828, - "profile_use_background_image": true, - "listed_count": 52, - "profile_text_color": "000000", - "lang": "en", - "followers_count": 608, - "protected": false, - "notifications": null, - "profile_background_image_url_https": "https://si0.twimg.com/profile_background_images/106455659/rect6056-9.png", - "profile_background_color": "EEE3C4", - "verified": false, - "geo_enabled": false, - "time_zone": "Central Time (US & Canada)", - "description": "Cartoonist, Illustrator, and T-Shirt connoisseur", - "default_profile_image": false, - "profile_background_image_url": "http://a0.twimg.com/profile_background_images/106455659/rect6056-9.png", - "statuses_count": 3575, - "friends_count": 249, - "following": null, - "show_all_inline_media": true, - "screen_name": "Omnitarian" - }, - "in_reply_to_screen_name": null, - "source": "Twitter for iPhone", - "in_reply_to_status_id": null - } - ], - "search_metadata": { - "max_id": 250126199840518145, - "since_id": 24012619984051000, - "refresh_url": "?since_id=250126199840518145&q=%23freebandnames&result_type=mixed&include_entities=1", - "next_results": "?max_id=249279667666817023&q=%23freebandnames&count=4&include_entities=1&result_type=mixed", - "count": 4, - "completed_in": 0.035, - "since_id_str": "24012619984051000", - "query": "%23freebandnames", - "max_id_str": "250126199840518145" - } -} diff --git a/vendor/github.com/mailru/easyjson/benchmark/ffjson_test.go b/vendor/github.com/mailru/easyjson/benchmark/ffjson_test.go deleted file mode 100644 index 03671827..00000000 --- a/vendor/github.com/mailru/easyjson/benchmark/ffjson_test.go +++ /dev/null @@ -1,190 +0,0 @@ -// +build use_ffjson - -package benchmark - -import ( - "testing" - - "github.com/pquerna/ffjson/ffjson" -) - -func BenchmarkFF_Unmarshal_M(b *testing.B) { - b.SetBytes(int64(len(largeStructText))) - for i := 0; i < b.N; i++ { - var s LargeStruct - err := ffjson.UnmarshalFast(largeStructText, &s) - if err != nil { - b.Error(err) - } - } -} - -func BenchmarkFF_Unmarshal_S(b *testing.B) { - for i := 0; i < b.N; i++ { - var s Entities - err := ffjson.UnmarshalFast(smallStructText, &s) - if err != nil { - b.Error(err) - } - } - b.SetBytes(int64(len(smallStructText))) -} - -func BenchmarkFF_Marshal_M(b *testing.B) { - var l int64 - for i := 0; i < b.N; i++ { - data, err := ffjson.MarshalFast(&largeStructData) - if err != nil { - b.Error(err) - } - l = int64(len(data)) - } - b.SetBytes(l) -} - -func BenchmarkFF_Marshal_S(b *testing.B) { - var l int64 - for i := 0; i < b.N; i++ { - data, err := ffjson.MarshalFast(&smallStructData) - if err != nil { - b.Error(err) - } - l = int64(len(data)) - } - b.SetBytes(l) -} - -func BenchmarkFF_Marshal_M_Pool(b *testing.B) { - var l int64 - for i := 0; i < b.N; i++ { - data, err := ffjson.MarshalFast(&largeStructData) - if err != nil { - b.Error(err) - } - l = int64(len(data)) - ffjson.Pool(data) - } - b.SetBytes(l) -} - -func BenchmarkFF_Marshal_L(b *testing.B) { - var l int64 - for i := 0; i < b.N; i++ { - data, err := ffjson.MarshalFast(&xlStructData) - if err != nil { - b.Error(err) - } - l = int64(len(data)) - } - b.SetBytes(l) -} - -func BenchmarkFF_Marshal_L_Pool(b *testing.B) { - var l int64 - for i := 0; i < b.N; i++ { - data, err := ffjson.MarshalFast(&xlStructData) - if err != nil { - b.Error(err) - } - l = int64(len(data)) - ffjson.Pool(data) - } - b.SetBytes(l) -} - -func BenchmarkFF_Marshal_L_Pool_Parallel(b *testing.B) { - var l int64 - for i := 0; i < b.N; i++ { - data, err := ffjson.MarshalFast(&xlStructData) - if err != nil { - b.Error(err) - } - l = int64(len(data)) - ffjson.Pool(data) - } - b.SetBytes(l) -} -func BenchmarkFF_Marshal_M_Pool_Parallel(b *testing.B) { - var l int64 - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - data, err := ffjson.MarshalFast(&largeStructData) - if err != nil { - b.Error(err) - } - l = int64(len(data)) - ffjson.Pool(data) - } - }) - b.SetBytes(l) -} - -func BenchmarkFF_Marshal_S_Pool(b *testing.B) { - var l int64 - for i := 0; i < b.N; i++ { - data, err := ffjson.MarshalFast(&smallStructData) - if err != nil { - b.Error(err) - } - l = int64(len(data)) - ffjson.Pool(data) - } - b.SetBytes(l) -} - -func BenchmarkFF_Marshal_S_Pool_Parallel(b *testing.B) { - var l int64 - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - data, err := ffjson.MarshalFast(&smallStructData) - if err != nil { - b.Error(err) - } - l = int64(len(data)) - ffjson.Pool(data) - } - }) - b.SetBytes(l) -} - -func BenchmarkFF_Marshal_S_Parallel(b *testing.B) { - var l int64 - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - data, err := ffjson.MarshalFast(&smallStructData) - if err != nil { - b.Error(err) - } - l = int64(len(data)) - } - }) - b.SetBytes(l) -} - -func BenchmarkFF_Marshal_M_Parallel(b *testing.B) { - var l int64 - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - data, err := ffjson.MarshalFast(&largeStructData) - if err != nil { - b.Error(err) - } - l = int64(len(data)) - } - }) - b.SetBytes(l) -} - -func BenchmarkFF_Marshal_L_Parallel(b *testing.B) { - var l int64 - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - data, err := ffjson.MarshalFast(&xlStructData) - if err != nil { - b.Error(err) - } - l = int64(len(data)) - } - }) - b.SetBytes(l) -} diff --git a/vendor/github.com/mailru/easyjson/benchmark/jsoniter_test.go b/vendor/github.com/mailru/easyjson/benchmark/jsoniter_test.go deleted file mode 100644 index 004f891d..00000000 --- a/vendor/github.com/mailru/easyjson/benchmark/jsoniter_test.go +++ /dev/null @@ -1,119 +0,0 @@ -// +build use_jsoniter - -package benchmark - -import ( - "testing" - - jsoniter "github.com/json-iterator/go" -) - -func BenchmarkJI_Unmarshal_M(b *testing.B) { - b.SetBytes(int64(len(largeStructText))) - for i := 0; i < b.N; i++ { - var s LargeStruct - err := jsoniter.Unmarshal(largeStructText, &s) - if err != nil { - b.Error(err) - } - } -} - -func BenchmarkJI_Unmarshal_S(b *testing.B) { - for i := 0; i < b.N; i++ { - var s Entities - err := jsoniter.Unmarshal(smallStructText, &s) - if err != nil { - b.Error(err) - } - } - b.SetBytes(int64(len(smallStructText))) -} - -func BenchmarkJI_Marshal_M(b *testing.B) { - var l int64 - for i := 0; i < b.N; i++ { - data, err := jsoniter.Marshal(&largeStructData) - if err != nil { - b.Error(err) - } - l = int64(len(data)) - } - b.SetBytes(l) -} - -func BenchmarkJI_Marshal_L(b *testing.B) { - var l int64 - for i := 0; i < b.N; i++ { - data, err := jsoniter.Marshal(&xlStructData) - if err != nil { - b.Error(err) - } - l = int64(len(data)) - } - b.SetBytes(l) -} - -func BenchmarkJI_Marshal_M_Parallel(b *testing.B) { - var l int64 - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - data, err := jsoniter.Marshal(&largeStructData) - if err != nil { - b.Error(err) - } - l = int64(len(data)) - } - }) - b.SetBytes(l) -} - -func BenchmarkJI_Marshal_L_Parallel(b *testing.B) { - var l int64 - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - data, err := jsoniter.Marshal(&xlStructData) - if err != nil { - b.Error(err) - } - l = int64(len(data)) - } - }) - b.SetBytes(l) -} - -func BenchmarkJI_Marshal_S(b *testing.B) { - var l int64 - for i := 0; i < b.N; i++ { - data, err := jsoniter.Marshal(&smallStructData) - if err != nil { - b.Error(err) - } - l = int64(len(data)) - } - b.SetBytes(l) -} - -func BenchmarkJI_Marshal_S_Parallel(b *testing.B) { - var l int64 - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - data, err := jsoniter.Marshal(&smallStructData) - if err != nil { - b.Error(err) - } - l = int64(len(data)) - } - }) - b.SetBytes(l) -} - -func BenchmarkJI_Marshal_M_ToWriter(b *testing.B) { - enc := jsoniter.NewEncoder(&DummyWriter{}) - for i := 0; i < b.N; i++ { - err := enc.Encode(&largeStructData) - if err != nil { - b.Error(err) - } - } -} diff --git a/vendor/github.com/mailru/easyjson/benchmark/ujson.sh b/vendor/github.com/mailru/easyjson/benchmark/ujson.sh deleted file mode 100755 index 378e7df4..00000000 --- a/vendor/github.com/mailru/easyjson/benchmark/ujson.sh +++ /dev/null @@ -1,7 +0,0 @@ -#/bin/bash - -echo -n "Python ujson module, DECODE: " -python -m timeit -s "import ujson; data = open('`dirname $0`/example.json', 'r').read()" 'ujson.loads(data)' - -echo -n "Python ujson module, ENCODE: " -python -m timeit -s "import ujson; data = open('`dirname $0`/example.json', 'r').read(); obj = ujson.loads(data)" 'ujson.dumps(obj)' diff --git a/vendor/github.com/mailru/easyjson/bootstrap/bootstrap.go b/vendor/github.com/mailru/easyjson/bootstrap/bootstrap.go deleted file mode 100644 index 1116a91a..00000000 --- a/vendor/github.com/mailru/easyjson/bootstrap/bootstrap.go +++ /dev/null @@ -1,193 +0,0 @@ -// Package bootstrap implements the bootstrapping logic: generation of a .go file to -// launch the actual generator and launching the generator itself. -// -// The package may be preferred to a command-line utility if generating the serializers -// from golang code is required. -package bootstrap - -import ( - "fmt" - "io/ioutil" - "os" - "os/exec" - "path/filepath" - "sort" -) - -const genPackage = "github.com/mailru/easyjson/gen" -const pkgWriter = "github.com/mailru/easyjson/jwriter" -const pkgLexer = "github.com/mailru/easyjson/jlexer" - -type Generator struct { - PkgPath, PkgName string - Types []string - - NoStdMarshalers bool - SnakeCase bool - LowerCamelCase bool - OmitEmpty bool - DisallowUnknownFields bool - - OutName string - BuildTags string - - StubsOnly bool - LeaveTemps bool - NoFormat bool -} - -// writeStub outputs an initial stubs for marshalers/unmarshalers so that the package -// using marshalers/unmarshales compiles correctly for boostrapping code. -func (g *Generator) writeStub() error { - f, err := os.Create(g.OutName) - if err != nil { - return err - } - defer f.Close() - - if g.BuildTags != "" { - fmt.Fprintln(f, "// +build ", g.BuildTags) - fmt.Fprintln(f) - } - fmt.Fprintln(f, "// TEMPORARY AUTOGENERATED FILE: easyjson stub code to make the package") - fmt.Fprintln(f, "// compilable during generation.") - fmt.Fprintln(f) - fmt.Fprintln(f, "package ", g.PkgName) - - if len(g.Types) > 0 { - fmt.Fprintln(f) - fmt.Fprintln(f, "import (") - fmt.Fprintln(f, ` "`+pkgWriter+`"`) - fmt.Fprintln(f, ` "`+pkgLexer+`"`) - fmt.Fprintln(f, ")") - } - - sort.Strings(g.Types) - for _, t := range g.Types { - fmt.Fprintln(f) - if !g.NoStdMarshalers { - fmt.Fprintln(f, "func (", t, ") MarshalJSON() ([]byte, error) { return nil, nil }") - fmt.Fprintln(f, "func (*", t, ") UnmarshalJSON([]byte) error { return nil }") - } - - fmt.Fprintln(f, "func (", t, ") MarshalEasyJSON(w *jwriter.Writer) {}") - fmt.Fprintln(f, "func (*", t, ") UnmarshalEasyJSON(l *jlexer.Lexer) {}") - fmt.Fprintln(f) - fmt.Fprintln(f, "type EasyJSON_exporter_"+t+" *"+t) - } - return nil -} - -// writeMain creates a .go file that launches the generator if 'go run'. -func (g *Generator) writeMain() (path string, err error) { - f, err := ioutil.TempFile(filepath.Dir(g.OutName), "easyjson-bootstrap") - if err != nil { - return "", err - } - - fmt.Fprintln(f, "// +build ignore") - fmt.Fprintln(f) - fmt.Fprintln(f, "// TEMPORARY AUTOGENERATED FILE: easyjson bootstapping code to launch") - fmt.Fprintln(f, "// the actual generator.") - fmt.Fprintln(f) - fmt.Fprintln(f, "package main") - fmt.Fprintln(f) - fmt.Fprintln(f, "import (") - fmt.Fprintln(f, ` "fmt"`) - fmt.Fprintln(f, ` "os"`) - fmt.Fprintln(f) - fmt.Fprintf(f, " %q\n", genPackage) - if len(g.Types) > 0 { - fmt.Fprintln(f) - fmt.Fprintf(f, " pkg %q\n", g.PkgPath) - } - fmt.Fprintln(f, ")") - fmt.Fprintln(f) - fmt.Fprintln(f, "func main() {") - fmt.Fprintf(f, " g := gen.NewGenerator(%q)\n", filepath.Base(g.OutName)) - fmt.Fprintf(f, " g.SetPkg(%q, %q)\n", g.PkgName, g.PkgPath) - if g.BuildTags != "" { - fmt.Fprintf(f, " g.SetBuildTags(%q)\n", g.BuildTags) - } - if g.SnakeCase { - fmt.Fprintln(f, " g.UseSnakeCase()") - } - if g.LowerCamelCase { - fmt.Fprintln(f, " g.UseLowerCamelCase()") - } - if g.OmitEmpty { - fmt.Fprintln(f, " g.OmitEmpty()") - } - if g.NoStdMarshalers { - fmt.Fprintln(f, " g.NoStdMarshalers()") - } - if g.DisallowUnknownFields { - fmt.Fprintln(f, " g.DisallowUnknownFields()") - } - - sort.Strings(g.Types) - for _, v := range g.Types { - fmt.Fprintln(f, " g.Add(pkg.EasyJSON_exporter_"+v+"(nil))") - } - - fmt.Fprintln(f, " if err := g.Run(os.Stdout); err != nil {") - fmt.Fprintln(f, " fmt.Fprintln(os.Stderr, err)") - fmt.Fprintln(f, " os.Exit(1)") - fmt.Fprintln(f, " }") - fmt.Fprintln(f, "}") - - src := f.Name() - if err := f.Close(); err != nil { - return src, err - } - - dest := src + ".go" - return dest, os.Rename(src, dest) -} - -func (g *Generator) Run() error { - if err := g.writeStub(); err != nil { - return err - } - if g.StubsOnly { - return nil - } - - path, err := g.writeMain() - if err != nil { - return err - } - if !g.LeaveTemps { - defer os.Remove(path) - } - - f, err := os.Create(g.OutName + ".tmp") - if err != nil { - return err - } - if !g.LeaveTemps { - defer os.Remove(f.Name()) // will not remove after rename - } - - cmd := exec.Command("go", "run", "-tags", g.BuildTags, filepath.Base(path)) - cmd.Stdout = f - cmd.Stderr = os.Stderr - cmd.Dir = filepath.Dir(path) - if err = cmd.Run(); err != nil { - return err - } - - f.Close() - - if !g.NoFormat { - cmd = exec.Command("gofmt", "-w", f.Name()) - cmd.Stderr = os.Stderr - cmd.Stdout = os.Stdout - - if err = cmd.Run(); err != nil { - return err - } - } - - return os.Rename(f.Name(), g.OutName) -} diff --git a/vendor/github.com/mailru/easyjson/buffer/pool.go b/vendor/github.com/mailru/easyjson/buffer/pool.go deleted file mode 100644 index 07fb4bc1..00000000 --- a/vendor/github.com/mailru/easyjson/buffer/pool.go +++ /dev/null @@ -1,270 +0,0 @@ -// Package buffer implements a buffer for serialization, consisting of a chain of []byte-s to -// reduce copying and to allow reuse of individual chunks. -package buffer - -import ( - "io" - "sync" -) - -// PoolConfig contains configuration for the allocation and reuse strategy. -type PoolConfig struct { - StartSize int // Minimum chunk size that is allocated. - PooledSize int // Minimum chunk size that is reused, reusing chunks too small will result in overhead. - MaxSize int // Maximum chunk size that will be allocated. -} - -var config = PoolConfig{ - StartSize: 128, - PooledSize: 512, - MaxSize: 32768, -} - -// Reuse pool: chunk size -> pool. -var buffers = map[int]*sync.Pool{} - -func initBuffers() { - for l := config.PooledSize; l <= config.MaxSize; l *= 2 { - buffers[l] = new(sync.Pool) - } -} - -func init() { - initBuffers() -} - -// Init sets up a non-default pooling and allocation strategy. Should be run before serialization is done. -func Init(cfg PoolConfig) { - config = cfg - initBuffers() -} - -// putBuf puts a chunk to reuse pool if it can be reused. -func putBuf(buf []byte) { - size := cap(buf) - if size < config.PooledSize { - return - } - if c := buffers[size]; c != nil { - c.Put(buf[:0]) - } -} - -// getBuf gets a chunk from reuse pool or creates a new one if reuse failed. -func getBuf(size int) []byte { - if size < config.PooledSize { - return make([]byte, 0, size) - } - - if c := buffers[size]; c != nil { - v := c.Get() - if v != nil { - return v.([]byte) - } - } - return make([]byte, 0, size) -} - -// Buffer is a buffer optimized for serialization without extra copying. -type Buffer struct { - - // Buf is the current chunk that can be used for serialization. - Buf []byte - - toPool []byte - bufs [][]byte -} - -// EnsureSpace makes sure that the current chunk contains at least s free bytes, -// possibly creating a new chunk. -func (b *Buffer) EnsureSpace(s int) { - if cap(b.Buf)-len(b.Buf) >= s { - return - } - l := len(b.Buf) - if l > 0 { - if cap(b.toPool) != cap(b.Buf) { - // Chunk was reallocated, toPool can be pooled. - putBuf(b.toPool) - } - if cap(b.bufs) == 0 { - b.bufs = make([][]byte, 0, 8) - } - b.bufs = append(b.bufs, b.Buf) - l = cap(b.toPool) * 2 - } else { - l = config.StartSize - } - - if l > config.MaxSize { - l = config.MaxSize - } - b.Buf = getBuf(l) - b.toPool = b.Buf -} - -// AppendByte appends a single byte to buffer. -func (b *Buffer) AppendByte(data byte) { - if cap(b.Buf) == len(b.Buf) { // EnsureSpace won't be inlined. - b.EnsureSpace(1) - } - b.Buf = append(b.Buf, data) -} - -// AppendBytes appends a byte slice to buffer. -func (b *Buffer) AppendBytes(data []byte) { - for len(data) > 0 { - if cap(b.Buf) == len(b.Buf) { // EnsureSpace won't be inlined. - b.EnsureSpace(1) - } - - sz := cap(b.Buf) - len(b.Buf) - if sz > len(data) { - sz = len(data) - } - - b.Buf = append(b.Buf, data[:sz]...) - data = data[sz:] - } -} - -// AppendBytes appends a string to buffer. -func (b *Buffer) AppendString(data string) { - for len(data) > 0 { - if cap(b.Buf) == len(b.Buf) { // EnsureSpace won't be inlined. - b.EnsureSpace(1) - } - - sz := cap(b.Buf) - len(b.Buf) - if sz > len(data) { - sz = len(data) - } - - b.Buf = append(b.Buf, data[:sz]...) - data = data[sz:] - } -} - -// Size computes the size of a buffer by adding sizes of every chunk. -func (b *Buffer) Size() int { - size := len(b.Buf) - for _, buf := range b.bufs { - size += len(buf) - } - return size -} - -// DumpTo outputs the contents of a buffer to a writer and resets the buffer. -func (b *Buffer) DumpTo(w io.Writer) (written int, err error) { - var n int - for _, buf := range b.bufs { - if err == nil { - n, err = w.Write(buf) - written += n - } - putBuf(buf) - } - - if err == nil { - n, err = w.Write(b.Buf) - written += n - } - putBuf(b.toPool) - - b.bufs = nil - b.Buf = nil - b.toPool = nil - - return -} - -// BuildBytes creates a single byte slice with all the contents of the buffer. Data is -// copied if it does not fit in a single chunk. You can optionally provide one byte -// slice as argument that it will try to reuse. -func (b *Buffer) BuildBytes(reuse ...[]byte) []byte { - if len(b.bufs) == 0 { - ret := b.Buf - b.toPool = nil - b.Buf = nil - return ret - } - - var ret []byte - size := b.Size() - - // If we got a buffer as argument and it is big enought, reuse it. - if len(reuse) == 1 && cap(reuse[0]) >= size { - ret = reuse[0][:0] - } else { - ret = make([]byte, 0, size) - } - for _, buf := range b.bufs { - ret = append(ret, buf...) - putBuf(buf) - } - - ret = append(ret, b.Buf...) - putBuf(b.toPool) - - b.bufs = nil - b.toPool = nil - b.Buf = nil - - return ret -} - -type readCloser struct { - offset int - bufs [][]byte -} - -func (r *readCloser) Read(p []byte) (n int, err error) { - for _, buf := range r.bufs { - // Copy as much as we can. - x := copy(p[n:], buf[r.offset:]) - n += x // Increment how much we filled. - - // Did we empty the whole buffer? - if r.offset+x == len(buf) { - // On to the next buffer. - r.offset = 0 - r.bufs = r.bufs[1:] - - // We can release this buffer. - putBuf(buf) - } else { - r.offset += x - } - - if n == len(p) { - break - } - } - // No buffers left or nothing read? - if len(r.bufs) == 0 { - err = io.EOF - } - return -} - -func (r *readCloser) Close() error { - // Release all remaining buffers. - for _, buf := range r.bufs { - putBuf(buf) - } - // In case Close gets called multiple times. - r.bufs = nil - - return nil -} - -// ReadCloser creates an io.ReadCloser with all the contents of the buffer. -func (b *Buffer) ReadCloser() io.ReadCloser { - ret := &readCloser{0, append(b.bufs, b.Buf)} - - b.bufs = nil - b.toPool = nil - b.Buf = nil - - return ret -} diff --git a/vendor/github.com/mailru/easyjson/buffer/pool_test.go b/vendor/github.com/mailru/easyjson/buffer/pool_test.go deleted file mode 100644 index 680623ac..00000000 --- a/vendor/github.com/mailru/easyjson/buffer/pool_test.go +++ /dev/null @@ -1,107 +0,0 @@ -package buffer - -import ( - "bytes" - "testing" -) - -func TestAppendByte(t *testing.T) { - var b Buffer - var want []byte - - for i := 0; i < 1000; i++ { - b.AppendByte(1) - b.AppendByte(2) - want = append(want, 1, 2) - } - - got := b.BuildBytes() - if !bytes.Equal(got, want) { - t.Errorf("BuildBytes() = %v; want %v", got, want) - } -} - -func TestAppendBytes(t *testing.T) { - var b Buffer - var want []byte - - for i := 0; i < 1000; i++ { - b.AppendBytes([]byte{1, 2}) - want = append(want, 1, 2) - } - - got := b.BuildBytes() - if !bytes.Equal(got, want) { - t.Errorf("BuildBytes() = %v; want %v", got, want) - } -} - -func TestAppendString(t *testing.T) { - var b Buffer - var want []byte - - s := "test" - for i := 0; i < 1000; i++ { - b.AppendBytes([]byte(s)) - want = append(want, s...) - } - - got := b.BuildBytes() - if !bytes.Equal(got, want) { - t.Errorf("BuildBytes() = %v; want %v", got, want) - } -} - -func TestDumpTo(t *testing.T) { - var b Buffer - var want []byte - - s := "test" - for i := 0; i < 1000; i++ { - b.AppendBytes([]byte(s)) - want = append(want, s...) - } - - out := &bytes.Buffer{} - n, err := b.DumpTo(out) - if err != nil { - t.Errorf("DumpTo() error: %v", err) - } - - got := out.Bytes() - if !bytes.Equal(got, want) { - t.Errorf("DumpTo(): got %v; want %v", got, want) - } - - if n != len(want) { - t.Errorf("DumpTo() = %v; want %v", n, len(want)) - } -} - -func TestReadCloser(t *testing.T) { - var b Buffer - var want []byte - - s := "test" - for i := 0; i < 1000; i++ { - b.AppendBytes([]byte(s)) - want = append(want, s...) - } - - out := &bytes.Buffer{} - rc := b.ReadCloser() - n, err := out.ReadFrom(rc) - if err != nil { - t.Errorf("ReadCloser() error: %v", err) - } - rc.Close() // Will always return nil - - got := out.Bytes() - if !bytes.Equal(got, want) { - t.Errorf("DumpTo(): got %v; want %v", got, want) - } - - if n != int64(len(want)) { - t.Errorf("DumpTo() = %v; want %v", n, len(want)) - } -} diff --git a/vendor/github.com/mailru/easyjson/easyjson/main.go b/vendor/github.com/mailru/easyjson/easyjson/main.go deleted file mode 100644 index d4035f76..00000000 --- a/vendor/github.com/mailru/easyjson/easyjson/main.go +++ /dev/null @@ -1,108 +0,0 @@ -package main - -import ( - "errors" - "flag" - "fmt" - "os" - "path/filepath" - "strings" - - "github.com/mailru/easyjson/bootstrap" - // Reference the gen package to be friendly to vendoring tools, - // as it is an indirect dependency. - // (The temporary bootstrapping code uses it.) - _ "github.com/mailru/easyjson/gen" - "github.com/mailru/easyjson/parser" -) - -var buildTags = flag.String("build_tags", "", "build tags to add to generated file") -var snakeCase = flag.Bool("snake_case", false, "use snake_case names instead of CamelCase by default") -var lowerCamelCase = flag.Bool("lower_camel_case", false, "use lowerCamelCase names instead of CamelCase by default") -var noStdMarshalers = flag.Bool("no_std_marshalers", false, "don't generate MarshalJSON/UnmarshalJSON funcs") -var omitEmpty = flag.Bool("omit_empty", false, "omit empty fields by default") -var allStructs = flag.Bool("all", false, "generate marshaler/unmarshalers for all structs in a file") -var leaveTemps = flag.Bool("leave_temps", false, "do not delete temporary files") -var stubs = flag.Bool("stubs", false, "only generate stubs for marshaler/unmarshaler funcs") -var noformat = flag.Bool("noformat", false, "do not run 'gofmt -w' on output file") -var specifiedName = flag.String("output_filename", "", "specify the filename of the output") -var processPkg = flag.Bool("pkg", false, "process the whole package instead of just the given file") -var disallowUnknownFields = flag.Bool("disallow_unknown_fields", false, "return error if any unknown field in json appeared") - -func generate(fname string) (err error) { - fInfo, err := os.Stat(fname) - if err != nil { - return err - } - - p := parser.Parser{AllStructs: *allStructs} - if err := p.Parse(fname, fInfo.IsDir()); err != nil { - return fmt.Errorf("Error parsing %v: %v", fname, err) - } - - var outName string - if fInfo.IsDir() { - outName = filepath.Join(fname, p.PkgName+"_easyjson.go") - } else { - if s := strings.TrimSuffix(fname, ".go"); s == fname { - return errors.New("Filename must end in '.go'") - } else { - outName = s + "_easyjson.go" - } - } - - if *specifiedName != "" { - outName = *specifiedName - } - - var trimmedBuildTags string - if *buildTags != "" { - trimmedBuildTags = strings.TrimSpace(*buildTags) - } - - g := bootstrap.Generator{ - BuildTags: trimmedBuildTags, - PkgPath: p.PkgPath, - PkgName: p.PkgName, - Types: p.StructNames, - SnakeCase: *snakeCase, - LowerCamelCase: *lowerCamelCase, - NoStdMarshalers: *noStdMarshalers, - DisallowUnknownFields: *disallowUnknownFields, - OmitEmpty: *omitEmpty, - LeaveTemps: *leaveTemps, - OutName: outName, - StubsOnly: *stubs, - NoFormat: *noformat, - } - - if err := g.Run(); err != nil { - return fmt.Errorf("Bootstrap failed: %v", err) - } - return nil -} - -func main() { - flag.Parse() - - files := flag.Args() - - gofile := os.Getenv("GOFILE") - if *processPkg { - gofile = filepath.Dir(gofile) - } - - if len(files) == 0 && gofile != "" { - files = []string{gofile} - } else if len(files) == 0 { - flag.Usage() - os.Exit(1) - } - - for _, fname := range files { - if err := generate(fname); err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } - } -} diff --git a/vendor/github.com/mailru/easyjson/gen/decoder.go b/vendor/github.com/mailru/easyjson/gen/decoder.go deleted file mode 100644 index 606602f5..00000000 --- a/vendor/github.com/mailru/easyjson/gen/decoder.go +++ /dev/null @@ -1,515 +0,0 @@ -package gen - -import ( - "encoding" - "encoding/json" - "fmt" - "reflect" - "strings" - "unicode" - - "github.com/mailru/easyjson" -) - -// Target this byte size for initial slice allocation to reduce garbage collection. -const minSliceBytes = 64 - -func (g *Generator) getDecoderName(t reflect.Type) string { - return g.functionName("decode", t) -} - -var primitiveDecoders = map[reflect.Kind]string{ - reflect.String: "in.String()", - reflect.Bool: "in.Bool()", - reflect.Int: "in.Int()", - reflect.Int8: "in.Int8()", - reflect.Int16: "in.Int16()", - reflect.Int32: "in.Int32()", - reflect.Int64: "in.Int64()", - reflect.Uint: "in.Uint()", - reflect.Uint8: "in.Uint8()", - reflect.Uint16: "in.Uint16()", - reflect.Uint32: "in.Uint32()", - reflect.Uint64: "in.Uint64()", - reflect.Float32: "in.Float32()", - reflect.Float64: "in.Float64()", -} - -var primitiveStringDecoders = map[reflect.Kind]string{ - reflect.String: "in.String()", - reflect.Int: "in.IntStr()", - reflect.Int8: "in.Int8Str()", - reflect.Int16: "in.Int16Str()", - reflect.Int32: "in.Int32Str()", - reflect.Int64: "in.Int64Str()", - reflect.Uint: "in.UintStr()", - reflect.Uint8: "in.Uint8Str()", - reflect.Uint16: "in.Uint16Str()", - reflect.Uint32: "in.Uint32Str()", - reflect.Uint64: "in.Uint64Str()", - reflect.Uintptr: "in.UintptrStr()", - reflect.Float32: "in.Float32Str()", - reflect.Float64: "in.Float64Str()", -} - -var customDecoders = map[string]string{ - "json.Number": "in.JsonNumber()", -} - -// genTypeDecoder generates decoding code for the type t, but uses unmarshaler interface if implemented by t. -func (g *Generator) genTypeDecoder(t reflect.Type, out string, tags fieldTags, indent int) error { - ws := strings.Repeat(" ", indent) - - unmarshalerIface := reflect.TypeOf((*easyjson.Unmarshaler)(nil)).Elem() - if reflect.PtrTo(t).Implements(unmarshalerIface) { - fmt.Fprintln(g.out, ws+"("+out+").UnmarshalEasyJSON(in)") - return nil - } - - unmarshalerIface = reflect.TypeOf((*json.Unmarshaler)(nil)).Elem() - if reflect.PtrTo(t).Implements(unmarshalerIface) { - fmt.Fprintln(g.out, ws+"if data := in.Raw(); in.Ok() {") - fmt.Fprintln(g.out, ws+" in.AddError( ("+out+").UnmarshalJSON(data) )") - fmt.Fprintln(g.out, ws+"}") - return nil - } - - unmarshalerIface = reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem() - if reflect.PtrTo(t).Implements(unmarshalerIface) { - fmt.Fprintln(g.out, ws+"if data := in.UnsafeBytes(); in.Ok() {") - fmt.Fprintln(g.out, ws+" in.AddError( ("+out+").UnmarshalText(data) )") - fmt.Fprintln(g.out, ws+"}") - return nil - } - - err := g.genTypeDecoderNoCheck(t, out, tags, indent) - return err -} - -// returns true of the type t implements one of the custom unmarshaler interfaces -func hasCustomUnmarshaler(t reflect.Type) bool { - t = reflect.PtrTo(t) - return t.Implements(reflect.TypeOf((*easyjson.Unmarshaler)(nil)).Elem()) || - t.Implements(reflect.TypeOf((*json.Unmarshaler)(nil)).Elem()) || - t.Implements(reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem()) -} - -// genTypeDecoderNoCheck generates decoding code for the type t. -func (g *Generator) genTypeDecoderNoCheck(t reflect.Type, out string, tags fieldTags, indent int) error { - ws := strings.Repeat(" ", indent) - // Check whether type is primitive, needs to be done after interface check. - if dec := customDecoders[t.String()]; dec != "" { - fmt.Fprintln(g.out, ws+out+" = "+dec) - return nil - } else if dec := primitiveStringDecoders[t.Kind()]; dec != "" && tags.asString { - fmt.Fprintln(g.out, ws+out+" = "+g.getType(t)+"("+dec+")") - return nil - } else if dec := primitiveDecoders[t.Kind()]; dec != "" { - fmt.Fprintln(g.out, ws+out+" = "+g.getType(t)+"("+dec+")") - return nil - } - - switch t.Kind() { - case reflect.Slice: - tmpVar := g.uniqueVarName() - elem := t.Elem() - - if elem.Kind() == reflect.Uint8 && elem.Name() == "uint8" { - fmt.Fprintln(g.out, ws+"if in.IsNull() {") - fmt.Fprintln(g.out, ws+" in.Skip()") - fmt.Fprintln(g.out, ws+" "+out+" = nil") - fmt.Fprintln(g.out, ws+"} else {") - fmt.Fprintln(g.out, ws+" "+out+" = in.Bytes()") - fmt.Fprintln(g.out, ws+"}") - - } else { - - capacity := minSliceBytes / elem.Size() - if capacity == 0 { - capacity = 1 - } - - fmt.Fprintln(g.out, ws+"if in.IsNull() {") - fmt.Fprintln(g.out, ws+" in.Skip()") - fmt.Fprintln(g.out, ws+" "+out+" = nil") - fmt.Fprintln(g.out, ws+"} else {") - fmt.Fprintln(g.out, ws+" in.Delim('[')") - fmt.Fprintln(g.out, ws+" if "+out+" == nil {") - fmt.Fprintln(g.out, ws+" if !in.IsDelim(']') {") - fmt.Fprintln(g.out, ws+" "+out+" = make("+g.getType(t)+", 0, "+fmt.Sprint(capacity)+")") - fmt.Fprintln(g.out, ws+" } else {") - fmt.Fprintln(g.out, ws+" "+out+" = "+g.getType(t)+"{}") - fmt.Fprintln(g.out, ws+" }") - fmt.Fprintln(g.out, ws+" } else { ") - fmt.Fprintln(g.out, ws+" "+out+" = ("+out+")[:0]") - fmt.Fprintln(g.out, ws+" }") - fmt.Fprintln(g.out, ws+" for !in.IsDelim(']') {") - fmt.Fprintln(g.out, ws+" var "+tmpVar+" "+g.getType(elem)) - - if err := g.genTypeDecoder(elem, tmpVar, tags, indent+2); err != nil { - return err - } - - fmt.Fprintln(g.out, ws+" "+out+" = append("+out+", "+tmpVar+")") - fmt.Fprintln(g.out, ws+" in.WantComma()") - fmt.Fprintln(g.out, ws+" }") - fmt.Fprintln(g.out, ws+" in.Delim(']')") - fmt.Fprintln(g.out, ws+"}") - } - - case reflect.Array: - iterVar := g.uniqueVarName() - elem := t.Elem() - - if elem.Kind() == reflect.Uint8 && elem.Name() == "uint8" { - fmt.Fprintln(g.out, ws+"if in.IsNull() {") - fmt.Fprintln(g.out, ws+" in.Skip()") - fmt.Fprintln(g.out, ws+"} else {") - fmt.Fprintln(g.out, ws+" copy("+out+"[:], in.Bytes())") - fmt.Fprintln(g.out, ws+"}") - - } else { - - length := t.Len() - - fmt.Fprintln(g.out, ws+"if in.IsNull() {") - fmt.Fprintln(g.out, ws+" in.Skip()") - fmt.Fprintln(g.out, ws+"} else {") - fmt.Fprintln(g.out, ws+" in.Delim('[')") - fmt.Fprintln(g.out, ws+" "+iterVar+" := 0") - fmt.Fprintln(g.out, ws+" for !in.IsDelim(']') {") - fmt.Fprintln(g.out, ws+" if "+iterVar+" < "+fmt.Sprint(length)+" {") - - if err := g.genTypeDecoder(elem, "("+out+")["+iterVar+"]", tags, indent+3); err != nil { - return err - } - - fmt.Fprintln(g.out, ws+" "+iterVar+"++") - fmt.Fprintln(g.out, ws+" } else {") - fmt.Fprintln(g.out, ws+" in.SkipRecursive()") - fmt.Fprintln(g.out, ws+" }") - fmt.Fprintln(g.out, ws+" in.WantComma()") - fmt.Fprintln(g.out, ws+" }") - fmt.Fprintln(g.out, ws+" in.Delim(']')") - fmt.Fprintln(g.out, ws+"}") - } - - case reflect.Struct: - dec := g.getDecoderName(t) - g.addType(t) - - fmt.Fprintln(g.out, ws+dec+"(in, &"+out+")") - - case reflect.Ptr: - fmt.Fprintln(g.out, ws+"if in.IsNull() {") - fmt.Fprintln(g.out, ws+" in.Skip()") - fmt.Fprintln(g.out, ws+" "+out+" = nil") - fmt.Fprintln(g.out, ws+"} else {") - fmt.Fprintln(g.out, ws+" if "+out+" == nil {") - fmt.Fprintln(g.out, ws+" "+out+" = new("+g.getType(t.Elem())+")") - fmt.Fprintln(g.out, ws+" }") - - if err := g.genTypeDecoder(t.Elem(), "*"+out, tags, indent+1); err != nil { - return err - } - - fmt.Fprintln(g.out, ws+"}") - - case reflect.Map: - key := t.Key() - keyDec, ok := primitiveStringDecoders[key.Kind()] - if !ok && !hasCustomUnmarshaler(key) { - return fmt.Errorf("map type %v not supported: only string and integer keys and types implementing json.Unmarshaler are allowed", key) - } // else assume the caller knows what they are doing and that the custom unmarshaler performs the translation from string or integer keys to the key type - elem := t.Elem() - tmpVar := g.uniqueVarName() - - fmt.Fprintln(g.out, ws+"if in.IsNull() {") - fmt.Fprintln(g.out, ws+" in.Skip()") - fmt.Fprintln(g.out, ws+"} else {") - fmt.Fprintln(g.out, ws+" in.Delim('{')") - fmt.Fprintln(g.out, ws+" if !in.IsDelim('}') {") - fmt.Fprintln(g.out, ws+" "+out+" = make("+g.getType(t)+")") - fmt.Fprintln(g.out, ws+" } else {") - fmt.Fprintln(g.out, ws+" "+out+" = nil") - fmt.Fprintln(g.out, ws+" }") - - fmt.Fprintln(g.out, ws+" for !in.IsDelim('}') {") - if keyDec != "" { - fmt.Fprintln(g.out, ws+" key := "+g.getType(key)+"("+keyDec+")") - } else { - fmt.Fprintln(g.out, ws+" var key "+g.getType(key)) - if err := g.genTypeDecoder(key, "key", tags, indent+2); err != nil { - return err - } - } - - fmt.Fprintln(g.out, ws+" in.WantColon()") - fmt.Fprintln(g.out, ws+" var "+tmpVar+" "+g.getType(elem)) - - if err := g.genTypeDecoder(elem, tmpVar, tags, indent+2); err != nil { - return err - } - - fmt.Fprintln(g.out, ws+" ("+out+")[key] = "+tmpVar) - fmt.Fprintln(g.out, ws+" in.WantComma()") - fmt.Fprintln(g.out, ws+" }") - fmt.Fprintln(g.out, ws+" in.Delim('}')") - fmt.Fprintln(g.out, ws+"}") - - case reflect.Interface: - if t.NumMethod() != 0 { - return fmt.Errorf("interface type %v not supported: only interface{} is allowed", t) - } - fmt.Fprintln(g.out, ws+"if m, ok := "+out+".(easyjson.Unmarshaler); ok {") - fmt.Fprintln(g.out, ws+"m.UnmarshalEasyJSON(in)") - fmt.Fprintln(g.out, ws+"} else if m, ok := "+out+".(json.Unmarshaler); ok {") - fmt.Fprintln(g.out, ws+"_ = m.UnmarshalJSON(in.Raw())") - fmt.Fprintln(g.out, ws+"} else {") - fmt.Fprintln(g.out, ws+" "+out+" = in.Interface()") - fmt.Fprintln(g.out, ws+"}") - default: - return fmt.Errorf("don't know how to decode %v", t) - } - return nil - -} - -func (g *Generator) genStructFieldDecoder(t reflect.Type, f reflect.StructField) error { - jsonName := g.fieldNamer.GetJSONFieldName(t, f) - tags := parseFieldTags(f) - - if tags.omit { - return nil - } - - fmt.Fprintf(g.out, " case %q:\n", jsonName) - if err := g.genTypeDecoder(f.Type, "out."+f.Name, tags, 3); err != nil { - return err - } - - if tags.required { - fmt.Fprintf(g.out, "%sSet = true\n", f.Name) - } - - return nil -} - -func (g *Generator) genRequiredFieldSet(t reflect.Type, f reflect.StructField) { - tags := parseFieldTags(f) - - if !tags.required { - return - } - - fmt.Fprintf(g.out, "var %sSet bool\n", f.Name) -} - -func (g *Generator) genRequiredFieldCheck(t reflect.Type, f reflect.StructField) { - jsonName := g.fieldNamer.GetJSONFieldName(t, f) - tags := parseFieldTags(f) - - if !tags.required { - return - } - - g.imports["fmt"] = "fmt" - - fmt.Fprintf(g.out, "if !%sSet {\n", f.Name) - fmt.Fprintf(g.out, " in.AddError(fmt.Errorf(\"key '%s' is required\"))\n", jsonName) - fmt.Fprintf(g.out, "}\n") -} - -func mergeStructFields(fields1, fields2 []reflect.StructField) (fields []reflect.StructField) { - used := map[string]bool{} - for _, f := range fields2 { - used[f.Name] = true - fields = append(fields, f) - } - - for _, f := range fields1 { - if !used[f.Name] { - fields = append(fields, f) - } - } - return -} - -func getStructFields(t reflect.Type) ([]reflect.StructField, error) { - if t.Kind() != reflect.Struct { - return nil, fmt.Errorf("got %v; expected a struct", t) - } - - var efields []reflect.StructField - for i := 0; i < t.NumField(); i++ { - f := t.Field(i) - if !f.Anonymous { - continue - } - - t1 := f.Type - if t1.Kind() == reflect.Ptr { - t1 = t1.Elem() - } - - fs, err := getStructFields(t1) - if err != nil { - return nil, fmt.Errorf("error processing embedded field: %v", err) - } - efields = mergeStructFields(efields, fs) - } - - var fields []reflect.StructField - for i := 0; i < t.NumField(); i++ { - f := t.Field(i) - if f.Anonymous { - continue - } - - c := []rune(f.Name)[0] - if unicode.IsUpper(c) { - fields = append(fields, f) - } - } - return mergeStructFields(efields, fields), nil -} - -func (g *Generator) genDecoder(t reflect.Type) error { - switch t.Kind() { - case reflect.Slice, reflect.Array, reflect.Map: - return g.genSliceArrayDecoder(t) - default: - return g.genStructDecoder(t) - } -} - -func (g *Generator) genSliceArrayDecoder(t reflect.Type) error { - switch t.Kind() { - case reflect.Slice, reflect.Array, reflect.Map: - default: - return fmt.Errorf("cannot generate encoder/decoder for %v, not a slice/array/map type", t) - } - - fname := g.getDecoderName(t) - typ := g.getType(t) - - fmt.Fprintln(g.out, "func "+fname+"(in *jlexer.Lexer, out *"+typ+") {") - fmt.Fprintln(g.out, " isTopLevel := in.IsStart()") - err := g.genTypeDecoderNoCheck(t, "*out", fieldTags{}, 1) - if err != nil { - return err - } - fmt.Fprintln(g.out, " if isTopLevel {") - fmt.Fprintln(g.out, " in.Consumed()") - fmt.Fprintln(g.out, " }") - fmt.Fprintln(g.out, "}") - - return nil -} - -func (g *Generator) genStructDecoder(t reflect.Type) error { - if t.Kind() != reflect.Struct { - return fmt.Errorf("cannot generate encoder/decoder for %v, not a struct type", t) - } - - fname := g.getDecoderName(t) - typ := g.getType(t) - - fmt.Fprintln(g.out, "func "+fname+"(in *jlexer.Lexer, out *"+typ+") {") - fmt.Fprintln(g.out, " isTopLevel := in.IsStart()") - fmt.Fprintln(g.out, " if in.IsNull() {") - fmt.Fprintln(g.out, " if isTopLevel {") - fmt.Fprintln(g.out, " in.Consumed()") - fmt.Fprintln(g.out, " }") - fmt.Fprintln(g.out, " in.Skip()") - fmt.Fprintln(g.out, " return") - fmt.Fprintln(g.out, " }") - - // Init embedded pointer fields. - for i := 0; i < t.NumField(); i++ { - f := t.Field(i) - if !f.Anonymous || f.Type.Kind() != reflect.Ptr { - continue - } - fmt.Fprintln(g.out, " out."+f.Name+" = new("+g.getType(f.Type.Elem())+")") - } - - fs, err := getStructFields(t) - if err != nil { - return fmt.Errorf("cannot generate decoder for %v: %v", t, err) - } - - for _, f := range fs { - g.genRequiredFieldSet(t, f) - } - - fmt.Fprintln(g.out, " in.Delim('{')") - fmt.Fprintln(g.out, " for !in.IsDelim('}') {") - fmt.Fprintln(g.out, " key := in.UnsafeString()") - fmt.Fprintln(g.out, " in.WantColon()") - fmt.Fprintln(g.out, " if in.IsNull() {") - fmt.Fprintln(g.out, " in.Skip()") - fmt.Fprintln(g.out, " in.WantComma()") - fmt.Fprintln(g.out, " continue") - fmt.Fprintln(g.out, " }") - - fmt.Fprintln(g.out, " switch key {") - for _, f := range fs { - if err := g.genStructFieldDecoder(t, f); err != nil { - return err - } - } - - fmt.Fprintln(g.out, " default:") - if g.disallowUnknownFields { - fmt.Fprintln(g.out, ` in.AddError(&jlexer.LexerError{ - Offset: in.GetPos(), - Reason: "unknown field", - Data: key, - })`) - } else { - fmt.Fprintln(g.out, " in.SkipRecursive()") - } - fmt.Fprintln(g.out, " }") - fmt.Fprintln(g.out, " in.WantComma()") - fmt.Fprintln(g.out, " }") - fmt.Fprintln(g.out, " in.Delim('}')") - fmt.Fprintln(g.out, " if isTopLevel {") - fmt.Fprintln(g.out, " in.Consumed()") - fmt.Fprintln(g.out, " }") - - for _, f := range fs { - g.genRequiredFieldCheck(t, f) - } - - fmt.Fprintln(g.out, "}") - - return nil -} - -func (g *Generator) genStructUnmarshaler(t reflect.Type) error { - switch t.Kind() { - case reflect.Slice, reflect.Array, reflect.Map, reflect.Struct: - default: - return fmt.Errorf("cannot generate encoder/decoder for %v, not a struct/slice/array/map type", t) - } - - fname := g.getDecoderName(t) - typ := g.getType(t) - - if !g.noStdMarshalers { - fmt.Fprintln(g.out, "// UnmarshalJSON supports json.Unmarshaler interface") - fmt.Fprintln(g.out, "func (v *"+typ+") UnmarshalJSON(data []byte) error {") - fmt.Fprintln(g.out, " r := jlexer.Lexer{Data: data}") - fmt.Fprintln(g.out, " "+fname+"(&r, v)") - fmt.Fprintln(g.out, " return r.Error()") - fmt.Fprintln(g.out, "}") - } - - fmt.Fprintln(g.out, "// UnmarshalEasyJSON supports easyjson.Unmarshaler interface") - fmt.Fprintln(g.out, "func (v *"+typ+") UnmarshalEasyJSON(l *jlexer.Lexer) {") - fmt.Fprintln(g.out, " "+fname+"(l, v)") - fmt.Fprintln(g.out, "}") - - return nil -} diff --git a/vendor/github.com/mailru/easyjson/gen/encoder.go b/vendor/github.com/mailru/easyjson/gen/encoder.go deleted file mode 100644 index b2be743d..00000000 --- a/vendor/github.com/mailru/easyjson/gen/encoder.go +++ /dev/null @@ -1,399 +0,0 @@ -package gen - -import ( - "encoding" - "encoding/json" - "fmt" - "reflect" - "strconv" - "strings" - - "github.com/mailru/easyjson" -) - -func (g *Generator) getEncoderName(t reflect.Type) string { - return g.functionName("encode", t) -} - -var primitiveEncoders = map[reflect.Kind]string{ - reflect.String: "out.String(string(%v))", - reflect.Bool: "out.Bool(bool(%v))", - reflect.Int: "out.Int(int(%v))", - reflect.Int8: "out.Int8(int8(%v))", - reflect.Int16: "out.Int16(int16(%v))", - reflect.Int32: "out.Int32(int32(%v))", - reflect.Int64: "out.Int64(int64(%v))", - reflect.Uint: "out.Uint(uint(%v))", - reflect.Uint8: "out.Uint8(uint8(%v))", - reflect.Uint16: "out.Uint16(uint16(%v))", - reflect.Uint32: "out.Uint32(uint32(%v))", - reflect.Uint64: "out.Uint64(uint64(%v))", - reflect.Float32: "out.Float32(float32(%v))", - reflect.Float64: "out.Float64(float64(%v))", -} - -var primitiveStringEncoders = map[reflect.Kind]string{ - reflect.String: "out.String(string(%v))", - reflect.Int: "out.IntStr(int(%v))", - reflect.Int8: "out.Int8Str(int8(%v))", - reflect.Int16: "out.Int16Str(int16(%v))", - reflect.Int32: "out.Int32Str(int32(%v))", - reflect.Int64: "out.Int64Str(int64(%v))", - reflect.Uint: "out.UintStr(uint(%v))", - reflect.Uint8: "out.Uint8Str(uint8(%v))", - reflect.Uint16: "out.Uint16Str(uint16(%v))", - reflect.Uint32: "out.Uint32Str(uint32(%v))", - reflect.Uint64: "out.Uint64Str(uint64(%v))", - reflect.Uintptr: "out.UintptrStr(uintptr(%v))", - reflect.Float32: "out.Float32Str(float32(%v))", - reflect.Float64: "out.Float64Str(float64(%v))", -} - -// fieldTags contains parsed version of json struct field tags. -type fieldTags struct { - name string - - omit bool - omitEmpty bool - noOmitEmpty bool - asString bool - required bool -} - -// parseFieldTags parses the json field tag into a structure. -func parseFieldTags(f reflect.StructField) fieldTags { - var ret fieldTags - - for i, s := range strings.Split(f.Tag.Get("json"), ",") { - switch { - case i == 0 && s == "-": - ret.omit = true - case i == 0: - ret.name = s - case s == "omitempty": - ret.omitEmpty = true - case s == "!omitempty": - ret.noOmitEmpty = true - case s == "string": - ret.asString = true - case s == "required": - ret.required = true - } - } - - return ret -} - -// genTypeEncoder generates code that encodes in of type t into the writer, but uses marshaler interface if implemented by t. -func (g *Generator) genTypeEncoder(t reflect.Type, in string, tags fieldTags, indent int, assumeNonEmpty bool) error { - ws := strings.Repeat(" ", indent) - - marshalerIface := reflect.TypeOf((*easyjson.Marshaler)(nil)).Elem() - if reflect.PtrTo(t).Implements(marshalerIface) { - fmt.Fprintln(g.out, ws+"("+in+").MarshalEasyJSON(out)") - return nil - } - - marshalerIface = reflect.TypeOf((*json.Marshaler)(nil)).Elem() - if reflect.PtrTo(t).Implements(marshalerIface) { - fmt.Fprintln(g.out, ws+"out.Raw( ("+in+").MarshalJSON() )") - return nil - } - - marshalerIface = reflect.TypeOf((*encoding.TextMarshaler)(nil)).Elem() - if reflect.PtrTo(t).Implements(marshalerIface) { - fmt.Fprintln(g.out, ws+"out.RawText( ("+in+").MarshalText() )") - return nil - } - - err := g.genTypeEncoderNoCheck(t, in, tags, indent, assumeNonEmpty) - return err -} - -// returns true of the type t implements one of the custom marshaler interfaces -func hasCustomMarshaler(t reflect.Type) bool { - t = reflect.PtrTo(t) - return t.Implements(reflect.TypeOf((*easyjson.Marshaler)(nil)).Elem()) || - t.Implements(reflect.TypeOf((*json.Marshaler)(nil)).Elem()) || - t.Implements(reflect.TypeOf((*encoding.TextMarshaler)(nil)).Elem()) -} - -// genTypeEncoderNoCheck generates code that encodes in of type t into the writer. -func (g *Generator) genTypeEncoderNoCheck(t reflect.Type, in string, tags fieldTags, indent int, assumeNonEmpty bool) error { - ws := strings.Repeat(" ", indent) - - // Check whether type is primitive, needs to be done after interface check. - if enc := primitiveStringEncoders[t.Kind()]; enc != "" && tags.asString { - fmt.Fprintf(g.out, ws+enc+"\n", in) - return nil - } else if enc := primitiveEncoders[t.Kind()]; enc != "" { - fmt.Fprintf(g.out, ws+enc+"\n", in) - return nil - } - - switch t.Kind() { - case reflect.Slice: - elem := t.Elem() - iVar := g.uniqueVarName() - vVar := g.uniqueVarName() - - if t.Elem().Kind() == reflect.Uint8 && elem.Name() == "uint8" { - fmt.Fprintln(g.out, ws+"out.Base64Bytes("+in+")") - } else { - if !assumeNonEmpty { - fmt.Fprintln(g.out, ws+"if "+in+" == nil && (out.Flags & jwriter.NilSliceAsEmpty) == 0 {") - fmt.Fprintln(g.out, ws+` out.RawString("null")`) - fmt.Fprintln(g.out, ws+"} else {") - } else { - fmt.Fprintln(g.out, ws+"{") - } - fmt.Fprintln(g.out, ws+" out.RawByte('[')") - fmt.Fprintln(g.out, ws+" for "+iVar+", "+vVar+" := range "+in+" {") - fmt.Fprintln(g.out, ws+" if "+iVar+" > 0 {") - fmt.Fprintln(g.out, ws+" out.RawByte(',')") - fmt.Fprintln(g.out, ws+" }") - - if err := g.genTypeEncoder(elem, vVar, tags, indent+2, false); err != nil { - return err - } - - fmt.Fprintln(g.out, ws+" }") - fmt.Fprintln(g.out, ws+" out.RawByte(']')") - fmt.Fprintln(g.out, ws+"}") - } - - case reflect.Array: - elem := t.Elem() - iVar := g.uniqueVarName() - - if t.Elem().Kind() == reflect.Uint8 && elem.Name() == "uint8" { - fmt.Fprintln(g.out, ws+"out.Base64Bytes("+in+"[:])") - } else { - fmt.Fprintln(g.out, ws+"out.RawByte('[')") - fmt.Fprintln(g.out, ws+"for "+iVar+" := range "+in+" {") - fmt.Fprintln(g.out, ws+" if "+iVar+" > 0 {") - fmt.Fprintln(g.out, ws+" out.RawByte(',')") - fmt.Fprintln(g.out, ws+" }") - - if err := g.genTypeEncoder(elem, "("+in+")["+iVar+"]", tags, indent+1, false); err != nil { - return err - } - - fmt.Fprintln(g.out, ws+"}") - fmt.Fprintln(g.out, ws+"out.RawByte(']')") - } - - case reflect.Struct: - enc := g.getEncoderName(t) - g.addType(t) - - fmt.Fprintln(g.out, ws+enc+"(out, "+in+")") - - case reflect.Ptr: - if !assumeNonEmpty { - fmt.Fprintln(g.out, ws+"if "+in+" == nil {") - fmt.Fprintln(g.out, ws+` out.RawString("null")`) - fmt.Fprintln(g.out, ws+"} else {") - } - - if err := g.genTypeEncoder(t.Elem(), "*"+in, tags, indent+1, false); err != nil { - return err - } - - if !assumeNonEmpty { - fmt.Fprintln(g.out, ws+"}") - } - - case reflect.Map: - key := t.Key() - keyEnc, ok := primitiveStringEncoders[key.Kind()] - if !ok && !hasCustomMarshaler(key) { - return fmt.Errorf("map key type %v not supported: only string and integer keys and types implementing Marshaler interfaces are allowed", key) - } // else assume the caller knows what they are doing and that the custom marshaler performs the translation from the key type to a string or integer - tmpVar := g.uniqueVarName() - - if !assumeNonEmpty { - fmt.Fprintln(g.out, ws+"if "+in+" == nil && (out.Flags & jwriter.NilMapAsEmpty) == 0 {") - fmt.Fprintln(g.out, ws+" out.RawString(`null`)") - fmt.Fprintln(g.out, ws+"} else {") - } else { - fmt.Fprintln(g.out, ws+"{") - } - fmt.Fprintln(g.out, ws+" out.RawByte('{')") - fmt.Fprintln(g.out, ws+" "+tmpVar+"First := true") - fmt.Fprintln(g.out, ws+" for "+tmpVar+"Name, "+tmpVar+"Value := range "+in+" {") - fmt.Fprintln(g.out, ws+" if "+tmpVar+"First { "+tmpVar+"First = false } else { out.RawByte(',') }") - if keyEnc != "" { - fmt.Fprintln(g.out, ws+" "+fmt.Sprintf(keyEnc, tmpVar+"Name")) - } else { - if err := g.genTypeEncoder(key, tmpVar+"Name", tags, indent+2, false); err != nil { - return err - } - } - - fmt.Fprintln(g.out, ws+" out.RawByte(':')") - - if err := g.genTypeEncoder(t.Elem(), tmpVar+"Value", tags, indent+2, false); err != nil { - return err - } - - fmt.Fprintln(g.out, ws+" }") - fmt.Fprintln(g.out, ws+" out.RawByte('}')") - fmt.Fprintln(g.out, ws+"}") - - case reflect.Interface: - if t.NumMethod() != 0 { - return fmt.Errorf("interface type %v not supported: only interface{} is allowed", t) - } - fmt.Fprintln(g.out, ws+"if m, ok := "+in+".(easyjson.Marshaler); ok {") - fmt.Fprintln(g.out, ws+" m.MarshalEasyJSON(out)") - fmt.Fprintln(g.out, ws+"} else if m, ok := "+in+".(json.Marshaler); ok {") - fmt.Fprintln(g.out, ws+" out.Raw(m.MarshalJSON())") - fmt.Fprintln(g.out, ws+"} else {") - fmt.Fprintln(g.out, ws+" out.Raw(json.Marshal("+in+"))") - fmt.Fprintln(g.out, ws+"}") - - default: - return fmt.Errorf("don't know how to encode %v", t) - } - return nil -} - -func (g *Generator) notEmptyCheck(t reflect.Type, v string) string { - optionalIface := reflect.TypeOf((*easyjson.Optional)(nil)).Elem() - if reflect.PtrTo(t).Implements(optionalIface) { - return "(" + v + ").IsDefined()" - } - - switch t.Kind() { - case reflect.Slice, reflect.Map: - return "len(" + v + ") != 0" - case reflect.Interface, reflect.Ptr: - return v + " != nil" - case reflect.Bool: - return v - case reflect.String: - return v + ` != ""` - case reflect.Float32, reflect.Float64, - reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, - reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - - return v + " != 0" - - default: - // note: Array types don't have a useful empty value - return "true" - } -} - -func (g *Generator) genStructFieldEncoder(t reflect.Type, f reflect.StructField) error { - jsonName := g.fieldNamer.GetJSONFieldName(t, f) - tags := parseFieldTags(f) - - if tags.omit { - return nil - } - noOmitEmpty := (!tags.omitEmpty && !g.omitEmpty) || tags.noOmitEmpty - if noOmitEmpty { - fmt.Fprintln(g.out, " {") - } else { - fmt.Fprintln(g.out, " if", g.notEmptyCheck(f.Type, "in."+f.Name), "{") - } - fmt.Fprintf(g.out, " const prefix string = %q\n", ","+strconv.Quote(jsonName)+":") - fmt.Fprintln(g.out, " if first {") - fmt.Fprintln(g.out, " first = false") - fmt.Fprintln(g.out, " out.RawString(prefix[1:])") - fmt.Fprintln(g.out, " } else {") - fmt.Fprintln(g.out, " out.RawString(prefix)") - fmt.Fprintln(g.out, " }") - - if err := g.genTypeEncoder(f.Type, "in."+f.Name, tags, 2, !noOmitEmpty); err != nil { - return err - } - fmt.Fprintln(g.out, " }") - return nil -} - -func (g *Generator) genEncoder(t reflect.Type) error { - switch t.Kind() { - case reflect.Slice, reflect.Array, reflect.Map: - return g.genSliceArrayMapEncoder(t) - default: - return g.genStructEncoder(t) - } -} - -func (g *Generator) genSliceArrayMapEncoder(t reflect.Type) error { - switch t.Kind() { - case reflect.Slice, reflect.Array, reflect.Map: - default: - return fmt.Errorf("cannot generate encoder/decoder for %v, not a slice/array/map type", t) - } - - fname := g.getEncoderName(t) - typ := g.getType(t) - - fmt.Fprintln(g.out, "func "+fname+"(out *jwriter.Writer, in "+typ+") {") - err := g.genTypeEncoderNoCheck(t, "in", fieldTags{}, 1, false) - if err != nil { - return err - } - fmt.Fprintln(g.out, "}") - return nil -} - -func (g *Generator) genStructEncoder(t reflect.Type) error { - if t.Kind() != reflect.Struct { - return fmt.Errorf("cannot generate encoder/decoder for %v, not a struct type", t) - } - - fname := g.getEncoderName(t) - typ := g.getType(t) - - fmt.Fprintln(g.out, "func "+fname+"(out *jwriter.Writer, in "+typ+") {") - fmt.Fprintln(g.out, " out.RawByte('{')") - fmt.Fprintln(g.out, " first := true") - fmt.Fprintln(g.out, " _ = first") - - fs, err := getStructFields(t) - if err != nil { - return fmt.Errorf("cannot generate encoder for %v: %v", t, err) - } - for _, f := range fs { - if err := g.genStructFieldEncoder(t, f); err != nil { - return err - } - } - - fmt.Fprintln(g.out, " out.RawByte('}')") - fmt.Fprintln(g.out, "}") - - return nil -} - -func (g *Generator) genStructMarshaler(t reflect.Type) error { - switch t.Kind() { - case reflect.Slice, reflect.Array, reflect.Map, reflect.Struct: - default: - return fmt.Errorf("cannot generate encoder/decoder for %v, not a struct/slice/array/map type", t) - } - - fname := g.getEncoderName(t) - typ := g.getType(t) - - if !g.noStdMarshalers { - fmt.Fprintln(g.out, "// MarshalJSON supports json.Marshaler interface") - fmt.Fprintln(g.out, "func (v "+typ+") MarshalJSON() ([]byte, error) {") - fmt.Fprintln(g.out, " w := jwriter.Writer{}") - fmt.Fprintln(g.out, " "+fname+"(&w, v)") - fmt.Fprintln(g.out, " return w.Buffer.BuildBytes(), w.Error") - fmt.Fprintln(g.out, "}") - } - - fmt.Fprintln(g.out, "// MarshalEasyJSON supports easyjson.Marshaler interface") - fmt.Fprintln(g.out, "func (v "+typ+") MarshalEasyJSON(w *jwriter.Writer) {") - fmt.Fprintln(g.out, " "+fname+"(w, v)") - fmt.Fprintln(g.out, "}") - - return nil -} diff --git a/vendor/github.com/mailru/easyjson/gen/generator.go b/vendor/github.com/mailru/easyjson/gen/generator.go deleted file mode 100644 index a34a8520..00000000 --- a/vendor/github.com/mailru/easyjson/gen/generator.go +++ /dev/null @@ -1,533 +0,0 @@ -package gen - -import ( - "bytes" - "fmt" - "hash/fnv" - "io" - "path" - "reflect" - "sort" - "strconv" - "strings" - "unicode" -) - -const pkgWriter = "github.com/mailru/easyjson/jwriter" -const pkgLexer = "github.com/mailru/easyjson/jlexer" -const pkgEasyJSON = "github.com/mailru/easyjson" - -// FieldNamer defines a policy for generating names for struct fields. -type FieldNamer interface { - GetJSONFieldName(t reflect.Type, f reflect.StructField) string -} - -// Generator generates the requested marshaler/unmarshalers. -type Generator struct { - out *bytes.Buffer - - pkgName string - pkgPath string - buildTags string - hashString string - - varCounter int - - noStdMarshalers bool - omitEmpty bool - disallowUnknownFields bool - fieldNamer FieldNamer - - // package path to local alias map for tracking imports - imports map[string]string - - // types that marshalers were requested for by user - marshalers map[reflect.Type]bool - - // types that encoders were already generated for - typesSeen map[reflect.Type]bool - - // types that encoders were requested for (e.g. by encoders of other types) - typesUnseen []reflect.Type - - // function name to relevant type maps to track names of de-/encoders in - // case of a name clash or unnamed structs - functionNames map[string]reflect.Type -} - -// NewGenerator initializes and returns a Generator. -func NewGenerator(filename string) *Generator { - ret := &Generator{ - imports: map[string]string{ - pkgWriter: "jwriter", - pkgLexer: "jlexer", - pkgEasyJSON: "easyjson", - "encoding/json": "json", - }, - fieldNamer: DefaultFieldNamer{}, - marshalers: make(map[reflect.Type]bool), - typesSeen: make(map[reflect.Type]bool), - functionNames: make(map[string]reflect.Type), - } - - // Use a file-unique prefix on all auxiliary funcs to avoid - // name clashes. - hash := fnv.New32() - hash.Write([]byte(filename)) - ret.hashString = fmt.Sprintf("%x", hash.Sum32()) - - return ret -} - -// SetPkg sets the name and path of output package. -func (g *Generator) SetPkg(name, path string) { - g.pkgName = name - g.pkgPath = path -} - -// SetBuildTags sets build tags for the output file. -func (g *Generator) SetBuildTags(tags string) { - g.buildTags = tags -} - -// SetFieldNamer sets field naming strategy. -func (g *Generator) SetFieldNamer(n FieldNamer) { - g.fieldNamer = n -} - -// UseSnakeCase sets snake_case field naming strategy. -func (g *Generator) UseSnakeCase() { - g.fieldNamer = SnakeCaseFieldNamer{} -} - -// UseLowerCamelCase sets lowerCamelCase field naming strategy. -func (g *Generator) UseLowerCamelCase() { - g.fieldNamer = LowerCamelCaseFieldNamer{} -} - -// NoStdMarshalers instructs not to generate standard MarshalJSON/UnmarshalJSON -// methods (only the custom interface). -func (g *Generator) NoStdMarshalers() { - g.noStdMarshalers = true -} - -// DisallowUnknownFields instructs not to skip unknown fields in json and return error. -func (g *Generator) DisallowUnknownFields() { - g.disallowUnknownFields = true -} - -// OmitEmpty triggers `json=",omitempty"` behaviour by default. -func (g *Generator) OmitEmpty() { - g.omitEmpty = true -} - -// addTypes requests to generate encoding/decoding funcs for the given type. -func (g *Generator) addType(t reflect.Type) { - if g.typesSeen[t] { - return - } - for _, t1 := range g.typesUnseen { - if t1 == t { - return - } - } - g.typesUnseen = append(g.typesUnseen, t) -} - -// Add requests to generate marshaler/unmarshalers and encoding/decoding -// funcs for the type of given object. -func (g *Generator) Add(obj interface{}) { - t := reflect.TypeOf(obj) - if t.Kind() == reflect.Ptr { - t = t.Elem() - } - g.addType(t) - g.marshalers[t] = true -} - -// printHeader prints package declaration and imports. -func (g *Generator) printHeader() { - if g.buildTags != "" { - fmt.Println("// +build ", g.buildTags) - fmt.Println() - } - fmt.Println("// Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.") - fmt.Println() - fmt.Println("package ", g.pkgName) - fmt.Println() - - byAlias := map[string]string{} - var aliases []string - for path, alias := range g.imports { - aliases = append(aliases, alias) - byAlias[alias] = path - } - - sort.Strings(aliases) - fmt.Println("import (") - for _, alias := range aliases { - fmt.Printf(" %s %q\n", alias, byAlias[alias]) - } - - fmt.Println(")") - fmt.Println("") - fmt.Println("// suppress unused package warning") - fmt.Println("var (") - fmt.Println(" _ *json.RawMessage") - fmt.Println(" _ *jlexer.Lexer") - fmt.Println(" _ *jwriter.Writer") - fmt.Println(" _ easyjson.Marshaler") - fmt.Println(")") - - fmt.Println() -} - -// Run runs the generator and outputs generated code to out. -func (g *Generator) Run(out io.Writer) error { - g.out = &bytes.Buffer{} - - for len(g.typesUnseen) > 0 { - t := g.typesUnseen[len(g.typesUnseen)-1] - g.typesUnseen = g.typesUnseen[:len(g.typesUnseen)-1] - g.typesSeen[t] = true - - if err := g.genDecoder(t); err != nil { - return err - } - if err := g.genEncoder(t); err != nil { - return err - } - - if !g.marshalers[t] { - continue - } - - if err := g.genStructMarshaler(t); err != nil { - return err - } - if err := g.genStructUnmarshaler(t); err != nil { - return err - } - } - g.printHeader() - _, err := out.Write(g.out.Bytes()) - return err -} - -// fixes vendored paths -func fixPkgPathVendoring(pkgPath string) string { - const vendor = "/vendor/" - if i := strings.LastIndex(pkgPath, vendor); i != -1 { - return pkgPath[i+len(vendor):] - } - return pkgPath -} - -func fixAliasName(alias string) string { - alias = strings.Replace( - strings.Replace(alias, ".", "_", -1), - "-", - "_", - -1, - ) - - if alias[0] == 'v' { // to void conflicting with var names, say v1 - alias = "_" + alias - } - return alias -} - -// pkgAlias creates and returns and import alias for a given package. -func (g *Generator) pkgAlias(pkgPath string) string { - pkgPath = fixPkgPathVendoring(pkgPath) - if alias := g.imports[pkgPath]; alias != "" { - return alias - } - - for i := 0; ; i++ { - alias := fixAliasName(path.Base(pkgPath)) - if i > 0 { - alias += fmt.Sprint(i) - } - - exists := false - for _, v := range g.imports { - if v == alias { - exists = true - break - } - } - - if !exists { - g.imports[pkgPath] = alias - return alias - } - } -} - -// getType return the textual type name of given type that can be used in generated code. -func (g *Generator) getType(t reflect.Type) string { - if t.Name() == "" { - switch t.Kind() { - case reflect.Ptr: - return "*" + g.getType(t.Elem()) - case reflect.Slice: - return "[]" + g.getType(t.Elem()) - case reflect.Array: - return "[" + strconv.Itoa(t.Len()) + "]" + g.getType(t.Elem()) - case reflect.Map: - return "map[" + g.getType(t.Key()) + "]" + g.getType(t.Elem()) - } - } - - if t.Name() == "" || t.PkgPath() == "" { - if t.Kind() == reflect.Struct { - // the fields of an anonymous struct can have named types, - // and t.String() will not be sufficient because it does not - // remove the package name when it matches g.pkgPath. - // so we convert by hand - nf := t.NumField() - lines := make([]string, 0, nf) - for i := 0; i < nf; i++ { - f := t.Field(i) - var line string - if !f.Anonymous { - line = f.Name + " " - } // else the field is anonymous (an embedded type) - line += g.getType(f.Type) - t := f.Tag - if t != "" { - line += " " + escapeTag(t) - } - lines = append(lines, line) - } - return strings.Join([]string{"struct { ", strings.Join(lines, "; "), " }"}, "") - } - return t.String() - } else if t.PkgPath() == g.pkgPath { - return t.Name() - } - return g.pkgAlias(t.PkgPath()) + "." + t.Name() -} - -// escape a struct field tag string back to source code -func escapeTag(tag reflect.StructTag) string { - t := string(tag) - if strings.ContainsRune(t, '`') { - // there are ` in the string; we can't use ` to enclose the string - return strconv.Quote(t) - } - return "`" + t + "`" -} - -// uniqueVarName returns a file-unique name that can be used for generated variables. -func (g *Generator) uniqueVarName() string { - g.varCounter++ - return fmt.Sprint("v", g.varCounter) -} - -// safeName escapes unsafe characters in pkg/type name and returns a string that can be used -// in encoder/decoder names for the type. -func (g *Generator) safeName(t reflect.Type) string { - name := t.PkgPath() - if t.Name() == "" { - name += "anonymous" - } else { - name += "." + t.Name() - } - - parts := []string{} - part := []rune{} - for _, c := range name { - if unicode.IsLetter(c) || unicode.IsDigit(c) { - part = append(part, c) - } else if len(part) > 0 { - parts = append(parts, string(part)) - part = []rune{} - } - } - return joinFunctionNameParts(false, parts...) -} - -// functionName returns a function name for a given type with a given prefix. If a function -// with this prefix already exists for a type, it is returned. -// -// Method is used to track encoder/decoder names for the type. -func (g *Generator) functionName(prefix string, t reflect.Type) string { - prefix = joinFunctionNameParts(true, "easyjson", g.hashString, prefix) - name := joinFunctionNameParts(true, prefix, g.safeName(t)) - - // Most of the names will be unique, try a shortcut first. - if e, ok := g.functionNames[name]; !ok || e == t { - g.functionNames[name] = t - return name - } - - // Search if the function already exists. - for name1, t1 := range g.functionNames { - if t1 == t && strings.HasPrefix(name1, prefix) { - return name1 - } - } - - // Create a new name in the case of a clash. - for i := 1; ; i++ { - nm := fmt.Sprint(name, i) - if _, ok := g.functionNames[nm]; ok { - continue - } - g.functionNames[nm] = t - return nm - } -} - -// DefaultFieldsNamer implements trivial naming policy equivalent to encoding/json. -type DefaultFieldNamer struct{} - -func (DefaultFieldNamer) GetJSONFieldName(t reflect.Type, f reflect.StructField) string { - jsonName := strings.Split(f.Tag.Get("json"), ",")[0] - if jsonName != "" { - return jsonName - } else { - return f.Name - } -} - -// LowerCamelCaseFieldNamer -type LowerCamelCaseFieldNamer struct{} - -func isLower(b byte) bool { - return b <= 122 && b >= 97 -} - -func isUpper(b byte) bool { - return b >= 65 && b <= 90 -} - -// convert HTTPRestClient to httpRestClient -func lowerFirst(s string) string { - if s == "" { - return "" - } - - str := "" - strlen := len(s) - - /** - Loop each char - If is uppercase: - If is first char, LOWER it - If the following char is lower, LEAVE it - If the following char is upper OR numeric, LOWER it - If is the end of string, LEAVE it - Else lowercase - */ - - foundLower := false - for i := range s { - ch := s[i] - if isUpper(ch) { - if i == 0 { - str += string(ch + 32) - } else if !foundLower { // Currently just a stream of capitals, eg JSONRESTS[erver] - if strlen > (i+1) && isLower(s[i+1]) { - // Next char is lower, keep this a capital - str += string(ch) - } else { - // Either at end of string or next char is capital - str += string(ch + 32) - } - } else { - str += string(ch) - } - } else { - foundLower = true - str += string(ch) - } - } - - return str -} - -func (LowerCamelCaseFieldNamer) GetJSONFieldName(t reflect.Type, f reflect.StructField) string { - jsonName := strings.Split(f.Tag.Get("json"), ",")[0] - if jsonName != "" { - return jsonName - } else { - return lowerFirst(f.Name) - } -} - -// SnakeCaseFieldNamer implements CamelCase to snake_case conversion for fields names. -type SnakeCaseFieldNamer struct{} - -func camelToSnake(name string) string { - var ret bytes.Buffer - - multipleUpper := false - var lastUpper rune - var beforeUpper rune - - for _, c := range name { - // Non-lowercase character after uppercase is considered to be uppercase too. - isUpper := (unicode.IsUpper(c) || (lastUpper != 0 && !unicode.IsLower(c))) - - if lastUpper != 0 { - // Output a delimiter if last character was either the first uppercase character - // in a row, or the last one in a row (e.g. 'S' in "HTTPServer"). - // Do not output a delimiter at the beginning of the name. - - firstInRow := !multipleUpper - lastInRow := !isUpper - - if ret.Len() > 0 && (firstInRow || lastInRow) && beforeUpper != '_' { - ret.WriteByte('_') - } - ret.WriteRune(unicode.ToLower(lastUpper)) - } - - // Buffer uppercase char, do not output it yet as a delimiter may be required if the - // next character is lowercase. - if isUpper { - multipleUpper = (lastUpper != 0) - lastUpper = c - continue - } - - ret.WriteRune(c) - lastUpper = 0 - beforeUpper = c - multipleUpper = false - } - - if lastUpper != 0 { - ret.WriteRune(unicode.ToLower(lastUpper)) - } - return string(ret.Bytes()) -} - -func (SnakeCaseFieldNamer) GetJSONFieldName(t reflect.Type, f reflect.StructField) string { - jsonName := strings.Split(f.Tag.Get("json"), ",")[0] - if jsonName != "" { - return jsonName - } - - return camelToSnake(f.Name) -} - -func joinFunctionNameParts(keepFirst bool, parts ...string) string { - buf := bytes.NewBufferString("") - for i, part := range parts { - if i == 0 && keepFirst { - buf.WriteString(part) - } else { - if len(part) > 0 { - buf.WriteString(strings.ToUpper(string(part[0]))) - } - if len(part) > 1 { - buf.WriteString(part[1:]) - } - } - } - return buf.String() -} diff --git a/vendor/github.com/mailru/easyjson/gen/generator_test.go b/vendor/github.com/mailru/easyjson/gen/generator_test.go deleted file mode 100644 index 0c9d2784..00000000 --- a/vendor/github.com/mailru/easyjson/gen/generator_test.go +++ /dev/null @@ -1,87 +0,0 @@ -package gen - -import ( - "testing" -) - -func TestCamelToSnake(t *testing.T) { - for i, test := range []struct { - In, Out string - }{ - {"", ""}, - {"A", "a"}, - {"SimpleExample", "simple_example"}, - {"internalField", "internal_field"}, - - {"SomeHTTPStuff", "some_http_stuff"}, - {"WriteJSON", "write_json"}, - {"HTTP2Server", "http2_server"}, - {"Some_Mixed_Case", "some_mixed_case"}, - {"do_nothing", "do_nothing"}, - - {"JSONHTTPRPCServer", "jsonhttprpc_server"}, // nothing can be done here without a dictionary - } { - got := camelToSnake(test.In) - if got != test.Out { - t.Errorf("[%d] camelToSnake(%s) = %s; want %s", i, test.In, got, test.Out) - } - } -} - -func TestCamelToLowerCamel(t *testing.T) { - for i, test := range []struct { - In, Out string - }{ - {"", ""}, - {"A", "a"}, - {"SimpleExample", "simpleExample"}, - {"internalField", "internalField"}, - - {"SomeHTTPStuff", "someHTTPStuff"}, - {"WriteJSON", "writeJSON"}, - {"HTTP2Server", "http2Server"}, - - {"JSONHTTPRPCServer", "jsonhttprpcServer"}, // nothing can be done here without a dictionary - } { - got := lowerFirst(test.In) - if got != test.Out { - t.Errorf("[%d] lowerFirst(%s) = %s; want %s", i, test.In, got, test.Out) - } - } -} - -func TestJoinFunctionNameParts(t *testing.T) { - for i, test := range []struct { - keepFirst bool - parts []string - out string - }{ - {false, []string{}, ""}, - {false, []string{"a"}, "A"}, - {false, []string{"simple", "example"}, "SimpleExample"}, - {true, []string{"first", "example"}, "firstExample"}, - {false, []string{"some", "UPPER", "case"}, "SomeUPPERCase"}, - {false, []string{"number", "123"}, "Number123"}, - } { - got := joinFunctionNameParts(test.keepFirst, test.parts...) - if got != test.out { - t.Errorf("[%d] joinFunctionNameParts(%v) = %s; want %s", i, test.parts, got, test.out) - } - } -} - -func TestFixVendorPath(t *testing.T) { - for i, test := range []struct { - In, Out string - }{ - {"", ""}, - {"time", "time"}, - {"project/vendor/subpackage", "subpackage"}, - } { - got := fixPkgPathVendoring(test.In) - if got != test.Out { - t.Errorf("[%d] fixPkgPathVendoring(%s) = %s; want %s", i, test.In, got, test.Out) - } - } - -} diff --git a/vendor/github.com/mailru/easyjson/helpers.go b/vendor/github.com/mailru/easyjson/helpers.go deleted file mode 100644 index b86b87d2..00000000 --- a/vendor/github.com/mailru/easyjson/helpers.go +++ /dev/null @@ -1,78 +0,0 @@ -// Package easyjson contains marshaler/unmarshaler interfaces and helper functions. -package easyjson - -import ( - "io" - "io/ioutil" - "net/http" - "strconv" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// Marshaler is an easyjson-compatible marshaler interface. -type Marshaler interface { - MarshalEasyJSON(w *jwriter.Writer) -} - -// Marshaler is an easyjson-compatible unmarshaler interface. -type Unmarshaler interface { - UnmarshalEasyJSON(w *jlexer.Lexer) -} - -// Optional defines an undefined-test method for a type to integrate with 'omitempty' logic. -type Optional interface { - IsDefined() bool -} - -// Marshal returns data as a single byte slice. Method is suboptimal as the data is likely to be copied -// from a chain of smaller chunks. -func Marshal(v Marshaler) ([]byte, error) { - w := jwriter.Writer{} - v.MarshalEasyJSON(&w) - return w.BuildBytes() -} - -// MarshalToWriter marshals the data to an io.Writer. -func MarshalToWriter(v Marshaler, w io.Writer) (written int, err error) { - jw := jwriter.Writer{} - v.MarshalEasyJSON(&jw) - return jw.DumpTo(w) -} - -// MarshalToHTTPResponseWriter sets Content-Length and Content-Type headers for the -// http.ResponseWriter, and send the data to the writer. started will be equal to -// false if an error occurred before any http.ResponseWriter methods were actually -// invoked (in this case a 500 reply is possible). -func MarshalToHTTPResponseWriter(v Marshaler, w http.ResponseWriter) (started bool, written int, err error) { - jw := jwriter.Writer{} - v.MarshalEasyJSON(&jw) - if jw.Error != nil { - return false, 0, jw.Error - } - w.Header().Set("Content-Type", "application/json") - w.Header().Set("Content-Length", strconv.Itoa(jw.Size())) - - started = true - written, err = jw.DumpTo(w) - return -} - -// Unmarshal decodes the JSON in data into the object. -func Unmarshal(data []byte, v Unmarshaler) error { - l := jlexer.Lexer{Data: data} - v.UnmarshalEasyJSON(&l) - return l.Error() -} - -// UnmarshalFromReader reads all the data in the reader and decodes as JSON into the object. -func UnmarshalFromReader(r io.Reader, v Unmarshaler) error { - data, err := ioutil.ReadAll(r) - if err != nil { - return err - } - l := jlexer.Lexer{Data: data} - v.UnmarshalEasyJSON(&l) - return l.Error() -} diff --git a/vendor/github.com/mailru/easyjson/jlexer/bytestostr.go b/vendor/github.com/mailru/easyjson/jlexer/bytestostr.go deleted file mode 100644 index ff7b27c5..00000000 --- a/vendor/github.com/mailru/easyjson/jlexer/bytestostr.go +++ /dev/null @@ -1,24 +0,0 @@ -// This file will only be included to the build if neither -// easyjson_nounsafe nor appengine build tag is set. See README notes -// for more details. - -//+build !easyjson_nounsafe -//+build !appengine - -package jlexer - -import ( - "reflect" - "unsafe" -) - -// bytesToStr creates a string pointing at the slice to avoid copying. -// -// Warning: the string returned by the function should be used with care, as the whole input data -// chunk may be either blocked from being freed by GC because of a single string or the buffer.Data -// may be garbage-collected even when the string exists. -func bytesToStr(data []byte) string { - h := (*reflect.SliceHeader)(unsafe.Pointer(&data)) - shdr := reflect.StringHeader{Data: h.Data, Len: h.Len} - return *(*string)(unsafe.Pointer(&shdr)) -} diff --git a/vendor/github.com/mailru/easyjson/jlexer/bytestostr_nounsafe.go b/vendor/github.com/mailru/easyjson/jlexer/bytestostr_nounsafe.go deleted file mode 100644 index 864d1be6..00000000 --- a/vendor/github.com/mailru/easyjson/jlexer/bytestostr_nounsafe.go +++ /dev/null @@ -1,13 +0,0 @@ -// This file is included to the build if any of the buildtags below -// are defined. Refer to README notes for more details. - -//+build easyjson_nounsafe appengine - -package jlexer - -// bytesToStr creates a string normally from []byte -// -// Note that this method is roughly 1.5x slower than using the 'unsafe' method. -func bytesToStr(data []byte) string { - return string(data) -} diff --git a/vendor/github.com/mailru/easyjson/jlexer/error.go b/vendor/github.com/mailru/easyjson/jlexer/error.go deleted file mode 100644 index e90ec40d..00000000 --- a/vendor/github.com/mailru/easyjson/jlexer/error.go +++ /dev/null @@ -1,15 +0,0 @@ -package jlexer - -import "fmt" - -// LexerError implements the error interface and represents all possible errors that can be -// generated during parsing the JSON data. -type LexerError struct { - Reason string - Offset int - Data string -} - -func (l *LexerError) Error() string { - return fmt.Sprintf("parse error: %s near offset %d of '%s'", l.Reason, l.Offset, l.Data) -} diff --git a/vendor/github.com/mailru/easyjson/jlexer/lexer.go b/vendor/github.com/mailru/easyjson/jlexer/lexer.go deleted file mode 100644 index 51f05661..00000000 --- a/vendor/github.com/mailru/easyjson/jlexer/lexer.go +++ /dev/null @@ -1,1181 +0,0 @@ -// Package jlexer contains a JSON lexer implementation. -// -// It is expected that it is mostly used with generated parser code, so the interface is tuned -// for a parser that knows what kind of data is expected. -package jlexer - -import ( - "encoding/base64" - "encoding/json" - "errors" - "fmt" - "io" - "strconv" - "unicode" - "unicode/utf16" - "unicode/utf8" -) - -// tokenKind determines type of a token. -type tokenKind byte - -const ( - tokenUndef tokenKind = iota // No token. - tokenDelim // Delimiter: one of '{', '}', '[' or ']'. - tokenString // A string literal, e.g. "abc\u1234" - tokenNumber // Number literal, e.g. 1.5e5 - tokenBool // Boolean literal: true or false. - tokenNull // null keyword. -) - -// token describes a single token: type, position in the input and value. -type token struct { - kind tokenKind // Type of a token. - - boolValue bool // Value if a boolean literal token. - byteValue []byte // Raw value of a token. - delimValue byte -} - -// Lexer is a JSON lexer: it iterates over JSON tokens in a byte slice. -type Lexer struct { - Data []byte // Input data given to the lexer. - - start int // Start of the current token. - pos int // Current unscanned position in the input stream. - token token // Last scanned token, if token.kind != tokenUndef. - - firstElement bool // Whether current element is the first in array or an object. - wantSep byte // A comma or a colon character, which need to occur before a token. - - UseMultipleErrors bool // If we want to use multiple errors. - fatalError error // Fatal error occurred during lexing. It is usually a syntax error. - multipleErrors []*LexerError // Semantic errors occurred during lexing. Marshalling will be continued after finding this errors. -} - -// FetchToken scans the input for the next token. -func (r *Lexer) FetchToken() { - r.token.kind = tokenUndef - r.start = r.pos - - // Check if r.Data has r.pos element - // If it doesn't, it mean corrupted input data - if len(r.Data) < r.pos { - r.errParse("Unexpected end of data") - return - } - // Determine the type of a token by skipping whitespace and reading the - // first character. - for _, c := range r.Data[r.pos:] { - switch c { - case ':', ',': - if r.wantSep == c { - r.pos++ - r.start++ - r.wantSep = 0 - } else { - r.errSyntax() - } - - case ' ', '\t', '\r', '\n': - r.pos++ - r.start++ - - case '"': - if r.wantSep != 0 { - r.errSyntax() - } - - r.token.kind = tokenString - r.fetchString() - return - - case '{', '[': - if r.wantSep != 0 { - r.errSyntax() - } - r.firstElement = true - r.token.kind = tokenDelim - r.token.delimValue = r.Data[r.pos] - r.pos++ - return - - case '}', ']': - if !r.firstElement && (r.wantSep != ',') { - r.errSyntax() - } - r.wantSep = 0 - r.token.kind = tokenDelim - r.token.delimValue = r.Data[r.pos] - r.pos++ - return - - case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-': - if r.wantSep != 0 { - r.errSyntax() - } - r.token.kind = tokenNumber - r.fetchNumber() - return - - case 'n': - if r.wantSep != 0 { - r.errSyntax() - } - - r.token.kind = tokenNull - r.fetchNull() - return - - case 't': - if r.wantSep != 0 { - r.errSyntax() - } - - r.token.kind = tokenBool - r.token.boolValue = true - r.fetchTrue() - return - - case 'f': - if r.wantSep != 0 { - r.errSyntax() - } - - r.token.kind = tokenBool - r.token.boolValue = false - r.fetchFalse() - return - - default: - r.errSyntax() - return - } - } - r.fatalError = io.EOF - return -} - -// isTokenEnd returns true if the char can follow a non-delimiter token -func isTokenEnd(c byte) bool { - return c == ' ' || c == '\t' || c == '\r' || c == '\n' || c == '[' || c == ']' || c == '{' || c == '}' || c == ',' || c == ':' -} - -// fetchNull fetches and checks remaining bytes of null keyword. -func (r *Lexer) fetchNull() { - r.pos += 4 - if r.pos > len(r.Data) || - r.Data[r.pos-3] != 'u' || - r.Data[r.pos-2] != 'l' || - r.Data[r.pos-1] != 'l' || - (r.pos != len(r.Data) && !isTokenEnd(r.Data[r.pos])) { - - r.pos -= 4 - r.errSyntax() - } -} - -// fetchTrue fetches and checks remaining bytes of true keyword. -func (r *Lexer) fetchTrue() { - r.pos += 4 - if r.pos > len(r.Data) || - r.Data[r.pos-3] != 'r' || - r.Data[r.pos-2] != 'u' || - r.Data[r.pos-1] != 'e' || - (r.pos != len(r.Data) && !isTokenEnd(r.Data[r.pos])) { - - r.pos -= 4 - r.errSyntax() - } -} - -// fetchFalse fetches and checks remaining bytes of false keyword. -func (r *Lexer) fetchFalse() { - r.pos += 5 - if r.pos > len(r.Data) || - r.Data[r.pos-4] != 'a' || - r.Data[r.pos-3] != 'l' || - r.Data[r.pos-2] != 's' || - r.Data[r.pos-1] != 'e' || - (r.pos != len(r.Data) && !isTokenEnd(r.Data[r.pos])) { - - r.pos -= 5 - r.errSyntax() - } -} - -// fetchNumber scans a number literal token. -func (r *Lexer) fetchNumber() { - hasE := false - afterE := false - hasDot := false - - r.pos++ - for i, c := range r.Data[r.pos:] { - switch { - case c >= '0' && c <= '9': - afterE = false - case c == '.' && !hasDot: - hasDot = true - case (c == 'e' || c == 'E') && !hasE: - hasE = true - hasDot = true - afterE = true - case (c == '+' || c == '-') && afterE: - afterE = false - default: - r.pos += i - if !isTokenEnd(c) { - r.errSyntax() - } else { - r.token.byteValue = r.Data[r.start:r.pos] - } - return - } - } - - r.pos = len(r.Data) - r.token.byteValue = r.Data[r.start:] -} - -// findStringLen tries to scan into the string literal for ending quote char to determine required size. -// The size will be exact if no escapes are present and may be inexact if there are escaped chars. -func findStringLen(data []byte) (isValid, hasEscapes bool, length int) { - delta := 0 - - for i := 0; i < len(data); i++ { - switch data[i] { - case '\\': - i++ - delta++ - if i < len(data) && data[i] == 'u' { - delta++ - } - case '"': - return true, (delta > 0), (i - delta) - } - } - - return false, false, len(data) -} - -// getu4 decodes \uXXXX from the beginning of s, returning the hex value, -// or it returns -1. -func getu4(s []byte) rune { - if len(s) < 6 || s[0] != '\\' || s[1] != 'u' { - return -1 - } - var val rune - for i := 2; i < len(s) && i < 6; i++ { - var v byte - c := s[i] - switch c { - case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - v = c - '0' - case 'a', 'b', 'c', 'd', 'e', 'f': - v = c - 'a' + 10 - case 'A', 'B', 'C', 'D', 'E', 'F': - v = c - 'A' + 10 - default: - return -1 - } - - val <<= 4 - val |= rune(v) - } - return val -} - -// processEscape processes a single escape sequence and returns number of bytes processed. -func (r *Lexer) processEscape(data []byte) (int, error) { - if len(data) < 2 { - return 0, fmt.Errorf("syntax error at %v", string(data)) - } - - c := data[1] - switch c { - case '"', '/', '\\': - r.token.byteValue = append(r.token.byteValue, c) - return 2, nil - case 'b': - r.token.byteValue = append(r.token.byteValue, '\b') - return 2, nil - case 'f': - r.token.byteValue = append(r.token.byteValue, '\f') - return 2, nil - case 'n': - r.token.byteValue = append(r.token.byteValue, '\n') - return 2, nil - case 'r': - r.token.byteValue = append(r.token.byteValue, '\r') - return 2, nil - case 't': - r.token.byteValue = append(r.token.byteValue, '\t') - return 2, nil - case 'u': - rr := getu4(data) - if rr < 0 { - return 0, errors.New("syntax error") - } - - read := 6 - if utf16.IsSurrogate(rr) { - rr1 := getu4(data[read:]) - if dec := utf16.DecodeRune(rr, rr1); dec != unicode.ReplacementChar { - read += 6 - rr = dec - } else { - rr = unicode.ReplacementChar - } - } - var d [4]byte - s := utf8.EncodeRune(d[:], rr) - r.token.byteValue = append(r.token.byteValue, d[:s]...) - return read, nil - } - - return 0, errors.New("syntax error") -} - -// fetchString scans a string literal token. -func (r *Lexer) fetchString() { - r.pos++ - data := r.Data[r.pos:] - - isValid, hasEscapes, length := findStringLen(data) - if !isValid { - r.pos += length - r.errParse("unterminated string literal") - return - } - if !hasEscapes { - r.token.byteValue = data[:length] - r.pos += length + 1 - return - } - - r.token.byteValue = make([]byte, 0, length) - p := 0 - for i := 0; i < len(data); { - switch data[i] { - case '"': - r.pos += i + 1 - r.token.byteValue = append(r.token.byteValue, data[p:i]...) - i++ - return - - case '\\': - r.token.byteValue = append(r.token.byteValue, data[p:i]...) - off, err := r.processEscape(data[i:]) - if err != nil { - r.errParse(err.Error()) - return - } - i += off - p = i - - default: - i++ - } - } - r.errParse("unterminated string literal") -} - -// scanToken scans the next token if no token is currently available in the lexer. -func (r *Lexer) scanToken() { - if r.token.kind != tokenUndef || r.fatalError != nil { - return - } - - r.FetchToken() -} - -// consume resets the current token to allow scanning the next one. -func (r *Lexer) consume() { - r.token.kind = tokenUndef - r.token.delimValue = 0 -} - -// Ok returns true if no error (including io.EOF) was encountered during scanning. -func (r *Lexer) Ok() bool { - return r.fatalError == nil -} - -const maxErrorContextLen = 13 - -func (r *Lexer) errParse(what string) { - if r.fatalError == nil { - var str string - if len(r.Data)-r.pos <= maxErrorContextLen { - str = string(r.Data) - } else { - str = string(r.Data[r.pos:r.pos+maxErrorContextLen-3]) + "..." - } - r.fatalError = &LexerError{ - Reason: what, - Offset: r.pos, - Data: str, - } - } -} - -func (r *Lexer) errSyntax() { - r.errParse("syntax error") -} - -func (r *Lexer) errInvalidToken(expected string) { - if r.fatalError != nil { - return - } - if r.UseMultipleErrors { - r.pos = r.start - r.consume() - r.SkipRecursive() - switch expected { - case "[": - r.token.delimValue = ']' - r.token.kind = tokenDelim - case "{": - r.token.delimValue = '}' - r.token.kind = tokenDelim - } - r.addNonfatalError(&LexerError{ - Reason: fmt.Sprintf("expected %s", expected), - Offset: r.start, - Data: string(r.Data[r.start:r.pos]), - }) - return - } - - var str string - if len(r.token.byteValue) <= maxErrorContextLen { - str = string(r.token.byteValue) - } else { - str = string(r.token.byteValue[:maxErrorContextLen-3]) + "..." - } - r.fatalError = &LexerError{ - Reason: fmt.Sprintf("expected %s", expected), - Offset: r.pos, - Data: str, - } -} - -func (r *Lexer) GetPos() int { - return r.pos -} - -// Delim consumes a token and verifies that it is the given delimiter. -func (r *Lexer) Delim(c byte) { - if r.token.kind == tokenUndef && r.Ok() { - r.FetchToken() - } - - if !r.Ok() || r.token.delimValue != c { - r.consume() // errInvalidToken can change token if UseMultipleErrors is enabled. - r.errInvalidToken(string([]byte{c})) - } else { - r.consume() - } -} - -// IsDelim returns true if there was no scanning error and next token is the given delimiter. -func (r *Lexer) IsDelim(c byte) bool { - if r.token.kind == tokenUndef && r.Ok() { - r.FetchToken() - } - return !r.Ok() || r.token.delimValue == c -} - -// Null verifies that the next token is null and consumes it. -func (r *Lexer) Null() { - if r.token.kind == tokenUndef && r.Ok() { - r.FetchToken() - } - if !r.Ok() || r.token.kind != tokenNull { - r.errInvalidToken("null") - } - r.consume() -} - -// IsNull returns true if the next token is a null keyword. -func (r *Lexer) IsNull() bool { - if r.token.kind == tokenUndef && r.Ok() { - r.FetchToken() - } - return r.Ok() && r.token.kind == tokenNull -} - -// Skip skips a single token. -func (r *Lexer) Skip() { - if r.token.kind == tokenUndef && r.Ok() { - r.FetchToken() - } - r.consume() -} - -// SkipRecursive skips next array or object completely, or just skips a single token if not -// an array/object. -// -// Note: no syntax validation is performed on the skipped data. -func (r *Lexer) SkipRecursive() { - r.scanToken() - var start, end byte - - if r.token.delimValue == '{' { - start, end = '{', '}' - } else if r.token.delimValue == '[' { - start, end = '[', ']' - } else { - r.consume() - return - } - - r.consume() - - level := 1 - inQuotes := false - wasEscape := false - - for i, c := range r.Data[r.pos:] { - switch { - case c == start && !inQuotes: - level++ - case c == end && !inQuotes: - level-- - if level == 0 { - r.pos += i + 1 - return - } - case c == '\\' && inQuotes: - wasEscape = !wasEscape - continue - case c == '"' && inQuotes: - inQuotes = wasEscape - case c == '"': - inQuotes = true - } - wasEscape = false - } - r.pos = len(r.Data) - r.fatalError = &LexerError{ - Reason: "EOF reached while skipping array/object or token", - Offset: r.pos, - Data: string(r.Data[r.pos:]), - } -} - -// Raw fetches the next item recursively as a data slice -func (r *Lexer) Raw() []byte { - r.SkipRecursive() - if !r.Ok() { - return nil - } - return r.Data[r.start:r.pos] -} - -// IsStart returns whether the lexer is positioned at the start -// of an input string. -func (r *Lexer) IsStart() bool { - return r.pos == 0 -} - -// Consumed reads all remaining bytes from the input, publishing an error if -// there is anything but whitespace remaining. -func (r *Lexer) Consumed() { - if r.pos > len(r.Data) || !r.Ok() { - return - } - - for _, c := range r.Data[r.pos:] { - if c != ' ' && c != '\t' && c != '\r' && c != '\n' { - r.AddError(&LexerError{ - Reason: "invalid character '" + string(c) + "' after top-level value", - Offset: r.pos, - Data: string(r.Data[r.pos:]), - }) - return - } - - r.pos++ - r.start++ - } -} - -func (r *Lexer) unsafeString() (string, []byte) { - if r.token.kind == tokenUndef && r.Ok() { - r.FetchToken() - } - if !r.Ok() || r.token.kind != tokenString { - r.errInvalidToken("string") - return "", nil - } - bytes := r.token.byteValue - ret := bytesToStr(r.token.byteValue) - r.consume() - return ret, bytes -} - -// UnsafeString returns the string value if the token is a string literal. -// -// Warning: returned string may point to the input buffer, so the string should not outlive -// the input buffer. Intended pattern of usage is as an argument to a switch statement. -func (r *Lexer) UnsafeString() string { - ret, _ := r.unsafeString() - return ret -} - -// UnsafeBytes returns the byte slice if the token is a string literal. -func (r *Lexer) UnsafeBytes() []byte { - _, ret := r.unsafeString() - return ret -} - -// String reads a string literal. -func (r *Lexer) String() string { - if r.token.kind == tokenUndef && r.Ok() { - r.FetchToken() - } - if !r.Ok() || r.token.kind != tokenString { - r.errInvalidToken("string") - return "" - } - ret := string(r.token.byteValue) - r.consume() - return ret -} - -// Bytes reads a string literal and base64 decodes it into a byte slice. -func (r *Lexer) Bytes() []byte { - if r.token.kind == tokenUndef && r.Ok() { - r.FetchToken() - } - if !r.Ok() || r.token.kind != tokenString { - r.errInvalidToken("string") - return nil - } - ret := make([]byte, base64.StdEncoding.DecodedLen(len(r.token.byteValue))) - n, err := base64.StdEncoding.Decode(ret, r.token.byteValue) - if err != nil { - r.fatalError = &LexerError{ - Reason: err.Error(), - } - return nil - } - - r.consume() - return ret[:n] -} - -// Bool reads a true or false boolean keyword. -func (r *Lexer) Bool() bool { - if r.token.kind == tokenUndef && r.Ok() { - r.FetchToken() - } - if !r.Ok() || r.token.kind != tokenBool { - r.errInvalidToken("bool") - return false - } - ret := r.token.boolValue - r.consume() - return ret -} - -func (r *Lexer) number() string { - if r.token.kind == tokenUndef && r.Ok() { - r.FetchToken() - } - if !r.Ok() || r.token.kind != tokenNumber { - r.errInvalidToken("number") - return "" - } - ret := bytesToStr(r.token.byteValue) - r.consume() - return ret -} - -func (r *Lexer) Uint8() uint8 { - s := r.number() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseUint(s, 10, 8) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: s, - }) - } - return uint8(n) -} - -func (r *Lexer) Uint16() uint16 { - s := r.number() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseUint(s, 10, 16) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: s, - }) - } - return uint16(n) -} - -func (r *Lexer) Uint32() uint32 { - s := r.number() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseUint(s, 10, 32) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: s, - }) - } - return uint32(n) -} - -func (r *Lexer) Uint64() uint64 { - s := r.number() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseUint(s, 10, 64) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: s, - }) - } - return n -} - -func (r *Lexer) Uint() uint { - return uint(r.Uint64()) -} - -func (r *Lexer) Int8() int8 { - s := r.number() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseInt(s, 10, 8) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: s, - }) - } - return int8(n) -} - -func (r *Lexer) Int16() int16 { - s := r.number() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseInt(s, 10, 16) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: s, - }) - } - return int16(n) -} - -func (r *Lexer) Int32() int32 { - s := r.number() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseInt(s, 10, 32) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: s, - }) - } - return int32(n) -} - -func (r *Lexer) Int64() int64 { - s := r.number() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseInt(s, 10, 64) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: s, - }) - } - return n -} - -func (r *Lexer) Int() int { - return int(r.Int64()) -} - -func (r *Lexer) Uint8Str() uint8 { - s, b := r.unsafeString() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseUint(s, 10, 8) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: string(b), - }) - } - return uint8(n) -} - -func (r *Lexer) Uint16Str() uint16 { - s, b := r.unsafeString() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseUint(s, 10, 16) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: string(b), - }) - } - return uint16(n) -} - -func (r *Lexer) Uint32Str() uint32 { - s, b := r.unsafeString() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseUint(s, 10, 32) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: string(b), - }) - } - return uint32(n) -} - -func (r *Lexer) Uint64Str() uint64 { - s, b := r.unsafeString() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseUint(s, 10, 64) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: string(b), - }) - } - return n -} - -func (r *Lexer) UintStr() uint { - return uint(r.Uint64Str()) -} - -func (r *Lexer) UintptrStr() uintptr { - return uintptr(r.Uint64Str()) -} - -func (r *Lexer) Int8Str() int8 { - s, b := r.unsafeString() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseInt(s, 10, 8) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: string(b), - }) - } - return int8(n) -} - -func (r *Lexer) Int16Str() int16 { - s, b := r.unsafeString() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseInt(s, 10, 16) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: string(b), - }) - } - return int16(n) -} - -func (r *Lexer) Int32Str() int32 { - s, b := r.unsafeString() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseInt(s, 10, 32) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: string(b), - }) - } - return int32(n) -} - -func (r *Lexer) Int64Str() int64 { - s, b := r.unsafeString() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseInt(s, 10, 64) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: string(b), - }) - } - return n -} - -func (r *Lexer) IntStr() int { - return int(r.Int64Str()) -} - -func (r *Lexer) Float32() float32 { - s := r.number() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseFloat(s, 32) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: s, - }) - } - return float32(n) -} - -func (r *Lexer) Float32Str() float32 { - s, b := r.unsafeString() - if !r.Ok() { - return 0 - } - n, err := strconv.ParseFloat(s, 32) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: string(b), - }) - } - return float32(n) -} - -func (r *Lexer) Float64() float64 { - s := r.number() - if !r.Ok() { - return 0 - } - - n, err := strconv.ParseFloat(s, 64) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: s, - }) - } - return n -} - -func (r *Lexer) Float64Str() float64 { - s, b := r.unsafeString() - if !r.Ok() { - return 0 - } - n, err := strconv.ParseFloat(s, 64) - if err != nil { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Reason: err.Error(), - Data: string(b), - }) - } - return n -} - -func (r *Lexer) Error() error { - return r.fatalError -} - -func (r *Lexer) AddError(e error) { - if r.fatalError == nil { - r.fatalError = e - } -} - -func (r *Lexer) AddNonFatalError(e error) { - r.addNonfatalError(&LexerError{ - Offset: r.start, - Data: string(r.Data[r.start:r.pos]), - Reason: e.Error(), - }) -} - -func (r *Lexer) addNonfatalError(err *LexerError) { - if r.UseMultipleErrors { - // We don't want to add errors with the same offset. - if len(r.multipleErrors) != 0 && r.multipleErrors[len(r.multipleErrors)-1].Offset == err.Offset { - return - } - r.multipleErrors = append(r.multipleErrors, err) - return - } - r.fatalError = err -} - -func (r *Lexer) GetNonFatalErrors() []*LexerError { - return r.multipleErrors -} - -// JsonNumber fetches and json.Number from 'encoding/json' package. -// Both int, float or string, contains them are valid values -func (r *Lexer) JsonNumber() json.Number { - if r.token.kind == tokenUndef && r.Ok() { - r.FetchToken() - } - if !r.Ok() { - r.errInvalidToken("json.Number") - return json.Number("") - } - - switch r.token.kind { - case tokenString: - return json.Number(r.String()) - case tokenNumber: - return json.Number(r.Raw()) - case tokenNull: - r.Null() - return json.Number("") - default: - r.errSyntax() - return json.Number("") - } -} - -// Interface fetches an interface{} analogous to the 'encoding/json' package. -func (r *Lexer) Interface() interface{} { - if r.token.kind == tokenUndef && r.Ok() { - r.FetchToken() - } - - if !r.Ok() { - return nil - } - switch r.token.kind { - case tokenString: - return r.String() - case tokenNumber: - return r.Float64() - case tokenBool: - return r.Bool() - case tokenNull: - r.Null() - return nil - } - - if r.token.delimValue == '{' { - r.consume() - - ret := map[string]interface{}{} - for !r.IsDelim('}') { - key := r.String() - r.WantColon() - ret[key] = r.Interface() - r.WantComma() - } - r.Delim('}') - - if r.Ok() { - return ret - } else { - return nil - } - } else if r.token.delimValue == '[' { - r.consume() - - var ret []interface{} - for !r.IsDelim(']') { - ret = append(ret, r.Interface()) - r.WantComma() - } - r.Delim(']') - - if r.Ok() { - return ret - } else { - return nil - } - } - r.errSyntax() - return nil -} - -// WantComma requires a comma to be present before fetching next token. -func (r *Lexer) WantComma() { - r.wantSep = ',' - r.firstElement = false -} - -// WantColon requires a colon to be present before fetching next token. -func (r *Lexer) WantColon() { - r.wantSep = ':' - r.firstElement = false -} diff --git a/vendor/github.com/mailru/easyjson/jlexer/lexer_test.go b/vendor/github.com/mailru/easyjson/jlexer/lexer_test.go deleted file mode 100644 index 3149ce46..00000000 --- a/vendor/github.com/mailru/easyjson/jlexer/lexer_test.go +++ /dev/null @@ -1,333 +0,0 @@ -package jlexer - -import ( - "bytes" - "encoding/json" - "reflect" - "testing" -) - -func TestString(t *testing.T) { - for i, test := range []struct { - toParse string - want string - wantError bool - }{ - {toParse: `"simple string"`, want: "simple string"}, - {toParse: " \r\r\n\t " + `"test"`, want: "test"}, - {toParse: `"\n\t\"\/\\\f\r"`, want: "\n\t\"/\\\f\r"}, - {toParse: `"\u0020"`, want: " "}, - {toParse: `"\u0020-\t"`, want: " -\t"}, - {toParse: `"\ufffd\uFFFD"`, want: "\ufffd\ufffd"}, - {toParse: `"\ud83d\ude00"`, want: "😀"}, - {toParse: `"\ud83d\ude08"`, want: "😈"}, - {toParse: `"\ud8"`, wantError: true}, - - {toParse: `"test"junk`, want: "test"}, - - {toParse: `5`, wantError: true}, // not a string - {toParse: `"\x"`, wantError: true}, // invalid escape - {toParse: `"\ud800"`, want: "�"}, // invalid utf-8 char; return replacement char - } { - l := Lexer{Data: []byte(test.toParse)} - - got := l.String() - if got != test.want { - t.Errorf("[%d, %q] String() = %v; want %v", i, test.toParse, got, test.want) - } - err := l.Error() - if err != nil && !test.wantError { - t.Errorf("[%d, %q] String() error: %v", i, test.toParse, err) - } else if err == nil && test.wantError { - t.Errorf("[%d, %q] String() ok; want error", i, test.toParse) - } - } -} - -func TestBytes(t *testing.T) { - for i, test := range []struct { - toParse string - want string - wantError bool - }{ - {toParse: `"c2ltcGxlIHN0cmluZw=="`, want: "simple string"}, - {toParse: " \r\r\n\t " + `"dGVzdA=="`, want: "test"}, - - {toParse: `5`, wantError: true}, // not a JSON string - {toParse: `"foobar"`, wantError: true}, // not base64 encoded - {toParse: `"c2ltcGxlIHN0cmluZw="`, wantError: true}, // invalid base64 padding - } { - l := Lexer{Data: []byte(test.toParse)} - - got := l.Bytes() - if bytes.Compare(got, []byte(test.want)) != 0 { - t.Errorf("[%d, %q] Bytes() = %v; want: %v", i, test.toParse, got, []byte(test.want)) - } - err := l.Error() - if err != nil && !test.wantError { - t.Errorf("[%d, %q] Bytes() error: %v", i, test.toParse, err) - } else if err == nil && test.wantError { - t.Errorf("[%d, %q] Bytes() ok; want error", i, test.toParse) - } - } -} - -func TestNumber(t *testing.T) { - for i, test := range []struct { - toParse string - want string - wantError bool - }{ - {toParse: "123", want: "123"}, - {toParse: "-123", want: "-123"}, - {toParse: "\r\n12.35", want: "12.35"}, - {toParse: "12.35e+1", want: "12.35e+1"}, - {toParse: "12.35e-15", want: "12.35e-15"}, - {toParse: "12.35E-15", want: "12.35E-15"}, - {toParse: "12.35E15", want: "12.35E15"}, - - {toParse: `"a"`, wantError: true}, - {toParse: "123junk", wantError: true}, - {toParse: "1.2.3", wantError: true}, - {toParse: "1e2e3", wantError: true}, - {toParse: "1e2.3", wantError: true}, - } { - l := Lexer{Data: []byte(test.toParse)} - - got := l.number() - if got != test.want { - t.Errorf("[%d, %q] number() = %v; want %v", i, test.toParse, got, test.want) - } - err := l.Error() - if err != nil && !test.wantError { - t.Errorf("[%d, %q] number() error: %v", i, test.toParse, err) - } else if err == nil && test.wantError { - t.Errorf("[%d, %q] number() ok; want error", i, test.toParse) - } - } -} - -func TestBool(t *testing.T) { - for i, test := range []struct { - toParse string - want bool - wantError bool - }{ - {toParse: "true", want: true}, - {toParse: "false", want: false}, - - {toParse: "1", wantError: true}, - {toParse: "truejunk", wantError: true}, - {toParse: `false"junk"`, wantError: true}, - {toParse: "True", wantError: true}, - {toParse: "False", wantError: true}, - } { - l := Lexer{Data: []byte(test.toParse)} - - got := l.Bool() - if got != test.want { - t.Errorf("[%d, %q] Bool() = %v; want %v", i, test.toParse, got, test.want) - } - err := l.Error() - if err != nil && !test.wantError { - t.Errorf("[%d, %q] Bool() error: %v", i, test.toParse, err) - } else if err == nil && test.wantError { - t.Errorf("[%d, %q] Bool() ok; want error", i, test.toParse) - } - } -} - -func TestSkipRecursive(t *testing.T) { - for i, test := range []struct { - toParse string - left string - wantError bool - }{ - {toParse: "5, 4", left: ", 4"}, - {toParse: "[5, 6], 4", left: ", 4"}, - {toParse: "[5, [7,8]]: 4", left: ": 4"}, - - {toParse: `{"a":1}, 4`, left: ", 4"}, - {toParse: `{"a":1, "b":{"c": 5}, "e":[12,15]}, 4`, left: ", 4"}, - - // array start/end chars in a string - {toParse: `[5, "]"], 4`, left: ", 4"}, - {toParse: `[5, "\"]"], 4`, left: ", 4"}, - {toParse: `[5, "["], 4`, left: ", 4"}, - {toParse: `[5, "\"["], 4`, left: ", 4"}, - - // object start/end chars in a string - {toParse: `{"a}":1}, 4`, left: ", 4"}, - {toParse: `{"a\"}":1}, 4`, left: ", 4"}, - {toParse: `{"a{":1}, 4`, left: ", 4"}, - {toParse: `{"a\"{":1}, 4`, left: ", 4"}, - - // object with double slashes at the end of string - {toParse: `{"a":"hey\\"}, 4`, left: ", 4"}, - } { - l := Lexer{Data: []byte(test.toParse)} - - l.SkipRecursive() - - got := string(l.Data[l.pos:]) - if got != test.left { - t.Errorf("[%d, %q] SkipRecursive() left = %v; want %v", i, test.toParse, got, test.left) - } - err := l.Error() - if err != nil && !test.wantError { - t.Errorf("[%d, %q] SkipRecursive() error: %v", i, test.toParse, err) - } else if err == nil && test.wantError { - t.Errorf("[%d, %q] SkipRecursive() ok; want error", i, test.toParse) - } - } -} - -func TestInterface(t *testing.T) { - for i, test := range []struct { - toParse string - want interface{} - wantError bool - }{ - {toParse: "null", want: nil}, - {toParse: "true", want: true}, - {toParse: `"a"`, want: "a"}, - {toParse: "5", want: float64(5)}, - - {toParse: `{}`, want: map[string]interface{}{}}, - {toParse: `[]`, want: []interface{}(nil)}, - - {toParse: `{"a": "b"}`, want: map[string]interface{}{"a": "b"}}, - {toParse: `[5]`, want: []interface{}{float64(5)}}, - - {toParse: `{"a":5 , "b" : "string"}`, want: map[string]interface{}{"a": float64(5), "b": "string"}}, - {toParse: `["a", 5 , null, true]`, want: []interface{}{"a", float64(5), nil, true}}, - - {toParse: `{"a" "b"}`, wantError: true}, - {toParse: `{"a": "b",}`, wantError: true}, - {toParse: `{"a":"b","c" "b"}`, wantError: true}, - {toParse: `{"a": "b","c":"d",}`, wantError: true}, - {toParse: `{,}`, wantError: true}, - - {toParse: `[1, 2,]`, wantError: true}, - {toParse: `[1 2]`, wantError: true}, - {toParse: `[,]`, wantError: true}, - } { - l := Lexer{Data: []byte(test.toParse)} - - got := l.Interface() - if !reflect.DeepEqual(got, test.want) { - t.Errorf("[%d, %q] Interface() = %v; want %v", i, test.toParse, got, test.want) - } - err := l.Error() - if err != nil && !test.wantError { - t.Errorf("[%d, %q] Interface() error: %v", i, test.toParse, err) - } else if err == nil && test.wantError { - t.Errorf("[%d, %q] Interface() ok; want error", i, test.toParse) - } - } -} - -func TestConsumed(t *testing.T) { - for i, test := range []struct { - toParse string - wantError bool - }{ - {toParse: "", wantError: false}, - {toParse: " ", wantError: false}, - {toParse: "\r\n", wantError: false}, - {toParse: "\t\t", wantError: false}, - - {toParse: "{", wantError: true}, - } { - l := Lexer{Data: []byte(test.toParse)} - l.Consumed() - - err := l.Error() - if err != nil && !test.wantError { - t.Errorf("[%d, %q] Consumed() error: %v", i, test.toParse, err) - } else if err == nil && test.wantError { - t.Errorf("[%d, %q] Consumed() ok; want error", i, test.toParse) - } - } -} - -func TestJsonNumber(t *testing.T) { - for i, test := range []struct { - toParse string - want json.Number - wantLexerError bool - wantValue interface{} - wantValueError bool - }{ - {toParse: `10`, want: json.Number("10"), wantValue: int64(10)}, - {toParse: `0`, want: json.Number("0"), wantValue: int64(0)}, - {toParse: `0.12`, want: json.Number("0.12"), wantValue: 0.12}, - {toParse: `25E-4`, want: json.Number("25E-4"), wantValue: 25E-4}, - - {toParse: `"10"`, want: json.Number("10"), wantValue: int64(10)}, - {toParse: `"0"`, want: json.Number("0"), wantValue: int64(0)}, - {toParse: `"0.12"`, want: json.Number("0.12"), wantValue: 0.12}, - {toParse: `"25E-4"`, want: json.Number("25E-4"), wantValue: 25E-4}, - - {toParse: `"foo"`, want: json.Number("foo"), wantValueError: true}, - {toParse: `null`, want: json.Number(""), wantValueError: true}, - - {toParse: `"a""`, want: json.Number("a"), wantValueError: true}, - - {toParse: `[1]`, want: json.Number(""), wantLexerError: true, wantValueError: true}, - {toParse: `{}`, want: json.Number(""), wantLexerError: true, wantValueError: true}, - {toParse: `a`, want: json.Number(""), wantLexerError: true, wantValueError: true}, - } { - l := Lexer{Data: []byte(test.toParse)} - - got := l.JsonNumber() - if got != test.want { - t.Errorf("[%d, %q] JsonNumber() = %v; want %v", i, test.toParse, got, test.want) - } - - err := l.Error() - if err != nil && !test.wantLexerError { - t.Errorf("[%d, %q] JsonNumber() lexer error: %v", i, test.toParse, err) - } else if err == nil && test.wantLexerError { - t.Errorf("[%d, %q] JsonNumber() ok; want lexer error", i, test.toParse) - } - - var valueErr error - var gotValue interface{} - switch test.wantValue.(type) { - case float64: - gotValue, valueErr = got.Float64() - default: - gotValue, valueErr = got.Int64() - } - - if !reflect.DeepEqual(gotValue, test.wantValue) && !test.wantLexerError && !test.wantValueError { - t.Errorf("[%d, %q] JsonNumber() = %v; want %v", i, test.toParse, gotValue, test.wantValue) - } - - if valueErr != nil && !test.wantValueError { - t.Errorf("[%d, %q] JsonNumber() value error: %v", i, test.toParse, valueErr) - } else if valueErr == nil && test.wantValueError { - t.Errorf("[%d, %q] JsonNumber() ok; want value error", i, test.toParse) - } - } -} - -func TestFetchStringUnterminatedString(t *testing.T) { - for _, test := range []struct { - data []byte - }{ - {data: []byte(`"sting without trailing quote`)}, - {data: []byte(`"\"`)}, - {data: []byte{'"'}}, - } { - l := Lexer{Data: test.data} - l.fetchString() - if l.pos > len(l.Data) { - t.Errorf("fetchString(%s): pos should not be greater than length of Data", test.data) - } - if l.Error() == nil { - t.Errorf("fetchString(%s): should add parsing error", test.data) - } - } -} diff --git a/vendor/github.com/mailru/easyjson/jwriter/writer.go b/vendor/github.com/mailru/easyjson/jwriter/writer.go deleted file mode 100644 index b9ed7cca..00000000 --- a/vendor/github.com/mailru/easyjson/jwriter/writer.go +++ /dev/null @@ -1,390 +0,0 @@ -// Package jwriter contains a JSON writer. -package jwriter - -import ( - "io" - "strconv" - "unicode/utf8" - - "github.com/mailru/easyjson/buffer" -) - -// Flags describe various encoding options. The behavior may be actually implemented in the encoder, but -// Flags field in Writer is used to set and pass them around. -type Flags int - -const ( - NilMapAsEmpty Flags = 1 << iota // Encode nil map as '{}' rather than 'null'. - NilSliceAsEmpty // Encode nil slice as '[]' rather than 'null'. -) - -// Writer is a JSON writer. -type Writer struct { - Flags Flags - - Error error - Buffer buffer.Buffer - NoEscapeHTML bool -} - -// Size returns the size of the data that was written out. -func (w *Writer) Size() int { - return w.Buffer.Size() -} - -// DumpTo outputs the data to given io.Writer, resetting the buffer. -func (w *Writer) DumpTo(out io.Writer) (written int, err error) { - return w.Buffer.DumpTo(out) -} - -// BuildBytes returns writer data as a single byte slice. You can optionally provide one byte slice -// as argument that it will try to reuse. -func (w *Writer) BuildBytes(reuse ...[]byte) ([]byte, error) { - if w.Error != nil { - return nil, w.Error - } - - return w.Buffer.BuildBytes(reuse...), nil -} - -// ReadCloser returns an io.ReadCloser that can be used to read the data. -// ReadCloser also resets the buffer. -func (w *Writer) ReadCloser() (io.ReadCloser, error) { - if w.Error != nil { - return nil, w.Error - } - - return w.Buffer.ReadCloser(), nil -} - -// RawByte appends raw binary data to the buffer. -func (w *Writer) RawByte(c byte) { - w.Buffer.AppendByte(c) -} - -// RawByte appends raw binary data to the buffer. -func (w *Writer) RawString(s string) { - w.Buffer.AppendString(s) -} - -// Raw appends raw binary data to the buffer or sets the error if it is given. Useful for -// calling with results of MarshalJSON-like functions. -func (w *Writer) Raw(data []byte, err error) { - switch { - case w.Error != nil: - return - case err != nil: - w.Error = err - case len(data) > 0: - w.Buffer.AppendBytes(data) - default: - w.RawString("null") - } -} - -// RawText encloses raw binary data in quotes and appends in to the buffer. -// Useful for calling with results of MarshalText-like functions. -func (w *Writer) RawText(data []byte, err error) { - switch { - case w.Error != nil: - return - case err != nil: - w.Error = err - case len(data) > 0: - w.String(string(data)) - default: - w.RawString("null") - } -} - -// Base64Bytes appends data to the buffer after base64 encoding it -func (w *Writer) Base64Bytes(data []byte) { - if data == nil { - w.Buffer.AppendString("null") - return - } - w.Buffer.AppendByte('"') - w.base64(data) - w.Buffer.AppendByte('"') -} - -func (w *Writer) Uint8(n uint8) { - w.Buffer.EnsureSpace(3) - w.Buffer.Buf = strconv.AppendUint(w.Buffer.Buf, uint64(n), 10) -} - -func (w *Writer) Uint16(n uint16) { - w.Buffer.EnsureSpace(5) - w.Buffer.Buf = strconv.AppendUint(w.Buffer.Buf, uint64(n), 10) -} - -func (w *Writer) Uint32(n uint32) { - w.Buffer.EnsureSpace(10) - w.Buffer.Buf = strconv.AppendUint(w.Buffer.Buf, uint64(n), 10) -} - -func (w *Writer) Uint(n uint) { - w.Buffer.EnsureSpace(20) - w.Buffer.Buf = strconv.AppendUint(w.Buffer.Buf, uint64(n), 10) -} - -func (w *Writer) Uint64(n uint64) { - w.Buffer.EnsureSpace(20) - w.Buffer.Buf = strconv.AppendUint(w.Buffer.Buf, n, 10) -} - -func (w *Writer) Int8(n int8) { - w.Buffer.EnsureSpace(4) - w.Buffer.Buf = strconv.AppendInt(w.Buffer.Buf, int64(n), 10) -} - -func (w *Writer) Int16(n int16) { - w.Buffer.EnsureSpace(6) - w.Buffer.Buf = strconv.AppendInt(w.Buffer.Buf, int64(n), 10) -} - -func (w *Writer) Int32(n int32) { - w.Buffer.EnsureSpace(11) - w.Buffer.Buf = strconv.AppendInt(w.Buffer.Buf, int64(n), 10) -} - -func (w *Writer) Int(n int) { - w.Buffer.EnsureSpace(21) - w.Buffer.Buf = strconv.AppendInt(w.Buffer.Buf, int64(n), 10) -} - -func (w *Writer) Int64(n int64) { - w.Buffer.EnsureSpace(21) - w.Buffer.Buf = strconv.AppendInt(w.Buffer.Buf, n, 10) -} - -func (w *Writer) Uint8Str(n uint8) { - w.Buffer.EnsureSpace(3) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendUint(w.Buffer.Buf, uint64(n), 10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) Uint16Str(n uint16) { - w.Buffer.EnsureSpace(5) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendUint(w.Buffer.Buf, uint64(n), 10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) Uint32Str(n uint32) { - w.Buffer.EnsureSpace(10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendUint(w.Buffer.Buf, uint64(n), 10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) UintStr(n uint) { - w.Buffer.EnsureSpace(20) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendUint(w.Buffer.Buf, uint64(n), 10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) Uint64Str(n uint64) { - w.Buffer.EnsureSpace(20) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendUint(w.Buffer.Buf, n, 10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) UintptrStr(n uintptr) { - w.Buffer.EnsureSpace(20) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendUint(w.Buffer.Buf, uint64(n), 10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) Int8Str(n int8) { - w.Buffer.EnsureSpace(4) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendInt(w.Buffer.Buf, int64(n), 10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) Int16Str(n int16) { - w.Buffer.EnsureSpace(6) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendInt(w.Buffer.Buf, int64(n), 10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) Int32Str(n int32) { - w.Buffer.EnsureSpace(11) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendInt(w.Buffer.Buf, int64(n), 10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) IntStr(n int) { - w.Buffer.EnsureSpace(21) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendInt(w.Buffer.Buf, int64(n), 10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) Int64Str(n int64) { - w.Buffer.EnsureSpace(21) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendInt(w.Buffer.Buf, n, 10) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) Float32(n float32) { - w.Buffer.EnsureSpace(20) - w.Buffer.Buf = strconv.AppendFloat(w.Buffer.Buf, float64(n), 'g', -1, 32) -} - -func (w *Writer) Float32Str(n float32) { - w.Buffer.EnsureSpace(20) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendFloat(w.Buffer.Buf, float64(n), 'g', -1, 32) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) Float64(n float64) { - w.Buffer.EnsureSpace(20) - w.Buffer.Buf = strconv.AppendFloat(w.Buffer.Buf, n, 'g', -1, 64) -} - -func (w *Writer) Float64Str(n float64) { - w.Buffer.EnsureSpace(20) - w.Buffer.Buf = append(w.Buffer.Buf, '"') - w.Buffer.Buf = strconv.AppendFloat(w.Buffer.Buf, float64(n), 'g', -1, 64) - w.Buffer.Buf = append(w.Buffer.Buf, '"') -} - -func (w *Writer) Bool(v bool) { - w.Buffer.EnsureSpace(5) - if v { - w.Buffer.Buf = append(w.Buffer.Buf, "true"...) - } else { - w.Buffer.Buf = append(w.Buffer.Buf, "false"...) - } -} - -const chars = "0123456789abcdef" - -func isNotEscapedSingleChar(c byte, escapeHTML bool) bool { - // Note: might make sense to use a table if there are more chars to escape. With 4 chars - // it benchmarks the same. - if escapeHTML { - return c != '<' && c != '>' && c != '&' && c != '\\' && c != '"' && c >= 0x20 && c < utf8.RuneSelf - } else { - return c != '\\' && c != '"' && c >= 0x20 && c < utf8.RuneSelf - } -} - -func (w *Writer) String(s string) { - w.Buffer.AppendByte('"') - - // Portions of the string that contain no escapes are appended as - // byte slices. - - p := 0 // last non-escape symbol - - for i := 0; i < len(s); { - c := s[i] - - if isNotEscapedSingleChar(c, !w.NoEscapeHTML) { - // single-width character, no escaping is required - i++ - continue - } else if c < utf8.RuneSelf { - // single-with character, need to escape - w.Buffer.AppendString(s[p:i]) - switch c { - case '\t': - w.Buffer.AppendString(`\t`) - case '\r': - w.Buffer.AppendString(`\r`) - case '\n': - w.Buffer.AppendString(`\n`) - case '\\': - w.Buffer.AppendString(`\\`) - case '"': - w.Buffer.AppendString(`\"`) - default: - w.Buffer.AppendString(`\u00`) - w.Buffer.AppendByte(chars[c>>4]) - w.Buffer.AppendByte(chars[c&0xf]) - } - - i++ - p = i - continue - } - - // broken utf - runeValue, runeWidth := utf8.DecodeRuneInString(s[i:]) - if runeValue == utf8.RuneError && runeWidth == 1 { - w.Buffer.AppendString(s[p:i]) - w.Buffer.AppendString(`\ufffd`) - i++ - p = i - continue - } - - // jsonp stuff - tab separator and line separator - if runeValue == '\u2028' || runeValue == '\u2029' { - w.Buffer.AppendString(s[p:i]) - w.Buffer.AppendString(`\u202`) - w.Buffer.AppendByte(chars[runeValue&0xf]) - i += runeWidth - p = i - continue - } - i += runeWidth - } - w.Buffer.AppendString(s[p:]) - w.Buffer.AppendByte('"') -} - -const encode = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" -const padChar = '=' - -func (w *Writer) base64(in []byte) { - - if len(in) == 0 { - return - } - - w.Buffer.EnsureSpace(((len(in)-1)/3 + 1) * 4) - - si := 0 - n := (len(in) / 3) * 3 - - for si < n { - // Convert 3x 8bit source bytes into 4 bytes - val := uint(in[si+0])<<16 | uint(in[si+1])<<8 | uint(in[si+2]) - - w.Buffer.Buf = append(w.Buffer.Buf, encode[val>>18&0x3F], encode[val>>12&0x3F], encode[val>>6&0x3F], encode[val&0x3F]) - - si += 3 - } - - remain := len(in) - si - if remain == 0 { - return - } - - // Add the remaining small block - val := uint(in[si+0]) << 16 - if remain == 2 { - val |= uint(in[si+1]) << 8 - } - - w.Buffer.Buf = append(w.Buffer.Buf, encode[val>>18&0x3F], encode[val>>12&0x3F]) - - switch remain { - case 2: - w.Buffer.Buf = append(w.Buffer.Buf, encode[val>>6&0x3F], byte(padChar)) - case 1: - w.Buffer.Buf = append(w.Buffer.Buf, byte(padChar), byte(padChar)) - } -} diff --git a/vendor/github.com/mailru/easyjson/opt/gotemplate_Bool.go b/vendor/github.com/mailru/easyjson/opt/gotemplate_Bool.go deleted file mode 100644 index 6978ee97..00000000 --- a/vendor/github.com/mailru/easyjson/opt/gotemplate_Bool.go +++ /dev/null @@ -1,79 +0,0 @@ -// generated by gotemplate - -package opt - -import ( - "fmt" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// template type Optional(A) - -// A 'gotemplate'-based type for providing optional semantics without using pointers. -type Bool struct { - V bool - Defined bool -} - -// Creates an optional type with a given value. -func OBool(v bool) Bool { - return Bool{V: v, Defined: true} -} - -// Get returns the value or given default in the case the value is undefined. -func (v Bool) Get(deflt bool) bool { - if !v.Defined { - return deflt - } - return v.V -} - -// MarshalEasyJSON does JSON marshaling using easyjson interface. -func (v Bool) MarshalEasyJSON(w *jwriter.Writer) { - if v.Defined { - w.Bool(v.V) - } else { - w.RawString("null") - } -} - -// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. -func (v *Bool) UnmarshalEasyJSON(l *jlexer.Lexer) { - if l.IsNull() { - l.Skip() - *v = Bool{} - } else { - v.V = l.Bool() - v.Defined = true - } -} - -// MarshalJSON implements a standard json marshaler interface. -func (v Bool) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - v.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} - -// UnmarshalJSON implements a standard json unmarshaler interface. -func (v *Bool) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - v.UnmarshalEasyJSON(&l) - return l.Error() -} - -// IsDefined returns whether the value is defined, a function is required so that it can -// be used in an interface. -func (v Bool) IsDefined() bool { - return v.Defined -} - -// String implements a stringer interface using fmt.Sprint for the value. -func (v Bool) String() string { - if !v.Defined { - return "" - } - return fmt.Sprint(v.V) -} diff --git a/vendor/github.com/mailru/easyjson/opt/gotemplate_Float32.go b/vendor/github.com/mailru/easyjson/opt/gotemplate_Float32.go deleted file mode 100644 index 643cea35..00000000 --- a/vendor/github.com/mailru/easyjson/opt/gotemplate_Float32.go +++ /dev/null @@ -1,79 +0,0 @@ -// generated by gotemplate - -package opt - -import ( - "fmt" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// template type Optional(A) - -// A 'gotemplate'-based type for providing optional semantics without using pointers. -type Float32 struct { - V float32 - Defined bool -} - -// Creates an optional type with a given value. -func OFloat32(v float32) Float32 { - return Float32{V: v, Defined: true} -} - -// Get returns the value or given default in the case the value is undefined. -func (v Float32) Get(deflt float32) float32 { - if !v.Defined { - return deflt - } - return v.V -} - -// MarshalEasyJSON does JSON marshaling using easyjson interface. -func (v Float32) MarshalEasyJSON(w *jwriter.Writer) { - if v.Defined { - w.Float32(v.V) - } else { - w.RawString("null") - } -} - -// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. -func (v *Float32) UnmarshalEasyJSON(l *jlexer.Lexer) { - if l.IsNull() { - l.Skip() - *v = Float32{} - } else { - v.V = l.Float32() - v.Defined = true - } -} - -// MarshalJSON implements a standard json marshaler interface. -func (v Float32) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - v.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} - -// UnmarshalJSON implements a standard json unmarshaler interface. -func (v *Float32) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - v.UnmarshalEasyJSON(&l) - return l.Error() -} - -// IsDefined returns whether the value is defined, a function is required so that it can -// be used in an interface. -func (v Float32) IsDefined() bool { - return v.Defined -} - -// String implements a stringer interface using fmt.Sprint for the value. -func (v Float32) String() string { - if !v.Defined { - return "" - } - return fmt.Sprint(v.V) -} diff --git a/vendor/github.com/mailru/easyjson/opt/gotemplate_Float64.go b/vendor/github.com/mailru/easyjson/opt/gotemplate_Float64.go deleted file mode 100644 index 75ae7275..00000000 --- a/vendor/github.com/mailru/easyjson/opt/gotemplate_Float64.go +++ /dev/null @@ -1,79 +0,0 @@ -// generated by gotemplate - -package opt - -import ( - "fmt" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// template type Optional(A) - -// A 'gotemplate'-based type for providing optional semantics without using pointers. -type Float64 struct { - V float64 - Defined bool -} - -// Creates an optional type with a given value. -func OFloat64(v float64) Float64 { - return Float64{V: v, Defined: true} -} - -// Get returns the value or given default in the case the value is undefined. -func (v Float64) Get(deflt float64) float64 { - if !v.Defined { - return deflt - } - return v.V -} - -// MarshalEasyJSON does JSON marshaling using easyjson interface. -func (v Float64) MarshalEasyJSON(w *jwriter.Writer) { - if v.Defined { - w.Float64(v.V) - } else { - w.RawString("null") - } -} - -// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. -func (v *Float64) UnmarshalEasyJSON(l *jlexer.Lexer) { - if l.IsNull() { - l.Skip() - *v = Float64{} - } else { - v.V = l.Float64() - v.Defined = true - } -} - -// MarshalJSON implements a standard json marshaler interface. -func (v Float64) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - v.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} - -// UnmarshalJSON implements a standard json unmarshaler interface. -func (v *Float64) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - v.UnmarshalEasyJSON(&l) - return l.Error() -} - -// IsDefined returns whether the value is defined, a function is required so that it can -// be used in an interface. -func (v Float64) IsDefined() bool { - return v.Defined -} - -// String implements a stringer interface using fmt.Sprint for the value. -func (v Float64) String() string { - if !v.Defined { - return "" - } - return fmt.Sprint(v.V) -} diff --git a/vendor/github.com/mailru/easyjson/opt/gotemplate_Int.go b/vendor/github.com/mailru/easyjson/opt/gotemplate_Int.go deleted file mode 100644 index 469742fe..00000000 --- a/vendor/github.com/mailru/easyjson/opt/gotemplate_Int.go +++ /dev/null @@ -1,79 +0,0 @@ -// generated by gotemplate - -package opt - -import ( - "fmt" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// template type Optional(A) - -// A 'gotemplate'-based type for providing optional semantics without using pointers. -type Int struct { - V int - Defined bool -} - -// Creates an optional type with a given value. -func OInt(v int) Int { - return Int{V: v, Defined: true} -} - -// Get returns the value or given default in the case the value is undefined. -func (v Int) Get(deflt int) int { - if !v.Defined { - return deflt - } - return v.V -} - -// MarshalEasyJSON does JSON marshaling using easyjson interface. -func (v Int) MarshalEasyJSON(w *jwriter.Writer) { - if v.Defined { - w.Int(v.V) - } else { - w.RawString("null") - } -} - -// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. -func (v *Int) UnmarshalEasyJSON(l *jlexer.Lexer) { - if l.IsNull() { - l.Skip() - *v = Int{} - } else { - v.V = l.Int() - v.Defined = true - } -} - -// MarshalJSON implements a standard json marshaler interface. -func (v Int) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - v.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} - -// UnmarshalJSON implements a standard json unmarshaler interface. -func (v *Int) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - v.UnmarshalEasyJSON(&l) - return l.Error() -} - -// IsDefined returns whether the value is defined, a function is required so that it can -// be used in an interface. -func (v Int) IsDefined() bool { - return v.Defined -} - -// String implements a stringer interface using fmt.Sprint for the value. -func (v Int) String() string { - if !v.Defined { - return "" - } - return fmt.Sprint(v.V) -} diff --git a/vendor/github.com/mailru/easyjson/opt/gotemplate_Int16.go b/vendor/github.com/mailru/easyjson/opt/gotemplate_Int16.go deleted file mode 100644 index b7723e24..00000000 --- a/vendor/github.com/mailru/easyjson/opt/gotemplate_Int16.go +++ /dev/null @@ -1,79 +0,0 @@ -// generated by gotemplate - -package opt - -import ( - "fmt" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// template type Optional(A) - -// A 'gotemplate'-based type for providing optional semantics without using pointers. -type Int16 struct { - V int16 - Defined bool -} - -// Creates an optional type with a given value. -func OInt16(v int16) Int16 { - return Int16{V: v, Defined: true} -} - -// Get returns the value or given default in the case the value is undefined. -func (v Int16) Get(deflt int16) int16 { - if !v.Defined { - return deflt - } - return v.V -} - -// MarshalEasyJSON does JSON marshaling using easyjson interface. -func (v Int16) MarshalEasyJSON(w *jwriter.Writer) { - if v.Defined { - w.Int16(v.V) - } else { - w.RawString("null") - } -} - -// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. -func (v *Int16) UnmarshalEasyJSON(l *jlexer.Lexer) { - if l.IsNull() { - l.Skip() - *v = Int16{} - } else { - v.V = l.Int16() - v.Defined = true - } -} - -// MarshalJSON implements a standard json marshaler interface. -func (v Int16) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - v.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} - -// UnmarshalJSON implements a standard json unmarshaler interface. -func (v *Int16) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - v.UnmarshalEasyJSON(&l) - return l.Error() -} - -// IsDefined returns whether the value is defined, a function is required so that it can -// be used in an interface. -func (v Int16) IsDefined() bool { - return v.Defined -} - -// String implements a stringer interface using fmt.Sprint for the value. -func (v Int16) String() string { - if !v.Defined { - return "" - } - return fmt.Sprint(v.V) -} diff --git a/vendor/github.com/mailru/easyjson/opt/gotemplate_Int32.go b/vendor/github.com/mailru/easyjson/opt/gotemplate_Int32.go deleted file mode 100644 index 7c7637a3..00000000 --- a/vendor/github.com/mailru/easyjson/opt/gotemplate_Int32.go +++ /dev/null @@ -1,79 +0,0 @@ -// generated by gotemplate - -package opt - -import ( - "fmt" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// template type Optional(A) - -// A 'gotemplate'-based type for providing optional semantics without using pointers. -type Int32 struct { - V int32 - Defined bool -} - -// Creates an optional type with a given value. -func OInt32(v int32) Int32 { - return Int32{V: v, Defined: true} -} - -// Get returns the value or given default in the case the value is undefined. -func (v Int32) Get(deflt int32) int32 { - if !v.Defined { - return deflt - } - return v.V -} - -// MarshalEasyJSON does JSON marshaling using easyjson interface. -func (v Int32) MarshalEasyJSON(w *jwriter.Writer) { - if v.Defined { - w.Int32(v.V) - } else { - w.RawString("null") - } -} - -// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. -func (v *Int32) UnmarshalEasyJSON(l *jlexer.Lexer) { - if l.IsNull() { - l.Skip() - *v = Int32{} - } else { - v.V = l.Int32() - v.Defined = true - } -} - -// MarshalJSON implements a standard json marshaler interface. -func (v Int32) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - v.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} - -// UnmarshalJSON implements a standard json unmarshaler interface. -func (v *Int32) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - v.UnmarshalEasyJSON(&l) - return l.Error() -} - -// IsDefined returns whether the value is defined, a function is required so that it can -// be used in an interface. -func (v Int32) IsDefined() bool { - return v.Defined -} - -// String implements a stringer interface using fmt.Sprint for the value. -func (v Int32) String() string { - if !v.Defined { - return "" - } - return fmt.Sprint(v.V) -} diff --git a/vendor/github.com/mailru/easyjson/opt/gotemplate_Int64.go b/vendor/github.com/mailru/easyjson/opt/gotemplate_Int64.go deleted file mode 100644 index e6ea6dc4..00000000 --- a/vendor/github.com/mailru/easyjson/opt/gotemplate_Int64.go +++ /dev/null @@ -1,79 +0,0 @@ -// generated by gotemplate - -package opt - -import ( - "fmt" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// template type Optional(A) - -// A 'gotemplate'-based type for providing optional semantics without using pointers. -type Int64 struct { - V int64 - Defined bool -} - -// Creates an optional type with a given value. -func OInt64(v int64) Int64 { - return Int64{V: v, Defined: true} -} - -// Get returns the value or given default in the case the value is undefined. -func (v Int64) Get(deflt int64) int64 { - if !v.Defined { - return deflt - } - return v.V -} - -// MarshalEasyJSON does JSON marshaling using easyjson interface. -func (v Int64) MarshalEasyJSON(w *jwriter.Writer) { - if v.Defined { - w.Int64(v.V) - } else { - w.RawString("null") - } -} - -// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. -func (v *Int64) UnmarshalEasyJSON(l *jlexer.Lexer) { - if l.IsNull() { - l.Skip() - *v = Int64{} - } else { - v.V = l.Int64() - v.Defined = true - } -} - -// MarshalJSON implements a standard json marshaler interface. -func (v Int64) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - v.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} - -// UnmarshalJSON implements a standard json unmarshaler interface. -func (v *Int64) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - v.UnmarshalEasyJSON(&l) - return l.Error() -} - -// IsDefined returns whether the value is defined, a function is required so that it can -// be used in an interface. -func (v Int64) IsDefined() bool { - return v.Defined -} - -// String implements a stringer interface using fmt.Sprint for the value. -func (v Int64) String() string { - if !v.Defined { - return "" - } - return fmt.Sprint(v.V) -} diff --git a/vendor/github.com/mailru/easyjson/opt/gotemplate_Int8.go b/vendor/github.com/mailru/easyjson/opt/gotemplate_Int8.go deleted file mode 100644 index ddc66658..00000000 --- a/vendor/github.com/mailru/easyjson/opt/gotemplate_Int8.go +++ /dev/null @@ -1,79 +0,0 @@ -// generated by gotemplate - -package opt - -import ( - "fmt" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// template type Optional(A) - -// A 'gotemplate'-based type for providing optional semantics without using pointers. -type Int8 struct { - V int8 - Defined bool -} - -// Creates an optional type with a given value. -func OInt8(v int8) Int8 { - return Int8{V: v, Defined: true} -} - -// Get returns the value or given default in the case the value is undefined. -func (v Int8) Get(deflt int8) int8 { - if !v.Defined { - return deflt - } - return v.V -} - -// MarshalEasyJSON does JSON marshaling using easyjson interface. -func (v Int8) MarshalEasyJSON(w *jwriter.Writer) { - if v.Defined { - w.Int8(v.V) - } else { - w.RawString("null") - } -} - -// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. -func (v *Int8) UnmarshalEasyJSON(l *jlexer.Lexer) { - if l.IsNull() { - l.Skip() - *v = Int8{} - } else { - v.V = l.Int8() - v.Defined = true - } -} - -// MarshalJSON implements a standard json marshaler interface. -func (v Int8) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - v.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} - -// UnmarshalJSON implements a standard json unmarshaler interface. -func (v *Int8) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - v.UnmarshalEasyJSON(&l) - return l.Error() -} - -// IsDefined returns whether the value is defined, a function is required so that it can -// be used in an interface. -func (v Int8) IsDefined() bool { - return v.Defined -} - -// String implements a stringer interface using fmt.Sprint for the value. -func (v Int8) String() string { - if !v.Defined { - return "" - } - return fmt.Sprint(v.V) -} diff --git a/vendor/github.com/mailru/easyjson/opt/gotemplate_String.go b/vendor/github.com/mailru/easyjson/opt/gotemplate_String.go deleted file mode 100644 index 11c90b4e..00000000 --- a/vendor/github.com/mailru/easyjson/opt/gotemplate_String.go +++ /dev/null @@ -1,79 +0,0 @@ -// generated by gotemplate - -package opt - -import ( - "fmt" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// template type Optional(A) - -// A 'gotemplate'-based type for providing optional semantics without using pointers. -type String struct { - V string - Defined bool -} - -// Creates an optional type with a given value. -func OString(v string) String { - return String{V: v, Defined: true} -} - -// Get returns the value or given default in the case the value is undefined. -func (v String) Get(deflt string) string { - if !v.Defined { - return deflt - } - return v.V -} - -// MarshalEasyJSON does JSON marshaling using easyjson interface. -func (v String) MarshalEasyJSON(w *jwriter.Writer) { - if v.Defined { - w.String(v.V) - } else { - w.RawString("null") - } -} - -// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. -func (v *String) UnmarshalEasyJSON(l *jlexer.Lexer) { - if l.IsNull() { - l.Skip() - *v = String{} - } else { - v.V = l.String() - v.Defined = true - } -} - -// MarshalJSON implements a standard json marshaler interface. -func (v String) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - v.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} - -// UnmarshalJSON implements a standard json unmarshaler interface. -func (v *String) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - v.UnmarshalEasyJSON(&l) - return l.Error() -} - -// IsDefined returns whether the value is defined, a function is required so that it can -// be used in an interface. -func (v String) IsDefined() bool { - return v.Defined -} - -// String implements a stringer interface using fmt.Sprint for the value. -func (v String) String() string { - if !v.Defined { - return "" - } - return fmt.Sprint(v.V) -} diff --git a/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint.go b/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint.go deleted file mode 100644 index 57efd318..00000000 --- a/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint.go +++ /dev/null @@ -1,79 +0,0 @@ -// generated by gotemplate - -package opt - -import ( - "fmt" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// template type Optional(A) - -// A 'gotemplate'-based type for providing optional semantics without using pointers. -type Uint struct { - V uint - Defined bool -} - -// Creates an optional type with a given value. -func OUint(v uint) Uint { - return Uint{V: v, Defined: true} -} - -// Get returns the value or given default in the case the value is undefined. -func (v Uint) Get(deflt uint) uint { - if !v.Defined { - return deflt - } - return v.V -} - -// MarshalEasyJSON does JSON marshaling using easyjson interface. -func (v Uint) MarshalEasyJSON(w *jwriter.Writer) { - if v.Defined { - w.Uint(v.V) - } else { - w.RawString("null") - } -} - -// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. -func (v *Uint) UnmarshalEasyJSON(l *jlexer.Lexer) { - if l.IsNull() { - l.Skip() - *v = Uint{} - } else { - v.V = l.Uint() - v.Defined = true - } -} - -// MarshalJSON implements a standard json marshaler interface. -func (v Uint) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - v.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} - -// UnmarshalJSON implements a standard json unmarshaler interface. -func (v *Uint) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - v.UnmarshalEasyJSON(&l) - return l.Error() -} - -// IsDefined returns whether the value is defined, a function is required so that it can -// be used in an interface. -func (v Uint) IsDefined() bool { - return v.Defined -} - -// String implements a stringer interface using fmt.Sprint for the value. -func (v Uint) String() string { - if !v.Defined { - return "" - } - return fmt.Sprint(v.V) -} diff --git a/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint16.go b/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint16.go deleted file mode 100644 index f28e1d2e..00000000 --- a/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint16.go +++ /dev/null @@ -1,79 +0,0 @@ -// generated by gotemplate - -package opt - -import ( - "fmt" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// template type Optional(A) - -// A 'gotemplate'-based type for providing optional semantics without using pointers. -type Uint16 struct { - V uint16 - Defined bool -} - -// Creates an optional type with a given value. -func OUint16(v uint16) Uint16 { - return Uint16{V: v, Defined: true} -} - -// Get returns the value or given default in the case the value is undefined. -func (v Uint16) Get(deflt uint16) uint16 { - if !v.Defined { - return deflt - } - return v.V -} - -// MarshalEasyJSON does JSON marshaling using easyjson interface. -func (v Uint16) MarshalEasyJSON(w *jwriter.Writer) { - if v.Defined { - w.Uint16(v.V) - } else { - w.RawString("null") - } -} - -// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. -func (v *Uint16) UnmarshalEasyJSON(l *jlexer.Lexer) { - if l.IsNull() { - l.Skip() - *v = Uint16{} - } else { - v.V = l.Uint16() - v.Defined = true - } -} - -// MarshalJSON implements a standard json marshaler interface. -func (v Uint16) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - v.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} - -// UnmarshalJSON implements a standard json unmarshaler interface. -func (v *Uint16) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - v.UnmarshalEasyJSON(&l) - return l.Error() -} - -// IsDefined returns whether the value is defined, a function is required so that it can -// be used in an interface. -func (v Uint16) IsDefined() bool { - return v.Defined -} - -// String implements a stringer interface using fmt.Sprint for the value. -func (v Uint16) String() string { - if !v.Defined { - return "" - } - return fmt.Sprint(v.V) -} diff --git a/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint32.go b/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint32.go deleted file mode 100644 index 9fb95c0d..00000000 --- a/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint32.go +++ /dev/null @@ -1,79 +0,0 @@ -// generated by gotemplate - -package opt - -import ( - "fmt" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// template type Optional(A) - -// A 'gotemplate'-based type for providing optional semantics without using pointers. -type Uint32 struct { - V uint32 - Defined bool -} - -// Creates an optional type with a given value. -func OUint32(v uint32) Uint32 { - return Uint32{V: v, Defined: true} -} - -// Get returns the value or given default in the case the value is undefined. -func (v Uint32) Get(deflt uint32) uint32 { - if !v.Defined { - return deflt - } - return v.V -} - -// MarshalEasyJSON does JSON marshaling using easyjson interface. -func (v Uint32) MarshalEasyJSON(w *jwriter.Writer) { - if v.Defined { - w.Uint32(v.V) - } else { - w.RawString("null") - } -} - -// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. -func (v *Uint32) UnmarshalEasyJSON(l *jlexer.Lexer) { - if l.IsNull() { - l.Skip() - *v = Uint32{} - } else { - v.V = l.Uint32() - v.Defined = true - } -} - -// MarshalJSON implements a standard json marshaler interface. -func (v Uint32) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - v.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} - -// UnmarshalJSON implements a standard json unmarshaler interface. -func (v *Uint32) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - v.UnmarshalEasyJSON(&l) - return l.Error() -} - -// IsDefined returns whether the value is defined, a function is required so that it can -// be used in an interface. -func (v Uint32) IsDefined() bool { - return v.Defined -} - -// String implements a stringer interface using fmt.Sprint for the value. -func (v Uint32) String() string { - if !v.Defined { - return "" - } - return fmt.Sprint(v.V) -} diff --git a/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint64.go b/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint64.go deleted file mode 100644 index 0e623c62..00000000 --- a/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint64.go +++ /dev/null @@ -1,79 +0,0 @@ -// generated by gotemplate - -package opt - -import ( - "fmt" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// template type Optional(A) - -// A 'gotemplate'-based type for providing optional semantics without using pointers. -type Uint64 struct { - V uint64 - Defined bool -} - -// Creates an optional type with a given value. -func OUint64(v uint64) Uint64 { - return Uint64{V: v, Defined: true} -} - -// Get returns the value or given default in the case the value is undefined. -func (v Uint64) Get(deflt uint64) uint64 { - if !v.Defined { - return deflt - } - return v.V -} - -// MarshalEasyJSON does JSON marshaling using easyjson interface. -func (v Uint64) MarshalEasyJSON(w *jwriter.Writer) { - if v.Defined { - w.Uint64(v.V) - } else { - w.RawString("null") - } -} - -// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. -func (v *Uint64) UnmarshalEasyJSON(l *jlexer.Lexer) { - if l.IsNull() { - l.Skip() - *v = Uint64{} - } else { - v.V = l.Uint64() - v.Defined = true - } -} - -// MarshalJSON implements a standard json marshaler interface. -func (v Uint64) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - v.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} - -// UnmarshalJSON implements a standard json unmarshaler interface. -func (v *Uint64) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - v.UnmarshalEasyJSON(&l) - return l.Error() -} - -// IsDefined returns whether the value is defined, a function is required so that it can -// be used in an interface. -func (v Uint64) IsDefined() bool { - return v.Defined -} - -// String implements a stringer interface using fmt.Sprint for the value. -func (v Uint64) String() string { - if !v.Defined { - return "" - } - return fmt.Sprint(v.V) -} diff --git a/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint8.go b/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint8.go deleted file mode 100644 index c629e445..00000000 --- a/vendor/github.com/mailru/easyjson/opt/gotemplate_Uint8.go +++ /dev/null @@ -1,79 +0,0 @@ -// generated by gotemplate - -package opt - -import ( - "fmt" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// template type Optional(A) - -// A 'gotemplate'-based type for providing optional semantics without using pointers. -type Uint8 struct { - V uint8 - Defined bool -} - -// Creates an optional type with a given value. -func OUint8(v uint8) Uint8 { - return Uint8{V: v, Defined: true} -} - -// Get returns the value or given default in the case the value is undefined. -func (v Uint8) Get(deflt uint8) uint8 { - if !v.Defined { - return deflt - } - return v.V -} - -// MarshalEasyJSON does JSON marshaling using easyjson interface. -func (v Uint8) MarshalEasyJSON(w *jwriter.Writer) { - if v.Defined { - w.Uint8(v.V) - } else { - w.RawString("null") - } -} - -// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. -func (v *Uint8) UnmarshalEasyJSON(l *jlexer.Lexer) { - if l.IsNull() { - l.Skip() - *v = Uint8{} - } else { - v.V = l.Uint8() - v.Defined = true - } -} - -// MarshalJSON implements a standard json marshaler interface. -func (v Uint8) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - v.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} - -// UnmarshalJSON implements a standard json unmarshaler interface. -func (v *Uint8) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - v.UnmarshalEasyJSON(&l) - return l.Error() -} - -// IsDefined returns whether the value is defined, a function is required so that it can -// be used in an interface. -func (v Uint8) IsDefined() bool { - return v.Defined -} - -// String implements a stringer interface using fmt.Sprint for the value. -func (v Uint8) String() string { - if !v.Defined { - return "" - } - return fmt.Sprint(v.V) -} diff --git a/vendor/github.com/mailru/easyjson/opt/optional/opt.go b/vendor/github.com/mailru/easyjson/opt/optional/opt.go deleted file mode 100644 index 277dd1a3..00000000 --- a/vendor/github.com/mailru/easyjson/opt/optional/opt.go +++ /dev/null @@ -1,80 +0,0 @@ -// +build none - -package optional - -import ( - "fmt" - - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// template type Optional(A) -type A int - -// A 'gotemplate'-based type for providing optional semantics without using pointers. -type Optional struct { - V A - Defined bool -} - -// Creates an optional type with a given value. -func OOptional(v A) Optional { - return Optional{V: v, Defined: true} -} - -// Get returns the value or given default in the case the value is undefined. -func (v Optional) Get(deflt A) A { - if !v.Defined { - return deflt - } - return v.V -} - -// MarshalEasyJSON does JSON marshaling using easyjson interface. -func (v Optional) MarshalEasyJSON(w *jwriter.Writer) { - if v.Defined { - w.Optional(v.V) - } else { - w.RawString("null") - } -} - -// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. -func (v *Optional) UnmarshalEasyJSON(l *jlexer.Lexer) { - if l.IsNull() { - l.Skip() - *v = Optional{} - } else { - v.V = l.Optional() - v.Defined = true - } -} - -// MarshalJSON implements a standard json marshaler interface. -func (v Optional) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - v.MarshalEasyJSON(&w) - return w.Buffer.BuildBytes(), w.Error -} - -// UnmarshalJSON implements a standard json unmarshaler interface. -func (v *Optional) UnmarshalJSON(data []byte) error { - l := jlexer.Lexer{Data: data} - v.UnmarshalEasyJSON(&l) - return l.Error() -} - -// IsDefined returns whether the value is defined, a function is required so that it can -// be used in an interface. -func (v Optional) IsDefined() bool { - return v.Defined -} - -// String implements a stringer interface using fmt.Sprint for the value. -func (v Optional) String() string { - if !v.Defined { - return "" - } - return fmt.Sprint(v.V) -} diff --git a/vendor/github.com/mailru/easyjson/opt/opts.go b/vendor/github.com/mailru/easyjson/opt/opts.go deleted file mode 100644 index 3617f7f9..00000000 --- a/vendor/github.com/mailru/easyjson/opt/opts.go +++ /dev/null @@ -1,22 +0,0 @@ -package opt - -//go:generate sed -i "s/\\+build none/generated by gotemplate/" optional/opt.go -//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Int(int) -//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Uint(uint) - -//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Int8(int8) -//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Int16(int16) -//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Int32(int32) -//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Int64(int64) - -//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Uint8(uint8) -//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Uint16(uint16) -//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Uint32(uint32) -//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Uint64(uint64) - -//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Float32(float32) -//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Float64(float64) - -//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" Bool(bool) -//go:generate gotemplate "github.com/mailru/easyjson/opt/optional" String(string) -//go:generate sed -i "s/generated by gotemplate/+build none/" optional/opt.go diff --git a/vendor/github.com/mailru/easyjson/parser/parser.go b/vendor/github.com/mailru/easyjson/parser/parser.go deleted file mode 100644 index 3639ed06..00000000 --- a/vendor/github.com/mailru/easyjson/parser/parser.go +++ /dev/null @@ -1,98 +0,0 @@ -package parser - -import ( - "bytes" - "go/ast" - "go/parser" - "go/token" - "os/exec" - "strings" -) - -const structComment = "easyjson:json" - -type Parser struct { - PkgPath string - PkgName string - StructNames []string - AllStructs bool -} - -type visitor struct { - *Parser - - name string - explicit bool -} - -func (p *Parser) needType(comments string) bool { - for _, v := range strings.Split(comments, "\n") { - if strings.HasPrefix(v, structComment) { - return true - } - } - return false -} - -func (v *visitor) Visit(n ast.Node) (w ast.Visitor) { - switch n := n.(type) { - case *ast.Package: - return v - case *ast.File: - v.PkgName = n.Name.String() - return v - - case *ast.GenDecl: - v.explicit = v.needType(n.Doc.Text()) - - if !v.explicit && !v.AllStructs { - return nil - } - return v - case *ast.TypeSpec: - v.name = n.Name.String() - - // Allow to specify non-structs explicitly independent of '-all' flag. - if v.explicit { - v.StructNames = append(v.StructNames, v.name) - return nil - } - return v - case *ast.StructType: - v.StructNames = append(v.StructNames, v.name) - return nil - } - return nil -} - -func (p *Parser) Parse(fname string, isDir bool) error { - var err error - if p.PkgPath, err = getPkgPath(fname, isDir); err != nil { - return err - } - - fset := token.NewFileSet() - if isDir { - packages, err := parser.ParseDir(fset, fname, nil, parser.ParseComments) - if err != nil { - return err - } - - for _, pckg := range packages { - ast.Walk(&visitor{Parser: p}, pckg) - } - } else { - f, err := parser.ParseFile(fset, fname, nil, parser.ParseComments) - if err != nil { - return err - } - - ast.Walk(&visitor{Parser: p}, f) - } - return nil -} - -func getDefaultGoPath() (string, error) { - output, err := exec.Command("go", "env", "GOPATH").Output() - return string(bytes.TrimSpace(output)), err -} diff --git a/vendor/github.com/mailru/easyjson/parser/pkgpath.go b/vendor/github.com/mailru/easyjson/parser/pkgpath.go deleted file mode 100644 index 489b392d..00000000 --- a/vendor/github.com/mailru/easyjson/parser/pkgpath.go +++ /dev/null @@ -1,163 +0,0 @@ -package parser - -import ( - "bytes" - "fmt" - "io/ioutil" - "os" - "os/exec" - "path" - "path/filepath" - "strconv" - "strings" -) - -func getPkgPath(fname string, isDir bool) (string, error) { - if !filepath.IsAbs(fname) { - pwd, err := os.Getwd() - if err != nil { - return "", err - } - fname = filepath.Join(pwd, fname) - } - - goModPath, _ := goModPath(fname, isDir) - if strings.Contains(goModPath, "go.mod") { - pkgPath, err := getPkgPathFromGoMod(fname, isDir, goModPath) - if err != nil { - return "", err - } - - return pkgPath, nil - } - - return getPkgPathFromGOPATH(fname, isDir) -} - -var ( - goModPathCache = make(map[string]string) -) - -// empty if no go.mod, GO111MODULE=off or go without go modules support -func goModPath(fname string, isDir bool) (string, error) { - root := fname - if !isDir { - root = filepath.Dir(fname) - } - - goModPath, ok := goModPathCache[root] - if ok { - return goModPath, nil - } - - defer func() { - goModPathCache[root] = goModPath - }() - - cmd := exec.Command("go", "env", "GOMOD") - cmd.Dir = root - - stdout, err := cmd.Output() - if err != nil { - return "", err - } - - goModPath = string(bytes.TrimSpace(stdout)) - - return goModPath, nil -} - -func getPkgPathFromGoMod(fname string, isDir bool, goModPath string) (string, error) { - modulePath := getModulePath(goModPath) - if modulePath == "" { - return "", fmt.Errorf("cannot determine module path from %s", goModPath) - } - - rel := path.Join(modulePath, filePathToPackagePath(strings.TrimPrefix(fname, filepath.Dir(goModPath)))) - - if !isDir { - return path.Dir(rel), nil - } - - return path.Clean(rel), nil -} - -var ( - modulePrefix = []byte("\nmodule ") - pkgPathFromGoModCache = make(map[string]string) -) - -func getModulePath(goModPath string) string { - pkgPath, ok := pkgPathFromGoModCache[goModPath] - if ok { - return pkgPath - } - - defer func() { - pkgPathFromGoModCache[goModPath] = pkgPath - }() - - data, err := ioutil.ReadFile(goModPath) - if err != nil { - return "" - } - var i int - if bytes.HasPrefix(data, modulePrefix[1:]) { - i = 0 - } else { - i = bytes.Index(data, modulePrefix) - if i < 0 { - return "" - } - i++ - } - line := data[i:] - - // Cut line at \n, drop trailing \r if present. - if j := bytes.IndexByte(line, '\n'); j >= 0 { - line = line[:j] - } - if line[len(line)-1] == '\r' { - line = line[:len(line)-1] - } - line = line[len("module "):] - - // If quoted, unquote. - pkgPath = strings.TrimSpace(string(line)) - if pkgPath != "" && pkgPath[0] == '"' { - s, err := strconv.Unquote(pkgPath) - if err != nil { - return "" - } - pkgPath = s - } - return pkgPath -} - -func getPkgPathFromGOPATH(fname string, isDir bool) (string, error) { - gopath := os.Getenv("GOPATH") - if gopath == "" { - var err error - gopath, err = getDefaultGoPath() - if err != nil { - return "", fmt.Errorf("cannot determine GOPATH: %s", err) - } - } - - for _, p := range strings.Split(gopath, string(filepath.ListSeparator)) { - prefix := filepath.Join(p, "src") + string(filepath.Separator) - if rel := strings.TrimPrefix(fname, prefix); rel != fname { - if !isDir { - return path.Dir(filePathToPackagePath(rel)), nil - } else { - return path.Clean(filePathToPackagePath(rel)), nil - } - } - } - - return "", fmt.Errorf("file '%v' is not in GOPATH", fname) -} - -func filePathToPackagePath(path string) string { - return filepath.ToSlash(path) -} diff --git a/vendor/github.com/mailru/easyjson/raw.go b/vendor/github.com/mailru/easyjson/raw.go deleted file mode 100644 index 81bd002e..00000000 --- a/vendor/github.com/mailru/easyjson/raw.go +++ /dev/null @@ -1,45 +0,0 @@ -package easyjson - -import ( - "github.com/mailru/easyjson/jlexer" - "github.com/mailru/easyjson/jwriter" -) - -// RawMessage is a raw piece of JSON (number, string, bool, object, array or -// null) that is extracted without parsing and output as is during marshaling. -type RawMessage []byte - -// MarshalEasyJSON does JSON marshaling using easyjson interface. -func (v *RawMessage) MarshalEasyJSON(w *jwriter.Writer) { - if len(*v) == 0 { - w.RawString("null") - } else { - w.Raw(*v, nil) - } -} - -// UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. -func (v *RawMessage) UnmarshalEasyJSON(l *jlexer.Lexer) { - *v = RawMessage(l.Raw()) -} - -// UnmarshalJSON implements encoding/json.Unmarshaler interface. -func (v *RawMessage) UnmarshalJSON(data []byte) error { - *v = data - return nil -} - -var nullBytes = []byte("null") - -// MarshalJSON implements encoding/json.Marshaler interface. -func (v RawMessage) MarshalJSON() ([]byte, error) { - if len(v) == 0 { - return nullBytes, nil - } - return v, nil -} - -// IsDefined is required for integration with omitempty easyjson logic. -func (v *RawMessage) IsDefined() bool { - return len(*v) > 0 -} diff --git a/vendor/github.com/mailru/easyjson/tests/basic_test.go b/vendor/github.com/mailru/easyjson/tests/basic_test.go deleted file mode 100644 index 3b1cc657..00000000 --- a/vendor/github.com/mailru/easyjson/tests/basic_test.go +++ /dev/null @@ -1,244 +0,0 @@ -package tests - -import ( - "reflect" - "testing" - - "encoding/json" - - "github.com/mailru/easyjson" - "github.com/mailru/easyjson/jwriter" -) - -type testType interface { - json.Marshaler - json.Unmarshaler -} - -var testCases = []struct { - Decoded testType - Encoded string -}{ - {&primitiveTypesValue, primitiveTypesString}, - {&namedPrimitiveTypesValue, namedPrimitiveTypesString}, - {&structsValue, structsString}, - {&omitEmptyValue, omitEmptyString}, - {&snakeStructValue, snakeStructString}, - {&omitEmptyDefaultValue, omitEmptyDefaultString}, - {&optsValue, optsString}, - {&rawValue, rawString}, - {&stdMarshalerValue, stdMarshalerString}, - {&userMarshalerValue, userMarshalerString}, - {&unexportedStructValue, unexportedStructString}, - {&excludedFieldValue, excludedFieldString}, - {&sliceValue, sliceString}, - {&arrayValue, arrayString}, - {&mapsValue, mapsString}, - {&deepNestValue, deepNestString}, - {&IntsValue, IntsString}, - {&mapStringStringValue, mapStringStringString}, - {&namedTypeValue, namedTypeValueString}, - {&customMapKeyTypeValue, customMapKeyTypeValueString}, - {&embeddedTypeValue, embeddedTypeValueString}, - {&mapMyIntStringValue, mapMyIntStringValueString}, - {&mapIntStringValue, mapIntStringValueString}, - {&mapInt32StringValue, mapInt32StringValueString}, - {&mapInt64StringValue, mapInt64StringValueString}, - {&mapUintStringValue, mapUintStringValueString}, - {&mapUint32StringValue, mapUint32StringValueString}, - {&mapUint64StringValue, mapUint64StringValueString}, - {&mapUintptrStringValue, mapUintptrStringValueString}, - {&intKeyedMapStructValue, intKeyedMapStructValueString}, - {&intArrayStructValue, intArrayStructValueString}, - {&myUInt8SliceValue, myUInt8SliceString}, - {&myUInt8ArrayValue, myUInt8ArrayString}, -} - -func TestMarshal(t *testing.T) { - for i, test := range testCases { - data, err := test.Decoded.MarshalJSON() - if err != nil { - t.Errorf("[%d, %T] MarshalJSON() error: %v", i, test.Decoded, err) - } - - got := string(data) - if got != test.Encoded { - t.Errorf("[%d, %T] MarshalJSON(): got \n%v\n\t\t want \n%v", i, test.Decoded, got, test.Encoded) - } - } -} - -func TestUnmarshal(t *testing.T) { - for i, test := range testCases { - v1 := reflect.New(reflect.TypeOf(test.Decoded).Elem()).Interface() - v := v1.(testType) - - err := v.UnmarshalJSON([]byte(test.Encoded)) - if err != nil { - t.Errorf("[%d, %T] UnmarshalJSON() error: %v", i, test.Decoded, err) - } - - if !reflect.DeepEqual(v, test.Decoded) { - t.Errorf("[%d, %T] UnmarshalJSON(): got \n%+v\n\t\t want \n%+v", i, test.Decoded, v, test.Decoded) - } - } -} - -func TestRawMessageSTD(t *testing.T) { - type T struct { - F easyjson.RawMessage - Fnil easyjson.RawMessage - } - - val := T{F: easyjson.RawMessage([]byte(`"test"`))} - str := `{"F":"test","Fnil":null}` - - data, err := json.Marshal(val) - if err != nil { - t.Errorf("json.Marshal() error: %v", err) - } - got := string(data) - if got != str { - t.Errorf("json.Marshal() = %v; want %v", got, str) - } - - wantV := T{F: easyjson.RawMessage([]byte(`"test"`)), Fnil: easyjson.RawMessage([]byte("null"))} - var gotV T - - err = json.Unmarshal([]byte(str), &gotV) - if err != nil { - t.Errorf("json.Unmarshal() error: %v", err) - } - if !reflect.DeepEqual(gotV, wantV) { - t.Errorf("json.Unmarshal() = %v; want %v", gotV, wantV) - } -} - -func TestParseNull(t *testing.T) { - var got, want SubStruct - if err := easyjson.Unmarshal([]byte("null"), &got); err != nil { - t.Errorf("Unmarshal() error: %v", err) - } - - if !reflect.DeepEqual(got, want) { - t.Errorf("Unmarshal() = %+v; want %+v", got, want) - } -} - -var testSpecialCases = []struct { - EncodedString string - Value string -}{ - {`"Username \u003cuser@example.com\u003e"`, `Username `}, - {`"Username\ufffd"`, "Username\xc5"}, - {`"тестzтест"`, "тестzтест"}, - {`"тест\ufffdтест"`, "тест\xc5тест"}, - {`"绿茶"`, "绿茶"}, - {`"绿\ufffd茶"`, "绿\xc5茶"}, - {`"тест\u2028"`, "тест\xE2\x80\xA8"}, - {`"\\\r\n\t\""`, "\\\r\n\t\""}, - {`"ü"`, "ü"}, -} - -func TestSpecialCases(t *testing.T) { - for i, test := range testSpecialCases { - w := jwriter.Writer{} - w.String(test.Value) - got := string(w.Buffer.BuildBytes()) - if got != test.EncodedString { - t.Errorf("[%d] Encoded() = %+v; want %+v", i, got, test.EncodedString) - } - } -} - -func TestOverflowArray(t *testing.T) { - var a Arrays - err := easyjson.Unmarshal([]byte(arrayOverflowString), &a) - if err != nil { - t.Error(err) - } - if a != arrayValue { - t.Errorf("Unmarshal(%v) = %+v; want %+v", arrayOverflowString, a, arrayValue) - } -} - -func TestUnderflowArray(t *testing.T) { - var a Arrays - err := easyjson.Unmarshal([]byte(arrayUnderflowString), &a) - if err != nil { - t.Error(err) - } - if a != arrayUnderflowValue { - t.Errorf("Unmarshal(%v) = %+v; want %+v", arrayUnderflowString, a, arrayUnderflowValue) - } -} - -func TestEncodingFlags(t *testing.T) { - for i, test := range []struct { - Flags jwriter.Flags - In easyjson.Marshaler - Want string - }{ - {0, EncodingFlagsTestMap{}, `{"F":null}`}, - {0, EncodingFlagsTestSlice{}, `{"F":null}`}, - {jwriter.NilMapAsEmpty, EncodingFlagsTestMap{}, `{"F":{}}`}, - {jwriter.NilSliceAsEmpty, EncodingFlagsTestSlice{}, `{"F":[]}`}, - } { - w := &jwriter.Writer{Flags: test.Flags} - test.In.MarshalEasyJSON(w) - - data, err := w.BuildBytes() - if err != nil { - t.Errorf("[%v] easyjson.Marshal(%+v) error: %v", i, test.In, err) - } - - v := string(data) - if v != test.Want { - t.Errorf("[%v] easyjson.Marshal(%+v) = %v; want %v", i, test.In, v, test.Want) - } - } - -} - -func TestNestedEasyJsonMarshal(t *testing.T) { - n := map[string]*NestedEasyMarshaler{ - "Value": {}, - "Slice1": {}, - "Slice2": {}, - "Map1": {}, - "Map2": {}, - } - - ni := NestedInterfaces{ - Value: n["Value"], - Slice: []interface{}{n["Slice1"], n["Slice2"]}, - Map: map[string]interface{}{"1": n["Map1"], "2": n["Map2"]}, - } - easyjson.Marshal(ni) - - for k, v := range n { - if !v.EasilyMarshaled { - t.Errorf("Nested interface %s wasn't easily marshaled", k) - } - } -} - -func TestUnmarshalStructWithEmbeddedPtrStruct(t *testing.T) { - var s = StructWithInterface{Field2: &EmbeddedStruct{}} - var err error - err = easyjson.Unmarshal([]byte(structWithInterfaceString), &s) - if err != nil { - t.Errorf("easyjson.Unmarshal() error: %v", err) - } - if !reflect.DeepEqual(s, structWithInterfaceValueFilled) { - t.Errorf("easyjson.Unmarshal() = %#v; want %#v", s, structWithInterfaceValueFilled) - } -} - -func TestDisallowUnknown(t *testing.T) { - var d DisallowUnknown - err := easyjson.Unmarshal([]byte(disallowUnknownString), &d) - if err == nil { - t.Error("want error, got nil") - } -} diff --git a/vendor/github.com/mailru/easyjson/tests/custom_map_key_type.go b/vendor/github.com/mailru/easyjson/tests/custom_map_key_type.go deleted file mode 100644 index 099bd06d..00000000 --- a/vendor/github.com/mailru/easyjson/tests/custom_map_key_type.go +++ /dev/null @@ -1,29 +0,0 @@ -package tests - -import fmt "fmt" - -//easyjson:json -type CustomMapKeyType struct { - Map map[customKeyType]int -} - -type customKeyType [2]byte - -func (k customKeyType) MarshalJSON() ([]byte, error) { - return []byte(fmt.Sprintf(`"%02x"`, k)), nil -} - -func (k *customKeyType) UnmarshalJSON(b []byte) error { - _, err := fmt.Sscanf(string(b), `"%02x%02x"`, &k[0], &k[1]) - return err -} - -var customMapKeyTypeValue CustomMapKeyType - -func init() { - customMapKeyTypeValue.Map = map[customKeyType]int{ - customKeyType{0x01, 0x02}: 3, - } -} - -var customMapKeyTypeValueString = `{"Map":{"0102":3}}` diff --git a/vendor/github.com/mailru/easyjson/tests/data.go b/vendor/github.com/mailru/easyjson/tests/data.go deleted file mode 100644 index 6ae90a0d..00000000 --- a/vendor/github.com/mailru/easyjson/tests/data.go +++ /dev/null @@ -1,802 +0,0 @@ -package tests - -import ( - "fmt" - "math" - "net" - "time" - - "github.com/mailru/easyjson" - "github.com/mailru/easyjson/opt" -) - -type PrimitiveTypes struct { - String string - Bool bool - - Int int - Int8 int8 - Int16 int16 - Int32 int32 - Int64 int64 - - Uint uint - Uint8 uint8 - Uint16 uint16 - Uint32 uint32 - Uint64 uint64 - - IntString int `json:",string"` - Int8String int8 `json:",string"` - Int16String int16 `json:",string"` - Int32String int32 `json:",string"` - Int64String int64 `json:",string"` - - UintString uint `json:",string"` - Uint8String uint8 `json:",string"` - Uint16String uint16 `json:",string"` - Uint32String uint32 `json:",string"` - Uint64String uint64 `json:",string"` - - Float32 float32 - Float64 float64 - - Float32String float32 `json:",string"` - Float64String float64 `json:",string"` - - Ptr *string - PtrNil *string -} - -var str = "bla" - -var primitiveTypesValue = PrimitiveTypes{ - String: "test", Bool: true, - - Int: math.MinInt32, - Int8: math.MinInt8, - Int16: math.MinInt16, - Int32: math.MinInt32, - Int64: math.MinInt64, - - Uint: math.MaxUint32, - Uint8: math.MaxUint8, - Uint16: math.MaxUint16, - Uint32: math.MaxUint32, - Uint64: math.MaxUint64, - - IntString: math.MinInt32, - Int8String: math.MinInt8, - Int16String: math.MinInt16, - Int32String: math.MinInt32, - Int64String: math.MinInt64, - - UintString: math.MaxUint32, - Uint8String: math.MaxUint8, - Uint16String: math.MaxUint16, - Uint32String: math.MaxUint32, - Uint64String: math.MaxUint64, - - Float32: 1.5, - Float64: math.MaxFloat64, - - Float32String: 1.5, - Float64String: math.MaxFloat64, - - Ptr: &str, -} - -var primitiveTypesString = "{" + - `"String":"test","Bool":true,` + - - `"Int":` + fmt.Sprint(math.MinInt32) + `,` + - `"Int8":` + fmt.Sprint(math.MinInt8) + `,` + - `"Int16":` + fmt.Sprint(math.MinInt16) + `,` + - `"Int32":` + fmt.Sprint(math.MinInt32) + `,` + - `"Int64":` + fmt.Sprint(int64(math.MinInt64)) + `,` + - - `"Uint":` + fmt.Sprint(uint32(math.MaxUint32)) + `,` + - `"Uint8":` + fmt.Sprint(math.MaxUint8) + `,` + - `"Uint16":` + fmt.Sprint(math.MaxUint16) + `,` + - `"Uint32":` + fmt.Sprint(uint32(math.MaxUint32)) + `,` + - `"Uint64":` + fmt.Sprint(uint64(math.MaxUint64)) + `,` + - - `"IntString":"` + fmt.Sprint(math.MinInt32) + `",` + - `"Int8String":"` + fmt.Sprint(math.MinInt8) + `",` + - `"Int16String":"` + fmt.Sprint(math.MinInt16) + `",` + - `"Int32String":"` + fmt.Sprint(math.MinInt32) + `",` + - `"Int64String":"` + fmt.Sprint(int64(math.MinInt64)) + `",` + - - `"UintString":"` + fmt.Sprint(uint32(math.MaxUint32)) + `",` + - `"Uint8String":"` + fmt.Sprint(math.MaxUint8) + `",` + - `"Uint16String":"` + fmt.Sprint(math.MaxUint16) + `",` + - `"Uint32String":"` + fmt.Sprint(uint32(math.MaxUint32)) + `",` + - `"Uint64String":"` + fmt.Sprint(uint64(math.MaxUint64)) + `",` + - - `"Float32":` + fmt.Sprint(1.5) + `,` + - `"Float64":` + fmt.Sprint(math.MaxFloat64) + `,` + - - `"Float32String":"` + fmt.Sprint(1.5) + `",` + - `"Float64String":"` + fmt.Sprint(math.MaxFloat64) + `",` + - - `"Ptr":"bla",` + - `"PtrNil":null` + - - "}" - -type ( - NamedString string - NamedBool bool - - NamedInt int - NamedInt8 int8 - NamedInt16 int16 - NamedInt32 int32 - NamedInt64 int64 - - NamedUint uint - NamedUint8 uint8 - NamedUint16 uint16 - NamedUint32 uint32 - NamedUint64 uint64 - - NamedFloat32 float32 - NamedFloat64 float64 - - NamedStrPtr *string -) - -type NamedPrimitiveTypes struct { - String NamedString - Bool NamedBool - - Int NamedInt - Int8 NamedInt8 - Int16 NamedInt16 - Int32 NamedInt32 - Int64 NamedInt64 - - Uint NamedUint - Uint8 NamedUint8 - Uint16 NamedUint16 - Uint32 NamedUint32 - Uint64 NamedUint64 - - Float32 NamedFloat32 - Float64 NamedFloat64 - - Ptr NamedStrPtr - PtrNil NamedStrPtr -} - -var namedPrimitiveTypesValue = NamedPrimitiveTypes{ - String: "test", - Bool: true, - - Int: math.MinInt32, - Int8: math.MinInt8, - Int16: math.MinInt16, - Int32: math.MinInt32, - Int64: math.MinInt64, - - Uint: math.MaxUint32, - Uint8: math.MaxUint8, - Uint16: math.MaxUint16, - Uint32: math.MaxUint32, - Uint64: math.MaxUint64, - - Float32: 1.5, - Float64: math.MaxFloat64, - - Ptr: NamedStrPtr(&str), -} - -var namedPrimitiveTypesString = "{" + - `"String":"test",` + - `"Bool":true,` + - - `"Int":` + fmt.Sprint(math.MinInt32) + `,` + - `"Int8":` + fmt.Sprint(math.MinInt8) + `,` + - `"Int16":` + fmt.Sprint(math.MinInt16) + `,` + - `"Int32":` + fmt.Sprint(math.MinInt32) + `,` + - `"Int64":` + fmt.Sprint(int64(math.MinInt64)) + `,` + - - `"Uint":` + fmt.Sprint(uint32(math.MaxUint32)) + `,` + - `"Uint8":` + fmt.Sprint(math.MaxUint8) + `,` + - `"Uint16":` + fmt.Sprint(math.MaxUint16) + `,` + - `"Uint32":` + fmt.Sprint(uint32(math.MaxUint32)) + `,` + - `"Uint64":` + fmt.Sprint(uint64(math.MaxUint64)) + `,` + - - `"Float32":` + fmt.Sprint(1.5) + `,` + - `"Float64":` + fmt.Sprint(math.MaxFloat64) + `,` + - - `"Ptr":"bla",` + - `"PtrNil":null` + - "}" - -type SubStruct struct { - Value string - Value2 string - unexpored bool -} - -type SubP struct { - V string -} - -type SubStructAlias SubStruct - -type Structs struct { - SubStruct - *SubP - - Value2 int - - Sub1 SubStruct `json:"substruct"` - Sub2 *SubStruct - SubNil *SubStruct - - SubSlice []SubStruct - SubSliceNil []SubStruct - - SubPtrSlice []*SubStruct - SubPtrSliceNil []*SubStruct - - SubA1 SubStructAlias - SubA2 *SubStructAlias - - Anonymous struct { - V string - I int - } - Anonymous1 *struct { - V string - } - - AnonymousSlice []struct{ V int } - AnonymousPtrSlice []*struct{ V int } - - Slice []string - - unexported bool -} - -var structsValue = Structs{ - SubStruct: SubStruct{Value: "test"}, - SubP: &SubP{V: "subp"}, - - Value2: 5, - - Sub1: SubStruct{Value: "test1", Value2: "v"}, - Sub2: &SubStruct{Value: "test2", Value2: "v2"}, - - SubSlice: []SubStruct{ - {Value: "s1"}, - {Value: "s2"}, - }, - - SubPtrSlice: []*SubStruct{ - {Value: "p1"}, - {Value: "p2"}, - }, - - SubA1: SubStructAlias{Value: "test3", Value2: "v3"}, - SubA2: &SubStructAlias{Value: "test4", Value2: "v4"}, - - Anonymous: struct { - V string - I int - }{V: "bla", I: 5}, - - Anonymous1: &struct { - V string - }{V: "bla1"}, - - AnonymousSlice: []struct{ V int }{{1}, {2}}, - AnonymousPtrSlice: []*struct{ V int }{{3}, {4}}, - - Slice: []string{"test5", "test6"}, -} - -var structsString = "{" + - `"Value2":5,` + - - `"substruct":{"Value":"test1","Value2":"v"},` + - `"Sub2":{"Value":"test2","Value2":"v2"},` + - `"SubNil":null,` + - - `"SubSlice":[{"Value":"s1","Value2":""},{"Value":"s2","Value2":""}],` + - `"SubSliceNil":null,` + - - `"SubPtrSlice":[{"Value":"p1","Value2":""},{"Value":"p2","Value2":""}],` + - `"SubPtrSliceNil":null,` + - - `"SubA1":{"Value":"test3","Value2":"v3"},` + - `"SubA2":{"Value":"test4","Value2":"v4"},` + - - `"Anonymous":{"V":"bla","I":5},` + - `"Anonymous1":{"V":"bla1"},` + - - `"AnonymousSlice":[{"V":1},{"V":2}],` + - `"AnonymousPtrSlice":[{"V":3},{"V":4}],` + - - `"Slice":["test5","test6"],` + - - // Embedded fields go last. - `"V":"subp",` + - `"Value":"test"` + - "}" - -type OmitEmpty struct { - // NOTE: first field is empty to test comma printing. - - StrE, StrNE string `json:",omitempty"` - PtrE, PtrNE *string `json:",omitempty"` - - IntNE int `json:"intField,omitempty"` - IntE int `json:",omitempty"` - - // NOTE: omitempty has no effect on non-pointer struct fields. - SubE, SubNE SubStruct `json:",omitempty"` - SubPE, SubPNE *SubStruct `json:",omitempty"` -} - -var omitEmptyValue = OmitEmpty{ - StrNE: "str", - PtrNE: &str, - IntNE: 6, - SubNE: SubStruct{Value: "1", Value2: "2"}, - SubPNE: &SubStruct{Value: "3", Value2: "4"}, -} - -var omitEmptyString = "{" + - `"StrNE":"str",` + - `"PtrNE":"bla",` + - `"intField":6,` + - `"SubE":{"Value":"","Value2":""},` + - `"SubNE":{"Value":"1","Value2":"2"},` + - `"SubPNE":{"Value":"3","Value2":"4"}` + - "}" - -type Opts struct { - StrNull opt.String - StrEmpty opt.String - Str opt.String - StrOmitempty opt.String `json:",omitempty"` - - IntNull opt.Int - IntZero opt.Int - Int opt.Int -} - -var optsValue = Opts{ - StrEmpty: opt.OString(""), - Str: opt.OString("test"), - - IntZero: opt.OInt(0), - Int: opt.OInt(5), -} - -var optsString = `{` + - `"StrNull":null,` + - `"StrEmpty":"",` + - `"Str":"test",` + - `"IntNull":null,` + - `"IntZero":0,` + - `"Int":5` + - `}` - -type Raw struct { - Field easyjson.RawMessage - Field2 string -} - -var rawValue = Raw{ - Field: []byte(`{"a" : "b"}`), - Field2: "test", -} - -var rawString = `{` + - `"Field":{"a" : "b"},` + - `"Field2":"test"` + - `}` - -type StdMarshaler struct { - T time.Time - IP net.IP -} - -var stdMarshalerValue = StdMarshaler{ - T: time.Date(2016, 01, 02, 14, 15, 10, 0, time.UTC), - IP: net.IPv4(192, 168, 0, 1), -} -var stdMarshalerString = `{` + - `"T":"2016-01-02T14:15:10Z",` + - `"IP":"192.168.0.1"` + - `}` - -type UserMarshaler struct { - V vMarshaler - T tMarshaler -} - -type vMarshaler net.IP - -func (v vMarshaler) MarshalJSON() ([]byte, error) { - return []byte(`"0::0"`), nil -} - -func (v *vMarshaler) UnmarshalJSON([]byte) error { - *v = vMarshaler(net.IPv6zero) - return nil -} - -type tMarshaler net.IP - -func (v tMarshaler) MarshalText() ([]byte, error) { - return []byte(`[0::0]`), nil -} - -func (v *tMarshaler) UnmarshalText([]byte) error { - *v = tMarshaler(net.IPv6zero) - return nil -} - -var userMarshalerValue = UserMarshaler{ - V: vMarshaler(net.IPv6zero), - T: tMarshaler(net.IPv6zero), -} -var userMarshalerString = `{` + - `"V":"0::0",` + - `"T":"[0::0]"` + - `}` - -type unexportedStruct struct { - Value string -} - -var unexportedStructValue = unexportedStruct{"test"} -var unexportedStructString = `{"Value":"test"}` - -type ExcludedField struct { - Process bool `json:"process"` - DoNotProcess bool `json:"-"` - DoNotProcess1 bool `json:"-"` -} - -var excludedFieldValue = ExcludedField{ - Process: true, - DoNotProcess: false, - DoNotProcess1: false, -} -var excludedFieldString = `{"process":true}` - -type Slices struct { - ByteSlice []byte - EmptyByteSlice []byte - NilByteSlice []byte - IntSlice []int - EmptyIntSlice []int - NilIntSlice []int -} - -var sliceValue = Slices{ - ByteSlice: []byte("abc"), - EmptyByteSlice: []byte{}, - NilByteSlice: []byte(nil), - IntSlice: []int{1, 2, 3, 4, 5}, - EmptyIntSlice: []int{}, - NilIntSlice: []int(nil), -} - -var sliceString = `{` + - `"ByteSlice":"YWJj",` + - `"EmptyByteSlice":"",` + - `"NilByteSlice":null,` + - `"IntSlice":[1,2,3,4,5],` + - `"EmptyIntSlice":[],` + - `"NilIntSlice":null` + - `}` - -type Arrays struct { - ByteArray [3]byte - EmptyByteArray [0]byte - IntArray [5]int - EmptyIntArray [0]int -} - -var arrayValue = Arrays{ - ByteArray: [3]byte{'a', 'b', 'c'}, - EmptyByteArray: [0]byte{}, - IntArray: [5]int{1, 2, 3, 4, 5}, - EmptyIntArray: [0]int{}, -} - -var arrayString = `{` + - `"ByteArray":"YWJj",` + - `"EmptyByteArray":"",` + - `"IntArray":[1,2,3,4,5],` + - `"EmptyIntArray":[]` + - `}` - -var arrayOverflowString = `{` + - `"ByteArray":"YWJjbnNk",` + - `"EmptyByteArray":"YWJj",` + - `"IntArray":[1,2,3,4,5,6],` + - `"EmptyIntArray":[7,8]` + - `}` - -var arrayUnderflowValue = Arrays{ - ByteArray: [3]byte{'x', 0, 0}, - EmptyByteArray: [0]byte{}, - IntArray: [5]int{1, 2, 0, 0, 0}, - EmptyIntArray: [0]int{}, -} - -var arrayUnderflowString = `{` + - `"ByteArray":"eA==",` + - `"IntArray":[1,2]` + - `}` - -type Str string - -type Maps struct { - Map map[string]string - InterfaceMap map[string]interface{} - NilMap map[string]string - - CustomMap map[Str]Str -} - -var mapsValue = Maps{ - Map: map[string]string{"A": "b"}, // only one item since map iteration is randomized - InterfaceMap: map[string]interface{}{"G": float64(1)}, - - CustomMap: map[Str]Str{"c": "d"}, -} - -var mapsString = `{` + - `"Map":{"A":"b"},` + - `"InterfaceMap":{"G":1},` + - `"NilMap":null,` + - `"CustomMap":{"c":"d"}` + - `}` - -type NamedSlice []Str -type NamedMap map[Str]Str - -type DeepNest struct { - SliceMap map[Str][]Str - SliceMap1 map[Str][]Str - SliceMap2 map[Str][]Str - NamedSliceMap map[Str]NamedSlice - NamedMapMap map[Str]NamedMap - MapSlice []map[Str]Str - NamedSliceSlice []NamedSlice - NamedMapSlice []NamedMap - NamedStringSlice []NamedString -} - -var deepNestValue = DeepNest{ - SliceMap: map[Str][]Str{ - "testSliceMap": []Str{ - "0", - "1", - }, - }, - SliceMap1: map[Str][]Str{ - "testSliceMap1": []Str(nil), - }, - SliceMap2: map[Str][]Str{ - "testSliceMap2": []Str{}, - }, - NamedSliceMap: map[Str]NamedSlice{ - "testNamedSliceMap": NamedSlice{ - "2", - "3", - }, - }, - NamedMapMap: map[Str]NamedMap{ - "testNamedMapMap": NamedMap{ - "key1": "value1", - }, - }, - MapSlice: []map[Str]Str{ - map[Str]Str{ - "testMapSlice": "someValue", - }, - }, - NamedSliceSlice: []NamedSlice{ - NamedSlice{ - "someValue1", - "someValue2", - }, - NamedSlice{ - "someValue3", - "someValue4", - }, - }, - NamedMapSlice: []NamedMap{ - NamedMap{ - "key2": "value2", - }, - NamedMap{ - "key3": "value3", - }, - }, - NamedStringSlice: []NamedString{ - "value4", "value5", - }, -} - -var deepNestString = `{` + - `"SliceMap":{` + - `"testSliceMap":["0","1"]` + - `},` + - `"SliceMap1":{` + - `"testSliceMap1":null` + - `},` + - `"SliceMap2":{` + - `"testSliceMap2":[]` + - `},` + - `"NamedSliceMap":{` + - `"testNamedSliceMap":["2","3"]` + - `},` + - `"NamedMapMap":{` + - `"testNamedMapMap":{"key1":"value1"}` + - `},` + - `"MapSlice":[` + - `{"testMapSlice":"someValue"}` + - `],` + - `"NamedSliceSlice":[` + - `["someValue1","someValue2"],` + - `["someValue3","someValue4"]` + - `],` + - `"NamedMapSlice":[` + - `{"key2":"value2"},` + - `{"key3":"value3"}` + - `],` + - `"NamedStringSlice":["value4","value5"]` + - `}` - -//easyjson:json -type Ints []int - -var IntsValue = Ints{1, 2, 3, 4, 5} - -var IntsString = `[1,2,3,4,5]` - -//easyjson:json -type MapStringString map[string]string - -var mapStringStringValue = MapStringString{"a": "b"} - -var mapStringStringString = `{"a":"b"}` - -type RequiredOptionalStruct struct { - FirstName string `json:"first_name,required"` - Lastname string `json:"last_name"` -} - -//easyjson:json -type EncodingFlagsTestMap struct { - F map[string]string -} - -//easyjson:json -type EncodingFlagsTestSlice struct { - F []string -} - -type StructWithInterface struct { - Field1 int `json:"f1"` - Field2 interface{} `json:"f2"` - Field3 string `json:"f3"` -} - -type EmbeddedStruct struct { - Field1 int `json:"f1"` - Field2 string `json:"f2"` -} - -var structWithInterfaceString = `{"f1":1,"f2":{"f1":11,"f2":"22"},"f3":"3"}` -var structWithInterfaceValueFilled = StructWithInterface{1, &EmbeddedStruct{11, "22"}, "3"} - -//easyjson:json -type MapIntString map[int]string - -var mapIntStringValue = MapIntString{3: "hi"} -var mapIntStringValueString = `{"3":"hi"}` - -//easyjson:json -type MapInt32String map[int32]string - -var mapInt32StringValue = MapInt32String{-354634382: "life"} -var mapInt32StringValueString = `{"-354634382":"life"}` - -//easyjson:json -type MapInt64String map[int64]string - -var mapInt64StringValue = MapInt64String{-3546343826724305832: "life"} -var mapInt64StringValueString = `{"-3546343826724305832":"life"}` - -//easyjson:json -type MapUintString map[uint]string - -var mapUintStringValue = MapUintString{42: "life"} -var mapUintStringValueString = `{"42":"life"}` - -//easyjson:json -type MapUint32String map[uint32]string - -var mapUint32StringValue = MapUint32String{354634382: "life"} -var mapUint32StringValueString = `{"354634382":"life"}` - -//easyjson:json -type MapUint64String map[uint64]string - -var mapUint64StringValue = MapUint64String{3546343826724305832: "life"} -var mapUint64StringValueString = `{"3546343826724305832":"life"}` - -//easyjson:json -type MapUintptrString map[uintptr]string - -var mapUintptrStringValue = MapUintptrString{272679208: "obj"} -var mapUintptrStringValueString = `{"272679208":"obj"}` - -type MyInt int - -//easyjson:json -type MapMyIntString map[MyInt]string - -var mapMyIntStringValue = MapMyIntString{MyInt(42): "life"} -var mapMyIntStringValueString = `{"42":"life"}` - -//easyjson:json -type IntKeyedMapStruct struct { - Foo MapMyIntString `json:"foo"` - Bar map[int16]MapUint32String `json:"bar"` -} - -var intKeyedMapStructValue = IntKeyedMapStruct{ - Foo: mapMyIntStringValue, - Bar: map[int16]MapUint32String{32: mapUint32StringValue}, -} -var intKeyedMapStructValueString = `{` + - `"foo":{"42":"life"},` + - `"bar":{"32":{"354634382":"life"}}` + - `}` - -type IntArray [2]int - -//easyjson:json -type IntArrayStruct struct { - Pointer *IntArray `json:"pointer"` - Value IntArray `json:"value"` -} - -var intArrayStructValue = IntArrayStruct{ - Pointer: &IntArray{1, 2}, - Value: IntArray{1, 2}, -} - -var intArrayStructValueString = `{` + - `"pointer":[1,2],` + - `"value":[1,2]` + - `}` - -type MyUInt8 uint8 - -//easyjson:json -type MyUInt8Slice []MyUInt8 - -var myUInt8SliceValue = MyUInt8Slice{1, 2, 3, 4, 5} - -var myUInt8SliceString = `[1,2,3,4,5]` - -//easyjson:json -type MyUInt8Array [2]MyUInt8 - -var myUInt8ArrayValue = MyUInt8Array{1, 2} - -var myUInt8ArrayString = `[1,2]` diff --git a/vendor/github.com/mailru/easyjson/tests/disallow_unknown.go b/vendor/github.com/mailru/easyjson/tests/disallow_unknown.go deleted file mode 100644 index 5b884c64..00000000 --- a/vendor/github.com/mailru/easyjson/tests/disallow_unknown.go +++ /dev/null @@ -1,8 +0,0 @@ -package tests - -//easyjson:json -type DisallowUnknown struct { - FieldOne string `json:"field_one"` -} - -var disallowUnknownString = `{"field_one": "one", "field_two": "two"}` diff --git a/vendor/github.com/mailru/easyjson/tests/embedded_type.go b/vendor/github.com/mailru/easyjson/tests/embedded_type.go deleted file mode 100644 index 66470b6e..00000000 --- a/vendor/github.com/mailru/easyjson/tests/embedded_type.go +++ /dev/null @@ -1,24 +0,0 @@ -package tests - -//easyjson:json -type EmbeddedType struct { - EmbeddedInnerType - Inner struct { - EmbeddedInnerType - } - Field2 int -} - -type EmbeddedInnerType struct { - Field1 int -} - -var embeddedTypeValue EmbeddedType - -func init() { - embeddedTypeValue.Field1 = 1 - embeddedTypeValue.Field2 = 2 - embeddedTypeValue.Inner.Field1 = 3 -} - -var embeddedTypeValueString = `{"Inner":{"Field1":3},"Field2":2,"Field1":1}` diff --git a/vendor/github.com/mailru/easyjson/tests/errors.go b/vendor/github.com/mailru/easyjson/tests/errors.go deleted file mode 100644 index 14360fcc..00000000 --- a/vendor/github.com/mailru/easyjson/tests/errors.go +++ /dev/null @@ -1,26 +0,0 @@ -package tests - -//easyjson:json -type ErrorIntSlice []int - -//easyjson:json -type ErrorBoolSlice []bool - -//easyjson:json -type ErrorUintSlice []uint - -//easyjson:json -type ErrorStruct struct { - Int int `json:"int"` - String string `json:"string"` - Slice []int `json:"slice"` - IntSlice []int `json:"int_slice"` -} - -type ErrorNestedStruct struct { - ErrorStruct ErrorStruct `json:"error_struct"` - Int int `json:"int"` -} - -//easyjson:json -type ErrorIntMap map[uint32]string diff --git a/vendor/github.com/mailru/easyjson/tests/errors_test.go b/vendor/github.com/mailru/easyjson/tests/errors_test.go deleted file mode 100644 index 40fa3354..00000000 --- a/vendor/github.com/mailru/easyjson/tests/errors_test.go +++ /dev/null @@ -1,285 +0,0 @@ -package tests - -import ( - "testing" - - "github.com/mailru/easyjson/jlexer" -) - -func TestMultipleErrorsInt(t *testing.T) { - for i, test := range []struct { - Data []byte - Offsets []int - }{ - { - Data: []byte(`[1, 2, 3, "4", "5"]`), - Offsets: []int{10, 15}, - }, - { - Data: []byte(`[1, {"2":"3"}, 3, "4"]`), - Offsets: []int{4, 18}, - }, - { - Data: []byte(`[1, "2", "3", "4", "5", "6"]`), - Offsets: []int{4, 9, 14, 19, 24}, - }, - { - Data: []byte(`[1, 2, 3, 4, "5"]`), - Offsets: []int{13}, - }, - { - Data: []byte(`[{"1": "2"}]`), - Offsets: []int{1}, - }, - } { - l := jlexer.Lexer{ - Data: test.Data, - UseMultipleErrors: true, - } - - var v ErrorIntSlice - - v.UnmarshalEasyJSON(&l) - - errors := l.GetNonFatalErrors() - - if len(errors) != len(test.Offsets) { - t.Errorf("[%d] TestMultipleErrorsInt(): errornum: want: %d, got %d", i, len(test.Offsets), len(errors)) - return - } - - for ii, e := range errors { - if e.Offset != test.Offsets[ii] { - t.Errorf("[%d] TestMultipleErrorsInt(): offset[%d]: want %d, got %d", i, ii, test.Offsets[ii], e.Offset) - } - } - } -} - -func TestMultipleErrorsBool(t *testing.T) { - for i, test := range []struct { - Data []byte - Offsets []int - }{ - { - Data: []byte(`[true, false, true, false]`), - }, - { - Data: []byte(`["test", "value", "lol", "1"]`), - Offsets: []int{1, 9, 18, 25}, - }, - { - Data: []byte(`[true, 42, {"a":"b", "c":"d"}, false]`), - Offsets: []int{7, 11}, - }, - } { - l := jlexer.Lexer{ - Data: test.Data, - UseMultipleErrors: true, - } - - var v ErrorBoolSlice - v.UnmarshalEasyJSON(&l) - - errors := l.GetNonFatalErrors() - - if len(errors) != len(test.Offsets) { - t.Errorf("[%d] TestMultipleErrorsBool(): errornum: want: %d, got %d", i, len(test.Offsets), len(errors)) - return - } - for ii, e := range errors { - if e.Offset != test.Offsets[ii] { - t.Errorf("[%d] TestMultipleErrorsBool(): offset[%d]: want %d, got %d", i, ii, test.Offsets[ii], e.Offset) - } - } - } -} - -func TestMultipleErrorsUint(t *testing.T) { - for i, test := range []struct { - Data []byte - Offsets []int - }{ - { - Data: []byte(`[42, 42, 42]`), - }, - { - Data: []byte(`[17, "42", 32]`), - Offsets: []int{5}, - }, - { - Data: []byte(`["zz", "zz"]`), - Offsets: []int{1, 7}, - }, - { - Data: []byte(`[{}, 42]`), - Offsets: []int{1}, - }, - } { - l := jlexer.Lexer{ - Data: test.Data, - UseMultipleErrors: true, - } - - var v ErrorUintSlice - v.UnmarshalEasyJSON(&l) - - errors := l.GetNonFatalErrors() - - if len(errors) != len(test.Offsets) { - t.Errorf("[%d] TestMultipleErrorsUint(): errornum: want: %d, got %d", i, len(test.Offsets), len(errors)) - return - } - for ii, e := range errors { - if e.Offset != test.Offsets[ii] { - t.Errorf("[%d] TestMultipleErrorsUint(): offset[%d]: want %d, got %d", i, ii, test.Offsets[ii], e.Offset) - } - } - } -} - -func TestMultipleErrorsStruct(t *testing.T) { - for i, test := range []struct { - Data []byte - Offsets []int - }{ - { - Data: []byte(`{"string": "test", "slice":[42, 42, 42], "int_slice":[1, 2, 3]}`), - }, - { - Data: []byte(`{"string": {"test": "test"}, "slice":[42, 42, 42], "int_slice":["1", 2, 3]}`), - Offsets: []int{11, 64}, - }, - { - Data: []byte(`{"slice": [42, 42], "string": {"test": "test"}, "int_slice":["1", "2", 3]}`), - Offsets: []int{30, 61, 66}, - }, - { - Data: []byte(`{"string": "test", "slice": {}}`), - Offsets: []int{28}, - }, - { - Data: []byte(`{"slice":5, "string" : "test"}`), - Offsets: []int{9}, - }, - { - Data: []byte(`{"slice" : "test", "string" : "test"}`), - Offsets: []int{11}, - }, - { - Data: []byte(`{"slice": "", "string" : {}, "int":{}}`), - Offsets: []int{10, 25, 35}, - }, - } { - l := jlexer.Lexer{ - Data: test.Data, - UseMultipleErrors: true, - } - var v ErrorStruct - v.UnmarshalEasyJSON(&l) - - errors := l.GetNonFatalErrors() - - if len(errors) != len(test.Offsets) { - t.Errorf("[%d] TestMultipleErrorsStruct(): errornum: want: %d, got %d", i, len(test.Offsets), len(errors)) - return - } - for ii, e := range errors { - if e.Offset != test.Offsets[ii] { - t.Errorf("[%d] TestMultipleErrorsStruct(): offset[%d]: want %d, got %d", i, ii, test.Offsets[ii], e.Offset) - } - } - } -} - -func TestMultipleErrorsNestedStruct(t *testing.T) { - for i, test := range []struct { - Data []byte - Offsets []int - }{ - { - Data: []byte(`{"error_struct":{}}`), - }, - { - Data: []byte(`{"error_struct":5}`), - Offsets: []int{16}, - }, - { - Data: []byte(`{"error_struct":[]}`), - Offsets: []int{16}, - }, - { - Data: []byte(`{"error_struct":{"int":{}}}`), - Offsets: []int{23}, - }, - { - Data: []byte(`{"error_struct":{"int_slice":{}}, "int":4}`), - Offsets: []int{29}, - }, - { - Data: []byte(`{"error_struct":{"int_slice":["1", 2, "3"]}, "int":[]}`), - Offsets: []int{30, 38, 51}, - }, - } { - l := jlexer.Lexer{ - Data: test.Data, - UseMultipleErrors: true, - } - var v ErrorNestedStruct - v.UnmarshalEasyJSON(&l) - - errors := l.GetNonFatalErrors() - - if len(errors) != len(test.Offsets) { - t.Errorf("[%d] TestMultipleErrorsNestedStruct(): errornum: want: %d, got %d", i, len(test.Offsets), len(errors)) - return - } - for ii, e := range errors { - if e.Offset != test.Offsets[ii] { - t.Errorf("[%d] TestMultipleErrorsNestedStruct(): offset[%d]: want %d, got %d", i, ii, test.Offsets[ii], e.Offset) - } - } - } -} - -func TestMultipleErrorsIntMap(t *testing.T) { - for i, test := range []struct { - Data []byte - Offsets []int - }{ - { - Data: []byte(`{"a":"NumErr"}`), - Offsets: []int{1}, - }, - { - Data: []byte(`{"":"ErrSyntax"}`), - Offsets: []int{1}, - }, - { - Data: []byte(`{"a":"NumErr","33147483647":"ErrRange","-1":"ErrRange"}`), - Offsets: []int{1, 14, 39}, - }, - } { - l := jlexer.Lexer{ - Data: test.Data, - UseMultipleErrors: true, - } - - var v ErrorIntMap - - v.UnmarshalEasyJSON(&l) - - errors := l.GetNonFatalErrors() - - if len(errors) != len(test.Offsets) { - t.Errorf("[%d] TestMultipleErrorsInt(): errornum: want: %d, got %d", i, len(test.Offsets), len(errors)) - return - } - - for ii, e := range errors { - if e.Offset != test.Offsets[ii] { - t.Errorf("[%d] TestMultipleErrorsInt(): offset[%d]: want %d, got %d", i, ii, test.Offsets[ii], e.Offset) - } - } - } -} diff --git a/vendor/github.com/mailru/easyjson/tests/named_type.go b/vendor/github.com/mailru/easyjson/tests/named_type.go deleted file mode 100644 index 0ff8dfeb..00000000 --- a/vendor/github.com/mailru/easyjson/tests/named_type.go +++ /dev/null @@ -1,22 +0,0 @@ -package tests - -//easyjson:json -type NamedType struct { - Inner struct { - // easyjson is mistakenly naming the type of this field 'tests.MyString' in the generated output - // something about a named type inside an anonmymous type is triggering this bug - Field MyString `tag:"value"` - Field2 int "tag:\"value with ` in it\"" - } -} - -type MyString string - -var namedTypeValue NamedType - -func init() { - namedTypeValue.Inner.Field = "test" - namedTypeValue.Inner.Field2 = 123 -} - -var namedTypeValueString = `{"Inner":{"Field":"test","Field2":123}}` diff --git a/vendor/github.com/mailru/easyjson/tests/nested_easy.go b/vendor/github.com/mailru/easyjson/tests/nested_easy.go deleted file mode 100644 index 6309a49f..00000000 --- a/vendor/github.com/mailru/easyjson/tests/nested_easy.go +++ /dev/null @@ -1,25 +0,0 @@ -package tests - -import ( - "github.com/mailru/easyjson" - "github.com/mailru/easyjson/jwriter" -) - -//easyjson:json -type NestedInterfaces struct { - Value interface{} - Slice []interface{} - Map map[string]interface{} -} - -type NestedEasyMarshaler struct { - EasilyMarshaled bool -} - -var _ easyjson.Marshaler = &NestedEasyMarshaler{} - -func (i *NestedEasyMarshaler) MarshalEasyJSON(w *jwriter.Writer) { - // We use this method only to indicate that easyjson.Marshaler - // interface was really used while encoding. - i.EasilyMarshaled = true -} \ No newline at end of file diff --git a/vendor/github.com/mailru/easyjson/tests/nothing.go b/vendor/github.com/mailru/easyjson/tests/nothing.go deleted file mode 100644 index 35334f5f..00000000 --- a/vendor/github.com/mailru/easyjson/tests/nothing.go +++ /dev/null @@ -1,3 +0,0 @@ -package tests - -// No structs in this file diff --git a/vendor/github.com/mailru/easyjson/tests/omitempty.go b/vendor/github.com/mailru/easyjson/tests/omitempty.go deleted file mode 100644 index ede5eb95..00000000 --- a/vendor/github.com/mailru/easyjson/tests/omitempty.go +++ /dev/null @@ -1,12 +0,0 @@ -package tests - -//easyjson:json -type OmitEmptyDefault struct { - Field string - Str string - Str1 string `json:"s,!omitempty"` - Str2 string `json:",!omitempty"` -} - -var omitEmptyDefaultValue = OmitEmptyDefault{Field: "test"} -var omitEmptyDefaultString = `{"Field":"test","s":"","Str2":""}` diff --git a/vendor/github.com/mailru/easyjson/tests/opt_test.go b/vendor/github.com/mailru/easyjson/tests/opt_test.go deleted file mode 100644 index bdd32aa4..00000000 --- a/vendor/github.com/mailru/easyjson/tests/opt_test.go +++ /dev/null @@ -1,70 +0,0 @@ -package tests - -import ( - "math" - "reflect" - "testing" - - "encoding/json" - - "github.com/mailru/easyjson/opt" -) - -// This struct type must NOT have a generated marshaler -type OptsVanilla struct { - Int opt.Int - Uint opt.Uint - - Int8 opt.Int8 - Int16 opt.Int16 - Int32 opt.Int32 - Int64 opt.Int64 - - Uint8 opt.Uint8 - Uint16 opt.Uint16 - Uint32 opt.Uint32 - Uint64 opt.Uint64 - - Float32 opt.Float32 - Float64 opt.Float64 - - Bool opt.Bool - String opt.String -} - -var optsVanillaValue = OptsVanilla{ - Int: opt.OInt(-123), - Uint: opt.OUint(123), - - Int8: opt.OInt8(math.MaxInt8), - Int16: opt.OInt16(math.MaxInt16), - Int32: opt.OInt32(math.MaxInt32), - Int64: opt.OInt64(math.MaxInt64), - - Uint8: opt.OUint8(math.MaxUint8), - Uint16: opt.OUint16(math.MaxUint16), - Uint32: opt.OUint32(math.MaxUint32), - Uint64: opt.OUint64(math.MaxUint64), - - Float32: opt.OFloat32(math.MaxFloat32), - Float64: opt.OFloat64(math.MaxFloat64), - - Bool: opt.OBool(true), - String: opt.OString("foo"), -} - -func TestOptsVanilla(t *testing.T) { - data, err := json.Marshal(optsVanillaValue) - if err != nil { - t.Errorf("Failed to marshal vanilla opts: %v", err) - } - - var ov OptsVanilla - if err := json.Unmarshal(data, &ov); err != nil { - t.Errorf("Failed to unmarshal vanilla opts: %v", err) - } - - if !reflect.DeepEqual(optsVanillaValue, ov) { - t.Errorf("Vanilla opts unmarshal returned invalid value %+v, want %+v", ov, optsVanillaValue) - } -} diff --git a/vendor/github.com/mailru/easyjson/tests/required_test.go b/vendor/github.com/mailru/easyjson/tests/required_test.go deleted file mode 100644 index 8cc743d8..00000000 --- a/vendor/github.com/mailru/easyjson/tests/required_test.go +++ /dev/null @@ -1,28 +0,0 @@ -package tests - -import ( - "fmt" - "testing" -) - -func TestRequiredField(t *testing.T) { - cases := []struct{ json, errorMessage string }{ - {`{"first_name":"Foo", "last_name": "Bar"}`, ""}, - {`{"last_name":"Bar"}`, "key 'first_name' is required"}, - {"{}", "key 'first_name' is required"}, - } - - for _, tc := range cases { - var v RequiredOptionalStruct - err := v.UnmarshalJSON([]byte(tc.json)) - if tc.errorMessage == "" { - if err != nil { - t.Errorf("%s. UnmarshalJSON didn`t expect error: %v", tc.json, err) - } - } else { - if fmt.Sprintf("%v", err) != tc.errorMessage { - t.Errorf("%s. UnmarshalJSON expected error: %v. got: %v", tc.json, tc.errorMessage, err) - } - } - } -} diff --git a/vendor/github.com/mailru/easyjson/tests/snake.go b/vendor/github.com/mailru/easyjson/tests/snake.go deleted file mode 100644 index 9b64f861..00000000 --- a/vendor/github.com/mailru/easyjson/tests/snake.go +++ /dev/null @@ -1,10 +0,0 @@ -package tests - -//easyjson:json -type SnakeStruct struct { - WeirdHTTPStuff bool - CustomNamedField string `json:"cUsToM"` -} - -var snakeStructValue SnakeStruct -var snakeStructString = `{"weird_http_stuff":false,"cUsToM":""}` diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh index aa860fa2..955dd50f 100755 --- a/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -187,6 +187,7 @@ struct ltchars { #include #include #include +#include #include #include #include @@ -500,6 +501,7 @@ ccflags="$@" $2 ~ /^(HDIO|WIN|SMART)_/ || $2 !~ "WMESGLEN" && $2 ~ /^W[A-Z0-9]+$/ || + $2 ~/^PPPIOC/ || $2 ~ /^BLK[A-Z]*(GET$|SET$|BUF$|PART$|SIZE)/ {printf("\t%s = C.%s\n", $2, $2)} $2 ~ /^__WCOREFLAG$/ {next} $2 ~ /^__W[A-Z0-9]+$/ {printf("\t%s = C.%s\n", substr($2,3), $2)} diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go index 673152b9..db3c31ef 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go @@ -1293,6 +1293,36 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x40042406 PERF_EVENT_IOC_SET_OUTPUT = 0x2405 PIPEFS_MAGIC = 0x50495045 + PPPIOCATTACH = 0x4004743d + PPPIOCATTCHAN = 0x40047438 + PPPIOCCONNECT = 0x4004743a + PPPIOCDETACH = 0x4004743c + PPPIOCDISCONN = 0x7439 + PPPIOCGASYNCMAP = 0x80047458 + PPPIOCGCHAN = 0x80047437 + PPPIOCGDEBUG = 0x80047441 + PPPIOCGFLAGS = 0x8004745a + PPPIOCGIDLE = 0x8008743f + PPPIOCGL2TPSTATS = 0x80487436 + PPPIOCGMRU = 0x80047453 + PPPIOCGNPMODE = 0xc008744c + PPPIOCGRASYNCMAP = 0x80047455 + PPPIOCGUNIT = 0x80047456 + PPPIOCGXASYNCMAP = 0x80207450 + PPPIOCNEWUNIT = 0xc004743e + PPPIOCSACTIVE = 0x40087446 + PPPIOCSASYNCMAP = 0x40047457 + PPPIOCSCOMPRESS = 0x400c744d + PPPIOCSDEBUG = 0x40047440 + PPPIOCSFLAGS = 0x40047459 + PPPIOCSMAXCID = 0x40047451 + PPPIOCSMRRU = 0x4004743b + PPPIOCSMRU = 0x40047452 + PPPIOCSNPMODE = 0x4008744b + PPPIOCSPASS = 0x40087447 + PPPIOCSRASYNCMAP = 0x40047454 + PPPIOCSXASYNCMAP = 0x4020744f + PPPIOCXFERUNIT = 0x744e PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 @@ -1696,6 +1726,7 @@ const ( SCM_TIMESTAMPNS = 0x23 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SC_LOG_FLUSH = 0x100000 SECCOMP_MODE_DISABLED = 0x0 SECCOMP_MODE_FILTER = 0x2 SECCOMP_MODE_STRICT = 0x1 @@ -1751,6 +1782,9 @@ const ( SIOCGMIIPHY = 0x8947 SIOCGMIIREG = 0x8948 SIOCGPGRP = 0x8904 + SIOCGPPPCSTATS = 0x89f2 + SIOCGPPPSTATS = 0x89f0 + SIOCGPPPVER = 0x89f1 SIOCGRARP = 0x8961 SIOCGSKNS = 0x894c SIOCGSTAMP = 0x8906 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go index 5735bcf3..4785835b 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go @@ -1293,6 +1293,36 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x40082406 PERF_EVENT_IOC_SET_OUTPUT = 0x2405 PIPEFS_MAGIC = 0x50495045 + PPPIOCATTACH = 0x4004743d + PPPIOCATTCHAN = 0x40047438 + PPPIOCCONNECT = 0x4004743a + PPPIOCDETACH = 0x4004743c + PPPIOCDISCONN = 0x7439 + PPPIOCGASYNCMAP = 0x80047458 + PPPIOCGCHAN = 0x80047437 + PPPIOCGDEBUG = 0x80047441 + PPPIOCGFLAGS = 0x8004745a + PPPIOCGIDLE = 0x8010743f + PPPIOCGL2TPSTATS = 0x80487436 + PPPIOCGMRU = 0x80047453 + PPPIOCGNPMODE = 0xc008744c + PPPIOCGRASYNCMAP = 0x80047455 + PPPIOCGUNIT = 0x80047456 + PPPIOCGXASYNCMAP = 0x80207450 + PPPIOCNEWUNIT = 0xc004743e + PPPIOCSACTIVE = 0x40107446 + PPPIOCSASYNCMAP = 0x40047457 + PPPIOCSCOMPRESS = 0x4010744d + PPPIOCSDEBUG = 0x40047440 + PPPIOCSFLAGS = 0x40047459 + PPPIOCSMAXCID = 0x40047451 + PPPIOCSMRRU = 0x4004743b + PPPIOCSMRU = 0x40047452 + PPPIOCSNPMODE = 0x4008744b + PPPIOCSPASS = 0x40107447 + PPPIOCSRASYNCMAP = 0x40047454 + PPPIOCSXASYNCMAP = 0x4020744f + PPPIOCXFERUNIT = 0x744e PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 @@ -1697,6 +1727,7 @@ const ( SCM_TIMESTAMPNS = 0x23 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SC_LOG_FLUSH = 0x100000 SECCOMP_MODE_DISABLED = 0x0 SECCOMP_MODE_FILTER = 0x2 SECCOMP_MODE_STRICT = 0x1 @@ -1752,6 +1783,9 @@ const ( SIOCGMIIPHY = 0x8947 SIOCGMIIREG = 0x8948 SIOCGPGRP = 0x8904 + SIOCGPPPCSTATS = 0x89f2 + SIOCGPPPSTATS = 0x89f0 + SIOCGPPPVER = 0x89f1 SIOCGRARP = 0x8961 SIOCGSKNS = 0x894c SIOCGSTAMP = 0x8906 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go index d8e8442e..5e902423 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go @@ -1291,6 +1291,36 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x40042406 PERF_EVENT_IOC_SET_OUTPUT = 0x2405 PIPEFS_MAGIC = 0x50495045 + PPPIOCATTACH = 0x4004743d + PPPIOCATTCHAN = 0x40047438 + PPPIOCCONNECT = 0x4004743a + PPPIOCDETACH = 0x4004743c + PPPIOCDISCONN = 0x7439 + PPPIOCGASYNCMAP = 0x80047458 + PPPIOCGCHAN = 0x80047437 + PPPIOCGDEBUG = 0x80047441 + PPPIOCGFLAGS = 0x8004745a + PPPIOCGIDLE = 0x8008743f + PPPIOCGL2TPSTATS = 0x80487436 + PPPIOCGMRU = 0x80047453 + PPPIOCGNPMODE = 0xc008744c + PPPIOCGRASYNCMAP = 0x80047455 + PPPIOCGUNIT = 0x80047456 + PPPIOCGXASYNCMAP = 0x80207450 + PPPIOCNEWUNIT = 0xc004743e + PPPIOCSACTIVE = 0x40087446 + PPPIOCSASYNCMAP = 0x40047457 + PPPIOCSCOMPRESS = 0x400c744d + PPPIOCSDEBUG = 0x40047440 + PPPIOCSFLAGS = 0x40047459 + PPPIOCSMAXCID = 0x40047451 + PPPIOCSMRRU = 0x4004743b + PPPIOCSMRU = 0x40047452 + PPPIOCSNPMODE = 0x4008744b + PPPIOCSPASS = 0x40087447 + PPPIOCSRASYNCMAP = 0x40047454 + PPPIOCSXASYNCMAP = 0x4020744f + PPPIOCXFERUNIT = 0x744e PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 @@ -1703,6 +1733,7 @@ const ( SCM_TIMESTAMPNS = 0x23 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SC_LOG_FLUSH = 0x100000 SECCOMP_MODE_DISABLED = 0x0 SECCOMP_MODE_FILTER = 0x2 SECCOMP_MODE_STRICT = 0x1 @@ -1758,6 +1789,9 @@ const ( SIOCGMIIPHY = 0x8947 SIOCGMIIREG = 0x8948 SIOCGPGRP = 0x8904 + SIOCGPPPCSTATS = 0x89f2 + SIOCGPPPSTATS = 0x89f0 + SIOCGPPPVER = 0x89f1 SIOCGRARP = 0x8961 SIOCGSKNS = 0x894c SIOCGSTAMP = 0x8906 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go index 5d79b789..ebe9d8b4 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go @@ -1294,6 +1294,36 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x40082406 PERF_EVENT_IOC_SET_OUTPUT = 0x2405 PIPEFS_MAGIC = 0x50495045 + PPPIOCATTACH = 0x4004743d + PPPIOCATTCHAN = 0x40047438 + PPPIOCCONNECT = 0x4004743a + PPPIOCDETACH = 0x4004743c + PPPIOCDISCONN = 0x7439 + PPPIOCGASYNCMAP = 0x80047458 + PPPIOCGCHAN = 0x80047437 + PPPIOCGDEBUG = 0x80047441 + PPPIOCGFLAGS = 0x8004745a + PPPIOCGIDLE = 0x8010743f + PPPIOCGL2TPSTATS = 0x80487436 + PPPIOCGMRU = 0x80047453 + PPPIOCGNPMODE = 0xc008744c + PPPIOCGRASYNCMAP = 0x80047455 + PPPIOCGUNIT = 0x80047456 + PPPIOCGXASYNCMAP = 0x80207450 + PPPIOCNEWUNIT = 0xc004743e + PPPIOCSACTIVE = 0x40107446 + PPPIOCSASYNCMAP = 0x40047457 + PPPIOCSCOMPRESS = 0x4010744d + PPPIOCSDEBUG = 0x40047440 + PPPIOCSFLAGS = 0x40047459 + PPPIOCSMAXCID = 0x40047451 + PPPIOCSMRRU = 0x4004743b + PPPIOCSMRU = 0x40047452 + PPPIOCSNPMODE = 0x4008744b + PPPIOCSPASS = 0x40107447 + PPPIOCSRASYNCMAP = 0x40047454 + PPPIOCSXASYNCMAP = 0x4020744f + PPPIOCXFERUNIT = 0x744e PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 @@ -1687,6 +1717,7 @@ const ( SCM_TIMESTAMPNS = 0x23 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SC_LOG_FLUSH = 0x100000 SECCOMP_MODE_DISABLED = 0x0 SECCOMP_MODE_FILTER = 0x2 SECCOMP_MODE_STRICT = 0x1 @@ -1742,6 +1773,9 @@ const ( SIOCGMIIPHY = 0x8947 SIOCGMIIREG = 0x8948 SIOCGPGRP = 0x8904 + SIOCGPPPCSTATS = 0x89f2 + SIOCGPPPSTATS = 0x89f0 + SIOCGPPPVER = 0x89f1 SIOCGRARP = 0x8961 SIOCGSKNS = 0x894c SIOCGSTAMP = 0x8906 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go index 3c91615c..d467d211 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go @@ -1291,6 +1291,36 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x80042406 PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PIPEFS_MAGIC = 0x50495045 + PPPIOCATTACH = 0x8004743d + PPPIOCATTCHAN = 0x80047438 + PPPIOCCONNECT = 0x8004743a + PPPIOCDETACH = 0x8004743c + PPPIOCDISCONN = 0x20007439 + PPPIOCGASYNCMAP = 0x40047458 + PPPIOCGCHAN = 0x40047437 + PPPIOCGDEBUG = 0x40047441 + PPPIOCGFLAGS = 0x4004745a + PPPIOCGIDLE = 0x4008743f + PPPIOCGL2TPSTATS = 0x40487436 + PPPIOCGMRU = 0x40047453 + PPPIOCGNPMODE = 0xc008744c + PPPIOCGRASYNCMAP = 0x40047455 + PPPIOCGUNIT = 0x40047456 + PPPIOCGXASYNCMAP = 0x40207450 + PPPIOCNEWUNIT = 0xc004743e + PPPIOCSACTIVE = 0x80087446 + PPPIOCSASYNCMAP = 0x80047457 + PPPIOCSCOMPRESS = 0x800c744d + PPPIOCSDEBUG = 0x80047440 + PPPIOCSFLAGS = 0x80047459 + PPPIOCSMAXCID = 0x80047451 + PPPIOCSMRRU = 0x8004743b + PPPIOCSMRU = 0x80047452 + PPPIOCSNPMODE = 0x8008744b + PPPIOCSPASS = 0x80087447 + PPPIOCSRASYNCMAP = 0x80047454 + PPPIOCSXASYNCMAP = 0x8020744f + PPPIOCXFERUNIT = 0x2000744e PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 @@ -1696,6 +1726,7 @@ const ( SCM_TIMESTAMPNS = 0x23 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SC_LOG_FLUSH = 0x100000 SECCOMP_MODE_DISABLED = 0x0 SECCOMP_MODE_FILTER = 0x2 SECCOMP_MODE_STRICT = 0x1 @@ -1751,6 +1782,9 @@ const ( SIOCGMIIPHY = 0x8947 SIOCGMIIREG = 0x8948 SIOCGPGRP = 0x40047309 + SIOCGPPPCSTATS = 0x89f2 + SIOCGPPPSTATS = 0x89f0 + SIOCGPPPVER = 0x89f1 SIOCGRARP = 0x8961 SIOCGSKNS = 0x894c SIOCGSTAMP = 0x8906 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go index e1f86c1c..9c293ed1 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go @@ -1291,6 +1291,36 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x80082406 PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PIPEFS_MAGIC = 0x50495045 + PPPIOCATTACH = 0x8004743d + PPPIOCATTCHAN = 0x80047438 + PPPIOCCONNECT = 0x8004743a + PPPIOCDETACH = 0x8004743c + PPPIOCDISCONN = 0x20007439 + PPPIOCGASYNCMAP = 0x40047458 + PPPIOCGCHAN = 0x40047437 + PPPIOCGDEBUG = 0x40047441 + PPPIOCGFLAGS = 0x4004745a + PPPIOCGIDLE = 0x4010743f + PPPIOCGL2TPSTATS = 0x40487436 + PPPIOCGMRU = 0x40047453 + PPPIOCGNPMODE = 0xc008744c + PPPIOCGRASYNCMAP = 0x40047455 + PPPIOCGUNIT = 0x40047456 + PPPIOCGXASYNCMAP = 0x40207450 + PPPIOCNEWUNIT = 0xc004743e + PPPIOCSACTIVE = 0x80107446 + PPPIOCSASYNCMAP = 0x80047457 + PPPIOCSCOMPRESS = 0x8010744d + PPPIOCSDEBUG = 0x80047440 + PPPIOCSFLAGS = 0x80047459 + PPPIOCSMAXCID = 0x80047451 + PPPIOCSMRRU = 0x8004743b + PPPIOCSMRU = 0x80047452 + PPPIOCSNPMODE = 0x8008744b + PPPIOCSPASS = 0x80107447 + PPPIOCSRASYNCMAP = 0x80047454 + PPPIOCSXASYNCMAP = 0x8020744f + PPPIOCXFERUNIT = 0x2000744e PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 @@ -1696,6 +1726,7 @@ const ( SCM_TIMESTAMPNS = 0x23 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SC_LOG_FLUSH = 0x100000 SECCOMP_MODE_DISABLED = 0x0 SECCOMP_MODE_FILTER = 0x2 SECCOMP_MODE_STRICT = 0x1 @@ -1751,6 +1782,9 @@ const ( SIOCGMIIPHY = 0x8947 SIOCGMIIREG = 0x8948 SIOCGPGRP = 0x40047309 + SIOCGPPPCSTATS = 0x89f2 + SIOCGPPPSTATS = 0x89f0 + SIOCGPPPVER = 0x89f1 SIOCGRARP = 0x8961 SIOCGSKNS = 0x894c SIOCGSTAMP = 0x8906 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go index d09e3b68..e2162508 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go @@ -1291,6 +1291,36 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x80082406 PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PIPEFS_MAGIC = 0x50495045 + PPPIOCATTACH = 0x8004743d + PPPIOCATTCHAN = 0x80047438 + PPPIOCCONNECT = 0x8004743a + PPPIOCDETACH = 0x8004743c + PPPIOCDISCONN = 0x20007439 + PPPIOCGASYNCMAP = 0x40047458 + PPPIOCGCHAN = 0x40047437 + PPPIOCGDEBUG = 0x40047441 + PPPIOCGFLAGS = 0x4004745a + PPPIOCGIDLE = 0x4010743f + PPPIOCGL2TPSTATS = 0x40487436 + PPPIOCGMRU = 0x40047453 + PPPIOCGNPMODE = 0xc008744c + PPPIOCGRASYNCMAP = 0x40047455 + PPPIOCGUNIT = 0x40047456 + PPPIOCGXASYNCMAP = 0x40207450 + PPPIOCNEWUNIT = 0xc004743e + PPPIOCSACTIVE = 0x80107446 + PPPIOCSASYNCMAP = 0x80047457 + PPPIOCSCOMPRESS = 0x8010744d + PPPIOCSDEBUG = 0x80047440 + PPPIOCSFLAGS = 0x80047459 + PPPIOCSMAXCID = 0x80047451 + PPPIOCSMRRU = 0x8004743b + PPPIOCSMRU = 0x80047452 + PPPIOCSNPMODE = 0x8008744b + PPPIOCSPASS = 0x80107447 + PPPIOCSRASYNCMAP = 0x80047454 + PPPIOCSXASYNCMAP = 0x8020744f + PPPIOCXFERUNIT = 0x2000744e PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 @@ -1696,6 +1726,7 @@ const ( SCM_TIMESTAMPNS = 0x23 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SC_LOG_FLUSH = 0x100000 SECCOMP_MODE_DISABLED = 0x0 SECCOMP_MODE_FILTER = 0x2 SECCOMP_MODE_STRICT = 0x1 @@ -1751,6 +1782,9 @@ const ( SIOCGMIIPHY = 0x8947 SIOCGMIIREG = 0x8948 SIOCGPGRP = 0x40047309 + SIOCGPPPCSTATS = 0x89f2 + SIOCGPPPSTATS = 0x89f0 + SIOCGPPPVER = 0x89f1 SIOCGRARP = 0x8961 SIOCGSKNS = 0x894c SIOCGSTAMP = 0x8906 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go index f78108df..836c0c65 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go @@ -1291,6 +1291,36 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x80042406 PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PIPEFS_MAGIC = 0x50495045 + PPPIOCATTACH = 0x8004743d + PPPIOCATTCHAN = 0x80047438 + PPPIOCCONNECT = 0x8004743a + PPPIOCDETACH = 0x8004743c + PPPIOCDISCONN = 0x20007439 + PPPIOCGASYNCMAP = 0x40047458 + PPPIOCGCHAN = 0x40047437 + PPPIOCGDEBUG = 0x40047441 + PPPIOCGFLAGS = 0x4004745a + PPPIOCGIDLE = 0x4008743f + PPPIOCGL2TPSTATS = 0x40487436 + PPPIOCGMRU = 0x40047453 + PPPIOCGNPMODE = 0xc008744c + PPPIOCGRASYNCMAP = 0x40047455 + PPPIOCGUNIT = 0x40047456 + PPPIOCGXASYNCMAP = 0x40207450 + PPPIOCNEWUNIT = 0xc004743e + PPPIOCSACTIVE = 0x80087446 + PPPIOCSASYNCMAP = 0x80047457 + PPPIOCSCOMPRESS = 0x800c744d + PPPIOCSDEBUG = 0x80047440 + PPPIOCSFLAGS = 0x80047459 + PPPIOCSMAXCID = 0x80047451 + PPPIOCSMRRU = 0x8004743b + PPPIOCSMRU = 0x80047452 + PPPIOCSNPMODE = 0x8008744b + PPPIOCSPASS = 0x80087447 + PPPIOCSRASYNCMAP = 0x80047454 + PPPIOCSXASYNCMAP = 0x8020744f + PPPIOCXFERUNIT = 0x2000744e PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 @@ -1696,6 +1726,7 @@ const ( SCM_TIMESTAMPNS = 0x23 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SC_LOG_FLUSH = 0x100000 SECCOMP_MODE_DISABLED = 0x0 SECCOMP_MODE_FILTER = 0x2 SECCOMP_MODE_STRICT = 0x1 @@ -1751,6 +1782,9 @@ const ( SIOCGMIIPHY = 0x8947 SIOCGMIIREG = 0x8948 SIOCGPGRP = 0x40047309 + SIOCGPPPCSTATS = 0x89f2 + SIOCGPPPSTATS = 0x89f0 + SIOCGPPPVER = 0x89f1 SIOCGRARP = 0x8961 SIOCGSKNS = 0x894c SIOCGSTAMP = 0x8906 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go index 8da57a99..7ca61843 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go @@ -1292,6 +1292,36 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x80082406 PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PIPEFS_MAGIC = 0x50495045 + PPPIOCATTACH = 0x8004743d + PPPIOCATTCHAN = 0x80047438 + PPPIOCCONNECT = 0x8004743a + PPPIOCDETACH = 0x8004743c + PPPIOCDISCONN = 0x20007439 + PPPIOCGASYNCMAP = 0x40047458 + PPPIOCGCHAN = 0x40047437 + PPPIOCGDEBUG = 0x40047441 + PPPIOCGFLAGS = 0x4004745a + PPPIOCGIDLE = 0x4010743f + PPPIOCGL2TPSTATS = 0x40487436 + PPPIOCGMRU = 0x40047453 + PPPIOCGNPMODE = 0xc008744c + PPPIOCGRASYNCMAP = 0x40047455 + PPPIOCGUNIT = 0x40047456 + PPPIOCGXASYNCMAP = 0x40207450 + PPPIOCNEWUNIT = 0xc004743e + PPPIOCSACTIVE = 0x80107446 + PPPIOCSASYNCMAP = 0x80047457 + PPPIOCSCOMPRESS = 0x8010744d + PPPIOCSDEBUG = 0x80047440 + PPPIOCSFLAGS = 0x80047459 + PPPIOCSMAXCID = 0x80047451 + PPPIOCSMRRU = 0x8004743b + PPPIOCSMRU = 0x80047452 + PPPIOCSNPMODE = 0x8008744b + PPPIOCSPASS = 0x80107447 + PPPIOCSRASYNCMAP = 0x80047454 + PPPIOCSXASYNCMAP = 0x8020744f + PPPIOCXFERUNIT = 0x2000744e PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 @@ -1752,6 +1782,7 @@ const ( SCM_TIMESTAMPNS = 0x23 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SC_LOG_FLUSH = 0x100000 SECCOMP_MODE_DISABLED = 0x0 SECCOMP_MODE_FILTER = 0x2 SECCOMP_MODE_STRICT = 0x1 @@ -1807,6 +1838,9 @@ const ( SIOCGMIIPHY = 0x8947 SIOCGMIIREG = 0x8948 SIOCGPGRP = 0x8904 + SIOCGPPPCSTATS = 0x89f2 + SIOCGPPPSTATS = 0x89f0 + SIOCGPPPVER = 0x89f1 SIOCGRARP = 0x8961 SIOCGSKNS = 0x894c SIOCGSTAMP = 0x8906 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go index 1832c0a7..839ac214 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go @@ -1292,6 +1292,36 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x80082406 PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PIPEFS_MAGIC = 0x50495045 + PPPIOCATTACH = 0x8004743d + PPPIOCATTCHAN = 0x80047438 + PPPIOCCONNECT = 0x8004743a + PPPIOCDETACH = 0x8004743c + PPPIOCDISCONN = 0x20007439 + PPPIOCGASYNCMAP = 0x40047458 + PPPIOCGCHAN = 0x40047437 + PPPIOCGDEBUG = 0x40047441 + PPPIOCGFLAGS = 0x4004745a + PPPIOCGIDLE = 0x4010743f + PPPIOCGL2TPSTATS = 0x40487436 + PPPIOCGMRU = 0x40047453 + PPPIOCGNPMODE = 0xc008744c + PPPIOCGRASYNCMAP = 0x40047455 + PPPIOCGUNIT = 0x40047456 + PPPIOCGXASYNCMAP = 0x40207450 + PPPIOCNEWUNIT = 0xc004743e + PPPIOCSACTIVE = 0x80107446 + PPPIOCSASYNCMAP = 0x80047457 + PPPIOCSCOMPRESS = 0x8010744d + PPPIOCSDEBUG = 0x80047440 + PPPIOCSFLAGS = 0x80047459 + PPPIOCSMAXCID = 0x80047451 + PPPIOCSMRRU = 0x8004743b + PPPIOCSMRU = 0x80047452 + PPPIOCSNPMODE = 0x8008744b + PPPIOCSPASS = 0x80107447 + PPPIOCSRASYNCMAP = 0x80047454 + PPPIOCSXASYNCMAP = 0x8020744f + PPPIOCXFERUNIT = 0x2000744e PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 @@ -1752,6 +1782,7 @@ const ( SCM_TIMESTAMPNS = 0x23 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SC_LOG_FLUSH = 0x100000 SECCOMP_MODE_DISABLED = 0x0 SECCOMP_MODE_FILTER = 0x2 SECCOMP_MODE_STRICT = 0x1 @@ -1807,6 +1838,9 @@ const ( SIOCGMIIPHY = 0x8947 SIOCGMIIREG = 0x8948 SIOCGPGRP = 0x8904 + SIOCGPPPCSTATS = 0x89f2 + SIOCGPPPSTATS = 0x89f0 + SIOCGPPPVER = 0x89f1 SIOCGRARP = 0x8961 SIOCGSKNS = 0x894c SIOCGSTAMP = 0x8906 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go index c6bd4eff..a747aa1b 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go @@ -1291,6 +1291,36 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x40082406 PERF_EVENT_IOC_SET_OUTPUT = 0x2405 PIPEFS_MAGIC = 0x50495045 + PPPIOCATTACH = 0x4004743d + PPPIOCATTCHAN = 0x40047438 + PPPIOCCONNECT = 0x4004743a + PPPIOCDETACH = 0x4004743c + PPPIOCDISCONN = 0x7439 + PPPIOCGASYNCMAP = 0x80047458 + PPPIOCGCHAN = 0x80047437 + PPPIOCGDEBUG = 0x80047441 + PPPIOCGFLAGS = 0x8004745a + PPPIOCGIDLE = 0x8010743f + PPPIOCGL2TPSTATS = 0x80487436 + PPPIOCGMRU = 0x80047453 + PPPIOCGNPMODE = 0xc008744c + PPPIOCGRASYNCMAP = 0x80047455 + PPPIOCGUNIT = 0x80047456 + PPPIOCGXASYNCMAP = 0x80207450 + PPPIOCNEWUNIT = 0xc004743e + PPPIOCSACTIVE = 0x40107446 + PPPIOCSASYNCMAP = 0x40047457 + PPPIOCSCOMPRESS = 0x4010744d + PPPIOCSDEBUG = 0x40047440 + PPPIOCSFLAGS = 0x40047459 + PPPIOCSMAXCID = 0x40047451 + PPPIOCSMRRU = 0x4004743b + PPPIOCSMRU = 0x40047452 + PPPIOCSNPMODE = 0x4008744b + PPPIOCSPASS = 0x40107447 + PPPIOCSRASYNCMAP = 0x40047454 + PPPIOCSXASYNCMAP = 0x4020744f + PPPIOCXFERUNIT = 0x744e PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 @@ -1684,6 +1714,7 @@ const ( SCM_TIMESTAMPNS = 0x23 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SC_LOG_FLUSH = 0x100000 SECCOMP_MODE_DISABLED = 0x0 SECCOMP_MODE_FILTER = 0x2 SECCOMP_MODE_STRICT = 0x1 @@ -1739,6 +1770,9 @@ const ( SIOCGMIIPHY = 0x8947 SIOCGMIIREG = 0x8948 SIOCGPGRP = 0x8904 + SIOCGPPPCSTATS = 0x89f2 + SIOCGPPPSTATS = 0x89f0 + SIOCGPPPVER = 0x89f1 SIOCGRARP = 0x8961 SIOCGSKNS = 0x894c SIOCGSTAMP = 0x8906 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go index 8cdf353d..96aff508 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go @@ -1291,6 +1291,36 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x40082406 PERF_EVENT_IOC_SET_OUTPUT = 0x2405 PIPEFS_MAGIC = 0x50495045 + PPPIOCATTACH = 0x4004743d + PPPIOCATTCHAN = 0x40047438 + PPPIOCCONNECT = 0x4004743a + PPPIOCDETACH = 0x4004743c + PPPIOCDISCONN = 0x7439 + PPPIOCGASYNCMAP = 0x80047458 + PPPIOCGCHAN = 0x80047437 + PPPIOCGDEBUG = 0x80047441 + PPPIOCGFLAGS = 0x8004745a + PPPIOCGIDLE = 0x8010743f + PPPIOCGL2TPSTATS = 0x80487436 + PPPIOCGMRU = 0x80047453 + PPPIOCGNPMODE = 0xc008744c + PPPIOCGRASYNCMAP = 0x80047455 + PPPIOCGUNIT = 0x80047456 + PPPIOCGXASYNCMAP = 0x80207450 + PPPIOCNEWUNIT = 0xc004743e + PPPIOCSACTIVE = 0x40107446 + PPPIOCSASYNCMAP = 0x40047457 + PPPIOCSCOMPRESS = 0x4010744d + PPPIOCSDEBUG = 0x40047440 + PPPIOCSFLAGS = 0x40047459 + PPPIOCSMAXCID = 0x40047451 + PPPIOCSMRRU = 0x4004743b + PPPIOCSMRU = 0x40047452 + PPPIOCSNPMODE = 0x4008744b + PPPIOCSPASS = 0x40107447 + PPPIOCSRASYNCMAP = 0x40047454 + PPPIOCSXASYNCMAP = 0x4020744f + PPPIOCXFERUNIT = 0x744e PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 @@ -1757,6 +1787,7 @@ const ( SCM_TIMESTAMPNS = 0x23 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SC_LOG_FLUSH = 0x100000 SECCOMP_MODE_DISABLED = 0x0 SECCOMP_MODE_FILTER = 0x2 SECCOMP_MODE_STRICT = 0x1 @@ -1812,6 +1843,9 @@ const ( SIOCGMIIPHY = 0x8947 SIOCGMIIREG = 0x8948 SIOCGPGRP = 0x8904 + SIOCGPPPCSTATS = 0x89f2 + SIOCGPPPSTATS = 0x89f0 + SIOCGPPPVER = 0x89f1 SIOCGRARP = 0x8961 SIOCGSKNS = 0x894c SIOCGSTAMP = 0x8906 diff --git a/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/help.go b/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/help.go index 66aa6245..043b9789 100644 --- a/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/help.go +++ b/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/help.go @@ -18,7 +18,7 @@ string. It uses heuristics that do not guarantee all reports are genuine problems, but it can find errors not caught by the compilers. ` -// Help implements the help subcommand for a multichecker or vet-lite +// Help implements the help subcommand for a multichecker or unitchecker // style command. The optional args specify the analyzers to describe. // Help calls log.Fatal if no such analyzer exists. func Help(progname string, analyzers []*analysis.Analyzer, args []string) { diff --git a/vendor/golang.org/x/tools/go/analysis/passes/composite/composite.go b/vendor/golang.org/x/tools/go/analysis/passes/composite/composite.go index b7cfe8a9..9cca7781 100644 --- a/vendor/golang.org/x/tools/go/analysis/passes/composite/composite.go +++ b/vendor/golang.org/x/tools/go/analysis/passes/composite/composite.go @@ -16,7 +16,7 @@ import ( "golang.org/x/tools/go/ast/inspector" ) -const Doc = `checked for unkeyed composite literals +const Doc = `check for unkeyed composite literals This analyzer reports a diagnostic for composite literals of struct types imported from another package that do not use the field-keyed diff --git a/vendor/golang.org/x/tools/go/analysis/passes/lostcancel/lostcancel.go b/vendor/golang.org/x/tools/go/analysis/passes/lostcancel/lostcancel.go index 996ecc4d..b5161836 100644 --- a/vendor/golang.org/x/tools/go/analysis/passes/lostcancel/lostcancel.go +++ b/vendor/golang.org/x/tools/go/analysis/passes/lostcancel/lostcancel.go @@ -93,32 +93,32 @@ func runFunc(pass *analysis.Pass, node ast.Node) { // ctx, cancel = context.WithCancel(...) // var ctx, cancel = context.WithCancel(...) // - if isContextWithCancel(pass.TypesInfo, n) && isCall(stack[len(stack)-2]) { - var id *ast.Ident // id of cancel var - stmt := stack[len(stack)-3] - switch stmt := stmt.(type) { - case *ast.ValueSpec: - if len(stmt.Names) > 1 { - id = stmt.Names[1] - } - case *ast.AssignStmt: - if len(stmt.Lhs) > 1 { - id, _ = stmt.Lhs[1].(*ast.Ident) - } + if !isContextWithCancel(pass.TypesInfo, n) || !isCall(stack[len(stack)-2]) { + return true + } + var id *ast.Ident // id of cancel var + stmt := stack[len(stack)-3] + switch stmt := stmt.(type) { + case *ast.ValueSpec: + if len(stmt.Names) > 1 { + id = stmt.Names[1] } - if id != nil { - if id.Name == "_" { - pass.Reportf(id.Pos(), - "the cancel function returned by context.%s should be called, not discarded, to avoid a context leak", - n.(*ast.SelectorExpr).Sel.Name) - } else if v, ok := pass.TypesInfo.Uses[id].(*types.Var); ok { - cancelvars[v] = stmt - } else if v, ok := pass.TypesInfo.Defs[id].(*types.Var); ok { - cancelvars[v] = stmt - } + case *ast.AssignStmt: + if len(stmt.Lhs) > 1 { + id, _ = stmt.Lhs[1].(*ast.Ident) + } + } + if id != nil { + if id.Name == "_" { + pass.Reportf(id.Pos(), + "the cancel function returned by context.%s should be called, not discarded, to avoid a context leak", + n.(*ast.SelectorExpr).Sel.Name) + } else if v, ok := pass.TypesInfo.Uses[id].(*types.Var); ok { + cancelvars[v] = stmt + } else if v, ok := pass.TypesInfo.Defs[id].(*types.Var); ok { + cancelvars[v] = stmt } } - return true }) @@ -179,18 +179,22 @@ func hasImport(pkg *types.Package, path string) bool { // isContextWithCancel reports whether n is one of the qualified identifiers // context.With{Cancel,Timeout,Deadline}. func isContextWithCancel(info *types.Info, n ast.Node) bool { - if sel, ok := n.(*ast.SelectorExpr); ok { - switch sel.Sel.Name { - case "WithCancel", "WithTimeout", "WithDeadline": - if x, ok := sel.X.(*ast.Ident); ok { - if pkgname, ok := info.Uses[x].(*types.PkgName); ok { - return pkgname.Imported().Path() == contextPackage - } - // Import failed, so we can't check package path. - // Just check the local package name (heuristic). - return x.Name == "context" - } + sel, ok := n.(*ast.SelectorExpr) + if !ok { + return false + } + switch sel.Sel.Name { + case "WithCancel", "WithTimeout", "WithDeadline": + default: + return false + } + if x, ok := sel.X.(*ast.Ident); ok { + if pkgname, ok := info.Uses[x].(*types.PkgName); ok { + return pkgname.Imported().Path() == contextPackage } + // Import failed, so we can't check package path. + // Just check the local package name (heuristic). + return x.Name == "context" } return false } @@ -270,29 +274,30 @@ outer: var search func(blocks []*cfg.Block) *ast.ReturnStmt search = func(blocks []*cfg.Block) *ast.ReturnStmt { for _, b := range blocks { - if !seen[b] { - seen[b] = true + if seen[b] { + continue + } + seen[b] = true - // Prune the search if the block uses v. - if blockUses(pass, v, b) { - continue - } + // Prune the search if the block uses v. + if blockUses(pass, v, b) { + continue + } - // Found path to return statement? - if ret := b.Return(); ret != nil { - if debug { - fmt.Printf("found path to return in block %s\n", b) - } - return ret // found + // Found path to return statement? + if ret := b.Return(); ret != nil { + if debug { + fmt.Printf("found path to return in block %s\n", b) } + return ret // found + } - // Recur - if ret := search(b.Succs); ret != nil { - if debug { - fmt.Printf(" from block %s\n", b) - } - return ret + // Recur + if ret := search(b.Succs); ret != nil { + if debug { + fmt.Printf(" from block %s\n", b) } + return ret } } return nil diff --git a/vendor/golang.org/x/tools/go/analysis/passes/stdmethods/stdmethods.go b/vendor/golang.org/x/tools/go/analysis/passes/stdmethods/stdmethods.go index b61c3220..83495112 100644 --- a/vendor/golang.org/x/tools/go/analysis/passes/stdmethods/stdmethods.go +++ b/vendor/golang.org/x/tools/go/analysis/passes/stdmethods/stdmethods.go @@ -131,7 +131,7 @@ func canonicalMethod(pass *analysis.Pass, id *ast.Ident) { expectFmt += " (" + argjoin(expect.results) + ")" } - actual := types.TypeString(sign, (*types.Package).Name) + actual := typeString(sign) actual = strings.TrimPrefix(actual, "func") actual = id.Name + actual @@ -139,6 +139,10 @@ func canonicalMethod(pass *analysis.Pass, id *ast.Ident) { } } +func typeString(typ types.Type) string { + return types.TypeString(typ, (*types.Package).Name) +} + func argjoin(x []string) string { y := make([]string, len(x)) for i, s := range x { @@ -178,5 +182,5 @@ func matchParamType(fset *token.FileSet, pkg *types.Package, expect string, actu } // Overkill but easy. - return actual.String() == expect + return typeString(actual) == expect } diff --git a/vendor/golang.org/x/tools/go/analysis/passes/stdmethods/testdata/src/a/a.go b/vendor/golang.org/x/tools/go/analysis/passes/stdmethods/testdata/src/a/a.go index 9833f8fd..de240a3b 100644 --- a/vendor/golang.org/x/tools/go/analysis/passes/stdmethods/testdata/src/a/a.go +++ b/vendor/golang.org/x/tools/go/analysis/passes/stdmethods/testdata/src/a/a.go @@ -24,6 +24,10 @@ func (U) GobDecode() {} // want `should have signature GobDecode\(\[\]byte\) err // Test rendering of type names such as xml.Encoder in diagnostic. func (U) MarshalXML(*xml.Encoder) {} // want `method MarshalXML\(\*xml.Encoder\) should...` +func (U) UnmarshalXML(*xml.Decoder, xml.StartElement) error { // no error: signature matches xml.Unmarshaler + return nil +} + type I interface { ReadByte() byte // want `should have signature ReadByte\(\) \(byte, error\)` } diff --git a/vendor/golang.org/x/tools/go/analysis/passes/unsafeptr/unsafeptr.go b/vendor/golang.org/x/tools/go/analysis/passes/unsafeptr/unsafeptr.go index 116d622b..308bfc69 100644 --- a/vendor/golang.org/x/tools/go/analysis/passes/unsafeptr/unsafeptr.go +++ b/vendor/golang.org/x/tools/go/analysis/passes/unsafeptr/unsafeptr.go @@ -62,28 +62,28 @@ func isSafeUintptr(info *types.Info, x ast.Expr) bool { return isSafeUintptr(info, x.X) case *ast.SelectorExpr: - switch x.Sel.Name { - case "Data": - // reflect.SliceHeader and reflect.StringHeader are okay, - // but only if they are pointing at a real slice or string. - // It's not okay to do: - // var x SliceHeader - // x.Data = uintptr(unsafe.Pointer(...)) - // ... use x ... - // p := unsafe.Pointer(x.Data) - // because in the middle the garbage collector doesn't - // see x.Data as a pointer and so x.Data may be dangling - // by the time we get to the conversion at the end. - // For now approximate by saying that *Header is okay - // but Header is not. - pt, ok := info.Types[x.X].Type.(*types.Pointer) - if ok { - t, ok := pt.Elem().(*types.Named) - if ok && t.Obj().Pkg().Path() == "reflect" { - switch t.Obj().Name() { - case "StringHeader", "SliceHeader": - return true - } + if x.Sel.Name != "Data" { + break + } + // reflect.SliceHeader and reflect.StringHeader are okay, + // but only if they are pointing at a real slice or string. + // It's not okay to do: + // var x SliceHeader + // x.Data = uintptr(unsafe.Pointer(...)) + // ... use x ... + // p := unsafe.Pointer(x.Data) + // because in the middle the garbage collector doesn't + // see x.Data as a pointer and so x.Data may be dangling + // by the time we get to the conversion at the end. + // For now approximate by saying that *Header is okay + // but Header is not. + pt, ok := info.Types[x.X].Type.(*types.Pointer) + if ok { + t, ok := pt.Elem().(*types.Named) + if ok && t.Obj().Pkg().Path() == "reflect" { + switch t.Obj().Name() { + case "StringHeader", "SliceHeader": + return true } } } diff --git a/vendor/golang.org/x/tools/go/analysis/cmd/vet-lite/main.go b/vendor/golang.org/x/tools/go/analysis/unitchecker/main.go similarity index 64% rename from vendor/golang.org/x/tools/go/analysis/cmd/vet-lite/main.go rename to vendor/golang.org/x/tools/go/analysis/unitchecker/main.go index 259d3976..844e8f3d 100644 --- a/vendor/golang.org/x/tools/go/analysis/cmd/vet-lite/main.go +++ b/vendor/golang.org/x/tools/go/analysis/unitchecker/main.go @@ -1,7 +1,12 @@ -// The vet-lite command is a driver for static checkers conforming to -// the golang.org/x/tools/go/analysis API. It must be run by go vet: +// +build ignore + +// This file provides an example command for static checkers +// conforming to the golang.org/x/tools/go/analysis API. +// It serves as a model for the behavior of the cmd/vet tool in $GOROOT. +// Being based on the unitchecker driver, it must be run by go vet: // -// $ go vet -vettool=$(which vet-lite) +// $ go build -o unitchecker main.go +// $ go vet -vettool=unitchecker my/project/... // // For a checker also capable of running standalone, use multichecker. package main @@ -32,21 +37,6 @@ import ( "golang.org/x/tools/go/analysis/passes/unusedresult" ) -// Legacy vet had the concept of "experimental" checkers. There -// was exactly one, shadow, and it had to be explicitly enabled -// by the -shadow flag, which would of course disable all the -// other tristate flags, requiring the -all flag to reenable them. -// (By itself, -all did not enable all checkers.) -// The -all flag is no longer needed, so it is a no-op. -// -// The shadow analyzer has been removed from the suite, -// but can be run using these additional commands: -// $ go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow -// $ go vet -vettool=$(which shadow) -// Alternatively, one could build a multichecker containing all -// the desired checks (vet's suite + shadow) and run it in a -// single "go vet" command. - func main() { unitchecker.Main( asmdecl.Analyzer, diff --git a/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go b/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go index 7b8fec9d..59489f92 100644 --- a/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go +++ b/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go @@ -95,7 +95,7 @@ func Main(analyzers ...*analysis.Analyzer) { Usage of %[1]s: %.16[1]s unit.cfg # execute analysis specified by config file - %.16[1]s help # general help + %.16[1]s help # general help %.16[1]s help name # help on specific analyzer and its flags `, progname) os.Exit(1) diff --git a/vendor/golang.org/x/tools/go/packages/packagestest/expect.go b/vendor/golang.org/x/tools/go/packages/packagestest/expect.go index 960f1151..69d30629 100644 --- a/vendor/golang.org/x/tools/go/packages/packagestest/expect.go +++ b/vendor/golang.org/x/tools/go/packages/packagestest/expect.go @@ -164,6 +164,7 @@ var ( posType = reflect.TypeOf(token.Pos(0)) positionType = reflect.TypeOf(token.Position{}) rangeType = reflect.TypeOf(Range{}) + fsetType = reflect.TypeOf((*token.FileSet)(nil)) ) // converter converts from a marker's argument parsed from the comment to @@ -190,6 +191,10 @@ func (e *Exported) buildConverter(pt reflect.Type) (converter, error) { return func(n *expect.Note, args []interface{}) (reflect.Value, []interface{}, error) { return reflect.ValueOf(n), args, nil }, nil + case pt == fsetType: + return func(n *expect.Note, args []interface{}) (reflect.Value, []interface{}, error) { + return reflect.ValueOf(e.fset), args, nil + }, nil case pt == posType: return func(n *expect.Note, args []interface{}) (reflect.Value, []interface{}, error) { r, remains, err := e.rangeConverter(n, args) diff --git a/vendor/golang.org/x/tools/go/packages/packagestest/export.go b/vendor/golang.org/x/tools/go/packages/packagestest/export.go index cb290fdd..4f2b3272 100644 --- a/vendor/golang.org/x/tools/go/packages/packagestest/export.go +++ b/vendor/golang.org/x/tools/go/packages/packagestest/export.go @@ -103,7 +103,7 @@ func TestAll(t *testing.T, f func(*testing.T, Exporter)) { // The file deletion in the cleanup can be skipped by setting the skip-cleanup // flag when invoking the test, allowing the temporary directory to be left for // debugging tests. -func Export(t *testing.T, exporter Exporter, modules []Module) *Exported { +func Export(t testing.TB, exporter Exporter, modules []Module) *Exported { t.Helper() dirname := strings.Replace(t.Name(), "/", "_", -1) dirname = strings.Replace(dirname, "#", "_", -1) // duplicate subtests get a #NNN suffix. diff --git a/vendor/golang.org/x/tools/go/ssa/source_test.go b/vendor/golang.org/x/tools/go/ssa/source_test.go index d543c1b1..e3e70233 100644 --- a/vendor/golang.org/x/tools/go/ssa/source_test.go +++ b/vendor/golang.org/x/tools/go/ssa/source_test.go @@ -20,6 +20,7 @@ import ( "testing" "golang.org/x/tools/go/ast/astutil" + "golang.org/x/tools/go/expect" "golang.org/x/tools/go/loader" "golang.org/x/tools/go/ssa" "golang.org/x/tools/go/ssa/ssautil" @@ -232,37 +233,41 @@ func testValueForExpr(t *testing.T, testfile string) { } } - // Find the actual AST node for each canonical position. - parenExprByPos := make(map[token.Pos]*ast.ParenExpr) + var parenExprs []*ast.ParenExpr ast.Inspect(f, func(n ast.Node) bool { if n != nil { if e, ok := n.(*ast.ParenExpr); ok { - parenExprByPos[e.Pos()] = e + parenExprs = append(parenExprs, e) } } return true }) - // Find all annotations of form /*@kind*/. - for _, c := range f.Comments { - text := strings.TrimSpace(c.Text()) - if text == "" || text[0] != '@' { - continue + notes, err := expect.Extract(prog.Fset, f) + if err != nil { + t.Fatal(err) + } + for _, n := range notes { + want := n.Name + if want == "nil" { + want = "" } - text = text[1:] - pos := c.End() + 1 - position := prog.Fset.Position(pos) + position := prog.Fset.Position(n.Pos) var e ast.Expr - if target := parenExprByPos[pos]; target == nil { - t.Errorf("%s: annotation doesn't precede ParenExpr: %q", position, text) + for _, paren := range parenExprs { + if paren.Pos() > n.Pos { + e = paren.X + break + } + } + if e == nil { + t.Errorf("%s: note doesn't precede ParenExpr: %q", position, want) continue - } else { - e = target.X } - path, _ := astutil.PathEnclosingInterval(f, pos, pos) + path, _ := astutil.PathEnclosingInterval(f, n.Pos, n.Pos) if path == nil { - t.Errorf("%s: can't find AST path from root to comment: %s", position, text) + t.Errorf("%s: can't find AST path from root to comment: %s", position, want) continue } @@ -274,7 +279,7 @@ func testValueForExpr(t *testing.T, testfile string) { v, gotAddr := fn.ValueForExpr(e) // (may be nil) got := strings.TrimPrefix(fmt.Sprintf("%T", v), "*ssa.") - if want := text; got != want { + if got != want { t.Errorf("%s: got value %q, want %q", position, got, want) } if v != nil { diff --git a/vendor/golang.org/x/tools/go/ssa/testdata/valueforexpr.go b/vendor/golang.org/x/tools/go/ssa/testdata/valueforexpr.go index 4a2cb85a..fe65b94f 100644 --- a/vendor/golang.org/x/tools/go/ssa/testdata/valueforexpr.go +++ b/vendor/golang.org/x/tools/go/ssa/testdata/valueforexpr.go @@ -10,12 +10,13 @@ package main func f(spilled, unspilled int) { _ = /*@UnOp*/ (spilled) _ = /*@Parameter*/ (unspilled) - _ = /*@*/ (1 + 2) // (constant) + _ = /*@nil*/ (1 + 2) // (constant) i := 0 f := func() (int, int) { return 0, 0 } - /*@Call*/ (print( /*@BinOp*/ (i + 1))) + /*@Call*/ + (print( /*@BinOp*/ (i + 1))) _, _ = /*@Call*/ (f()) ch := /*@MakeChan*/ (make(chan int)) /*@UnOp*/ (<-ch) @@ -43,7 +44,7 @@ func f(spilled, unspilled int) { sl := []int{} _ = /*@Slice*/ (sl[:0]) - _ = /*@*/ (new(int)) // optimized away + _ = /*@nil*/ (new(int)) // optimized away tmp := /*@Alloc*/ (new(int)) _ = tmp var iface interface{} @@ -88,7 +89,7 @@ func complit() { _, _, _ = sl1, sl2, sl3 _ = /*@Slice*/ ([]int{}) - _ = /*@*/ (& /*@Slice*/ ([]int{})) // & optimized away + _ = /*@nil*/ (& /*@Slice*/ ([]int{})) // & optimized away _ = & /*@Slice*/ ([]int{}) // 2. Arrays @@ -117,7 +118,7 @@ func complit() { _, _, _ = m1, m2, m3 _ = /*@MakeMap*/ (M{}) - _ = /*@*/ (& /*@MakeMap*/ (M{})) // & optimized away + _ = /*@nil*/ (& /*@MakeMap*/ (M{})) // & optimized away _ = & /*@MakeMap*/ (M{}) // 4. Structs diff --git a/vendor/golang.org/x/tools/internal/lsp/lsp_test.go b/vendor/golang.org/x/tools/internal/lsp/lsp_test.go index 418da422..2b3710bc 100644 --- a/vendor/golang.org/x/tools/internal/lsp/lsp_test.go +++ b/vendor/golang.org/x/tools/internal/lsp/lsp_test.go @@ -7,6 +7,7 @@ package lsp import ( "bytes" "context" + "fmt" "go/token" "os/exec" "path/filepath" @@ -27,6 +28,10 @@ func TestLSP(t *testing.T) { func testLSP(t *testing.T, exporter packagestest.Exporter) { const dir = "testdata" + const expectedCompletionsCount = 4 + const expectedDiagnosticsCount = 9 + const expectedFormatCount = 3 + const expectedDefinitionsCount = 16 files := packagestest.MustCopyFileTree(dir) for fragment, operation := range files { @@ -47,9 +52,11 @@ func testLSP(t *testing.T, exporter packagestest.Exporter) { dirs := make(map[string]bool) // collect results for certain tests - expectedDiagnostics := make(map[string][]protocol.Diagnostic) - expectedCompletions := make(map[token.Position]*protocol.CompletionItem) - expectedFormat := make(map[string]string) + expectedDiagnostics := make(diagnostics) + completionItems := make(completionItems) + expectedCompletions := make(completions) + expectedFormat := make(formats) + expectedDefinitions := make(definitions) s := &server{ view: source.NewView(), @@ -80,70 +87,86 @@ func testLSP(t *testing.T, exporter packagestest.Exporter) { } // Collect any data that needs to be used by subsequent tests. if err := exported.Expect(map[string]interface{}{ - "diag": func(pos token.Position, msg string) { - collectDiagnostics(t, expectedDiagnostics, pos, msg) - }, - "item": func(pos token.Position, label, detail, kind string) { - collectCompletionItems(expectedCompletions, pos, label, detail, kind) - }, - "format": func(pos token.Position) { - collectFormat(expectedFormat, pos) - }, + "diag": expectedDiagnostics.collect, + "item": completionItems.collect, + "complete": expectedCompletions.collect, + "format": expectedFormat.collect, + "godef": expectedDefinitions.collect, }); err != nil { t.Fatal(err) } - // test completion - testCompletion(t, exported, s, expectedCompletions) + t.Run("Completion", func(t *testing.T) { + t.Helper() + if len(expectedCompletions) != expectedCompletionsCount { + t.Errorf("got %v completions expected %v", len(expectedCompletions), expectedCompletionsCount) + } + expectedCompletions.test(t, exported, s, completionItems) + }) - // test diagnostics - var dirList []string - for dir := range dirs { - dirList = append(dirList, dir) - } - exported.Config.Mode = packages.LoadFiles - pkgs, err := packages.Load(exported.Config, dirList...) - if err != nil { - t.Fatal(err) - } - testDiagnostics(t, s.view, pkgs, expectedDiagnostics) + t.Run("Diagnostics", func(t *testing.T) { + t.Helper() + diagnosticsCount := expectedDiagnostics.test(t, exported, s.view, dirs) + if diagnosticsCount != expectedDiagnosticsCount { + t.Errorf("got %v diagnostics expected %v", diagnosticsCount, expectedDiagnosticsCount) + } + }) - // test format - testFormat(t, s, expectedFormat) + t.Run("Format", func(t *testing.T) { + t.Helper() + if len(expectedFormat) != expectedFormatCount { + t.Errorf("got %v formats expected %v", len(expectedFormat), expectedFormatCount) + } + expectedFormat.test(t, s) + }) + + t.Run("Definitions", func(t *testing.T) { + t.Helper() + if len(expectedDefinitions) != expectedDefinitionsCount { + t.Errorf("got %v definitions expected %v", len(expectedDefinitions), expectedDefinitionsCount) + } + expectedDefinitions.test(t, s) + }) } -func testCompletion(t *testing.T, exported *packagestest.Exported, s *server, wants map[token.Position]*protocol.CompletionItem) { - if err := exported.Expect(map[string]interface{}{ - "complete": func(src token.Position, expected []token.Position) { - var want []protocol.CompletionItem - for _, pos := range expected { - want = append(want, *wants[pos]) - } - list, err := s.Completion(context.Background(), &protocol.CompletionParams{ - TextDocumentPositionParams: protocol.TextDocumentPositionParams{ - TextDocument: protocol.TextDocumentIdentifier{ - URI: protocol.DocumentURI(source.ToURI(src.Filename)), - }, - Position: protocol.Position{ - Line: float64(src.Line - 1), - Character: float64(src.Column - 1), - }, +type diagnostics map[string][]protocol.Diagnostic +type completionItems map[token.Pos]*protocol.CompletionItem +type completions map[token.Position][]token.Pos +type formats map[string]string +type definitions map[protocol.Location]protocol.Location + +func (c completions) test(t *testing.T, exported *packagestest.Exported, s *server, items completionItems) { + for src, itemList := range c { + var want []protocol.CompletionItem + for _, pos := range itemList { + want = append(want, *items[pos]) + } + list, err := s.Completion(context.Background(), &protocol.CompletionParams{ + TextDocumentPositionParams: protocol.TextDocumentPositionParams{ + TextDocument: protocol.TextDocumentIdentifier{ + URI: protocol.DocumentURI(source.ToURI(src.Filename)), }, - }) - if err != nil { - t.Fatal(err) - } - got := list.Items - if equal := reflect.DeepEqual(want, got); !equal { - t.Errorf("completion failed for %s:%v:%v: (expected: %v), (got: %v)", filepath.Base(src.Filename), src.Line, src.Column, want, got) - } - }, - }); err != nil { - t.Fatal(err) + Position: protocol.Position{ + Line: float64(src.Line - 1), + Character: float64(src.Column - 1), + }, + }, + }) + if err != nil { + t.Fatal(err) + } + got := list.Items + if equal := reflect.DeepEqual(want, got); !equal { + t.Errorf("completion failed for %s:%v:%v: (expected: %v), (got: %v)", filepath.Base(src.Filename), src.Line, src.Column, want, got) + } } } -func collectCompletionItems(expectedCompletions map[token.Position]*protocol.CompletionItem, pos token.Position, label, detail, kind string) { +func (c completions) collect(src token.Position, expected []token.Pos) { + c[src] = expected +} + +func (i completionItems) collect(pos token.Pos, label, detail, kind string) { var k protocol.CompletionItemKind switch kind { case "struct": @@ -163,14 +186,26 @@ func collectCompletionItems(expectedCompletions map[token.Position]*protocol.Com case "method": k = protocol.MethodCompletion } - expectedCompletions[pos] = &protocol.CompletionItem{ + i[pos] = &protocol.CompletionItem{ Label: label, Detail: detail, Kind: float64(k), } } -func testDiagnostics(t *testing.T, v *source.View, pkgs []*packages.Package, wants map[string][]protocol.Diagnostic) { +func (d diagnostics) test(t *testing.T, exported *packagestest.Exported, v *source.View, dirs map[string]bool) int { + // first trigger a load to get the diagnostics + var dirList []string + for dir := range dirs { + dirList = append(dirList, dir) + } + exported.Config.Mode = packages.LoadFiles + pkgs, err := packages.Load(exported.Config, dirList...) + if err != nil { + t.Fatal(err) + } + // and now see if they match the expected ones + count := 0 for _, pkg := range pkgs { for _, filename := range pkg.GoFiles { f := v.GetFile(source.ToURI(filename)) @@ -182,15 +217,26 @@ func testDiagnostics(t *testing.T, v *source.View, pkgs []*packages.Package, wan sort.Slice(got, func(i int, j int) bool { return got[i].Range.Start.Line < got[j].Range.Start.Line }) - want := wants[filename] + want := d[filename] if equal := reflect.DeepEqual(want, got); !equal { - t.Errorf("diagnostics failed for %s: (expected: %v), (got: %v)", filepath.Base(filename), want, got) + msg := &bytes.Buffer{} + fmt.Fprintf(msg, "diagnostics failed for %s: expected:\n", filepath.Base(filename)) + for _, d := range want { + fmt.Fprintf(msg, " %v\n", d) + } + fmt.Fprintf(msg, "got:\n") + for _, d := range got { + fmt.Fprintf(msg, " %v\n", d) + } + t.Error(msg.String()) } + count += len(want) } } + return count } -func collectDiagnostics(t *testing.T, expectedDiagnostics map[string][]protocol.Diagnostic, pos token.Position, msg string) { +func (d diagnostics) collect(pos token.Position, msg string) { line := float64(pos.Line - 1) col := float64(pos.Column - 1) want := protocol.Diagnostic{ @@ -208,15 +254,11 @@ func collectDiagnostics(t *testing.T, expectedDiagnostics map[string][]protocol. Source: "LSP", Message: msg, } - if _, ok := expectedDiagnostics[pos.Filename]; ok { - expectedDiagnostics[pos.Filename] = append(expectedDiagnostics[pos.Filename], want) - } else { - t.Errorf("unexpected filename: %v", pos.Filename) - } + d[pos.Filename] = append(d[pos.Filename], want) } -func testFormat(t *testing.T, s *server, expectedFormat map[string]string) { - for filename, gofmted := range expectedFormat { +func (f formats) test(t *testing.T, s *server) { + for filename, gofmted := range f { edits, err := s.Formatting(context.Background(), &protocol.DocumentFormattingParams{ TextDocument: protocol.TextDocumentIdentifier{ URI: protocol.DocumentURI(source.ToURI(filename)), @@ -235,10 +277,38 @@ func testFormat(t *testing.T, s *server, expectedFormat map[string]string) { } } -func collectFormat(expectedFormat map[string]string, pos token.Position) { +func (f formats) collect(pos token.Position) { cmd := exec.Command("gofmt", pos.Filename) stdout := bytes.NewBuffer(nil) cmd.Stdout = stdout cmd.Run() // ignore error, sometimes we have intentionally ungofmt-able files - expectedFormat[pos.Filename] = stdout.String() + f[pos.Filename] = stdout.String() +} + +func (d definitions) test(t *testing.T, s *server) { + for src, target := range d { + locs, err := s.Definition(context.Background(), &protocol.TextDocumentPositionParams{ + TextDocument: protocol.TextDocumentIdentifier{ + URI: src.URI, + }, + Position: src.Range.Start, + }) + if err != nil { + t.Fatal(err) + } + if len(locs) != 1 { + t.Errorf("got %d locations for definition, expected 1", len(locs)) + } + if locs[0] != target { + t.Errorf("for %v got %v want %v", src, locs[0], target) + } + } +} + +func (d definitions) collect(fset *token.FileSet, src, target packagestest.Range) { + sRange := source.Range{Start: src.Start, End: src.End} + sLoc := toProtocolLocation(fset, sRange) + tRange := source.Range{Start: target.Start, End: target.End} + tLoc := toProtocolLocation(fset, tRange) + d[sLoc] = tLoc } diff --git a/vendor/golang.org/x/tools/internal/lsp/position.go b/vendor/golang.org/x/tools/internal/lsp/position.go index de4ce674..e4b70fb8 100644 --- a/vendor/golang.org/x/tools/internal/lsp/position.go +++ b/vendor/golang.org/x/tools/internal/lsp/position.go @@ -24,11 +24,11 @@ func fromProtocolLocation(v *source.View, loc protocol.Location) (source.Range, } // toProtocolLocation converts from a source range back to a protocol location. -func toProtocolLocation(v *source.View, r source.Range) protocol.Location { - tokFile := v.Config.Fset.File(r.Start) - file := v.GetFile(source.ToURI(tokFile.Name())) +func toProtocolLocation(fset *token.FileSet, r source.Range) protocol.Location { + tokFile := fset.File(r.Start) + uri := source.ToURI(tokFile.Name()) return protocol.Location{ - URI: protocol.DocumentURI(file.URI), + URI: protocol.DocumentURI(uri), Range: toProtocolRange(tokFile, r), } } diff --git a/vendor/golang.org/x/tools/internal/lsp/protocol/printers.go b/vendor/golang.org/x/tools/internal/lsp/protocol/printers.go index e658af96..e4995b47 100644 --- a/vendor/golang.org/x/tools/internal/lsp/protocol/printers.go +++ b/vendor/golang.org/x/tools/internal/lsp/protocol/printers.go @@ -17,9 +17,9 @@ import ( ) func (p Position) Format(f fmt.State, c rune) { - fmt.Fprintf(f, "%d", int(p.Line)) + fmt.Fprintf(f, "%d", int(p.Line)+1) if p.Character >= 0 { - fmt.Fprintf(f, ":%d", int(p.Character)) + fmt.Fprintf(f, ":%d", int(p.Character)+1) } } @@ -28,7 +28,7 @@ func (r Range) Format(f fmt.State, c rune) { case r.Start == r.End || r.End.Line < 0: fmt.Fprintf(f, "%v", r.Start) case r.End.Line == r.Start.Line: - fmt.Fprintf(f, "%v¦%d", r.Start, int(r.End.Character)) + fmt.Fprintf(f, "%v¦%d", r.Start, int(r.End.Character)+1) default: fmt.Fprintf(f, "%v¦%v", r.Start, r.End) } @@ -37,3 +37,20 @@ func (r Range) Format(f fmt.State, c rune) { func (l Location) Format(f fmt.State, c rune) { fmt.Fprintf(f, "%s:%v", l.URI, l.Range) } + +func (s DiagnosticSeverity) Format(f fmt.State, c rune) { + switch s { + case SeverityError: + fmt.Fprint(f, "Error") + case SeverityWarning: + fmt.Fprint(f, "Warning") + case SeverityInformation: + fmt.Fprint(f, "Information") + case SeverityHint: + fmt.Fprint(f, "Hint") + } +} + +func (d Diagnostic) Format(f fmt.State, c rune) { + fmt.Fprintf(f, "%v:%v from %v at %v: %v", d.Severity, d.Code, d.Source, d.Range, d.Message) +} diff --git a/vendor/golang.org/x/tools/internal/lsp/server.go b/vendor/golang.org/x/tools/internal/lsp/server.go index 00c90756..ad51fa4d 100644 --- a/vendor/golang.org/x/tools/internal/lsp/server.go +++ b/vendor/golang.org/x/tools/internal/lsp/server.go @@ -204,7 +204,7 @@ func (s *server) Definition(ctx context.Context, params *protocol.TextDocumentPo if err != nil { return nil, err } - return []protocol.Location{toProtocolLocation(s.view, r)}, nil + return []protocol.Location{toProtocolLocation(s.view.Config.Fset, r)}, nil } func (s *server) TypeDefinition(context.Context, *protocol.TextDocumentPositionParams) ([]protocol.Location, error) { diff --git a/vendor/golang.org/x/tools/internal/lsp/source/definition.go b/vendor/golang.org/x/tools/internal/lsp/source/definition.go index 0df2bd13..43546381 100644 --- a/vendor/golang.org/x/tools/internal/lsp/source/definition.go +++ b/vendor/golang.org/x/tools/internal/lsp/source/definition.go @@ -5,11 +5,13 @@ package source import ( + "bytes" "context" "fmt" "go/ast" "go/token" "go/types" + "io/ioutil" "golang.org/x/tools/go/ast/astutil" ) @@ -43,10 +45,7 @@ func Definition(ctx context.Context, f *File, pos token.Pos) (Range, error) { } } } - return Range{ - Start: obj.Pos(), - End: obj.Pos() + token.Pos(len([]byte(obj.Name()))), // TODO: use real range of obj - }, nil + return objToRange(f.view.Config.Fset, obj), nil } // ident returns the ident plus any extra information needed @@ -93,3 +92,30 @@ func checkIdentifier(f *ast.File, pos token.Pos) (ident, error) { } return result, nil } + +func objToRange(fSet *token.FileSet, obj types.Object) Range { + p := obj.Pos() + f := fSet.File(p) + pos := f.Position(p) + if pos.Column == 1 { + // Column is 1, so we probably do not have full position information + // Currently exportdata does not store the column. + // For now we attempt to read the original source and find the identifier + // within the line. If we find it we patch the column to match its offset. + // TODO: we have probably already added the full data for the file to the + // fileset, we ought to track it rather than adding it over and over again + // TODO: if we parse from source, we will never need this hack + if src, err := ioutil.ReadFile(pos.Filename); err == nil { + newF := fSet.AddFile(pos.Filename, -1, len(src)) + newF.SetLinesForContent(src) + lineStart := lineStart(newF, pos.Line) + offset := newF.Offset(lineStart) + col := bytes.Index(src[offset:], []byte(obj.Name())) + p = newF.Pos(offset + col) + } + } + return Range{ + Start: p, + End: p + token.Pos(len([]byte(obj.Name()))), // TODO: use real range of obj + } +} diff --git a/vendor/golang.org/x/tools/internal/lsp/testdata/bad/bad.go b/vendor/golang.org/x/tools/internal/lsp/testdata/bad/bad.go index 8500d069..75f728ec 100644 --- a/vendor/golang.org/x/tools/internal/lsp/testdata/bad/bad.go +++ b/vendor/golang.org/x/tools/internal/lsp/testdata/bad/bad.go @@ -1,5 +1,3 @@ -// +build go1.11 - package bad func stuff() { @@ -14,8 +12,7 @@ type bob struct { } func _() { - var q int _ = &bob{ - f: q, //@diag("f", "unknown field f in struct literal") + f: 0, //@diag("f", "unknown field f in struct literal") } } diff --git a/vendor/golang.org/x/tools/internal/lsp/testdata/bad/bad_util.go b/vendor/golang.org/x/tools/internal/lsp/testdata/bad/bad_util.go index f6a0e7d9..9ab8a73e 100644 --- a/vendor/golang.org/x/tools/internal/lsp/testdata/bad/bad_util.go +++ b/vendor/golang.org/x/tools/internal/lsp/testdata/bad/bad_util.go @@ -1,5 +1,3 @@ -// +build go1.11 - package bad func random2(y int) int { diff --git a/vendor/golang.org/x/tools/internal/lsp/testdata/godef/a/a.go b/vendor/golang.org/x/tools/internal/lsp/testdata/godef/a/a.go new file mode 100644 index 00000000..e9c96744 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/lsp/testdata/godef/a/a.go @@ -0,0 +1,11 @@ +// A comment just to push the positions out + +package a + +type A string //@A + +func Stuff() { //@Stuff + x := 5 + Random2(x) //@godef("dom2", Random2) + Random() //@godef("()", Random) +} diff --git a/vendor/golang.org/x/tools/internal/lsp/testdata/godef/a/random.go b/vendor/golang.org/x/tools/internal/lsp/testdata/godef/a/random.go new file mode 100644 index 00000000..5dcb6efb --- /dev/null +++ b/vendor/golang.org/x/tools/internal/lsp/testdata/godef/a/random.go @@ -0,0 +1,23 @@ +package a + +func Random() int { //@Random + y := 6 + 7 + return y +} + +func Random2(y int) int { //@Random2,mark(RandomParamY, "y") + return y //@godef("y", RandomParamY) +} + +type Pos struct { + x, y int //@mark(PosX, "x"),mark(PosY, "y") +} + +func (p *Pos) Sum() int { //@mark(PosSum, "Sum") + return p.x + p.y //@godef("x", PosX) +} + +func _() { + var p Pos + _ = p.Sum() //@godef("()", PosSum) +} diff --git a/vendor/golang.org/x/tools/internal/lsp/testdata/godef/b/b.go b/vendor/golang.org/x/tools/internal/lsp/testdata/godef/b/b.go new file mode 100644 index 00000000..ae608156 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/lsp/testdata/godef/b/b.go @@ -0,0 +1,23 @@ +package b + +import "golang.org/x/tools/internal/lsp/godef/a" + +type S1 struct { //@S1 + F1 int //@mark(S1F1, "F1") + S2 //@godef("S2", S2), mark(S1S2, "S2") + a.A //@godef("A", A) +} + +type S2 struct { //@S2 + F1 string //@mark(S2F1, "F1") + F2 int //@mark(S2F2, "F2") +} + +func Bar() { + a.Stuff() //@godef("Stuff", Stuff) + var x S1 //@godef("S1", S1) + _ = x.S2 //@godef("S2", S1S2) + _ = x.F1 //@godef("F1", S1F1) + _ = x.F2 //@godef("F2", S2F2) + _ = x.S2.F1 //@godef("F1", S2F1) +} diff --git a/vendor/golang.org/x/tools/internal/lsp/testdata/godef/b/c.go b/vendor/golang.org/x/tools/internal/lsp/testdata/godef/b/c.go new file mode 100644 index 00000000..c8daf624 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/lsp/testdata/godef/b/c.go @@ -0,0 +1,8 @@ +package b + +// This is the in-editor version of the file. +// The on-disk version is in c.go.saved. + +var _ = S1{ //@godef("S1", S1) + F1: 99, //@godef("F1", S1F1) +} diff --git a/vendor/golang.org/x/tools/internal/lsp/testdata/godef/b/c.go.saved b/vendor/golang.org/x/tools/internal/lsp/testdata/godef/b/c.go.saved new file mode 100644 index 00000000..ff1a8794 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/lsp/testdata/godef/b/c.go.saved @@ -0,0 +1,7 @@ +package b + +// This is the on-disk version of c.go, which represents +// the in-editor version of the file. + +} + diff --git a/vendor/golang.org/x/tools/internal/lsp/testdata/godef/broken/unclosedIf.go.in b/vendor/golang.org/x/tools/internal/lsp/testdata/godef/broken/unclosedIf.go.in new file mode 100644 index 00000000..d29b108a --- /dev/null +++ b/vendor/golang.org/x/tools/internal/lsp/testdata/godef/broken/unclosedIf.go.in @@ -0,0 +1,11 @@ +package broken + +import "fmt" + +func unclosedIf() { + if false { + var myUnclosedIf string //@myUnclosedIf + fmt.Printf("s = %v\n", myUnclosedIf) //@godef("my", myUnclosedIf) +} +//@diag(EOF, "expected ';', found 'EOF'") +//@diag(EOF, "expected '}', found 'EOF'") diff --git a/vendor/golang.org/x/tools/internal/lsp/testdata/noparse_format/noparse_format.1_10.go.in b/vendor/golang.org/x/tools/internal/lsp/testdata/noparse_format/noparse_format.1_10.go.in new file mode 100644 index 00000000..f450053a --- /dev/null +++ b/vendor/golang.org/x/tools/internal/lsp/testdata/noparse_format/noparse_format.1_10.go.in @@ -0,0 +1,11 @@ +// +build !go1.11 + +// This file does not actually test anything +// on 1.10 the errors are different +package noparse_format + +func what() { + // we need a diagnostic below so we have the same count as the main file + var b int //@diag("b", "b declared but not used") + if true {} +} \ No newline at end of file diff --git a/vendor/k8s.io/api/Godeps/Godeps.json b/vendor/k8s.io/api/Godeps/Godeps.json index 29031888..529d9e3c 100644 --- a/vendor/k8s.io/api/Godeps/Godeps.json +++ b/vendor/k8s.io/api/Godeps/Godeps.json @@ -10,10 +10,6 @@ "ImportPath": "github.com/davecgh/go-spew/spew", "Rev": "782f4967f2dc4564575ca782fe2d04090b5faca8" }, - { - "ImportPath": "github.com/ghodss/yaml", - "Rev": "c7ce16629ff4cd059ed96ed06419dd3856fd3577" - }, { "ImportPath": "github.com/gogo/protobuf/proto", "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" @@ -22,10 +18,6 @@ "ImportPath": "github.com/gogo/protobuf/sortkeys", "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" }, - { - "ImportPath": "github.com/golang/glog", - "Rev": "44145f04b68cf362d9c4df2182967c2275eaefed" - }, { "ImportPath": "github.com/golang/protobuf/proto", "Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265" @@ -64,19 +56,19 @@ }, { "ImportPath": "golang.org/x/net/http2", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + "Rev": "0ed95abb35c445290478a5348a7b38bb154135fd" }, { "ImportPath": "golang.org/x/net/http2/hpack", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + "Rev": "0ed95abb35c445290478a5348a7b38bb154135fd" }, { "ImportPath": "golang.org/x/net/idna", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + "Rev": "0ed95abb35c445290478a5348a7b38bb154135fd" }, { "ImportPath": "golang.org/x/net/lex/httplex", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + "Rev": "0ed95abb35c445290478a5348a7b38bb154135fd" }, { "ImportPath": "golang.org/x/text/secure/bidirule", @@ -104,151 +96,159 @@ }, { "ImportPath": "k8s.io/apimachinery/pkg/api/apitesting", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/apitesting/fuzzer", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/apitesting/roundtrip", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/equality", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/meta", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/resource", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/fuzzer", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1beta1", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/conversion", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/fields", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/labels", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/schema", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/selection", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/types", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/diff", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/errors", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/framer", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/intstr", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/json", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/naming", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/net", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/runtime", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/sets", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/validation", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/validation/field", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/yaml", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/watch", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" + }, + { + "ImportPath": "k8s.io/klog", + "Rev": "8139d8cb77af419532b33dfa7dd09fbc5f1d344f" + }, + { + "ImportPath": "sigs.k8s.io/yaml", + "Rev": "fd68e9863619f6ec2fdd8625fe1f02e7c877e480" } ] } diff --git a/vendor/k8s.io/api/authentication/v1/generated.pb.go b/vendor/k8s.io/api/authentication/v1/generated.pb.go index dcea4228..4e7f28d8 100644 --- a/vendor/k8s.io/api/authentication/v1/generated.pb.go +++ b/vendor/k8s.io/api/authentication/v1/generated.pb.go @@ -355,6 +355,21 @@ func (m *TokenReviewSpec) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Token))) i += copy(dAtA[i:], m.Token) + if len(m.Audiences) > 0 { + for _, s := range m.Audiences { + dAtA[i] = 0x12 + i++ + l = len(s) + for l >= 1<<7 { + dAtA[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + dAtA[i] = uint8(l) + i++ + i += copy(dAtA[i:], s) + } + } return i, nil } @@ -393,6 +408,21 @@ func (m *TokenReviewStatus) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Error))) i += copy(dAtA[i:], m.Error) + if len(m.Audiences) > 0 { + for _, s := range m.Audiences { + dAtA[i] = 0x22 + i++ + l = len(s) + for l >= 1<<7 { + dAtA[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + dAtA[i] = uint8(l) + i++ + i += copy(dAtA[i:], s) + } + } return i, nil } @@ -561,6 +591,12 @@ func (m *TokenReviewSpec) Size() (n int) { _ = l l = len(m.Token) n += 1 + l + sovGenerated(uint64(l)) + if len(m.Audiences) > 0 { + for _, s := range m.Audiences { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } return n } @@ -572,6 +608,12 @@ func (m *TokenReviewStatus) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) l = len(m.Error) n += 1 + l + sovGenerated(uint64(l)) + if len(m.Audiences) > 0 { + for _, s := range m.Audiences { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } return n } @@ -679,6 +721,7 @@ func (this *TokenReviewSpec) String() string { } s := strings.Join([]string{`&TokenReviewSpec{`, `Token:` + fmt.Sprintf("%v", this.Token) + `,`, + `Audiences:` + fmt.Sprintf("%v", this.Audiences) + `,`, `}`, }, "") return s @@ -691,6 +734,7 @@ func (this *TokenReviewStatus) String() string { `Authenticated:` + fmt.Sprintf("%v", this.Authenticated) + `,`, `User:` + strings.Replace(strings.Replace(this.User.String(), "UserInfo", "UserInfo", 1), `&`, ``, 1) + `,`, `Error:` + fmt.Sprintf("%v", this.Error) + `,`, + `Audiences:` + fmt.Sprintf("%v", this.Audiences) + `,`, `}`, }, "") return s @@ -1550,6 +1594,35 @@ func (m *TokenReviewSpec) Unmarshal(dAtA []byte) error { } m.Token = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Audiences", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Audiences = append(m.Audiences, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -1679,6 +1752,35 @@ func (m *TokenReviewStatus) Unmarshal(dAtA []byte) error { } m.Error = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Audiences", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Audiences = append(m.Audiences, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -2070,61 +2172,62 @@ func init() { } var fileDescriptorGenerated = []byte{ - // 892 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0xcf, 0x8f, 0xdb, 0x44, - 0x14, 0x8e, 0xf3, 0x63, 0xb5, 0x99, 0x74, 0x97, 0xdd, 0x29, 0x95, 0xa2, 0x05, 0xec, 0x60, 0x24, - 0x14, 0x01, 0xb5, 0x9b, 0x08, 0x95, 0xaa, 0x48, 0x48, 0x6b, 0x36, 0x82, 0x08, 0x41, 0xab, 0x69, - 0x77, 0x41, 0x9c, 0x98, 0xd8, 0x6f, 0xb3, 0x26, 0x78, 0x6c, 0xec, 0x71, 0x68, 0x6e, 0xfd, 0x13, - 0x38, 0x82, 0xc4, 0x81, 0x3f, 0x02, 0x89, 0x23, 0xd7, 0x3d, 0x56, 0x9c, 0x7a, 0x40, 0x11, 0x6b, - 0xfe, 0x05, 0x4e, 0x9c, 0xd0, 0x8c, 0x67, 0xe3, 0xfc, 0xd8, 0x4d, 0x73, 0xea, 0x2d, 0xf3, 0xde, - 0xf7, 0xbe, 0x79, 0xef, 0x9b, 0x2f, 0xcf, 0xa8, 0x37, 0xba, 0x97, 0x58, 0x7e, 0x68, 0x8f, 0xd2, - 0x01, 0xc4, 0x0c, 0x38, 0x24, 0xf6, 0x18, 0x98, 0x17, 0xc6, 0xb6, 0x4a, 0xd0, 0xc8, 0xb7, 0x69, - 0xca, 0xcf, 0x80, 0x71, 0xdf, 0xa5, 0xdc, 0x0f, 0x99, 0x3d, 0xee, 0xd8, 0x43, 0x60, 0x10, 0x53, - 0x0e, 0x9e, 0x15, 0xc5, 0x21, 0x0f, 0xf1, 0xeb, 0x39, 0xda, 0xa2, 0x91, 0x6f, 0x2d, 0xa2, 0xad, - 0x71, 0xe7, 0xe0, 0xf6, 0xd0, 0xe7, 0x67, 0xe9, 0xc0, 0x72, 0xc3, 0xc0, 0x1e, 0x86, 0xc3, 0xd0, - 0x96, 0x45, 0x83, 0xf4, 0x54, 0x9e, 0xe4, 0x41, 0xfe, 0xca, 0xc9, 0x0e, 0xde, 0x2f, 0xae, 0x0e, - 0xa8, 0x7b, 0xe6, 0x33, 0x88, 0x27, 0x76, 0x34, 0x1a, 0x8a, 0x40, 0x62, 0x07, 0xc0, 0xe9, 0x15, - 0x2d, 0x1c, 0xd8, 0xd7, 0x55, 0xc5, 0x29, 0xe3, 0x7e, 0x00, 0x2b, 0x05, 0x77, 0x5f, 0x54, 0x90, - 0xb8, 0x67, 0x10, 0xd0, 0xe5, 0x3a, 0xf3, 0x4f, 0x0d, 0xbd, 0xea, 0x84, 0x29, 0xf3, 0x1e, 0x0c, - 0xbe, 0x05, 0x97, 0x13, 0x38, 0x85, 0x18, 0x98, 0x0b, 0xb8, 0x85, 0xaa, 0x23, 0x9f, 0x79, 0x4d, - 0xad, 0xa5, 0xb5, 0xeb, 0xce, 0x8d, 0xf3, 0xa9, 0x51, 0xca, 0xa6, 0x46, 0xf5, 0x33, 0x9f, 0x79, - 0x44, 0x66, 0x70, 0x17, 0x21, 0xfa, 0xb0, 0x7f, 0x02, 0x71, 0xe2, 0x87, 0xac, 0x59, 0x96, 0x38, - 0xac, 0x70, 0xe8, 0x70, 0x96, 0x21, 0x73, 0x28, 0xc1, 0xca, 0x68, 0x00, 0xcd, 0xca, 0x22, 0xeb, - 0x17, 0x34, 0x00, 0x22, 0x33, 0xd8, 0x41, 0x95, 0xb4, 0x7f, 0xd4, 0xac, 0x4a, 0xc0, 0x1d, 0x05, - 0xa8, 0x1c, 0xf7, 0x8f, 0xfe, 0x9b, 0x1a, 0x6f, 0x5e, 0x37, 0x24, 0x9f, 0x44, 0x90, 0x58, 0xc7, - 0xfd, 0x23, 0x22, 0x8a, 0xcd, 0x0f, 0x10, 0xea, 0x3d, 0xe1, 0x31, 0x3d, 0xa1, 0xdf, 0xa5, 0x80, - 0x0d, 0x54, 0xf3, 0x39, 0x04, 0x49, 0x53, 0x6b, 0x55, 0xda, 0x75, 0xa7, 0x9e, 0x4d, 0x8d, 0x5a, - 0x5f, 0x04, 0x48, 0x1e, 0xbf, 0xbf, 0xfd, 0xd3, 0xaf, 0x46, 0xe9, 0xe9, 0x5f, 0xad, 0x92, 0xf9, - 0x4b, 0x19, 0xdd, 0x78, 0x1c, 0x8e, 0x80, 0x11, 0xf8, 0x3e, 0x85, 0x84, 0xe3, 0x6f, 0xd0, 0xb6, - 0x78, 0x22, 0x8f, 0x72, 0x2a, 0x95, 0x68, 0x74, 0xef, 0x58, 0x85, 0x3b, 0x66, 0x4d, 0x58, 0xd1, - 0x68, 0x28, 0x02, 0x89, 0x25, 0xd0, 0xd6, 0xb8, 0x63, 0xe5, 0x72, 0x7e, 0x0e, 0x9c, 0x16, 0x9a, - 0x14, 0x31, 0x32, 0x63, 0xc5, 0x0f, 0x51, 0x35, 0x89, 0xc0, 0x95, 0xfa, 0x35, 0xba, 0x96, 0xb5, - 0xce, 0x7b, 0xd6, 0x7c, 0x6f, 0x8f, 0x22, 0x70, 0x0b, 0x05, 0xc5, 0x89, 0x48, 0x26, 0xfc, 0x15, - 0xda, 0x4a, 0x38, 0xe5, 0x69, 0x22, 0x55, 0x5e, 0xec, 0xf8, 0x45, 0x9c, 0xb2, 0xce, 0xd9, 0x55, - 0xac, 0x5b, 0xf9, 0x99, 0x28, 0x3e, 0xf3, 0x5f, 0x0d, 0xed, 0x2d, 0xb7, 0x80, 0xdf, 0x45, 0x75, - 0x9a, 0x7a, 0xbe, 0x30, 0xcd, 0xa5, 0xc4, 0x3b, 0xd9, 0xd4, 0xa8, 0x1f, 0x5e, 0x06, 0x49, 0x91, - 0xc7, 0x0c, 0xed, 0x0e, 0x16, 0xdc, 0xa6, 0x7a, 0xec, 0xae, 0xef, 0xf1, 0x2a, 0x87, 0x3a, 0x38, - 0x9b, 0x1a, 0xbb, 0x8b, 0x19, 0xb2, 0xc4, 0x8e, 0x3f, 0x46, 0xfb, 0xf0, 0x24, 0xf2, 0x63, 0xc9, - 0xf4, 0x08, 0xdc, 0x90, 0x79, 0x89, 0xf4, 0x56, 0xc5, 0xb9, 0x95, 0x4d, 0x8d, 0xfd, 0xde, 0x72, - 0x92, 0xac, 0xe2, 0xcd, 0xdf, 0x34, 0x84, 0x57, 0x55, 0xc2, 0x6f, 0xa1, 0x1a, 0x17, 0x51, 0xf5, - 0x17, 0xd9, 0x51, 0xa2, 0xd5, 0x72, 0x68, 0x9e, 0xc3, 0x13, 0x74, 0xb3, 0x20, 0x7c, 0xec, 0x07, - 0x90, 0x70, 0x1a, 0x44, 0xea, 0xb5, 0xdf, 0xd9, 0xcc, 0x4b, 0xa2, 0xcc, 0x79, 0x4d, 0xd1, 0xdf, - 0xec, 0xad, 0xd2, 0x91, 0xab, 0xee, 0x30, 0x7f, 0x2e, 0xa3, 0x86, 0x6a, 0x7b, 0xec, 0xc3, 0x0f, - 0x2f, 0xc1, 0xcb, 0x0f, 0x16, 0xbc, 0x7c, 0x7b, 0x23, 0xdf, 0x89, 0xd6, 0xae, 0xb5, 0xf2, 0x97, - 0x4b, 0x56, 0xb6, 0x37, 0xa7, 0x5c, 0xef, 0xe4, 0xbb, 0xe8, 0x95, 0xa5, 0xfb, 0x37, 0x7a, 0x4e, - 0xf3, 0x0f, 0x0d, 0xed, 0xaf, 0xdc, 0x82, 0x3f, 0x44, 0x3b, 0x73, 0xcd, 0x40, 0xbe, 0x34, 0xb7, - 0x9d, 0x5b, 0x8a, 0x62, 0xe7, 0x70, 0x3e, 0x49, 0x16, 0xb1, 0xf8, 0x53, 0x54, 0x4d, 0x13, 0x88, - 0x95, 0x68, 0x6f, 0xaf, 0x9f, 0xf0, 0x38, 0x81, 0xb8, 0xcf, 0x4e, 0xc3, 0x42, 0x2d, 0x11, 0x21, - 0x92, 0x41, 0x4c, 0x00, 0x71, 0x1c, 0xc6, 0x6a, 0xbb, 0xce, 0x26, 0xe8, 0x89, 0x20, 0xc9, 0x73, - 0xe6, 0xef, 0x65, 0xb4, 0x7d, 0xc9, 0x82, 0xdf, 0x43, 0xdb, 0xa2, 0x52, 0xae, 0xe4, 0x7c, 0xec, - 0x3d, 0x55, 0x24, 0x31, 0x22, 0x4e, 0x66, 0x08, 0xfc, 0x06, 0xaa, 0xa4, 0xbe, 0xa7, 0x36, 0x7d, - 0x63, 0x6e, 0x35, 0x13, 0x11, 0xc7, 0x26, 0xda, 0x1a, 0xc6, 0x61, 0x1a, 0x89, 0xc7, 0x12, 0x5b, - 0x00, 0x09, 0xdd, 0x3f, 0x91, 0x11, 0xa2, 0x32, 0xf8, 0x04, 0xd5, 0x40, 0x6c, 0xe6, 0x66, 0xb5, - 0x55, 0x69, 0x37, 0xba, 0x9d, 0xcd, 0xa6, 0xb5, 0xe4, 0x36, 0xef, 0x31, 0x1e, 0x4f, 0xe6, 0xa6, - 0x12, 0x31, 0x92, 0xd3, 0x1d, 0x0c, 0xd4, 0xc6, 0x97, 0x18, 0xbc, 0x87, 0x2a, 0x23, 0x98, 0xe4, - 0x13, 0x11, 0xf1, 0x13, 0x7f, 0x84, 0x6a, 0x63, 0xf1, 0x31, 0x50, 0x2a, 0xb7, 0xd7, 0xdf, 0x5b, - 0x7c, 0x3c, 0x48, 0x5e, 0x76, 0xbf, 0x7c, 0x4f, 0x73, 0xda, 0xe7, 0x17, 0x7a, 0xe9, 0xd9, 0x85, - 0x5e, 0x7a, 0x7e, 0xa1, 0x97, 0x9e, 0x66, 0xba, 0x76, 0x9e, 0xe9, 0xda, 0xb3, 0x4c, 0xd7, 0x9e, - 0x67, 0xba, 0xf6, 0x77, 0xa6, 0x6b, 0x3f, 0xfe, 0xa3, 0x97, 0xbe, 0x2e, 0x8f, 0x3b, 0xff, 0x07, - 0x00, 0x00, 0xff, 0xff, 0x5e, 0x8d, 0x94, 0x78, 0x88, 0x08, 0x00, 0x00, + // 900 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0xcf, 0x6f, 0xe3, 0x44, + 0x14, 0x8e, 0xf3, 0xa3, 0x4a, 0x26, 0xdb, 0xd2, 0xce, 0xb2, 0x52, 0x54, 0xc0, 0x2e, 0x41, 0x42, + 0x15, 0xb0, 0xf6, 0x26, 0x42, 0xb0, 0x5a, 0x24, 0xa4, 0x9a, 0x46, 0x10, 0x21, 0xd8, 0xd5, 0xec, + 0xb6, 0x20, 0x4e, 0x4c, 0xec, 0xd7, 0xc4, 0x04, 0x8f, 0x8d, 0x3d, 0x0e, 0x9b, 0xdb, 0xfe, 0x09, + 0x1c, 0x41, 0xe2, 0xc0, 0x1f, 0x81, 0xc4, 0xbf, 0xd0, 0xe3, 0x8a, 0xd3, 0x1e, 0x50, 0x44, 0xcd, + 0x95, 0x23, 0x27, 0x4e, 0x68, 0xc6, 0xd3, 0x38, 0x4e, 0xda, 0x34, 0x27, 0x6e, 0x9e, 0xf7, 0xbe, + 0xf7, 0xbd, 0x37, 0xdf, 0x7c, 0x9e, 0x41, 0xbd, 0xf1, 0xfd, 0xd8, 0xf4, 0x02, 0x6b, 0x9c, 0x0c, + 0x20, 0x62, 0xc0, 0x21, 0xb6, 0x26, 0xc0, 0xdc, 0x20, 0xb2, 0x54, 0x82, 0x86, 0x9e, 0x45, 0x13, + 0x3e, 0x02, 0xc6, 0x3d, 0x87, 0x72, 0x2f, 0x60, 0xd6, 0xa4, 0x63, 0x0d, 0x81, 0x41, 0x44, 0x39, + 0xb8, 0x66, 0x18, 0x05, 0x3c, 0xc0, 0xaf, 0x66, 0x68, 0x93, 0x86, 0x9e, 0x59, 0x44, 0x9b, 0x93, + 0xce, 0xfe, 0xdd, 0xa1, 0xc7, 0x47, 0xc9, 0xc0, 0x74, 0x02, 0xdf, 0x1a, 0x06, 0xc3, 0xc0, 0x92, + 0x45, 0x83, 0xe4, 0x4c, 0xae, 0xe4, 0x42, 0x7e, 0x65, 0x64, 0xfb, 0xef, 0xe6, 0xad, 0x7d, 0xea, + 0x8c, 0x3c, 0x06, 0xd1, 0xd4, 0x0a, 0xc7, 0x43, 0x11, 0x88, 0x2d, 0x1f, 0x38, 0xbd, 0x62, 0x84, + 0x7d, 0xeb, 0xba, 0xaa, 0x28, 0x61, 0xdc, 0xf3, 0x61, 0xa5, 0xe0, 0xbd, 0x9b, 0x0a, 0x62, 0x67, + 0x04, 0x3e, 0x5d, 0xae, 0x6b, 0xff, 0xae, 0xa1, 0x97, 0xed, 0x20, 0x61, 0xee, 0xc3, 0xc1, 0x37, + 0xe0, 0x70, 0x02, 0x67, 0x10, 0x01, 0x73, 0x00, 0x1f, 0xa0, 0xea, 0xd8, 0x63, 0x6e, 0x4b, 0x3b, + 0xd0, 0x0e, 0x1b, 0xf6, 0xad, 0xf3, 0x99, 0x51, 0x4a, 0x67, 0x46, 0xf5, 0x53, 0x8f, 0xb9, 0x44, + 0x66, 0x70, 0x17, 0x21, 0xfa, 0xa8, 0x7f, 0x0a, 0x51, 0xec, 0x05, 0xac, 0x55, 0x96, 0x38, 0xac, + 0x70, 0xe8, 0x68, 0x9e, 0x21, 0x0b, 0x28, 0xc1, 0xca, 0xa8, 0x0f, 0xad, 0x4a, 0x91, 0xf5, 0x73, + 0xea, 0x03, 0x91, 0x19, 0x6c, 0xa3, 0x4a, 0xd2, 0x3f, 0x6e, 0x55, 0x25, 0xe0, 0x9e, 0x02, 0x54, + 0x4e, 0xfa, 0xc7, 0xff, 0xce, 0x8c, 0xd7, 0xaf, 0xdb, 0x24, 0x9f, 0x86, 0x10, 0x9b, 0x27, 0xfd, + 0x63, 0x22, 0x8a, 0xdb, 0xef, 0x23, 0xd4, 0x7b, 0xca, 0x23, 0x7a, 0x4a, 0xbf, 0x4d, 0x00, 0x1b, + 0xa8, 0xe6, 0x71, 0xf0, 0xe3, 0x96, 0x76, 0x50, 0x39, 0x6c, 0xd8, 0x8d, 0x74, 0x66, 0xd4, 0xfa, + 0x22, 0x40, 0xb2, 0xf8, 0x83, 0xfa, 0x8f, 0xbf, 0x18, 0xa5, 0x67, 0x7f, 0x1c, 0x94, 0xda, 0x3f, + 0x97, 0xd1, 0xad, 0x27, 0xc1, 0x18, 0x18, 0x81, 0xef, 0x12, 0x88, 0x39, 0xfe, 0x1a, 0xd5, 0xc5, + 0x11, 0xb9, 0x94, 0x53, 0xa9, 0x44, 0xb3, 0x7b, 0xcf, 0xcc, 0xdd, 0x31, 0x1f, 0xc2, 0x0c, 0xc7, + 0x43, 0x11, 0x88, 0x4d, 0x81, 0x36, 0x27, 0x1d, 0x33, 0x93, 0xf3, 0x33, 0xe0, 0x34, 0xd7, 0x24, + 0x8f, 0x91, 0x39, 0x2b, 0x7e, 0x84, 0xaa, 0x71, 0x08, 0x8e, 0xd4, 0xaf, 0xd9, 0x35, 0xcd, 0x75, + 0xde, 0x33, 0x17, 0x67, 0x7b, 0x1c, 0x82, 0x93, 0x2b, 0x28, 0x56, 0x44, 0x32, 0xe1, 0x2f, 0xd1, + 0x56, 0xcc, 0x29, 0x4f, 0x62, 0xa9, 0x72, 0x71, 0xe2, 0x9b, 0x38, 0x65, 0x9d, 0xbd, 0xa3, 0x58, + 0xb7, 0xb2, 0x35, 0x51, 0x7c, 0xed, 0x7f, 0x34, 0xb4, 0xbb, 0x3c, 0x02, 0x7e, 0x1b, 0x35, 0x68, + 0xe2, 0x7a, 0xc2, 0x34, 0x97, 0x12, 0x6f, 0xa7, 0x33, 0xa3, 0x71, 0x74, 0x19, 0x24, 0x79, 0x1e, + 0x33, 0xb4, 0x33, 0x28, 0xb8, 0x4d, 0xcd, 0xd8, 0x5d, 0x3f, 0xe3, 0x55, 0x0e, 0xb5, 0x71, 0x3a, + 0x33, 0x76, 0x8a, 0x19, 0xb2, 0xc4, 0x8e, 0x3f, 0x42, 0x7b, 0xf0, 0x34, 0xf4, 0x22, 0xc9, 0xf4, + 0x18, 0x9c, 0x80, 0xb9, 0xb1, 0xf4, 0x56, 0xc5, 0xbe, 0x93, 0xce, 0x8c, 0xbd, 0xde, 0x72, 0x92, + 0xac, 0xe2, 0xdb, 0xbf, 0x6a, 0x08, 0xaf, 0xaa, 0x84, 0xdf, 0x40, 0x35, 0x2e, 0xa2, 0xea, 0x17, + 0xd9, 0x56, 0xa2, 0xd5, 0x32, 0x68, 0x96, 0xc3, 0x53, 0x74, 0x3b, 0x27, 0x7c, 0xe2, 0xf9, 0x10, + 0x73, 0xea, 0x87, 0xea, 0xb4, 0xdf, 0xda, 0xcc, 0x4b, 0xa2, 0xcc, 0x7e, 0x45, 0xd1, 0xdf, 0xee, + 0xad, 0xd2, 0x91, 0xab, 0x7a, 0xb4, 0x7f, 0x2a, 0xa3, 0xa6, 0x1a, 0x7b, 0xe2, 0xc1, 0xf7, 0xff, + 0x83, 0x97, 0x1f, 0x16, 0xbc, 0x7c, 0x77, 0x23, 0xdf, 0x89, 0xd1, 0xae, 0xb5, 0xf2, 0x17, 0x4b, + 0x56, 0xb6, 0x36, 0xa7, 0x5c, 0xef, 0x64, 0x07, 0xbd, 0xb4, 0xd4, 0x7f, 0xb3, 0xe3, 0x2c, 0x98, + 0xbd, 0xbc, 0xde, 0xec, 0xed, 0xbf, 0x35, 0xb4, 0xb7, 0x32, 0x12, 0xfe, 0x00, 0x6d, 0x2f, 0x4c, + 0x0e, 0xd9, 0x0d, 0x5b, 0xb7, 0xef, 0xa8, 0x7e, 0xdb, 0x47, 0x8b, 0x49, 0x52, 0xc4, 0xe2, 0x4f, + 0x50, 0x35, 0x89, 0x21, 0x52, 0x0a, 0xbf, 0xb9, 0x5e, 0x8e, 0x93, 0x18, 0xa2, 0x3e, 0x3b, 0x0b, + 0x72, 0x69, 0x45, 0x84, 0x48, 0x06, 0xb1, 0x5d, 0x88, 0xa2, 0x20, 0x52, 0x57, 0xf1, 0x7c, 0xbb, + 0x3d, 0x11, 0x24, 0x59, 0xae, 0xb8, 0xdd, 0xea, 0x0d, 0xdb, 0xfd, 0xad, 0x8c, 0xea, 0x97, 0x2d, + 0xf1, 0x3b, 0xa8, 0x2e, 0xda, 0xc8, 0xcb, 0x3e, 0x13, 0x74, 0x57, 0x75, 0x90, 0x18, 0x11, 0x27, + 0x73, 0x04, 0x7e, 0x0d, 0x55, 0x12, 0xcf, 0x55, 0x6f, 0x48, 0x73, 0xe1, 0xd2, 0x27, 0x22, 0x8e, + 0xdb, 0x68, 0x6b, 0x18, 0x05, 0x49, 0x28, 0x6c, 0x20, 0x66, 0x40, 0xe2, 0x44, 0x3f, 0x96, 0x11, + 0xa2, 0x32, 0xf8, 0x14, 0xd5, 0x40, 0xdc, 0xf9, 0x72, 0xcc, 0x66, 0xb7, 0xb3, 0x99, 0x34, 0xa6, + 0x7c, 0x27, 0x7a, 0x8c, 0x47, 0xd3, 0x05, 0x09, 0x44, 0x8c, 0x64, 0x74, 0xfb, 0x03, 0xf5, 0x96, + 0x48, 0x0c, 0xde, 0x45, 0x95, 0x31, 0x4c, 0xb3, 0x1d, 0x11, 0xf1, 0x89, 0x3f, 0x44, 0xb5, 0x89, + 0x78, 0x66, 0xd4, 0x91, 0x1c, 0xae, 0xef, 0x9b, 0x3f, 0x4b, 0x24, 0x2b, 0x7b, 0x50, 0xbe, 0xaf, + 0xd9, 0x87, 0xe7, 0x17, 0x7a, 0xe9, 0xf9, 0x85, 0x5e, 0x7a, 0x71, 0xa1, 0x97, 0x9e, 0xa5, 0xba, + 0x76, 0x9e, 0xea, 0xda, 0xf3, 0x54, 0xd7, 0x5e, 0xa4, 0xba, 0xf6, 0x67, 0xaa, 0x6b, 0x3f, 0xfc, + 0xa5, 0x97, 0xbe, 0x2a, 0x4f, 0x3a, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x5f, 0x04, 0x81, 0x6f, + 0xe2, 0x08, 0x00, 0x00, } diff --git a/vendor/k8s.io/api/authentication/v1/generated.proto b/vendor/k8s.io/api/authentication/v1/generated.proto index 10c79217..b69636a8 100644 --- a/vendor/k8s.io/api/authentication/v1/generated.proto +++ b/vendor/k8s.io/api/authentication/v1/generated.proto @@ -118,6 +118,14 @@ message TokenReviewSpec { // Token is the opaque bearer token. // +optional optional string token = 1; + + // Audiences is a list of the identifiers that the resource server presented + // with the token identifies as. Audience-aware token authenticators will + // verify that the token was intended for at least one of the audiences in + // this list. If no audiences are provided, the audience will default to the + // audience of the Kubernetes apiserver. + // +optional + repeated string audiences = 2; } // TokenReviewStatus is the result of the token authentication request. @@ -130,6 +138,18 @@ message TokenReviewStatus { // +optional optional UserInfo user = 2; + // Audiences are audience identifiers chosen by the authenticator that are + // compatible with both the TokenReview and token. An identifier is any + // identifier in the intersection of the TokenReviewSpec audiences and the + // token's audiences. A client of the TokenReview API that sets the + // spec.audiences field should validate that a compatible audience identifier + // is returned in the status.audiences field to ensure that the TokenReview + // server is audience aware. If a TokenReview returns an empty + // status.audience field where status.authenticated is "true", the token is + // valid against the audience of the Kubernetes API server. + // +optional + repeated string audiences = 4; + // Error indicates that the token couldn't be checked // +optional optional string error = 3; diff --git a/vendor/k8s.io/api/authentication/v1/types.go b/vendor/k8s.io/api/authentication/v1/types.go index 723457a3..d348c6fd 100644 --- a/vendor/k8s.io/api/authentication/v1/types.go +++ b/vendor/k8s.io/api/authentication/v1/types.go @@ -64,6 +64,13 @@ type TokenReviewSpec struct { // Token is the opaque bearer token. // +optional Token string `json:"token,omitempty" protobuf:"bytes,1,opt,name=token"` + // Audiences is a list of the identifiers that the resource server presented + // with the token identifies as. Audience-aware token authenticators will + // verify that the token was intended for at least one of the audiences in + // this list. If no audiences are provided, the audience will default to the + // audience of the Kubernetes apiserver. + // +optional + Audiences []string `json:"audiences,omitempty" protobuf:"bytes,2,rep,name=audiences"` } // TokenReviewStatus is the result of the token authentication request. @@ -74,6 +81,17 @@ type TokenReviewStatus struct { // User is the UserInfo associated with the provided token. // +optional User UserInfo `json:"user,omitempty" protobuf:"bytes,2,opt,name=user"` + // Audiences are audience identifiers chosen by the authenticator that are + // compatible with both the TokenReview and token. An identifier is any + // identifier in the intersection of the TokenReviewSpec audiences and the + // token's audiences. A client of the TokenReview API that sets the + // spec.audiences field should validate that a compatible audience identifier + // is returned in the status.audiences field to ensure that the TokenReview + // server is audience aware. If a TokenReview returns an empty + // status.audience field where status.authenticated is "true", the token is + // valid against the audience of the Kubernetes API server. + // +optional + Audiences []string `json:"audiences,omitempty" protobuf:"bytes,4,rep,name=audiences"` // Error indicates that the token couldn't be checked // +optional Error string `json:"error,omitempty" protobuf:"bytes,3,opt,name=error"` diff --git a/vendor/k8s.io/api/authentication/v1/types_swagger_doc_generated.go b/vendor/k8s.io/api/authentication/v1/types_swagger_doc_generated.go index 6632a5dd..f2c9b95c 100644 --- a/vendor/k8s.io/api/authentication/v1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/authentication/v1/types_swagger_doc_generated.go @@ -79,8 +79,9 @@ func (TokenReview) SwaggerDoc() map[string]string { } var map_TokenReviewSpec = map[string]string{ - "": "TokenReviewSpec is a description of the token authentication request.", - "token": "Token is the opaque bearer token.", + "": "TokenReviewSpec is a description of the token authentication request.", + "token": "Token is the opaque bearer token.", + "audiences": "Audiences is a list of the identifiers that the resource server presented with the token identifies as. Audience-aware token authenticators will verify that the token was intended for at least one of the audiences in this list. If no audiences are provided, the audience will default to the audience of the Kubernetes apiserver.", } func (TokenReviewSpec) SwaggerDoc() map[string]string { @@ -91,6 +92,7 @@ var map_TokenReviewStatus = map[string]string{ "": "TokenReviewStatus is the result of the token authentication request.", "authenticated": "Authenticated indicates that the token was associated with a known user.", "user": "User is the UserInfo associated with the provided token.", + "audiences": "Audiences are audience identifiers chosen by the authenticator that are compatible with both the TokenReview and token. An identifier is any identifier in the intersection of the TokenReviewSpec audiences and the token's audiences. A client of the TokenReview API that sets the spec.audiences field should validate that a compatible audience identifier is returned in the status.audiences field to ensure that the TokenReview server is audience aware. If a TokenReview returns an empty status.audience field where status.authenticated is \"true\", the token is valid against the audience of the Kubernetes API server.", "error": "Error indicates that the token couldn't be checked", } diff --git a/vendor/k8s.io/api/authentication/v1/zz_generated.deepcopy.go b/vendor/k8s.io/api/authentication/v1/zz_generated.deepcopy.go index f36c253b..aca99c42 100644 --- a/vendor/k8s.io/api/authentication/v1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/authentication/v1/zz_generated.deepcopy.go @@ -141,7 +141,7 @@ func (in *TokenReview) DeepCopyInto(out *TokenReview) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec + in.Spec.DeepCopyInto(&out.Spec) in.Status.DeepCopyInto(&out.Status) return } @@ -167,6 +167,11 @@ func (in *TokenReview) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TokenReviewSpec) DeepCopyInto(out *TokenReviewSpec) { *out = *in + if in.Audiences != nil { + in, out := &in.Audiences, &out.Audiences + *out = make([]string, len(*in)) + copy(*out, *in) + } return } @@ -184,6 +189,11 @@ func (in *TokenReviewSpec) DeepCopy() *TokenReviewSpec { func (in *TokenReviewStatus) DeepCopyInto(out *TokenReviewStatus) { *out = *in in.User.DeepCopyInto(&out.User) + if in.Audiences != nil { + in, out := &in.Audiences, &out.Audiences + *out = make([]string, len(*in)) + copy(*out, *in) + } return } diff --git a/vendor/k8s.io/api/authentication/v1beta1/generated.pb.go b/vendor/k8s.io/api/authentication/v1beta1/generated.pb.go index 55886b47..5f34e76a 100644 --- a/vendor/k8s.io/api/authentication/v1beta1/generated.pb.go +++ b/vendor/k8s.io/api/authentication/v1beta1/generated.pb.go @@ -175,6 +175,21 @@ func (m *TokenReviewSpec) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Token))) i += copy(dAtA[i:], m.Token) + if len(m.Audiences) > 0 { + for _, s := range m.Audiences { + dAtA[i] = 0x12 + i++ + l = len(s) + for l >= 1<<7 { + dAtA[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + dAtA[i] = uint8(l) + i++ + i += copy(dAtA[i:], s) + } + } return i, nil } @@ -213,6 +228,21 @@ func (m *TokenReviewStatus) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Error))) i += copy(dAtA[i:], m.Error) + if len(m.Audiences) > 0 { + for _, s := range m.Audiences { + dAtA[i] = 0x22 + i++ + l = len(s) + for l >= 1<<7 { + dAtA[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + dAtA[i] = uint8(l) + i++ + i += copy(dAtA[i:], s) + } + } return i, nil } @@ -326,6 +356,12 @@ func (m *TokenReviewSpec) Size() (n int) { _ = l l = len(m.Token) n += 1 + l + sovGenerated(uint64(l)) + if len(m.Audiences) > 0 { + for _, s := range m.Audiences { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } return n } @@ -337,6 +373,12 @@ func (m *TokenReviewStatus) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) l = len(m.Error) n += 1 + l + sovGenerated(uint64(l)) + if len(m.Audiences) > 0 { + for _, s := range m.Audiences { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } return n } @@ -396,6 +438,7 @@ func (this *TokenReviewSpec) String() string { } s := strings.Join([]string{`&TokenReviewSpec{`, `Token:` + fmt.Sprintf("%v", this.Token) + `,`, + `Audiences:` + fmt.Sprintf("%v", this.Audiences) + `,`, `}`, }, "") return s @@ -408,6 +451,7 @@ func (this *TokenReviewStatus) String() string { `Authenticated:` + fmt.Sprintf("%v", this.Authenticated) + `,`, `User:` + strings.Replace(strings.Replace(this.User.String(), "UserInfo", "UserInfo", 1), `&`, ``, 1) + `,`, `Error:` + fmt.Sprintf("%v", this.Error) + `,`, + `Audiences:` + fmt.Sprintf("%v", this.Audiences) + `,`, `}`, }, "") return s @@ -720,6 +764,35 @@ func (m *TokenReviewSpec) Unmarshal(dAtA []byte) error { } m.Token = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Audiences", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Audiences = append(m.Audiences, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -849,6 +922,35 @@ func (m *TokenReviewStatus) Unmarshal(dAtA []byte) error { } m.Error = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Audiences", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Audiences = append(m.Audiences, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -1240,45 +1342,47 @@ func init() { } var fileDescriptorGenerated = []byte{ - // 635 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0xcf, 0x4f, 0xd4, 0x40, - 0x14, 0x6e, 0xf7, 0x07, 0xee, 0xce, 0x8a, 0xe2, 0x24, 0x26, 0x9b, 0x4d, 0xec, 0xae, 0xeb, 0x85, - 0x44, 0x99, 0x0a, 0x21, 0x48, 0xf0, 0x64, 0x95, 0x18, 0x4c, 0x88, 0xc9, 0x08, 0x1e, 0xd4, 0x83, - 0xb3, 0xdd, 0x47, 0xb7, 0xae, 0xed, 0x34, 0xd3, 0x69, 0x95, 0x1b, 0x7f, 0x82, 0x47, 0x8f, 0x26, - 0xfe, 0x25, 0x26, 0x1e, 0x38, 0x72, 0xe4, 0x60, 0x88, 0xd4, 0x7f, 0xc4, 0xcc, 0x74, 0x64, 0x17, - 0x88, 0x01, 0x6e, 0xf3, 0xbe, 0xf7, 0xbe, 0x6f, 0xde, 0xf7, 0x66, 0x1e, 0x7a, 0x31, 0x5e, 0x4d, - 0x49, 0xc8, 0xdd, 0x71, 0x36, 0x00, 0x11, 0x83, 0x84, 0xd4, 0xcd, 0x21, 0x1e, 0x72, 0xe1, 0x9a, - 0x04, 0x4b, 0x42, 0x97, 0x65, 0x72, 0x04, 0xb1, 0x0c, 0x7d, 0x26, 0x43, 0x1e, 0xbb, 0xf9, 0xe2, - 0x00, 0x24, 0x5b, 0x74, 0x03, 0x88, 0x41, 0x30, 0x09, 0x43, 0x92, 0x08, 0x2e, 0x39, 0xbe, 0x5b, - 0x52, 0x08, 0x4b, 0x42, 0x72, 0x9a, 0x42, 0x0c, 0xa5, 0xb3, 0x10, 0x84, 0x72, 0x94, 0x0d, 0x88, - 0xcf, 0x23, 0x37, 0xe0, 0x01, 0x77, 0x35, 0x73, 0x90, 0xed, 0xe8, 0x48, 0x07, 0xfa, 0x54, 0x2a, - 0x76, 0x96, 0x27, 0x4d, 0x44, 0xcc, 0x1f, 0x85, 0x31, 0x88, 0x5d, 0x37, 0x19, 0x07, 0x0a, 0x48, - 0xdd, 0x08, 0x24, 0x73, 0xf3, 0x73, 0x7d, 0x74, 0xdc, 0xff, 0xb1, 0x44, 0x16, 0xcb, 0x30, 0x82, - 0x73, 0x84, 0x95, 0x8b, 0x08, 0xa9, 0x3f, 0x82, 0x88, 0x9d, 0xe5, 0xf5, 0x1f, 0x21, 0xb4, 0xfe, - 0x59, 0x0a, 0xf6, 0x9a, 0x7d, 0xcc, 0x00, 0x77, 0x51, 0x3d, 0x94, 0x10, 0xa5, 0x6d, 0xbb, 0x57, - 0x9d, 0x6f, 0x7a, 0xcd, 0xe2, 0xa8, 0x5b, 0xdf, 0x50, 0x00, 0x2d, 0xf1, 0xb5, 0xc6, 0xd7, 0x6f, - 0x5d, 0x6b, 0xef, 0x57, 0xcf, 0xea, 0x7f, 0xaf, 0xa0, 0xd6, 0x16, 0x1f, 0x43, 0x4c, 0x21, 0x0f, - 0xe1, 0x13, 0x7e, 0x8f, 0x1a, 0xca, 0xcc, 0x90, 0x49, 0xd6, 0xb6, 0x7b, 0xf6, 0x7c, 0x6b, 0xe9, - 0x21, 0x99, 0x0c, 0xf3, 0xa4, 0x27, 0x92, 0x8c, 0x03, 0x05, 0xa4, 0x44, 0x55, 0x93, 0x7c, 0x91, - 0xbc, 0x1c, 0x7c, 0x00, 0x5f, 0x6e, 0x82, 0x64, 0x1e, 0xde, 0x3f, 0xea, 0x5a, 0xc5, 0x51, 0x17, - 0x4d, 0x30, 0x7a, 0xa2, 0x8a, 0xb7, 0x50, 0x2d, 0x4d, 0xc0, 0x6f, 0x57, 0xb4, 0xfa, 0x12, 0xb9, - 0xf0, 0xa9, 0xc8, 0x54, 0x7f, 0xaf, 0x12, 0xf0, 0xbd, 0xeb, 0x46, 0xbf, 0xa6, 0x22, 0xaa, 0xd5, - 0xf0, 0x3b, 0x34, 0x93, 0x4a, 0x26, 0xb3, 0xb4, 0x5d, 0xd5, 0xba, 0xcb, 0x57, 0xd4, 0xd5, 0x5c, - 0xef, 0x86, 0x51, 0x9e, 0x29, 0x63, 0x6a, 0x34, 0xfb, 0x2b, 0xe8, 0xe6, 0x99, 0x26, 0xf0, 0x3d, - 0x54, 0x97, 0x0a, 0xd2, 0x53, 0x6a, 0x7a, 0xb3, 0x86, 0x59, 0x2f, 0xeb, 0xca, 0x5c, 0xff, 0xa7, - 0x8d, 0x6e, 0x9d, 0xbb, 0x05, 0x3f, 0x46, 0xb3, 0x53, 0x1d, 0xc1, 0x50, 0x4b, 0x34, 0xbc, 0xdb, - 0x46, 0x62, 0xf6, 0xc9, 0x74, 0x92, 0x9e, 0xae, 0xc5, 0x9b, 0xa8, 0x96, 0xa5, 0x20, 0xcc, 0xf8, - 0xee, 0x5f, 0xc2, 0xe6, 0x76, 0x0a, 0x62, 0x23, 0xde, 0xe1, 0x93, 0xb9, 0x29, 0x84, 0x6a, 0x19, - 0x65, 0x03, 0x84, 0xe0, 0x42, 0x8f, 0x6d, 0xca, 0xc6, 0xba, 0x02, 0x69, 0x99, 0xeb, 0xff, 0xa8, - 0xa0, 0xc6, 0x3f, 0x15, 0xfc, 0x00, 0x35, 0x14, 0x33, 0x66, 0x11, 0x18, 0xef, 0x73, 0x86, 0xa4, - 0x6b, 0x14, 0x4e, 0x4f, 0x2a, 0xf0, 0x1d, 0x54, 0xcd, 0xc2, 0xa1, 0xee, 0xb6, 0xe9, 0xb5, 0x4c, - 0x61, 0x75, 0x7b, 0xe3, 0x19, 0x55, 0x38, 0xee, 0xa3, 0x99, 0x40, 0xf0, 0x2c, 0x51, 0xcf, 0xa6, - 0xbe, 0x2a, 0x52, 0xc3, 0x7f, 0xae, 0x11, 0x6a, 0x32, 0xf8, 0x2d, 0xaa, 0x83, 0xfa, 0xdb, 0xed, - 0x5a, 0xaf, 0x3a, 0xdf, 0x5a, 0x5a, 0xb9, 0x82, 0x65, 0xa2, 0x97, 0x62, 0x3d, 0x96, 0x62, 0x77, - 0xca, 0x9a, 0xc2, 0x68, 0xa9, 0xd9, 0x09, 0xcc, 0xe2, 0xe8, 0x1a, 0x3c, 0x87, 0xaa, 0x63, 0xd8, - 0x2d, 0x6d, 0x51, 0x75, 0xc4, 0x4f, 0x51, 0x3d, 0x57, 0x3b, 0x65, 0xe6, 0xbd, 0x70, 0x89, 0xcb, - 0x27, 0x8b, 0x48, 0x4b, 0xee, 0x5a, 0x65, 0xd5, 0xf6, 0x16, 0xf6, 0x8f, 0x1d, 0xeb, 0xe0, 0xd8, - 0xb1, 0x0e, 0x8f, 0x1d, 0x6b, 0xaf, 0x70, 0xec, 0xfd, 0xc2, 0xb1, 0x0f, 0x0a, 0xc7, 0x3e, 0x2c, - 0x1c, 0xfb, 0x77, 0xe1, 0xd8, 0x5f, 0xfe, 0x38, 0xd6, 0x9b, 0x6b, 0x46, 0xe4, 0x6f, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x39, 0x00, 0xe7, 0xfa, 0x0e, 0x05, 0x00, 0x00, + // 663 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0xcd, 0x4e, 0x14, 0x4d, + 0x14, 0xed, 0x9e, 0x1f, 0xbe, 0x99, 0x9a, 0x6f, 0x14, 0x2b, 0x31, 0x99, 0x4c, 0x62, 0x0f, 0x8e, + 0x1b, 0x12, 0xa4, 0x5a, 0x08, 0x41, 0x82, 0x2b, 0x5a, 0x89, 0xc1, 0x84, 0x98, 0x94, 0xe0, 0x42, + 0x5d, 0x58, 0xd3, 0x73, 0xe9, 0x69, 0xc7, 0xfe, 0x49, 0x55, 0xf5, 0x28, 0x3b, 0x1e, 0xc1, 0xa5, + 0x4b, 0x13, 0x9f, 0xc4, 0x1d, 0x4b, 0x96, 0x2c, 0xcc, 0x44, 0xda, 0x27, 0xf0, 0x0d, 0x4c, 0x55, + 0x17, 0xcc, 0x00, 0x31, 0xc0, 0xae, 0xeb, 0xdc, 0x7b, 0xce, 0x3d, 0xf7, 0x54, 0x17, 0x7a, 0x31, + 0x5c, 0x13, 0x24, 0x4c, 0xdc, 0x61, 0xd6, 0x03, 0x1e, 0x83, 0x04, 0xe1, 0x8e, 0x20, 0xee, 0x27, + 0xdc, 0x35, 0x05, 0x96, 0x86, 0x2e, 0xcb, 0xe4, 0x00, 0x62, 0x19, 0xfa, 0x4c, 0x86, 0x49, 0xec, + 0x8e, 0x96, 0x7a, 0x20, 0xd9, 0x92, 0x1b, 0x40, 0x0c, 0x9c, 0x49, 0xe8, 0x93, 0x94, 0x27, 0x32, + 0xc1, 0xf7, 0x0b, 0x0a, 0x61, 0x69, 0x48, 0xce, 0x53, 0x88, 0xa1, 0xb4, 0x17, 0x83, 0x50, 0x0e, + 0xb2, 0x1e, 0xf1, 0x93, 0xc8, 0x0d, 0x92, 0x20, 0x71, 0x35, 0xb3, 0x97, 0xed, 0xe9, 0x93, 0x3e, + 0xe8, 0xaf, 0x42, 0xb1, 0xbd, 0x32, 0x31, 0x11, 0x31, 0x7f, 0x10, 0xc6, 0xc0, 0xf7, 0xdd, 0x74, + 0x18, 0x28, 0x40, 0xb8, 0x11, 0x48, 0xe6, 0x8e, 0x2e, 0xf9, 0x68, 0xbb, 0xff, 0x62, 0xf1, 0x2c, + 0x96, 0x61, 0x04, 0x97, 0x08, 0xab, 0x57, 0x11, 0x84, 0x3f, 0x80, 0x88, 0x5d, 0xe4, 0x75, 0x1f, + 0x23, 0xb4, 0xf9, 0x59, 0x72, 0xf6, 0x9a, 0x7d, 0xcc, 0x00, 0x77, 0x50, 0x35, 0x94, 0x10, 0x89, + 0x96, 0x3d, 0x57, 0x9e, 0xaf, 0x7b, 0xf5, 0x7c, 0xdc, 0xa9, 0x6e, 0x29, 0x80, 0x16, 0xf8, 0x7a, + 0xed, 0xeb, 0xb7, 0x8e, 0x75, 0xf0, 0x73, 0xce, 0xea, 0x7e, 0x2f, 0xa1, 0xc6, 0x4e, 0x32, 0x84, + 0x98, 0xc2, 0x28, 0x84, 0x4f, 0xf8, 0x3d, 0xaa, 0xa9, 0x65, 0xfa, 0x4c, 0xb2, 0x96, 0x3d, 0x67, + 0xcf, 0x37, 0x96, 0x1f, 0x91, 0x49, 0x98, 0x67, 0x9e, 0x48, 0x3a, 0x0c, 0x14, 0x20, 0x88, 0xea, + 0x26, 0xa3, 0x25, 0xf2, 0xb2, 0xf7, 0x01, 0x7c, 0xb9, 0x0d, 0x92, 0x79, 0xf8, 0x70, 0xdc, 0xb1, + 0xf2, 0x71, 0x07, 0x4d, 0x30, 0x7a, 0xa6, 0x8a, 0x77, 0x50, 0x45, 0xa4, 0xe0, 0xb7, 0x4a, 0x5a, + 0x7d, 0x99, 0x5c, 0x79, 0x55, 0x64, 0xca, 0xdf, 0xab, 0x14, 0x7c, 0xef, 0x7f, 0xa3, 0x5f, 0x51, + 0x27, 0xaa, 0xd5, 0xf0, 0x3b, 0x34, 0x23, 0x24, 0x93, 0x99, 0x68, 0x95, 0xb5, 0xee, 0xca, 0x0d, + 0x75, 0x35, 0xd7, 0xbb, 0x65, 0x94, 0x67, 0x8a, 0x33, 0x35, 0x9a, 0x5d, 0x1f, 0xdd, 0xbe, 0x60, + 0x02, 0x3f, 0x40, 0x55, 0xa9, 0x20, 0x9d, 0x52, 0xdd, 0x6b, 0x1a, 0x66, 0xb5, 0xe8, 0x2b, 0x6a, + 0x78, 0x01, 0xd5, 0x59, 0xd6, 0x0f, 0x21, 0xf6, 0x41, 0xb4, 0x4a, 0xfa, 0x32, 0x9a, 0xf9, 0xb8, + 0x53, 0xdf, 0x38, 0x05, 0xe9, 0xa4, 0xde, 0xfd, 0x63, 0xa3, 0x3b, 0x97, 0x2c, 0xe1, 0x27, 0xa8, + 0x39, 0x65, 0x1f, 0xfa, 0x7a, 0x5e, 0xcd, 0xbb, 0x6b, 0xe6, 0x35, 0x37, 0xa6, 0x8b, 0xf4, 0x7c, + 0x2f, 0xde, 0x46, 0x95, 0x4c, 0x00, 0x37, 0x59, 0x2f, 0x5c, 0x23, 0x93, 0x5d, 0x01, 0x7c, 0x2b, + 0xde, 0x4b, 0x26, 0x21, 0x2b, 0x84, 0x6a, 0x19, 0xb5, 0x33, 0x70, 0x9e, 0x70, 0x9d, 0xf1, 0xd4, + 0xce, 0x9b, 0x0a, 0xa4, 0x45, 0xed, 0xfc, 0xce, 0x95, 0x2b, 0x76, 0xfe, 0x51, 0x42, 0xb5, 0xd3, + 0x91, 0xf8, 0x21, 0xaa, 0xa9, 0x31, 0x31, 0x8b, 0xc0, 0xa4, 0x3a, 0x6b, 0x26, 0xe8, 0x1e, 0x85, + 0xd3, 0xb3, 0x0e, 0x7c, 0x0f, 0x95, 0xb3, 0xb0, 0xaf, 0x57, 0xab, 0x7b, 0x0d, 0xd3, 0x58, 0xde, + 0xdd, 0x7a, 0x46, 0x15, 0x8e, 0xbb, 0x68, 0x26, 0xe0, 0x49, 0x96, 0xaa, 0x1f, 0x42, 0x79, 0x40, + 0xea, 0x5a, 0x9f, 0x6b, 0x84, 0x9a, 0x0a, 0x7e, 0x8b, 0xaa, 0xa0, 0x5e, 0x8d, 0xb6, 0xd9, 0x58, + 0x5e, 0xbd, 0x41, 0x3e, 0x44, 0x3f, 0xb7, 0xcd, 0x58, 0xf2, 0xfd, 0xa9, 0x1c, 0x14, 0x46, 0x0b, + 0xcd, 0x76, 0x60, 0x9e, 0xa4, 0xee, 0xc1, 0xb3, 0xa8, 0x3c, 0x84, 0xfd, 0x62, 0x2d, 0xaa, 0x3e, + 0xf1, 0x53, 0x54, 0x1d, 0xa9, 0xd7, 0x6a, 0x2e, 0x67, 0xf1, 0x1a, 0xc3, 0x27, 0x4f, 0x9c, 0x16, + 0xdc, 0xf5, 0xd2, 0x9a, 0xed, 0x2d, 0x1e, 0x9e, 0x38, 0xd6, 0xd1, 0x89, 0x63, 0x1d, 0x9f, 0x38, + 0xd6, 0x41, 0xee, 0xd8, 0x87, 0xb9, 0x63, 0x1f, 0xe5, 0x8e, 0x7d, 0x9c, 0x3b, 0xf6, 0xaf, 0xdc, + 0xb1, 0xbf, 0xfc, 0x76, 0xac, 0x37, 0xff, 0x19, 0x91, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xf7, + 0xd6, 0x32, 0x28, 0x68, 0x05, 0x00, 0x00, } diff --git a/vendor/k8s.io/api/authentication/v1beta1/generated.proto b/vendor/k8s.io/api/authentication/v1beta1/generated.proto index a057bc59..caf2a6a5 100644 --- a/vendor/k8s.io/api/authentication/v1beta1/generated.proto +++ b/vendor/k8s.io/api/authentication/v1beta1/generated.proto @@ -57,6 +57,14 @@ message TokenReviewSpec { // Token is the opaque bearer token. // +optional optional string token = 1; + + // Audiences is a list of the identifiers that the resource server presented + // with the token identifies as. Audience-aware token authenticators will + // verify that the token was intended for at least one of the audiences in + // this list. If no audiences are provided, the audience will default to the + // audience of the Kubernetes apiserver. + // +optional + repeated string audiences = 2; } // TokenReviewStatus is the result of the token authentication request. @@ -69,6 +77,18 @@ message TokenReviewStatus { // +optional optional UserInfo user = 2; + // Audiences are audience identifiers chosen by the authenticator that are + // compatible with both the TokenReview and token. An identifier is any + // identifier in the intersection of the TokenReviewSpec audiences and the + // token's audiences. A client of the TokenReview API that sets the + // spec.audiences field should validate that a compatible audience identifier + // is returned in the status.audiences field to ensure that the TokenReview + // server is audience aware. If a TokenReview returns an empty + // status.audience field where status.authenticated is "true", the token is + // valid against the audience of the Kubernetes API server. + // +optional + repeated string audiences = 4; + // Error indicates that the token couldn't be checked // +optional optional string error = 3; diff --git a/vendor/k8s.io/api/authentication/v1beta1/types.go b/vendor/k8s.io/api/authentication/v1beta1/types.go index a90949dc..0b6cba82 100644 --- a/vendor/k8s.io/api/authentication/v1beta1/types.go +++ b/vendor/k8s.io/api/authentication/v1beta1/types.go @@ -48,6 +48,13 @@ type TokenReviewSpec struct { // Token is the opaque bearer token. // +optional Token string `json:"token,omitempty" protobuf:"bytes,1,opt,name=token"` + // Audiences is a list of the identifiers that the resource server presented + // with the token identifies as. Audience-aware token authenticators will + // verify that the token was intended for at least one of the audiences in + // this list. If no audiences are provided, the audience will default to the + // audience of the Kubernetes apiserver. + // +optional + Audiences []string `json:"audiences,omitempty" protobuf:"bytes,2,rep,name=audiences"` } // TokenReviewStatus is the result of the token authentication request. @@ -58,6 +65,17 @@ type TokenReviewStatus struct { // User is the UserInfo associated with the provided token. // +optional User UserInfo `json:"user,omitempty" protobuf:"bytes,2,opt,name=user"` + // Audiences are audience identifiers chosen by the authenticator that are + // compatible with both the TokenReview and token. An identifier is any + // identifier in the intersection of the TokenReviewSpec audiences and the + // token's audiences. A client of the TokenReview API that sets the + // spec.audiences field should validate that a compatible audience identifier + // is returned in the status.audiences field to ensure that the TokenReview + // server is audience aware. If a TokenReview returns an empty + // status.audience field where status.authenticated is "true", the token is + // valid against the audience of the Kubernetes API server. + // +optional + Audiences []string `json:"audiences,omitempty" protobuf:"bytes,4,rep,name=audiences"` // Error indicates that the token couldn't be checked // +optional Error string `json:"error,omitempty" protobuf:"bytes,3,opt,name=error"` diff --git a/vendor/k8s.io/api/authentication/v1beta1/types_swagger_doc_generated.go b/vendor/k8s.io/api/authentication/v1beta1/types_swagger_doc_generated.go index 968999d1..8c9acfb5 100644 --- a/vendor/k8s.io/api/authentication/v1beta1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/authentication/v1beta1/types_swagger_doc_generated.go @@ -38,8 +38,9 @@ func (TokenReview) SwaggerDoc() map[string]string { } var map_TokenReviewSpec = map[string]string{ - "": "TokenReviewSpec is a description of the token authentication request.", - "token": "Token is the opaque bearer token.", + "": "TokenReviewSpec is a description of the token authentication request.", + "token": "Token is the opaque bearer token.", + "audiences": "Audiences is a list of the identifiers that the resource server presented with the token identifies as. Audience-aware token authenticators will verify that the token was intended for at least one of the audiences in this list. If no audiences are provided, the audience will default to the audience of the Kubernetes apiserver.", } func (TokenReviewSpec) SwaggerDoc() map[string]string { @@ -50,6 +51,7 @@ var map_TokenReviewStatus = map[string]string{ "": "TokenReviewStatus is the result of the token authentication request.", "authenticated": "Authenticated indicates that the token was associated with a known user.", "user": "User is the UserInfo associated with the provided token.", + "audiences": "Audiences are audience identifiers chosen by the authenticator that are compatible with both the TokenReview and token. An identifier is any identifier in the intersection of the TokenReviewSpec audiences and the token's audiences. A client of the TokenReview API that sets the spec.audiences field should validate that a compatible audience identifier is returned in the status.audiences field to ensure that the TokenReview server is audience aware. If a TokenReview returns an empty status.audience field where status.authenticated is \"true\", the token is valid against the audience of the Kubernetes API server.", "error": "Error indicates that the token couldn't be checked", } diff --git a/vendor/k8s.io/api/authentication/v1beta1/zz_generated.deepcopy.go b/vendor/k8s.io/api/authentication/v1beta1/zz_generated.deepcopy.go index 3a5f6d5a..a5d82a81 100644 --- a/vendor/k8s.io/api/authentication/v1beta1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/authentication/v1beta1/zz_generated.deepcopy.go @@ -49,7 +49,7 @@ func (in *TokenReview) DeepCopyInto(out *TokenReview) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec + in.Spec.DeepCopyInto(&out.Spec) in.Status.DeepCopyInto(&out.Status) return } @@ -75,6 +75,11 @@ func (in *TokenReview) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TokenReviewSpec) DeepCopyInto(out *TokenReviewSpec) { *out = *in + if in.Audiences != nil { + in, out := &in.Audiences, &out.Audiences + *out = make([]string, len(*in)) + copy(*out, *in) + } return } @@ -92,6 +97,11 @@ func (in *TokenReviewSpec) DeepCopy() *TokenReviewSpec { func (in *TokenReviewStatus) DeepCopyInto(out *TokenReviewStatus) { *out = *in in.User.DeepCopyInto(&out.User) + if in.Audiences != nil { + in, out := &in.Audiences, &out.Audiences + *out = make([]string, len(*in)) + copy(*out, *in) + } return } diff --git a/vendor/k8s.io/api/core/v1/generated.pb.go b/vendor/k8s.io/api/core/v1/generated.pb.go index 80e8aad5..05cc6d62 100644 --- a/vendor/k8s.io/api/core/v1/generated.pb.go +++ b/vendor/k8s.io/api/core/v1/generated.pb.go @@ -81,6 +81,7 @@ limitations under the License. FlockerVolumeSource GCEPersistentDiskVolumeSource GitRepoVolumeSource + GlusterfsPersistentVolumeSource GlusterfsVolumeSource HTTPGetAction HTTPHeader @@ -498,604 +499,610 @@ func (m *GitRepoVolumeSource) Reset() { *m = GitRepoVolumeSou func (*GitRepoVolumeSource) ProtoMessage() {} func (*GitRepoVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{56} } +func (m *GlusterfsPersistentVolumeSource) Reset() { *m = GlusterfsPersistentVolumeSource{} } +func (*GlusterfsPersistentVolumeSource) ProtoMessage() {} +func (*GlusterfsPersistentVolumeSource) Descriptor() ([]byte, []int) { + return fileDescriptorGenerated, []int{57} +} + func (m *GlusterfsVolumeSource) Reset() { *m = GlusterfsVolumeSource{} } func (*GlusterfsVolumeSource) ProtoMessage() {} -func (*GlusterfsVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{57} } +func (*GlusterfsVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{58} } func (m *HTTPGetAction) Reset() { *m = HTTPGetAction{} } func (*HTTPGetAction) ProtoMessage() {} -func (*HTTPGetAction) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{58} } +func (*HTTPGetAction) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{59} } func (m *HTTPHeader) Reset() { *m = HTTPHeader{} } func (*HTTPHeader) ProtoMessage() {} -func (*HTTPHeader) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{59} } +func (*HTTPHeader) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{60} } func (m *Handler) Reset() { *m = Handler{} } func (*Handler) ProtoMessage() {} -func (*Handler) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{60} } +func (*Handler) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{61} } func (m *HostAlias) Reset() { *m = HostAlias{} } func (*HostAlias) ProtoMessage() {} -func (*HostAlias) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{61} } +func (*HostAlias) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{62} } func (m *HostPathVolumeSource) Reset() { *m = HostPathVolumeSource{} } func (*HostPathVolumeSource) ProtoMessage() {} -func (*HostPathVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{62} } +func (*HostPathVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{63} } func (m *ISCSIPersistentVolumeSource) Reset() { *m = ISCSIPersistentVolumeSource{} } func (*ISCSIPersistentVolumeSource) ProtoMessage() {} func (*ISCSIPersistentVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{63} + return fileDescriptorGenerated, []int{64} } func (m *ISCSIVolumeSource) Reset() { *m = ISCSIVolumeSource{} } func (*ISCSIVolumeSource) ProtoMessage() {} -func (*ISCSIVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{64} } +func (*ISCSIVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{65} } func (m *KeyToPath) Reset() { *m = KeyToPath{} } func (*KeyToPath) ProtoMessage() {} -func (*KeyToPath) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{65} } +func (*KeyToPath) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{66} } func (m *Lifecycle) Reset() { *m = Lifecycle{} } func (*Lifecycle) ProtoMessage() {} -func (*Lifecycle) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{66} } +func (*Lifecycle) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{67} } func (m *LimitRange) Reset() { *m = LimitRange{} } func (*LimitRange) ProtoMessage() {} -func (*LimitRange) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{67} } +func (*LimitRange) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{68} } func (m *LimitRangeItem) Reset() { *m = LimitRangeItem{} } func (*LimitRangeItem) ProtoMessage() {} -func (*LimitRangeItem) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{68} } +func (*LimitRangeItem) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{69} } func (m *LimitRangeList) Reset() { *m = LimitRangeList{} } func (*LimitRangeList) ProtoMessage() {} -func (*LimitRangeList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{69} } +func (*LimitRangeList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{70} } func (m *LimitRangeSpec) Reset() { *m = LimitRangeSpec{} } func (*LimitRangeSpec) ProtoMessage() {} -func (*LimitRangeSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{70} } +func (*LimitRangeSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{71} } func (m *List) Reset() { *m = List{} } func (*List) ProtoMessage() {} -func (*List) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{71} } +func (*List) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{72} } func (m *LoadBalancerIngress) Reset() { *m = LoadBalancerIngress{} } func (*LoadBalancerIngress) ProtoMessage() {} -func (*LoadBalancerIngress) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{72} } +func (*LoadBalancerIngress) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{73} } func (m *LoadBalancerStatus) Reset() { *m = LoadBalancerStatus{} } func (*LoadBalancerStatus) ProtoMessage() {} -func (*LoadBalancerStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{73} } +func (*LoadBalancerStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{74} } func (m *LocalObjectReference) Reset() { *m = LocalObjectReference{} } func (*LocalObjectReference) ProtoMessage() {} -func (*LocalObjectReference) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{74} } +func (*LocalObjectReference) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{75} } func (m *LocalVolumeSource) Reset() { *m = LocalVolumeSource{} } func (*LocalVolumeSource) ProtoMessage() {} -func (*LocalVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{75} } +func (*LocalVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{76} } func (m *NFSVolumeSource) Reset() { *m = NFSVolumeSource{} } func (*NFSVolumeSource) ProtoMessage() {} -func (*NFSVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{76} } +func (*NFSVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{77} } func (m *Namespace) Reset() { *m = Namespace{} } func (*Namespace) ProtoMessage() {} -func (*Namespace) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{77} } +func (*Namespace) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{78} } func (m *NamespaceList) Reset() { *m = NamespaceList{} } func (*NamespaceList) ProtoMessage() {} -func (*NamespaceList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{78} } +func (*NamespaceList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{79} } func (m *NamespaceSpec) Reset() { *m = NamespaceSpec{} } func (*NamespaceSpec) ProtoMessage() {} -func (*NamespaceSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{79} } +func (*NamespaceSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{80} } func (m *NamespaceStatus) Reset() { *m = NamespaceStatus{} } func (*NamespaceStatus) ProtoMessage() {} -func (*NamespaceStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{80} } +func (*NamespaceStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{81} } func (m *Node) Reset() { *m = Node{} } func (*Node) ProtoMessage() {} -func (*Node) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{81} } +func (*Node) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{82} } func (m *NodeAddress) Reset() { *m = NodeAddress{} } func (*NodeAddress) ProtoMessage() {} -func (*NodeAddress) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{82} } +func (*NodeAddress) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{83} } func (m *NodeAffinity) Reset() { *m = NodeAffinity{} } func (*NodeAffinity) ProtoMessage() {} -func (*NodeAffinity) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{83} } +func (*NodeAffinity) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{84} } func (m *NodeCondition) Reset() { *m = NodeCondition{} } func (*NodeCondition) ProtoMessage() {} -func (*NodeCondition) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{84} } +func (*NodeCondition) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{85} } func (m *NodeConfigSource) Reset() { *m = NodeConfigSource{} } func (*NodeConfigSource) ProtoMessage() {} -func (*NodeConfigSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{85} } +func (*NodeConfigSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{86} } func (m *NodeConfigStatus) Reset() { *m = NodeConfigStatus{} } func (*NodeConfigStatus) ProtoMessage() {} -func (*NodeConfigStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{86} } +func (*NodeConfigStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{87} } func (m *NodeDaemonEndpoints) Reset() { *m = NodeDaemonEndpoints{} } func (*NodeDaemonEndpoints) ProtoMessage() {} -func (*NodeDaemonEndpoints) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{87} } +func (*NodeDaemonEndpoints) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{88} } func (m *NodeList) Reset() { *m = NodeList{} } func (*NodeList) ProtoMessage() {} -func (*NodeList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{88} } +func (*NodeList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{89} } func (m *NodeProxyOptions) Reset() { *m = NodeProxyOptions{} } func (*NodeProxyOptions) ProtoMessage() {} -func (*NodeProxyOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{89} } +func (*NodeProxyOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{90} } func (m *NodeResources) Reset() { *m = NodeResources{} } func (*NodeResources) ProtoMessage() {} -func (*NodeResources) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{90} } +func (*NodeResources) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{91} } func (m *NodeSelector) Reset() { *m = NodeSelector{} } func (*NodeSelector) ProtoMessage() {} -func (*NodeSelector) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{91} } +func (*NodeSelector) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{92} } func (m *NodeSelectorRequirement) Reset() { *m = NodeSelectorRequirement{} } func (*NodeSelectorRequirement) ProtoMessage() {} func (*NodeSelectorRequirement) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{92} + return fileDescriptorGenerated, []int{93} } func (m *NodeSelectorTerm) Reset() { *m = NodeSelectorTerm{} } func (*NodeSelectorTerm) ProtoMessage() {} -func (*NodeSelectorTerm) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{93} } +func (*NodeSelectorTerm) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{94} } func (m *NodeSpec) Reset() { *m = NodeSpec{} } func (*NodeSpec) ProtoMessage() {} -func (*NodeSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{94} } +func (*NodeSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{95} } func (m *NodeStatus) Reset() { *m = NodeStatus{} } func (*NodeStatus) ProtoMessage() {} -func (*NodeStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{95} } +func (*NodeStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{96} } func (m *NodeSystemInfo) Reset() { *m = NodeSystemInfo{} } func (*NodeSystemInfo) ProtoMessage() {} -func (*NodeSystemInfo) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{96} } +func (*NodeSystemInfo) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{97} } func (m *ObjectFieldSelector) Reset() { *m = ObjectFieldSelector{} } func (*ObjectFieldSelector) ProtoMessage() {} -func (*ObjectFieldSelector) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{97} } +func (*ObjectFieldSelector) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{98} } func (m *ObjectReference) Reset() { *m = ObjectReference{} } func (*ObjectReference) ProtoMessage() {} -func (*ObjectReference) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{98} } +func (*ObjectReference) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{99} } func (m *PersistentVolume) Reset() { *m = PersistentVolume{} } func (*PersistentVolume) ProtoMessage() {} -func (*PersistentVolume) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{99} } +func (*PersistentVolume) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{100} } func (m *PersistentVolumeClaim) Reset() { *m = PersistentVolumeClaim{} } func (*PersistentVolumeClaim) ProtoMessage() {} -func (*PersistentVolumeClaim) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{100} } +func (*PersistentVolumeClaim) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{101} } func (m *PersistentVolumeClaimCondition) Reset() { *m = PersistentVolumeClaimCondition{} } func (*PersistentVolumeClaimCondition) ProtoMessage() {} func (*PersistentVolumeClaimCondition) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{101} + return fileDescriptorGenerated, []int{102} } func (m *PersistentVolumeClaimList) Reset() { *m = PersistentVolumeClaimList{} } func (*PersistentVolumeClaimList) ProtoMessage() {} func (*PersistentVolumeClaimList) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{102} + return fileDescriptorGenerated, []int{103} } func (m *PersistentVolumeClaimSpec) Reset() { *m = PersistentVolumeClaimSpec{} } func (*PersistentVolumeClaimSpec) ProtoMessage() {} func (*PersistentVolumeClaimSpec) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{103} + return fileDescriptorGenerated, []int{104} } func (m *PersistentVolumeClaimStatus) Reset() { *m = PersistentVolumeClaimStatus{} } func (*PersistentVolumeClaimStatus) ProtoMessage() {} func (*PersistentVolumeClaimStatus) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{104} + return fileDescriptorGenerated, []int{105} } func (m *PersistentVolumeClaimVolumeSource) Reset() { *m = PersistentVolumeClaimVolumeSource{} } func (*PersistentVolumeClaimVolumeSource) ProtoMessage() {} func (*PersistentVolumeClaimVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{105} + return fileDescriptorGenerated, []int{106} } func (m *PersistentVolumeList) Reset() { *m = PersistentVolumeList{} } func (*PersistentVolumeList) ProtoMessage() {} -func (*PersistentVolumeList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{106} } +func (*PersistentVolumeList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{107} } func (m *PersistentVolumeSource) Reset() { *m = PersistentVolumeSource{} } func (*PersistentVolumeSource) ProtoMessage() {} func (*PersistentVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{107} + return fileDescriptorGenerated, []int{108} } func (m *PersistentVolumeSpec) Reset() { *m = PersistentVolumeSpec{} } func (*PersistentVolumeSpec) ProtoMessage() {} -func (*PersistentVolumeSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{108} } +func (*PersistentVolumeSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{109} } func (m *PersistentVolumeStatus) Reset() { *m = PersistentVolumeStatus{} } func (*PersistentVolumeStatus) ProtoMessage() {} func (*PersistentVolumeStatus) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{109} + return fileDescriptorGenerated, []int{110} } func (m *PhotonPersistentDiskVolumeSource) Reset() { *m = PhotonPersistentDiskVolumeSource{} } func (*PhotonPersistentDiskVolumeSource) ProtoMessage() {} func (*PhotonPersistentDiskVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{110} + return fileDescriptorGenerated, []int{111} } func (m *Pod) Reset() { *m = Pod{} } func (*Pod) ProtoMessage() {} -func (*Pod) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{111} } +func (*Pod) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{112} } func (m *PodAffinity) Reset() { *m = PodAffinity{} } func (*PodAffinity) ProtoMessage() {} -func (*PodAffinity) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{112} } +func (*PodAffinity) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{113} } func (m *PodAffinityTerm) Reset() { *m = PodAffinityTerm{} } func (*PodAffinityTerm) ProtoMessage() {} -func (*PodAffinityTerm) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{113} } +func (*PodAffinityTerm) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{114} } func (m *PodAntiAffinity) Reset() { *m = PodAntiAffinity{} } func (*PodAntiAffinity) ProtoMessage() {} -func (*PodAntiAffinity) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{114} } +func (*PodAntiAffinity) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{115} } func (m *PodAttachOptions) Reset() { *m = PodAttachOptions{} } func (*PodAttachOptions) ProtoMessage() {} -func (*PodAttachOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{115} } +func (*PodAttachOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{116} } func (m *PodCondition) Reset() { *m = PodCondition{} } func (*PodCondition) ProtoMessage() {} -func (*PodCondition) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{116} } +func (*PodCondition) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{117} } func (m *PodDNSConfig) Reset() { *m = PodDNSConfig{} } func (*PodDNSConfig) ProtoMessage() {} -func (*PodDNSConfig) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{117} } +func (*PodDNSConfig) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{118} } func (m *PodDNSConfigOption) Reset() { *m = PodDNSConfigOption{} } func (*PodDNSConfigOption) ProtoMessage() {} -func (*PodDNSConfigOption) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{118} } +func (*PodDNSConfigOption) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{119} } func (m *PodExecOptions) Reset() { *m = PodExecOptions{} } func (*PodExecOptions) ProtoMessage() {} -func (*PodExecOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{119} } +func (*PodExecOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{120} } func (m *PodList) Reset() { *m = PodList{} } func (*PodList) ProtoMessage() {} -func (*PodList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{120} } +func (*PodList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{121} } func (m *PodLogOptions) Reset() { *m = PodLogOptions{} } func (*PodLogOptions) ProtoMessage() {} -func (*PodLogOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{121} } +func (*PodLogOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{122} } func (m *PodPortForwardOptions) Reset() { *m = PodPortForwardOptions{} } func (*PodPortForwardOptions) ProtoMessage() {} -func (*PodPortForwardOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{122} } +func (*PodPortForwardOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{123} } func (m *PodProxyOptions) Reset() { *m = PodProxyOptions{} } func (*PodProxyOptions) ProtoMessage() {} -func (*PodProxyOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{123} } +func (*PodProxyOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{124} } func (m *PodReadinessGate) Reset() { *m = PodReadinessGate{} } func (*PodReadinessGate) ProtoMessage() {} -func (*PodReadinessGate) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{124} } +func (*PodReadinessGate) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{125} } func (m *PodSecurityContext) Reset() { *m = PodSecurityContext{} } func (*PodSecurityContext) ProtoMessage() {} -func (*PodSecurityContext) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{125} } +func (*PodSecurityContext) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{126} } func (m *PodSignature) Reset() { *m = PodSignature{} } func (*PodSignature) ProtoMessage() {} -func (*PodSignature) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{126} } +func (*PodSignature) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{127} } func (m *PodSpec) Reset() { *m = PodSpec{} } func (*PodSpec) ProtoMessage() {} -func (*PodSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{127} } +func (*PodSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{128} } func (m *PodStatus) Reset() { *m = PodStatus{} } func (*PodStatus) ProtoMessage() {} -func (*PodStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{128} } +func (*PodStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{129} } func (m *PodStatusResult) Reset() { *m = PodStatusResult{} } func (*PodStatusResult) ProtoMessage() {} -func (*PodStatusResult) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{129} } +func (*PodStatusResult) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{130} } func (m *PodTemplate) Reset() { *m = PodTemplate{} } func (*PodTemplate) ProtoMessage() {} -func (*PodTemplate) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{130} } +func (*PodTemplate) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{131} } func (m *PodTemplateList) Reset() { *m = PodTemplateList{} } func (*PodTemplateList) ProtoMessage() {} -func (*PodTemplateList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{131} } +func (*PodTemplateList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{132} } func (m *PodTemplateSpec) Reset() { *m = PodTemplateSpec{} } func (*PodTemplateSpec) ProtoMessage() {} -func (*PodTemplateSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{132} } +func (*PodTemplateSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{133} } func (m *PortworxVolumeSource) Reset() { *m = PortworxVolumeSource{} } func (*PortworxVolumeSource) ProtoMessage() {} -func (*PortworxVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{133} } +func (*PortworxVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{134} } func (m *Preconditions) Reset() { *m = Preconditions{} } func (*Preconditions) ProtoMessage() {} -func (*Preconditions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{134} } +func (*Preconditions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{135} } func (m *PreferAvoidPodsEntry) Reset() { *m = PreferAvoidPodsEntry{} } func (*PreferAvoidPodsEntry) ProtoMessage() {} -func (*PreferAvoidPodsEntry) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{135} } +func (*PreferAvoidPodsEntry) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{136} } func (m *PreferredSchedulingTerm) Reset() { *m = PreferredSchedulingTerm{} } func (*PreferredSchedulingTerm) ProtoMessage() {} func (*PreferredSchedulingTerm) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{136} + return fileDescriptorGenerated, []int{137} } func (m *Probe) Reset() { *m = Probe{} } func (*Probe) ProtoMessage() {} -func (*Probe) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{137} } +func (*Probe) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{138} } func (m *ProjectedVolumeSource) Reset() { *m = ProjectedVolumeSource{} } func (*ProjectedVolumeSource) ProtoMessage() {} -func (*ProjectedVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{138} } +func (*ProjectedVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{139} } func (m *QuobyteVolumeSource) Reset() { *m = QuobyteVolumeSource{} } func (*QuobyteVolumeSource) ProtoMessage() {} -func (*QuobyteVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{139} } +func (*QuobyteVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{140} } func (m *RBDPersistentVolumeSource) Reset() { *m = RBDPersistentVolumeSource{} } func (*RBDPersistentVolumeSource) ProtoMessage() {} func (*RBDPersistentVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{140} + return fileDescriptorGenerated, []int{141} } func (m *RBDVolumeSource) Reset() { *m = RBDVolumeSource{} } func (*RBDVolumeSource) ProtoMessage() {} -func (*RBDVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{141} } +func (*RBDVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{142} } func (m *RangeAllocation) Reset() { *m = RangeAllocation{} } func (*RangeAllocation) ProtoMessage() {} -func (*RangeAllocation) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{142} } +func (*RangeAllocation) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{143} } func (m *ReplicationController) Reset() { *m = ReplicationController{} } func (*ReplicationController) ProtoMessage() {} -func (*ReplicationController) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{143} } +func (*ReplicationController) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{144} } func (m *ReplicationControllerCondition) Reset() { *m = ReplicationControllerCondition{} } func (*ReplicationControllerCondition) ProtoMessage() {} func (*ReplicationControllerCondition) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{144} + return fileDescriptorGenerated, []int{145} } func (m *ReplicationControllerList) Reset() { *m = ReplicationControllerList{} } func (*ReplicationControllerList) ProtoMessage() {} func (*ReplicationControllerList) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{145} + return fileDescriptorGenerated, []int{146} } func (m *ReplicationControllerSpec) Reset() { *m = ReplicationControllerSpec{} } func (*ReplicationControllerSpec) ProtoMessage() {} func (*ReplicationControllerSpec) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{146} + return fileDescriptorGenerated, []int{147} } func (m *ReplicationControllerStatus) Reset() { *m = ReplicationControllerStatus{} } func (*ReplicationControllerStatus) ProtoMessage() {} func (*ReplicationControllerStatus) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{147} + return fileDescriptorGenerated, []int{148} } func (m *ResourceFieldSelector) Reset() { *m = ResourceFieldSelector{} } func (*ResourceFieldSelector) ProtoMessage() {} -func (*ResourceFieldSelector) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{148} } +func (*ResourceFieldSelector) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{149} } func (m *ResourceQuota) Reset() { *m = ResourceQuota{} } func (*ResourceQuota) ProtoMessage() {} -func (*ResourceQuota) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{149} } +func (*ResourceQuota) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{150} } func (m *ResourceQuotaList) Reset() { *m = ResourceQuotaList{} } func (*ResourceQuotaList) ProtoMessage() {} -func (*ResourceQuotaList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{150} } +func (*ResourceQuotaList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{151} } func (m *ResourceQuotaSpec) Reset() { *m = ResourceQuotaSpec{} } func (*ResourceQuotaSpec) ProtoMessage() {} -func (*ResourceQuotaSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{151} } +func (*ResourceQuotaSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{152} } func (m *ResourceQuotaStatus) Reset() { *m = ResourceQuotaStatus{} } func (*ResourceQuotaStatus) ProtoMessage() {} -func (*ResourceQuotaStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{152} } +func (*ResourceQuotaStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{153} } func (m *ResourceRequirements) Reset() { *m = ResourceRequirements{} } func (*ResourceRequirements) ProtoMessage() {} -func (*ResourceRequirements) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{153} } +func (*ResourceRequirements) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{154} } func (m *SELinuxOptions) Reset() { *m = SELinuxOptions{} } func (*SELinuxOptions) ProtoMessage() {} -func (*SELinuxOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{154} } +func (*SELinuxOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{155} } func (m *ScaleIOPersistentVolumeSource) Reset() { *m = ScaleIOPersistentVolumeSource{} } func (*ScaleIOPersistentVolumeSource) ProtoMessage() {} func (*ScaleIOPersistentVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{155} + return fileDescriptorGenerated, []int{156} } func (m *ScaleIOVolumeSource) Reset() { *m = ScaleIOVolumeSource{} } func (*ScaleIOVolumeSource) ProtoMessage() {} -func (*ScaleIOVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{156} } +func (*ScaleIOVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{157} } func (m *ScopeSelector) Reset() { *m = ScopeSelector{} } func (*ScopeSelector) ProtoMessage() {} -func (*ScopeSelector) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{157} } +func (*ScopeSelector) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{158} } func (m *ScopedResourceSelectorRequirement) Reset() { *m = ScopedResourceSelectorRequirement{} } func (*ScopedResourceSelectorRequirement) ProtoMessage() {} func (*ScopedResourceSelectorRequirement) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{158} + return fileDescriptorGenerated, []int{159} } func (m *Secret) Reset() { *m = Secret{} } func (*Secret) ProtoMessage() {} -func (*Secret) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{159} } +func (*Secret) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{160} } func (m *SecretEnvSource) Reset() { *m = SecretEnvSource{} } func (*SecretEnvSource) ProtoMessage() {} -func (*SecretEnvSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{160} } +func (*SecretEnvSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{161} } func (m *SecretKeySelector) Reset() { *m = SecretKeySelector{} } func (*SecretKeySelector) ProtoMessage() {} -func (*SecretKeySelector) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{161} } +func (*SecretKeySelector) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{162} } func (m *SecretList) Reset() { *m = SecretList{} } func (*SecretList) ProtoMessage() {} -func (*SecretList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{162} } +func (*SecretList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{163} } func (m *SecretProjection) Reset() { *m = SecretProjection{} } func (*SecretProjection) ProtoMessage() {} -func (*SecretProjection) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{163} } +func (*SecretProjection) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{164} } func (m *SecretReference) Reset() { *m = SecretReference{} } func (*SecretReference) ProtoMessage() {} -func (*SecretReference) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{164} } +func (*SecretReference) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{165} } func (m *SecretVolumeSource) Reset() { *m = SecretVolumeSource{} } func (*SecretVolumeSource) ProtoMessage() {} -func (*SecretVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{165} } +func (*SecretVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{166} } func (m *SecurityContext) Reset() { *m = SecurityContext{} } func (*SecurityContext) ProtoMessage() {} -func (*SecurityContext) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{166} } +func (*SecurityContext) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{167} } func (m *SerializedReference) Reset() { *m = SerializedReference{} } func (*SerializedReference) ProtoMessage() {} -func (*SerializedReference) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{167} } +func (*SerializedReference) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{168} } func (m *Service) Reset() { *m = Service{} } func (*Service) ProtoMessage() {} -func (*Service) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{168} } +func (*Service) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{169} } func (m *ServiceAccount) Reset() { *m = ServiceAccount{} } func (*ServiceAccount) ProtoMessage() {} -func (*ServiceAccount) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{169} } +func (*ServiceAccount) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{170} } func (m *ServiceAccountList) Reset() { *m = ServiceAccountList{} } func (*ServiceAccountList) ProtoMessage() {} -func (*ServiceAccountList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{170} } +func (*ServiceAccountList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{171} } func (m *ServiceAccountTokenProjection) Reset() { *m = ServiceAccountTokenProjection{} } func (*ServiceAccountTokenProjection) ProtoMessage() {} func (*ServiceAccountTokenProjection) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{171} + return fileDescriptorGenerated, []int{172} } func (m *ServiceList) Reset() { *m = ServiceList{} } func (*ServiceList) ProtoMessage() {} -func (*ServiceList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{172} } +func (*ServiceList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{173} } func (m *ServicePort) Reset() { *m = ServicePort{} } func (*ServicePort) ProtoMessage() {} -func (*ServicePort) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{173} } +func (*ServicePort) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{174} } func (m *ServiceProxyOptions) Reset() { *m = ServiceProxyOptions{} } func (*ServiceProxyOptions) ProtoMessage() {} -func (*ServiceProxyOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{174} } +func (*ServiceProxyOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{175} } func (m *ServiceSpec) Reset() { *m = ServiceSpec{} } func (*ServiceSpec) ProtoMessage() {} -func (*ServiceSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{175} } +func (*ServiceSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{176} } func (m *ServiceStatus) Reset() { *m = ServiceStatus{} } func (*ServiceStatus) ProtoMessage() {} -func (*ServiceStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{176} } +func (*ServiceStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{177} } func (m *SessionAffinityConfig) Reset() { *m = SessionAffinityConfig{} } func (*SessionAffinityConfig) ProtoMessage() {} -func (*SessionAffinityConfig) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{177} } +func (*SessionAffinityConfig) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{178} } func (m *StorageOSPersistentVolumeSource) Reset() { *m = StorageOSPersistentVolumeSource{} } func (*StorageOSPersistentVolumeSource) ProtoMessage() {} func (*StorageOSPersistentVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{178} + return fileDescriptorGenerated, []int{179} } func (m *StorageOSVolumeSource) Reset() { *m = StorageOSVolumeSource{} } func (*StorageOSVolumeSource) ProtoMessage() {} -func (*StorageOSVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{179} } +func (*StorageOSVolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{180} } func (m *Sysctl) Reset() { *m = Sysctl{} } func (*Sysctl) ProtoMessage() {} -func (*Sysctl) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{180} } +func (*Sysctl) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{181} } func (m *TCPSocketAction) Reset() { *m = TCPSocketAction{} } func (*TCPSocketAction) ProtoMessage() {} -func (*TCPSocketAction) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{181} } +func (*TCPSocketAction) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{182} } func (m *Taint) Reset() { *m = Taint{} } func (*Taint) ProtoMessage() {} -func (*Taint) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{182} } +func (*Taint) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{183} } func (m *Toleration) Reset() { *m = Toleration{} } func (*Toleration) ProtoMessage() {} -func (*Toleration) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{183} } +func (*Toleration) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{184} } func (m *TopologySelectorLabelRequirement) Reset() { *m = TopologySelectorLabelRequirement{} } func (*TopologySelectorLabelRequirement) ProtoMessage() {} func (*TopologySelectorLabelRequirement) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{184} + return fileDescriptorGenerated, []int{185} } func (m *TopologySelectorTerm) Reset() { *m = TopologySelectorTerm{} } func (*TopologySelectorTerm) ProtoMessage() {} -func (*TopologySelectorTerm) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{185} } +func (*TopologySelectorTerm) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{186} } func (m *TypedLocalObjectReference) Reset() { *m = TypedLocalObjectReference{} } func (*TypedLocalObjectReference) ProtoMessage() {} func (*TypedLocalObjectReference) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{186} + return fileDescriptorGenerated, []int{187} } func (m *Volume) Reset() { *m = Volume{} } func (*Volume) ProtoMessage() {} -func (*Volume) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{187} } +func (*Volume) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{188} } func (m *VolumeDevice) Reset() { *m = VolumeDevice{} } func (*VolumeDevice) ProtoMessage() {} -func (*VolumeDevice) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{188} } +func (*VolumeDevice) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{189} } func (m *VolumeMount) Reset() { *m = VolumeMount{} } func (*VolumeMount) ProtoMessage() {} -func (*VolumeMount) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{189} } +func (*VolumeMount) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{190} } func (m *VolumeNodeAffinity) Reset() { *m = VolumeNodeAffinity{} } func (*VolumeNodeAffinity) ProtoMessage() {} -func (*VolumeNodeAffinity) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{190} } +func (*VolumeNodeAffinity) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{191} } func (m *VolumeProjection) Reset() { *m = VolumeProjection{} } func (*VolumeProjection) ProtoMessage() {} -func (*VolumeProjection) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{191} } +func (*VolumeProjection) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{192} } func (m *VolumeSource) Reset() { *m = VolumeSource{} } func (*VolumeSource) ProtoMessage() {} -func (*VolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{192} } +func (*VolumeSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{193} } func (m *VsphereVirtualDiskVolumeSource) Reset() { *m = VsphereVirtualDiskVolumeSource{} } func (*VsphereVirtualDiskVolumeSource) ProtoMessage() {} func (*VsphereVirtualDiskVolumeSource) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{193} + return fileDescriptorGenerated, []int{194} } func (m *WeightedPodAffinityTerm) Reset() { *m = WeightedPodAffinityTerm{} } func (*WeightedPodAffinityTerm) ProtoMessage() {} func (*WeightedPodAffinityTerm) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{194} + return fileDescriptorGenerated, []int{195} } func init() { @@ -1156,6 +1163,7 @@ func init() { proto.RegisterType((*FlockerVolumeSource)(nil), "k8s.io.api.core.v1.FlockerVolumeSource") proto.RegisterType((*GCEPersistentDiskVolumeSource)(nil), "k8s.io.api.core.v1.GCEPersistentDiskVolumeSource") proto.RegisterType((*GitRepoVolumeSource)(nil), "k8s.io.api.core.v1.GitRepoVolumeSource") + proto.RegisterType((*GlusterfsPersistentVolumeSource)(nil), "k8s.io.api.core.v1.GlusterfsPersistentVolumeSource") proto.RegisterType((*GlusterfsVolumeSource)(nil), "k8s.io.api.core.v1.GlusterfsVolumeSource") proto.RegisterType((*HTTPGetAction)(nil), "k8s.io.api.core.v1.HTTPGetAction") proto.RegisterType((*HTTPHeader)(nil), "k8s.io.api.core.v1.HTTPHeader") @@ -3948,6 +3956,46 @@ func (m *GitRepoVolumeSource) MarshalTo(dAtA []byte) (int, error) { return i, nil } +func (m *GlusterfsPersistentVolumeSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GlusterfsPersistentVolumeSource) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.EndpointsName))) + i += copy(dAtA[i:], m.EndpointsName) + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Path))) + i += copy(dAtA[i:], m.Path) + dAtA[i] = 0x18 + i++ + if m.ReadOnly { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + if m.EndpointsNamespace != nil { + dAtA[i] = 0x22 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.EndpointsNamespace))) + i += copy(dAtA[i:], *m.EndpointsNamespace) + } + return i, nil +} + func (m *GlusterfsVolumeSource) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -11946,6 +11994,21 @@ func (m *GitRepoVolumeSource) Size() (n int) { return n } +func (m *GlusterfsPersistentVolumeSource) Size() (n int) { + var l int + _ = l + l = len(m.EndpointsName) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Path) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + if m.EndpointsNamespace != nil { + l = len(*m.EndpointsNamespace) + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + func (m *GlusterfsVolumeSource) Size() (n int) { var l int _ = l @@ -15291,6 +15354,19 @@ func (this *GitRepoVolumeSource) String() string { }, "") return s } +func (this *GlusterfsPersistentVolumeSource) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&GlusterfsPersistentVolumeSource{`, + `EndpointsName:` + fmt.Sprintf("%v", this.EndpointsName) + `,`, + `Path:` + fmt.Sprintf("%v", this.Path) + `,`, + `ReadOnly:` + fmt.Sprintf("%v", this.ReadOnly) + `,`, + `EndpointsNamespace:` + valueToStringGenerated(this.EndpointsNamespace) + `,`, + `}`, + }, "") + return s +} func (this *GlusterfsVolumeSource) String() string { if this == nil { return "nil" @@ -16006,7 +16082,7 @@ func (this *PersistentVolumeSource) String() string { `GCEPersistentDisk:` + strings.Replace(fmt.Sprintf("%v", this.GCEPersistentDisk), "GCEPersistentDiskVolumeSource", "GCEPersistentDiskVolumeSource", 1) + `,`, `AWSElasticBlockStore:` + strings.Replace(fmt.Sprintf("%v", this.AWSElasticBlockStore), "AWSElasticBlockStoreVolumeSource", "AWSElasticBlockStoreVolumeSource", 1) + `,`, `HostPath:` + strings.Replace(fmt.Sprintf("%v", this.HostPath), "HostPathVolumeSource", "HostPathVolumeSource", 1) + `,`, - `Glusterfs:` + strings.Replace(fmt.Sprintf("%v", this.Glusterfs), "GlusterfsVolumeSource", "GlusterfsVolumeSource", 1) + `,`, + `Glusterfs:` + strings.Replace(fmt.Sprintf("%v", this.Glusterfs), "GlusterfsPersistentVolumeSource", "GlusterfsPersistentVolumeSource", 1) + `,`, `NFS:` + strings.Replace(fmt.Sprintf("%v", this.NFS), "NFSVolumeSource", "NFSVolumeSource", 1) + `,`, `RBD:` + strings.Replace(fmt.Sprintf("%v", this.RBD), "RBDPersistentVolumeSource", "RBDPersistentVolumeSource", 1) + `,`, `ISCSI:` + strings.Replace(fmt.Sprintf("%v", this.ISCSI), "ISCSIPersistentVolumeSource", "ISCSIPersistentVolumeSource", 1) + `,`, @@ -26700,6 +26776,164 @@ func (m *GitRepoVolumeSource) Unmarshal(dAtA []byte) error { } return nil } +func (m *GlusterfsPersistentVolumeSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GlusterfsPersistentVolumeSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GlusterfsPersistentVolumeSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EndpointsName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EndpointsName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ReadOnly", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.ReadOnly = bool(v != 0) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EndpointsNamespace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.EndpointsNamespace = &s + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *GlusterfsVolumeSource) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -35062,7 +35296,7 @@ func (m *PersistentVolumeSource) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Glusterfs == nil { - m.Glusterfs = &GlusterfsVolumeSource{} + m.Glusterfs = &GlusterfsPersistentVolumeSource{} } if err := m.Glusterfs.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -51414,806 +51648,808 @@ func init() { } var fileDescriptorGenerated = []byte{ - // 12807 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0xbd, 0x6b, 0x70, 0x24, 0xd7, - 0x75, 0x18, 0xac, 0x9e, 0x19, 0x3c, 0xe6, 0xe0, 0x7d, 0x77, 0x97, 0xc4, 0x82, 0xdc, 0x9d, 0x65, - 0x53, 0x5a, 0x2e, 0x45, 0x12, 0x2b, 0x2e, 0x49, 0x91, 0x16, 0x29, 0xda, 0x00, 0x06, 0xd8, 0x1d, - 0xee, 0x02, 0x3b, 0xbc, 0x83, 0x5d, 0x4a, 0x34, 0x25, 0xab, 0x31, 0x73, 0x01, 0x34, 0xd1, 0xe8, - 0x1e, 0x76, 0xf7, 0x60, 0x17, 0xfc, 0xec, 0xaa, 0x2f, 0x72, 0xec, 0x44, 0xb1, 0x2b, 0xa5, 0x8a, - 0x55, 0x79, 0xd8, 0x2e, 0xa7, 0xca, 0x71, 0xca, 0x76, 0x9c, 0xa4, 0xe2, 0xd8, 0xb1, 0x1d, 0xcb, - 0x4e, 0x1c, 0x3b, 0x3f, 0x9c, 0x3f, 0x8a, 0x93, 0xaa, 0x94, 0x5c, 0xe5, 0x0a, 0x62, 0xc3, 0x79, - 0x94, 0x7f, 0xe4, 0x51, 0x71, 0x7e, 0xc4, 0x88, 0x2b, 0x4e, 0xdd, 0x67, 0xdf, 0xdb, 0xd3, 0x3d, - 0x33, 0x58, 0x62, 0x41, 0x5a, 0xa5, 0x7f, 0x33, 0xf7, 0x9c, 0x7b, 0xee, 0xed, 0xfb, 0x3c, 0xe7, - 0xdc, 0xf3, 0x80, 0x57, 0x77, 0x5e, 0x89, 0xe6, 0xdd, 0xe0, 0xea, 0x4e, 0x67, 0x83, 0x84, 0x3e, - 0x89, 0x49, 0x74, 0x75, 0x8f, 0xf8, 0xad, 0x20, 0xbc, 0x2a, 0x00, 0x4e, 0xdb, 0xbd, 0xda, 0x0c, - 0x42, 0x72, 0x75, 0xef, 0xf9, 0xab, 0x5b, 0xc4, 0x27, 0xa1, 0x13, 0x93, 0xd6, 0x7c, 0x3b, 0x0c, - 0xe2, 0x00, 0x21, 0x8e, 0x33, 0xef, 0xb4, 0xdd, 0x79, 0x8a, 0x33, 0xbf, 0xf7, 0xfc, 0xdc, 0x73, - 0x5b, 0x6e, 0xbc, 0xdd, 0xd9, 0x98, 0x6f, 0x06, 0xbb, 0x57, 0xb7, 0x82, 0xad, 0xe0, 0x2a, 0x43, - 0xdd, 0xe8, 0x6c, 0xb2, 0x7f, 0xec, 0x0f, 0xfb, 0xc5, 0x49, 0xcc, 0xbd, 0x98, 0x34, 0xb3, 0xeb, - 0x34, 0xb7, 0x5d, 0x9f, 0x84, 0xfb, 0x57, 0xdb, 0x3b, 0x5b, 0xac, 0xdd, 0x90, 0x44, 0x41, 0x27, - 0x6c, 0x92, 0x74, 0xc3, 0x3d, 0x6b, 0x45, 0x57, 0x77, 0x49, 0xec, 0x64, 0x74, 0x77, 0xee, 0x6a, - 0x5e, 0xad, 0xb0, 0xe3, 0xc7, 0xee, 0x6e, 0x77, 0x33, 0x9f, 0xee, 0x57, 0x21, 0x6a, 0x6e, 0x93, - 0x5d, 0xa7, 0xab, 0xde, 0x0b, 0x79, 0xf5, 0x3a, 0xb1, 0xeb, 0x5d, 0x75, 0xfd, 0x38, 0x8a, 0xc3, - 0x74, 0x25, 0xfb, 0x9b, 0x16, 0x5c, 0x5a, 0x78, 0xab, 0xb1, 0xec, 0x39, 0x51, 0xec, 0x36, 0x17, - 0xbd, 0xa0, 0xb9, 0xd3, 0x88, 0x83, 0x90, 0xdc, 0x0d, 0xbc, 0xce, 0x2e, 0x69, 0xb0, 0x81, 0x40, - 0xcf, 0xc2, 0xe8, 0x1e, 0xfb, 0x5f, 0xab, 0xce, 0x5a, 0x97, 0xac, 0x2b, 0xe5, 0xc5, 0xe9, 0xdf, - 0x3e, 0xa8, 0x7c, 0xec, 0xf0, 0xa0, 0x32, 0x7a, 0x57, 0x94, 0x63, 0x85, 0x81, 0x2e, 0xc3, 0xf0, - 0x66, 0xb4, 0xbe, 0xdf, 0x26, 0xb3, 0x05, 0x86, 0x3b, 0x29, 0x70, 0x87, 0x57, 0x1a, 0xb4, 0x14, - 0x0b, 0x28, 0xba, 0x0a, 0xe5, 0xb6, 0x13, 0xc6, 0x6e, 0xec, 0x06, 0xfe, 0x6c, 0xf1, 0x92, 0x75, - 0x65, 0x68, 0x71, 0x46, 0xa0, 0x96, 0xeb, 0x12, 0x80, 0x13, 0x1c, 0xda, 0x8d, 0x90, 0x38, 0xad, - 0xdb, 0xbe, 0xb7, 0x3f, 0x5b, 0xba, 0x64, 0x5d, 0x19, 0x4d, 0xba, 0x81, 0x45, 0x39, 0x56, 0x18, - 0xf6, 0x8f, 0x16, 0x60, 0x74, 0x61, 0x73, 0xd3, 0xf5, 0xdd, 0x78, 0x1f, 0xdd, 0x85, 0x71, 0x3f, - 0x68, 0x11, 0xf9, 0x9f, 0x7d, 0xc5, 0xd8, 0xb5, 0x4b, 0xf3, 0xdd, 0x4b, 0x69, 0x7e, 0x4d, 0xc3, - 0x5b, 0x9c, 0x3e, 0x3c, 0xa8, 0x8c, 0xeb, 0x25, 0xd8, 0xa0, 0x83, 0x30, 0x8c, 0xb5, 0x83, 0x96, - 0x22, 0x5b, 0x60, 0x64, 0x2b, 0x59, 0x64, 0xeb, 0x09, 0xda, 0xe2, 0xd4, 0xe1, 0x41, 0x65, 0x4c, - 0x2b, 0xc0, 0x3a, 0x11, 0xb4, 0x01, 0x53, 0xf4, 0xaf, 0x1f, 0xbb, 0x8a, 0x6e, 0x91, 0xd1, 0x7d, - 0x32, 0x8f, 0xae, 0x86, 0xba, 0x78, 0xe6, 0xf0, 0xa0, 0x32, 0x95, 0x2a, 0xc4, 0x69, 0x82, 0xf6, - 0xfb, 0x30, 0xb9, 0x10, 0xc7, 0x4e, 0x73, 0x9b, 0xb4, 0xf8, 0x0c, 0xa2, 0x17, 0xa1, 0xe4, 0x3b, - 0xbb, 0x44, 0xcc, 0xef, 0x25, 0x31, 0xb0, 0xa5, 0x35, 0x67, 0x97, 0x1c, 0x1d, 0x54, 0xa6, 0xef, - 0xf8, 0xee, 0x7b, 0x1d, 0xb1, 0x2a, 0x68, 0x19, 0x66, 0xd8, 0xe8, 0x1a, 0x40, 0x8b, 0xec, 0xb9, - 0x4d, 0x52, 0x77, 0xe2, 0x6d, 0x31, 0xdf, 0x48, 0xd4, 0x85, 0xaa, 0x82, 0x60, 0x0d, 0xcb, 0xbe, - 0x0f, 0xe5, 0x85, 0xbd, 0xc0, 0x6d, 0xd5, 0x83, 0x56, 0x84, 0x76, 0x60, 0xaa, 0x1d, 0x92, 0x4d, - 0x12, 0xaa, 0xa2, 0x59, 0xeb, 0x52, 0xf1, 0xca, 0xd8, 0xb5, 0x2b, 0x99, 0x1f, 0x6b, 0xa2, 0x2e, - 0xfb, 0x71, 0xb8, 0xbf, 0xf8, 0xa8, 0x68, 0x6f, 0x2a, 0x05, 0xc5, 0x69, 0xca, 0xf6, 0xbf, 0x2c, - 0xc0, 0xb9, 0x85, 0xf7, 0x3b, 0x21, 0xa9, 0xba, 0xd1, 0x4e, 0x7a, 0x85, 0xb7, 0xdc, 0x68, 0x67, - 0x2d, 0x19, 0x01, 0xb5, 0xb4, 0xaa, 0xa2, 0x1c, 0x2b, 0x0c, 0xf4, 0x1c, 0x8c, 0xd0, 0xdf, 0x77, - 0x70, 0x4d, 0x7c, 0xf2, 0x19, 0x81, 0x3c, 0x56, 0x75, 0x62, 0xa7, 0xca, 0x41, 0x58, 0xe2, 0xa0, - 0x55, 0x18, 0x6b, 0xb2, 0x0d, 0xb9, 0xb5, 0x1a, 0xb4, 0x08, 0x9b, 0xcc, 0xf2, 0xe2, 0x33, 0x14, - 0x7d, 0x29, 0x29, 0x3e, 0x3a, 0xa8, 0xcc, 0xf2, 0xbe, 0x09, 0x12, 0x1a, 0x0c, 0xeb, 0xf5, 0x91, - 0xad, 0xf6, 0x57, 0x89, 0x51, 0x82, 0x8c, 0xbd, 0x75, 0x45, 0xdb, 0x2a, 0x43, 0x6c, 0xab, 0x8c, - 0x67, 0x6f, 0x13, 0xf4, 0x3c, 0x94, 0x76, 0x5c, 0xbf, 0x35, 0x3b, 0xcc, 0x68, 0x5d, 0xa0, 0x73, - 0x7e, 0xd3, 0xf5, 0x5b, 0x47, 0x07, 0x95, 0x19, 0xa3, 0x3b, 0xb4, 0x10, 0x33, 0x54, 0xfb, 0x8f, - 0x2d, 0xa8, 0x30, 0xd8, 0x8a, 0xeb, 0x91, 0x3a, 0x09, 0x23, 0x37, 0x8a, 0x89, 0x1f, 0x1b, 0x03, - 0x7a, 0x0d, 0x20, 0x22, 0xcd, 0x90, 0xc4, 0xda, 0x90, 0xaa, 0x85, 0xd1, 0x50, 0x10, 0xac, 0x61, - 0xd1, 0x03, 0x21, 0xda, 0x76, 0x42, 0xb6, 0xbe, 0xc4, 0xc0, 0xaa, 0x03, 0xa1, 0x21, 0x01, 0x38, - 0xc1, 0x31, 0x0e, 0x84, 0x62, 0xbf, 0x03, 0x01, 0x7d, 0x16, 0xa6, 0x92, 0xc6, 0xa2, 0xb6, 0xd3, - 0x94, 0x03, 0xc8, 0xb6, 0x4c, 0xc3, 0x04, 0xe1, 0x34, 0xae, 0xfd, 0xf7, 0x2c, 0xb1, 0x78, 0xe8, - 0x57, 0x7f, 0xc4, 0xbf, 0xd5, 0xfe, 0x15, 0x0b, 0x46, 0x16, 0x5d, 0xbf, 0xe5, 0xfa, 0x5b, 0xe8, - 0x4b, 0x30, 0x4a, 0xef, 0xa6, 0x96, 0x13, 0x3b, 0xe2, 0xdc, 0xfb, 0x94, 0xb6, 0xb7, 0xd4, 0x55, - 0x31, 0xdf, 0xde, 0xd9, 0xa2, 0x05, 0xd1, 0x3c, 0xc5, 0xa6, 0xbb, 0xed, 0xf6, 0xc6, 0xbb, 0xa4, - 0x19, 0xaf, 0x92, 0xd8, 0x49, 0x3e, 0x27, 0x29, 0xc3, 0x8a, 0x2a, 0xba, 0x09, 0xc3, 0xb1, 0x13, - 0x6e, 0x91, 0x58, 0x1c, 0x80, 0x99, 0x07, 0x15, 0xaf, 0x89, 0xe9, 0x8e, 0x24, 0x7e, 0x93, 0x24, - 0xd7, 0xc2, 0x3a, 0xab, 0x8a, 0x05, 0x09, 0xfb, 0xaf, 0x0c, 0xc3, 0xf9, 0xa5, 0x46, 0x2d, 0x67, - 0x5d, 0x5d, 0x86, 0xe1, 0x56, 0xe8, 0xee, 0x91, 0x50, 0x8c, 0xb3, 0xa2, 0x52, 0x65, 0xa5, 0x58, - 0x40, 0xd1, 0x2b, 0x30, 0xce, 0x2f, 0xa4, 0x1b, 0x8e, 0xdf, 0xf2, 0xe4, 0x10, 0x9f, 0x15, 0xd8, - 0xe3, 0x77, 0x35, 0x18, 0x36, 0x30, 0x8f, 0xb9, 0xa8, 0x2e, 0xa7, 0x36, 0x63, 0xde, 0x65, 0xf7, - 0x15, 0x0b, 0xa6, 0x79, 0x33, 0x0b, 0x71, 0x1c, 0xba, 0x1b, 0x9d, 0x98, 0x44, 0xb3, 0x43, 0xec, - 0xa4, 0x5b, 0xca, 0x1a, 0xad, 0xdc, 0x11, 0x98, 0xbf, 0x9b, 0xa2, 0xc2, 0x0f, 0xc1, 0x59, 0xd1, - 0xee, 0x74, 0x1a, 0x8c, 0xbb, 0x9a, 0x45, 0xdf, 0x6f, 0xc1, 0x5c, 0x33, 0xf0, 0xe3, 0x30, 0xf0, - 0x3c, 0x12, 0xd6, 0x3b, 0x1b, 0x9e, 0x1b, 0x6d, 0xf3, 0x75, 0x8a, 0xc9, 0x26, 0x3b, 0x09, 0x72, - 0xe6, 0x50, 0x21, 0x89, 0x39, 0xbc, 0x78, 0x78, 0x50, 0x99, 0x5b, 0xca, 0x25, 0x85, 0x7b, 0x34, - 0x83, 0x76, 0x00, 0xd1, 0xab, 0xb4, 0x11, 0x3b, 0x5b, 0x24, 0x69, 0x7c, 0x64, 0xf0, 0xc6, 0x1f, - 0x39, 0x3c, 0xa8, 0xa0, 0xb5, 0x2e, 0x12, 0x38, 0x83, 0x2c, 0x7a, 0x0f, 0xce, 0xd2, 0xd2, 0xae, - 0x6f, 0x1d, 0x1d, 0xbc, 0xb9, 0xd9, 0xc3, 0x83, 0xca, 0xd9, 0xb5, 0x0c, 0x22, 0x38, 0x93, 0xf4, - 0xdc, 0x12, 0x9c, 0xcb, 0x9c, 0x2a, 0x34, 0x0d, 0xc5, 0x1d, 0xc2, 0x59, 0x90, 0x32, 0xa6, 0x3f, - 0xd1, 0x59, 0x18, 0xda, 0x73, 0xbc, 0x8e, 0x58, 0xa5, 0x98, 0xff, 0xf9, 0x4c, 0xe1, 0x15, 0xcb, - 0x6e, 0xc2, 0xf8, 0x92, 0xd3, 0x76, 0x36, 0x5c, 0xcf, 0x8d, 0x5d, 0x12, 0xa1, 0xa7, 0xa0, 0xe8, - 0xb4, 0x5a, 0xec, 0x8a, 0x2c, 0x2f, 0x9e, 0x3b, 0x3c, 0xa8, 0x14, 0x17, 0x5a, 0xf4, 0xac, 0x06, - 0x85, 0xb5, 0x8f, 0x29, 0x06, 0xfa, 0x24, 0x94, 0x5a, 0x61, 0xd0, 0x9e, 0x2d, 0x30, 0x4c, 0x3a, - 0x54, 0xa5, 0x6a, 0x18, 0xb4, 0x53, 0xa8, 0x0c, 0xc7, 0xfe, 0x8d, 0x02, 0x3c, 0xbe, 0x44, 0xda, - 0xdb, 0x2b, 0x8d, 0x9c, 0x4d, 0x77, 0x05, 0x46, 0x77, 0x03, 0xdf, 0x8d, 0x83, 0x30, 0x12, 0x4d, - 0xb3, 0xdb, 0x64, 0x55, 0x94, 0x61, 0x05, 0x45, 0x97, 0xa0, 0xd4, 0x4e, 0x38, 0x81, 0x71, 0xc9, - 0x45, 0x30, 0x1e, 0x80, 0x41, 0x28, 0x46, 0x27, 0x22, 0xa1, 0xb8, 0x05, 0x15, 0xc6, 0x9d, 0x88, - 0x84, 0x98, 0x41, 0x92, 0xe3, 0x94, 0x1e, 0xb4, 0x62, 0x5b, 0xa5, 0x8e, 0x53, 0x0a, 0xc1, 0x1a, - 0x16, 0xaa, 0x43, 0x39, 0x52, 0x93, 0x3a, 0x34, 0xf8, 0xa4, 0x4e, 0xb0, 0xf3, 0x56, 0xcd, 0x64, - 0x42, 0xc4, 0x38, 0x06, 0x86, 0xfb, 0x9e, 0xb7, 0x5f, 0x2f, 0x00, 0xe2, 0x43, 0xf8, 0xe7, 0x6c, - 0xe0, 0xee, 0x74, 0x0f, 0x5c, 0x26, 0xe7, 0x75, 0x2b, 0x68, 0x3a, 0x5e, 0xfa, 0x08, 0x3f, 0xa9, - 0xd1, 0xfb, 0x5f, 0x16, 0x3c, 0xbe, 0xe4, 0xfa, 0x2d, 0x12, 0xe6, 0x2c, 0xc0, 0x87, 0x23, 0x80, - 0x1c, 0xef, 0xa4, 0x37, 0x96, 0x58, 0xe9, 0x04, 0x96, 0x98, 0xfd, 0xdf, 0x2d, 0x40, 0xfc, 0xb3, - 0x3f, 0x72, 0x1f, 0x7b, 0xa7, 0xfb, 0x63, 0x4f, 0x60, 0x59, 0xd8, 0xb7, 0x60, 0x72, 0xc9, 0x73, - 0x89, 0x1f, 0xd7, 0xea, 0x4b, 0x81, 0xbf, 0xe9, 0x6e, 0xa1, 0xcf, 0xc0, 0x24, 0x95, 0x69, 0x83, - 0x4e, 0xdc, 0x20, 0xcd, 0xc0, 0x67, 0xec, 0x3f, 0x95, 0x04, 0xd1, 0xe1, 0x41, 0x65, 0x72, 0xdd, - 0x80, 0xe0, 0x14, 0xa6, 0xfd, 0x7b, 0x74, 0xfc, 0x82, 0xdd, 0x76, 0xe0, 0x13, 0x3f, 0x5e, 0x0a, - 0xfc, 0x16, 0x17, 0x13, 0x3f, 0x03, 0xa5, 0x98, 0x8e, 0x07, 0x1f, 0xbb, 0xcb, 0x72, 0xa3, 0xd0, - 0x51, 0x38, 0x3a, 0xa8, 0x3c, 0xd2, 0x5d, 0x83, 0x8d, 0x13, 0xab, 0x83, 0xbe, 0x03, 0x86, 0xa3, - 0xd8, 0x89, 0x3b, 0x91, 0x18, 0xcd, 0x27, 0xe4, 0x68, 0x36, 0x58, 0xe9, 0xd1, 0x41, 0x65, 0x4a, - 0x55, 0xe3, 0x45, 0x58, 0x54, 0x40, 0x4f, 0xc3, 0xc8, 0x2e, 0x89, 0x22, 0x67, 0x4b, 0x72, 0xf8, - 0x53, 0xa2, 0xee, 0xc8, 0x2a, 0x2f, 0xc6, 0x12, 0x8e, 0x9e, 0x84, 0x21, 0x12, 0x86, 0x41, 0x28, - 0xf6, 0xe8, 0x84, 0x40, 0x1c, 0x5a, 0xa6, 0x85, 0x98, 0xc3, 0xec, 0x7f, 0x6d, 0xc1, 0x94, 0xea, - 0x2b, 0x6f, 0xeb, 0x14, 0x58, 0xb9, 0xb7, 0x01, 0x9a, 0xf2, 0x03, 0x23, 0x76, 0x7b, 0x8c, 0x5d, - 0xbb, 0x9c, 0xc9, 0xa0, 0x74, 0x0d, 0x63, 0x42, 0x59, 0x15, 0x45, 0x58, 0xa3, 0x66, 0xff, 0xba, - 0x05, 0x67, 0x52, 0x5f, 0x74, 0xcb, 0x8d, 0x62, 0xf4, 0x4e, 0xd7, 0x57, 0xcd, 0x0f, 0xf6, 0x55, - 0xb4, 0x36, 0xfb, 0x26, 0xb5, 0x94, 0x65, 0x89, 0xf6, 0x45, 0x37, 0x60, 0xc8, 0x8d, 0xc9, 0xae, - 0xfc, 0x98, 0x27, 0x7b, 0x7e, 0x0c, 0xef, 0x55, 0x32, 0x23, 0x35, 0x5a, 0x13, 0x73, 0x02, 0xf6, - 0x8f, 0x14, 0xa1, 0xcc, 0x97, 0xed, 0xaa, 0xd3, 0x3e, 0x85, 0xb9, 0xa8, 0x41, 0x89, 0x51, 0xe7, - 0x1d, 0x7f, 0x2a, 0xbb, 0xe3, 0xa2, 0x3b, 0xf3, 0x54, 0x4e, 0xe3, 0xac, 0xa0, 0xba, 0x1a, 0x68, - 0x11, 0x66, 0x24, 0x90, 0x03, 0xb0, 0xe1, 0xfa, 0x4e, 0xb8, 0x4f, 0xcb, 0x66, 0x8b, 0x8c, 0xe0, - 0x73, 0xbd, 0x09, 0x2e, 0x2a, 0x7c, 0x4e, 0x56, 0xf5, 0x35, 0x01, 0x60, 0x8d, 0xe8, 0xdc, 0xcb, - 0x50, 0x56, 0xc8, 0xc7, 0xe1, 0x71, 0xe6, 0x3e, 0x0b, 0x53, 0xa9, 0xb6, 0xfa, 0x55, 0x1f, 0xd7, - 0x59, 0xa4, 0x5f, 0x65, 0xa7, 0x80, 0xe8, 0xf5, 0xb2, 0xbf, 0x27, 0x4e, 0xd1, 0xf7, 0xe1, 0xac, - 0x97, 0x71, 0x38, 0x89, 0xa9, 0x1a, 0xfc, 0x30, 0x7b, 0x5c, 0x7c, 0xf6, 0xd9, 0x2c, 0x28, 0xce, - 0x6c, 0x83, 0x5e, 0xfb, 0x41, 0x9b, 0xae, 0x79, 0xc7, 0x63, 0xfd, 0x15, 0xd2, 0xf7, 0x6d, 0x51, - 0x86, 0x15, 0x94, 0x1e, 0x61, 0x67, 0x55, 0xe7, 0x6f, 0x92, 0xfd, 0x06, 0xf1, 0x48, 0x33, 0x0e, - 0xc2, 0x0f, 0xb5, 0xfb, 0x17, 0xf8, 0xe8, 0xf3, 0x13, 0x70, 0x4c, 0x10, 0x28, 0xde, 0x24, 0xfb, - 0x7c, 0x2a, 0xf4, 0xaf, 0x2b, 0xf6, 0xfc, 0xba, 0x9f, 0xb7, 0x60, 0x42, 0x7d, 0xdd, 0x29, 0x6c, - 0xf5, 0x45, 0x73, 0xab, 0x5f, 0xe8, 0xb9, 0xc0, 0x73, 0x36, 0xf9, 0xd7, 0x0b, 0x70, 0x5e, 0xe1, - 0x50, 0x76, 0x9f, 0xff, 0x11, 0xab, 0xea, 0x2a, 0x94, 0x7d, 0xa5, 0x3d, 0xb0, 0x4c, 0xb1, 0x3d, - 0xd1, 0x1d, 0x24, 0x38, 0x94, 0x6b, 0xf3, 0x13, 0x11, 0x7f, 0x5c, 0x57, 0xab, 0x09, 0x15, 0xda, - 0x22, 0x14, 0x3b, 0x6e, 0x4b, 0xdc, 0x19, 0x9f, 0x92, 0xa3, 0x7d, 0xa7, 0x56, 0x3d, 0x3a, 0xa8, - 0x3c, 0x91, 0xa7, 0xd2, 0xa5, 0x97, 0x55, 0x34, 0x7f, 0xa7, 0x56, 0xc5, 0xb4, 0x32, 0x5a, 0x80, - 0x29, 0xa9, 0xb5, 0xbe, 0x4b, 0x39, 0xa8, 0xc0, 0x17, 0x57, 0x8b, 0xd2, 0x8d, 0x61, 0x13, 0x8c, - 0xd3, 0xf8, 0xa8, 0x0a, 0xd3, 0x3b, 0x9d, 0x0d, 0xe2, 0x91, 0x98, 0x7f, 0xf0, 0x4d, 0xc2, 0x35, - 0x47, 0xe5, 0x44, 0xb4, 0xbc, 0x99, 0x82, 0xe3, 0xae, 0x1a, 0xf6, 0x9f, 0xb1, 0x23, 0x5e, 0x8c, - 0x5e, 0x3d, 0x0c, 0xe8, 0xc2, 0xa2, 0xd4, 0x3f, 0xcc, 0xe5, 0x3c, 0xc8, 0xaa, 0xb8, 0x49, 0xf6, - 0xd7, 0x03, 0xca, 0x6c, 0x67, 0xaf, 0x0a, 0x63, 0xcd, 0x97, 0x7a, 0xae, 0xf9, 0x5f, 0x2c, 0xc0, - 0x39, 0x35, 0x02, 0x06, 0x5f, 0xf7, 0xe7, 0x7d, 0x0c, 0x9e, 0x87, 0xb1, 0x16, 0xd9, 0x74, 0x3a, - 0x5e, 0xac, 0xd4, 0x98, 0x43, 0x5c, 0x95, 0x5d, 0x4d, 0x8a, 0xb1, 0x8e, 0x73, 0x8c, 0x61, 0xfb, - 0xa9, 0x31, 0x76, 0xb7, 0xc6, 0x0e, 0x5d, 0xe3, 0x6a, 0xd7, 0x58, 0xb9, 0xbb, 0xe6, 0x49, 0x18, - 0x72, 0x77, 0x29, 0xaf, 0x55, 0x30, 0x59, 0xa8, 0x1a, 0x2d, 0xc4, 0x1c, 0x86, 0x3e, 0x01, 0x23, - 0xcd, 0x60, 0x77, 0xd7, 0xf1, 0x5b, 0xec, 0xca, 0x2b, 0x2f, 0x8e, 0x51, 0x76, 0x6c, 0x89, 0x17, - 0x61, 0x09, 0x43, 0x8f, 0x43, 0xc9, 0x09, 0xb7, 0xa2, 0xd9, 0x12, 0xc3, 0x19, 0xa5, 0x2d, 0x2d, - 0x84, 0x5b, 0x11, 0x66, 0xa5, 0x54, 0xaa, 0xba, 0x17, 0x84, 0x3b, 0xae, 0xbf, 0x55, 0x75, 0x43, - 0xb1, 0x25, 0xd4, 0x5d, 0xf8, 0x96, 0x82, 0x60, 0x0d, 0x0b, 0xad, 0xc0, 0x50, 0x3b, 0x08, 0xe3, - 0x68, 0x76, 0x98, 0x0d, 0xf7, 0x13, 0x39, 0x07, 0x11, 0xff, 0xda, 0x7a, 0x10, 0xc6, 0xc9, 0x07, - 0xd0, 0x7f, 0x11, 0xe6, 0xd5, 0xd1, 0x77, 0x40, 0x91, 0xf8, 0x7b, 0xb3, 0x23, 0x8c, 0xca, 0x5c, - 0x16, 0x95, 0x65, 0x7f, 0xef, 0xae, 0x13, 0x26, 0xa7, 0xf4, 0xb2, 0xbf, 0x87, 0x69, 0x1d, 0xf4, - 0x79, 0x28, 0xcb, 0x2d, 0x1e, 0x09, 0x35, 0x47, 0xe6, 0x12, 0x93, 0x07, 0x03, 0x26, 0xef, 0x75, - 0xdc, 0x90, 0xec, 0x12, 0x3f, 0x8e, 0x92, 0x33, 0x4d, 0x42, 0x23, 0x9c, 0x50, 0x43, 0x9f, 0x97, - 0xba, 0xb5, 0xd5, 0xa0, 0xe3, 0xc7, 0xd1, 0x6c, 0x99, 0x75, 0x2f, 0xf3, 0xd5, 0xe3, 0x6e, 0x82, - 0x97, 0x56, 0xbe, 0xf1, 0xca, 0xd8, 0x20, 0x85, 0x30, 0x4c, 0x78, 0xee, 0x1e, 0xf1, 0x49, 0x14, - 0xd5, 0xc3, 0x60, 0x83, 0xcc, 0x02, 0xeb, 0xf9, 0xf9, 0xec, 0xc7, 0x80, 0x60, 0x83, 0x2c, 0xce, - 0x1c, 0x1e, 0x54, 0x26, 0x6e, 0xe9, 0x75, 0xb0, 0x49, 0x02, 0xdd, 0x81, 0x49, 0x2a, 0xd7, 0xb8, - 0x09, 0xd1, 0xb1, 0x7e, 0x44, 0x99, 0xf4, 0x81, 0x8d, 0x4a, 0x38, 0x45, 0x04, 0xbd, 0x01, 0x65, - 0xcf, 0xdd, 0x24, 0xcd, 0xfd, 0xa6, 0x47, 0x66, 0xc7, 0x19, 0xc5, 0xcc, 0x6d, 0x75, 0x4b, 0x22, - 0x71, 0xb9, 0x48, 0xfd, 0xc5, 0x49, 0x75, 0x74, 0x17, 0x1e, 0x89, 0x49, 0xb8, 0xeb, 0xfa, 0x0e, - 0xdd, 0x0e, 0x42, 0x5e, 0x60, 0x4f, 0x2a, 0x13, 0x6c, 0xbd, 0x5d, 0x14, 0x43, 0xf7, 0xc8, 0x7a, - 0x26, 0x16, 0xce, 0xa9, 0x8d, 0x6e, 0xc3, 0x14, 0xdb, 0x09, 0xf5, 0x8e, 0xe7, 0xd5, 0x03, 0xcf, - 0x6d, 0xee, 0xcf, 0x4e, 0x32, 0x82, 0x9f, 0x90, 0xf7, 0x42, 0xcd, 0x04, 0x1f, 0x1d, 0x54, 0x20, - 0xf9, 0x87, 0xd3, 0xb5, 0xd1, 0x06, 0xd3, 0xa1, 0x77, 0x42, 0x37, 0xde, 0xa7, 0xeb, 0x97, 0xdc, - 0x8f, 0x67, 0xa7, 0x7a, 0x8a, 0xc2, 0x3a, 0xaa, 0x52, 0xb4, 0xeb, 0x85, 0x38, 0x4d, 0x90, 0x6e, - 0xed, 0x28, 0x6e, 0xb9, 0xfe, 0xec, 0x34, 0x3b, 0x31, 0xd4, 0xce, 0x68, 0xd0, 0x42, 0xcc, 0x61, - 0x4c, 0x7f, 0x4e, 0x7f, 0xdc, 0xa6, 0x27, 0xe8, 0x0c, 0x43, 0x4c, 0xf4, 0xe7, 0x12, 0x80, 0x13, - 0x1c, 0xca, 0xd4, 0xc4, 0xf1, 0xfe, 0x2c, 0x62, 0xa8, 0x6a, 0xbb, 0xac, 0xaf, 0x7f, 0x1e, 0xd3, - 0x72, 0x74, 0x0b, 0x46, 0x88, 0xbf, 0xb7, 0x12, 0x06, 0xbb, 0xb3, 0x67, 0xf2, 0xf7, 0xec, 0x32, - 0x47, 0xe1, 0x07, 0x7a, 0x22, 0xe0, 0x89, 0x62, 0x2c, 0x49, 0xa0, 0xfb, 0x30, 0x9b, 0x31, 0x23, - 0x7c, 0x02, 0xce, 0xb2, 0x09, 0x78, 0x4d, 0xd4, 0x9d, 0x5d, 0xcf, 0xc1, 0x3b, 0xea, 0x01, 0xc3, - 0xb9, 0xd4, 0xd1, 0x17, 0x60, 0x82, 0x6f, 0x28, 0xfe, 0xf8, 0x16, 0xcd, 0x9e, 0x63, 0x5f, 0x73, - 0x29, 0x7f, 0x73, 0x72, 0xc4, 0xc5, 0x73, 0xa2, 0x43, 0x13, 0x7a, 0x69, 0x84, 0x4d, 0x6a, 0xf6, - 0x06, 0x4c, 0xaa, 0x73, 0x8b, 0x2d, 0x1d, 0x54, 0x81, 0x21, 0xc6, 0xed, 0x08, 0xfd, 0x56, 0x99, - 0xce, 0x14, 0xe3, 0x84, 0x30, 0x2f, 0x67, 0x33, 0xe5, 0xbe, 0x4f, 0x16, 0xf7, 0x63, 0xc2, 0xa5, - 0xea, 0xa2, 0x36, 0x53, 0x12, 0x80, 0x13, 0x1c, 0xfb, 0xff, 0x72, 0xae, 0x31, 0x39, 0x1c, 0x07, - 0xb8, 0x0e, 0x9e, 0x85, 0xd1, 0xed, 0x20, 0x8a, 0x29, 0x36, 0x6b, 0x63, 0x28, 0xe1, 0x13, 0x6f, - 0x88, 0x72, 0xac, 0x30, 0xd0, 0xab, 0x30, 0xd1, 0xd4, 0x1b, 0x10, 0x77, 0x99, 0x1a, 0x02, 0xa3, - 0x75, 0x6c, 0xe2, 0xa2, 0x57, 0x60, 0x94, 0x3d, 0x9d, 0x37, 0x03, 0x4f, 0x30, 0x59, 0xf2, 0x42, - 0x1e, 0xad, 0x8b, 0xf2, 0x23, 0xed, 0x37, 0x56, 0xd8, 0xe8, 0x32, 0x0c, 0xd3, 0x2e, 0xd4, 0xea, - 0xe2, 0x16, 0x51, 0xaa, 0x9a, 0x1b, 0xac, 0x14, 0x0b, 0xa8, 0xfd, 0xd7, 0x0a, 0xda, 0x28, 0x53, - 0x89, 0x94, 0xa0, 0x3a, 0x8c, 0xdc, 0x73, 0xdc, 0xd8, 0xf5, 0xb7, 0x04, 0xbb, 0xf0, 0x74, 0xcf, - 0x2b, 0x85, 0x55, 0x7a, 0x8b, 0x57, 0xe0, 0x97, 0x9e, 0xf8, 0x83, 0x25, 0x19, 0x4a, 0x31, 0xec, - 0xf8, 0x3e, 0xa5, 0x58, 0x18, 0x94, 0x22, 0xe6, 0x15, 0x38, 0x45, 0xf1, 0x07, 0x4b, 0x32, 0xe8, - 0x1d, 0x00, 0xb9, 0x2c, 0x49, 0x4b, 0x3c, 0x59, 0x3f, 0xdb, 0x9f, 0xe8, 0xba, 0xaa, 0xb3, 0x38, - 0x49, 0xaf, 0xd4, 0xe4, 0x3f, 0xd6, 0xe8, 0xd9, 0x31, 0x63, 0xab, 0xba, 0x3b, 0x83, 0xbe, 0x9b, - 0x9e, 0x04, 0x4e, 0x18, 0x93, 0xd6, 0x42, 0x2c, 0x06, 0xe7, 0x93, 0x83, 0xc9, 0x14, 0xeb, 0xee, - 0x2e, 0xd1, 0x4f, 0x0d, 0x41, 0x04, 0x27, 0xf4, 0xec, 0x5f, 0x2e, 0xc2, 0x6c, 0x5e, 0x77, 0xe9, - 0xa2, 0x23, 0xf7, 0xdd, 0x78, 0x89, 0x72, 0x43, 0x96, 0xb9, 0xe8, 0x96, 0x45, 0x39, 0x56, 0x18, - 0x74, 0xf6, 0x23, 0x77, 0x4b, 0x8a, 0x84, 0x43, 0xc9, 0xec, 0x37, 0x58, 0x29, 0x16, 0x50, 0x8a, - 0x17, 0x12, 0x27, 0x12, 0x36, 0x11, 0xda, 0x2a, 0xc1, 0xac, 0x14, 0x0b, 0xa8, 0xae, 0x6f, 0x2a, - 0xf5, 0xd1, 0x37, 0x19, 0x43, 0x34, 0x74, 0xb2, 0x43, 0x84, 0xbe, 0x08, 0xb0, 0xe9, 0xfa, 0x6e, - 0xb4, 0xcd, 0xa8, 0x0f, 0x1f, 0x9b, 0xba, 0xe2, 0xa5, 0x56, 0x14, 0x15, 0xac, 0x51, 0x44, 0x2f, - 0xc1, 0x98, 0xda, 0x80, 0xb5, 0x2a, 0x7b, 0x20, 0xd2, 0x1e, 0xdc, 0x93, 0xd3, 0xa8, 0x8a, 0x75, - 0x3c, 0xfb, 0xdd, 0xf4, 0x7a, 0x11, 0x3b, 0x40, 0x1b, 0x5f, 0x6b, 0xd0, 0xf1, 0x2d, 0xf4, 0x1e, - 0x5f, 0xfb, 0x37, 0x8b, 0x30, 0x65, 0x34, 0xd6, 0x89, 0x06, 0x38, 0xb3, 0xae, 0xd3, 0x7b, 0xce, - 0x89, 0x89, 0xd8, 0x7f, 0x76, 0xff, 0xad, 0xa2, 0xdf, 0x85, 0x74, 0x07, 0xf0, 0xfa, 0xe8, 0x8b, - 0x50, 0xf6, 0x9c, 0x88, 0xe9, 0xae, 0x88, 0xd8, 0x77, 0x83, 0x10, 0x4b, 0xe4, 0x08, 0x27, 0x8a, - 0xb5, 0xab, 0x86, 0xd3, 0x4e, 0x48, 0xd2, 0x0b, 0x99, 0xf2, 0x3e, 0xd2, 0xe8, 0x46, 0x75, 0x82, - 0x32, 0x48, 0xfb, 0x98, 0xc3, 0xd0, 0x2b, 0x30, 0x1e, 0x12, 0xb6, 0x2a, 0x96, 0x28, 0x2b, 0xc7, - 0x96, 0xd9, 0x50, 0xc2, 0xf3, 0x61, 0x0d, 0x86, 0x0d, 0xcc, 0x84, 0x95, 0x1f, 0xee, 0xc1, 0xca, - 0x3f, 0x0d, 0x23, 0xec, 0x87, 0x5a, 0x01, 0x6a, 0x36, 0x6a, 0xbc, 0x18, 0x4b, 0x78, 0x7a, 0xc1, - 0x8c, 0x0e, 0xb8, 0x60, 0x3e, 0x09, 0x93, 0x55, 0x87, 0xec, 0x06, 0xfe, 0xb2, 0xdf, 0x6a, 0x07, - 0xae, 0x1f, 0xa3, 0x59, 0x28, 0xb1, 0xdb, 0x81, 0xef, 0xed, 0x12, 0xa5, 0x80, 0x4b, 0x94, 0x31, - 0xb7, 0xb7, 0xe0, 0x5c, 0x35, 0xb8, 0xe7, 0xdf, 0x73, 0xc2, 0xd6, 0x42, 0xbd, 0xa6, 0xc9, 0xb9, - 0x6b, 0x52, 0xce, 0xe2, 0x46, 0x2c, 0x99, 0x67, 0xaa, 0x56, 0x93, 0xdf, 0xb5, 0x2b, 0xae, 0x47, - 0x72, 0xb4, 0x11, 0x7f, 0xa3, 0x60, 0xb4, 0x94, 0xe0, 0xab, 0x07, 0x23, 0x2b, 0xf7, 0xc1, 0xe8, - 0x4d, 0x18, 0xdd, 0x74, 0x89, 0xd7, 0xc2, 0x64, 0x53, 0x2c, 0xb1, 0xa7, 0xf2, 0xdf, 0xe5, 0x57, - 0x28, 0xa6, 0xd4, 0x3e, 0x71, 0x29, 0x6d, 0x45, 0x54, 0xc6, 0x8a, 0x0c, 0xda, 0x81, 0x69, 0x29, - 0x06, 0x48, 0xa8, 0x58, 0x70, 0x4f, 0xf7, 0x92, 0x2d, 0x4c, 0xe2, 0x67, 0x0f, 0x0f, 0x2a, 0xd3, - 0x38, 0x45, 0x06, 0x77, 0x11, 0xa6, 0x62, 0xd9, 0x2e, 0x3d, 0x5a, 0x4b, 0x6c, 0xf8, 0x99, 0x58, - 0xc6, 0x24, 0x4c, 0x56, 0x6a, 0xff, 0xb8, 0x05, 0x8f, 0x76, 0x8d, 0x8c, 0x90, 0xb4, 0x4f, 0x78, - 0x16, 0xd2, 0x92, 0x6f, 0xa1, 0xbf, 0xe4, 0x6b, 0xff, 0x7d, 0x0b, 0xce, 0x2e, 0xef, 0xb6, 0xe3, - 0xfd, 0xaa, 0x6b, 0xbe, 0xee, 0xbc, 0x0c, 0xc3, 0xbb, 0xa4, 0xe5, 0x76, 0x76, 0xc5, 0xcc, 0x55, - 0xe4, 0xf1, 0xb3, 0xca, 0x4a, 0x8f, 0x0e, 0x2a, 0x13, 0x8d, 0x38, 0x08, 0x9d, 0x2d, 0xc2, 0x0b, - 0xb0, 0x40, 0x67, 0x87, 0xb8, 0xfb, 0x3e, 0xb9, 0xe5, 0xee, 0xba, 0xd2, 0xce, 0xa2, 0xa7, 0xee, - 0x6c, 0x5e, 0x0e, 0xe8, 0xfc, 0x9b, 0x1d, 0xc7, 0x8f, 0xdd, 0x78, 0x5f, 0x3c, 0xcc, 0x48, 0x22, - 0x38, 0xa1, 0x67, 0x7f, 0xd3, 0x82, 0x29, 0xb9, 0xee, 0x17, 0x5a, 0xad, 0x90, 0x44, 0x11, 0x9a, - 0x83, 0x82, 0xdb, 0x16, 0xbd, 0x04, 0xd1, 0xcb, 0x42, 0xad, 0x8e, 0x0b, 0x6e, 0x1b, 0xd5, 0xa1, - 0xcc, 0xcd, 0x35, 0x92, 0xc5, 0x35, 0x90, 0xd1, 0x07, 0xeb, 0xc1, 0xba, 0xac, 0x89, 0x13, 0x22, - 0x92, 0x83, 0x63, 0x67, 0x66, 0xd1, 0x7c, 0xf5, 0xba, 0x21, 0xca, 0xb1, 0xc2, 0x40, 0x57, 0x60, - 0xd4, 0x0f, 0x5a, 0xdc, 0x7a, 0x86, 0xdf, 0x7e, 0x6c, 0xc9, 0xae, 0x89, 0x32, 0xac, 0xa0, 0xf6, - 0x0f, 0x5b, 0x30, 0x2e, 0xbf, 0x6c, 0x40, 0x66, 0x92, 0x6e, 0xad, 0x84, 0x91, 0x4c, 0xb6, 0x16, - 0x65, 0x06, 0x19, 0xc4, 0xe0, 0x01, 0x8b, 0xc7, 0xe1, 0x01, 0xed, 0x1f, 0x2b, 0xc0, 0xa4, 0xec, - 0x4e, 0xa3, 0xb3, 0x11, 0x91, 0x18, 0xad, 0x43, 0xd9, 0xe1, 0x43, 0x4e, 0xe4, 0x8a, 0x7d, 0x32, - 0x5b, 0xf8, 0x30, 0xe6, 0x27, 0xb9, 0x96, 0x17, 0x64, 0x6d, 0x9c, 0x10, 0x42, 0x1e, 0xcc, 0xf8, - 0x41, 0xcc, 0x8e, 0x68, 0x05, 0xef, 0xf5, 0x04, 0x92, 0xa6, 0x7e, 0x5e, 0x50, 0x9f, 0x59, 0x4b, - 0x53, 0xc1, 0xdd, 0x84, 0xd1, 0xb2, 0x54, 0x78, 0x14, 0xf3, 0xc5, 0x0d, 0x7d, 0x16, 0xb2, 0xf5, - 0x1d, 0xf6, 0xaf, 0x59, 0x50, 0x96, 0x68, 0xa7, 0xf1, 0xda, 0xb5, 0x0a, 0x23, 0x11, 0x9b, 0x04, - 0x39, 0x34, 0x76, 0xaf, 0x8e, 0xf3, 0xf9, 0x4a, 0x6e, 0x1e, 0xfe, 0x3f, 0xc2, 0x92, 0x06, 0xd3, - 0x77, 0xab, 0xee, 0x7f, 0x44, 0xf4, 0xdd, 0xaa, 0x3f, 0x39, 0x37, 0xcc, 0x7f, 0x61, 0x7d, 0xd6, - 0xc4, 0x5a, 0xca, 0x20, 0xb5, 0x43, 0xb2, 0xe9, 0xde, 0x4f, 0x33, 0x48, 0x75, 0x56, 0x8a, 0x05, - 0x14, 0xbd, 0x03, 0xe3, 0x4d, 0xa9, 0xe8, 0x4c, 0x8e, 0x81, 0xcb, 0x3d, 0x95, 0xee, 0xea, 0x7d, - 0x86, 0x5b, 0xd6, 0x2e, 0x69, 0xf5, 0xb1, 0x41, 0xcd, 0x7c, 0x6e, 0x2f, 0xf6, 0x7b, 0x6e, 0x4f, - 0xe8, 0xe6, 0x3f, 0x3e, 0xff, 0x84, 0x05, 0xc3, 0x5c, 0x5d, 0x36, 0x98, 0x7e, 0x51, 0x7b, 0xae, - 0x4a, 0xc6, 0xee, 0x2e, 0x2d, 0x14, 0xcf, 0x4f, 0x68, 0x15, 0xca, 0xec, 0x07, 0x53, 0x1b, 0x14, - 0xf3, 0x4d, 0x8a, 0x79, 0xab, 0x7a, 0x07, 0xef, 0xca, 0x6a, 0x38, 0xa1, 0x60, 0x7f, 0xad, 0x48, - 0x8f, 0xaa, 0x04, 0xd5, 0xb8, 0xc1, 0xad, 0x87, 0x77, 0x83, 0x17, 0x1e, 0xd6, 0x0d, 0xbe, 0x05, - 0x53, 0x4d, 0xed, 0x71, 0x2b, 0x99, 0xc9, 0x2b, 0x3d, 0x17, 0x89, 0xf6, 0x0e, 0xc6, 0x55, 0x46, - 0x4b, 0x26, 0x11, 0x9c, 0xa6, 0x8a, 0xbe, 0x1b, 0xc6, 0xf9, 0x3c, 0x8b, 0x56, 0xb8, 0xc5, 0xc2, - 0x27, 0xf2, 0xd7, 0x8b, 0xde, 0x04, 0x5b, 0x89, 0x0d, 0xad, 0x3a, 0x36, 0x88, 0xd9, 0xbf, 0x3c, - 0x0a, 0x43, 0xcb, 0x7b, 0xc4, 0x8f, 0x4f, 0xe1, 0x40, 0x6a, 0xc2, 0xa4, 0xeb, 0xef, 0x05, 0xde, - 0x1e, 0x69, 0x71, 0xf8, 0x71, 0x2e, 0xd7, 0x47, 0x04, 0xe9, 0xc9, 0x9a, 0x41, 0x02, 0xa7, 0x48, - 0x3e, 0x0c, 0x09, 0xf3, 0x3a, 0x0c, 0xf3, 0xb9, 0x17, 0xe2, 0x65, 0xa6, 0x32, 0x98, 0x0d, 0xa2, - 0xd8, 0x05, 0x89, 0xf4, 0xcb, 0xb5, 0xcf, 0xa2, 0x3a, 0x7a, 0x17, 0x26, 0x37, 0xdd, 0x30, 0x8a, - 0xa9, 0x68, 0x18, 0xc5, 0xce, 0x6e, 0xfb, 0x01, 0x24, 0x4a, 0x35, 0x0e, 0x2b, 0x06, 0x25, 0x9c, - 0xa2, 0x8c, 0xb6, 0x60, 0x82, 0x0a, 0x39, 0x49, 0x53, 0x23, 0xc7, 0x6e, 0x4a, 0xa9, 0x8c, 0x6e, - 0xe9, 0x84, 0xb0, 0x49, 0x97, 0x1e, 0x26, 0x4d, 0x26, 0x14, 0x8d, 0x32, 0x8e, 0x42, 0x1d, 0x26, - 0x5c, 0x1a, 0xe2, 0x30, 0x7a, 0x26, 0x31, 0xb3, 0x95, 0xb2, 0x79, 0x26, 0x69, 0xc6, 0x29, 0x5f, - 0x82, 0x32, 0xa1, 0x43, 0x48, 0x09, 0x0b, 0xc5, 0xf8, 0xd5, 0xc1, 0xfa, 0xba, 0xea, 0x36, 0xc3, - 0xc0, 0x94, 0xe5, 0x97, 0x25, 0x25, 0x9c, 0x10, 0x45, 0x4b, 0x30, 0x1c, 0x91, 0xd0, 0x25, 0x91, - 0x50, 0x91, 0xf7, 0x98, 0x46, 0x86, 0xc6, 0x6d, 0xcf, 0xf9, 0x6f, 0x2c, 0xaa, 0xd2, 0xe5, 0xe5, - 0x30, 0x69, 0x88, 0x69, 0xc5, 0xb5, 0xe5, 0xb5, 0xc0, 0x4a, 0xb1, 0x80, 0xa2, 0x37, 0x60, 0x24, - 0x24, 0x1e, 0x53, 0x16, 0x4d, 0x0c, 0xbe, 0xc8, 0xb9, 0xee, 0x89, 0xd7, 0xc3, 0x92, 0x00, 0xba, - 0x09, 0x28, 0x24, 0x94, 0x87, 0x70, 0xfd, 0x2d, 0x65, 0xcc, 0x21, 0x74, 0xdd, 0x8f, 0x89, 0xf6, - 0xcf, 0xe0, 0x04, 0x43, 0x5a, 0xa5, 0xe2, 0x8c, 0x6a, 0xe8, 0x3a, 0xcc, 0xa8, 0xd2, 0x9a, 0x1f, - 0xc5, 0x8e, 0xdf, 0x24, 0x4c, 0xcd, 0x5d, 0x4e, 0xb8, 0x22, 0x9c, 0x46, 0xc0, 0xdd, 0x75, 0xec, - 0x9f, 0xa5, 0xec, 0x0c, 0x1d, 0xad, 0x53, 0xe0, 0x05, 0x5e, 0x37, 0x79, 0x81, 0xf3, 0xb9, 0x33, - 0x97, 0xc3, 0x07, 0x1c, 0x5a, 0x30, 0xa6, 0xcd, 0x6c, 0xb2, 0x66, 0xad, 0x1e, 0x6b, 0xb6, 0x03, - 0xd3, 0x74, 0xa5, 0xdf, 0xde, 0x88, 0x48, 0xb8, 0x47, 0x5a, 0x6c, 0x61, 0x16, 0x1e, 0x6c, 0x61, - 0xaa, 0x57, 0xe6, 0x5b, 0x29, 0x82, 0xb8, 0xab, 0x09, 0xf4, 0xb2, 0xd4, 0x9c, 0x14, 0x0d, 0x23, - 0x2d, 0xae, 0x15, 0x39, 0x3a, 0xa8, 0x4c, 0x6b, 0x1f, 0xa2, 0x6b, 0x4a, 0xec, 0x2f, 0xc9, 0x6f, - 0x54, 0xaf, 0xf9, 0x4d, 0xb5, 0x58, 0x52, 0xaf, 0xf9, 0x6a, 0x39, 0xe0, 0x04, 0x87, 0xee, 0x51, - 0x2a, 0x82, 0xa4, 0x5f, 0xf3, 0xa9, 0x80, 0x82, 0x19, 0xc4, 0x7e, 0x01, 0x60, 0xf9, 0x3e, 0x69, - 0xf2, 0xa5, 0xae, 0x3f, 0x40, 0x5a, 0xf9, 0x0f, 0x90, 0xf6, 0xbf, 0xb5, 0x60, 0x72, 0x65, 0xc9, - 0x10, 0x13, 0xe7, 0x01, 0xb8, 0x6c, 0xf4, 0xd6, 0x5b, 0x6b, 0x52, 0xb7, 0xce, 0xd5, 0xa3, 0xaa, - 0x14, 0x6b, 0x18, 0xe8, 0x3c, 0x14, 0xbd, 0x8e, 0x2f, 0x44, 0x96, 0x91, 0xc3, 0x83, 0x4a, 0xf1, - 0x56, 0xc7, 0xc7, 0xb4, 0x4c, 0xb3, 0x10, 0x2c, 0x0e, 0x6c, 0x21, 0xd8, 0xd7, 0xbd, 0x0a, 0x55, - 0x60, 0xe8, 0xde, 0x3d, 0xb7, 0xc5, 0x8d, 0xd8, 0x85, 0xde, 0xff, 0xad, 0xb7, 0x6a, 0xd5, 0x08, - 0xf3, 0x72, 0xfb, 0xab, 0x45, 0x98, 0x5b, 0xf1, 0xc8, 0xfd, 0x0f, 0x68, 0xc8, 0x3f, 0xa8, 0x7d, - 0xe3, 0xf1, 0xf8, 0xc5, 0xe3, 0xda, 0xb0, 0xf6, 0x1f, 0x8f, 0x4d, 0x18, 0xe1, 0x8f, 0xd9, 0xd2, - 0xac, 0xff, 0xd5, 0xac, 0xd6, 0xf3, 0x07, 0x64, 0x9e, 0x3f, 0x8a, 0x0b, 0x73, 0x7e, 0x75, 0xd3, - 0x8a, 0x52, 0x2c, 0x89, 0xcf, 0x7d, 0x06, 0xc6, 0x75, 0xcc, 0x63, 0x59, 0x93, 0xff, 0x85, 0x22, - 0x4c, 0xd3, 0x1e, 0x3c, 0xd4, 0x89, 0xb8, 0xd3, 0x3d, 0x11, 0x27, 0x6d, 0x51, 0xdc, 0x7f, 0x36, - 0xde, 0x49, 0xcf, 0xc6, 0xf3, 0x79, 0xb3, 0x71, 0xda, 0x73, 0xf0, 0xfd, 0x16, 0x9c, 0x59, 0xf1, - 0x82, 0xe6, 0x4e, 0xca, 0xea, 0xf7, 0x25, 0x18, 0xa3, 0xe7, 0x78, 0x64, 0x78, 0x11, 0x19, 0x7e, - 0x65, 0x02, 0x84, 0x75, 0x3c, 0xad, 0xda, 0x9d, 0x3b, 0xb5, 0x6a, 0x96, 0x3b, 0x9a, 0x00, 0x61, - 0x1d, 0xcf, 0xfe, 0x86, 0x05, 0x17, 0xae, 0x2f, 0x2d, 0x27, 0x4b, 0xb1, 0xcb, 0x23, 0x8e, 0x4a, - 0x81, 0x2d, 0xad, 0x2b, 0x89, 0x14, 0x58, 0x65, 0xbd, 0x10, 0xd0, 0x8f, 0x8a, 0xb7, 0xe7, 0xcf, - 0x58, 0x70, 0xe6, 0xba, 0x1b, 0xd3, 0x6b, 0x39, 0xed, 0x9b, 0x45, 0xef, 0xe5, 0xc8, 0x8d, 0x83, - 0x70, 0x3f, 0xed, 0x9b, 0x85, 0x15, 0x04, 0x6b, 0x58, 0xbc, 0xe5, 0x3d, 0x97, 0x99, 0x51, 0x15, - 0x4c, 0x55, 0x14, 0x16, 0xe5, 0x58, 0x61, 0xd0, 0x0f, 0x6b, 0xb9, 0x21, 0x13, 0x25, 0xf6, 0xc5, - 0x09, 0xab, 0x3e, 0xac, 0x2a, 0x01, 0x38, 0xc1, 0xb1, 0x7f, 0xdc, 0x82, 0x73, 0xd7, 0xbd, 0x4e, - 0x14, 0x93, 0x70, 0x33, 0x32, 0x3a, 0xfb, 0x02, 0x94, 0x89, 0x14, 0xd7, 0x45, 0x5f, 0x15, 0x83, - 0xa9, 0xe4, 0x78, 0xee, 0x18, 0xa6, 0xf0, 0x06, 0xf0, 0x1c, 0x38, 0x9e, 0xeb, 0xd8, 0x2f, 0x14, - 0x60, 0xe2, 0xc6, 0xfa, 0x7a, 0xfd, 0x3a, 0x89, 0xc5, 0x2d, 0xd6, 0x5f, 0xd5, 0x8c, 0x35, 0x8d, - 0x59, 0x2f, 0xa1, 0xa8, 0x13, 0xbb, 0xde, 0x3c, 0xf7, 0x44, 0x9e, 0xaf, 0xf9, 0xf1, 0xed, 0xb0, - 0x11, 0x87, 0xae, 0xbf, 0x95, 0xa9, 0x63, 0x93, 0x77, 0x6d, 0x31, 0xef, 0xae, 0x45, 0x2f, 0xc0, - 0x30, 0x73, 0x85, 0x96, 0xe2, 0xc9, 0x63, 0x4a, 0xa6, 0x60, 0xa5, 0x47, 0x07, 0x95, 0xf2, 0x1d, - 0x5c, 0xe3, 0x7f, 0xb0, 0x40, 0x45, 0x77, 0x60, 0x6c, 0x3b, 0x8e, 0xdb, 0x37, 0x88, 0xd3, 0x22, - 0xa1, 0x3c, 0x1d, 0x2e, 0x66, 0x9d, 0x0e, 0x74, 0x10, 0x38, 0x5a, 0xb2, 0xa1, 0x92, 0xb2, 0x08, - 0xeb, 0x74, 0xec, 0x06, 0x40, 0x02, 0x3b, 0x21, 0xfd, 0x82, 0xfd, 0x87, 0x16, 0x8c, 0x70, 0xaf, - 0xb4, 0x10, 0xbd, 0x06, 0x25, 0x72, 0x9f, 0x34, 0x05, 0xe7, 0x98, 0xd9, 0xe1, 0x84, 0xf1, 0xe0, - 0xda, 0x72, 0xfa, 0x1f, 0xb3, 0x5a, 0xe8, 0x06, 0x8c, 0xd0, 0xde, 0x5e, 0x57, 0x2e, 0x7a, 0x4f, - 0xe4, 0x7d, 0xb1, 0x9a, 0x76, 0xce, 0xab, 0x88, 0x22, 0x2c, 0xab, 0x33, 0xcd, 0x6f, 0xb3, 0xdd, - 0xa0, 0x07, 0x58, 0xdc, 0xeb, 0x9e, 0x5d, 0x5f, 0xaa, 0x73, 0x24, 0x41, 0x8d, 0x6b, 0x7e, 0x65, - 0x21, 0x4e, 0x88, 0xd8, 0xeb, 0x50, 0xa6, 0x93, 0xba, 0xe0, 0xb9, 0x4e, 0x6f, 0xa5, 0xf3, 0x33, - 0x50, 0x96, 0x0a, 0xe0, 0x48, 0x38, 0x36, 0x31, 0xaa, 0x52, 0x3f, 0x1c, 0xe1, 0x04, 0x6e, 0x6f, - 0xc2, 0x59, 0xf6, 0xf2, 0xef, 0xc4, 0xdb, 0xc6, 0x1e, 0xeb, 0xbf, 0x98, 0x9f, 0x15, 0x82, 0x18, - 0x9f, 0x99, 0x59, 0xcd, 0x77, 0x60, 0x5c, 0x52, 0x4c, 0x84, 0x32, 0xfb, 0x8f, 0x4a, 0xf0, 0x58, - 0xad, 0x91, 0xef, 0xb0, 0xf8, 0x0a, 0x8c, 0x73, 0x36, 0x8d, 0x2e, 0x6d, 0xc7, 0x13, 0xed, 0xaa, - 0x77, 0xb1, 0x75, 0x0d, 0x86, 0x0d, 0x4c, 0x74, 0x01, 0x8a, 0xee, 0x7b, 0x7e, 0xda, 0x0c, 0xb7, - 0xf6, 0xe6, 0x1a, 0xa6, 0xe5, 0x14, 0x4c, 0x39, 0x3e, 0x7e, 0x94, 0x2a, 0xb0, 0xe2, 0xfa, 0x5e, - 0x87, 0x49, 0x37, 0x6a, 0x46, 0x6e, 0xcd, 0xa7, 0xe7, 0x4c, 0xe2, 0xec, 0x9a, 0x28, 0x09, 0x68, - 0xa7, 0x15, 0x14, 0xa7, 0xb0, 0xb5, 0x73, 0x7d, 0x68, 0x60, 0xae, 0xb1, 0xaf, 0xa7, 0x0f, 0x65, - 0x88, 0xdb, 0xec, 0xeb, 0x22, 0x66, 0xd4, 0x26, 0x18, 0x62, 0xfe, 0xc1, 0x11, 0x96, 0x30, 0x2a, - 0x81, 0x35, 0xb7, 0x9d, 0xf6, 0x42, 0x27, 0xde, 0xae, 0xba, 0x51, 0x33, 0xd8, 0x23, 0xe1, 0x3e, - 0x13, 0x9e, 0x47, 0x13, 0x09, 0x4c, 0x01, 0x96, 0x6e, 0x2c, 0xd4, 0x29, 0x26, 0xee, 0xae, 0x63, - 0x72, 0x85, 0x70, 0x12, 0x5c, 0xe1, 0x02, 0x4c, 0xc9, 0x66, 0x1a, 0x24, 0x62, 0x77, 0xc4, 0x18, - 0xeb, 0x98, 0x32, 0xb5, 0x15, 0xc5, 0xaa, 0x5b, 0x69, 0x7c, 0xf4, 0x32, 0x4c, 0xb8, 0xbe, 0x1b, - 0xbb, 0x4e, 0x1c, 0x84, 0xec, 0x86, 0xe5, 0x72, 0x32, 0xb3, 0x64, 0xab, 0xe9, 0x00, 0x6c, 0xe2, - 0xd9, 0xff, 0xb1, 0x04, 0x33, 0x6c, 0xda, 0xbe, 0xbd, 0xc2, 0x3e, 0x32, 0x2b, 0xec, 0x4e, 0xf7, - 0x0a, 0x3b, 0x09, 0x76, 0xf7, 0xc3, 0x5c, 0x66, 0xef, 0x42, 0x59, 0xd9, 0x02, 0x4b, 0x67, 0x00, - 0x2b, 0xc7, 0x19, 0xa0, 0x3f, 0xf7, 0x21, 0x9f, 0x71, 0x8b, 0x99, 0xcf, 0xb8, 0x7f, 0xcb, 0x82, - 0xc4, 0x24, 0x12, 0xdd, 0x80, 0x72, 0x3b, 0x60, 0x66, 0x07, 0xa1, 0xb4, 0xe5, 0x79, 0x2c, 0xf3, - 0xa2, 0xe2, 0x97, 0x22, 0x1f, 0xbf, 0xba, 0xac, 0x81, 0x93, 0xca, 0x68, 0x11, 0x46, 0xda, 0x21, - 0x69, 0xc4, 0xcc, 0x05, 0xb6, 0x2f, 0x1d, 0xbe, 0x46, 0x38, 0x3e, 0x96, 0x15, 0xed, 0x5f, 0xb4, - 0x00, 0xf8, 0x4b, 0xa9, 0xe3, 0x6f, 0x91, 0x53, 0xd0, 0xfe, 0x56, 0xa1, 0x14, 0xb5, 0x49, 0xb3, - 0x97, 0x41, 0x48, 0xd2, 0x9f, 0x46, 0x9b, 0x34, 0x93, 0x01, 0xa7, 0xff, 0x30, 0xab, 0x6d, 0xff, - 0x00, 0xc0, 0x64, 0x82, 0x56, 0x8b, 0xc9, 0x2e, 0x7a, 0xce, 0x70, 0x89, 0x3b, 0x9f, 0x72, 0x89, - 0x2b, 0x33, 0x6c, 0x4d, 0xd1, 0xf8, 0x2e, 0x14, 0x77, 0x9d, 0xfb, 0x42, 0x93, 0xf4, 0x4c, 0xef, - 0x6e, 0x50, 0xfa, 0xf3, 0xab, 0xce, 0x7d, 0x2e, 0x33, 0x3d, 0x23, 0x17, 0xc8, 0xaa, 0x73, 0xff, - 0x88, 0x9b, 0x7d, 0xb0, 0x43, 0xea, 0x96, 0x1b, 0xc5, 0x5f, 0xfe, 0x0f, 0xc9, 0x7f, 0xb6, 0xec, - 0x68, 0x23, 0xac, 0x2d, 0xd7, 0x17, 0xef, 0x86, 0x03, 0xb5, 0xe5, 0xfa, 0xe9, 0xb6, 0x5c, 0x7f, - 0x80, 0xb6, 0x5c, 0x1f, 0xbd, 0x0f, 0x23, 0xe2, 0x8d, 0x9e, 0xd9, 0x7a, 0x9b, 0x5a, 0xaa, 0xbc, - 0xf6, 0xc4, 0x13, 0x3f, 0x6f, 0xf3, 0xaa, 0x94, 0x09, 0x45, 0x69, 0xdf, 0x76, 0x65, 0x83, 0xe8, - 0xaf, 0x5b, 0x30, 0x29, 0x7e, 0x63, 0xf2, 0x5e, 0x87, 0x44, 0xb1, 0xe0, 0x3d, 0x3f, 0x3d, 0x78, - 0x1f, 0x44, 0x45, 0xde, 0x95, 0x4f, 0xcb, 0x63, 0xd6, 0x04, 0xf6, 0xed, 0x51, 0xaa, 0x17, 0xe8, - 0x1f, 0x5a, 0x70, 0x76, 0xd7, 0xb9, 0xcf, 0x5b, 0xe4, 0x65, 0xd8, 0x89, 0xdd, 0x40, 0xd8, 0xae, - 0xbf, 0x36, 0xd8, 0xf4, 0x77, 0x55, 0xe7, 0x9d, 0x94, 0x66, 0xae, 0x67, 0xb3, 0x50, 0xfa, 0x76, - 0x35, 0xb3, 0x5f, 0x73, 0x9b, 0x30, 0x2a, 0xd7, 0x5b, 0x86, 0xe4, 0x5d, 0xd5, 0x19, 0xeb, 0x63, - 0x9b, 0x48, 0xe8, 0x7e, 0x69, 0xb4, 0x1d, 0xb1, 0xd6, 0x1e, 0x6a, 0x3b, 0xef, 0xc2, 0xb8, 0xbe, - 0xc6, 0x1e, 0x6a, 0x5b, 0xef, 0xc1, 0x99, 0x8c, 0xb5, 0xf4, 0x50, 0x9b, 0xbc, 0x07, 0xe7, 0x73, - 0xd7, 0xc7, 0xc3, 0x6c, 0xd8, 0xfe, 0x05, 0x4b, 0x3f, 0x07, 0x4f, 0x41, 0x05, 0xbf, 0x64, 0xaa, - 0xe0, 0x2f, 0xf6, 0xde, 0x39, 0x39, 0x7a, 0xf8, 0x77, 0xf4, 0x4e, 0xd3, 0x53, 0x1d, 0xbd, 0x01, - 0xc3, 0x1e, 0x2d, 0x91, 0xc6, 0x21, 0x76, 0xff, 0x1d, 0x99, 0xf0, 0x52, 0xac, 0x3c, 0xc2, 0x82, - 0x82, 0xfd, 0x2b, 0x16, 0x94, 0x4e, 0x61, 0x24, 0xb0, 0x39, 0x12, 0xcf, 0xe5, 0x92, 0x16, 0x21, - 0xcd, 0xe6, 0xb1, 0x73, 0x6f, 0xf9, 0x7e, 0x4c, 0xfc, 0x88, 0x89, 0x8a, 0x99, 0x03, 0xf3, 0x3d, - 0x70, 0xe6, 0x56, 0xe0, 0xb4, 0x16, 0x1d, 0xcf, 0xf1, 0x9b, 0x24, 0xac, 0xf9, 0x5b, 0x7d, 0xad, - 0x94, 0x74, 0x9b, 0xa2, 0x42, 0x3f, 0x9b, 0x22, 0x7b, 0x1b, 0x90, 0xde, 0x80, 0xb0, 0xe3, 0xc4, - 0x30, 0xe2, 0xf2, 0xa6, 0xc4, 0xf0, 0x3f, 0x95, 0xcd, 0xdd, 0x75, 0xf5, 0x4c, 0xb3, 0x50, 0xe4, - 0x05, 0x58, 0x12, 0xb2, 0x5f, 0x81, 0x4c, 0xdf, 0xad, 0xfe, 0x6a, 0x03, 0xfb, 0xf3, 0x30, 0xc3, - 0x6a, 0x1e, 0x53, 0xa4, 0xb5, 0x53, 0x4a, 0xba, 0x8c, 0x90, 0x51, 0xf6, 0x57, 0x2c, 0x98, 0x5a, - 0x4b, 0xc5, 0xaf, 0xb8, 0xcc, 0xde, 0x03, 0x33, 0x74, 0xc3, 0x0d, 0x56, 0x8a, 0x05, 0xf4, 0xc4, - 0x75, 0x50, 0x7f, 0x66, 0x41, 0xe2, 0x4e, 0x79, 0x0a, 0x8c, 0xd7, 0x92, 0xc1, 0x78, 0x65, 0xea, - 0x46, 0x54, 0x77, 0xf2, 0xf8, 0x2e, 0x74, 0x53, 0xc5, 0x0e, 0xe8, 0xa1, 0x16, 0x49, 0xc8, 0x70, - 0x4f, 0xf3, 0x49, 0x33, 0xc0, 0x80, 0x8c, 0x26, 0xc0, 0x4c, 0x89, 0x14, 0xee, 0x47, 0xc4, 0x94, - 0x48, 0xf5, 0x27, 0x67, 0x87, 0xd6, 0xb5, 0x2e, 0xb3, 0x93, 0xeb, 0x3b, 0x99, 0x69, 0xb8, 0xe3, - 0xb9, 0xef, 0x13, 0x15, 0x00, 0xa5, 0x22, 0x4c, 0xbd, 0x45, 0xe9, 0xd1, 0x41, 0x65, 0x42, 0xfd, - 0xe3, 0x51, 0xb2, 0x92, 0x2a, 0xf6, 0x0d, 0x98, 0x4a, 0x0d, 0x18, 0x7a, 0x09, 0x86, 0xda, 0xdb, - 0x4e, 0x44, 0x52, 0xe6, 0x93, 0x43, 0x75, 0x5a, 0x78, 0x74, 0x50, 0x99, 0x54, 0x15, 0x58, 0x09, - 0xe6, 0xd8, 0xf6, 0xff, 0xb0, 0xa0, 0xb4, 0x16, 0xb4, 0x4e, 0x63, 0x31, 0xbd, 0x6e, 0x2c, 0xa6, - 0xc7, 0xf3, 0x62, 0x0c, 0xe6, 0xae, 0xa3, 0x95, 0xd4, 0x3a, 0xba, 0x98, 0x4b, 0xa1, 0xf7, 0x12, - 0xda, 0x85, 0x31, 0x16, 0xb9, 0x50, 0x98, 0x73, 0xbe, 0x60, 0xc8, 0x00, 0x95, 0x94, 0x0c, 0x30, - 0xa5, 0xa1, 0x6a, 0x92, 0xc0, 0xd3, 0x30, 0x22, 0x4c, 0x0a, 0xd3, 0x46, 0xf0, 0x02, 0x17, 0x4b, - 0xb8, 0xfd, 0x13, 0x45, 0x30, 0x22, 0x25, 0xa2, 0x5f, 0xb3, 0x60, 0x3e, 0xe4, 0x5e, 0x85, 0xad, - 0x6a, 0x27, 0x74, 0xfd, 0xad, 0x46, 0x73, 0x9b, 0xb4, 0x3a, 0x9e, 0xeb, 0x6f, 0xd5, 0xb6, 0xfc, - 0x40, 0x15, 0x2f, 0xdf, 0x27, 0xcd, 0x0e, 0x7b, 0x17, 0xe8, 0x13, 0x96, 0x51, 0x99, 0xec, 0x5c, - 0x3b, 0x3c, 0xa8, 0xcc, 0xe3, 0x63, 0xd1, 0xc6, 0xc7, 0xec, 0x0b, 0xfa, 0x86, 0x05, 0x57, 0x79, - 0x00, 0xc1, 0xc1, 0xfb, 0xdf, 0x43, 0x62, 0xaa, 0x4b, 0x52, 0x09, 0x91, 0x75, 0x12, 0xee, 0x2e, - 0xbe, 0x2c, 0x06, 0xf4, 0x6a, 0xfd, 0x78, 0x6d, 0xe1, 0xe3, 0x76, 0xce, 0xfe, 0x17, 0x45, 0x98, - 0x10, 0x0e, 0xed, 0x22, 0x52, 0xca, 0x4b, 0xc6, 0x92, 0x78, 0x22, 0xb5, 0x24, 0x66, 0x0c, 0xe4, - 0x93, 0x09, 0x92, 0x12, 0xc1, 0x8c, 0xe7, 0x44, 0xf1, 0x0d, 0xe2, 0x84, 0xf1, 0x06, 0x71, 0xb8, - 0x29, 0x4b, 0xf1, 0xd8, 0x66, 0x37, 0x4a, 0x45, 0x73, 0x2b, 0x4d, 0x0c, 0x77, 0xd3, 0x47, 0x7b, - 0x80, 0x98, 0x3d, 0x4e, 0xe8, 0xf8, 0x11, 0xff, 0x16, 0x57, 0xbc, 0x19, 0x1c, 0xaf, 0xd5, 0x39, - 0xd1, 0x2a, 0xba, 0xd5, 0x45, 0x0d, 0x67, 0xb4, 0xa0, 0xd9, 0x59, 0x0d, 0x0d, 0x6a, 0x67, 0x35, - 0xdc, 0xc7, 0xd3, 0xc4, 0x87, 0xe9, 0xae, 0x98, 0x04, 0x6f, 0x43, 0x59, 0xd9, 0xc3, 0x89, 0x43, - 0xa7, 0x77, 0x68, 0x8f, 0x34, 0x05, 0xae, 0x46, 0x49, 0x6c, 0x31, 0x13, 0x72, 0xf6, 0x3f, 0x2a, - 0x18, 0x0d, 0xf2, 0x49, 0x5c, 0x83, 0x51, 0x27, 0x8a, 0xdc, 0x2d, 0x9f, 0xb4, 0xc4, 0x8e, 0xfd, - 0x78, 0xde, 0x8e, 0x35, 0x9a, 0x61, 0x36, 0x89, 0x0b, 0xa2, 0x26, 0x56, 0x34, 0xd0, 0x0d, 0x6e, - 0x30, 0xb4, 0x27, 0x79, 0xfe, 0xc1, 0xa8, 0x81, 0x34, 0x29, 0xda, 0x23, 0x58, 0xd4, 0x47, 0x5f, - 0xe0, 0x16, 0x5d, 0x37, 0xfd, 0xe0, 0x9e, 0x7f, 0x3d, 0x08, 0xa4, 0x17, 0xda, 0x60, 0x04, 0x67, - 0xa4, 0x1d, 0x97, 0xaa, 0x8e, 0x4d, 0x6a, 0x83, 0xc5, 0xed, 0xf9, 0x5e, 0x38, 0x43, 0x49, 0x9b, - 0xbe, 0x24, 0x11, 0x22, 0x30, 0x25, 0xa2, 0x25, 0xc8, 0x32, 0x31, 0x76, 0x99, 0xec, 0xbc, 0x59, - 0x3b, 0x51, 0xfa, 0xdd, 0x34, 0x49, 0xe0, 0x34, 0x4d, 0xfb, 0xa7, 0x2d, 0x60, 0x56, 0xf0, 0xa7, - 0xc0, 0x32, 0x7c, 0xd6, 0x64, 0x19, 0x66, 0xf3, 0x06, 0x39, 0x87, 0x5b, 0x78, 0x91, 0xaf, 0xac, - 0x7a, 0x18, 0xdc, 0xdf, 0x17, 0xaf, 0xe9, 0xfd, 0x39, 0x59, 0xfb, 0xff, 0x58, 0xfc, 0x10, 0x53, - 0x8e, 0xe9, 0xe8, 0xfb, 0x60, 0xb4, 0xe9, 0xb4, 0x9d, 0x26, 0x0f, 0xeb, 0x9b, 0xab, 0xd5, 0x31, - 0x2a, 0xcd, 0x2f, 0x89, 0x1a, 0x5c, 0x4b, 0x21, 0xa3, 0x6e, 0x8c, 0xca, 0xe2, 0xbe, 0x9a, 0x09, - 0xd5, 0xe4, 0xdc, 0x0e, 0x4c, 0x18, 0xc4, 0x1e, 0xaa, 0x48, 0xfb, 0x7d, 0xfc, 0x8a, 0x55, 0x51, - 0x62, 0x76, 0x61, 0xc6, 0xd7, 0xfe, 0xd3, 0x0b, 0x45, 0x8a, 0x29, 0x1f, 0xef, 0x77, 0x89, 0xb2, - 0xdb, 0x47, 0xb3, 0xf2, 0x4f, 0x91, 0xc1, 0xdd, 0x94, 0xed, 0x9f, 0xb4, 0xe0, 0x51, 0x1d, 0x51, - 0x8b, 0x19, 0xd0, 0x4f, 0x4f, 0x5c, 0x85, 0xd1, 0xa0, 0x4d, 0x42, 0x27, 0x0e, 0x42, 0x71, 0x6b, - 0x5c, 0x91, 0x83, 0x7e, 0x5b, 0x94, 0x1f, 0x89, 0xf8, 0x8a, 0x92, 0xba, 0x2c, 0xc7, 0xaa, 0x26, - 0x95, 0x63, 0xd8, 0x60, 0x44, 0x22, 0x9e, 0x03, 0x3b, 0x03, 0xd8, 0x93, 0x69, 0x84, 0x05, 0xc4, - 0xfe, 0x23, 0x8b, 0x2f, 0x2c, 0xbd, 0xeb, 0xe8, 0x3d, 0x98, 0xde, 0x75, 0xe2, 0xe6, 0xf6, 0xf2, - 0xfd, 0x76, 0xc8, 0xd5, 0xe3, 0x72, 0x9c, 0x9e, 0xe9, 0x37, 0x4e, 0xda, 0x47, 0x26, 0x46, 0x6a, - 0xab, 0x29, 0x62, 0xb8, 0x8b, 0x3c, 0xda, 0x80, 0x31, 0x56, 0xc6, 0xac, 0xa1, 0xa3, 0x5e, 0xac, - 0x41, 0x5e, 0x6b, 0xea, 0xd5, 0x79, 0x35, 0xa1, 0x83, 0x75, 0xa2, 0xf6, 0x97, 0x8b, 0x7c, 0xb7, - 0x33, 0x6e, 0xfb, 0x69, 0x18, 0x69, 0x07, 0xad, 0xa5, 0x5a, 0x15, 0x8b, 0x59, 0x50, 0xd7, 0x48, - 0x9d, 0x17, 0x63, 0x09, 0x47, 0xaf, 0x02, 0x90, 0xfb, 0x31, 0x09, 0x7d, 0xc7, 0x53, 0x46, 0x23, - 0xca, 0x4c, 0xb2, 0x1a, 0xac, 0x05, 0xf1, 0x9d, 0x88, 0x7c, 0xcf, 0xb2, 0x42, 0xc1, 0x1a, 0x3a, - 0xba, 0x06, 0xd0, 0x0e, 0x83, 0x3d, 0xb7, 0xc5, 0xdc, 0xeb, 0x8a, 0xa6, 0x49, 0x45, 0x5d, 0x41, - 0xb0, 0x86, 0x85, 0x5e, 0x85, 0x89, 0x8e, 0x1f, 0x71, 0x0e, 0xc5, 0xd9, 0x10, 0xd1, 0x09, 0x47, - 0x13, 0xeb, 0x86, 0x3b, 0x3a, 0x10, 0x9b, 0xb8, 0x68, 0x01, 0x86, 0x63, 0x87, 0xd9, 0x44, 0x0c, - 0xe5, 0xdb, 0x36, 0xae, 0x53, 0x0c, 0x3d, 0xa8, 0x2c, 0xad, 0x80, 0x45, 0x45, 0xf4, 0xb6, 0xf4, - 0x55, 0xe0, 0x67, 0xbd, 0x30, 0x2a, 0x1e, 0xec, 0x5e, 0xd0, 0x3c, 0x15, 0x84, 0xb1, 0xb2, 0x41, - 0xcb, 0xfe, 0x46, 0x19, 0x20, 0x61, 0xc7, 0xd1, 0xfb, 0x5d, 0xe7, 0xd1, 0xb3, 0xbd, 0x19, 0xf8, - 0x93, 0x3b, 0x8c, 0xd0, 0x0f, 0x5a, 0x30, 0xe6, 0x78, 0x5e, 0xd0, 0x74, 0x62, 0x36, 0xca, 0x85, - 0xde, 0xe7, 0xa1, 0x68, 0x7f, 0x21, 0xa9, 0xc1, 0xbb, 0xf0, 0x82, 0x5c, 0x78, 0x1a, 0xa4, 0x6f, - 0x2f, 0xf4, 0x86, 0xd1, 0xa7, 0xa4, 0x94, 0xc6, 0x97, 0xc7, 0x5c, 0x5a, 0x4a, 0x2b, 0xb3, 0xa3, - 0x5f, 0x13, 0xd0, 0xd0, 0x1d, 0x23, 0xf0, 0x5c, 0x29, 0x3f, 0x06, 0x83, 0xc1, 0x95, 0xf6, 0x8b, - 0x39, 0x87, 0xea, 0xba, 0x73, 0xd5, 0x50, 0x7e, 0xa0, 0x12, 0x4d, 0xfc, 0xe9, 0xe3, 0x58, 0xf5, - 0x2e, 0x4c, 0xb5, 0xcc, 0xbb, 0x5d, 0xac, 0xa6, 0xa7, 0xf2, 0xe8, 0xa6, 0x58, 0x81, 0xe4, 0x36, - 0x4f, 0x01, 0x70, 0x9a, 0x30, 0xaa, 0x73, 0x37, 0xb7, 0x9a, 0xbf, 0x19, 0x08, 0xe3, 0x74, 0x3b, - 0x77, 0x2e, 0xf7, 0xa3, 0x98, 0xec, 0x52, 0xcc, 0xe4, 0xd2, 0x5e, 0x13, 0x75, 0xb1, 0xa2, 0x82, - 0xde, 0x80, 0x61, 0xe6, 0x27, 0x1b, 0xcd, 0x8e, 0xe6, 0x2b, 0x13, 0xcd, 0x10, 0x0f, 0xc9, 0xa6, - 0x62, 0x7f, 0x23, 0x2c, 0x28, 0xa0, 0x1b, 0x32, 0x0e, 0x4c, 0x54, 0xf3, 0xef, 0x44, 0x84, 0xc5, - 0x81, 0x29, 0x2f, 0x7e, 0x3c, 0x09, 0xf1, 0xc2, 0xcb, 0x33, 0xc3, 0xc7, 0x1b, 0x35, 0x29, 0x73, - 0x24, 0xfe, 0xcb, 0xa8, 0xf4, 0xb3, 0x90, 0xdf, 0x3d, 0x33, 0x72, 0x7d, 0x32, 0x9c, 0x77, 0x4d, - 0x12, 0x38, 0x4d, 0x93, 0x32, 0x9a, 0x7c, 0xe7, 0x0a, 0xf3, 0xf6, 0x7e, 0xfb, 0x9f, 0xcb, 0xd7, - 0xec, 0x92, 0xe1, 0x25, 0x58, 0xd4, 0x3f, 0xd5, 0x5b, 0x7f, 0xce, 0x87, 0xe9, 0xf4, 0x16, 0x7d, - 0xa8, 0x5c, 0xc6, 0x1f, 0x96, 0x60, 0xd2, 0x5c, 0x52, 0xe8, 0x2a, 0x94, 0x05, 0x11, 0x15, 0x94, - 0x54, 0xed, 0x92, 0x55, 0x09, 0xc0, 0x09, 0x0e, 0x8b, 0x45, 0xcb, 0xaa, 0x6b, 0x66, 0x89, 0x49, - 0x2c, 0x5a, 0x05, 0xc1, 0x1a, 0x16, 0x95, 0x97, 0x36, 0x82, 0x20, 0x56, 0x97, 0x8a, 0x5a, 0x77, - 0x8b, 0xac, 0x14, 0x0b, 0x28, 0xbd, 0x4c, 0x76, 0x48, 0xe8, 0x13, 0xcf, 0x8c, 0x75, 0xa6, 0x2e, - 0x93, 0x9b, 0x3a, 0x10, 0x9b, 0xb8, 0xf4, 0x96, 0x0c, 0x22, 0xb6, 0x90, 0x85, 0x54, 0x96, 0x98, - 0x79, 0x36, 0xb8, 0xc7, 0xb9, 0x84, 0xa3, 0xcf, 0xc3, 0xa3, 0xca, 0x41, 0x1c, 0x73, 0x45, 0xb5, - 0x6c, 0x71, 0xd8, 0x50, 0xa2, 0x3c, 0xba, 0x94, 0x8d, 0x86, 0xf3, 0xea, 0xa3, 0xd7, 0x61, 0x52, - 0x70, 0xee, 0x92, 0xe2, 0x88, 0x69, 0x3b, 0x71, 0xd3, 0x80, 0xe2, 0x14, 0xb6, 0x8c, 0xd6, 0xc6, - 0x98, 0x67, 0x49, 0x61, 0xb4, 0x3b, 0x5a, 0x9b, 0x0e, 0xc7, 0x5d, 0x35, 0xd0, 0x02, 0x4c, 0x71, - 0xd6, 0xca, 0xf5, 0xb7, 0xf8, 0x9c, 0x08, 0xef, 0x13, 0xb5, 0xa5, 0x6e, 0x9b, 0x60, 0x9c, 0xc6, - 0x47, 0xaf, 0xc0, 0xb8, 0x13, 0x36, 0xb7, 0xdd, 0x98, 0x34, 0xe3, 0x4e, 0xc8, 0xdd, 0x52, 0x34, - 0xe3, 0x93, 0x05, 0x0d, 0x86, 0x0d, 0x4c, 0xfb, 0x7d, 0x38, 0x93, 0xe1, 0xb8, 0x46, 0x17, 0x8e, - 0xd3, 0x76, 0xe5, 0x37, 0xa5, 0x0c, 0x36, 0x17, 0xea, 0x35, 0xf9, 0x35, 0x1a, 0x16, 0x5d, 0x9d, - 0xcc, 0xc1, 0x4d, 0x4b, 0x42, 0xa1, 0x56, 0xe7, 0x8a, 0x04, 0xe0, 0x04, 0xc7, 0xfe, 0x9f, 0x05, - 0x98, 0xca, 0x50, 0xbe, 0xb3, 0x44, 0x08, 0x29, 0xd9, 0x23, 0xc9, 0x7b, 0x60, 0x06, 0xff, 0x2b, - 0x1c, 0x23, 0xf8, 0x5f, 0xb1, 0x5f, 0xf0, 0xbf, 0xd2, 0x07, 0x09, 0xfe, 0x67, 0x8e, 0xd8, 0xd0, - 0x40, 0x23, 0x96, 0x11, 0x30, 0x70, 0xf8, 0x98, 0x01, 0x03, 0x8d, 0x41, 0x1f, 0x19, 0x60, 0xd0, - 0xbf, 0x56, 0x80, 0xe9, 0xb4, 0x91, 0xdc, 0x29, 0xa8, 0x63, 0xdf, 0x30, 0xd4, 0xb1, 0xd9, 0x69, - 0x45, 0xd2, 0xa6, 0x7b, 0x79, 0xaa, 0x59, 0x9c, 0x52, 0xcd, 0x7e, 0x72, 0x20, 0x6a, 0xbd, 0xd5, - 0xb4, 0x7f, 0xa7, 0x00, 0xe7, 0xd2, 0x55, 0x96, 0x3c, 0xc7, 0xdd, 0x3d, 0x85, 0xb1, 0xb9, 0x6d, - 0x8c, 0xcd, 0x73, 0x83, 0x7c, 0x0d, 0xeb, 0x5a, 0xee, 0x00, 0xbd, 0x95, 0x1a, 0xa0, 0xab, 0x83, - 0x93, 0xec, 0x3d, 0x4a, 0xdf, 0x2c, 0xc2, 0xc5, 0xcc, 0x7a, 0x89, 0x36, 0x73, 0xc5, 0xd0, 0x66, - 0x5e, 0x4b, 0x69, 0x33, 0xed, 0xde, 0xb5, 0x4f, 0x46, 0xbd, 0x29, 0x3c, 0x0a, 0x59, 0x80, 0xb8, - 0x07, 0x54, 0x6d, 0x1a, 0x1e, 0x85, 0x8a, 0x10, 0x36, 0xe9, 0x7e, 0x2b, 0xa9, 0x34, 0xff, 0x95, - 0x05, 0xe7, 0x33, 0xe7, 0xe6, 0x14, 0x54, 0x58, 0x6b, 0xa6, 0x0a, 0xeb, 0xe9, 0x81, 0x57, 0x6b, - 0x8e, 0x4e, 0xeb, 0xb7, 0x4a, 0x39, 0xdf, 0xc2, 0x04, 0xf4, 0xdb, 0x30, 0xe6, 0x34, 0x9b, 0x24, - 0x8a, 0x56, 0x83, 0x96, 0x0a, 0x98, 0xf6, 0x1c, 0x93, 0xb3, 0x92, 0xe2, 0xa3, 0x83, 0xca, 0x5c, - 0x9a, 0x44, 0x02, 0xc6, 0x3a, 0x05, 0x33, 0xc6, 0x63, 0xe1, 0x44, 0x63, 0x3c, 0x5e, 0x03, 0xd8, - 0x53, 0xdc, 0x7a, 0x5a, 0xc8, 0xd7, 0xf8, 0x78, 0x0d, 0x0b, 0x7d, 0x01, 0x46, 0x23, 0x71, 0x8d, - 0x8b, 0xa5, 0xf8, 0xc2, 0x80, 0x73, 0xe5, 0x6c, 0x10, 0xcf, 0x74, 0x5d, 0x57, 0xfa, 0x10, 0x45, - 0x12, 0x7d, 0x17, 0x4c, 0x47, 0x3c, 0x32, 0xca, 0x92, 0xe7, 0x44, 0xcc, 0x0f, 0x42, 0xac, 0x42, - 0xe6, 0x8f, 0xde, 0x48, 0xc1, 0x70, 0x17, 0x36, 0x5a, 0x91, 0x1f, 0xc5, 0xc2, 0xb8, 0xf0, 0x85, - 0x79, 0x39, 0xf9, 0x20, 0x91, 0x86, 0xe9, 0x6c, 0x7a, 0xf8, 0xd9, 0xc0, 0x6b, 0x35, 0xd1, 0x17, - 0x00, 0xe8, 0xf2, 0x11, 0xba, 0x84, 0x91, 0xfc, 0xc3, 0x93, 0x9e, 0x2a, 0xad, 0x4c, 0xcb, 0x4f, - 0xe6, 0xcb, 0x57, 0x55, 0x44, 0xb0, 0x46, 0xd0, 0xfe, 0x5a, 0x09, 0x1e, 0xeb, 0x71, 0x46, 0xa2, - 0x05, 0xf3, 0x09, 0xf4, 0x99, 0xb4, 0x70, 0x3d, 0x97, 0x59, 0xd9, 0x90, 0xb6, 0x53, 0x4b, 0xb1, - 0xf0, 0x81, 0x97, 0xe2, 0x0f, 0x59, 0x9a, 0xda, 0x83, 0x1b, 0xf3, 0x7d, 0xf6, 0x98, 0x67, 0xff, - 0x09, 0xea, 0x41, 0x36, 0x33, 0x94, 0x09, 0xd7, 0x06, 0xee, 0xce, 0xc0, 0xda, 0x85, 0xd3, 0x55, - 0xfe, 0x7e, 0xd9, 0x82, 0x27, 0x32, 0xfb, 0x6b, 0x98, 0x6c, 0x5c, 0x85, 0x72, 0x93, 0x16, 0x6a, - 0xae, 0x5b, 0x89, 0x4f, 0xab, 0x04, 0xe0, 0x04, 0xc7, 0xb0, 0xcc, 0x28, 0xf4, 0xb5, 0xcc, 0xf8, - 0xe7, 0x16, 0x74, 0xed, 0x8f, 0x53, 0x38, 0xa8, 0x6b, 0xe6, 0x41, 0xfd, 0xf1, 0x41, 0xe6, 0x32, - 0xe7, 0x8c, 0xfe, 0x4f, 0x53, 0xf0, 0x48, 0x8e, 0xaf, 0xc6, 0x1e, 0xcc, 0x6c, 0x35, 0x89, 0xe9, - 0x14, 0x27, 0x3e, 0x26, 0xd3, 0x7f, 0xb0, 0xa7, 0x07, 0x1d, 0x4b, 0xcf, 0x33, 0xd3, 0x85, 0x82, - 0xbb, 0x9b, 0x40, 0x5f, 0xb6, 0xe0, 0xac, 0x73, 0x2f, 0xea, 0x4a, 0xc2, 0x28, 0xd6, 0xcc, 0x8b, - 0x99, 0x4a, 0x90, 0x3e, 0x49, 0x1b, 0x79, 0xbe, 0xa2, 0x2c, 0x2c, 0x9c, 0xd9, 0x16, 0xc2, 0x22, - 0x84, 0x26, 0x65, 0xe7, 0x7b, 0xb8, 0x6d, 0x66, 0x39, 0xd5, 0xf0, 0x23, 0x5b, 0x42, 0xb0, 0xa2, - 0x83, 0xee, 0x42, 0x79, 0x4b, 0x7a, 0xba, 0x89, 0x2b, 0x21, 0xf3, 0x8e, 0xcd, 0x74, 0x87, 0xe3, - 0xcf, 0x92, 0x0a, 0x84, 0x13, 0x52, 0xe8, 0x75, 0x28, 0xfa, 0x9b, 0x51, 0xaf, 0x44, 0x3f, 0x29, - 0x4b, 0x26, 0xee, 0x12, 0xbd, 0xb6, 0xd2, 0xc0, 0xb4, 0x22, 0xba, 0x01, 0xc5, 0x70, 0xa3, 0x25, - 0xf4, 0x76, 0x99, 0x27, 0x37, 0x5e, 0xac, 0x66, 0x2f, 0x12, 0x4e, 0x09, 0x2f, 0x56, 0x31, 0x25, - 0x81, 0xea, 0x30, 0xc4, 0xdc, 0x1a, 0xc4, 0x2d, 0x90, 0xc9, 0xef, 0xf6, 0x70, 0x0f, 0xe2, 0x7e, - 0xd3, 0x0c, 0x01, 0x73, 0x42, 0x68, 0x1d, 0x86, 0x9b, 0x2c, 0x29, 0x8c, 0x88, 0xda, 0xfc, 0xa9, - 0x4c, 0x0d, 0x5d, 0x8f, 0x6c, 0x39, 0x42, 0x61, 0xc5, 0x30, 0xb0, 0xa0, 0xc5, 0xa8, 0x92, 0xf6, - 0xf6, 0x66, 0xc4, 0x24, 0xfc, 0x3c, 0xaa, 0x3d, 0x92, 0x40, 0x09, 0xaa, 0x0c, 0x03, 0x0b, 0x5a, - 0xe8, 0x33, 0x50, 0xd8, 0x6c, 0x0a, 0xaf, 0x87, 0x4c, 0x55, 0x9d, 0xe9, 0xd5, 0xbe, 0x38, 0x7c, - 0x78, 0x50, 0x29, 0xac, 0x2c, 0xe1, 0xc2, 0x66, 0x13, 0xad, 0xc1, 0xc8, 0x26, 0xf7, 0x83, 0x15, - 0xda, 0xb8, 0xa7, 0xb2, 0x5d, 0x74, 0xbb, 0x5c, 0x65, 0xb9, 0xb5, 0xbe, 0x00, 0x60, 0x49, 0x84, - 0xc5, 0xa1, 0x54, 0xfe, 0xbc, 0x22, 0x20, 0xf3, 0xfc, 0xf1, 0x7c, 0xb0, 0xf9, 0xad, 0x9c, 0x78, - 0x05, 0x63, 0x8d, 0x22, 0xfa, 0x12, 0x94, 0x1d, 0x99, 0xfe, 0x4f, 0x04, 0xac, 0x78, 0x21, 0x73, - 0x63, 0xf6, 0xce, 0x8c, 0xc8, 0x57, 0xb5, 0x42, 0xc2, 0x09, 0x51, 0xb4, 0x03, 0x13, 0x7b, 0x51, - 0x7b, 0x9b, 0xc8, 0x8d, 0xcc, 0xe2, 0x57, 0xe4, 0x5c, 0x5c, 0x77, 0x05, 0xa2, 0x1b, 0xc6, 0x1d, - 0xc7, 0xeb, 0x3a, 0x7b, 0xd8, 0x5b, 0xf6, 0x5d, 0x9d, 0x18, 0x36, 0x69, 0xd3, 0xe1, 0x7f, 0xaf, - 0x13, 0x6c, 0xec, 0xc7, 0x44, 0x44, 0x70, 0xce, 0x1c, 0xfe, 0x37, 0x39, 0x4a, 0xf7, 0xf0, 0x0b, - 0x00, 0x96, 0x44, 0xe8, 0x56, 0x77, 0x64, 0x6a, 0x4d, 0x16, 0xb9, 0x39, 0x67, 0xab, 0x67, 0xe6, - 0xdf, 0xd4, 0x06, 0x85, 0x9d, 0x91, 0x09, 0x29, 0x76, 0x36, 0xb6, 0xb7, 0x83, 0x38, 0xf0, 0x53, - 0xe7, 0xf2, 0x4c, 0xfe, 0xd9, 0x58, 0xcf, 0xc0, 0xef, 0x3e, 0x1b, 0xb3, 0xb0, 0x70, 0x66, 0x5b, - 0xa8, 0x05, 0x93, 0xed, 0x20, 0x8c, 0xef, 0x05, 0xa1, 0x5c, 0x5f, 0xa8, 0x87, 0x36, 0xc1, 0xc0, - 0x14, 0x2d, 0xb2, 0x88, 0xe2, 0x26, 0x04, 0xa7, 0x68, 0xa2, 0xcf, 0xc1, 0x48, 0xd4, 0x74, 0x3c, - 0x52, 0xbb, 0x3d, 0x7b, 0x26, 0xff, 0xd2, 0x69, 0x70, 0x94, 0x9c, 0xd5, 0xc5, 0x26, 0x47, 0xa0, - 0x60, 0x49, 0x0e, 0xad, 0xc0, 0x10, 0x4b, 0x0b, 0xc0, 0x82, 0x4f, 0xe7, 0x04, 0x46, 0xea, 0xb2, - 0x2b, 0xe5, 0x67, 0x13, 0x2b, 0xc6, 0xbc, 0x3a, 0xdd, 0x03, 0x82, 0xa9, 0x0e, 0xa2, 0xd9, 0x73, - 0xf9, 0x7b, 0x40, 0xf0, 0xe2, 0xb7, 0x1b, 0xbd, 0xf6, 0x80, 0x42, 0xc2, 0x09, 0x51, 0x7a, 0x32, - 0xd3, 0xd3, 0xf4, 0x91, 0x1e, 0x66, 0x2c, 0xb9, 0x67, 0x29, 0x3b, 0x99, 0xe9, 0x49, 0x4a, 0x49, - 0xd8, 0xbf, 0x3f, 0xd2, 0xcd, 0xa9, 0x30, 0x31, 0xec, 0x2f, 0x5a, 0x5d, 0x2f, 0x74, 0x9f, 0x1e, - 0x54, 0x2b, 0x74, 0x82, 0x3c, 0xea, 0x97, 0x2d, 0x78, 0xa4, 0x9d, 0xf9, 0x21, 0xe2, 0xda, 0x1f, - 0x4c, 0xb9, 0xc4, 0x3f, 0x5d, 0x05, 0x88, 0xcf, 0x86, 0xe3, 0x9c, 0x96, 0xd2, 0x72, 0x40, 0xf1, - 0x03, 0xcb, 0x01, 0xab, 0x30, 0xca, 0x58, 0xcb, 0x3e, 0x49, 0xd2, 0xd2, 0xe2, 0x10, 0x63, 0x20, - 0x96, 0x44, 0x45, 0xac, 0x48, 0xa0, 0x1f, 0xb6, 0xe0, 0x42, 0xba, 0xeb, 0x98, 0x30, 0xb0, 0x08, - 0xa7, 0xce, 0x25, 0xc0, 0x15, 0xf1, 0xfd, 0x17, 0xea, 0xbd, 0x90, 0x8f, 0xfa, 0x21, 0xe0, 0xde, - 0x8d, 0xa1, 0x6a, 0x86, 0x08, 0x3a, 0x6c, 0xaa, 0xdd, 0x07, 0x10, 0x43, 0x5f, 0x84, 0xf1, 0xdd, - 0xa0, 0xe3, 0xc7, 0xc2, 0xea, 0x45, 0xf8, 0x29, 0xb2, 0x67, 0xe6, 0x55, 0xad, 0x1c, 0x1b, 0x58, - 0x29, 0xe1, 0x75, 0xf4, 0x81, 0x85, 0xd7, 0x77, 0x52, 0xa9, 0xb0, 0xcb, 0xf9, 0x61, 0xfb, 0x84, - 0x9c, 0x7f, 0x8c, 0x84, 0xd8, 0xa7, 0x2b, 0x11, 0xfd, 0xac, 0x95, 0xc1, 0xca, 0x73, 0x19, 0xf9, - 0x35, 0x53, 0x46, 0xbe, 0x9c, 0x96, 0x91, 0xbb, 0x54, 0xae, 0x86, 0x78, 0x3c, 0x78, 0xec, 0xe7, - 0x41, 0x83, 0xa9, 0xd9, 0x1e, 0x5c, 0xea, 0x77, 0x2d, 0x31, 0xf3, 0xa7, 0x96, 0x7a, 0x60, 0x4b, - 0xcc, 0x9f, 0x5a, 0xb5, 0x2a, 0x66, 0x90, 0x41, 0xa3, 0x6d, 0xd8, 0xff, 0xd5, 0x82, 0x62, 0x3d, - 0x68, 0x9d, 0x82, 0x0a, 0xf9, 0xb3, 0x86, 0x0a, 0xf9, 0xb1, 0x9c, 0x14, 0xe5, 0xb9, 0x0a, 0xe3, - 0xe5, 0x94, 0xc2, 0xf8, 0x42, 0x1e, 0x81, 0xde, 0xea, 0xe1, 0x9f, 0x2a, 0x82, 0x9e, 0x50, 0x1d, - 0xfd, 0xd6, 0x83, 0xd8, 0x1e, 0x17, 0x7b, 0xe5, 0x58, 0x17, 0x94, 0x99, 0xd5, 0x94, 0x74, 0xbd, - 0xfb, 0x73, 0x66, 0x82, 0xfc, 0x16, 0x71, 0xb7, 0xb6, 0x63, 0xd2, 0x4a, 0x7f, 0xce, 0xe9, 0x99, - 0x20, 0xff, 0x67, 0x0b, 0xa6, 0x52, 0xad, 0x23, 0x0f, 0x26, 0x3c, 0x5d, 0xff, 0x27, 0xd6, 0xe9, - 0x03, 0xa9, 0x0e, 0x85, 0x09, 0xa7, 0x56, 0x84, 0x4d, 0xe2, 0x68, 0x1e, 0x40, 0xbd, 0xcf, 0x49, - 0xbd, 0x17, 0xe3, 0xfa, 0xd5, 0x03, 0x5e, 0x84, 0x35, 0x0c, 0xf4, 0x12, 0x8c, 0xc5, 0x41, 0x3b, - 0xf0, 0x82, 0xad, 0xfd, 0x9b, 0x44, 0xc6, 0x77, 0x51, 0x86, 0x59, 0xeb, 0x09, 0x08, 0xeb, 0x78, - 0xf6, 0xcf, 0x14, 0x21, 0x9d, 0x84, 0xff, 0xdb, 0x6b, 0xf2, 0xa3, 0xb9, 0x26, 0xbf, 0x69, 0xc1, - 0x34, 0x6d, 0x9d, 0x19, 0x89, 0xc8, 0xcb, 0x56, 0xe5, 0xa0, 0xb1, 0x7a, 0xe4, 0xa0, 0xb9, 0x4c, - 0xcf, 0xae, 0x56, 0xd0, 0x89, 0x85, 0xde, 0x4c, 0x3b, 0x9c, 0x68, 0x29, 0x16, 0x50, 0x81, 0x47, - 0xc2, 0x50, 0x78, 0x3e, 0xe9, 0x78, 0x24, 0x0c, 0xb1, 0x80, 0xca, 0x14, 0x35, 0xa5, 0x9c, 0x14, - 0x35, 0x2c, 0x5a, 0x9d, 0x30, 0x27, 0x10, 0x6c, 0x8f, 0x16, 0xad, 0x4e, 0xda, 0x19, 0x24, 0x38, - 0xf6, 0x2f, 0x14, 0x61, 0xbc, 0x1e, 0xb4, 0x92, 0x17, 0xb2, 0x17, 0x8d, 0x17, 0xb2, 0x4b, 0xa9, - 0x17, 0xb2, 0x69, 0x1d, 0xf7, 0xdb, 0xef, 0x61, 0x1f, 0xd6, 0x7b, 0xd8, 0x3f, 0xb3, 0xd8, 0xac, - 0x55, 0xd7, 0x1a, 0x22, 0x45, 0xee, 0xf3, 0x30, 0xc6, 0x0e, 0x24, 0xe6, 0x6a, 0x27, 0x9f, 0x8d, - 0x58, 0xf4, 0xf9, 0xb5, 0xa4, 0x18, 0xeb, 0x38, 0xe8, 0x0a, 0x8c, 0x46, 0xc4, 0x09, 0x9b, 0xdb, - 0xea, 0x8c, 0x13, 0x8f, 0x2a, 0xbc, 0x0c, 0x2b, 0x28, 0x7a, 0x33, 0x09, 0x94, 0x56, 0xcc, 0x4f, - 0xf6, 0xaa, 0xf7, 0x87, 0x6f, 0x91, 0xfc, 0xe8, 0x68, 0xf6, 0x5b, 0x80, 0xba, 0xf1, 0x07, 0x08, - 0x89, 0x54, 0x31, 0x43, 0x22, 0x95, 0xbb, 0xc2, 0x21, 0xfd, 0xa9, 0x05, 0x93, 0xf5, 0xa0, 0x45, - 0xb7, 0xee, 0xb7, 0xd2, 0x3e, 0xd5, 0xa3, 0x44, 0x0e, 0xf7, 0x88, 0x12, 0xf9, 0x77, 0x2d, 0x18, - 0xa9, 0x07, 0xad, 0x53, 0xd0, 0xb6, 0xbf, 0x66, 0x6a, 0xdb, 0x1f, 0xcd, 0x59, 0x12, 0x39, 0x0a, - 0xf6, 0x5f, 0x2a, 0xc2, 0x04, 0xed, 0x67, 0xb0, 0x25, 0x67, 0xc9, 0x18, 0x11, 0x6b, 0x80, 0x11, - 0xa1, 0x6c, 0x6e, 0xe0, 0x79, 0xc1, 0xbd, 0xf4, 0x8c, 0xad, 0xb0, 0x52, 0x2c, 0xa0, 0xe8, 0x59, - 0x18, 0x6d, 0x87, 0x64, 0xcf, 0x0d, 0x04, 0xff, 0xa8, 0xbd, 0x5d, 0xd4, 0x45, 0x39, 0x56, 0x18, - 0x54, 0xee, 0x8a, 0x5c, 0xbf, 0x49, 0x64, 0xa6, 0xe9, 0x12, 0x4b, 0x46, 0xc5, 0xc3, 0x3f, 0x6b, - 0xe5, 0xd8, 0xc0, 0x42, 0x6f, 0x41, 0x99, 0xfd, 0x67, 0x27, 0xca, 0xf1, 0x93, 0xe7, 0x88, 0x9c, - 0x0b, 0x82, 0x00, 0x4e, 0x68, 0xa1, 0x6b, 0x00, 0xb1, 0x0c, 0x11, 0x1c, 0x89, 0xc8, 0x36, 0x8a, - 0xd7, 0x56, 0xc1, 0x83, 0x23, 0xac, 0x61, 0xa1, 0x67, 0xa0, 0x1c, 0x3b, 0xae, 0x77, 0xcb, 0xf5, - 0x49, 0xc4, 0x54, 0xce, 0x45, 0x99, 0x52, 0x41, 0x14, 0xe2, 0x04, 0x4e, 0x79, 0x1d, 0xe6, 0xf6, - 0xcd, 0x53, 0x6f, 0x8d, 0x32, 0x6c, 0xc6, 0xeb, 0xdc, 0x52, 0xa5, 0x58, 0xc3, 0xb0, 0x5f, 0x81, - 0x73, 0xf5, 0xa0, 0x55, 0x0f, 0xc2, 0x78, 0x25, 0x08, 0xef, 0x39, 0x61, 0x4b, 0xce, 0x5f, 0x45, - 0x46, 0xf7, 0xa7, 0x67, 0xcf, 0x10, 0xdf, 0x99, 0x46, 0xdc, 0xfe, 0x17, 0x18, 0xb7, 0x73, 0x4c, - 0x57, 0x8e, 0x26, 0xbb, 0x77, 0x55, 0x96, 0xbd, 0xeb, 0x4e, 0x4c, 0xd0, 0x6d, 0x96, 0x99, 0x2b, - 0xb9, 0x82, 0x44, 0xf5, 0xa7, 0xb5, 0xcc, 0x5c, 0x09, 0x30, 0xf3, 0xce, 0x32, 0xeb, 0xdb, 0xbf, - 0x5e, 0x64, 0xa7, 0x51, 0x2a, 0xe9, 0x1c, 0xfa, 0x22, 0x4c, 0x46, 0xe4, 0x96, 0xeb, 0x77, 0xee, - 0x4b, 0x21, 0xbc, 0x87, 0x33, 0x4e, 0x63, 0x59, 0xc7, 0xe4, 0xaa, 0x3c, 0xb3, 0x0c, 0xa7, 0xa8, - 0xd1, 0x79, 0x0a, 0x3b, 0xfe, 0x42, 0x74, 0x27, 0x22, 0xa1, 0x48, 0x7a, 0xc6, 0xe6, 0x09, 0xcb, - 0x42, 0x9c, 0xc0, 0xe9, 0xba, 0x64, 0x7f, 0xd6, 0x02, 0x1f, 0x07, 0x41, 0x2c, 0x57, 0x32, 0x4b, - 0x9b, 0xa3, 0x95, 0x63, 0x03, 0x0b, 0xad, 0x00, 0x8a, 0x3a, 0xed, 0xb6, 0xc7, 0x9e, 0xf3, 0x1d, - 0xef, 0x7a, 0x18, 0x74, 0xda, 0xfc, 0xad, 0xb3, 0xb8, 0xf8, 0x08, 0xbd, 0xc2, 0x1a, 0x5d, 0x50, - 0x9c, 0x51, 0x83, 0x9e, 0x3e, 0x9b, 0x11, 0xfb, 0xcd, 0x56, 0x77, 0x51, 0xa8, 0xd7, 0x1b, 0xac, - 0x08, 0x4b, 0x18, 0x5d, 0x4c, 0xac, 0x79, 0x8e, 0x39, 0x9c, 0x2c, 0x26, 0xac, 0x4a, 0xb1, 0x86, - 0x81, 0x96, 0x61, 0x24, 0xda, 0x8f, 0x9a, 0xb1, 0x88, 0xc3, 0x94, 0x93, 0xbe, 0xb2, 0xc1, 0x50, - 0xb4, 0x94, 0x0a, 0xbc, 0x0a, 0x96, 0x75, 0xed, 0xef, 0x63, 0x97, 0x21, 0x4b, 0x91, 0x15, 0x77, - 0x42, 0x82, 0x76, 0x61, 0xa2, 0xcd, 0xa6, 0x5c, 0x04, 0x70, 0x16, 0xf3, 0xf6, 0xe2, 0x80, 0x52, - 0xed, 0x3d, 0x7a, 0xd0, 0x28, 0xad, 0x13, 0x13, 0x17, 0xea, 0x3a, 0x39, 0x6c, 0x52, 0xb7, 0xbf, - 0x86, 0xd8, 0x99, 0xdb, 0xe0, 0xa2, 0xea, 0x88, 0x30, 0x28, 0x16, 0x7c, 0xf9, 0x5c, 0xbe, 0xce, - 0x24, 0xf9, 0x22, 0x61, 0x94, 0x8c, 0x65, 0x5d, 0xf4, 0x26, 0x7b, 0x9b, 0xe6, 0x07, 0x5d, 0xbf, - 0x4c, 0xc5, 0x1c, 0xcb, 0x78, 0x86, 0x16, 0x15, 0xb1, 0x46, 0x04, 0xdd, 0x82, 0x09, 0x91, 0x51, - 0x49, 0x28, 0xc5, 0x8a, 0x86, 0xd2, 0x63, 0x02, 0xeb, 0xc0, 0xa3, 0x74, 0x01, 0x36, 0x2b, 0xa3, - 0x2d, 0xb8, 0xa0, 0xa5, 0x17, 0xbc, 0x1e, 0x3a, 0xec, 0xbd, 0xd2, 0x65, 0x9b, 0x48, 0x3b, 0x37, - 0x9f, 0x38, 0x3c, 0xa8, 0x5c, 0x58, 0xef, 0x85, 0x88, 0x7b, 0xd3, 0x41, 0xb7, 0xe1, 0x1c, 0xf7, - 0xdb, 0xab, 0x12, 0xa7, 0xe5, 0xb9, 0xbe, 0x3a, 0x98, 0xf9, 0x3a, 0x3c, 0x7f, 0x78, 0x50, 0x39, - 0xb7, 0x90, 0x85, 0x80, 0xb3, 0xeb, 0xa1, 0xd7, 0xa0, 0xdc, 0xf2, 0x23, 0x31, 0x06, 0xc3, 0x46, - 0xe6, 0xcc, 0x72, 0x75, 0xad, 0xa1, 0xbe, 0x3f, 0xf9, 0x83, 0x93, 0x0a, 0x68, 0x8b, 0x2b, 0xc6, - 0x94, 0x1c, 0x3a, 0x92, 0x9f, 0x25, 0x5d, 0x2c, 0x09, 0xc3, 0x73, 0x87, 0x6b, 0x84, 0x95, 0xe5, - 0xab, 0xe1, 0xd4, 0x63, 0x10, 0x46, 0x6f, 0x00, 0xa2, 0x8c, 0x9a, 0xdb, 0x24, 0x0b, 0x4d, 0x16, - 0x47, 0x9b, 0xe9, 0x11, 0x47, 0x0d, 0x4f, 0x09, 0xd4, 0xe8, 0xc2, 0xc0, 0x19, 0xb5, 0xd0, 0x0d, - 0x7a, 0x90, 0xe9, 0xa5, 0xc2, 0x82, 0x57, 0x32, 0xf7, 0xb3, 0x55, 0xd2, 0x0e, 0x49, 0xd3, 0x89, - 0x49, 0xcb, 0xa4, 0x88, 0x53, 0xf5, 0xe8, 0x5d, 0xaa, 0x52, 0xea, 0x80, 0x19, 0x2c, 0xa3, 0x3b, - 0xad, 0x0e, 0x95, 0x8b, 0xb7, 0x83, 0x28, 0x5e, 0x23, 0xf1, 0xbd, 0x20, 0xdc, 0x11, 0xb1, 0xc9, - 0x92, 0x30, 0x99, 0x09, 0x08, 0xeb, 0x78, 0x94, 0x0f, 0x66, 0x8f, 0xc3, 0xb5, 0x2a, 0x7b, 0xa1, - 0x1b, 0x4d, 0xf6, 0xc9, 0x0d, 0x5e, 0x8c, 0x25, 0x5c, 0xa2, 0xd6, 0xea, 0x4b, 0xec, 0xb5, 0x2d, - 0x85, 0x5a, 0xab, 0x2f, 0x61, 0x09, 0x47, 0xa4, 0x3b, 0x2b, 0xe9, 0x64, 0xbe, 0x56, 0xb3, 0xfb, - 0x3a, 0x18, 0x30, 0x31, 0xa9, 0x0f, 0xd3, 0x2a, 0x1f, 0x2a, 0x0f, 0xda, 0x16, 0xcd, 0x4e, 0xb1, - 0x45, 0x32, 0x78, 0xc4, 0x37, 0xa5, 0x27, 0xae, 0xa5, 0x28, 0xe1, 0x2e, 0xda, 0x46, 0xf8, 0x92, - 0xe9, 0xbe, 0x29, 0x91, 0xae, 0x42, 0x39, 0xea, 0x6c, 0xb4, 0x82, 0x5d, 0xc7, 0xf5, 0xd9, 0xe3, - 0x98, 0xc6, 0x64, 0x35, 0x24, 0x00, 0x27, 0x38, 0x68, 0x05, 0x46, 0x1d, 0xa9, 0x04, 0x46, 0xf9, - 0xb1, 0x0a, 0x94, 0xea, 0x97, 0xbb, 0xef, 0x4a, 0xb5, 0xaf, 0xaa, 0x8b, 0x5e, 0x85, 0x09, 0xe1, - 0xad, 0xc5, 0x23, 0x38, 0xb0, 0xc7, 0x2b, 0xcd, 0x1c, 0xbf, 0xa1, 0x03, 0xb1, 0x89, 0x8b, 0xbe, - 0x00, 0x93, 0x94, 0x4a, 0x72, 0xb0, 0xcd, 0x9e, 0x1d, 0xe4, 0x44, 0xd4, 0x52, 0x5d, 0xe8, 0x95, - 0x71, 0x8a, 0x18, 0x6a, 0xc1, 0xe3, 0x4e, 0x27, 0x0e, 0x98, 0x22, 0xdd, 0x5c, 0xff, 0xeb, 0xc1, - 0x0e, 0xf1, 0xd9, 0x1b, 0xd6, 0xe8, 0xe2, 0xa5, 0xc3, 0x83, 0xca, 0xe3, 0x0b, 0x3d, 0xf0, 0x70, - 0x4f, 0x2a, 0xe8, 0x0e, 0x8c, 0xc5, 0x81, 0xc7, 0x0c, 0xe3, 0x29, 0x2b, 0xf1, 0x48, 0x7e, 0xf8, - 0x9f, 0x75, 0x85, 0xa6, 0x2b, 0x91, 0x54, 0x55, 0xac, 0xd3, 0x41, 0xeb, 0x7c, 0x8f, 0xb1, 0xc0, - 0xa8, 0x24, 0x9a, 0x7d, 0x34, 0x7f, 0x60, 0x54, 0xfc, 0x54, 0x73, 0x0b, 0x8a, 0x9a, 0x58, 0x27, - 0x83, 0xae, 0xc3, 0x4c, 0x3b, 0x74, 0x03, 0xb6, 0xb0, 0xd5, 0x23, 0xc6, 0xac, 0x99, 0xdd, 0xa0, - 0x9e, 0x46, 0xc0, 0xdd, 0x75, 0xa8, 0x90, 0x29, 0x0b, 0x67, 0xcf, 0xf3, 0x54, 0x59, 0x9c, 0xf1, - 0xe6, 0x65, 0x58, 0x41, 0xd1, 0x2a, 0x3b, 0x97, 0xb9, 0x38, 0x38, 0x3b, 0x97, 0x1f, 0xe3, 0x41, - 0x17, 0x1b, 0x39, 0xbf, 0xa4, 0xfe, 0xe2, 0x84, 0x02, 0xbd, 0x37, 0xa2, 0x6d, 0x27, 0x24, 0xf5, - 0x30, 0x68, 0x12, 0xde, 0x19, 0x6e, 0x93, 0xff, 0x18, 0x8f, 0xdf, 0x48, 0xef, 0x8d, 0x46, 0x16, - 0x02, 0xce, 0xae, 0x87, 0x5a, 0x5a, 0x86, 0x68, 0xca, 0x86, 0x46, 0xb3, 0x8f, 0xf7, 0x30, 0x33, - 0x4a, 0xf1, 0xac, 0xc9, 0x5a, 0x34, 0x8a, 0x23, 0x9c, 0xa2, 0x89, 0xbe, 0x0b, 0xa6, 0x45, 0xb8, - 0xa3, 0x64, 0xdc, 0x2f, 0x24, 0xf6, 0x8b, 0x38, 0x05, 0xc3, 0x5d, 0xd8, 0x94, 0xe5, 0x23, 0xbe, - 0xb3, 0xe1, 0x11, 0xb1, 0x08, 0x6f, 0xb9, 0xfe, 0x4e, 0x34, 0x7b, 0x91, 0x7d, 0x35, 0x63, 0xf9, - 0x96, 0xbb, 0xa0, 0x38, 0xa3, 0xc6, 0xdc, 0x77, 0xc2, 0x4c, 0xd7, 0xcd, 0x75, 0xac, 0x20, 0xe6, - 0x7f, 0x32, 0x04, 0x65, 0xa5, 0x94, 0x47, 0x57, 0xcd, 0xb7, 0x96, 0xf3, 0xe9, 0xb7, 0x96, 0x51, - 0x2a, 0x1b, 0xe8, 0xcf, 0x2b, 0xeb, 0x86, 0x79, 0x5e, 0x21, 0x3f, 0x65, 0x98, 0xce, 0xdd, 0xf7, - 0x75, 0xf5, 0xd3, 0x74, 0x2c, 0xc5, 0x81, 0x1f, 0x6d, 0x4a, 0x3d, 0xd5, 0x36, 0x03, 0x66, 0xec, - 0x45, 0x4f, 0x52, 0x01, 0xa9, 0x55, 0xab, 0xa7, 0x53, 0x58, 0xd6, 0x69, 0x21, 0xe6, 0x30, 0x26, - 0x48, 0x52, 0x36, 0x8b, 0x09, 0x92, 0x23, 0x0f, 0x28, 0x48, 0x4a, 0x02, 0x38, 0xa1, 0x85, 0x3c, - 0x98, 0x69, 0x9a, 0xd9, 0x47, 0x95, 0x7b, 0xdf, 0x93, 0x7d, 0xf3, 0x80, 0x76, 0xb4, 0x54, 0x6f, - 0x4b, 0x69, 0x2a, 0xb8, 0x9b, 0x30, 0x7a, 0x15, 0x46, 0xdf, 0x0b, 0x22, 0xb6, 0x28, 0x05, 0xaf, - 0x21, 0xdd, 0xa0, 0x46, 0xdf, 0xbc, 0xdd, 0x60, 0xe5, 0x47, 0x07, 0x95, 0xb1, 0x7a, 0xd0, 0x92, - 0x7f, 0xb1, 0xaa, 0x80, 0xee, 0xc3, 0x39, 0xe3, 0x84, 0x56, 0xdd, 0x85, 0xc1, 0xbb, 0x7b, 0x41, - 0x34, 0x77, 0xae, 0x96, 0x45, 0x09, 0x67, 0x37, 0x40, 0x8f, 0x3d, 0x3f, 0x10, 0x99, 0x7b, 0x25, - 0x3f, 0xc3, 0xd8, 0x96, 0xb2, 0xee, 0x04, 0x9f, 0x42, 0xc0, 0xdd, 0x75, 0xec, 0x5f, 0xe5, 0x6f, - 0x18, 0x42, 0xd3, 0x49, 0xa2, 0x8e, 0x77, 0x1a, 0x89, 0xa1, 0x96, 0x0d, 0x25, 0xec, 0x03, 0xbf, - 0x93, 0xfd, 0xa6, 0xc5, 0xde, 0xc9, 0xd6, 0xc9, 0x6e, 0xdb, 0xa3, 0xf2, 0xf6, 0xc3, 0xef, 0xf8, - 0x9b, 0x30, 0x1a, 0x8b, 0xd6, 0x7a, 0xe5, 0xb2, 0xd2, 0x3a, 0xc5, 0xde, 0x0a, 0x15, 0xa7, 0x23, - 0x4b, 0xb1, 0x22, 0x63, 0xff, 0x13, 0x3e, 0x03, 0x12, 0x72, 0x0a, 0x0a, 0xb1, 0xaa, 0xa9, 0x10, - 0xab, 0xf4, 0xf9, 0x82, 0x1c, 0xc5, 0xd8, 0x3f, 0x36, 0xfb, 0xcd, 0x84, 0xca, 0x8f, 0xfa, 0x03, - 0xad, 0xfd, 0xa3, 0x16, 0x9c, 0xcd, 0xb2, 0x68, 0xa2, 0xdc, 0x29, 0x17, 0x69, 0xd5, 0x83, 0xb5, - 0x1a, 0xc1, 0xbb, 0xa2, 0x1c, 0x2b, 0x8c, 0x81, 0xd3, 0x44, 0x1c, 0x2f, 0x4e, 0xdc, 0x6d, 0x98, - 0xa8, 0x87, 0x44, 0xbb, 0x03, 0x5e, 0xe7, 0xfe, 0x74, 0xbc, 0x3f, 0xcf, 0x1e, 0xdb, 0x97, 0xce, - 0xfe, 0xb9, 0x02, 0x9c, 0xe5, 0x2f, 0x4e, 0x0b, 0x7b, 0x81, 0xdb, 0xaa, 0x07, 0x2d, 0x91, 0xe2, - 0xe3, 0x6d, 0x18, 0x6f, 0x6b, 0x7a, 0x88, 0x5e, 0x91, 0xaa, 0x74, 0x7d, 0x45, 0x22, 0x0f, 0xea, - 0xa5, 0xd8, 0xa0, 0x85, 0x5a, 0x30, 0x4e, 0xf6, 0xdc, 0xa6, 0x7a, 0xb6, 0x28, 0x1c, 0xfb, 0x6e, - 0x50, 0xad, 0x2c, 0x6b, 0x74, 0xb0, 0x41, 0xf5, 0x21, 0x64, 0x7d, 0xb3, 0x7f, 0xcc, 0x82, 0x47, - 0x73, 0xe2, 0x5a, 0xd1, 0xe6, 0xee, 0xb1, 0xb7, 0x3d, 0x91, 0x40, 0x4a, 0x35, 0xc7, 0x5f, 0xfc, - 0xb0, 0x80, 0xa2, 0xcf, 0x01, 0xf0, 0x17, 0x3b, 0x2a, 0x1e, 0xf5, 0x0b, 0x00, 0x64, 0xc4, 0x2e, - 0xd1, 0x62, 0x4e, 0xc8, 0xfa, 0x58, 0xa3, 0x65, 0xff, 0x74, 0x11, 0x86, 0xd8, 0x0b, 0x11, 0x5a, - 0x81, 0x91, 0x6d, 0x1e, 0xe9, 0x79, 0x90, 0xa0, 0xd2, 0x89, 0x9c, 0xc9, 0x0b, 0xb0, 0xac, 0x8c, - 0x56, 0xe1, 0x0c, 0x8f, 0x94, 0xed, 0x55, 0x89, 0xe7, 0xec, 0x4b, 0x75, 0x05, 0x4f, 0xba, 0xa4, - 0xe2, 0x67, 0xd4, 0xba, 0x51, 0x70, 0x56, 0x3d, 0xf4, 0x3a, 0x4c, 0x52, 0xfe, 0x2e, 0xe8, 0xc4, - 0x92, 0x12, 0x8f, 0x91, 0xad, 0x18, 0xca, 0x75, 0x03, 0x8a, 0x53, 0xd8, 0x54, 0xf0, 0x6a, 0x77, - 0x29, 0x66, 0x86, 0x12, 0xc1, 0xcb, 0x54, 0xc6, 0x98, 0xb8, 0xcc, 0x94, 0xa9, 0xc3, 0x0c, 0xb7, - 0xd6, 0xb7, 0x43, 0x12, 0x6d, 0x07, 0x5e, 0x4b, 0xe4, 0xec, 0x4e, 0x4c, 0x99, 0x52, 0x70, 0xdc, - 0x55, 0x83, 0x52, 0xd9, 0x74, 0x5c, 0xaf, 0x13, 0x92, 0x84, 0xca, 0xb0, 0x49, 0x65, 0x25, 0x05, - 0xc7, 0x5d, 0x35, 0xe8, 0x3a, 0x3a, 0x27, 0x92, 0x68, 0x4b, 0xaf, 0x7e, 0x65, 0x9f, 0x36, 0x22, - 0xfd, 0x9b, 0x7a, 0x84, 0xb5, 0x11, 0x16, 0x3c, 0x2a, 0x0d, 0xb7, 0xa6, 0x4f, 0x14, 0x9e, 0x4d, - 0x92, 0xca, 0x83, 0xa4, 0x72, 0xfe, 0x7d, 0x0b, 0xce, 0x64, 0xd8, 0xc1, 0xf2, 0xa3, 0x6a, 0xcb, - 0x8d, 0x62, 0x95, 0x58, 0x46, 0x3b, 0xaa, 0x78, 0x39, 0x56, 0x18, 0x74, 0x3f, 0xf0, 0xc3, 0x30, - 0x7d, 0x00, 0x0a, 0x3b, 0x33, 0x01, 0x3d, 0xde, 0x01, 0x88, 0x2e, 0x41, 0xa9, 0x13, 0x11, 0x19, - 0x90, 0x4a, 0x9d, 0xdf, 0x4c, 0xc3, 0xcc, 0x20, 0x94, 0x35, 0xdd, 0x52, 0xca, 0x5d, 0x8d, 0x35, - 0xe5, 0x1a, 0x5b, 0x0e, 0xb3, 0xbf, 0x5a, 0x84, 0xf3, 0xb9, 0x16, 0xef, 0xb4, 0x4b, 0xbb, 0x81, - 0xef, 0xc6, 0x81, 0x7a, 0x7d, 0xe4, 0x21, 0x51, 0x48, 0x7b, 0x7b, 0x55, 0x94, 0x63, 0x85, 0x81, - 0x2e, 0xcb, 0x74, 0xee, 0xe9, 0xd4, 0x39, 0x8b, 0x55, 0x23, 0xa3, 0xfb, 0xa0, 0x69, 0xc9, 0x9e, - 0x84, 0x52, 0x3b, 0x08, 0xbc, 0xf4, 0x61, 0x44, 0xbb, 0x1b, 0x04, 0x1e, 0x66, 0x40, 0xf4, 0x09, - 0x31, 0x0e, 0xa9, 0xe7, 0x36, 0xec, 0xb4, 0x82, 0x48, 0x1b, 0x8c, 0xa7, 0x61, 0x64, 0x87, 0xec, - 0x87, 0xae, 0xbf, 0x95, 0x7e, 0x86, 0xbd, 0xc9, 0x8b, 0xb1, 0x84, 0x9b, 0x99, 0x23, 0x46, 0x4e, - 0x3a, 0x9f, 0xd8, 0x68, 0xdf, 0xab, 0xed, 0x87, 0x8a, 0x30, 0x85, 0x17, 0xab, 0xdf, 0x9e, 0x88, - 0x3b, 0xdd, 0x13, 0x71, 0xd2, 0xf9, 0xc4, 0xfa, 0xcf, 0xc6, 0x2f, 0x59, 0x30, 0xc5, 0xa2, 0x2b, - 0x8b, 0x40, 0x1c, 0x6e, 0xe0, 0x9f, 0x02, 0xeb, 0xf6, 0x24, 0x0c, 0x85, 0xb4, 0xd1, 0x74, 0x92, - 0x20, 0xd6, 0x13, 0xcc, 0x61, 0xe8, 0x71, 0x28, 0xb1, 0x2e, 0xd0, 0xc9, 0x1b, 0xe7, 0xf9, 0x15, - 0xaa, 0x4e, 0xec, 0x60, 0x56, 0xca, 0xbc, 0xcb, 0x31, 0x69, 0x7b, 0x2e, 0xef, 0x74, 0xf2, 0xb4, - 0xf1, 0xd1, 0xf0, 0x2e, 0xcf, 0xec, 0xda, 0x07, 0xf3, 0x2e, 0xcf, 0x26, 0xd9, 0x5b, 0x2c, 0xfa, - 0x6f, 0x05, 0xb8, 0x98, 0x59, 0x6f, 0x60, 0xef, 0xf2, 0xde, 0xb5, 0x4f, 0xc6, 0x9a, 0x26, 0xdb, - 0xc8, 0xa5, 0x78, 0x8a, 0x46, 0x2e, 0xa5, 0x41, 0x39, 0xc7, 0xa1, 0x01, 0x9c, 0xbe, 0x33, 0x87, - 0xec, 0x23, 0xe2, 0xf4, 0x9d, 0xd9, 0xb7, 0x1c, 0xb1, 0xee, 0xcf, 0x0a, 0x39, 0xdf, 0xc2, 0x04, - 0xbc, 0x2b, 0xf4, 0x9c, 0x61, 0xc0, 0x48, 0x70, 0xc2, 0xe3, 0xfc, 0x8c, 0xe1, 0x65, 0x58, 0x41, - 0x91, 0xab, 0xb9, 0x4f, 0x17, 0xf2, 0x53, 0x48, 0xe6, 0x36, 0x35, 0x6f, 0xbe, 0x44, 0xa9, 0x21, - 0xc8, 0x70, 0xa5, 0x5e, 0xd5, 0x84, 0xf2, 0xe2, 0xe0, 0x42, 0xf9, 0x78, 0xb6, 0x40, 0x8e, 0x16, - 0x60, 0x6a, 0xd7, 0xf5, 0xe9, 0xb1, 0xb9, 0x6f, 0xb2, 0xa2, 0x2a, 0x9a, 0xc8, 0xaa, 0x09, 0xc6, - 0x69, 0xfc, 0xb9, 0x57, 0x61, 0xe2, 0xc1, 0xd5, 0x91, 0xdf, 0x2c, 0xc2, 0x63, 0x3d, 0xb6, 0x3d, - 0x3f, 0xeb, 0x8d, 0x39, 0xd0, 0xce, 0xfa, 0xae, 0x79, 0xa8, 0xc3, 0xd9, 0xcd, 0x8e, 0xe7, 0xed, - 0x33, 0x3b, 0x52, 0xd2, 0x92, 0x18, 0x82, 0x57, 0x7c, 0x5c, 0x66, 0xb4, 0x58, 0xc9, 0xc0, 0xc1, - 0x99, 0x35, 0xd1, 0x1b, 0x80, 0x02, 0x91, 0xbf, 0xf6, 0x3a, 0xf1, 0x85, 0x7e, 0x9f, 0x0d, 0x7c, - 0x31, 0xd9, 0x8c, 0xb7, 0xbb, 0x30, 0x70, 0x46, 0x2d, 0xca, 0xf4, 0xd3, 0x5b, 0x69, 0x5f, 0x75, - 0x2b, 0xc5, 0xf4, 0x63, 0x1d, 0x88, 0x4d, 0x5c, 0x74, 0x1d, 0x66, 0x9c, 0x3d, 0xc7, 0xe5, 0x51, - 0xf6, 0x24, 0x01, 0xce, 0xf5, 0x2b, 0x25, 0xd8, 0x42, 0x1a, 0x01, 0x77, 0xd7, 0x49, 0x39, 0x58, - 0x0f, 0xe7, 0x3b, 0x58, 0xf7, 0x3e, 0x17, 0xfb, 0xe9, 0x74, 0xed, 0x7f, 0x6f, 0xd1, 0xeb, 0x2b, - 0x23, 0x07, 0x3d, 0x1d, 0x07, 0xa5, 0x9b, 0xd4, 0x7c, 0x9d, 0xcf, 0x69, 0x96, 0x22, 0x09, 0x10, - 0x9b, 0xb8, 0x7c, 0x41, 0x44, 0x89, 0xb3, 0x8d, 0xc1, 0xba, 0x8b, 0x58, 0x09, 0x0a, 0x03, 0x7d, - 0x1e, 0x46, 0x5a, 0xee, 0x9e, 0x1b, 0x05, 0xa1, 0xd8, 0x2c, 0xc7, 0x74, 0x59, 0x48, 0xce, 0xc1, - 0x2a, 0x27, 0x83, 0x25, 0x3d, 0xfb, 0x87, 0x0a, 0x30, 0x21, 0x5b, 0x7c, 0xb3, 0x13, 0xc4, 0xce, - 0x29, 0x5c, 0xcb, 0xd7, 0x8d, 0x6b, 0xf9, 0x13, 0xbd, 0x02, 0x46, 0xb0, 0x2e, 0xe5, 0x5e, 0xc7, - 0xb7, 0x53, 0xd7, 0xf1, 0x53, 0xfd, 0x49, 0xf5, 0xbe, 0x86, 0xff, 0xa9, 0x05, 0x33, 0x06, 0xfe, - 0x29, 0xdc, 0x06, 0x2b, 0xe6, 0x6d, 0xf0, 0x44, 0xdf, 0x6f, 0xc8, 0xb9, 0x05, 0x7e, 0xa0, 0x98, - 0xea, 0x3b, 0x3b, 0xfd, 0xdf, 0x83, 0xd2, 0xb6, 0x13, 0xb6, 0x7a, 0x05, 0xa6, 0xed, 0xaa, 0x34, - 0x7f, 0xc3, 0x09, 0x5b, 0xfc, 0x0c, 0x7f, 0x56, 0x65, 0xbd, 0x74, 0xc2, 0x56, 0x5f, 0xdf, 0x32, - 0xd6, 0x14, 0x7a, 0x05, 0x86, 0xa3, 0x66, 0xd0, 0x56, 0x96, 0x9f, 0x97, 0x78, 0x46, 0x4c, 0x5a, - 0x72, 0x74, 0x50, 0x41, 0x66, 0x73, 0xb4, 0x18, 0x0b, 0x7c, 0xf4, 0x36, 0x4c, 0xb0, 0x5f, 0xca, - 0x02, 0xa2, 0x98, 0x9f, 0x0e, 0xa1, 0xa1, 0x23, 0x72, 0x43, 0x1a, 0xa3, 0x08, 0x9b, 0xa4, 0xe6, - 0xb6, 0xa0, 0xac, 0x3e, 0xeb, 0xa1, 0xfa, 0x04, 0xfd, 0x9b, 0x22, 0x9c, 0xc9, 0x58, 0x73, 0x28, - 0x32, 0x66, 0xe2, 0xf9, 0x01, 0x97, 0xea, 0x07, 0x9c, 0x8b, 0x88, 0x49, 0x43, 0x2d, 0xb1, 0xb6, - 0x06, 0x6e, 0xf4, 0x4e, 0x44, 0xd2, 0x8d, 0xd2, 0xa2, 0xfe, 0x8d, 0xd2, 0xc6, 0x4e, 0x6d, 0xa8, - 0x69, 0x43, 0xaa, 0xa7, 0x0f, 0x75, 0x4e, 0xff, 0xb8, 0x08, 0x67, 0xb3, 0x62, 0xd8, 0xa0, 0xef, - 0x4d, 0xa5, 0xc6, 0x79, 0x71, 0xd0, 0xe8, 0x37, 0x3c, 0x5f, 0x8e, 0x48, 0xf4, 0x3c, 0x6f, 0x26, - 0xcb, 0xe9, 0x3b, 0xcc, 0xa2, 0x4d, 0xe6, 0x48, 0x1a, 0xf2, 0x94, 0x46, 0xf2, 0xf8, 0xf8, 0xf4, - 0xc0, 0x1d, 0x10, 0xb9, 0x90, 0xa2, 0x94, 0x23, 0xa9, 0x2c, 0xee, 0xef, 0x48, 0x2a, 0x5b, 0x9e, - 0x73, 0x61, 0x4c, 0xfb, 0x9a, 0x87, 0x3a, 0xe3, 0x3b, 0xf4, 0xb6, 0xd2, 0xfa, 0xfd, 0x50, 0x67, - 0xfd, 0xc7, 0x2c, 0x48, 0x99, 0x59, 0x2a, 0x75, 0x97, 0x95, 0xab, 0xee, 0xba, 0x04, 0xa5, 0x30, - 0xf0, 0x48, 0x3a, 0x13, 0x0d, 0x0e, 0x3c, 0x82, 0x19, 0x84, 0x62, 0xc4, 0x89, 0xb2, 0x63, 0x5c, - 0x17, 0xe4, 0x84, 0x88, 0xf6, 0x24, 0x0c, 0x79, 0x64, 0x8f, 0x78, 0xe9, 0x30, 0xef, 0xb7, 0x68, - 0x21, 0xe6, 0x30, 0xfb, 0x97, 0x4a, 0x70, 0xa1, 0xa7, 0x2b, 0x36, 0x15, 0x87, 0xb6, 0x9c, 0x98, - 0xdc, 0x73, 0xf6, 0xd3, 0xf1, 0x98, 0xaf, 0xf3, 0x62, 0x2c, 0xe1, 0xcc, 0xf2, 0x9c, 0xc7, 0x5f, - 0x4c, 0x29, 0x07, 0x45, 0xd8, 0x45, 0x01, 0x7d, 0x08, 0x49, 0xee, 0xaf, 0x01, 0x44, 0x91, 0xc7, - 0xed, 0x06, 0x5a, 0xc2, 0xa4, 0x3d, 0x89, 0xd3, 0xd9, 0xb8, 0x25, 0x20, 0x58, 0xc3, 0x42, 0x55, - 0x98, 0x6e, 0x87, 0x41, 0xcc, 0x75, 0xad, 0x55, 0x6e, 0x70, 0x34, 0x64, 0x7a, 0xc1, 0xd6, 0x53, - 0x70, 0xdc, 0x55, 0x03, 0xbd, 0x04, 0x63, 0xc2, 0x33, 0xb6, 0x1e, 0x04, 0x9e, 0x50, 0x03, 0x29, - 0xf3, 0x95, 0x46, 0x02, 0xc2, 0x3a, 0x9e, 0x56, 0x8d, 0x29, 0x70, 0x47, 0x32, 0xab, 0x71, 0x25, - 0xae, 0x86, 0x97, 0x8a, 0x67, 0x35, 0x3a, 0x50, 0x3c, 0xab, 0x44, 0x31, 0x56, 0x1e, 0xf8, 0xcd, - 0x0a, 0xfa, 0xaa, 0x92, 0x7e, 0xbe, 0x04, 0x67, 0xc4, 0xc2, 0x79, 0xd8, 0xcb, 0xe5, 0x21, 0xa5, - 0xe2, 0xff, 0xf6, 0x9a, 0x39, 0xed, 0x35, 0xf3, 0xc3, 0x16, 0x98, 0xec, 0x15, 0xfa, 0xff, 0x72, - 0x03, 0xda, 0xbf, 0x94, 0xcb, 0xae, 0xb5, 0xe4, 0x05, 0xf2, 0x01, 0x43, 0xdb, 0xdb, 0xff, 0xce, - 0x82, 0x27, 0xfa, 0x52, 0x44, 0xcb, 0x50, 0x66, 0x3c, 0xa0, 0x26, 0x9d, 0x3d, 0xa5, 0x0c, 0x12, - 0x25, 0x20, 0x87, 0x25, 0x4d, 0x6a, 0xa2, 0xe5, 0xae, 0xcc, 0x01, 0x4f, 0x67, 0x64, 0x0e, 0x38, - 0x67, 0x0c, 0xcf, 0x03, 0xa6, 0x0e, 0xf8, 0xd5, 0x22, 0x0c, 0xf3, 0x15, 0x7f, 0x0a, 0x62, 0xd8, - 0x8a, 0xd0, 0xdb, 0xf6, 0x88, 0x68, 0xc5, 0xfb, 0x32, 0x5f, 0x75, 0x62, 0x87, 0xb3, 0x09, 0xea, - 0xb6, 0x4a, 0x34, 0xbc, 0x68, 0xde, 0xb8, 0xcf, 0xe6, 0x52, 0x8a, 0x49, 0xe0, 0x34, 0xb4, 0xdb, - 0xed, 0x8b, 0x00, 0x11, 0xcb, 0xba, 0x4f, 0x69, 0x88, 0xd8, 0x68, 0x9f, 0xec, 0xd1, 0x7a, 0x43, - 0x21, 0xf3, 0x3e, 0x24, 0x3b, 0x5d, 0x01, 0xb0, 0x46, 0x71, 0xee, 0x65, 0x28, 0x2b, 0xe4, 0x7e, - 0x5a, 0x9c, 0x71, 0x9d, 0xb9, 0xf8, 0x2c, 0x4c, 0xa5, 0xda, 0x3a, 0x96, 0x12, 0xe8, 0x97, 0x2d, - 0x98, 0xe2, 0x5d, 0x5e, 0xf6, 0xf7, 0xc4, 0x99, 0xfa, 0x3e, 0x9c, 0xf5, 0x32, 0xce, 0x36, 0x31, - 0xa3, 0x83, 0x9f, 0x85, 0x4a, 0xe9, 0x93, 0x05, 0xc5, 0x99, 0x6d, 0xa0, 0x2b, 0x74, 0xdd, 0xd2, - 0xb3, 0xcb, 0xf1, 0x84, 0x17, 0xd3, 0x38, 0x5f, 0xb3, 0xbc, 0x0c, 0x2b, 0xa8, 0xfd, 0xbb, 0x16, - 0xcc, 0xf0, 0x9e, 0xdf, 0x24, 0xfb, 0x6a, 0x87, 0x7f, 0x98, 0x7d, 0x17, 0xc9, 0x3c, 0x0a, 0x39, - 0xc9, 0x3c, 0xf4, 0x4f, 0x2b, 0xf6, 0xfc, 0xb4, 0x9f, 0xb3, 0x40, 0xac, 0xc0, 0x53, 0x10, 0xe5, - 0xbf, 0xd3, 0x14, 0xe5, 0xe7, 0xf2, 0x17, 0x75, 0x8e, 0x0c, 0xff, 0xa7, 0x16, 0x4c, 0x73, 0x84, - 0xe4, 0x2d, 0xf9, 0x43, 0x9d, 0x87, 0x41, 0xb2, 0xf2, 0xa9, 0x54, 0xdd, 0xd9, 0x1f, 0x65, 0x4c, - 0x56, 0xa9, 0xe7, 0x64, 0xb5, 0xe4, 0x06, 0x3a, 0x46, 0x46, 0xca, 0x63, 0x07, 0xc5, 0xb6, 0xff, - 0xc8, 0x02, 0xc4, 0x9b, 0x31, 0xd8, 0x1f, 0xca, 0x54, 0xb0, 0x52, 0xed, 0xba, 0x48, 0x8e, 0x1a, - 0x05, 0xc1, 0x1a, 0xd6, 0x89, 0x0c, 0x4f, 0xca, 0x20, 0xa0, 0xd8, 0xdf, 0x20, 0xe0, 0x18, 0x23, - 0xfa, 0xbf, 0x4b, 0x90, 0x76, 0x2b, 0x40, 0x77, 0x61, 0xbc, 0xe9, 0xb4, 0x9d, 0x0d, 0xd7, 0x73, - 0x63, 0x97, 0x44, 0xbd, 0x2c, 0x89, 0x96, 0x34, 0x3c, 0xf1, 0xd4, 0xab, 0x95, 0x60, 0x83, 0x0e, - 0x9a, 0x07, 0x68, 0x87, 0xee, 0x9e, 0xeb, 0x91, 0x2d, 0xa6, 0x71, 0x60, 0x7e, 0x93, 0xdc, 0x3c, - 0x46, 0x96, 0x62, 0x0d, 0x23, 0xc3, 0x05, 0xae, 0xf8, 0xf0, 0x5c, 0xe0, 0x4a, 0xc7, 0x74, 0x81, - 0x1b, 0x1a, 0xc8, 0x05, 0x0e, 0xc3, 0x23, 0x92, 0x45, 0xa2, 0xff, 0x57, 0x5c, 0x8f, 0x08, 0xbe, - 0x98, 0x7b, 0x53, 0xce, 0x1d, 0x1e, 0x54, 0x1e, 0xc1, 0x99, 0x18, 0x38, 0xa7, 0x26, 0xfa, 0x1c, - 0xcc, 0x3a, 0x9e, 0x17, 0xdc, 0x53, 0xa3, 0xb6, 0x1c, 0x35, 0x1d, 0x8f, 0x6b, 0xec, 0x47, 0x18, - 0xd5, 0xc7, 0x0f, 0x0f, 0x2a, 0xb3, 0x0b, 0x39, 0x38, 0x38, 0xb7, 0x76, 0xca, 0x83, 0x6e, 0xb4, - 0xaf, 0x07, 0xdd, 0x6b, 0x50, 0x6e, 0x87, 0x41, 0x73, 0x55, 0xf3, 0xea, 0xb9, 0xc8, 0xf2, 0xdd, - 0xcb, 0xc2, 0xa3, 0x83, 0xca, 0x84, 0xfa, 0xc3, 0x6e, 0xf8, 0xa4, 0x82, 0xbd, 0x03, 0x67, 0x1a, - 0x24, 0x74, 0x59, 0x26, 0xcd, 0x56, 0xb2, 0xa1, 0xd7, 0xa1, 0x1c, 0xa6, 0x8e, 0xb0, 0x81, 0x02, - 0x34, 0x69, 0xd1, 0x82, 0xe5, 0x91, 0x95, 0x10, 0xb2, 0xff, 0xc4, 0x82, 0x11, 0x61, 0x61, 0x7e, - 0x0a, 0x9c, 0xd3, 0x82, 0xa1, 0xc0, 0xae, 0x64, 0x1f, 0xf3, 0xac, 0x33, 0xb9, 0xaa, 0xeb, 0x5a, - 0x4a, 0x75, 0xfd, 0x44, 0x2f, 0x22, 0xbd, 0x95, 0xd6, 0x7f, 0xb3, 0x08, 0x93, 0xa6, 0x53, 0xc8, - 0x29, 0x0c, 0xc1, 0x1a, 0x8c, 0x44, 0xc2, 0x03, 0xa9, 0x90, 0x6f, 0x39, 0x9d, 0x9e, 0xc4, 0xc4, - 0x2c, 0x4a, 0xf8, 0x1c, 0x49, 0x22, 0x99, 0xae, 0x4d, 0xc5, 0x87, 0xe8, 0xda, 0xd4, 0xcf, 0x2f, - 0xa7, 0x74, 0x12, 0x7e, 0x39, 0xf6, 0xd7, 0xd9, 0x55, 0xa3, 0x97, 0x9f, 0x02, 0x17, 0x72, 0xdd, - 0xbc, 0x94, 0xec, 0x1e, 0x2b, 0x4b, 0x74, 0x2a, 0x87, 0x1b, 0xf9, 0x45, 0x0b, 0x2e, 0x64, 0x7c, - 0x95, 0xc6, 0x9a, 0x3c, 0x0b, 0xa3, 0x4e, 0xa7, 0xe5, 0xaa, 0xbd, 0xac, 0x3d, 0x63, 0x2d, 0x88, - 0x72, 0xac, 0x30, 0xd0, 0x12, 0xcc, 0x90, 0xfb, 0x6d, 0x97, 0xbf, 0x23, 0xea, 0xb6, 0x8b, 0x45, - 0x1e, 0xaa, 0x76, 0x39, 0x0d, 0xc4, 0xdd, 0xf8, 0xca, 0xad, 0xbb, 0x98, 0xeb, 0xd6, 0xfd, 0x0f, - 0x2c, 0x18, 0x53, 0xde, 0x26, 0x0f, 0x7d, 0xb4, 0xbf, 0xcb, 0x1c, 0xed, 0xc7, 0x7a, 0x8c, 0x76, - 0xce, 0x30, 0xff, 0xed, 0x82, 0xea, 0x6f, 0x3d, 0x08, 0xe3, 0x01, 0x58, 0x9e, 0x57, 0x60, 0xb4, - 0x1d, 0x06, 0x71, 0xd0, 0x0c, 0x3c, 0xc1, 0xf1, 0x3c, 0x9e, 0x44, 0x1d, 0xe0, 0xe5, 0x47, 0xda, - 0x6f, 0xac, 0xb0, 0xd9, 0xe8, 0x05, 0x61, 0x2c, 0xb8, 0x8c, 0x64, 0xf4, 0x82, 0x30, 0xc6, 0x0c, - 0x82, 0x5a, 0x00, 0xb1, 0x13, 0x6e, 0x91, 0x98, 0x96, 0x89, 0x00, 0x26, 0xf9, 0x87, 0x47, 0x27, - 0x76, 0xbd, 0x79, 0xd7, 0x8f, 0xa3, 0x38, 0x9c, 0xaf, 0xf9, 0xf1, 0xed, 0x90, 0x0b, 0x50, 0x5a, - 0x18, 0x01, 0x45, 0x0b, 0x6b, 0x74, 0xa5, 0xaf, 0x27, 0x6b, 0x63, 0xc8, 0x7c, 0x10, 0x5f, 0x13, - 0xe5, 0x58, 0x61, 0xd8, 0x2f, 0xb3, 0xab, 0x84, 0x0d, 0xd0, 0xf1, 0x3c, 0xfc, 0xbf, 0x31, 0xaa, - 0x86, 0x96, 0xbd, 0x86, 0x55, 0xf5, 0x38, 0x02, 0xbd, 0x4f, 0x6e, 0xda, 0xb0, 0xee, 0x47, 0x93, - 0x04, 0x1b, 0x40, 0xdf, 0xdd, 0x65, 0x27, 0xf1, 0x5c, 0x9f, 0x2b, 0xe0, 0x18, 0x96, 0x11, 0x2c, - 0x7c, 0x36, 0x0b, 0x33, 0x5c, 0xab, 0x8b, 0x45, 0xae, 0x85, 0xcf, 0x16, 0x00, 0x9c, 0xe0, 0xa0, - 0xab, 0x42, 0xfc, 0x2e, 0x19, 0x49, 0xf4, 0xa4, 0xf8, 0x2d, 0x3f, 0x5f, 0x93, 0xbf, 0x9f, 0x87, - 0x31, 0x95, 0x4c, 0xaf, 0xce, 0x73, 0x92, 0x89, 0x70, 0x2e, 0xcb, 0x49, 0x31, 0xd6, 0x71, 0xd0, - 0x3a, 0x4c, 0x45, 0x5c, 0xf7, 0xa2, 0xa2, 0xf6, 0x71, 0x1d, 0xd6, 0x27, 0xa5, 0x7d, 0x45, 0xc3, - 0x04, 0x1f, 0xb1, 0x22, 0x7e, 0x74, 0x48, 0x87, 0xcd, 0x34, 0x09, 0xf4, 0x3a, 0x4c, 0x7a, 0x7a, - 0xda, 0xfa, 0xba, 0x50, 0x71, 0x29, 0xf3, 0x63, 0x23, 0xa9, 0x7d, 0x1d, 0xa7, 0xb0, 0x29, 0xa7, - 0xa4, 0x97, 0x88, 0x48, 0x93, 0x8e, 0xbf, 0x45, 0x22, 0x91, 0x0a, 0x8c, 0x71, 0x4a, 0xb7, 0x72, - 0x70, 0x70, 0x6e, 0x6d, 0xf4, 0x0a, 0x8c, 0xcb, 0xcf, 0xd7, 0xdc, 0x91, 0x13, 0x23, 0x77, 0x0d, - 0x86, 0x0d, 0x4c, 0x74, 0x0f, 0xce, 0xc9, 0xff, 0xeb, 0xa1, 0xb3, 0xb9, 0xe9, 0x36, 0x85, 0x37, - 0x38, 0xf7, 0xf4, 0x59, 0x90, 0xae, 0x43, 0xcb, 0x59, 0x48, 0x47, 0x07, 0x95, 0x4b, 0x62, 0xd4, - 0x32, 0xe1, 0x6c, 0x12, 0xb3, 0xe9, 0xa3, 0x55, 0x38, 0xb3, 0x4d, 0x1c, 0x2f, 0xde, 0x5e, 0xda, - 0x26, 0xcd, 0x1d, 0xb9, 0x89, 0x98, 0x93, 0xb3, 0x66, 0x1a, 0x7e, 0xa3, 0x1b, 0x05, 0x67, 0xd5, - 0x43, 0xef, 0xc0, 0x6c, 0xbb, 0xb3, 0xe1, 0xb9, 0xd1, 0xf6, 0x5a, 0x10, 0x33, 0x93, 0x0e, 0x95, - 0x8b, 0x4e, 0x78, 0x43, 0x2b, 0x07, 0xef, 0x7a, 0x0e, 0x1e, 0xce, 0xa5, 0x80, 0xde, 0x87, 0x73, - 0xa9, 0xc5, 0x20, 0x7c, 0x33, 0x27, 0xf3, 0xe3, 0xf6, 0x36, 0xb2, 0x2a, 0x08, 0x5f, 0xcb, 0x2c, - 0x10, 0xce, 0x6e, 0xe2, 0x83, 0x19, 0xfa, 0xbc, 0x47, 0x2b, 0x6b, 0x4c, 0x19, 0xfa, 0x12, 0x8c, - 0xeb, 0xab, 0x48, 0x5c, 0x30, 0x97, 0xb3, 0x79, 0x16, 0x6d, 0xb5, 0x71, 0x96, 0x4e, 0xad, 0x28, - 0x1d, 0x86, 0x0d, 0x8a, 0x36, 0x81, 0xec, 0xef, 0x43, 0xb7, 0x60, 0xb4, 0xe9, 0xb9, 0xc4, 0x8f, - 0x6b, 0xf5, 0x5e, 0xc1, 0x43, 0x96, 0x04, 0x8e, 0x18, 0x30, 0x11, 0xe8, 0x94, 0x97, 0x61, 0x45, - 0xc1, 0xfe, 0x8d, 0x02, 0x54, 0xfa, 0x44, 0xcd, 0x4d, 0xe9, 0xa3, 0xad, 0x81, 0xf4, 0xd1, 0x0b, - 0x32, 0xb3, 0xde, 0x5a, 0x4a, 0x48, 0x4f, 0x65, 0xcd, 0x4b, 0x44, 0xf5, 0x34, 0xfe, 0xc0, 0xf6, - 0xc1, 0xba, 0x4a, 0xbb, 0xd4, 0xd7, 0x72, 0xdd, 0x78, 0xca, 0x1a, 0x1a, 0x5c, 0x10, 0xc9, 0x7d, - 0x96, 0xb0, 0xbf, 0x5e, 0x80, 0x73, 0x6a, 0x08, 0xbf, 0x75, 0x07, 0xee, 0x4e, 0xf7, 0xc0, 0x9d, - 0xc0, 0xa3, 0x8e, 0x7d, 0x1b, 0x86, 0x79, 0xf0, 0x95, 0x01, 0x18, 0xa0, 0x27, 0xcd, 0x48, 0x5d, - 0xea, 0x9a, 0x36, 0xa2, 0x75, 0xfd, 0x25, 0x0b, 0xa6, 0xd6, 0x97, 0xea, 0x8d, 0xa0, 0xb9, 0x43, - 0xe2, 0x05, 0xce, 0xb0, 0x62, 0xc1, 0xff, 0x58, 0x0f, 0xc8, 0xd7, 0x64, 0x71, 0x4c, 0x97, 0xa0, - 0xb4, 0x1d, 0x44, 0x71, 0xfa, 0xc5, 0xf7, 0x46, 0x10, 0xc5, 0x98, 0x41, 0xec, 0xdf, 0xb3, 0x60, - 0x88, 0xe5, 0x83, 0xed, 0x97, 0xa4, 0x78, 0x90, 0xef, 0x42, 0x2f, 0xc1, 0x30, 0xd9, 0xdc, 0x24, - 0xcd, 0x58, 0xcc, 0xaa, 0x74, 0x47, 0x1d, 0x5e, 0x66, 0xa5, 0xf4, 0xd2, 0x67, 0x8d, 0xf1, 0xbf, - 0x58, 0x20, 0xa3, 0xb7, 0xa0, 0x1c, 0xbb, 0xbb, 0x64, 0xa1, 0xd5, 0x12, 0x6f, 0x66, 0x0f, 0xe0, - 0xfd, 0xbb, 0x2e, 0x09, 0xe0, 0x84, 0x96, 0xfd, 0xd5, 0x02, 0x40, 0x12, 0x42, 0xa0, 0xdf, 0x27, - 0x2e, 0x76, 0xbd, 0xa6, 0x5c, 0xce, 0x78, 0x4d, 0x41, 0x09, 0xc1, 0x8c, 0xa7, 0x14, 0x35, 0x4c, - 0xc5, 0x81, 0x86, 0xa9, 0x74, 0x9c, 0x61, 0x5a, 0x82, 0x99, 0x24, 0x04, 0x82, 0x19, 0x0f, 0x86, - 0x09, 0x29, 0xeb, 0x69, 0x20, 0xee, 0xc6, 0xb7, 0x09, 0x5c, 0x92, 0x91, 0x39, 0xe5, 0x5d, 0xc3, - 0x4c, 0x32, 0x8f, 0x91, 0xaf, 0x3a, 0x79, 0x2e, 0x2a, 0xe4, 0x3e, 0x17, 0xfd, 0xa4, 0x05, 0x67, - 0xd3, 0xed, 0x30, 0xdf, 0xb7, 0xaf, 0x58, 0x70, 0x8e, 0x3d, 0x9a, 0xb1, 0x56, 0xbb, 0x9f, 0xe8, - 0x5e, 0xcc, 0x0e, 0x0d, 0xd1, 0xbb, 0xc7, 0x89, 0xdf, 0xf3, 0x6a, 0x16, 0x69, 0x9c, 0xdd, 0xa2, - 0xfd, 0x15, 0x0b, 0xce, 0xe7, 0xa6, 0x21, 0x42, 0x57, 0x60, 0xd4, 0x69, 0xbb, 0x5c, 0x23, 0x25, - 0xf6, 0x3b, 0x93, 0x1e, 0xeb, 0x35, 0xae, 0x8f, 0x52, 0x50, 0x95, 0x1e, 0xb1, 0x90, 0x9b, 0x1e, - 0xb1, 0x6f, 0xb6, 0x43, 0xfb, 0x07, 0x2d, 0x10, 0xee, 0x4e, 0x03, 0x1c, 0x32, 0x6f, 0xcb, 0xec, - 0xb2, 0x46, 0x50, 0xf4, 0x4b, 0xf9, 0xfe, 0x5f, 0x22, 0x14, 0xba, 0xba, 0xd4, 0x8d, 0x00, 0xe8, - 0x06, 0x2d, 0xbb, 0x05, 0x02, 0x5a, 0x25, 0x4c, 0x67, 0xd5, 0xbf, 0x37, 0xd7, 0x00, 0x5a, 0x0c, - 0x57, 0xcb, 0x31, 0xa9, 0xae, 0x90, 0xaa, 0x82, 0x60, 0x0d, 0xcb, 0xfe, 0x91, 0x02, 0x8c, 0xc9, - 0x20, 0xdc, 0x1d, 0x7f, 0x10, 0xc9, 0xf2, 0x58, 0xb9, 0x78, 0x58, 0x52, 0x56, 0x4a, 0xb8, 0x9e, - 0x08, 0xe4, 0x49, 0x52, 0x56, 0x09, 0xc0, 0x09, 0x0e, 0x7a, 0x1a, 0x46, 0xa2, 0xce, 0x06, 0x43, - 0x4f, 0x39, 0xf1, 0x34, 0x78, 0x31, 0x96, 0x70, 0xf4, 0x39, 0x98, 0xe6, 0xf5, 0xc2, 0xa0, 0xed, - 0x6c, 0x71, 0xf5, 0xe7, 0x90, 0xf2, 0xaa, 0x9d, 0x5e, 0x4d, 0xc1, 0x8e, 0x0e, 0x2a, 0x67, 0xd3, - 0x65, 0x4c, 0x71, 0xde, 0x45, 0xc5, 0xfe, 0x12, 0xa0, 0xee, 0xb8, 0xe2, 0xe8, 0x0d, 0x6e, 0x4a, - 0xe5, 0x86, 0xa4, 0xd5, 0x4b, 0x23, 0xae, 0x3b, 0x81, 0x4a, 0x43, 0x7a, 0x5e, 0x0b, 0xab, 0xfa, - 0xf6, 0x5f, 0x2d, 0xc2, 0x74, 0xda, 0x25, 0x10, 0xdd, 0x80, 0x61, 0x7e, 0xd9, 0x09, 0xf2, 0x3d, - 0x1e, 0x5c, 0x35, 0x47, 0x42, 0xb6, 0xed, 0xc5, 0x7d, 0x29, 0xea, 0xa3, 0x77, 0x60, 0xac, 0x15, - 0xdc, 0xf3, 0xef, 0x39, 0x61, 0x6b, 0xa1, 0x5e, 0x13, 0xeb, 0x32, 0x93, 0x67, 0xae, 0x26, 0x68, - 0xba, 0x73, 0x22, 0x7b, 0x5c, 0x48, 0x40, 0x58, 0x27, 0x87, 0xd6, 0x59, 0xac, 0xc4, 0x4d, 0x77, - 0x6b, 0xd5, 0x69, 0xf7, 0xb2, 0xab, 0x5d, 0x92, 0x48, 0x1a, 0xe5, 0x09, 0x11, 0x50, 0x91, 0x03, - 0x70, 0x42, 0x08, 0x7d, 0x2f, 0x9c, 0x89, 0x72, 0xd4, 0x6c, 0x79, 0x69, 0x26, 0x7a, 0x69, 0x9e, - 0x16, 0x1f, 0xa5, 0xd2, 0x4c, 0x96, 0x42, 0x2e, 0xab, 0x19, 0xfb, 0xcb, 0x67, 0xc0, 0xd8, 0x8d, - 0x46, 0xae, 0x21, 0xeb, 0x84, 0x72, 0x0d, 0x61, 0x18, 0x25, 0xbb, 0xed, 0x78, 0xbf, 0xea, 0x86, - 0xbd, 0x72, 0xe1, 0x2d, 0x0b, 0x9c, 0x6e, 0x9a, 0x12, 0x82, 0x15, 0x9d, 0xec, 0x84, 0x50, 0xc5, - 0x0f, 0x31, 0x21, 0x54, 0xe9, 0x14, 0x13, 0x42, 0xad, 0xc1, 0xc8, 0x96, 0x1b, 0x63, 0xd2, 0x0e, - 0x04, 0x9b, 0x99, 0xb9, 0x0e, 0xaf, 0x73, 0x94, 0xee, 0x24, 0x24, 0x02, 0x80, 0x25, 0x11, 0xf4, - 0x86, 0xda, 0x81, 0xc3, 0xf9, 0x52, 0x5a, 0xf7, 0xcb, 0x60, 0xe6, 0x1e, 0x14, 0x09, 0xa0, 0x46, - 0x1e, 0x34, 0x01, 0xd4, 0x8a, 0x4c, 0xdb, 0x34, 0x9a, 0x6f, 0x04, 0xcf, 0xb2, 0x32, 0xf5, 0x49, - 0xd6, 0x64, 0x24, 0xb8, 0x2a, 0x9f, 0x5c, 0x82, 0xab, 0x1f, 0xb4, 0xe0, 0x5c, 0x3b, 0x2b, 0xd7, - 0x9b, 0x48, 0xb6, 0xf4, 0xd2, 0xc0, 0xc9, 0xec, 0x8c, 0x06, 0x99, 0xb8, 0x9e, 0x89, 0x86, 0xb3, - 0x9b, 0xa3, 0x03, 0x1d, 0x6e, 0xb4, 0x44, 0x86, 0xa6, 0x27, 0x73, 0x32, 0x65, 0xf5, 0xc8, 0x8f, - 0xb5, 0x9e, 0x91, 0x95, 0xe9, 0xe3, 0x79, 0x59, 0x99, 0x06, 0xce, 0xc5, 0xf4, 0x86, 0xca, 0x91, - 0x35, 0x91, 0xbf, 0x94, 0x78, 0x06, 0xac, 0xbe, 0x99, 0xb1, 0xde, 0x50, 0x99, 0xb1, 0x7a, 0xc4, - 0x8c, 0xe3, 0x79, 0xaf, 0xfa, 0xe6, 0xc3, 0xd2, 0x72, 0x5a, 0x4d, 0x9d, 0x4c, 0x4e, 0x2b, 0xe3, - 0xaa, 0xe1, 0x69, 0x95, 0x9e, 0xe9, 0x73, 0xd5, 0x18, 0x74, 0x7b, 0x5f, 0x36, 0x3c, 0x7f, 0xd7, - 0xcc, 0x03, 0xe5, 0xef, 0xba, 0xab, 0xe7, 0xc3, 0x42, 0x7d, 0x12, 0x3e, 0x51, 0xa4, 0x01, 0xb3, - 0x60, 0xdd, 0xd5, 0x2f, 0xc0, 0x33, 0xf9, 0x74, 0xd5, 0x3d, 0xd7, 0x4d, 0x37, 0xf3, 0x0a, 0xec, - 0xca, 0xae, 0x75, 0xf6, 0x74, 0xb2, 0x6b, 0x9d, 0x3b, 0xf1, 0xec, 0x5a, 0x8f, 0x9c, 0x42, 0x76, - 0xad, 0x47, 0x3f, 0xd4, 0xec, 0x5a, 0xb3, 0x0f, 0x21, 0xbb, 0xd6, 0x5a, 0x92, 0x5d, 0xeb, 0x7c, - 0xfe, 0x94, 0x64, 0x58, 0xe6, 0xe6, 0xe4, 0xd4, 0xba, 0xcb, 0x9e, 0xe7, 0x79, 0xcc, 0x0a, 0x11, - 0xd4, 0x2e, 0x3b, 0x7f, 0x70, 0x56, 0x60, 0x0b, 0x3e, 0x25, 0x0a, 0x84, 0x13, 0x52, 0x94, 0x6e, - 0x92, 0x63, 0xeb, 0xb1, 0x1e, 0x0a, 0xd9, 0x2c, 0x55, 0x57, 0x7e, 0x66, 0x2d, 0xfb, 0x2f, 0x17, - 0xe0, 0x62, 0xef, 0x75, 0x9d, 0xe8, 0xc9, 0xea, 0xc9, 0xbb, 0x4e, 0x4a, 0x4f, 0xc6, 0x85, 0x9c, - 0x04, 0x6b, 0xe0, 0xc0, 0x3e, 0xd7, 0x61, 0x46, 0x99, 0xe4, 0x7a, 0x6e, 0x73, 0x5f, 0xcb, 0x2b, - 0xac, 0x5c, 0x0f, 0x1b, 0x69, 0x04, 0xdc, 0x5d, 0x07, 0x2d, 0xc0, 0x94, 0x51, 0x58, 0xab, 0x0a, - 0x61, 0x46, 0x29, 0xe6, 0x1a, 0x26, 0x18, 0xa7, 0xf1, 0xed, 0x9f, 0xb5, 0xe0, 0xd1, 0x9c, 0xc4, - 0x13, 0x03, 0xc7, 0xad, 0xd9, 0x84, 0xa9, 0xb6, 0x59, 0xb5, 0x4f, 0x78, 0x2b, 0x23, 0xbd, 0x85, - 0xea, 0x6b, 0x0a, 0x80, 0xd3, 0x44, 0x17, 0xaf, 0xfc, 0xf6, 0x1f, 0x5c, 0xfc, 0xd8, 0xef, 0xfc, - 0xc1, 0xc5, 0x8f, 0xfd, 0xee, 0x1f, 0x5c, 0xfc, 0xd8, 0xff, 0x7f, 0x78, 0xd1, 0xfa, 0xed, 0xc3, - 0x8b, 0xd6, 0xef, 0x1c, 0x5e, 0xb4, 0x7e, 0xf7, 0xf0, 0xa2, 0xf5, 0xfb, 0x87, 0x17, 0xad, 0xaf, - 0xfe, 0xe1, 0xc5, 0x8f, 0xbd, 0x5d, 0xd8, 0x7b, 0xfe, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0xd1, - 0x90, 0x44, 0x98, 0x55, 0xe7, 0x00, 0x00, + // 12835 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x7d, 0x6d, 0x70, 0x64, 0x57, + 0x56, 0xd8, 0xbe, 0xee, 0xd6, 0x47, 0x1f, 0x7d, 0xdf, 0x99, 0xb1, 0x35, 0xb2, 0x67, 0x7a, 0xfc, + 0xbc, 0x3b, 0x1e, 0xaf, 0x6d, 0xcd, 0x7a, 0x6c, 0xaf, 0xcd, 0xda, 0x6b, 0x90, 0xd4, 0xd2, 0x4c, + 0x7b, 0x46, 0x9a, 0xf6, 0x6d, 0xcd, 0x78, 0xd7, 0x78, 0x97, 0x7d, 0xea, 0xbe, 0x92, 0x9e, 0xf5, + 0xf4, 0x5e, 0xfb, 0xbd, 0xd7, 0x9a, 0x91, 0x03, 0x55, 0xc9, 0x12, 0x48, 0x36, 0x50, 0xa9, 0xad, + 0xb0, 0x95, 0x0f, 0xa0, 0x48, 0x15, 0x21, 0x05, 0x84, 0x24, 0x15, 0x02, 0x01, 0xc2, 0x42, 0x42, + 0x20, 0x3f, 0xc8, 0x9f, 0x0d, 0x49, 0x55, 0x6a, 0xa9, 0xa2, 0xa2, 0x80, 0x48, 0x25, 0xc5, 0x8f, + 0x40, 0x2a, 0xe4, 0x47, 0x50, 0xa8, 0x90, 0xba, 0x9f, 0xef, 0xde, 0xd7, 0xef, 0x75, 0xb7, 0xc6, + 0x1a, 0xd9, 0x50, 0xfb, 0xaf, 0xfb, 0x9e, 0x73, 0xcf, 0xbd, 0xef, 0x7e, 0x9e, 0x73, 0xee, 0xf9, + 0x80, 0x57, 0x77, 0x5e, 0x89, 0xe6, 0xdd, 0xe0, 0xea, 0x4e, 0x67, 0x83, 0x84, 0x3e, 0x89, 0x49, + 0x74, 0x75, 0x8f, 0xf8, 0xad, 0x20, 0xbc, 0x2a, 0x00, 0x4e, 0xdb, 0xbd, 0xda, 0x0c, 0x42, 0x72, + 0x75, 0xef, 0xf9, 0xab, 0x5b, 0xc4, 0x27, 0xa1, 0x13, 0x93, 0xd6, 0x7c, 0x3b, 0x0c, 0xe2, 0x00, + 0x21, 0x8e, 0x33, 0xef, 0xb4, 0xdd, 0x79, 0x8a, 0x33, 0xbf, 0xf7, 0xfc, 0xdc, 0x73, 0x5b, 0x6e, + 0xbc, 0xdd, 0xd9, 0x98, 0x6f, 0x06, 0xbb, 0x57, 0xb7, 0x82, 0xad, 0xe0, 0x2a, 0x43, 0xdd, 0xe8, + 0x6c, 0xb2, 0x7f, 0xec, 0x0f, 0xfb, 0xc5, 0x49, 0xcc, 0xbd, 0x98, 0x34, 0xb3, 0xeb, 0x34, 0xb7, + 0x5d, 0x9f, 0x84, 0xfb, 0x57, 0xdb, 0x3b, 0x5b, 0xac, 0xdd, 0x90, 0x44, 0x41, 0x27, 0x6c, 0x92, + 0x74, 0xc3, 0x3d, 0x6b, 0x45, 0x57, 0x77, 0x49, 0xec, 0x64, 0x74, 0x77, 0xee, 0x6a, 0x5e, 0xad, + 0xb0, 0xe3, 0xc7, 0xee, 0x6e, 0x77, 0x33, 0x9f, 0xee, 0x57, 0x21, 0x6a, 0x6e, 0x93, 0x5d, 0xa7, + 0xab, 0xde, 0x0b, 0x79, 0xf5, 0x3a, 0xb1, 0xeb, 0x5d, 0x75, 0xfd, 0x38, 0x8a, 0xc3, 0x74, 0x25, + 0xfb, 0x9b, 0x16, 0x5c, 0x5a, 0x78, 0xab, 0xb1, 0xec, 0x39, 0x51, 0xec, 0x36, 0x17, 0xbd, 0xa0, + 0xb9, 0xd3, 0x88, 0x83, 0x90, 0xdc, 0x0d, 0xbc, 0xce, 0x2e, 0x69, 0xb0, 0x81, 0x40, 0xcf, 0xc2, + 0xe8, 0x1e, 0xfb, 0x5f, 0xab, 0xce, 0x5a, 0x97, 0xac, 0x2b, 0xe5, 0xc5, 0xe9, 0xdf, 0x3c, 0xa8, + 0x7c, 0xec, 0xf0, 0xa0, 0x32, 0x7a, 0x57, 0x94, 0x63, 0x85, 0x81, 0x2e, 0xc3, 0xf0, 0x66, 0xb4, + 0xbe, 0xdf, 0x26, 0xb3, 0x05, 0x86, 0x3b, 0x29, 0x70, 0x87, 0x57, 0x1a, 0xb4, 0x14, 0x0b, 0x28, + 0xba, 0x0a, 0xe5, 0xb6, 0x13, 0xc6, 0x6e, 0xec, 0x06, 0xfe, 0x6c, 0xf1, 0x92, 0x75, 0x65, 0x68, + 0x71, 0x46, 0xa0, 0x96, 0xeb, 0x12, 0x80, 0x13, 0x1c, 0xda, 0x8d, 0x90, 0x38, 0xad, 0xdb, 0xbe, + 0xb7, 0x3f, 0x5b, 0xba, 0x64, 0x5d, 0x19, 0x4d, 0xba, 0x81, 0x45, 0x39, 0x56, 0x18, 0xf6, 0x0f, + 0x17, 0x60, 0x74, 0x61, 0x73, 0xd3, 0xf5, 0xdd, 0x78, 0x1f, 0xdd, 0x85, 0x71, 0x3f, 0x68, 0x11, + 0xf9, 0x9f, 0x7d, 0xc5, 0xd8, 0xb5, 0x4b, 0xf3, 0xdd, 0x4b, 0x69, 0x7e, 0x4d, 0xc3, 0x5b, 0x9c, + 0x3e, 0x3c, 0xa8, 0x8c, 0xeb, 0x25, 0xd8, 0xa0, 0x83, 0x30, 0x8c, 0xb5, 0x83, 0x96, 0x22, 0x5b, + 0x60, 0x64, 0x2b, 0x59, 0x64, 0xeb, 0x09, 0xda, 0xe2, 0xd4, 0xe1, 0x41, 0x65, 0x4c, 0x2b, 0xc0, + 0x3a, 0x11, 0xb4, 0x01, 0x53, 0xf4, 0xaf, 0x1f, 0xbb, 0x8a, 0x6e, 0x91, 0xd1, 0x7d, 0x32, 0x8f, + 0xae, 0x86, 0xba, 0x78, 0xe6, 0xf0, 0xa0, 0x32, 0x95, 0x2a, 0xc4, 0x69, 0x82, 0xf6, 0xfb, 0x30, + 0xb9, 0x10, 0xc7, 0x4e, 0x73, 0x9b, 0xb4, 0xf8, 0x0c, 0xa2, 0x17, 0xa1, 0xe4, 0x3b, 0xbb, 0x44, + 0xcc, 0xef, 0x25, 0x31, 0xb0, 0xa5, 0x35, 0x67, 0x97, 0x1c, 0x1d, 0x54, 0xa6, 0xef, 0xf8, 0xee, + 0x7b, 0x1d, 0xb1, 0x2a, 0x68, 0x19, 0x66, 0xd8, 0xe8, 0x1a, 0x40, 0x8b, 0xec, 0xb9, 0x4d, 0x52, + 0x77, 0xe2, 0x6d, 0x31, 0xdf, 0x48, 0xd4, 0x85, 0xaa, 0x82, 0x60, 0x0d, 0xcb, 0xbe, 0x0f, 0xe5, + 0x85, 0xbd, 0xc0, 0x6d, 0xd5, 0x83, 0x56, 0x84, 0x76, 0x60, 0xaa, 0x1d, 0x92, 0x4d, 0x12, 0xaa, + 0xa2, 0x59, 0xeb, 0x52, 0xf1, 0xca, 0xd8, 0xb5, 0x2b, 0x99, 0x1f, 0x6b, 0xa2, 0x2e, 0xfb, 0x71, + 0xb8, 0xbf, 0xf8, 0xa8, 0x68, 0x6f, 0x2a, 0x05, 0xc5, 0x69, 0xca, 0xf6, 0xbf, 0x2d, 0xc0, 0xb9, + 0x85, 0xf7, 0x3b, 0x21, 0xa9, 0xba, 0xd1, 0x4e, 0x7a, 0x85, 0xb7, 0xdc, 0x68, 0x67, 0x2d, 0x19, + 0x01, 0xb5, 0xb4, 0xaa, 0xa2, 0x1c, 0x2b, 0x0c, 0xf4, 0x1c, 0x8c, 0xd0, 0xdf, 0x77, 0x70, 0x4d, + 0x7c, 0xf2, 0x19, 0x81, 0x3c, 0x56, 0x75, 0x62, 0xa7, 0xca, 0x41, 0x58, 0xe2, 0xa0, 0x55, 0x18, + 0x6b, 0xb2, 0x0d, 0xb9, 0xb5, 0x1a, 0xb4, 0x08, 0x9b, 0xcc, 0xf2, 0xe2, 0x33, 0x14, 0x7d, 0x29, + 0x29, 0x3e, 0x3a, 0xa8, 0xcc, 0xf2, 0xbe, 0x09, 0x12, 0x1a, 0x0c, 0xeb, 0xf5, 0x91, 0xad, 0xf6, + 0x57, 0x89, 0x51, 0x82, 0x8c, 0xbd, 0x75, 0x45, 0xdb, 0x2a, 0x43, 0x6c, 0xab, 0x8c, 0x67, 0x6f, + 0x13, 0xf4, 0x3c, 0x94, 0x76, 0x5c, 0xbf, 0x35, 0x3b, 0xcc, 0x68, 0x5d, 0xa0, 0x73, 0x7e, 0xd3, + 0xf5, 0x5b, 0x47, 0x07, 0x95, 0x19, 0xa3, 0x3b, 0xb4, 0x10, 0x33, 0x54, 0xfb, 0x8f, 0x2d, 0xa8, + 0x30, 0xd8, 0x8a, 0xeb, 0x91, 0x3a, 0x09, 0x23, 0x37, 0x8a, 0x89, 0x1f, 0x1b, 0x03, 0x7a, 0x0d, + 0x20, 0x22, 0xcd, 0x90, 0xc4, 0xda, 0x90, 0xaa, 0x85, 0xd1, 0x50, 0x10, 0xac, 0x61, 0xd1, 0x03, + 0x21, 0xda, 0x76, 0x42, 0xb6, 0xbe, 0xc4, 0xc0, 0xaa, 0x03, 0xa1, 0x21, 0x01, 0x38, 0xc1, 0x31, + 0x0e, 0x84, 0x62, 0xbf, 0x03, 0x01, 0x7d, 0x16, 0xa6, 0x92, 0xc6, 0xa2, 0xb6, 0xd3, 0x94, 0x03, + 0xc8, 0xb6, 0x4c, 0xc3, 0x04, 0xe1, 0x34, 0xae, 0xfd, 0x8f, 0x2c, 0xb1, 0x78, 0xe8, 0x57, 0x7f, + 0xc4, 0xbf, 0xd5, 0xfe, 0x25, 0x0b, 0x46, 0x16, 0x5d, 0xbf, 0xe5, 0xfa, 0x5b, 0xe8, 0x4b, 0x30, + 0x4a, 0xef, 0xa6, 0x96, 0x13, 0x3b, 0xe2, 0xdc, 0xfb, 0x94, 0xb6, 0xb7, 0xd4, 0x55, 0x31, 0xdf, + 0xde, 0xd9, 0xa2, 0x05, 0xd1, 0x3c, 0xc5, 0xa6, 0xbb, 0xed, 0xf6, 0xc6, 0xbb, 0xa4, 0x19, 0xaf, + 0x92, 0xd8, 0x49, 0x3e, 0x27, 0x29, 0xc3, 0x8a, 0x2a, 0xba, 0x09, 0xc3, 0xb1, 0x13, 0x6e, 0x91, + 0x58, 0x1c, 0x80, 0x99, 0x07, 0x15, 0xaf, 0x89, 0xe9, 0x8e, 0x24, 0x7e, 0x93, 0x24, 0xd7, 0xc2, + 0x3a, 0xab, 0x8a, 0x05, 0x09, 0xfb, 0x6f, 0x0c, 0xc3, 0xf9, 0xa5, 0x46, 0x2d, 0x67, 0x5d, 0x5d, + 0x86, 0xe1, 0x56, 0xe8, 0xee, 0x91, 0x50, 0x8c, 0xb3, 0xa2, 0x52, 0x65, 0xa5, 0x58, 0x40, 0xd1, + 0x2b, 0x30, 0xce, 0x2f, 0xa4, 0x1b, 0x8e, 0xdf, 0xf2, 0xe4, 0x10, 0x9f, 0x15, 0xd8, 0xe3, 0x77, + 0x35, 0x18, 0x36, 0x30, 0x8f, 0xb9, 0xa8, 0x2e, 0xa7, 0x36, 0x63, 0xde, 0x65, 0xf7, 0x15, 0x0b, + 0xa6, 0x79, 0x33, 0x0b, 0x71, 0x1c, 0xba, 0x1b, 0x9d, 0x98, 0x44, 0xb3, 0x43, 0xec, 0xa4, 0x5b, + 0xca, 0x1a, 0xad, 0xdc, 0x11, 0x98, 0xbf, 0x9b, 0xa2, 0xc2, 0x0f, 0xc1, 0x59, 0xd1, 0xee, 0x74, + 0x1a, 0x8c, 0xbb, 0x9a, 0x45, 0xdf, 0x6b, 0xc1, 0x5c, 0x33, 0xf0, 0xe3, 0x30, 0xf0, 0x3c, 0x12, + 0xd6, 0x3b, 0x1b, 0x9e, 0x1b, 0x6d, 0xf3, 0x75, 0x8a, 0xc9, 0x26, 0x3b, 0x09, 0x72, 0xe6, 0x50, + 0x21, 0x89, 0x39, 0xbc, 0x78, 0x78, 0x50, 0x99, 0x5b, 0xca, 0x25, 0x85, 0x7b, 0x34, 0x83, 0x76, + 0x00, 0xd1, 0xab, 0xb4, 0x11, 0x3b, 0x5b, 0x24, 0x69, 0x7c, 0x64, 0xf0, 0xc6, 0x1f, 0x39, 0x3c, + 0xa8, 0xa0, 0xb5, 0x2e, 0x12, 0x38, 0x83, 0x2c, 0x7a, 0x0f, 0xce, 0xd2, 0xd2, 0xae, 0x6f, 0x1d, + 0x1d, 0xbc, 0xb9, 0xd9, 0xc3, 0x83, 0xca, 0xd9, 0xb5, 0x0c, 0x22, 0x38, 0x93, 0xf4, 0xdc, 0x12, + 0x9c, 0xcb, 0x9c, 0x2a, 0x34, 0x0d, 0xc5, 0x1d, 0xc2, 0x59, 0x90, 0x32, 0xa6, 0x3f, 0xd1, 0x59, + 0x18, 0xda, 0x73, 0xbc, 0x8e, 0x58, 0xa5, 0x98, 0xff, 0xf9, 0x4c, 0xe1, 0x15, 0xcb, 0x6e, 0xc2, + 0xf8, 0x92, 0xd3, 0x76, 0x36, 0x5c, 0xcf, 0x8d, 0x5d, 0x12, 0xa1, 0xa7, 0xa0, 0xe8, 0xb4, 0x5a, + 0xec, 0x8a, 0x2c, 0x2f, 0x9e, 0x3b, 0x3c, 0xa8, 0x14, 0x17, 0x5a, 0xf4, 0xac, 0x06, 0x85, 0xb5, + 0x8f, 0x29, 0x06, 0xfa, 0x24, 0x94, 0x5a, 0x61, 0xd0, 0x9e, 0x2d, 0x30, 0x4c, 0x3a, 0x54, 0xa5, + 0x6a, 0x18, 0xb4, 0x53, 0xa8, 0x0c, 0xc7, 0xfe, 0xb5, 0x02, 0x3c, 0xbe, 0x44, 0xda, 0xdb, 0x2b, + 0x8d, 0x9c, 0x4d, 0x77, 0x05, 0x46, 0x77, 0x03, 0xdf, 0x8d, 0x83, 0x30, 0x12, 0x4d, 0xb3, 0xdb, + 0x64, 0x55, 0x94, 0x61, 0x05, 0x45, 0x97, 0xa0, 0xd4, 0x4e, 0x38, 0x81, 0x71, 0xc9, 0x45, 0x30, + 0x1e, 0x80, 0x41, 0x28, 0x46, 0x27, 0x22, 0xa1, 0xb8, 0x05, 0x15, 0xc6, 0x9d, 0x88, 0x84, 0x98, + 0x41, 0x92, 0xe3, 0x94, 0x1e, 0xb4, 0x62, 0x5b, 0xa5, 0x8e, 0x53, 0x0a, 0xc1, 0x1a, 0x16, 0xaa, + 0x43, 0x39, 0x52, 0x93, 0x3a, 0x34, 0xf8, 0xa4, 0x4e, 0xb0, 0xf3, 0x56, 0xcd, 0x64, 0x42, 0xc4, + 0x38, 0x06, 0x86, 0xfb, 0x9e, 0xb7, 0x5f, 0x2f, 0x00, 0xe2, 0x43, 0xf8, 0xe7, 0x6c, 0xe0, 0xee, + 0x74, 0x0f, 0x5c, 0x26, 0xe7, 0x75, 0x2b, 0x68, 0x3a, 0x5e, 0xfa, 0x08, 0x3f, 0xa9, 0xd1, 0xfb, + 0xdf, 0x16, 0x3c, 0xbe, 0xe4, 0xfa, 0x2d, 0x12, 0xe6, 0x2c, 0xc0, 0x87, 0x23, 0x80, 0x1c, 0xef, + 0xa4, 0x37, 0x96, 0x58, 0xe9, 0x04, 0x96, 0x98, 0xfd, 0x47, 0x16, 0x20, 0xfe, 0xd9, 0x1f, 0xb9, + 0x8f, 0xbd, 0xd3, 0xfd, 0xb1, 0x27, 0xb0, 0x2c, 0xec, 0x5b, 0x30, 0xb9, 0xe4, 0xb9, 0xc4, 0x8f, + 0x6b, 0xf5, 0xa5, 0xc0, 0xdf, 0x74, 0xb7, 0xd0, 0x67, 0x60, 0x92, 0xca, 0xb4, 0x41, 0x27, 0x6e, + 0x90, 0x66, 0xe0, 0x33, 0xf6, 0x9f, 0x4a, 0x82, 0xe8, 0xf0, 0xa0, 0x32, 0xb9, 0x6e, 0x40, 0x70, + 0x0a, 0xd3, 0xfe, 0x1d, 0x3a, 0x7e, 0xc1, 0x6e, 0x3b, 0xf0, 0x89, 0x1f, 0x2f, 0x05, 0x7e, 0x8b, + 0x8b, 0x89, 0x9f, 0x81, 0x52, 0x4c, 0xc7, 0x83, 0x8f, 0xdd, 0x65, 0xb9, 0x51, 0xe8, 0x28, 0x1c, + 0x1d, 0x54, 0x1e, 0xe9, 0xae, 0xc1, 0xc6, 0x89, 0xd5, 0x41, 0xdf, 0x06, 0xc3, 0x51, 0xec, 0xc4, + 0x9d, 0x48, 0x8c, 0xe6, 0x13, 0x72, 0x34, 0x1b, 0xac, 0xf4, 0xe8, 0xa0, 0x32, 0xa5, 0xaa, 0xf1, + 0x22, 0x2c, 0x2a, 0xa0, 0xa7, 0x61, 0x64, 0x97, 0x44, 0x91, 0xb3, 0x25, 0x39, 0xfc, 0x29, 0x51, + 0x77, 0x64, 0x95, 0x17, 0x63, 0x09, 0x47, 0x4f, 0xc2, 0x10, 0x09, 0xc3, 0x20, 0x14, 0x7b, 0x74, + 0x42, 0x20, 0x0e, 0x2d, 0xd3, 0x42, 0xcc, 0x61, 0xf6, 0xbf, 0xb7, 0x60, 0x4a, 0xf5, 0x95, 0xb7, + 0x75, 0x0a, 0xac, 0xdc, 0xdb, 0x00, 0x4d, 0xf9, 0x81, 0x11, 0xbb, 0x3d, 0xc6, 0xae, 0x5d, 0xce, + 0x64, 0x50, 0xba, 0x86, 0x31, 0xa1, 0xac, 0x8a, 0x22, 0xac, 0x51, 0xb3, 0x7f, 0xd5, 0x82, 0x33, + 0xa9, 0x2f, 0xba, 0xe5, 0x46, 0x31, 0x7a, 0xa7, 0xeb, 0xab, 0xe6, 0x07, 0xfb, 0x2a, 0x5a, 0x9b, + 0x7d, 0x93, 0x5a, 0xca, 0xb2, 0x44, 0xfb, 0xa2, 0x1b, 0x30, 0xe4, 0xc6, 0x64, 0x57, 0x7e, 0xcc, + 0x93, 0x3d, 0x3f, 0x86, 0xf7, 0x2a, 0x99, 0x91, 0x1a, 0xad, 0x89, 0x39, 0x01, 0xfb, 0x87, 0x8a, + 0x50, 0xe6, 0xcb, 0x76, 0xd5, 0x69, 0x9f, 0xc2, 0x5c, 0xd4, 0xa0, 0xc4, 0xa8, 0xf3, 0x8e, 0x3f, + 0x95, 0xdd, 0x71, 0xd1, 0x9d, 0x79, 0x2a, 0xa7, 0x71, 0x56, 0x50, 0x5d, 0x0d, 0xb4, 0x08, 0x33, + 0x12, 0xc8, 0x01, 0xd8, 0x70, 0x7d, 0x27, 0xdc, 0xa7, 0x65, 0xb3, 0x45, 0x46, 0xf0, 0xb9, 0xde, + 0x04, 0x17, 0x15, 0x3e, 0x27, 0xab, 0xfa, 0x9a, 0x00, 0xb0, 0x46, 0x74, 0xee, 0x65, 0x28, 0x2b, + 0xe4, 0xe3, 0xf0, 0x38, 0x73, 0x9f, 0x85, 0xa9, 0x54, 0x5b, 0xfd, 0xaa, 0x8f, 0xeb, 0x2c, 0xd2, + 0x2f, 0xb3, 0x53, 0x40, 0xf4, 0x7a, 0xd9, 0xdf, 0x13, 0xa7, 0xe8, 0xfb, 0x70, 0xd6, 0xcb, 0x38, + 0x9c, 0xc4, 0x54, 0x0d, 0x7e, 0x98, 0x3d, 0x2e, 0x3e, 0xfb, 0x6c, 0x16, 0x14, 0x67, 0xb6, 0x41, + 0xaf, 0xfd, 0xa0, 0x4d, 0xd7, 0xbc, 0xe3, 0xb1, 0xfe, 0x0a, 0xe9, 0xfb, 0xb6, 0x28, 0xc3, 0x0a, + 0x4a, 0x8f, 0xb0, 0xb3, 0xaa, 0xf3, 0x37, 0xc9, 0x7e, 0x83, 0x78, 0xa4, 0x19, 0x07, 0xe1, 0x87, + 0xda, 0xfd, 0x0b, 0x7c, 0xf4, 0xf9, 0x09, 0x38, 0x26, 0x08, 0x14, 0x6f, 0x92, 0x7d, 0x3e, 0x15, + 0xfa, 0xd7, 0x15, 0x7b, 0x7e, 0xdd, 0xcf, 0x5a, 0x30, 0xa1, 0xbe, 0xee, 0x14, 0xb6, 0xfa, 0xa2, + 0xb9, 0xd5, 0x2f, 0xf4, 0x5c, 0xe0, 0x39, 0x9b, 0xfc, 0xeb, 0x05, 0x38, 0xaf, 0x70, 0x28, 0xbb, + 0xcf, 0xff, 0x88, 0x55, 0x75, 0x15, 0xca, 0xbe, 0xd2, 0x1e, 0x58, 0xa6, 0xd8, 0x9e, 0xe8, 0x0e, + 0x12, 0x1c, 0xca, 0xb5, 0xf9, 0x89, 0x88, 0x3f, 0xae, 0xab, 0xd5, 0x84, 0x0a, 0x6d, 0x11, 0x8a, + 0x1d, 0xb7, 0x25, 0xee, 0x8c, 0x4f, 0xc9, 0xd1, 0xbe, 0x53, 0xab, 0x1e, 0x1d, 0x54, 0x9e, 0xc8, + 0x53, 0xe9, 0xd2, 0xcb, 0x2a, 0x9a, 0xbf, 0x53, 0xab, 0x62, 0x5a, 0x19, 0x2d, 0xc0, 0x94, 0xd4, + 0x5a, 0xdf, 0xa5, 0x1c, 0x54, 0xe0, 0x8b, 0xab, 0x45, 0xe9, 0xc6, 0xb0, 0x09, 0xc6, 0x69, 0x7c, + 0x54, 0x85, 0xe9, 0x9d, 0xce, 0x06, 0xf1, 0x48, 0xcc, 0x3f, 0xf8, 0x26, 0xe1, 0x9a, 0xa3, 0x72, + 0x22, 0x5a, 0xde, 0x4c, 0xc1, 0x71, 0x57, 0x0d, 0xfb, 0xcf, 0xd8, 0x11, 0x2f, 0x46, 0xaf, 0x1e, + 0x06, 0x74, 0x61, 0x51, 0xea, 0x1f, 0xe6, 0x72, 0x1e, 0x64, 0x55, 0xdc, 0x24, 0xfb, 0xeb, 0x01, + 0x65, 0xb6, 0xb3, 0x57, 0x85, 0xb1, 0xe6, 0x4b, 0x3d, 0xd7, 0xfc, 0xcf, 0x17, 0xe0, 0x9c, 0x1a, + 0x01, 0x83, 0xaf, 0xfb, 0xf3, 0x3e, 0x06, 0xcf, 0xc3, 0x58, 0x8b, 0x6c, 0x3a, 0x1d, 0x2f, 0x56, + 0x6a, 0xcc, 0x21, 0xae, 0xca, 0xae, 0x26, 0xc5, 0x58, 0xc7, 0x39, 0xc6, 0xb0, 0xfd, 0xc4, 0x18, + 0xbb, 0x5b, 0x63, 0x87, 0xae, 0x71, 0xb5, 0x6b, 0xac, 0xdc, 0x5d, 0xf3, 0x24, 0x0c, 0xb9, 0xbb, + 0x94, 0xd7, 0x2a, 0x98, 0x2c, 0x54, 0x8d, 0x16, 0x62, 0x0e, 0x43, 0x9f, 0x80, 0x91, 0x66, 0xb0, + 0xbb, 0xeb, 0xf8, 0x2d, 0x76, 0xe5, 0x95, 0x17, 0xc7, 0x28, 0x3b, 0xb6, 0xc4, 0x8b, 0xb0, 0x84, + 0xa1, 0xc7, 0xa1, 0xe4, 0x84, 0x5b, 0xd1, 0x6c, 0x89, 0xe1, 0x8c, 0xd2, 0x96, 0x16, 0xc2, 0xad, + 0x08, 0xb3, 0x52, 0x2a, 0x55, 0xdd, 0x0b, 0xc2, 0x1d, 0xd7, 0xdf, 0xaa, 0xba, 0xa1, 0xd8, 0x12, + 0xea, 0x2e, 0x7c, 0x4b, 0x41, 0xb0, 0x86, 0x85, 0x56, 0x60, 0xa8, 0x1d, 0x84, 0x71, 0x34, 0x3b, + 0xcc, 0x86, 0xfb, 0x89, 0x9c, 0x83, 0x88, 0x7f, 0x6d, 0x3d, 0x08, 0xe3, 0xe4, 0x03, 0xe8, 0xbf, + 0x08, 0xf3, 0xea, 0xe8, 0xdb, 0xa0, 0x48, 0xfc, 0xbd, 0xd9, 0x11, 0x46, 0x65, 0x2e, 0x8b, 0xca, + 0xb2, 0xbf, 0x77, 0xd7, 0x09, 0x93, 0x53, 0x7a, 0xd9, 0xdf, 0xc3, 0xb4, 0x0e, 0xfa, 0x3c, 0x94, + 0xe5, 0x16, 0x8f, 0x84, 0x9a, 0x23, 0x73, 0x89, 0xc9, 0x83, 0x01, 0x93, 0xf7, 0x3a, 0x6e, 0x48, + 0x76, 0x89, 0x1f, 0x47, 0xc9, 0x99, 0x26, 0xa1, 0x11, 0x4e, 0xa8, 0xa1, 0xcf, 0x4b, 0xdd, 0xda, + 0x6a, 0xd0, 0xf1, 0xe3, 0x68, 0xb6, 0xcc, 0xba, 0x97, 0xf9, 0xea, 0x71, 0x37, 0xc1, 0x4b, 0x2b, + 0xdf, 0x78, 0x65, 0x6c, 0x90, 0x42, 0x18, 0x26, 0x3c, 0x77, 0x8f, 0xf8, 0x24, 0x8a, 0xea, 0x61, + 0xb0, 0x41, 0x66, 0x81, 0xf5, 0xfc, 0x7c, 0xf6, 0x63, 0x40, 0xb0, 0x41, 0x16, 0x67, 0x0e, 0x0f, + 0x2a, 0x13, 0xb7, 0xf4, 0x3a, 0xd8, 0x24, 0x81, 0xee, 0xc0, 0x24, 0x95, 0x6b, 0xdc, 0x84, 0xe8, + 0x58, 0x3f, 0xa2, 0x4c, 0xfa, 0xc0, 0x46, 0x25, 0x9c, 0x22, 0x82, 0xde, 0x80, 0xb2, 0xe7, 0x6e, + 0x92, 0xe6, 0x7e, 0xd3, 0x23, 0xb3, 0xe3, 0x8c, 0x62, 0xe6, 0xb6, 0xba, 0x25, 0x91, 0xb8, 0x5c, + 0xa4, 0xfe, 0xe2, 0xa4, 0x3a, 0xba, 0x0b, 0x8f, 0xc4, 0x24, 0xdc, 0x75, 0x7d, 0x87, 0x6e, 0x07, + 0x21, 0x2f, 0xb0, 0x27, 0x95, 0x09, 0xb6, 0xde, 0x2e, 0x8a, 0xa1, 0x7b, 0x64, 0x3d, 0x13, 0x0b, + 0xe7, 0xd4, 0x46, 0xb7, 0x61, 0x8a, 0xed, 0x84, 0x7a, 0xc7, 0xf3, 0xea, 0x81, 0xe7, 0x36, 0xf7, + 0x67, 0x27, 0x19, 0xc1, 0x4f, 0xc8, 0x7b, 0xa1, 0x66, 0x82, 0x8f, 0x0e, 0x2a, 0x90, 0xfc, 0xc3, + 0xe9, 0xda, 0x68, 0x83, 0xe9, 0xd0, 0x3b, 0xa1, 0x1b, 0xef, 0xd3, 0xf5, 0x4b, 0xee, 0xc7, 0xb3, + 0x53, 0x3d, 0x45, 0x61, 0x1d, 0x55, 0x29, 0xda, 0xf5, 0x42, 0x9c, 0x26, 0x48, 0xb7, 0x76, 0x14, + 0xb7, 0x5c, 0x7f, 0x76, 0x9a, 0x9d, 0x18, 0x6a, 0x67, 0x34, 0x68, 0x21, 0xe6, 0x30, 0xa6, 0x3f, + 0xa7, 0x3f, 0x6e, 0xd3, 0x13, 0x74, 0x86, 0x21, 0x26, 0xfa, 0x73, 0x09, 0xc0, 0x09, 0x0e, 0x65, + 0x6a, 0xe2, 0x78, 0x7f, 0x16, 0x31, 0x54, 0xb5, 0x5d, 0xd6, 0xd7, 0x3f, 0x8f, 0x69, 0x39, 0xba, + 0x05, 0x23, 0xc4, 0xdf, 0x5b, 0x09, 0x83, 0xdd, 0xd9, 0x33, 0xf9, 0x7b, 0x76, 0x99, 0xa3, 0xf0, + 0x03, 0x3d, 0x11, 0xf0, 0x44, 0x31, 0x96, 0x24, 0xd0, 0x7d, 0x98, 0xcd, 0x98, 0x11, 0x3e, 0x01, + 0x67, 0xd9, 0x04, 0xbc, 0x26, 0xea, 0xce, 0xae, 0xe7, 0xe0, 0x1d, 0xf5, 0x80, 0xe1, 0x5c, 0xea, + 0xe8, 0x0b, 0x30, 0xc1, 0x37, 0x14, 0x7f, 0x7c, 0x8b, 0x66, 0xcf, 0xb1, 0xaf, 0xb9, 0x94, 0xbf, + 0x39, 0x39, 0xe2, 0xe2, 0x39, 0xd1, 0xa1, 0x09, 0xbd, 0x34, 0xc2, 0x26, 0x35, 0x7b, 0x03, 0x26, + 0xd5, 0xb9, 0xc5, 0x96, 0x0e, 0xaa, 0xc0, 0x10, 0xe3, 0x76, 0x84, 0x7e, 0xab, 0x4c, 0x67, 0x8a, + 0x71, 0x42, 0x98, 0x97, 0xb3, 0x99, 0x72, 0xdf, 0x27, 0x8b, 0xfb, 0x31, 0xe1, 0x52, 0x75, 0x51, + 0x9b, 0x29, 0x09, 0xc0, 0x09, 0x8e, 0xfd, 0xff, 0x38, 0xd7, 0x98, 0x1c, 0x8e, 0x03, 0x5c, 0x07, + 0xcf, 0xc2, 0xe8, 0x76, 0x10, 0xc5, 0x14, 0x9b, 0xb5, 0x31, 0x94, 0xf0, 0x89, 0x37, 0x44, 0x39, + 0x56, 0x18, 0xe8, 0x55, 0x98, 0x68, 0xea, 0x0d, 0x88, 0xbb, 0x4c, 0x0d, 0x81, 0xd1, 0x3a, 0x36, + 0x71, 0xd1, 0x2b, 0x30, 0xca, 0x9e, 0xce, 0x9b, 0x81, 0x27, 0x98, 0x2c, 0x79, 0x21, 0x8f, 0xd6, + 0x45, 0xf9, 0x91, 0xf6, 0x1b, 0x2b, 0x6c, 0x74, 0x19, 0x86, 0x69, 0x17, 0x6a, 0x75, 0x71, 0x8b, + 0x28, 0x55, 0xcd, 0x0d, 0x56, 0x8a, 0x05, 0xd4, 0xfe, 0x5b, 0x05, 0x6d, 0x94, 0xa9, 0x44, 0x4a, + 0x50, 0x1d, 0x46, 0xee, 0x39, 0x6e, 0xec, 0xfa, 0x5b, 0x82, 0x5d, 0x78, 0xba, 0xe7, 0x95, 0xc2, + 0x2a, 0xbd, 0xc5, 0x2b, 0xf0, 0x4b, 0x4f, 0xfc, 0xc1, 0x92, 0x0c, 0xa5, 0x18, 0x76, 0x7c, 0x9f, + 0x52, 0x2c, 0x0c, 0x4a, 0x11, 0xf3, 0x0a, 0x9c, 0xa2, 0xf8, 0x83, 0x25, 0x19, 0xf4, 0x0e, 0x80, + 0x5c, 0x96, 0xa4, 0x25, 0x9e, 0xac, 0x9f, 0xed, 0x4f, 0x74, 0x5d, 0xd5, 0x59, 0x9c, 0xa4, 0x57, + 0x6a, 0xf2, 0x1f, 0x6b, 0xf4, 0xec, 0x98, 0xb1, 0x55, 0xdd, 0x9d, 0x41, 0xdf, 0x49, 0x4f, 0x02, + 0x27, 0x8c, 0x49, 0x6b, 0x21, 0x16, 0x83, 0xf3, 0xc9, 0xc1, 0x64, 0x8a, 0x75, 0x77, 0x97, 0xe8, + 0xa7, 0x86, 0x20, 0x82, 0x13, 0x7a, 0xf6, 0x2f, 0x16, 0x61, 0x36, 0xaf, 0xbb, 0x74, 0xd1, 0x91, + 0xfb, 0x6e, 0xbc, 0x44, 0xb9, 0x21, 0xcb, 0x5c, 0x74, 0xcb, 0xa2, 0x1c, 0x2b, 0x0c, 0x3a, 0xfb, + 0x91, 0xbb, 0x25, 0x45, 0xc2, 0xa1, 0x64, 0xf6, 0x1b, 0xac, 0x14, 0x0b, 0x28, 0xc5, 0x0b, 0x89, + 0x13, 0x09, 0x9b, 0x08, 0x6d, 0x95, 0x60, 0x56, 0x8a, 0x05, 0x54, 0xd7, 0x37, 0x95, 0xfa, 0xe8, + 0x9b, 0x8c, 0x21, 0x1a, 0x3a, 0xd9, 0x21, 0x42, 0x5f, 0x04, 0xd8, 0x74, 0x7d, 0x37, 0xda, 0x66, + 0xd4, 0x87, 0x8f, 0x4d, 0x5d, 0xf1, 0x52, 0x2b, 0x8a, 0x0a, 0xd6, 0x28, 0xa2, 0x97, 0x60, 0x4c, + 0x6d, 0xc0, 0x5a, 0x95, 0x3d, 0x10, 0x69, 0x0f, 0xee, 0xc9, 0x69, 0x54, 0xc5, 0x3a, 0x9e, 0xfd, + 0x6e, 0x7a, 0xbd, 0x88, 0x1d, 0xa0, 0x8d, 0xaf, 0x35, 0xe8, 0xf8, 0x16, 0x7a, 0x8f, 0xaf, 0xfd, + 0xeb, 0x45, 0x98, 0x32, 0x1a, 0xeb, 0x44, 0x03, 0x9c, 0x59, 0xd7, 0xe9, 0x3d, 0xe7, 0xc4, 0x44, + 0xec, 0x3f, 0xbb, 0xff, 0x56, 0xd1, 0xef, 0x42, 0xba, 0x03, 0x78, 0x7d, 0xf4, 0x45, 0x28, 0x7b, + 0x4e, 0xc4, 0x74, 0x57, 0x44, 0xec, 0xbb, 0x41, 0x88, 0x25, 0x72, 0x84, 0x13, 0xc5, 0xda, 0x55, + 0xc3, 0x69, 0x27, 0x24, 0xe9, 0x85, 0x4c, 0x79, 0x1f, 0x69, 0x74, 0xa3, 0x3a, 0x41, 0x19, 0xa4, + 0x7d, 0xcc, 0x61, 0xe8, 0x15, 0x18, 0x0f, 0x09, 0x5b, 0x15, 0x4b, 0x94, 0x95, 0x63, 0xcb, 0x6c, + 0x28, 0xe1, 0xf9, 0xb0, 0x06, 0xc3, 0x06, 0x66, 0xc2, 0xca, 0x0f, 0xf7, 0x60, 0xe5, 0x9f, 0x86, + 0x11, 0xf6, 0x43, 0xad, 0x00, 0x35, 0x1b, 0x35, 0x5e, 0x8c, 0x25, 0x3c, 0xbd, 0x60, 0x46, 0x07, + 0x5c, 0x30, 0x9f, 0x84, 0xc9, 0xaa, 0x43, 0x76, 0x03, 0x7f, 0xd9, 0x6f, 0xb5, 0x03, 0xd7, 0x8f, + 0xd1, 0x2c, 0x94, 0xd8, 0xed, 0xc0, 0xf7, 0x76, 0x89, 0x52, 0xc0, 0x25, 0xca, 0x98, 0xdb, 0x5b, + 0x70, 0xae, 0x1a, 0xdc, 0xf3, 0xef, 0x39, 0x61, 0x6b, 0xa1, 0x5e, 0xd3, 0xe4, 0xdc, 0x35, 0x29, + 0x67, 0x71, 0x23, 0x96, 0xcc, 0x33, 0x55, 0xab, 0xc9, 0xef, 0xda, 0x15, 0xd7, 0x23, 0x39, 0xda, + 0x88, 0xbf, 0x53, 0x30, 0x5a, 0x4a, 0xf0, 0xd5, 0x83, 0x91, 0x95, 0xfb, 0x60, 0xf4, 0x26, 0x8c, + 0x6e, 0xba, 0xc4, 0x6b, 0x61, 0xb2, 0x29, 0x96, 0xd8, 0x53, 0xf9, 0xef, 0xf2, 0x2b, 0x14, 0x53, + 0x6a, 0x9f, 0xb8, 0x94, 0xb6, 0x22, 0x2a, 0x63, 0x45, 0x06, 0xed, 0xc0, 0xb4, 0x14, 0x03, 0x24, + 0x54, 0x2c, 0xb8, 0xa7, 0x7b, 0xc9, 0x16, 0x26, 0xf1, 0xb3, 0x87, 0x07, 0x95, 0x69, 0x9c, 0x22, + 0x83, 0xbb, 0x08, 0x53, 0xb1, 0x6c, 0x97, 0x1e, 0xad, 0x25, 0x36, 0xfc, 0x4c, 0x2c, 0x63, 0x12, + 0x26, 0x2b, 0xb5, 0x7f, 0xd4, 0x82, 0x47, 0xbb, 0x46, 0x46, 0x48, 0xda, 0x27, 0x3c, 0x0b, 0x69, + 0xc9, 0xb7, 0xd0, 0x5f, 0xf2, 0xb5, 0xff, 0xb1, 0x05, 0x67, 0x97, 0x77, 0xdb, 0xf1, 0x7e, 0xd5, + 0x35, 0x5f, 0x77, 0x5e, 0x86, 0xe1, 0x5d, 0xd2, 0x72, 0x3b, 0xbb, 0x62, 0xe6, 0x2a, 0xf2, 0xf8, + 0x59, 0x65, 0xa5, 0x47, 0x07, 0x95, 0x89, 0x46, 0x1c, 0x84, 0xce, 0x16, 0xe1, 0x05, 0x58, 0xa0, + 0xb3, 0x43, 0xdc, 0x7d, 0x9f, 0xdc, 0x72, 0x77, 0x5d, 0x69, 0x67, 0xd1, 0x53, 0x77, 0x36, 0x2f, + 0x07, 0x74, 0xfe, 0xcd, 0x8e, 0xe3, 0xc7, 0x6e, 0xbc, 0x2f, 0x1e, 0x66, 0x24, 0x11, 0x9c, 0xd0, + 0xb3, 0xbf, 0x69, 0xc1, 0x94, 0x5c, 0xf7, 0x0b, 0xad, 0x56, 0x48, 0xa2, 0x08, 0xcd, 0x41, 0xc1, + 0x6d, 0x8b, 0x5e, 0x82, 0xe8, 0x65, 0xa1, 0x56, 0xc7, 0x05, 0xb7, 0x8d, 0xea, 0x50, 0xe6, 0xe6, + 0x1a, 0xc9, 0xe2, 0x1a, 0xc8, 0xe8, 0x83, 0xf5, 0x60, 0x5d, 0xd6, 0xc4, 0x09, 0x11, 0xc9, 0xc1, + 0xb1, 0x33, 0xb3, 0x68, 0xbe, 0x7a, 0xdd, 0x10, 0xe5, 0x58, 0x61, 0xa0, 0x2b, 0x30, 0xea, 0x07, + 0x2d, 0x6e, 0x3d, 0xc3, 0x6f, 0x3f, 0xb6, 0x64, 0xd7, 0x44, 0x19, 0x56, 0x50, 0xfb, 0x07, 0x2d, + 0x18, 0x97, 0x5f, 0x36, 0x20, 0x33, 0x49, 0xb7, 0x56, 0xc2, 0x48, 0x26, 0x5b, 0x8b, 0x32, 0x83, + 0x0c, 0x62, 0xf0, 0x80, 0xc5, 0xe3, 0xf0, 0x80, 0xf6, 0x8f, 0x14, 0x60, 0x52, 0x76, 0xa7, 0xd1, + 0xd9, 0x88, 0x48, 0x8c, 0xd6, 0xa1, 0xec, 0xf0, 0x21, 0x27, 0x72, 0xc5, 0x3e, 0x99, 0x2d, 0x7c, + 0x18, 0xf3, 0x93, 0x5c, 0xcb, 0x0b, 0xb2, 0x36, 0x4e, 0x08, 0x21, 0x0f, 0x66, 0xfc, 0x20, 0x66, + 0x47, 0xb4, 0x82, 0xf7, 0x7a, 0x02, 0x49, 0x53, 0x3f, 0x2f, 0xa8, 0xcf, 0xac, 0xa5, 0xa9, 0xe0, + 0x6e, 0xc2, 0x68, 0x59, 0x2a, 0x3c, 0x8a, 0xf9, 0xe2, 0x86, 0x3e, 0x0b, 0xd9, 0xfa, 0x0e, 0xfb, + 0x57, 0x2c, 0x28, 0x4b, 0xb4, 0xd3, 0x78, 0xed, 0x5a, 0x85, 0x91, 0x88, 0x4d, 0x82, 0x1c, 0x1a, + 0xbb, 0x57, 0xc7, 0xf9, 0x7c, 0x25, 0x37, 0x0f, 0xff, 0x1f, 0x61, 0x49, 0x83, 0xe9, 0xbb, 0x55, + 0xf7, 0x3f, 0x22, 0xfa, 0x6e, 0xd5, 0x9f, 0x9c, 0x1b, 0xe6, 0xbf, 0xb3, 0x3e, 0x6b, 0x62, 0x2d, + 0x65, 0x90, 0xda, 0x21, 0xd9, 0x74, 0xef, 0xa7, 0x19, 0xa4, 0x3a, 0x2b, 0xc5, 0x02, 0x8a, 0xde, + 0x81, 0xf1, 0xa6, 0x54, 0x74, 0x26, 0xc7, 0xc0, 0xe5, 0x9e, 0x4a, 0x77, 0xf5, 0x3e, 0xc3, 0x2d, + 0x6b, 0x97, 0xb4, 0xfa, 0xd8, 0xa0, 0x66, 0x3e, 0xb7, 0x17, 0xfb, 0x3d, 0xb7, 0x27, 0x74, 0xf3, + 0x1f, 0x9f, 0x7f, 0xcc, 0x82, 0x61, 0xae, 0x2e, 0x1b, 0x4c, 0xbf, 0xa8, 0x3d, 0x57, 0x25, 0x63, + 0x77, 0x97, 0x16, 0x8a, 0xe7, 0x27, 0xb4, 0x0a, 0x65, 0xf6, 0x83, 0xa9, 0x0d, 0x8a, 0xf9, 0x26, + 0xc5, 0xbc, 0x55, 0xbd, 0x83, 0x77, 0x65, 0x35, 0x9c, 0x50, 0xb0, 0xbf, 0x56, 0xa4, 0x47, 0x55, + 0x82, 0x6a, 0xdc, 0xe0, 0xd6, 0xc3, 0xbb, 0xc1, 0x0b, 0x0f, 0xeb, 0x06, 0xdf, 0x82, 0xa9, 0xa6, + 0xf6, 0xb8, 0x95, 0xcc, 0xe4, 0x95, 0x9e, 0x8b, 0x44, 0x7b, 0x07, 0xe3, 0x2a, 0xa3, 0x25, 0x93, + 0x08, 0x4e, 0x53, 0x45, 0xdf, 0x09, 0xe3, 0x7c, 0x9e, 0x45, 0x2b, 0xdc, 0x62, 0xe1, 0x13, 0xf9, + 0xeb, 0x45, 0x6f, 0x82, 0xad, 0xc4, 0x86, 0x56, 0x1d, 0x1b, 0xc4, 0xec, 0x5f, 0x1c, 0x85, 0xa1, + 0xe5, 0x3d, 0xe2, 0xc7, 0xa7, 0x70, 0x20, 0x35, 0x61, 0xd2, 0xf5, 0xf7, 0x02, 0x6f, 0x8f, 0xb4, + 0x38, 0xfc, 0x38, 0x97, 0xeb, 0x23, 0x82, 0xf4, 0x64, 0xcd, 0x20, 0x81, 0x53, 0x24, 0x1f, 0x86, + 0x84, 0x79, 0x1d, 0x86, 0xf9, 0xdc, 0x0b, 0xf1, 0x32, 0x53, 0x19, 0xcc, 0x06, 0x51, 0xec, 0x82, + 0x44, 0xfa, 0xe5, 0xda, 0x67, 0x51, 0x1d, 0xbd, 0x0b, 0x93, 0x9b, 0x6e, 0x18, 0xc5, 0x54, 0x34, + 0x8c, 0x62, 0x67, 0xb7, 0xfd, 0x00, 0x12, 0xa5, 0x1a, 0x87, 0x15, 0x83, 0x12, 0x4e, 0x51, 0x46, + 0x5b, 0x30, 0x41, 0x85, 0x9c, 0xa4, 0xa9, 0x91, 0x63, 0x37, 0xa5, 0x54, 0x46, 0xb7, 0x74, 0x42, + 0xd8, 0xa4, 0x4b, 0x0f, 0x93, 0x26, 0x13, 0x8a, 0x46, 0x19, 0x47, 0xa1, 0x0e, 0x13, 0x2e, 0x0d, + 0x71, 0x18, 0x3d, 0x93, 0x98, 0xd9, 0x4a, 0xd9, 0x3c, 0x93, 0x34, 0xe3, 0x94, 0x2f, 0x41, 0x99, + 0xd0, 0x21, 0xa4, 0x84, 0x85, 0x62, 0xfc, 0xea, 0x60, 0x7d, 0x5d, 0x75, 0x9b, 0x61, 0x60, 0xca, + 0xf2, 0xcb, 0x92, 0x12, 0x4e, 0x88, 0xa2, 0x25, 0x18, 0x8e, 0x48, 0xe8, 0x92, 0x48, 0xa8, 0xc8, + 0x7b, 0x4c, 0x23, 0x43, 0xe3, 0xb6, 0xe7, 0xfc, 0x37, 0x16, 0x55, 0xe9, 0xf2, 0x72, 0x98, 0x34, + 0xc4, 0xb4, 0xe2, 0xda, 0xf2, 0x5a, 0x60, 0xa5, 0x58, 0x40, 0xd1, 0x1b, 0x30, 0x12, 0x12, 0x8f, + 0x29, 0x8b, 0x26, 0x06, 0x5f, 0xe4, 0x5c, 0xf7, 0xc4, 0xeb, 0x61, 0x49, 0x00, 0xdd, 0x04, 0x14, + 0x12, 0xca, 0x43, 0xb8, 0xfe, 0x96, 0x32, 0xe6, 0x10, 0xba, 0xee, 0xc7, 0x44, 0xfb, 0x67, 0x70, + 0x82, 0x21, 0xad, 0x52, 0x71, 0x46, 0x35, 0x74, 0x1d, 0x66, 0x54, 0x69, 0xcd, 0x8f, 0x62, 0xc7, + 0x6f, 0x12, 0xa6, 0xe6, 0x2e, 0x27, 0x5c, 0x11, 0x4e, 0x23, 0xe0, 0xee, 0x3a, 0xf6, 0x4f, 0x53, + 0x76, 0x86, 0x8e, 0xd6, 0x29, 0xf0, 0x02, 0xaf, 0x9b, 0xbc, 0xc0, 0xf9, 0xdc, 0x99, 0xcb, 0xe1, + 0x03, 0x0e, 0x2d, 0x18, 0xd3, 0x66, 0x36, 0x59, 0xb3, 0x56, 0x8f, 0x35, 0xdb, 0x81, 0x69, 0xba, + 0xd2, 0x6f, 0x6f, 0x44, 0x24, 0xdc, 0x23, 0x2d, 0xb6, 0x30, 0x0b, 0x0f, 0xb6, 0x30, 0xd5, 0x2b, + 0xf3, 0xad, 0x14, 0x41, 0xdc, 0xd5, 0x04, 0x7a, 0x59, 0x6a, 0x4e, 0x8a, 0x86, 0x91, 0x16, 0xd7, + 0x8a, 0x1c, 0x1d, 0x54, 0xa6, 0xb5, 0x0f, 0xd1, 0x35, 0x25, 0xf6, 0x97, 0xe4, 0x37, 0xaa, 0xd7, + 0xfc, 0xa6, 0x5a, 0x2c, 0xa9, 0xd7, 0x7c, 0xb5, 0x1c, 0x70, 0x82, 0x43, 0xf7, 0x28, 0x15, 0x41, + 0xd2, 0xaf, 0xf9, 0x54, 0x40, 0xc1, 0x0c, 0x62, 0xbf, 0x00, 0xb0, 0x7c, 0x9f, 0x34, 0xf9, 0x52, + 0xd7, 0x1f, 0x20, 0xad, 0xfc, 0x07, 0x48, 0xfb, 0x3f, 0x5a, 0x30, 0xb9, 0xb2, 0x64, 0x88, 0x89, + 0xf3, 0x00, 0x5c, 0x36, 0x7a, 0xeb, 0xad, 0x35, 0xa9, 0x5b, 0xe7, 0xea, 0x51, 0x55, 0x8a, 0x35, + 0x0c, 0x74, 0x1e, 0x8a, 0x5e, 0xc7, 0x17, 0x22, 0xcb, 0xc8, 0xe1, 0x41, 0xa5, 0x78, 0xab, 0xe3, + 0x63, 0x5a, 0xa6, 0x59, 0x08, 0x16, 0x07, 0xb6, 0x10, 0xec, 0xeb, 0x5e, 0x85, 0x2a, 0x30, 0x74, + 0xef, 0x9e, 0xdb, 0xe2, 0x46, 0xec, 0x42, 0xef, 0xff, 0xd6, 0x5b, 0xb5, 0x6a, 0x84, 0x79, 0xb9, + 0xfd, 0xd5, 0x22, 0xcc, 0xad, 0x78, 0xe4, 0xfe, 0x07, 0x34, 0xe4, 0x1f, 0xd4, 0xbe, 0xf1, 0x78, + 0xfc, 0xe2, 0x71, 0x6d, 0x58, 0xfb, 0x8f, 0xc7, 0x26, 0x8c, 0xf0, 0xc7, 0x6c, 0x69, 0xd6, 0xff, + 0x6a, 0x56, 0xeb, 0xf9, 0x03, 0x32, 0xcf, 0x1f, 0xc5, 0x85, 0x39, 0xbf, 0xba, 0x69, 0x45, 0x29, + 0x96, 0xc4, 0xe7, 0x3e, 0x03, 0xe3, 0x3a, 0xe6, 0xb1, 0xac, 0xc9, 0xff, 0x4a, 0x11, 0xa6, 0x69, + 0x0f, 0x1e, 0xea, 0x44, 0xdc, 0xe9, 0x9e, 0x88, 0x93, 0xb6, 0x28, 0xee, 0x3f, 0x1b, 0xef, 0xa4, + 0x67, 0xe3, 0xf9, 0xbc, 0xd9, 0x38, 0xed, 0x39, 0xf8, 0x5e, 0x0b, 0xce, 0xac, 0x78, 0x41, 0x73, + 0x27, 0x65, 0xf5, 0xfb, 0x12, 0x8c, 0xd1, 0x73, 0x3c, 0x32, 0xbc, 0x88, 0x0c, 0xbf, 0x32, 0x01, + 0xc2, 0x3a, 0x9e, 0x56, 0xed, 0xce, 0x9d, 0x5a, 0x35, 0xcb, 0x1d, 0x4d, 0x80, 0xb0, 0x8e, 0x67, + 0x7f, 0xc3, 0x82, 0x0b, 0xd7, 0x97, 0x96, 0x93, 0xa5, 0xd8, 0xe5, 0x11, 0x47, 0xa5, 0xc0, 0x96, + 0xd6, 0x95, 0x44, 0x0a, 0xac, 0xb2, 0x5e, 0x08, 0xe8, 0x47, 0xc5, 0xdb, 0xf3, 0xa7, 0x2c, 0x38, + 0x73, 0xdd, 0x8d, 0xe9, 0xb5, 0x9c, 0xf6, 0xcd, 0xa2, 0xf7, 0x72, 0xe4, 0xc6, 0x41, 0xb8, 0x9f, + 0xf6, 0xcd, 0xc2, 0x0a, 0x82, 0x35, 0x2c, 0xde, 0xf2, 0x9e, 0xcb, 0xcc, 0xa8, 0x0a, 0xa6, 0x2a, + 0x0a, 0x8b, 0x72, 0xac, 0x30, 0xe8, 0x87, 0xb5, 0xdc, 0x90, 0x89, 0x12, 0xfb, 0xe2, 0x84, 0x55, + 0x1f, 0x56, 0x95, 0x00, 0x9c, 0xe0, 0xd8, 0x7f, 0x68, 0x41, 0xe5, 0xba, 0xd7, 0x89, 0x62, 0x12, + 0x6e, 0x46, 0x39, 0xa7, 0xe3, 0x0b, 0x50, 0x26, 0x52, 0x70, 0x17, 0xbd, 0x56, 0xac, 0xa6, 0x92, + 0xe8, 0xb9, 0x8b, 0x98, 0xc2, 0x1b, 0xc0, 0x87, 0xe0, 0x78, 0x46, 0xe0, 0x2b, 0x80, 0x88, 0xde, + 0x96, 0xee, 0x33, 0xc7, 0x9c, 0x6f, 0x96, 0xbb, 0xa0, 0x38, 0xa3, 0x86, 0xfd, 0xa3, 0x16, 0x9c, + 0x53, 0x1f, 0xfc, 0x91, 0xfb, 0x4c, 0xfb, 0xe7, 0x0a, 0x30, 0x71, 0x63, 0x7d, 0xbd, 0x7e, 0x9d, + 0xc4, 0xe2, 0xda, 0xee, 0xaf, 0x5b, 0xc7, 0x9a, 0x8a, 0xb0, 0x97, 0x14, 0xd8, 0x89, 0x5d, 0x6f, + 0x9e, 0xbb, 0x5e, 0xcf, 0xd7, 0xfc, 0xf8, 0x76, 0xd8, 0x88, 0x43, 0xd7, 0xdf, 0xca, 0x54, 0x2a, + 0x4a, 0xe6, 0xa2, 0x98, 0xc7, 0x5c, 0xa0, 0x17, 0x60, 0x98, 0xf9, 0x7e, 0xcb, 0x49, 0x78, 0x4c, + 0x09, 0x51, 0xac, 0xf4, 0xe8, 0xa0, 0x52, 0xbe, 0x83, 0x6b, 0xfc, 0x0f, 0x16, 0xa8, 0xe8, 0x0e, + 0x8c, 0x6d, 0xc7, 0x71, 0xfb, 0x06, 0x71, 0x5a, 0x24, 0x94, 0xc7, 0xe1, 0xc5, 0xac, 0xe3, 0x90, + 0x0e, 0x02, 0x47, 0x4b, 0x4e, 0x90, 0xa4, 0x2c, 0xc2, 0x3a, 0x1d, 0xbb, 0x01, 0x90, 0xc0, 0x4e, + 0x48, 0xa1, 0x62, 0xff, 0xbe, 0x05, 0x23, 0xdc, 0x0d, 0x2f, 0x44, 0xaf, 0x41, 0x89, 0xdc, 0x27, + 0x4d, 0xc1, 0x2a, 0x67, 0x76, 0x38, 0xe1, 0xb4, 0xf8, 0xf3, 0x00, 0xfd, 0x8f, 0x59, 0x2d, 0x74, + 0x03, 0x46, 0x68, 0x6f, 0xaf, 0x2b, 0x9f, 0xc4, 0x27, 0xf2, 0xbe, 0x58, 0x4d, 0x3b, 0x67, 0xce, + 0x44, 0x11, 0x96, 0xd5, 0x99, 0xaa, 0xbb, 0xd9, 0x6e, 0xd0, 0x13, 0x3b, 0xee, 0xc5, 0x58, 0xac, + 0x2f, 0xd5, 0x39, 0x92, 0xa0, 0xc6, 0x55, 0xdd, 0xb2, 0x10, 0x27, 0x44, 0xec, 0x75, 0x28, 0xd3, + 0x49, 0x5d, 0xf0, 0x5c, 0xa7, 0xb7, 0x96, 0xfd, 0x19, 0x28, 0x4b, 0x8d, 0x77, 0x24, 0x3c, 0xb9, + 0x18, 0x55, 0xa9, 0x10, 0x8f, 0x70, 0x02, 0xb7, 0x37, 0xe1, 0x2c, 0x33, 0x75, 0x70, 0xe2, 0x6d, + 0x63, 0x8f, 0xf5, 0x5f, 0xcc, 0xcf, 0x0a, 0xc9, 0x93, 0xcf, 0xcc, 0xac, 0xe6, 0x2c, 0x31, 0x2e, + 0x29, 0x26, 0x52, 0xa8, 0xfd, 0x07, 0x25, 0x78, 0xac, 0xd6, 0xc8, 0xf7, 0xd0, 0x7c, 0x05, 0xc6, + 0x39, 0x5f, 0x4a, 0x97, 0xb6, 0xe3, 0x89, 0x76, 0xd5, 0x43, 0xe0, 0xba, 0x06, 0xc3, 0x06, 0x26, + 0xba, 0x00, 0x45, 0xf7, 0x3d, 0x3f, 0x6d, 0x77, 0x5c, 0x7b, 0x73, 0x0d, 0xd3, 0x72, 0x0a, 0xa6, + 0x2c, 0x2e, 0xbf, 0x3b, 0x14, 0x58, 0xb1, 0xb9, 0xaf, 0xc3, 0xa4, 0x1b, 0x35, 0x23, 0xb7, 0xe6, + 0xd3, 0x73, 0x46, 0x3b, 0xa9, 0x94, 0x56, 0x84, 0x76, 0x5a, 0x41, 0x71, 0x0a, 0x5b, 0xbb, 0xc8, + 0x86, 0x06, 0x66, 0x93, 0xfb, 0xba, 0x36, 0x51, 0x09, 0xa0, 0xcd, 0xbe, 0x2e, 0x62, 0x56, 0x7c, + 0x42, 0x02, 0xe0, 0x1f, 0x1c, 0x61, 0x09, 0xa3, 0x22, 0x67, 0x73, 0xdb, 0x69, 0x2f, 0x74, 0xe2, + 0xed, 0xaa, 0x1b, 0x35, 0x83, 0x3d, 0x12, 0xee, 0x33, 0x6d, 0xc1, 0x68, 0x22, 0x72, 0x2a, 0xc0, + 0xd2, 0x8d, 0x85, 0x3a, 0xc5, 0xc4, 0xdd, 0x75, 0x4c, 0x36, 0x18, 0x4e, 0x82, 0x0d, 0x5e, 0x80, + 0x29, 0xd9, 0x4c, 0x83, 0x44, 0xec, 0x52, 0x1c, 0x63, 0x1d, 0x53, 0xb6, 0xc5, 0xa2, 0x58, 0x75, + 0x2b, 0x8d, 0x8f, 0x5e, 0x86, 0x09, 0xd7, 0x77, 0x63, 0xd7, 0x89, 0x83, 0x90, 0xb1, 0x14, 0x5c, + 0x31, 0xc0, 0x4c, 0xf7, 0x6a, 0x3a, 0x00, 0x9b, 0x78, 0xf6, 0x7f, 0x2d, 0xc1, 0x0c, 0x9b, 0xb6, + 0x6f, 0xad, 0xb0, 0x8f, 0xcc, 0x0a, 0xbb, 0xd3, 0xbd, 0xc2, 0x4e, 0x82, 0xbf, 0xff, 0x30, 0x97, + 0xd9, 0xbb, 0x50, 0x56, 0xc6, 0xcf, 0xd2, 0xfb, 0xc1, 0xca, 0xf1, 0x7e, 0xe8, 0xcf, 0x7d, 0xc8, + 0x77, 0xeb, 0x62, 0xe6, 0xbb, 0xf5, 0xdf, 0xb3, 0x20, 0xb1, 0x01, 0x45, 0x37, 0xa0, 0xdc, 0x0e, + 0x98, 0x9d, 0x45, 0x28, 0x8d, 0x97, 0x1e, 0xcb, 0xbc, 0xa8, 0xf8, 0xa5, 0xc8, 0xc7, 0xaf, 0x2e, + 0x6b, 0xe0, 0xa4, 0x32, 0x5a, 0x84, 0x91, 0x76, 0x48, 0x1a, 0x31, 0xf3, 0xf9, 0xed, 0x4b, 0x87, + 0xaf, 0x11, 0x8e, 0x8f, 0x65, 0x45, 0xfb, 0xe7, 0x2d, 0x00, 0xfe, 0x34, 0xec, 0xf8, 0x5b, 0xe4, + 0x14, 0xd4, 0xdd, 0x55, 0x28, 0x45, 0x6d, 0xd2, 0xec, 0x65, 0x01, 0x93, 0xf4, 0xa7, 0xd1, 0x26, + 0xcd, 0x64, 0xc0, 0xe9, 0x3f, 0xcc, 0x6a, 0xdb, 0xdf, 0x07, 0x30, 0x99, 0xa0, 0xd5, 0x62, 0xb2, + 0x8b, 0x9e, 0x33, 0x7c, 0x00, 0xcf, 0xa7, 0x7c, 0x00, 0xcb, 0x0c, 0x5b, 0xd3, 0xac, 0xbe, 0x0b, + 0xc5, 0x5d, 0xe7, 0xbe, 0x50, 0x9d, 0x3d, 0xd3, 0xbb, 0x1b, 0x94, 0xfe, 0xfc, 0xaa, 0x73, 0x9f, + 0x0b, 0x89, 0xcf, 0xc8, 0x05, 0xb2, 0xea, 0xdc, 0x3f, 0xe2, 0x76, 0x2e, 0xec, 0x90, 0xba, 0xe5, + 0x46, 0xf1, 0x97, 0xff, 0x4b, 0xf2, 0x9f, 0x2d, 0x3b, 0xda, 0x08, 0x6b, 0xcb, 0xf5, 0xc5, 0x43, + 0xe9, 0x40, 0x6d, 0xb9, 0x7e, 0xba, 0x2d, 0xd7, 0x1f, 0xa0, 0x2d, 0xd7, 0x47, 0xef, 0xc3, 0x88, + 0x30, 0x4a, 0x60, 0xc6, 0xed, 0xa6, 0x5a, 0x2e, 0xaf, 0x3d, 0x61, 0xd3, 0xc0, 0xdb, 0xbc, 0x2a, + 0x85, 0x60, 0x51, 0xda, 0xb7, 0x5d, 0xd9, 0x20, 0xfa, 0xdb, 0x16, 0x4c, 0x8a, 0xdf, 0x98, 0xbc, + 0xd7, 0x21, 0x51, 0x2c, 0x78, 0xcf, 0x4f, 0x0f, 0xde, 0x07, 0x51, 0x91, 0x77, 0xe5, 0xd3, 0xf2, + 0x98, 0x35, 0x81, 0x7d, 0x7b, 0x94, 0xea, 0x05, 0xfa, 0xa7, 0x16, 0x9c, 0xdd, 0x75, 0xee, 0xf3, + 0x16, 0x79, 0x19, 0x76, 0x62, 0x37, 0x10, 0xc6, 0xfa, 0xaf, 0x0d, 0x36, 0xfd, 0x5d, 0xd5, 0x79, + 0x27, 0xa5, 0x5d, 0xef, 0xd9, 0x2c, 0x94, 0xbe, 0x5d, 0xcd, 0xec, 0xd7, 0xdc, 0x26, 0x8c, 0xca, + 0xf5, 0x96, 0xa1, 0x6a, 0xa8, 0xea, 0x8c, 0xf5, 0xb1, 0x6d, 0x42, 0x74, 0x47, 0x3c, 0xda, 0x8e, + 0x58, 0x6b, 0x0f, 0xb5, 0x9d, 0x77, 0x61, 0x5c, 0x5f, 0x63, 0x0f, 0xb5, 0xad, 0xf7, 0xe0, 0x4c, + 0xc6, 0x5a, 0x7a, 0xa8, 0x4d, 0xde, 0x83, 0xf3, 0xb9, 0xeb, 0xe3, 0x61, 0x36, 0x6c, 0xff, 0x9c, + 0xa5, 0x9f, 0x83, 0xa7, 0xf0, 0xe6, 0xb0, 0x64, 0xbe, 0x39, 0x5c, 0xec, 0xbd, 0x73, 0x72, 0x1e, + 0x1e, 0xde, 0xd1, 0x3b, 0x4d, 0x4f, 0x75, 0xf4, 0x06, 0x0c, 0x7b, 0xb4, 0x44, 0x5a, 0xc3, 0xd8, + 0xfd, 0x77, 0x64, 0xc2, 0x4b, 0xb1, 0xf2, 0x08, 0x0b, 0x0a, 0xf6, 0x2f, 0x59, 0x50, 0x3a, 0x85, + 0x91, 0xc0, 0xe6, 0x48, 0x3c, 0x97, 0x4b, 0x5a, 0xc4, 0x70, 0x9b, 0xc7, 0xce, 0xbd, 0xe5, 0xfb, + 0x31, 0xf1, 0x23, 0x26, 0x2a, 0x66, 0x0e, 0xcc, 0x77, 0xc1, 0x99, 0x5b, 0x81, 0xd3, 0x5a, 0x74, + 0x3c, 0xc7, 0x6f, 0x92, 0xb0, 0xe6, 0x6f, 0xf5, 0x35, 0xcb, 0xd2, 0x8d, 0xa8, 0x0a, 0xfd, 0x8c, + 0xa8, 0xec, 0x6d, 0x40, 0x7a, 0x03, 0xc2, 0x70, 0x15, 0xc3, 0x88, 0xcb, 0x9b, 0x12, 0xc3, 0xff, + 0x54, 0x36, 0x77, 0xd7, 0xd5, 0x33, 0xcd, 0x24, 0x93, 0x17, 0x60, 0x49, 0xc8, 0x7e, 0x05, 0x32, + 0x9d, 0xd5, 0xfa, 0xab, 0x0d, 0xec, 0xcf, 0xc3, 0x0c, 0xab, 0x79, 0x4c, 0x91, 0xd6, 0x4e, 0x69, + 0x25, 0x33, 0x62, 0x64, 0xd9, 0x5f, 0xb1, 0x60, 0x6a, 0x2d, 0x15, 0xb0, 0xe3, 0x32, 0x7b, 0x00, + 0xcd, 0x50, 0x86, 0x37, 0x58, 0x29, 0x16, 0xd0, 0x13, 0xd7, 0x41, 0xfd, 0x99, 0x05, 0x89, 0xff, + 0xe8, 0x29, 0x30, 0x5e, 0x4b, 0x06, 0xe3, 0x95, 0xa9, 0x1b, 0x51, 0xdd, 0xc9, 0xe3, 0xbb, 0xd0, + 0x4d, 0x15, 0x2c, 0xa1, 0x87, 0x5a, 0x24, 0x21, 0xc3, 0x5d, 0xeb, 0x27, 0xcd, 0x88, 0x0a, 0x32, + 0x7c, 0x02, 0xb3, 0x9d, 0x52, 0xb8, 0x1f, 0x11, 0xdb, 0x29, 0xd5, 0x9f, 0x9c, 0x1d, 0x5a, 0xd7, + 0xba, 0xcc, 0x4e, 0xae, 0x6f, 0x67, 0xb6, 0xf0, 0x8e, 0xe7, 0xbe, 0x4f, 0x54, 0xc4, 0x97, 0x8a, + 0xb0, 0x6d, 0x17, 0xa5, 0x47, 0x07, 0x95, 0x09, 0xf5, 0x8f, 0x87, 0x05, 0x4b, 0xaa, 0xd8, 0x37, + 0x60, 0x2a, 0x35, 0x60, 0xe8, 0x25, 0x18, 0x6a, 0x6f, 0x3b, 0x11, 0x49, 0xd9, 0x8b, 0x0e, 0xd5, + 0x69, 0xe1, 0xd1, 0x41, 0x65, 0x52, 0x55, 0x60, 0x25, 0x98, 0x63, 0xdb, 0xff, 0xd3, 0x82, 0xd2, + 0x5a, 0xd0, 0x3a, 0x8d, 0xc5, 0xf4, 0xba, 0xb1, 0x98, 0x1e, 0xcf, 0x0b, 0xaa, 0x98, 0xbb, 0x8e, + 0x56, 0x52, 0xeb, 0xe8, 0x62, 0x2e, 0x85, 0xde, 0x4b, 0x68, 0x17, 0xc6, 0x58, 0xa8, 0x46, 0x61, + 0xbf, 0xfa, 0x82, 0x21, 0x03, 0x54, 0x52, 0x32, 0xc0, 0x94, 0x86, 0xaa, 0x49, 0x02, 0x4f, 0xc3, + 0x88, 0xb0, 0xa1, 0x4c, 0x5b, 0xfd, 0x0b, 0x5c, 0x2c, 0xe1, 0xf6, 0x8f, 0x15, 0xc1, 0x08, 0x0d, + 0x89, 0x7e, 0xc5, 0x82, 0xf9, 0x90, 0xbb, 0x51, 0xb6, 0xaa, 0x9d, 0xd0, 0xf5, 0xb7, 0x1a, 0xcd, + 0x6d, 0xd2, 0xea, 0x78, 0xae, 0xbf, 0x55, 0xdb, 0xf2, 0x03, 0x55, 0xbc, 0x7c, 0x9f, 0x34, 0x3b, + 0xec, 0x21, 0xa4, 0x4f, 0x1c, 0x4a, 0x65, 0xa3, 0x74, 0xed, 0xf0, 0xa0, 0x32, 0x8f, 0x8f, 0x45, + 0x1b, 0x1f, 0xb3, 0x2f, 0xe8, 0x1b, 0x16, 0x5c, 0xe5, 0x11, 0x13, 0x07, 0xef, 0x7f, 0x0f, 0x89, + 0xa9, 0x2e, 0x49, 0x25, 0x44, 0xd6, 0x49, 0xb8, 0xbb, 0xf8, 0xb2, 0x18, 0xd0, 0xab, 0xf5, 0xe3, + 0xb5, 0x85, 0x8f, 0xdb, 0x39, 0xfb, 0xdf, 0x14, 0x61, 0x42, 0x78, 0xf0, 0x8b, 0xd0, 0x30, 0x2f, + 0x19, 0x4b, 0xe2, 0x89, 0xd4, 0x92, 0x98, 0x31, 0x90, 0x4f, 0x26, 0x2a, 0x4c, 0x04, 0x33, 0x9e, + 0x13, 0xc5, 0x37, 0x88, 0x13, 0xc6, 0x1b, 0xc4, 0xe1, 0xb6, 0x3b, 0xc5, 0x63, 0xdb, 0x19, 0x29, + 0x15, 0xcd, 0xad, 0x34, 0x31, 0xdc, 0x4d, 0x1f, 0xed, 0x01, 0x62, 0x06, 0x48, 0xa1, 0xe3, 0x47, + 0xfc, 0x5b, 0x5c, 0xf1, 0x66, 0x70, 0xbc, 0x56, 0xe7, 0x44, 0xab, 0xe8, 0x56, 0x17, 0x35, 0x9c, + 0xd1, 0x82, 0x66, 0x58, 0x36, 0x34, 0xa8, 0x61, 0xd9, 0x70, 0x1f, 0xd7, 0x1a, 0x1f, 0xa6, 0xbb, + 0x82, 0x30, 0xbc, 0x0d, 0x65, 0x65, 0x00, 0x28, 0x0e, 0x9d, 0xde, 0xb1, 0x4c, 0xd2, 0x14, 0xb8, + 0x1a, 0x25, 0x31, 0x3e, 0x4d, 0xc8, 0xd9, 0xff, 0xac, 0x60, 0x34, 0xc8, 0x27, 0x71, 0x0d, 0x46, + 0x9d, 0x28, 0x72, 0xb7, 0x7c, 0xd2, 0x12, 0x3b, 0xf6, 0xe3, 0x79, 0x3b, 0xd6, 0x68, 0x86, 0x19, + 0x61, 0x2e, 0x88, 0x9a, 0x58, 0xd1, 0x40, 0x37, 0xb8, 0x85, 0xd4, 0x9e, 0xe4, 0xf9, 0x07, 0xa3, + 0x06, 0xd2, 0x86, 0x6a, 0x8f, 0x60, 0x51, 0x1f, 0x7d, 0x81, 0x9b, 0xb0, 0xdd, 0xf4, 0x83, 0x7b, + 0xfe, 0xf5, 0x20, 0x90, 0x6e, 0x77, 0x83, 0x11, 0x9c, 0x91, 0x86, 0x6b, 0xaa, 0x3a, 0x36, 0xa9, + 0x0d, 0x16, 0xa8, 0xe8, 0xbb, 0xe1, 0x0c, 0x25, 0x6d, 0x3a, 0xcf, 0x44, 0x88, 0xc0, 0x94, 0x08, + 0x0f, 0x21, 0xcb, 0xc4, 0xd8, 0x65, 0xb2, 0xf3, 0x66, 0xed, 0x44, 0xe9, 0x77, 0xd3, 0x24, 0x81, + 0xd3, 0x34, 0xed, 0x9f, 0xb4, 0x80, 0x99, 0xfd, 0x9f, 0x02, 0xcb, 0xf0, 0x59, 0x93, 0x65, 0x98, + 0xcd, 0x1b, 0xe4, 0x1c, 0x6e, 0xe1, 0x45, 0xbe, 0xb2, 0xea, 0x61, 0x70, 0x7f, 0x5f, 0x98, 0x0f, + 0xf4, 0xe7, 0x64, 0xed, 0xff, 0x6b, 0xf1, 0x43, 0x4c, 0x79, 0xe2, 0xa3, 0xef, 0x81, 0xd1, 0xa6, + 0xd3, 0x76, 0x9a, 0x3c, 0x8e, 0x71, 0xae, 0x56, 0xc7, 0xa8, 0x34, 0xbf, 0x24, 0x6a, 0x70, 0x2d, + 0x85, 0x0c, 0x33, 0x32, 0x2a, 0x8b, 0xfb, 0x6a, 0x26, 0x54, 0x93, 0x73, 0x3b, 0x30, 0x61, 0x10, + 0x7b, 0xa8, 0x22, 0xed, 0xf7, 0xf0, 0x2b, 0x56, 0x85, 0xc5, 0xd9, 0x85, 0x19, 0x5f, 0xfb, 0x4f, + 0x2f, 0x14, 0x29, 0xa6, 0x7c, 0xbc, 0xdf, 0x25, 0xca, 0x6e, 0x1f, 0xcd, 0xad, 0x21, 0x45, 0x06, + 0x77, 0x53, 0xb6, 0x7f, 0xdc, 0x82, 0x47, 0x75, 0x44, 0x2d, 0x48, 0x42, 0x3f, 0x3d, 0x71, 0x15, + 0x46, 0x83, 0x36, 0x09, 0x9d, 0x38, 0x08, 0xc5, 0xad, 0x71, 0x45, 0x0e, 0xfa, 0x6d, 0x51, 0x7e, + 0x24, 0x02, 0x4a, 0x4a, 0xea, 0xb2, 0x1c, 0xab, 0x9a, 0x54, 0x8e, 0x61, 0x83, 0x11, 0x89, 0x00, + 0x16, 0xec, 0x0c, 0x60, 0x4f, 0xa6, 0x11, 0x16, 0x10, 0xfb, 0x0f, 0x2c, 0xbe, 0xb0, 0xf4, 0xae, + 0xa3, 0xf7, 0x60, 0x7a, 0xd7, 0x89, 0x9b, 0xdb, 0xcb, 0xf7, 0xdb, 0x21, 0x57, 0x8f, 0xcb, 0x71, + 0x7a, 0xa6, 0xdf, 0x38, 0x69, 0x1f, 0x99, 0x58, 0xe5, 0xad, 0xa6, 0x88, 0xe1, 0x2e, 0xf2, 0x68, + 0x03, 0xc6, 0x58, 0x19, 0x33, 0xff, 0x8e, 0x7a, 0xb1, 0x06, 0x79, 0xad, 0xa9, 0x57, 0xe7, 0xd5, + 0x84, 0x0e, 0xd6, 0x89, 0xda, 0x5f, 0x2e, 0xf2, 0xdd, 0xce, 0xb8, 0xed, 0xa7, 0x61, 0xa4, 0x1d, + 0xb4, 0x96, 0x6a, 0x55, 0x2c, 0x66, 0x41, 0x5d, 0x23, 0x75, 0x5e, 0x8c, 0x25, 0x1c, 0xbd, 0x0a, + 0x40, 0xee, 0xc7, 0x24, 0xf4, 0x1d, 0x4f, 0x59, 0xc9, 0x28, 0xbb, 0xd0, 0x6a, 0xb0, 0x16, 0xc4, + 0x77, 0x22, 0xf2, 0x5d, 0xcb, 0x0a, 0x05, 0x6b, 0xe8, 0xe8, 0x1a, 0x40, 0x3b, 0x0c, 0xf6, 0xdc, + 0x16, 0xf3, 0x27, 0x2c, 0x9a, 0x36, 0x24, 0x75, 0x05, 0xc1, 0x1a, 0x16, 0x7a, 0x15, 0x26, 0x3a, + 0x7e, 0xc4, 0x39, 0x14, 0x67, 0x43, 0x84, 0x63, 0x1c, 0x4d, 0xac, 0x1b, 0xee, 0xe8, 0x40, 0x6c, + 0xe2, 0xa2, 0x05, 0x18, 0x8e, 0x1d, 0x66, 0x13, 0x31, 0x94, 0x6f, 0xcc, 0xb9, 0x4e, 0x31, 0xf4, + 0x28, 0xba, 0xb4, 0x02, 0x16, 0x15, 0xd1, 0xdb, 0xd2, 0x39, 0x83, 0x9f, 0xf5, 0xc2, 0x8a, 0x7a, + 0xb0, 0x7b, 0x41, 0x73, 0xcd, 0x10, 0xd6, 0xd9, 0x06, 0x2d, 0xfb, 0x1b, 0x65, 0x80, 0x84, 0x1d, + 0x47, 0xef, 0x77, 0x9d, 0x47, 0xcf, 0xf6, 0x66, 0xe0, 0x4f, 0xee, 0x30, 0x42, 0xdf, 0x6f, 0xc1, + 0x98, 0xe3, 0x79, 0x41, 0xd3, 0x89, 0xd9, 0x28, 0x17, 0x7a, 0x9f, 0x87, 0xa2, 0xfd, 0x85, 0xa4, + 0x06, 0xef, 0xc2, 0x0b, 0x72, 0xe1, 0x69, 0x90, 0xbe, 0xbd, 0xd0, 0x1b, 0x46, 0x9f, 0x92, 0x52, + 0x1a, 0x5f, 0x1e, 0x73, 0x69, 0x29, 0xad, 0xcc, 0x8e, 0x7e, 0x4d, 0x40, 0x43, 0x77, 0x8c, 0x48, + 0x7b, 0xa5, 0xfc, 0xa0, 0x13, 0x06, 0x57, 0xda, 0x2f, 0xc8, 0x1e, 0xaa, 0xeb, 0xde, 0x64, 0x43, + 0xf9, 0x91, 0x59, 0x34, 0xf1, 0xa7, 0x8f, 0x27, 0xd9, 0xbb, 0x30, 0xd5, 0x32, 0xef, 0x76, 0xb1, + 0x9a, 0x9e, 0xca, 0xa3, 0x9b, 0x62, 0x05, 0x92, 0xdb, 0x3c, 0x05, 0xc0, 0x69, 0xc2, 0xa8, 0xce, + 0xfd, 0xfa, 0x6a, 0xfe, 0x66, 0x20, 0xac, 0xf1, 0xed, 0xdc, 0xb9, 0xdc, 0x8f, 0x62, 0xb2, 0x4b, + 0x31, 0x93, 0x4b, 0x7b, 0x4d, 0xd4, 0xc5, 0x8a, 0x0a, 0x7a, 0x03, 0x86, 0x99, 0x63, 0x70, 0x34, + 0x3b, 0x9a, 0xaf, 0x4c, 0x34, 0x63, 0x5a, 0x24, 0x9b, 0x8a, 0xfd, 0x8d, 0xb0, 0xa0, 0x80, 0x6e, + 0xc8, 0xc0, 0x37, 0x51, 0xcd, 0xbf, 0x13, 0x11, 0x16, 0xf8, 0xa6, 0xbc, 0xf8, 0xf1, 0x24, 0xa6, + 0x0d, 0x2f, 0xcf, 0x8c, 0x97, 0x6f, 0xd4, 0xa4, 0xcc, 0x91, 0xf8, 0x2f, 0xc3, 0xf0, 0xcf, 0x42, + 0x7e, 0xf7, 0xcc, 0x50, 0xfd, 0xc9, 0x70, 0xde, 0x35, 0x49, 0xe0, 0x34, 0x4d, 0xca, 0x68, 0xf2, + 0x9d, 0x2b, 0xec, 0xf9, 0xfb, 0xed, 0x7f, 0x2e, 0x5f, 0xb3, 0x4b, 0x86, 0x97, 0x60, 0x51, 0xff, + 0x54, 0x6f, 0xfd, 0x39, 0x1f, 0xa6, 0xd3, 0x5b, 0xf4, 0xa1, 0x72, 0x19, 0xbf, 0x5f, 0x82, 0x49, + 0x73, 0x49, 0xa1, 0xab, 0x50, 0x16, 0x44, 0x54, 0x14, 0x56, 0xb5, 0x4b, 0x56, 0x25, 0x00, 0x27, + 0x38, 0x2c, 0xf8, 0x2e, 0xab, 0xae, 0xd9, 0x61, 0x26, 0xc1, 0x77, 0x15, 0x04, 0x6b, 0x58, 0x54, + 0x5e, 0xda, 0x08, 0x82, 0x58, 0x5d, 0x2a, 0x6a, 0xdd, 0x2d, 0xb2, 0x52, 0x2c, 0xa0, 0xf4, 0x32, + 0xd9, 0x21, 0xa1, 0x4f, 0x3c, 0x33, 0xb8, 0x9b, 0xba, 0x4c, 0x6e, 0xea, 0x40, 0x6c, 0xe2, 0xd2, + 0x5b, 0x32, 0x88, 0xd8, 0x42, 0x16, 0x52, 0x59, 0x62, 0xd7, 0xda, 0xe0, 0x2e, 0xf6, 0x12, 0x8e, + 0x3e, 0x0f, 0x8f, 0x2a, 0x8f, 0x78, 0xcc, 0x15, 0xd5, 0xb2, 0xc5, 0x61, 0x43, 0x89, 0xf2, 0xe8, + 0x52, 0x36, 0x1a, 0xce, 0xab, 0x8f, 0x5e, 0x87, 0x49, 0xc1, 0xb9, 0x4b, 0x8a, 0x23, 0xa6, 0xed, + 0xc4, 0x4d, 0x03, 0x8a, 0x53, 0xd8, 0x32, 0x3c, 0x1d, 0x63, 0x9e, 0x25, 0x85, 0xd1, 0xee, 0xf0, + 0x74, 0x3a, 0x1c, 0x77, 0xd5, 0x40, 0x0b, 0x30, 0xc5, 0x59, 0x2b, 0xd7, 0xdf, 0xe2, 0x73, 0x22, + 0xdc, 0x6d, 0xd4, 0x96, 0xba, 0x6d, 0x82, 0x71, 0x1a, 0x1f, 0xbd, 0x02, 0xe3, 0x4e, 0xd8, 0xdc, + 0x76, 0x63, 0xd2, 0x8c, 0x3b, 0x21, 0xf7, 0xc3, 0xd1, 0x8c, 0x4f, 0x16, 0x34, 0x18, 0x36, 0x30, + 0xed, 0xf7, 0xe1, 0x4c, 0x86, 0xa7, 0x1e, 0x5d, 0x38, 0x4e, 0xdb, 0x95, 0xdf, 0x94, 0xb2, 0x50, + 0x5d, 0xa8, 0xd7, 0xe4, 0xd7, 0x68, 0x58, 0x74, 0x75, 0x32, 0x8f, 0x3e, 0x2d, 0xeb, 0x86, 0x5a, + 0x9d, 0x2b, 0x12, 0x80, 0x13, 0x1c, 0xfb, 0x7f, 0x15, 0x60, 0x2a, 0x43, 0xf9, 0xce, 0x32, 0x3f, + 0xa4, 0x64, 0x8f, 0x24, 0xd1, 0x83, 0x19, 0xed, 0xb0, 0x70, 0x8c, 0x68, 0x87, 0xc5, 0x7e, 0xd1, + 0x0e, 0x4b, 0x1f, 0x24, 0xda, 0xa1, 0x39, 0x62, 0x43, 0x03, 0x8d, 0x58, 0x46, 0x84, 0xc4, 0xe1, + 0x63, 0x46, 0x48, 0x34, 0x06, 0x7d, 0x64, 0x80, 0x41, 0xff, 0x5a, 0x01, 0xa6, 0xd3, 0x46, 0x72, + 0xa7, 0xa0, 0x8e, 0x7d, 0xc3, 0x50, 0xc7, 0x66, 0xe7, 0x51, 0x49, 0x9b, 0xee, 0xe5, 0xa9, 0x66, + 0x71, 0x4a, 0x35, 0xfb, 0xc9, 0x81, 0xa8, 0xf5, 0x56, 0xd3, 0xfe, 0x83, 0x02, 0x9c, 0x4b, 0x57, + 0x59, 0xf2, 0x1c, 0x77, 0xf7, 0x14, 0xc6, 0xe6, 0xb6, 0x31, 0x36, 0xcf, 0x0d, 0xf2, 0x35, 0xac, + 0x6b, 0xb9, 0x03, 0xf4, 0x56, 0x6a, 0x80, 0xae, 0x0e, 0x4e, 0xb2, 0xf7, 0x28, 0x7d, 0xb3, 0x08, + 0x17, 0x33, 0xeb, 0x25, 0xda, 0xcc, 0x15, 0x43, 0x9b, 0x79, 0x2d, 0xa5, 0xcd, 0xb4, 0x7b, 0xd7, + 0x3e, 0x19, 0xf5, 0xa6, 0x70, 0xa1, 0x64, 0x11, 0xf1, 0x1e, 0x50, 0xb5, 0x69, 0xb8, 0x50, 0x2a, + 0x42, 0xd8, 0xa4, 0xfb, 0x17, 0x49, 0xa5, 0xf9, 0xef, 0x2c, 0x38, 0x9f, 0x39, 0x37, 0xa7, 0xa0, + 0xc2, 0x5a, 0x33, 0x55, 0x58, 0x4f, 0x0f, 0xbc, 0x5a, 0x73, 0x74, 0x5a, 0xbf, 0x51, 0xca, 0xf9, + 0x16, 0x26, 0xa0, 0xdf, 0x86, 0x31, 0xa7, 0xd9, 0x24, 0x51, 0xb4, 0x1a, 0xb4, 0x54, 0x84, 0xb8, + 0xe7, 0x98, 0x9c, 0x95, 0x14, 0x1f, 0x1d, 0x54, 0xe6, 0xd2, 0x24, 0x12, 0x30, 0xd6, 0x29, 0x98, + 0x41, 0x2d, 0x0b, 0x27, 0x1a, 0xd4, 0xf2, 0x1a, 0xc0, 0x9e, 0xe2, 0xd6, 0xd3, 0x42, 0xbe, 0xc6, + 0xc7, 0x6b, 0x58, 0xe8, 0x0b, 0x30, 0x1a, 0x89, 0x6b, 0x5c, 0x2c, 0xc5, 0x17, 0x06, 0x9c, 0x2b, + 0x67, 0x83, 0x78, 0xa6, 0xaf, 0xbe, 0xd2, 0x87, 0x28, 0x92, 0xe8, 0x3b, 0x60, 0x3a, 0xe2, 0xa1, + 0x60, 0x96, 0x3c, 0x27, 0x62, 0x7e, 0x10, 0x62, 0x15, 0x32, 0x07, 0xfc, 0x46, 0x0a, 0x86, 0xbb, + 0xb0, 0xd1, 0x8a, 0xfc, 0x28, 0x16, 0xb7, 0x86, 0x2f, 0xcc, 0xcb, 0xc9, 0x07, 0x89, 0xbc, 0x53, + 0x67, 0xd3, 0xc3, 0xcf, 0x06, 0x5e, 0xab, 0x89, 0xbe, 0x00, 0x40, 0x97, 0x8f, 0xd0, 0x25, 0x8c, + 0xe4, 0x1f, 0x9e, 0xf4, 0x54, 0x69, 0x65, 0x5a, 0x7e, 0x32, 0xe7, 0xc5, 0xaa, 0x22, 0x82, 0x35, + 0x82, 0xf6, 0xd7, 0x4a, 0xf0, 0x58, 0x8f, 0x33, 0x12, 0x2d, 0x98, 0x4f, 0xa0, 0xcf, 0xa4, 0x85, + 0xeb, 0xb9, 0xcc, 0xca, 0x86, 0xb4, 0x9d, 0x5a, 0x8a, 0x85, 0x0f, 0xbc, 0x14, 0x7f, 0xc0, 0xd2, + 0xd4, 0x1e, 0xdc, 0x98, 0xef, 0xb3, 0xc7, 0x3c, 0xfb, 0x4f, 0x50, 0x0f, 0xb2, 0x99, 0xa1, 0x4c, + 0xb8, 0x36, 0x70, 0x77, 0x06, 0xd6, 0x2e, 0x9c, 0xae, 0xf2, 0xf7, 0xcb, 0x16, 0x3c, 0x91, 0xd9, + 0x5f, 0xc3, 0x64, 0xe3, 0x2a, 0x94, 0x9b, 0xb4, 0x50, 0xf3, 0x55, 0x4b, 0x9c, 0x78, 0x25, 0x00, + 0x27, 0x38, 0x86, 0x65, 0x46, 0xa1, 0xaf, 0x65, 0xc6, 0xbf, 0xb6, 0xa0, 0x6b, 0x7f, 0x9c, 0xc2, + 0x41, 0x5d, 0x33, 0x0f, 0xea, 0x8f, 0x0f, 0x32, 0x97, 0x39, 0x67, 0xf4, 0x1f, 0x4d, 0xc1, 0x23, + 0x39, 0xbe, 0x1a, 0x7b, 0x30, 0xb3, 0xd5, 0x24, 0xa6, 0x17, 0xa0, 0xf8, 0x98, 0x4c, 0x87, 0xc9, + 0x9e, 0x2e, 0x83, 0x2c, 0x1f, 0xd1, 0x4c, 0x17, 0x0a, 0xee, 0x6e, 0x02, 0x7d, 0xd9, 0x82, 0xb3, + 0xce, 0xbd, 0xa8, 0x2b, 0xeb, 0xa4, 0x58, 0x33, 0x2f, 0x66, 0x2a, 0x41, 0xfa, 0x64, 0xa9, 0xe4, + 0x09, 0x9a, 0xb2, 0xb0, 0x70, 0x66, 0x5b, 0x08, 0x8b, 0x98, 0xa1, 0x94, 0x9d, 0xef, 0xe1, 0xa7, + 0x9a, 0xe5, 0x54, 0xc3, 0x8f, 0x6c, 0x09, 0xc1, 0x8a, 0x0e, 0xfa, 0x12, 0x94, 0xb7, 0xa4, 0xa7, + 0x5b, 0xc6, 0x95, 0x90, 0x0c, 0x64, 0x6f, 0xff, 0x3f, 0xfe, 0x40, 0xa9, 0x90, 0x70, 0x42, 0x14, + 0xbd, 0x0e, 0x45, 0x7f, 0x33, 0xea, 0x95, 0xe3, 0x28, 0x65, 0xd3, 0xc4, 0xbd, 0xc1, 0xd7, 0x56, + 0x1a, 0x98, 0x56, 0x44, 0x37, 0xa0, 0x18, 0x6e, 0xb4, 0x84, 0x06, 0x2f, 0xf3, 0x0c, 0xc7, 0x8b, + 0xd5, 0x9c, 0x5e, 0x31, 0x4a, 0x78, 0xb1, 0x8a, 0x29, 0x09, 0x54, 0x87, 0x21, 0xe6, 0xe0, 0x20, + 0xee, 0x83, 0x4c, 0xce, 0xb7, 0x87, 0xa3, 0x10, 0x77, 0x19, 0x67, 0x08, 0x98, 0x13, 0x42, 0xeb, + 0x30, 0xdc, 0x64, 0xf9, 0x70, 0x44, 0xc0, 0xea, 0x4f, 0x65, 0xea, 0xea, 0x7a, 0x24, 0x0a, 0x12, + 0xaa, 0x2b, 0x86, 0x81, 0x05, 0x2d, 0x46, 0x95, 0xb4, 0xb7, 0x37, 0x23, 0x26, 0xeb, 0xe7, 0x51, + 0xed, 0x91, 0xff, 0x4a, 0x50, 0x65, 0x18, 0x58, 0xd0, 0x42, 0x9f, 0x81, 0xc2, 0x66, 0x53, 0xf8, + 0x3f, 0x64, 0x2a, 0xed, 0x4c, 0x87, 0xfe, 0xc5, 0xe1, 0xc3, 0x83, 0x4a, 0x61, 0x65, 0x09, 0x17, + 0x36, 0x9b, 0x68, 0x0d, 0x46, 0x36, 0xb9, 0x0b, 0xb0, 0xd0, 0xcb, 0x3d, 0x95, 0xed, 0x9d, 0xdc, + 0xe5, 0x25, 0xcc, 0xed, 0xf6, 0x05, 0x00, 0x4b, 0x22, 0x2c, 0x04, 0xa7, 0x72, 0x65, 0x16, 0xb1, + 0xa8, 0xe7, 0x8f, 0xe7, 0x7e, 0xce, 0xef, 0xe7, 0xc4, 0x21, 0x1a, 0x6b, 0x14, 0xe9, 0xaa, 0x76, + 0x64, 0xe6, 0x43, 0x11, 0xab, 0x23, 0x73, 0x55, 0xf7, 0x49, 0x0a, 0xc9, 0x57, 0xb5, 0x42, 0xc2, + 0x09, 0x51, 0xb4, 0x03, 0x13, 0x7b, 0x51, 0x7b, 0x9b, 0xc8, 0x2d, 0xcd, 0x42, 0x77, 0xe4, 0x5c, + 0x61, 0x77, 0x05, 0xa2, 0x1b, 0xc6, 0x1d, 0xc7, 0xeb, 0x3a, 0x85, 0xd8, 0xab, 0xf6, 0x5d, 0x9d, + 0x18, 0x36, 0x69, 0xd3, 0xe1, 0x7f, 0xaf, 0x13, 0x6c, 0xec, 0xc7, 0x44, 0x04, 0xaf, 0xce, 0x1c, + 0xfe, 0x37, 0x39, 0x4a, 0xf7, 0xf0, 0x0b, 0x00, 0x96, 0x44, 0xd0, 0x5d, 0x31, 0x3c, 0xec, 0xf4, + 0x9c, 0xce, 0x0f, 0xa6, 0x94, 0x99, 0x7a, 0x54, 0x1b, 0x14, 0x76, 0x5a, 0x26, 0xa4, 0xd8, 0x29, + 0xd9, 0xde, 0x0e, 0xe2, 0xc0, 0x4f, 0x9d, 0xd0, 0x33, 0xf9, 0xa7, 0x64, 0x3d, 0x03, 0xbf, 0xfb, + 0x94, 0xcc, 0xc2, 0xc2, 0x99, 0x6d, 0xa1, 0x16, 0x4c, 0xb6, 0x83, 0x30, 0xbe, 0x17, 0x84, 0x72, + 0x7d, 0xa1, 0x1e, 0x7a, 0x05, 0x03, 0x53, 0xb4, 0xc8, 0x82, 0xa9, 0x9b, 0x10, 0x9c, 0xa2, 0x89, + 0x3e, 0x07, 0x23, 0x51, 0xd3, 0xf1, 0x48, 0xed, 0xf6, 0xec, 0x99, 0xfc, 0xeb, 0xa7, 0xc1, 0x51, + 0x72, 0x56, 0x17, 0x9b, 0x1c, 0x81, 0x82, 0x25, 0x39, 0xb4, 0x02, 0x43, 0x2c, 0x23, 0x02, 0x8b, + 0xbb, 0x9d, 0x13, 0x13, 0xaa, 0xcb, 0xc2, 0x94, 0x9f, 0x4d, 0xac, 0x18, 0xf3, 0xea, 0x74, 0x0f, + 0x08, 0xf6, 0x3a, 0x88, 0x66, 0xcf, 0xe5, 0xef, 0x01, 0xc1, 0x95, 0xdf, 0x6e, 0xf4, 0xda, 0x03, + 0x0a, 0x09, 0x27, 0x44, 0xe9, 0xc9, 0x4c, 0x4f, 0xd3, 0x47, 0x7a, 0x18, 0xb4, 0xe4, 0x9e, 0xa5, + 0xec, 0x64, 0xa6, 0x27, 0x29, 0x25, 0x61, 0xff, 0xee, 0x48, 0x37, 0xcf, 0xc2, 0x04, 0xb2, 0xbf, + 0x6a, 0x75, 0xbd, 0xd5, 0x7d, 0x7a, 0x50, 0xfd, 0xd0, 0x09, 0x72, 0xab, 0x5f, 0xb6, 0xe0, 0x91, + 0x76, 0xe6, 0x87, 0x08, 0x06, 0x60, 0x30, 0x35, 0x13, 0xff, 0x74, 0x15, 0x1b, 0x3f, 0x1b, 0x8e, + 0x73, 0x5a, 0x4a, 0x4b, 0x04, 0xc5, 0x0f, 0x2c, 0x11, 0xac, 0xc2, 0x28, 0x63, 0x32, 0xfb, 0xe4, + 0x87, 0x4b, 0x0b, 0x46, 0x8c, 0x95, 0x58, 0x12, 0x15, 0xb1, 0x22, 0x81, 0x7e, 0xd0, 0x82, 0x0b, + 0xe9, 0xae, 0x63, 0xc2, 0xc0, 0x22, 0x92, 0x3c, 0x97, 0x05, 0x57, 0xc4, 0xf7, 0x5f, 0xa8, 0xf7, + 0x42, 0x3e, 0xea, 0x87, 0x80, 0x7b, 0x37, 0x86, 0xaa, 0x19, 0xc2, 0xe8, 0xb0, 0xa9, 0x80, 0x1f, + 0x40, 0x20, 0x7d, 0x11, 0xc6, 0x77, 0x83, 0x8e, 0x1f, 0x0b, 0xfb, 0x17, 0xe1, 0xb1, 0xc8, 0x1e, + 0x9c, 0x57, 0xb5, 0x72, 0x6c, 0x60, 0xa5, 0xc4, 0xd8, 0xd1, 0x07, 0x16, 0x63, 0xdf, 0x49, 0x65, + 0x01, 0x2f, 0xe7, 0x47, 0x2c, 0x14, 0x12, 0xff, 0x31, 0x72, 0x81, 0x9f, 0xae, 0x6c, 0xf4, 0xd3, + 0x56, 0x06, 0x53, 0xcf, 0xa5, 0xe5, 0xd7, 0x4c, 0x69, 0xf9, 0x72, 0x5a, 0x5a, 0xee, 0x52, 0xbe, + 0x1a, 0x82, 0xf2, 0xe0, 0x61, 0xaf, 0x07, 0x8d, 0x23, 0x67, 0x7b, 0x70, 0xa9, 0xdf, 0xb5, 0xc4, + 0x0c, 0xa1, 0x5a, 0xea, 0xa9, 0x2d, 0x31, 0x84, 0x6a, 0xd5, 0xaa, 0x98, 0x41, 0x06, 0x0d, 0x34, + 0x62, 0xff, 0x0f, 0x0b, 0x8a, 0xf5, 0xa0, 0x75, 0x0a, 0xca, 0xe4, 0xcf, 0x1a, 0xca, 0xe4, 0xc7, + 0x72, 0xb2, 0xb3, 0xe7, 0xaa, 0x8e, 0x97, 0x53, 0xaa, 0xe3, 0x0b, 0x79, 0x04, 0x7a, 0x2b, 0x8a, + 0x7f, 0xa2, 0x08, 0x7a, 0x2e, 0x79, 0xf4, 0x1b, 0x0f, 0x62, 0x85, 0x5c, 0xec, 0x95, 0x5e, 0x5e, + 0x50, 0x66, 0xf6, 0x53, 0xd2, 0x09, 0xef, 0xcf, 0x99, 0x31, 0xf2, 0x5b, 0xc4, 0xdd, 0xda, 0x8e, + 0x49, 0x2b, 0xfd, 0x39, 0xa7, 0x67, 0x8c, 0xfc, 0xdf, 0x2c, 0x98, 0x4a, 0xb5, 0x8e, 0x3c, 0x98, + 0xf0, 0x74, 0x4d, 0xa0, 0x58, 0xa7, 0x0f, 0xa4, 0x44, 0x14, 0xc6, 0x9c, 0x5a, 0x11, 0x36, 0x89, + 0xa3, 0x79, 0x00, 0xf5, 0x52, 0x27, 0x35, 0x60, 0x8c, 0xeb, 0x57, 0x4f, 0x79, 0x11, 0xd6, 0x30, + 0xd0, 0x4b, 0x30, 0x16, 0x07, 0xed, 0xc0, 0x0b, 0xb6, 0xf6, 0x6f, 0x12, 0x19, 0xda, 0x46, 0x99, + 0x68, 0xad, 0x27, 0x20, 0xac, 0xe3, 0xd9, 0x3f, 0x55, 0xe4, 0x1f, 0xea, 0xc7, 0xee, 0xb7, 0xd6, + 0xe4, 0x47, 0x7b, 0x4d, 0x7e, 0xd3, 0x82, 0x69, 0xda, 0x3a, 0x33, 0x17, 0x91, 0x97, 0xad, 0x4a, + 0xbf, 0x63, 0xf5, 0x48, 0xbf, 0x73, 0x99, 0x9e, 0x5d, 0xad, 0xa0, 0x13, 0x0b, 0x0d, 0x9a, 0x76, + 0x38, 0xd1, 0x52, 0x2c, 0xa0, 0x02, 0x8f, 0x84, 0xa1, 0xf0, 0x81, 0xd2, 0xf1, 0x48, 0x18, 0x62, + 0x01, 0x95, 0xd9, 0x79, 0x4a, 0x39, 0xd9, 0x79, 0x58, 0xa0, 0x3e, 0x61, 0x58, 0x20, 0xd8, 0x1e, + 0x2d, 0x50, 0x9f, 0xb4, 0x38, 0x48, 0x70, 0xec, 0x9f, 0x2b, 0xc2, 0x78, 0x3d, 0x68, 0x25, 0x6f, + 0x65, 0x2f, 0x1a, 0x6f, 0x65, 0x97, 0x52, 0x6f, 0x65, 0xd3, 0x3a, 0xee, 0xb7, 0x5e, 0xc6, 0x3e, + 0xac, 0x97, 0xb1, 0x7f, 0x65, 0xb1, 0x59, 0xab, 0xae, 0x35, 0x44, 0x76, 0xe0, 0xe7, 0x61, 0x8c, + 0x1d, 0x48, 0xcc, 0xe9, 0x4e, 0x3e, 0x20, 0xb1, 0xc0, 0xfb, 0x6b, 0x49, 0x31, 0xd6, 0x71, 0xd0, + 0x15, 0x18, 0x8d, 0x88, 0x13, 0x36, 0xb7, 0xd5, 0x19, 0x27, 0x9e, 0x57, 0x78, 0x19, 0x56, 0x50, + 0xf4, 0x66, 0x12, 0x23, 0xae, 0x98, 0x9f, 0xe7, 0x56, 0xef, 0x0f, 0xdf, 0x22, 0xf9, 0x81, 0xe1, + 0xec, 0xb7, 0x00, 0x75, 0xe3, 0x0f, 0x10, 0x1c, 0xa9, 0x62, 0x06, 0x47, 0x2a, 0x77, 0x05, 0x46, + 0xfa, 0x53, 0x0b, 0x26, 0xeb, 0x41, 0x8b, 0x6e, 0xdd, 0xbf, 0x48, 0xfb, 0x54, 0x0f, 0x90, 0x39, + 0xdc, 0x23, 0x40, 0xe6, 0x3f, 0xb4, 0x60, 0xa4, 0x1e, 0xb4, 0x4e, 0x41, 0xef, 0xfe, 0x9a, 0xa9, + 0x77, 0x7f, 0x34, 0x67, 0x49, 0xe4, 0xa8, 0xda, 0x7f, 0xa1, 0x08, 0x13, 0xb4, 0x9f, 0xc1, 0x96, + 0x9c, 0x25, 0x63, 0x44, 0xac, 0x01, 0x46, 0x84, 0xb2, 0xb9, 0x81, 0xe7, 0x05, 0xf7, 0xd2, 0x33, + 0xb6, 0xc2, 0x4a, 0xb1, 0x80, 0xa2, 0x67, 0x61, 0xb4, 0x1d, 0x92, 0x3d, 0x37, 0x10, 0xfc, 0xa3, + 0xf6, 0x8a, 0x51, 0x17, 0xe5, 0x58, 0x61, 0x50, 0xb9, 0x2b, 0x72, 0xfd, 0x26, 0x91, 0x49, 0xb6, + 0x4b, 0x2c, 0x0f, 0x17, 0x8f, 0x7c, 0xad, 0x95, 0x63, 0x03, 0x0b, 0xbd, 0x05, 0x65, 0xf6, 0x9f, + 0x9d, 0x28, 0xc7, 0xcf, 0x1b, 0x24, 0xd2, 0x4d, 0x08, 0x02, 0x38, 0xa1, 0x85, 0xae, 0x01, 0xc4, + 0x32, 0x3a, 0x72, 0x24, 0x62, 0xdc, 0x28, 0x5e, 0x5b, 0xc5, 0x4d, 0x8e, 0xb0, 0x86, 0x85, 0x9e, + 0x81, 0x72, 0xec, 0xb8, 0xde, 0x2d, 0xd7, 0x27, 0x11, 0x53, 0x39, 0x17, 0x65, 0x36, 0x09, 0x51, + 0x88, 0x13, 0x38, 0xe5, 0x75, 0x98, 0x03, 0x38, 0xcf, 0x3a, 0x36, 0xca, 0xb0, 0x19, 0xaf, 0x73, + 0x4b, 0x95, 0x62, 0x0d, 0xc3, 0x7e, 0x05, 0xce, 0xd5, 0x83, 0x56, 0x3d, 0x08, 0xe3, 0x95, 0x20, + 0xbc, 0xe7, 0x84, 0x2d, 0x39, 0x7f, 0x15, 0x99, 0xd8, 0x80, 0x9e, 0x3d, 0x43, 0x7c, 0x67, 0x1a, + 0x29, 0x0b, 0x5e, 0x60, 0xdc, 0xce, 0x31, 0x9d, 0x3a, 0x9a, 0xec, 0xde, 0x55, 0x09, 0x06, 0xaf, + 0x3b, 0x31, 0x41, 0xb7, 0x59, 0x52, 0xb2, 0xe4, 0x0a, 0x12, 0xd5, 0x9f, 0xd6, 0x92, 0x92, 0x25, + 0xc0, 0xcc, 0x3b, 0xcb, 0xac, 0x6f, 0xff, 0x6a, 0x91, 0x9d, 0x46, 0xa9, 0x7c, 0x7b, 0xe8, 0x8b, + 0x30, 0x19, 0x91, 0x5b, 0xae, 0xdf, 0xb9, 0x2f, 0x85, 0xf0, 0x1e, 0x6e, 0x39, 0x8d, 0x65, 0x1d, + 0x93, 0xab, 0xf2, 0xcc, 0x32, 0x9c, 0xa2, 0x46, 0xe7, 0x29, 0xec, 0xf8, 0x0b, 0xd1, 0x9d, 0x88, + 0x84, 0x22, 0xdf, 0x1b, 0x9b, 0x27, 0x2c, 0x0b, 0x71, 0x02, 0xa7, 0xeb, 0x92, 0xfd, 0x59, 0x0b, + 0x7c, 0x1c, 0x04, 0xb1, 0x5c, 0xc9, 0x2c, 0x63, 0x90, 0x56, 0x8e, 0x0d, 0x2c, 0xb4, 0x02, 0x28, + 0xea, 0xb4, 0xdb, 0x1e, 0x7b, 0xd8, 0x77, 0xbc, 0xeb, 0x61, 0xd0, 0x69, 0xf3, 0x57, 0xcf, 0x22, + 0x0f, 0x4c, 0xd8, 0xe8, 0x82, 0xe2, 0x8c, 0x1a, 0xf4, 0xf4, 0xd9, 0x8c, 0xd8, 0x6f, 0xb6, 0xba, + 0x8b, 0x42, 0xbd, 0xde, 0x60, 0x45, 0x58, 0xc2, 0xe8, 0x62, 0x62, 0xcd, 0x73, 0xcc, 0xe1, 0x64, + 0x31, 0x61, 0x55, 0x8a, 0x35, 0x0c, 0xb4, 0x0c, 0x23, 0xd1, 0x7e, 0xd4, 0x8c, 0x45, 0x44, 0xa6, + 0x9c, 0xcc, 0x9d, 0x0d, 0x86, 0xa2, 0x65, 0x93, 0xe0, 0x55, 0xb0, 0xac, 0x6b, 0x7f, 0x0f, 0xbb, + 0x0c, 0x59, 0x76, 0xb0, 0xb8, 0x13, 0x12, 0xb4, 0x0b, 0x13, 0x6d, 0x36, 0xe5, 0x22, 0x76, 0xb5, + 0x98, 0xb7, 0x17, 0x07, 0x94, 0x6a, 0xef, 0xd1, 0x83, 0x46, 0x69, 0x9d, 0x98, 0xb8, 0x50, 0xd7, + 0xc9, 0x61, 0x93, 0xba, 0xfd, 0x35, 0xc4, 0xce, 0xdc, 0x06, 0x17, 0x55, 0x47, 0x84, 0x69, 0xb1, + 0xe0, 0xcb, 0xe7, 0xf2, 0x75, 0x26, 0xc9, 0x17, 0x09, 0xf3, 0x64, 0x2c, 0xeb, 0xa2, 0x37, 0xd9, + 0x2b, 0x35, 0x3f, 0xe8, 0xfa, 0x25, 0x69, 0xe6, 0x58, 0xc6, 0x83, 0xb4, 0xa8, 0x88, 0x35, 0x22, + 0xe8, 0x16, 0x4c, 0x88, 0x64, 0x52, 0x42, 0x29, 0x56, 0x34, 0x94, 0x1e, 0x13, 0x58, 0x07, 0x1e, + 0xa5, 0x0b, 0xb0, 0x59, 0x19, 0x6d, 0xc1, 0x05, 0x2d, 0xb3, 0xe2, 0xf5, 0xd0, 0x61, 0x2f, 0x97, + 0x2e, 0xdb, 0x44, 0xda, 0xb9, 0xf9, 0xc4, 0xe1, 0x41, 0xe5, 0xc2, 0x7a, 0x2f, 0x44, 0xdc, 0x9b, + 0x0e, 0xba, 0x0d, 0xe7, 0xb8, 0x07, 0x5f, 0x95, 0x38, 0x2d, 0xcf, 0xf5, 0xd5, 0xc1, 0xcc, 0xd7, + 0xe1, 0xf9, 0xc3, 0x83, 0xca, 0xb9, 0x85, 0x2c, 0x04, 0x9c, 0x5d, 0x0f, 0xbd, 0x06, 0xe5, 0x96, + 0x1f, 0x89, 0x31, 0x18, 0x36, 0x92, 0x86, 0x96, 0xab, 0x6b, 0x0d, 0xf5, 0xfd, 0xc9, 0x1f, 0x9c, + 0x54, 0x40, 0x5b, 0x5c, 0x31, 0xa6, 0xe4, 0xd0, 0x91, 0xfc, 0x04, 0xf1, 0x62, 0x49, 0x18, 0x3e, + 0x3c, 0x5c, 0x23, 0xac, 0x6c, 0x60, 0x0d, 0xf7, 0x1e, 0x83, 0x30, 0x7a, 0x03, 0x10, 0x65, 0xd4, + 0xdc, 0x26, 0x59, 0x68, 0xb2, 0x10, 0xe2, 0x4c, 0x8f, 0x38, 0x6a, 0xf8, 0x4c, 0xa0, 0x46, 0x17, + 0x06, 0xce, 0xa8, 0x85, 0x6e, 0xd0, 0x83, 0x4c, 0x2f, 0x15, 0xb6, 0xbc, 0x92, 0xb9, 0x9f, 0xad, + 0x92, 0x76, 0x48, 0x9a, 0x4e, 0x4c, 0x5a, 0x26, 0x45, 0x9c, 0xaa, 0x47, 0xef, 0x52, 0x95, 0x4d, + 0x08, 0xcc, 0xb0, 0x19, 0xdd, 0x19, 0x85, 0xa8, 0x5c, 0xbc, 0x1d, 0x44, 0xf1, 0x1a, 0x89, 0xef, + 0x05, 0xe1, 0x8e, 0x88, 0x52, 0x96, 0x04, 0xcc, 0x4c, 0x40, 0x58, 0xc7, 0xa3, 0x7c, 0x30, 0x7b, + 0x26, 0xae, 0x55, 0xd9, 0x0b, 0xdd, 0x68, 0xb2, 0x4f, 0x6e, 0xf0, 0x62, 0x2c, 0xe1, 0x12, 0xb5, + 0x56, 0x5f, 0x62, 0xaf, 0x6d, 0x29, 0xd4, 0x5a, 0x7d, 0x09, 0x4b, 0x38, 0x22, 0xdd, 0x09, 0x59, + 0x27, 0xf3, 0xb5, 0x9a, 0xdd, 0xd7, 0xc1, 0x80, 0x39, 0x59, 0x7d, 0x98, 0x56, 0xa9, 0x60, 0x79, + 0xf8, 0xb6, 0x68, 0x76, 0x8a, 0x2d, 0x92, 0xc1, 0x63, 0xbf, 0x29, 0x3d, 0x71, 0x2d, 0x45, 0x09, + 0x77, 0xd1, 0x36, 0x02, 0x99, 0x4c, 0xf7, 0xcd, 0x06, 0x75, 0x15, 0xca, 0x51, 0x67, 0xa3, 0x15, + 0xec, 0x3a, 0xae, 0xcf, 0x1e, 0xc7, 0x34, 0x26, 0xab, 0x21, 0x01, 0x38, 0xc1, 0x41, 0x2b, 0x30, + 0xea, 0x48, 0x25, 0x30, 0xca, 0x8f, 0x5a, 0xa0, 0x54, 0xbf, 0xdc, 0x91, 0x57, 0xaa, 0x7d, 0x55, + 0x5d, 0xf4, 0x2a, 0x4c, 0x08, 0xbf, 0x2d, 0x1e, 0xcb, 0x81, 0x3d, 0x5e, 0x69, 0x86, 0xf9, 0x0d, + 0x1d, 0x88, 0x4d, 0x5c, 0xf4, 0x05, 0x98, 0xa4, 0x54, 0x92, 0x83, 0x6d, 0xf6, 0xec, 0x20, 0x27, + 0xa2, 0x96, 0xe5, 0x43, 0xaf, 0x8c, 0x53, 0xc4, 0x50, 0x0b, 0x1e, 0x77, 0x3a, 0x71, 0xc0, 0x14, + 0xe9, 0xe6, 0xfa, 0x5f, 0x0f, 0x76, 0x88, 0xcf, 0xde, 0xb0, 0x46, 0x17, 0x2f, 0x1d, 0x1e, 0x54, + 0x1e, 0x5f, 0xe8, 0x81, 0x87, 0x7b, 0x52, 0x41, 0x77, 0x60, 0x2c, 0x0e, 0x3c, 0x66, 0x22, 0x4f, + 0x59, 0x89, 0x47, 0xf2, 0x03, 0x01, 0xad, 0x2b, 0x34, 0x5d, 0x89, 0xa4, 0xaa, 0x62, 0x9d, 0x0e, + 0x5a, 0xe7, 0x7b, 0x8c, 0x85, 0x48, 0x25, 0xd1, 0xec, 0xa3, 0xf9, 0x03, 0xa3, 0x22, 0xa9, 0x9a, + 0x5b, 0x50, 0xd4, 0xc4, 0x3a, 0x19, 0x74, 0x1d, 0x66, 0xda, 0xa1, 0x1b, 0xb0, 0x85, 0xad, 0x1e, + 0x31, 0x66, 0xcd, 0xc4, 0x0e, 0xf5, 0x34, 0x02, 0xee, 0xae, 0x43, 0x85, 0x4c, 0x59, 0x38, 0x7b, + 0x9e, 0x67, 0x09, 0xe3, 0x8c, 0x37, 0x2f, 0xc3, 0x0a, 0x8a, 0x56, 0xd9, 0xb9, 0xcc, 0xc5, 0xc1, + 0xd9, 0xb9, 0xfc, 0x68, 0x0f, 0xba, 0xd8, 0xc8, 0xf9, 0x25, 0xf5, 0x17, 0x27, 0x14, 0xe8, 0xbd, + 0x11, 0x6d, 0x3b, 0x21, 0xa9, 0x87, 0x41, 0x93, 0x44, 0x5a, 0x54, 0xe6, 0xc7, 0x78, 0x24, 0x47, + 0x7a, 0x6f, 0x34, 0xb2, 0x10, 0x70, 0x76, 0x3d, 0xd4, 0xd2, 0x92, 0x63, 0x53, 0x36, 0x34, 0x9a, + 0x7d, 0xbc, 0x87, 0xc1, 0x51, 0x8a, 0x67, 0x4d, 0xd6, 0xa2, 0x51, 0x1c, 0xe1, 0x14, 0x4d, 0xf4, + 0x1d, 0x30, 0x2d, 0x02, 0x1f, 0x25, 0xe3, 0x7e, 0x21, 0xb1, 0x64, 0xc4, 0x29, 0x18, 0xee, 0xc2, + 0xe6, 0xb1, 0xa8, 0x9d, 0x0d, 0x8f, 0x88, 0x45, 0x78, 0xcb, 0xf5, 0x77, 0xa2, 0xd9, 0x8b, 0xec, + 0xab, 0x45, 0x2c, 0xea, 0x34, 0x14, 0x67, 0xd4, 0x98, 0xfb, 0x76, 0x98, 0xe9, 0xba, 0xb9, 0x8e, + 0x15, 0xbf, 0xfd, 0x4f, 0x86, 0xa0, 0xac, 0x94, 0xf2, 0xe8, 0xaa, 0xf9, 0xd6, 0x72, 0x3e, 0xfd, + 0xd6, 0x32, 0x4a, 0x65, 0x03, 0xfd, 0x79, 0x65, 0xdd, 0x30, 0xd4, 0x2b, 0xe4, 0x67, 0x4b, 0xd3, + 0xb9, 0xfb, 0xbe, 0x4e, 0x7f, 0x9a, 0x8e, 0xa5, 0x38, 0xf0, 0xa3, 0x4d, 0xa9, 0xa7, 0xda, 0x66, + 0xc0, 0x64, 0xc5, 0xe8, 0x49, 0x2a, 0x20, 0xb5, 0x6a, 0xf5, 0x74, 0xf6, 0xce, 0x3a, 0x2d, 0xc4, + 0x1c, 0xc6, 0x04, 0x49, 0xca, 0x66, 0x31, 0x41, 0x72, 0xe4, 0x01, 0x05, 0x49, 0x49, 0x00, 0x27, + 0xb4, 0x90, 0x07, 0x33, 0x4d, 0x33, 0xf1, 0xaa, 0x72, 0xf4, 0x7b, 0xb2, 0x6f, 0x0a, 0xd4, 0x8e, + 0x96, 0xe5, 0x6e, 0x29, 0x4d, 0x05, 0x77, 0x13, 0x46, 0xaf, 0xc2, 0xe8, 0x7b, 0x41, 0xc4, 0x16, + 0xa5, 0xe0, 0x35, 0xa4, 0x43, 0xd4, 0xe8, 0x9b, 0xb7, 0x1b, 0xac, 0xfc, 0xe8, 0xa0, 0x32, 0x56, + 0x0f, 0x5a, 0xf2, 0x2f, 0x56, 0x15, 0xd0, 0x7d, 0x38, 0x67, 0x9c, 0xd0, 0xaa, 0xbb, 0x30, 0x78, + 0x77, 0x2f, 0x88, 0xe6, 0xce, 0xd5, 0xb2, 0x28, 0xe1, 0xec, 0x06, 0xe8, 0xb1, 0xe7, 0x07, 0x22, + 0x69, 0xb1, 0xe4, 0x67, 0x18, 0xdb, 0x52, 0xd6, 0xdd, 0xe1, 0x53, 0x08, 0xb8, 0xbb, 0x8e, 0xfd, + 0xcb, 0xfc, 0x0d, 0x43, 0x68, 0x3a, 0x49, 0xd4, 0xf1, 0x4e, 0x23, 0x27, 0xd6, 0xb2, 0xa1, 0x84, + 0x7d, 0xe0, 0x77, 0xb2, 0x5f, 0xb7, 0xd8, 0x3b, 0xd9, 0x3a, 0xd9, 0x6d, 0x7b, 0x54, 0xde, 0x7e, + 0xf8, 0x1d, 0x7f, 0x13, 0x46, 0x63, 0xd1, 0x5a, 0xaf, 0x34, 0x5e, 0x5a, 0xa7, 0xd8, 0x5b, 0xa1, + 0xe2, 0x74, 0x64, 0x29, 0x56, 0x64, 0xec, 0x7f, 0xc1, 0x67, 0x40, 0x42, 0x4e, 0x41, 0x21, 0x56, + 0x35, 0x15, 0x62, 0x95, 0x3e, 0x5f, 0x90, 0xa3, 0x18, 0xfb, 0xe7, 0x66, 0xbf, 0x99, 0x50, 0xf9, + 0x51, 0x7f, 0xa0, 0xb5, 0x7f, 0xd8, 0x82, 0xb3, 0x59, 0x16, 0x4d, 0x94, 0x3b, 0xe5, 0x22, 0xad, + 0x7a, 0xb0, 0x56, 0x23, 0x78, 0x57, 0x94, 0x63, 0x85, 0x31, 0x70, 0x86, 0x8c, 0xe3, 0x45, 0x8c, + 0xbb, 0x0d, 0x13, 0xf5, 0x90, 0x68, 0x77, 0xc0, 0xeb, 0xdc, 0xb3, 0x8e, 0xf7, 0xe7, 0xd9, 0x63, + 0x7b, 0xd5, 0xd9, 0x3f, 0x53, 0x80, 0xb3, 0xfc, 0xc5, 0x69, 0x61, 0x2f, 0x70, 0x5b, 0xf5, 0xa0, + 0x25, 0xb2, 0x9b, 0xbc, 0x0d, 0xe3, 0x6d, 0x4d, 0x0f, 0xd1, 0x2b, 0x66, 0x95, 0xae, 0xaf, 0x48, + 0xe4, 0x41, 0xbd, 0x14, 0x1b, 0xb4, 0x50, 0x0b, 0xc6, 0xc9, 0x9e, 0xdb, 0x54, 0xcf, 0x16, 0x85, + 0x63, 0xdf, 0x0d, 0xaa, 0x95, 0x65, 0x8d, 0x0e, 0x36, 0xa8, 0x3e, 0x84, 0x84, 0x77, 0xf6, 0x8f, + 0x58, 0xf0, 0x68, 0x4e, 0x84, 0x2b, 0xda, 0xdc, 0x3d, 0xf6, 0xb6, 0x27, 0x72, 0x67, 0xa9, 0xe6, + 0xf8, 0x8b, 0x1f, 0x16, 0x50, 0xf4, 0x39, 0x00, 0xfe, 0x62, 0x47, 0xc5, 0xa3, 0x7e, 0xa1, 0x80, + 0x8c, 0x28, 0x26, 0x5a, 0xf4, 0x09, 0x59, 0x1f, 0x6b, 0xb4, 0xec, 0x9f, 0x2c, 0xc2, 0x10, 0x7b, + 0x21, 0x42, 0x2b, 0x30, 0xb2, 0xcd, 0x63, 0x3e, 0x0f, 0x12, 0x5e, 0x3a, 0x91, 0x33, 0x79, 0x01, + 0x96, 0x95, 0xd1, 0x2a, 0x9c, 0xe1, 0x31, 0xb3, 0xbd, 0x2a, 0xf1, 0x9c, 0x7d, 0xa9, 0xae, 0xe0, + 0xf9, 0xa6, 0x54, 0x24, 0x8d, 0x5a, 0x37, 0x0a, 0xce, 0xaa, 0x87, 0x5e, 0x87, 0x49, 0xca, 0xdf, + 0x05, 0x9d, 0x58, 0x52, 0xe2, 0xd1, 0xb2, 0x15, 0x43, 0xb9, 0x6e, 0x40, 0x71, 0x0a, 0x9b, 0x0a, + 0x5e, 0xed, 0x2e, 0xc5, 0xcc, 0x50, 0x22, 0x78, 0x99, 0xca, 0x18, 0x13, 0x97, 0x99, 0x32, 0x75, + 0x98, 0xe1, 0xd6, 0xfa, 0x76, 0x48, 0xa2, 0xed, 0xc0, 0x6b, 0x89, 0x74, 0xe5, 0x89, 0x29, 0x53, + 0x0a, 0x8e, 0xbb, 0x6a, 0x50, 0x2a, 0x9b, 0x8e, 0xeb, 0x75, 0x42, 0x92, 0x50, 0x19, 0x36, 0xa9, + 0xac, 0xa4, 0xe0, 0xb8, 0xab, 0x06, 0x5d, 0x47, 0xe7, 0x44, 0xfe, 0x70, 0xe9, 0xdf, 0xaf, 0xec, + 0xd3, 0x46, 0xa4, 0xa7, 0x53, 0x8f, 0x00, 0x37, 0xc2, 0x82, 0x47, 0x65, 0x20, 0xd7, 0xf4, 0x89, + 0xc2, 0xc7, 0x49, 0x52, 0x79, 0x90, 0x2c, 0xd6, 0xbf, 0x6b, 0xc1, 0x99, 0x0c, 0x3b, 0x58, 0x7e, + 0x54, 0x6d, 0xb9, 0x51, 0xac, 0x72, 0xea, 0x68, 0x47, 0x15, 0x2f, 0xc7, 0x0a, 0x83, 0xee, 0x07, + 0x7e, 0x18, 0xa6, 0x0f, 0x40, 0x61, 0x67, 0x26, 0xa0, 0xc7, 0xcc, 0x4e, 0x73, 0x09, 0x4a, 0x9d, + 0x88, 0xc8, 0xd0, 0x54, 0xea, 0xfc, 0x66, 0x1a, 0x66, 0x06, 0xa1, 0xac, 0xe9, 0x96, 0x52, 0xee, + 0x6a, 0xac, 0x29, 0xd7, 0xd8, 0x72, 0x98, 0xfd, 0xd5, 0x22, 0x9c, 0xcf, 0xb5, 0x78, 0xa7, 0x5d, + 0xda, 0x0d, 0x7c, 0x37, 0x0e, 0xd4, 0xeb, 0x23, 0x0f, 0x8e, 0x42, 0xda, 0xdb, 0xab, 0xa2, 0x1c, + 0x2b, 0x0c, 0x74, 0x59, 0x66, 0xb2, 0x4f, 0x67, 0x0d, 0x5a, 0xac, 0x1a, 0xc9, 0xec, 0x07, 0xcd, + 0xc8, 0xf6, 0x24, 0x94, 0xda, 0x41, 0xe0, 0xa5, 0x0f, 0x23, 0xda, 0xdd, 0x20, 0xf0, 0x30, 0x03, + 0xa2, 0x4f, 0x88, 0x71, 0x48, 0x3d, 0xb7, 0x61, 0xa7, 0x15, 0x44, 0xda, 0x60, 0x3c, 0x0d, 0x23, + 0x3b, 0x64, 0x3f, 0x74, 0xfd, 0xad, 0xf4, 0x33, 0xec, 0x4d, 0x5e, 0x8c, 0x25, 0xdc, 0xcc, 0x21, + 0x31, 0x72, 0xd2, 0xa9, 0xd4, 0x46, 0xfb, 0x5e, 0x6d, 0x3f, 0x50, 0x84, 0x29, 0xbc, 0x58, 0xfd, + 0xd6, 0x44, 0xdc, 0xe9, 0x9e, 0x88, 0x93, 0x4e, 0xa5, 0xd6, 0x7f, 0x36, 0x7e, 0xc1, 0x82, 0x29, + 0x16, 0x67, 0x59, 0x84, 0xe4, 0x70, 0x03, 0xff, 0x14, 0x58, 0xb7, 0x27, 0x61, 0x28, 0xa4, 0x8d, + 0xa6, 0xd3, 0x05, 0xb1, 0x9e, 0x60, 0x0e, 0x43, 0x8f, 0x43, 0x89, 0x75, 0x81, 0x4e, 0xde, 0x38, + 0xcf, 0xb4, 0x50, 0x75, 0x62, 0x07, 0xb3, 0x52, 0xe6, 0x67, 0x8e, 0x49, 0xdb, 0x73, 0x79, 0xa7, + 0x93, 0xa7, 0x8d, 0x8f, 0x86, 0x9f, 0x79, 0x66, 0xd7, 0x3e, 0x98, 0x9f, 0x79, 0x36, 0xc9, 0xde, + 0x62, 0xd1, 0x1f, 0x16, 0xe0, 0x62, 0x66, 0xbd, 0x81, 0xfd, 0xcc, 0x7b, 0xd7, 0x3e, 0x19, 0x6b, + 0x9a, 0x6c, 0x23, 0x97, 0xe2, 0x29, 0x1a, 0xb9, 0x94, 0x06, 0xe5, 0x1c, 0x87, 0x06, 0x70, 0xff, + 0xce, 0x1c, 0xb2, 0x8f, 0x88, 0xfb, 0x77, 0x66, 0xdf, 0x72, 0xc4, 0xba, 0x3f, 0x2b, 0xe4, 0x7c, + 0x0b, 0x13, 0xf0, 0xae, 0xd0, 0x73, 0x86, 0x01, 0x23, 0xc1, 0x09, 0x8f, 0xf3, 0x33, 0x86, 0x97, + 0x61, 0x05, 0x45, 0xae, 0xe6, 0x48, 0x5d, 0xc8, 0xcf, 0x9e, 0x99, 0xdb, 0xd4, 0xbc, 0xf9, 0x12, + 0xa5, 0x86, 0x20, 0xc3, 0xa9, 0x7a, 0x55, 0x13, 0xca, 0x8b, 0x83, 0x0b, 0xe5, 0xe3, 0xd9, 0x02, + 0x39, 0x5a, 0x80, 0xa9, 0x5d, 0xd7, 0xa7, 0xc7, 0xe6, 0xbe, 0xc9, 0x8a, 0xaa, 0xb8, 0x22, 0xab, + 0x26, 0x18, 0xa7, 0xf1, 0xe7, 0x5e, 0x85, 0x89, 0x07, 0x57, 0x47, 0x7e, 0xb3, 0x08, 0x8f, 0xf5, + 0xd8, 0xf6, 0xfc, 0xac, 0x37, 0xe6, 0x40, 0x3b, 0xeb, 0xbb, 0xe6, 0xa1, 0x0e, 0x67, 0x37, 0x3b, + 0x9e, 0xb7, 0xcf, 0xec, 0x48, 0x49, 0x4b, 0x62, 0x08, 0x5e, 0xf1, 0x71, 0x99, 0xdb, 0x62, 0x25, + 0x03, 0x07, 0x67, 0xd6, 0x44, 0x6f, 0x00, 0x0a, 0x44, 0xea, 0xde, 0xeb, 0xc4, 0x17, 0xfa, 0x7d, + 0x36, 0xf0, 0xc5, 0x64, 0x33, 0xde, 0xee, 0xc2, 0xc0, 0x19, 0xb5, 0x28, 0xd3, 0x4f, 0x6f, 0xa5, + 0x7d, 0xd5, 0xad, 0x14, 0xd3, 0x8f, 0x75, 0x20, 0x36, 0x71, 0xd1, 0x75, 0x98, 0x71, 0xf6, 0x1c, + 0x97, 0xc7, 0xdb, 0x93, 0x04, 0x38, 0xd7, 0xaf, 0x94, 0x60, 0x0b, 0x69, 0x04, 0xdc, 0x5d, 0x27, + 0xe5, 0x6a, 0x3d, 0x9c, 0xef, 0x6a, 0xdd, 0xfb, 0x5c, 0xec, 0xa7, 0xd3, 0xb5, 0xff, 0xb3, 0x45, + 0xaf, 0xaf, 0x8c, 0xf4, 0xfb, 0x74, 0x1c, 0x94, 0x6e, 0x52, 0xf3, 0x7a, 0x3e, 0xa7, 0x59, 0x8a, + 0x24, 0x40, 0x6c, 0xe2, 0xf2, 0x05, 0x11, 0x25, 0xce, 0x36, 0x06, 0xeb, 0x2e, 0xa2, 0x26, 0x28, + 0x0c, 0xf4, 0x79, 0x18, 0x69, 0xb9, 0x7b, 0x6e, 0x14, 0x84, 0x62, 0xb3, 0x1c, 0xd3, 0x65, 0x21, + 0x39, 0x07, 0xab, 0x9c, 0x0c, 0x96, 0xf4, 0xec, 0x1f, 0x28, 0xc0, 0x84, 0x6c, 0xf1, 0xcd, 0x4e, + 0x10, 0x3b, 0xa7, 0x70, 0x2d, 0x5f, 0x37, 0xae, 0xe5, 0x4f, 0xf4, 0x0a, 0x1d, 0xc1, 0xba, 0x94, + 0x7b, 0x1d, 0xdf, 0x4e, 0x5d, 0xc7, 0x4f, 0xf5, 0x27, 0xd5, 0xfb, 0x1a, 0xfe, 0x97, 0x16, 0xcc, + 0x18, 0xf8, 0xa7, 0x70, 0x1b, 0xac, 0x98, 0xb7, 0xc1, 0x13, 0x7d, 0xbf, 0x21, 0xe7, 0x16, 0xf8, + 0xbe, 0x62, 0xaa, 0xef, 0xec, 0xf4, 0x7f, 0x0f, 0x4a, 0xdb, 0x4e, 0xd8, 0xea, 0x15, 0xa2, 0xb6, + 0xab, 0xd2, 0xfc, 0x0d, 0x27, 0x6c, 0xf1, 0x33, 0xfc, 0x59, 0x95, 0xff, 0xd2, 0x09, 0x5b, 0x7d, + 0x7d, 0xcb, 0x58, 0x53, 0xe8, 0x15, 0x18, 0x8e, 0x9a, 0x41, 0x5b, 0x59, 0x7e, 0x5e, 0xe2, 0xb9, + 0x31, 0x69, 0xc9, 0xd1, 0x41, 0x05, 0x99, 0xcd, 0xd1, 0x62, 0x2c, 0xf0, 0xd1, 0xdb, 0x30, 0xc1, + 0x7e, 0x29, 0x0b, 0x88, 0x62, 0x7e, 0x62, 0x84, 0x86, 0x8e, 0xc8, 0x0d, 0x69, 0x8c, 0x22, 0x6c, + 0x92, 0x9a, 0xdb, 0x82, 0xb2, 0xfa, 0xac, 0x87, 0xea, 0x13, 0xf4, 0x1f, 0x8a, 0x70, 0x26, 0x63, + 0xcd, 0xa1, 0xc8, 0x98, 0x89, 0xe7, 0x07, 0x5c, 0xaa, 0x1f, 0x70, 0x2e, 0x22, 0x26, 0x0d, 0xb5, + 0xc4, 0xda, 0x1a, 0xb8, 0xd1, 0x3b, 0x11, 0x49, 0x37, 0x4a, 0x8b, 0xfa, 0x37, 0x4a, 0x1b, 0x3b, + 0xb5, 0xa1, 0xa6, 0x0d, 0xa9, 0x9e, 0x3e, 0xd4, 0x39, 0xfd, 0xe3, 0x22, 0x9c, 0xcd, 0x8a, 0x66, + 0x83, 0xbe, 0x3b, 0x95, 0x24, 0xe7, 0xc5, 0x41, 0xe3, 0xe0, 0xf0, 0xcc, 0x39, 0x22, 0xc7, 0xf5, + 0xbc, 0x99, 0x36, 0xa7, 0xef, 0x30, 0x8b, 0x36, 0x99, 0x23, 0x69, 0xc8, 0x93, 0x1b, 0xc9, 0xe3, + 0xe3, 0xd3, 0x03, 0x77, 0x40, 0x64, 0x45, 0x8a, 0x52, 0x8e, 0xa4, 0xb2, 0xb8, 0xbf, 0x23, 0xa9, + 0x6c, 0x79, 0xce, 0x85, 0x31, 0xed, 0x6b, 0x1e, 0xea, 0x8c, 0xef, 0xd0, 0xdb, 0x4a, 0xeb, 0xf7, + 0x43, 0x9d, 0xf5, 0x1f, 0xb1, 0x20, 0x65, 0x66, 0xa9, 0xd4, 0x5d, 0x56, 0xae, 0xba, 0xeb, 0x12, + 0x94, 0xc2, 0xc0, 0x23, 0xe9, 0x9c, 0x34, 0x38, 0xf0, 0x08, 0x66, 0x10, 0x8a, 0x11, 0x27, 0xca, + 0x8e, 0x71, 0x5d, 0x90, 0x13, 0x22, 0xda, 0x93, 0x30, 0xe4, 0x91, 0x3d, 0xe2, 0xa5, 0x03, 0xbe, + 0xdf, 0xa2, 0x85, 0x98, 0xc3, 0xec, 0x5f, 0x28, 0xc1, 0x85, 0x9e, 0xae, 0xd8, 0x54, 0x1c, 0xda, + 0x72, 0x62, 0x72, 0xcf, 0xd9, 0x4f, 0x47, 0x66, 0xbe, 0xce, 0x8b, 0xb1, 0x84, 0x33, 0xcb, 0x73, + 0x1e, 0x89, 0x31, 0xa5, 0x1c, 0x14, 0x01, 0x18, 0x05, 0xf4, 0x21, 0xe4, 0xf7, 0xbf, 0x06, 0x10, + 0x45, 0x1e, 0xb7, 0x1b, 0x68, 0x09, 0x93, 0xf6, 0x24, 0x62, 0x67, 0xe3, 0x96, 0x80, 0x60, 0x0d, + 0x0b, 0x55, 0x61, 0xba, 0x1d, 0x06, 0x31, 0xd7, 0xb5, 0x56, 0xb9, 0xc1, 0xd1, 0x90, 0xe9, 0x05, + 0x5b, 0x4f, 0xc1, 0x71, 0x57, 0x0d, 0xf4, 0x12, 0x8c, 0x09, 0xcf, 0xd8, 0x7a, 0x10, 0x78, 0x42, + 0x0d, 0xa4, 0xcc, 0x57, 0x1a, 0x09, 0x08, 0xeb, 0x78, 0x5a, 0x35, 0xa6, 0xc0, 0x1d, 0xc9, 0xac, + 0xc6, 0x95, 0xb8, 0x1a, 0x5e, 0x2a, 0xb2, 0xd5, 0xe8, 0x40, 0x91, 0xad, 0x12, 0xc5, 0x58, 0x79, + 0xe0, 0x37, 0x2b, 0xe8, 0xab, 0x4a, 0xfa, 0xd9, 0x12, 0x9c, 0x11, 0x0b, 0xe7, 0x61, 0x2f, 0x97, + 0x3b, 0xdd, 0xcb, 0xe5, 0x24, 0x54, 0x67, 0xdf, 0x5a, 0x33, 0xa7, 0xbd, 0x66, 0x7e, 0xd0, 0x02, + 0x93, 0xbd, 0x42, 0x7f, 0x29, 0x37, 0xb4, 0xfd, 0x4b, 0xb9, 0xec, 0x5a, 0x4b, 0x5e, 0x20, 0x1f, + 0x30, 0xc8, 0xbd, 0xfd, 0x9f, 0x2c, 0x78, 0xa2, 0x2f, 0x45, 0xb4, 0x0c, 0x65, 0xc6, 0x03, 0x6a, + 0xd2, 0xd9, 0x53, 0xca, 0x20, 0x51, 0x02, 0x72, 0x58, 0xd2, 0xa4, 0x26, 0x5a, 0xee, 0xca, 0x21, + 0xf0, 0x74, 0x46, 0x0e, 0x81, 0x73, 0xc6, 0xf0, 0x3c, 0x60, 0x12, 0x81, 0x5f, 0x2e, 0xc2, 0x30, + 0x5f, 0xf1, 0xa7, 0x20, 0x86, 0xad, 0x08, 0xbd, 0x6d, 0x8f, 0xd8, 0x56, 0xbc, 0x2f, 0xf3, 0x55, + 0x27, 0x76, 0x38, 0x9b, 0xa0, 0x6e, 0xab, 0x44, 0xc3, 0x8b, 0xe6, 0x8d, 0xfb, 0x6c, 0x2e, 0xa5, + 0x98, 0x04, 0x4e, 0x43, 0xbb, 0xdd, 0xbe, 0x08, 0x10, 0xb1, 0xfc, 0xfb, 0x94, 0x86, 0x88, 0x92, + 0xf6, 0xc9, 0x1e, 0xad, 0x37, 0x14, 0x32, 0xef, 0x43, 0xb2, 0xd3, 0x15, 0x00, 0x6b, 0x14, 0xe7, + 0x5e, 0x86, 0xb2, 0x42, 0xee, 0xa7, 0xc5, 0x19, 0xd7, 0x99, 0x8b, 0xcf, 0xc2, 0x54, 0xaa, 0xad, + 0x63, 0x29, 0x81, 0x7e, 0xd1, 0x82, 0x29, 0xde, 0xe5, 0x65, 0x7f, 0x4f, 0x9c, 0xa9, 0xef, 0xc3, + 0x59, 0x2f, 0xe3, 0x6c, 0x13, 0x33, 0x3a, 0xf8, 0x59, 0xa8, 0x94, 0x3e, 0x59, 0x50, 0x9c, 0xd9, + 0x06, 0xba, 0x42, 0xd7, 0x2d, 0x3d, 0xbb, 0x1c, 0x4f, 0x78, 0x31, 0x8d, 0xf3, 0x35, 0xcb, 0xcb, + 0xb0, 0x82, 0xda, 0xbf, 0x6d, 0xc1, 0x0c, 0xef, 0xf9, 0x4d, 0xb2, 0xaf, 0x76, 0xf8, 0x87, 0xd9, + 0x77, 0x91, 0xd6, 0xa3, 0x90, 0x93, 0xd6, 0x43, 0xff, 0xb4, 0x62, 0xcf, 0x4f, 0xfb, 0x19, 0x0b, + 0xc4, 0x0a, 0x3c, 0x05, 0x51, 0xfe, 0xdb, 0x4d, 0x51, 0x7e, 0x2e, 0x7f, 0x51, 0xe7, 0xc8, 0xf0, + 0x7f, 0x6a, 0xc1, 0x34, 0x47, 0x48, 0xde, 0x92, 0x3f, 0xd4, 0x79, 0x18, 0x24, 0x3f, 0x9f, 0x4a, + 0xda, 0x9d, 0xfd, 0x51, 0xc6, 0x64, 0x95, 0x7a, 0x4e, 0x56, 0x4b, 0x6e, 0xa0, 0x63, 0xe4, 0xa6, + 0x3c, 0x76, 0x78, 0x6c, 0xfb, 0x0f, 0x2c, 0x40, 0xbc, 0x19, 0x83, 0xfd, 0xa1, 0x4c, 0x05, 0x2b, + 0xd5, 0xae, 0x8b, 0xe4, 0xa8, 0x51, 0x10, 0xac, 0x61, 0x9d, 0xc8, 0xf0, 0xa4, 0x0c, 0x02, 0x8a, + 0xfd, 0x0d, 0x02, 0x8e, 0x31, 0xa2, 0xff, 0xa7, 0x04, 0x69, 0xb7, 0x02, 0x74, 0x17, 0xc6, 0x9b, + 0x4e, 0xdb, 0xd9, 0x70, 0x3d, 0x37, 0x76, 0x49, 0xd4, 0xcb, 0x92, 0x68, 0x49, 0xc3, 0x13, 0x4f, + 0xbd, 0x5a, 0x09, 0x36, 0xe8, 0xa0, 0x79, 0x80, 0x76, 0xe8, 0xee, 0xb9, 0x1e, 0xd9, 0x62, 0x1a, + 0x07, 0xe6, 0x37, 0xc9, 0xcd, 0x63, 0x64, 0x29, 0xd6, 0x30, 0x32, 0x5c, 0xe0, 0x8a, 0x0f, 0xcf, + 0x05, 0xae, 0x74, 0x4c, 0x17, 0xb8, 0xa1, 0x81, 0x5c, 0xe0, 0x30, 0x3c, 0x22, 0x59, 0x24, 0xfa, + 0x7f, 0xc5, 0xf5, 0x88, 0xe0, 0x8b, 0xb9, 0x37, 0xe5, 0xdc, 0xe1, 0x41, 0xe5, 0x11, 0x9c, 0x89, + 0x81, 0x73, 0x6a, 0xa2, 0xcf, 0xc1, 0xac, 0xe3, 0x79, 0xc1, 0x3d, 0x35, 0x6a, 0xcb, 0x51, 0xd3, + 0xf1, 0xb8, 0xc6, 0x7e, 0x84, 0x51, 0x7d, 0xfc, 0xf0, 0xa0, 0x32, 0xbb, 0x90, 0x83, 0x83, 0x73, + 0x6b, 0xa7, 0x3c, 0xe8, 0x46, 0xfb, 0x7a, 0xd0, 0xbd, 0x06, 0xe5, 0x76, 0x18, 0x34, 0x57, 0x35, + 0xaf, 0x9e, 0x8b, 0x2c, 0xf3, 0xbd, 0x2c, 0x3c, 0x3a, 0xa8, 0x4c, 0xa8, 0x3f, 0xec, 0x86, 0x4f, + 0x2a, 0xd8, 0x3b, 0x70, 0xa6, 0x41, 0x42, 0x97, 0xe5, 0xd4, 0x6c, 0x25, 0x1b, 0x7a, 0x1d, 0xca, + 0x61, 0xea, 0x08, 0x1b, 0x28, 0x40, 0x93, 0x16, 0x37, 0x58, 0x1e, 0x59, 0x09, 0x21, 0xfb, 0x4f, + 0x2c, 0x18, 0x11, 0x16, 0xe6, 0xa7, 0xc0, 0x39, 0x2d, 0x18, 0x0a, 0xec, 0x4a, 0xf6, 0x31, 0xcf, + 0x3a, 0x93, 0xab, 0xba, 0xae, 0xa5, 0x54, 0xd7, 0x4f, 0xf4, 0x22, 0xd2, 0x5b, 0x69, 0xfd, 0x77, + 0x8b, 0x30, 0x69, 0x3a, 0x85, 0x9c, 0xc2, 0x10, 0xac, 0xc1, 0x48, 0x24, 0x3c, 0x90, 0x0a, 0xf9, + 0x96, 0xd3, 0xe9, 0x49, 0x4c, 0xcc, 0xa2, 0x84, 0xcf, 0x91, 0x24, 0x92, 0xe9, 0xda, 0x54, 0x7c, + 0x88, 0xae, 0x4d, 0xfd, 0xfc, 0x72, 0x4a, 0x27, 0xe1, 0x97, 0x63, 0x7f, 0x9d, 0x5d, 0x35, 0x7a, + 0xf9, 0x29, 0x70, 0x21, 0xd7, 0xcd, 0x4b, 0xc9, 0xee, 0xb1, 0xb2, 0x44, 0xa7, 0x72, 0xb8, 0x91, + 0x9f, 0xb7, 0xe0, 0x42, 0xc6, 0x57, 0x69, 0xac, 0xc9, 0xb3, 0x30, 0xea, 0x74, 0x5a, 0xae, 0xda, + 0xcb, 0xda, 0x33, 0xd6, 0x82, 0x28, 0xc7, 0x0a, 0x03, 0x2d, 0xc1, 0x0c, 0xb9, 0xdf, 0x76, 0xf9, + 0x3b, 0xa2, 0x6e, 0xbb, 0x58, 0xe4, 0x41, 0x6b, 0x97, 0xd3, 0x40, 0xdc, 0x8d, 0xaf, 0xdc, 0xba, + 0x8b, 0xb9, 0x6e, 0xdd, 0xff, 0xc4, 0x82, 0x31, 0xe5, 0x6d, 0xf2, 0xd0, 0x47, 0xfb, 0x3b, 0xcc, + 0xd1, 0x7e, 0xac, 0xc7, 0x68, 0xe7, 0x0c, 0xf3, 0xdf, 0x2f, 0xa8, 0xfe, 0xd6, 0x83, 0x30, 0x1e, + 0x80, 0xe5, 0x79, 0x05, 0x46, 0xdb, 0x61, 0x10, 0x07, 0xcd, 0xc0, 0x13, 0x1c, 0xcf, 0xe3, 0x49, + 0xd4, 0x01, 0x5e, 0x7e, 0xa4, 0xfd, 0xc6, 0x0a, 0x9b, 0x8d, 0x5e, 0x10, 0xc6, 0x82, 0xcb, 0x48, + 0x46, 0x2f, 0x08, 0x63, 0xcc, 0x20, 0xa8, 0x05, 0x10, 0x3b, 0xe1, 0x16, 0x89, 0x69, 0x99, 0x08, + 0x60, 0x92, 0x7f, 0x78, 0x74, 0x62, 0xd7, 0x9b, 0x77, 0xfd, 0x38, 0x8a, 0xc3, 0xf9, 0x9a, 0x1f, + 0xdf, 0x0e, 0xb9, 0x00, 0xa5, 0x85, 0x11, 0x50, 0xb4, 0xb0, 0x46, 0x57, 0xfa, 0x7a, 0xb2, 0x36, + 0x86, 0xcc, 0x07, 0xf1, 0x35, 0x51, 0x8e, 0x15, 0x86, 0xfd, 0x32, 0xbb, 0x4a, 0xd8, 0x00, 0x1d, + 0xcf, 0xc3, 0xff, 0x1b, 0xa3, 0x6a, 0x68, 0xd9, 0x6b, 0x58, 0x55, 0x8f, 0x23, 0xd0, 0xfb, 0xe4, + 0xa6, 0x0d, 0xeb, 0x7e, 0x34, 0x49, 0xb0, 0x01, 0xf4, 0x9d, 0x5d, 0x76, 0x12, 0xcf, 0xf5, 0xb9, + 0x02, 0x8e, 0x61, 0x19, 0xc1, 0x02, 0x69, 0xb3, 0x30, 0xc3, 0xb5, 0xba, 0x58, 0xe4, 0x5a, 0x20, + 0x6d, 0x01, 0xc0, 0x09, 0x0e, 0xba, 0x2a, 0xc4, 0xef, 0x92, 0x91, 0x4e, 0x4f, 0x8a, 0xdf, 0xf2, + 0xf3, 0x35, 0xf9, 0xfb, 0x79, 0x18, 0x53, 0x69, 0xf5, 0xea, 0x3c, 0x3b, 0x99, 0x08, 0xe7, 0xb2, + 0x9c, 0x14, 0x63, 0x1d, 0x07, 0xad, 0xc3, 0x54, 0xc4, 0x75, 0x2f, 0x2a, 0x6a, 0x1f, 0xd7, 0x61, + 0x7d, 0x52, 0xda, 0x57, 0x34, 0x4c, 0xf0, 0x11, 0x2b, 0xe2, 0x47, 0x87, 0x74, 0xd8, 0x4c, 0x93, + 0x40, 0xaf, 0xc3, 0xa4, 0xa7, 0x27, 0xb0, 0xaf, 0x0b, 0x15, 0x97, 0x32, 0x3f, 0x36, 0xd2, 0xdb, + 0xd7, 0x71, 0x0a, 0x9b, 0x72, 0x4a, 0x7a, 0x89, 0x88, 0x34, 0xe9, 0xf8, 0x5b, 0x24, 0x12, 0x49, + 0xc1, 0x18, 0xa7, 0x74, 0x2b, 0x07, 0x07, 0xe7, 0xd6, 0x46, 0xaf, 0xc0, 0xb8, 0xfc, 0x7c, 0xcd, + 0x1d, 0x39, 0x31, 0x72, 0xd7, 0x60, 0xd8, 0xc0, 0x44, 0xf7, 0xe0, 0x9c, 0xfc, 0xbf, 0x1e, 0x3a, + 0x9b, 0x9b, 0x6e, 0x53, 0x78, 0x83, 0x73, 0x4f, 0x9f, 0x05, 0xe9, 0x3a, 0xb4, 0x9c, 0x85, 0x74, + 0x74, 0x50, 0xb9, 0x24, 0x46, 0x2d, 0x13, 0xce, 0x26, 0x31, 0x9b, 0x3e, 0x5a, 0x85, 0x33, 0xdb, + 0xc4, 0xf1, 0xe2, 0xed, 0xa5, 0x6d, 0xd2, 0xdc, 0x91, 0x9b, 0x88, 0x39, 0x39, 0x6b, 0xa6, 0xe1, + 0x37, 0xba, 0x51, 0x70, 0x56, 0x3d, 0xf4, 0x0e, 0xcc, 0xb6, 0x3b, 0x1b, 0x9e, 0x1b, 0x6d, 0xaf, + 0x05, 0x31, 0x33, 0xe9, 0x50, 0x59, 0xe9, 0x84, 0x37, 0xb4, 0x72, 0xf0, 0xae, 0xe7, 0xe0, 0xe1, + 0x5c, 0x0a, 0xe8, 0x7d, 0x38, 0x97, 0x5a, 0x0c, 0xc2, 0x37, 0x73, 0x32, 0x3f, 0x6e, 0x6f, 0x23, + 0xab, 0x82, 0xf0, 0xb5, 0xcc, 0x02, 0xe1, 0xec, 0x26, 0x3e, 0x98, 0xa1, 0xcf, 0x7b, 0xb4, 0xb2, + 0xc6, 0x94, 0xa1, 0x2f, 0xc1, 0xb8, 0xbe, 0x8a, 0xc4, 0x05, 0x73, 0x39, 0x9b, 0x67, 0xd1, 0x56, + 0x1b, 0x67, 0xe9, 0xd4, 0x8a, 0xd2, 0x61, 0xd8, 0xa0, 0x68, 0x13, 0xc8, 0xfe, 0x3e, 0x74, 0x0b, + 0x46, 0x9b, 0x9e, 0x4b, 0xfc, 0xb8, 0x56, 0xef, 0x15, 0x3c, 0x64, 0x49, 0xe0, 0x88, 0x01, 0x13, + 0x81, 0x4e, 0x79, 0x19, 0x56, 0x14, 0xec, 0x5f, 0x2b, 0x40, 0xa5, 0x4f, 0xd4, 0xdc, 0x94, 0x3e, + 0xda, 0x1a, 0x48, 0x1f, 0xbd, 0x20, 0x73, 0xec, 0xad, 0xa5, 0x84, 0xf4, 0x54, 0xfe, 0xbc, 0x44, + 0x54, 0x4f, 0xe3, 0x0f, 0x6c, 0x1f, 0xac, 0xab, 0xb4, 0x4b, 0x7d, 0x2d, 0xd7, 0x8d, 0xa7, 0xac, + 0xa1, 0xc1, 0x05, 0x91, 0xdc, 0x67, 0x09, 0xfb, 0xeb, 0x05, 0x38, 0xa7, 0x86, 0xf0, 0x2f, 0xee, + 0xc0, 0xdd, 0xe9, 0x1e, 0xb8, 0x13, 0x78, 0xd4, 0xb1, 0x6f, 0xc3, 0x30, 0x0f, 0xbe, 0x32, 0x00, + 0x03, 0xf4, 0xa4, 0x19, 0xa9, 0x4b, 0x5d, 0xd3, 0x46, 0xb4, 0xae, 0xbf, 0x66, 0xc1, 0xd4, 0xfa, + 0x52, 0xbd, 0x11, 0x34, 0x77, 0x48, 0xbc, 0xc0, 0x19, 0x56, 0x2c, 0xf8, 0x1f, 0xeb, 0x01, 0xf9, + 0x9a, 0x2c, 0x8e, 0xe9, 0x12, 0x94, 0xb6, 0x83, 0x28, 0x4e, 0xbf, 0xf8, 0xde, 0x08, 0xa2, 0x18, + 0x33, 0x88, 0xfd, 0x3b, 0x16, 0x0c, 0xb1, 0xcc, 0xb0, 0xfd, 0xd2, 0x15, 0x0f, 0xf2, 0x5d, 0xe8, + 0x25, 0x18, 0x26, 0x9b, 0x9b, 0xa4, 0x19, 0x8b, 0x59, 0x95, 0xee, 0xa8, 0xc3, 0xcb, 0xac, 0x94, + 0x5e, 0xfa, 0xac, 0x31, 0xfe, 0x17, 0x0b, 0x64, 0xf4, 0x16, 0x94, 0x63, 0x77, 0x97, 0x2c, 0xb4, + 0x5a, 0xe2, 0xcd, 0xec, 0x01, 0xbc, 0x7f, 0xd7, 0x25, 0x01, 0x9c, 0xd0, 0xb2, 0xbf, 0x5a, 0x00, + 0x48, 0x42, 0x08, 0xf4, 0xfb, 0xc4, 0xc5, 0xae, 0xd7, 0x94, 0xcb, 0x19, 0xaf, 0x29, 0x28, 0x21, + 0x98, 0xf1, 0x94, 0xa2, 0x86, 0xa9, 0x38, 0xd0, 0x30, 0x95, 0x8e, 0x33, 0x4c, 0x4b, 0x30, 0x93, + 0x84, 0x40, 0x30, 0xe3, 0xc1, 0x30, 0x21, 0x65, 0x3d, 0x0d, 0xc4, 0xdd, 0xf8, 0x36, 0x81, 0x4b, + 0x32, 0x32, 0xa7, 0xbc, 0x6b, 0x98, 0x49, 0xe6, 0x31, 0x32, 0x57, 0x27, 0xcf, 0x45, 0x85, 0xdc, + 0xe7, 0xa2, 0x1f, 0xb7, 0xe0, 0x6c, 0xba, 0x1d, 0xe6, 0xfb, 0xf6, 0x15, 0x0b, 0xce, 0xb1, 0x47, + 0x33, 0xd6, 0x6a, 0xf7, 0x13, 0xdd, 0x8b, 0xd9, 0xa1, 0x21, 0x7a, 0xf7, 0x38, 0xf1, 0x7b, 0x5e, + 0xcd, 0x22, 0x8d, 0xb3, 0x5b, 0xb4, 0xbf, 0x62, 0xc1, 0xf9, 0xdc, 0x84, 0x44, 0xe8, 0x0a, 0x8c, + 0x3a, 0x6d, 0x97, 0x6b, 0xa4, 0xc4, 0x7e, 0x67, 0xd2, 0x63, 0xbd, 0xc6, 0xf5, 0x51, 0x0a, 0xaa, + 0x12, 0x25, 0x16, 0x72, 0x13, 0x25, 0xf6, 0xcd, 0x7b, 0x68, 0x7f, 0xbf, 0x05, 0xc2, 0xdd, 0x69, + 0x80, 0x43, 0xe6, 0x6d, 0x99, 0x67, 0xd6, 0x08, 0x8a, 0x7e, 0x29, 0xdf, 0xff, 0x4b, 0x84, 0x42, + 0x57, 0x97, 0xba, 0x11, 0x00, 0xdd, 0xa0, 0x65, 0xb7, 0x40, 0x40, 0xab, 0x84, 0xe9, 0xac, 0xfa, + 0xf7, 0xe6, 0x1a, 0x40, 0x8b, 0xe1, 0x6a, 0xd9, 0x26, 0xd5, 0x15, 0x52, 0x55, 0x10, 0xac, 0x61, + 0xd9, 0x3f, 0x54, 0x80, 0x31, 0x19, 0x84, 0xbb, 0xe3, 0x0f, 0x22, 0x59, 0x1e, 0x2b, 0x2b, 0x0f, + 0x4b, 0xcf, 0x4a, 0x09, 0xd7, 0x13, 0x81, 0x3c, 0x49, 0xcf, 0x2a, 0x01, 0x38, 0xc1, 0x41, 0x4f, + 0xc3, 0x48, 0xd4, 0xd9, 0x60, 0xe8, 0x29, 0x27, 0x9e, 0x06, 0x2f, 0xc6, 0x12, 0x8e, 0x3e, 0x07, + 0xd3, 0xbc, 0x5e, 0x18, 0xb4, 0x9d, 0x2d, 0xae, 0xfe, 0x1c, 0x52, 0x5e, 0xb5, 0xd3, 0xab, 0x29, + 0xd8, 0xd1, 0x41, 0xe5, 0x6c, 0xba, 0x8c, 0x29, 0xce, 0xbb, 0xa8, 0xd8, 0x5f, 0x02, 0xd4, 0x1d, + 0x57, 0x1c, 0xbd, 0xc1, 0x4d, 0xa9, 0xdc, 0x90, 0xb4, 0x7a, 0x69, 0xc4, 0x75, 0x27, 0x50, 0x69, + 0x48, 0xcf, 0x6b, 0x61, 0x55, 0xdf, 0xfe, 0x9b, 0x45, 0x98, 0x4e, 0xbb, 0x04, 0xa2, 0x1b, 0x30, + 0xcc, 0x2f, 0x3b, 0x41, 0xbe, 0xc7, 0x83, 0xab, 0xe6, 0x48, 0xc8, 0xb6, 0xbd, 0xb8, 0x2f, 0x45, + 0x7d, 0xf4, 0x0e, 0x8c, 0xb5, 0x82, 0x7b, 0xfe, 0x3d, 0x27, 0x6c, 0x2d, 0xd4, 0x6b, 0x62, 0x5d, + 0x66, 0xf2, 0xcc, 0xd5, 0x04, 0x4d, 0x77, 0x4e, 0x64, 0x8f, 0x0b, 0x09, 0x08, 0xeb, 0xe4, 0xd0, + 0x3a, 0x8b, 0x95, 0xb8, 0xe9, 0x6e, 0xad, 0x3a, 0xed, 0x5e, 0x76, 0xb5, 0x4b, 0x12, 0x49, 0xa3, + 0x3c, 0x21, 0x02, 0x2a, 0x72, 0x00, 0x4e, 0x08, 0xa1, 0xef, 0x86, 0x33, 0x51, 0x8e, 0x9a, 0x2d, + 0x2f, 0xcd, 0x44, 0x2f, 0xcd, 0xd3, 0xe2, 0xa3, 0x54, 0x9a, 0xc9, 0x52, 0xc8, 0x65, 0x35, 0x63, + 0x7f, 0xf9, 0x0c, 0x18, 0xbb, 0xd1, 0xc8, 0x3a, 0x64, 0x9d, 0x50, 0xd6, 0x21, 0x0c, 0xa3, 0x64, + 0xb7, 0x1d, 0xef, 0x57, 0xdd, 0xb0, 0x57, 0x56, 0xbc, 0x65, 0x81, 0xd3, 0x4d, 0x53, 0x42, 0xb0, + 0xa2, 0x93, 0x9d, 0x1a, 0xaa, 0xf8, 0x21, 0xa6, 0x86, 0x2a, 0x9d, 0x62, 0x6a, 0xa8, 0x35, 0x18, + 0xd9, 0x72, 0x63, 0x4c, 0xda, 0x81, 0x60, 0x33, 0x33, 0xd7, 0xe1, 0x75, 0x8e, 0xd2, 0x9d, 0x84, + 0x44, 0x00, 0xb0, 0x24, 0x82, 0xde, 0x50, 0x3b, 0x70, 0x38, 0x5f, 0x4a, 0xeb, 0x7e, 0x19, 0xcc, + 0xdc, 0x83, 0x22, 0x01, 0xd4, 0xc8, 0x83, 0x26, 0x80, 0x5a, 0x91, 0x69, 0x9b, 0x46, 0xf3, 0x8d, + 0xe0, 0x59, 0x56, 0xa6, 0x3e, 0xc9, 0x9a, 0xee, 0xea, 0xa9, 0xae, 0xca, 0xf9, 0x27, 0x81, 0xca, + 0x62, 0x35, 0x60, 0x82, 0xab, 0xef, 0xb7, 0xe0, 0x5c, 0x3b, 0x2b, 0xeb, 0x9b, 0x48, 0xb6, 0xf4, + 0xd2, 0xc0, 0x69, 0xed, 0x8c, 0x06, 0x99, 0xb8, 0x9e, 0x89, 0x86, 0xb3, 0x9b, 0xa3, 0x03, 0x1d, + 0x6e, 0xb4, 0x44, 0x86, 0xa6, 0x27, 0x73, 0x32, 0x65, 0xf5, 0xc8, 0x8f, 0xb5, 0x9e, 0x91, 0x95, + 0xe9, 0xe3, 0x79, 0x59, 0x99, 0x06, 0xce, 0xc5, 0xf4, 0x86, 0xca, 0x91, 0x35, 0x91, 0xbf, 0x94, + 0x78, 0x06, 0xac, 0xbe, 0x99, 0xb1, 0xde, 0x50, 0x99, 0xb1, 0x7a, 0xc4, 0x8c, 0xe3, 0x79, 0xaf, + 0xfa, 0xe6, 0xc3, 0xd2, 0x72, 0x5a, 0x4d, 0x9d, 0x4c, 0x4e, 0x2b, 0xe3, 0xaa, 0xe1, 0x69, 0x95, + 0x9e, 0xe9, 0x73, 0xd5, 0x18, 0x74, 0x7b, 0x5f, 0x36, 0x3c, 0x7f, 0xd7, 0xcc, 0x03, 0xe5, 0xef, + 0xba, 0xab, 0xe7, 0xc3, 0x42, 0x7d, 0x12, 0x3e, 0x51, 0xa4, 0x01, 0xb3, 0x60, 0xdd, 0xd5, 0x2f, + 0xc0, 0x33, 0xf9, 0x74, 0xd5, 0x3d, 0xd7, 0x4d, 0x37, 0xf3, 0x0a, 0xec, 0xca, 0xae, 0x75, 0xf6, + 0x74, 0xb2, 0x6b, 0x9d, 0x3b, 0xf1, 0xec, 0x5a, 0x8f, 0x9c, 0x42, 0x76, 0xad, 0x47, 0x3f, 0xd4, + 0xec, 0x5a, 0xb3, 0x0f, 0x21, 0xbb, 0xd6, 0x5a, 0x92, 0x5d, 0xeb, 0x7c, 0xfe, 0x94, 0x64, 0x58, + 0xe6, 0xe6, 0xe4, 0xd4, 0xba, 0xcb, 0x9e, 0xe7, 0x79, 0xcc, 0x0a, 0x11, 0xd4, 0x2e, 0x3b, 0x93, + 0x70, 0x56, 0x60, 0x0b, 0x3e, 0x25, 0x0a, 0x84, 0x13, 0x52, 0x94, 0x6e, 0x92, 0x63, 0xeb, 0xb1, + 0x1e, 0x0a, 0xd9, 0x2c, 0x55, 0x57, 0x7e, 0x66, 0x2d, 0xfb, 0xaf, 0x17, 0xe0, 0x62, 0xef, 0x75, + 0x9d, 0xe8, 0xc9, 0xea, 0xc9, 0xbb, 0x4e, 0x4a, 0x4f, 0xc6, 0x85, 0x9c, 0x04, 0x6b, 0xe0, 0xc0, + 0x3e, 0xd7, 0x61, 0x46, 0x99, 0xe4, 0x7a, 0x6e, 0x73, 0x5f, 0xcb, 0x30, 0xac, 0x5c, 0x0f, 0x1b, + 0x69, 0x04, 0xdc, 0x5d, 0x07, 0x2d, 0xc0, 0x94, 0x51, 0x58, 0xab, 0x0a, 0x61, 0x46, 0x29, 0xe6, + 0x1a, 0x26, 0x18, 0xa7, 0xf1, 0xed, 0x9f, 0xb6, 0xe0, 0xd1, 0x9c, 0xc4, 0x13, 0x03, 0xc7, 0xad, + 0xd9, 0x84, 0xa9, 0xb6, 0x59, 0xb5, 0x4f, 0x78, 0x2b, 0x23, 0xbd, 0x85, 0xea, 0x6b, 0x0a, 0x80, + 0xd3, 0x44, 0x17, 0xaf, 0xfc, 0xe6, 0xef, 0x5d, 0xfc, 0xd8, 0x6f, 0xfd, 0xde, 0xc5, 0x8f, 0xfd, + 0xf6, 0xef, 0x5d, 0xfc, 0xd8, 0x5f, 0x3e, 0xbc, 0x68, 0xfd, 0xe6, 0xe1, 0x45, 0xeb, 0xb7, 0x0e, + 0x2f, 0x5a, 0xbf, 0x7d, 0x78, 0xd1, 0xfa, 0xdd, 0xc3, 0x8b, 0xd6, 0x57, 0x7f, 0xff, 0xe2, 0xc7, + 0xde, 0x2e, 0xec, 0x3d, 0xff, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0x84, 0x97, 0x9c, 0xb4, 0x50, + 0xe8, 0x00, 0x00, } diff --git a/vendor/k8s.io/api/core/v1/generated.proto b/vendor/k8s.io/api/core/v1/generated.proto index c76482ff..165aa2a2 100644 --- a/vendor/k8s.io/api/core/v1/generated.proto +++ b/vendor/k8s.io/api/core/v1/generated.proto @@ -641,7 +641,7 @@ message Container { repeated VolumeMount volumeMounts = 9; // volumeDevices is the list of block devices to be used by the container. - // This is an alpha feature and may change in the future. + // This is a beta feature. // +patchMergeKey=devicePath // +patchStrategy=merge // +optional @@ -1373,6 +1373,30 @@ message GitRepoVolumeSource { optional string directory = 3; } +// Represents a Glusterfs mount that lasts the lifetime of a pod. +// Glusterfs volumes do not support ownership management or SELinux relabeling. +message GlusterfsPersistentVolumeSource { + // EndpointsName is the endpoint name that details Glusterfs topology. + // More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod + optional string endpoints = 1; + + // Path is the Glusterfs volume path. + // More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod + optional string path = 2; + + // ReadOnly here will force the Glusterfs volume to be mounted with read-only permissions. + // Defaults to false. + // More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod + // +optional + optional bool readOnly = 3; + + // EndpointsNamespace is the namespace that contains Glusterfs endpoint. + // If this field is empty, the EndpointNamespace defaults to the same namespace as the bound PVC. + // More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod + // +optional + optional string endpointsNamespace = 4; +} + // Represents a Glusterfs mount that lasts the lifetime of a pod. // Glusterfs volumes do not support ownership management or SELinux relabeling. message GlusterfsVolumeSource { @@ -2296,7 +2320,7 @@ message PersistentVolumeClaimSpec { // volumeMode defines what type of volume is required by the claim. // Value of Filesystem is implied when not included in claim spec. - // This is an alpha feature and may change in the future. + // This is a beta feature. // +optional optional string volumeMode = 6; @@ -2389,7 +2413,7 @@ message PersistentVolumeSource { // exposed to the pod. Provisioned by an admin. // More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md // +optional - optional GlusterfsVolumeSource glusterfs = 4; + optional GlusterfsPersistentVolumeSource glusterfs = 4; // NFS represents an NFS mount on the host. Provisioned by an admin. // More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs @@ -2512,7 +2536,7 @@ message PersistentVolumeSpec { // volumeMode defines if a volume is intended to be used with a formatted filesystem // or to remain in raw block state. Value of Filesystem is implied when not included in spec. - // This is an alpha feature and may change in the future. + // This is a beta feature. // +optional optional string volumeMode = 8; diff --git a/vendor/k8s.io/api/core/v1/types.go b/vendor/k8s.io/api/core/v1/types.go index 67c67f84..43e70b9b 100644 --- a/vendor/k8s.io/api/core/v1/types.go +++ b/vendor/k8s.io/api/core/v1/types.go @@ -191,7 +191,7 @@ type PersistentVolumeSource struct { // exposed to the pod. Provisioned by an admin. // More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md // +optional - Glusterfs *GlusterfsVolumeSource `json:"glusterfs,omitempty" protobuf:"bytes,4,opt,name=glusterfs"` + Glusterfs *GlusterfsPersistentVolumeSource `json:"glusterfs,omitempty" protobuf:"bytes,4,opt,name=glusterfs"` // NFS represents an NFS mount on the host. Provisioned by an admin. // More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs // +optional @@ -326,7 +326,7 @@ type PersistentVolumeSpec struct { MountOptions []string `json:"mountOptions,omitempty" protobuf:"bytes,7,opt,name=mountOptions"` // volumeMode defines if a volume is intended to be used with a formatted filesystem // or to remain in raw block state. Value of Filesystem is implied when not included in spec. - // This is an alpha feature and may change in the future. + // This is a beta feature. // +optional VolumeMode *PersistentVolumeMode `json:"volumeMode,omitempty" protobuf:"bytes,8,opt,name=volumeMode,casttype=PersistentVolumeMode"` // NodeAffinity defines constraints that limit what nodes this volume can be accessed from. @@ -455,7 +455,7 @@ type PersistentVolumeClaimSpec struct { StorageClassName *string `json:"storageClassName,omitempty" protobuf:"bytes,5,opt,name=storageClassName"` // volumeMode defines what type of volume is required by the claim. // Value of Filesystem is implied when not included in claim spec. - // This is an alpha feature and may change in the future. + // This is a beta feature. // +optional VolumeMode *PersistentVolumeMode `json:"volumeMode,omitempty" protobuf:"bytes,6,opt,name=volumeMode,casttype=PersistentVolumeMode"` // This field requires the VolumeSnapshotDataSource alpha feature gate to be @@ -636,6 +636,30 @@ type GlusterfsVolumeSource struct { ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,3,opt,name=readOnly"` } +// Represents a Glusterfs mount that lasts the lifetime of a pod. +// Glusterfs volumes do not support ownership management or SELinux relabeling. +type GlusterfsPersistentVolumeSource struct { + // EndpointsName is the endpoint name that details Glusterfs topology. + // More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod + EndpointsName string `json:"endpoints" protobuf:"bytes,1,opt,name=endpoints"` + + // Path is the Glusterfs volume path. + // More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod + Path string `json:"path" protobuf:"bytes,2,opt,name=path"` + + // ReadOnly here will force the Glusterfs volume to be mounted with read-only permissions. + // Defaults to false. + // More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod + // +optional + ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,3,opt,name=readOnly"` + + // EndpointsNamespace is the namespace that contains Glusterfs endpoint. + // If this field is empty, the EndpointNamespace defaults to the same namespace as the bound PVC. + // More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod + // +optional + EndpointsNamespace *string `json:"endpointsNamespace,omitempty" protobuf:"bytes,4,opt,name=endpointsNamespace"` +} + // Represents a Rados Block Device mount that lasts the lifetime of a pod. // RBD volumes support ownership management and SELinux relabeling. type RBDVolumeSource struct { @@ -2090,7 +2114,7 @@ type Container struct { // +patchStrategy=merge VolumeMounts []VolumeMount `json:"volumeMounts,omitempty" patchStrategy:"merge" patchMergeKey:"mountPath" protobuf:"bytes,9,rep,name=volumeMounts"` // volumeDevices is the list of block devices to be used by the container. - // This is an alpha feature and may change in the future. + // This is a beta feature. // +patchMergeKey=devicePath // +patchStrategy=merge // +optional diff --git a/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go b/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go index ba95e388..71f90685 100644 --- a/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go @@ -321,7 +321,7 @@ var map_Container = map[string]string{ "env": "List of environment variables to set in the container. Cannot be updated.", "resources": "Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/", "volumeMounts": "Pod volumes to mount into the container's filesystem. Cannot be updated.", - "volumeDevices": "volumeDevices is the list of block devices to be used by the container. This is an alpha feature and may change in the future.", + "volumeDevices": "volumeDevices is the list of block devices to be used by the container. This is a beta feature.", "livenessProbe": "Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", "readinessProbe": "Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", "lifecycle": "Actions that the management system should take in response to container lifecycle events. Cannot be updated.", @@ -695,6 +695,18 @@ func (GitRepoVolumeSource) SwaggerDoc() map[string]string { return map_GitRepoVolumeSource } +var map_GlusterfsPersistentVolumeSource = map[string]string{ + "": "Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs volumes do not support ownership management or SELinux relabeling.", + "endpoints": "EndpointsName is the endpoint name that details Glusterfs topology. More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod", + "path": "Path is the Glusterfs volume path. More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod", + "readOnly": "ReadOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod", + "endpointsNamespace": "EndpointsNamespace is the namespace that contains Glusterfs endpoint. If this field is empty, the EndpointNamespace defaults to the same namespace as the bound PVC. More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod", +} + +func (GlusterfsPersistentVolumeSource) SwaggerDoc() map[string]string { + return map_GlusterfsPersistentVolumeSource +} + var map_GlusterfsVolumeSource = map[string]string{ "": "Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs volumes do not support ownership management or SELinux relabeling.", "endpoints": "EndpointsName is the endpoint name that details Glusterfs topology. More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod", @@ -1210,7 +1222,7 @@ var map_PersistentVolumeClaimSpec = map[string]string{ "resources": "Resources represents the minimum resources the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources", "volumeName": "VolumeName is the binding reference to the PersistentVolume backing this claim.", "storageClassName": "Name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1", - "volumeMode": "volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec. This is an alpha feature and may change in the future.", + "volumeMode": "volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec. This is a beta feature.", "dataSource": "This field requires the VolumeSnapshotDataSource alpha feature gate to be enabled and currently VolumeSnapshot is the only supported data source. If the provisioner can support VolumeSnapshot data source, it will create a new volume and data will be restored to the volume at the same time. If the provisioner does not support VolumeSnapshot data source, volume will not be created and the failure will be reported as an event. In the future, we plan to support more data source types and the behavior of the provisioner may change.", } @@ -1288,7 +1300,7 @@ var map_PersistentVolumeSpec = map[string]string{ "persistentVolumeReclaimPolicy": "What happens to a persistent volume when released from its claim. Valid options are Retain (default for manually created PersistentVolumes), Delete (default for dynamically provisioned PersistentVolumes), and Recycle (deprecated). Recycle must be supported by the volume plugin underlying this PersistentVolume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#reclaiming", "storageClassName": "Name of StorageClass to which this persistent volume belongs. Empty value means that this volume does not belong to any StorageClass.", "mountOptions": "A list of mount options, e.g. [\"ro\", \"soft\"]. Not validated - mount will simply fail if one is invalid. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#mount-options", - "volumeMode": "volumeMode defines if a volume is intended to be used with a formatted filesystem or to remain in raw block state. Value of Filesystem is implied when not included in spec. This is an alpha feature and may change in the future.", + "volumeMode": "volumeMode defines if a volume is intended to be used with a formatted filesystem or to remain in raw block state. Value of Filesystem is implied when not included in spec. This is a beta feature.", "nodeAffinity": "NodeAffinity defines constraints that limit what nodes this volume can be accessed from. This field influences the scheduling of pods that use this volume.", } diff --git a/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go b/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go index 42a5ca07..4219c95e 100644 --- a/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go @@ -1498,6 +1498,27 @@ func (in *GitRepoVolumeSource) DeepCopy() *GitRepoVolumeSource { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GlusterfsPersistentVolumeSource) DeepCopyInto(out *GlusterfsPersistentVolumeSource) { + *out = *in + if in.EndpointsNamespace != nil { + in, out := &in.EndpointsNamespace, &out.EndpointsNamespace + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlusterfsPersistentVolumeSource. +func (in *GlusterfsPersistentVolumeSource) DeepCopy() *GlusterfsPersistentVolumeSource { + if in == nil { + return nil + } + out := new(GlusterfsPersistentVolumeSource) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GlusterfsVolumeSource) DeepCopyInto(out *GlusterfsVolumeSource) { *out = *in @@ -2806,8 +2827,8 @@ func (in *PersistentVolumeSource) DeepCopyInto(out *PersistentVolumeSource) { } if in.Glusterfs != nil { in, out := &in.Glusterfs, &out.Glusterfs - *out = new(GlusterfsVolumeSource) - **out = **in + *out = new(GlusterfsPersistentVolumeSource) + (*in).DeepCopyInto(*out) } if in.NFS != nil { in, out := &in.NFS, &out.NFS diff --git a/vendor/k8s.io/api/storage/v1/generated.pb.go b/vendor/k8s.io/api/storage/v1/generated.pb.go index 9ad0a015..e4b29311 100644 --- a/vendor/k8s.io/api/storage/v1/generated.pb.go +++ b/vendor/k8s.io/api/storage/v1/generated.pb.go @@ -26,6 +26,12 @@ limitations under the License. It has these top-level messages: StorageClass StorageClassList + VolumeAttachment + VolumeAttachmentList + VolumeAttachmentSource + VolumeAttachmentSpec + VolumeAttachmentStatus + VolumeError */ package v1 @@ -61,9 +67,39 @@ func (m *StorageClassList) Reset() { *m = StorageClassList{} func (*StorageClassList) ProtoMessage() {} func (*StorageClassList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{1} } +func (m *VolumeAttachment) Reset() { *m = VolumeAttachment{} } +func (*VolumeAttachment) ProtoMessage() {} +func (*VolumeAttachment) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{2} } + +func (m *VolumeAttachmentList) Reset() { *m = VolumeAttachmentList{} } +func (*VolumeAttachmentList) ProtoMessage() {} +func (*VolumeAttachmentList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{3} } + +func (m *VolumeAttachmentSource) Reset() { *m = VolumeAttachmentSource{} } +func (*VolumeAttachmentSource) ProtoMessage() {} +func (*VolumeAttachmentSource) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{4} } + +func (m *VolumeAttachmentSpec) Reset() { *m = VolumeAttachmentSpec{} } +func (*VolumeAttachmentSpec) ProtoMessage() {} +func (*VolumeAttachmentSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{5} } + +func (m *VolumeAttachmentStatus) Reset() { *m = VolumeAttachmentStatus{} } +func (*VolumeAttachmentStatus) ProtoMessage() {} +func (*VolumeAttachmentStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{6} } + +func (m *VolumeError) Reset() { *m = VolumeError{} } +func (*VolumeError) ProtoMessage() {} +func (*VolumeError) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{7} } + func init() { proto.RegisterType((*StorageClass)(nil), "k8s.io.api.storage.v1.StorageClass") proto.RegisterType((*StorageClassList)(nil), "k8s.io.api.storage.v1.StorageClassList") + proto.RegisterType((*VolumeAttachment)(nil), "k8s.io.api.storage.v1.VolumeAttachment") + proto.RegisterType((*VolumeAttachmentList)(nil), "k8s.io.api.storage.v1.VolumeAttachmentList") + proto.RegisterType((*VolumeAttachmentSource)(nil), "k8s.io.api.storage.v1.VolumeAttachmentSource") + proto.RegisterType((*VolumeAttachmentSpec)(nil), "k8s.io.api.storage.v1.VolumeAttachmentSpec") + proto.RegisterType((*VolumeAttachmentStatus)(nil), "k8s.io.api.storage.v1.VolumeAttachmentStatus") + proto.RegisterType((*VolumeError)(nil), "k8s.io.api.storage.v1.VolumeError") } func (m *StorageClass) Marshal() (dAtA []byte, err error) { size := m.Size() @@ -204,6 +240,242 @@ func (m *StorageClassList) MarshalTo(dAtA []byte) (int, error) { return i, nil } +func (m *VolumeAttachment) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *VolumeAttachment) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.ObjectMeta.Size())) + n3, err := m.ObjectMeta.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n3 + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.Spec.Size())) + n4, err := m.Spec.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n4 + dAtA[i] = 0x1a + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.Status.Size())) + n5, err := m.Status.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n5 + return i, nil +} + +func (m *VolumeAttachmentList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *VolumeAttachmentList) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.ListMeta.Size())) + n6, err := m.ListMeta.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n6 + if len(m.Items) > 0 { + for _, msg := range m.Items { + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + return i, nil +} + +func (m *VolumeAttachmentSource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *VolumeAttachmentSource) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.PersistentVolumeName != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.PersistentVolumeName))) + i += copy(dAtA[i:], *m.PersistentVolumeName) + } + return i, nil +} + +func (m *VolumeAttachmentSpec) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *VolumeAttachmentSpec) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Attacher))) + i += copy(dAtA[i:], m.Attacher) + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.Source.Size())) + n7, err := m.Source.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n7 + dAtA[i] = 0x1a + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.NodeName))) + i += copy(dAtA[i:], m.NodeName) + return i, nil +} + +func (m *VolumeAttachmentStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *VolumeAttachmentStatus) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0x8 + i++ + if m.Attached { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + if len(m.AttachmentMetadata) > 0 { + keysForAttachmentMetadata := make([]string, 0, len(m.AttachmentMetadata)) + for k := range m.AttachmentMetadata { + keysForAttachmentMetadata = append(keysForAttachmentMetadata, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAttachmentMetadata) + for _, k := range keysForAttachmentMetadata { + dAtA[i] = 0x12 + i++ + v := m.AttachmentMetadata[string(k)] + mapSize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + i = encodeVarintGenerated(dAtA, i, uint64(mapSize)) + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(k))) + i += copy(dAtA[i:], k) + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i += copy(dAtA[i:], v) + } + } + if m.AttachError != nil { + dAtA[i] = 0x1a + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.AttachError.Size())) + n8, err := m.AttachError.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n8 + } + if m.DetachError != nil { + dAtA[i] = 0x22 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.DetachError.Size())) + n9, err := m.DetachError.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n9 + } + return i, nil +} + +func (m *VolumeError) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *VolumeError) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.Time.Size())) + n10, err := m.Time.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n10 + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Message))) + i += copy(dAtA[i:], m.Message) + return i, nil +} + func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) @@ -268,6 +540,87 @@ func (m *StorageClassList) Size() (n int) { return n } +func (m *VolumeAttachment) Size() (n int) { + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *VolumeAttachmentList) Size() (n int) { + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *VolumeAttachmentSource) Size() (n int) { + var l int + _ = l + if m.PersistentVolumeName != nil { + l = len(*m.PersistentVolumeName) + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *VolumeAttachmentSpec) Size() (n int) { + var l int + _ = l + l = len(m.Attacher) + n += 1 + l + sovGenerated(uint64(l)) + l = m.Source.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.NodeName) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *VolumeAttachmentStatus) Size() (n int) { + var l int + _ = l + n += 2 + if len(m.AttachmentMetadata) > 0 { + for k, v := range m.AttachmentMetadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.AttachError != nil { + l = m.AttachError.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.DetachError != nil { + l = m.DetachError.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *VolumeError) Size() (n int) { + var l int + _ = l + l = m.Time.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Message) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + func sovGenerated(x uint64) (n int) { for { n++ @@ -319,6 +672,85 @@ func (this *StorageClassList) String() string { }, "") return s } +func (this *VolumeAttachment) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&VolumeAttachment{`, + `ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "VolumeAttachmentSpec", "VolumeAttachmentSpec", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "VolumeAttachmentStatus", "VolumeAttachmentStatus", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *VolumeAttachmentList) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&VolumeAttachmentList{`, + `ListMeta:` + strings.Replace(strings.Replace(this.ListMeta.String(), "ListMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Items), "VolumeAttachment", "VolumeAttachment", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *VolumeAttachmentSource) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&VolumeAttachmentSource{`, + `PersistentVolumeName:` + valueToStringGenerated(this.PersistentVolumeName) + `,`, + `}`, + }, "") + return s +} +func (this *VolumeAttachmentSpec) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&VolumeAttachmentSpec{`, + `Attacher:` + fmt.Sprintf("%v", this.Attacher) + `,`, + `Source:` + strings.Replace(strings.Replace(this.Source.String(), "VolumeAttachmentSource", "VolumeAttachmentSource", 1), `&`, ``, 1) + `,`, + `NodeName:` + fmt.Sprintf("%v", this.NodeName) + `,`, + `}`, + }, "") + return s +} +func (this *VolumeAttachmentStatus) String() string { + if this == nil { + return "nil" + } + keysForAttachmentMetadata := make([]string, 0, len(this.AttachmentMetadata)) + for k := range this.AttachmentMetadata { + keysForAttachmentMetadata = append(keysForAttachmentMetadata, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAttachmentMetadata) + mapStringForAttachmentMetadata := "map[string]string{" + for _, k := range keysForAttachmentMetadata { + mapStringForAttachmentMetadata += fmt.Sprintf("%v: %v,", k, this.AttachmentMetadata[k]) + } + mapStringForAttachmentMetadata += "}" + s := strings.Join([]string{`&VolumeAttachmentStatus{`, + `Attached:` + fmt.Sprintf("%v", this.Attached) + `,`, + `AttachmentMetadata:` + mapStringForAttachmentMetadata + `,`, + `AttachError:` + strings.Replace(fmt.Sprintf("%v", this.AttachError), "VolumeError", "VolumeError", 1) + `,`, + `DetachError:` + strings.Replace(fmt.Sprintf("%v", this.DetachError), "VolumeError", "VolumeError", 1) + `,`, + `}`, + }, "") + return s +} +func (this *VolumeError) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&VolumeError{`, + `Time:` + strings.Replace(strings.Replace(this.Time.String(), "Time", "k8s_io_apimachinery_pkg_apis_meta_v1.Time", 1), `&`, ``, 1) + `,`, + `Message:` + fmt.Sprintf("%v", this.Message) + `,`, + `}`, + }, "") + return s +} func valueToStringGenerated(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { @@ -806,6 +1238,838 @@ func (m *StorageClassList) Unmarshal(dAtA []byte) error { } return nil } +func (m *VolumeAttachment) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: VolumeAttachment: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VolumeAttachment: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *VolumeAttachmentList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: VolumeAttachmentList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VolumeAttachmentList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, VolumeAttachment{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *VolumeAttachmentSource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: VolumeAttachmentSource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VolumeAttachmentSource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PersistentVolumeName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.PersistentVolumeName = &s + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *VolumeAttachmentSpec) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: VolumeAttachmentSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VolumeAttachmentSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Attacher", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Attacher = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Source.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NodeName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *VolumeAttachmentStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: VolumeAttachmentStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VolumeAttachmentStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Attached", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Attached = bool(v != 0) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AttachmentMetadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AttachmentMetadata == nil { + m.AttachmentMetadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.AttachmentMetadata[mapkey] = mapvalue + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AttachError", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AttachError == nil { + m.AttachError = &VolumeError{} + } + if err := m.AttachError.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DetachError", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DetachError == nil { + m.DetachError = &VolumeError{} + } + if err := m.DetachError.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *VolumeError) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: VolumeError: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VolumeError: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Time.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipGenerated(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 @@ -916,46 +2180,67 @@ func init() { } var fileDescriptorGenerated = []byte{ - // 656 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xcd, 0x6e, 0xd3, 0x4a, - 0x14, 0x8e, 0x93, 0x9b, 0xde, 0x74, 0xd2, 0xea, 0x26, 0xbe, 0xbd, 0x92, 0x6f, 0x16, 0x4e, 0x54, - 0x36, 0x11, 0x12, 0xe3, 0xa6, 0x14, 0x54, 0x21, 0x81, 0x54, 0xa3, 0x4a, 0x20, 0xb5, 0x6a, 0xe4, - 0x56, 0x15, 0x42, 0x2c, 0x98, 0x38, 0x07, 0x77, 0x88, 0xed, 0x31, 0x33, 0x63, 0x43, 0x76, 0xbc, - 0x00, 0x12, 0xcf, 0xc3, 0x13, 0x74, 0xd9, 0x65, 0x57, 0x16, 0x35, 0x6f, 0xd1, 0x15, 0xf2, 0x0f, - 0x8d, 0x9b, 0x04, 0xd1, 0xdd, 0xcc, 0x77, 0xbe, 0xef, 0x3b, 0x33, 0xe7, 0x07, 0x3d, 0x9b, 0xec, - 0x0a, 0x4c, 0x99, 0x31, 0x09, 0x47, 0xc0, 0x7d, 0x90, 0x20, 0x8c, 0x08, 0xfc, 0x31, 0xe3, 0x46, - 0x11, 0x20, 0x01, 0x35, 0x84, 0x64, 0x9c, 0x38, 0x60, 0x44, 0x03, 0xc3, 0x01, 0x1f, 0x38, 0x91, - 0x30, 0xc6, 0x01, 0x67, 0x92, 0xa9, 0xff, 0xe5, 0x34, 0x4c, 0x02, 0x8a, 0x0b, 0x1a, 0x8e, 0x06, - 0x9d, 0x07, 0x0e, 0x95, 0x67, 0xe1, 0x08, 0xdb, 0xcc, 0x33, 0x1c, 0xe6, 0x30, 0x23, 0x63, 0x8f, - 0xc2, 0x77, 0xd9, 0x2d, 0xbb, 0x64, 0xa7, 0xdc, 0xa5, 0xb3, 0x59, 0x4a, 0x66, 0x33, 0xbe, 0x2c, - 0x53, 0x67, 0x67, 0xc6, 0xf1, 0x88, 0x7d, 0x46, 0x7d, 0xe0, 0x53, 0x23, 0x98, 0x38, 0x29, 0x20, - 0x0c, 0x0f, 0x24, 0x59, 0xa6, 0x32, 0x7e, 0xa7, 0xe2, 0xa1, 0x2f, 0xa9, 0x07, 0x0b, 0x82, 0xc7, - 0x7f, 0x12, 0x08, 0xfb, 0x0c, 0x3c, 0x32, 0xaf, 0xdb, 0xfc, 0xb2, 0x82, 0xd6, 0x8e, 0xf3, 0x02, - 0x3c, 0x77, 0x89, 0x10, 0xea, 0x5b, 0xd4, 0x48, 0x1f, 0x35, 0x26, 0x92, 0x68, 0x4a, 0x4f, 0xe9, - 0x37, 0xb7, 0xb7, 0xf0, 0xac, 0x58, 0x37, 0xde, 0x38, 0x98, 0x38, 0x29, 0x20, 0x70, 0xca, 0xc6, - 0xd1, 0x00, 0x1f, 0x8d, 0xde, 0x83, 0x2d, 0x0f, 0x41, 0x12, 0x53, 0x3d, 0x8f, 0xbb, 0x95, 0x24, - 0xee, 0xa2, 0x19, 0x66, 0xdd, 0xb8, 0xaa, 0x8f, 0x50, 0x33, 0xe0, 0x2c, 0xa2, 0x82, 0x32, 0x1f, - 0xb8, 0x56, 0xed, 0x29, 0xfd, 0x55, 0xf3, 0xdf, 0x42, 0xd2, 0x1c, 0xce, 0x42, 0x56, 0x99, 0xa7, - 0x3a, 0x08, 0x05, 0x84, 0x13, 0x0f, 0x24, 0x70, 0xa1, 0xd5, 0x7a, 0xb5, 0x7e, 0x73, 0xfb, 0x21, - 0x5e, 0xda, 0x47, 0x5c, 0xfe, 0x11, 0x1e, 0xde, 0xa8, 0xf6, 0x7d, 0xc9, 0xa7, 0xb3, 0xd7, 0xcd, - 0x02, 0x56, 0xc9, 0x5a, 0x9d, 0xa0, 0x75, 0x0e, 0xb6, 0x4b, 0xa8, 0x37, 0x64, 0x2e, 0xb5, 0xa7, - 0xda, 0x5f, 0xd9, 0x0b, 0xf7, 0x93, 0xb8, 0xbb, 0x6e, 0x95, 0x03, 0xd7, 0x71, 0x77, 0x6b, 0x71, - 0x02, 0xf0, 0x10, 0xb8, 0xa0, 0x42, 0x82, 0x2f, 0x4f, 0x99, 0x1b, 0x7a, 0x70, 0x4b, 0x63, 0xdd, - 0xf6, 0x56, 0x77, 0xd0, 0x9a, 0xc7, 0x42, 0x5f, 0x1e, 0x05, 0x92, 0x32, 0x5f, 0x68, 0xf5, 0x5e, - 0xad, 0xbf, 0x6a, 0xb6, 0x92, 0xb8, 0xbb, 0x76, 0x58, 0xc2, 0xad, 0x5b, 0x2c, 0xf5, 0x00, 0x6d, - 0x10, 0xd7, 0x65, 0x1f, 0xf3, 0x04, 0xfb, 0x9f, 0x02, 0xe2, 0xa7, 0x55, 0xd2, 0x56, 0x7a, 0x4a, - 0xbf, 0x61, 0x6a, 0x49, 0xdc, 0xdd, 0xd8, 0x5b, 0x12, 0xb7, 0x96, 0xaa, 0xd4, 0x57, 0xa8, 0x1d, - 0x65, 0x90, 0x49, 0xfd, 0x31, 0xf5, 0x9d, 0x43, 0x36, 0x06, 0xed, 0xef, 0xec, 0xd3, 0xf7, 0x93, - 0xb8, 0xdb, 0x3e, 0x9d, 0x0f, 0x5e, 0x2f, 0x03, 0xad, 0x45, 0x13, 0xf5, 0x03, 0x6a, 0x67, 0x19, - 0x61, 0x7c, 0xc2, 0x02, 0xe6, 0x32, 0x87, 0x82, 0xd0, 0x1a, 0x59, 0xeb, 0xfa, 0xe5, 0xd6, 0xa5, - 0xa5, 0x4b, 0xfb, 0x56, 0xb0, 0xa6, 0xc7, 0xe0, 0x82, 0x2d, 0x19, 0x3f, 0x01, 0xee, 0x99, 0xff, - 0x17, 0xfd, 0x6a, 0xef, 0xcd, 0x5b, 0x59, 0x8b, 0xee, 0x9d, 0xa7, 0xe8, 0x9f, 0xb9, 0x86, 0xab, - 0x2d, 0x54, 0x9b, 0xc0, 0x34, 0x9b, 0xe6, 0x55, 0x2b, 0x3d, 0xaa, 0x1b, 0xa8, 0x1e, 0x11, 0x37, - 0x84, 0x7c, 0xf8, 0xac, 0xfc, 0xf2, 0xa4, 0xba, 0xab, 0x6c, 0x7e, 0x53, 0x50, 0xab, 0x3c, 0x3d, - 0x07, 0x54, 0x48, 0xf5, 0xcd, 0xc2, 0x4e, 0xe0, 0xbb, 0xed, 0x44, 0xaa, 0xce, 0x36, 0xa2, 0x55, - 0xfc, 0xa1, 0xf1, 0x0b, 0x29, 0xed, 0xc3, 0x0b, 0x54, 0xa7, 0x12, 0x3c, 0xa1, 0x55, 0xb3, 0xc2, - 0xdc, 0xbb, 0xc3, 0x4c, 0x9b, 0xeb, 0x85, 0x5f, 0xfd, 0x65, 0xaa, 0xb4, 0x72, 0x03, 0xb3, 0x7f, - 0x7e, 0xa5, 0x57, 0x2e, 0xae, 0xf4, 0xca, 0xe5, 0x95, 0x5e, 0xf9, 0x9c, 0xe8, 0xca, 0x79, 0xa2, - 0x2b, 0x17, 0x89, 0xae, 0x5c, 0x26, 0xba, 0xf2, 0x3d, 0xd1, 0x95, 0xaf, 0x3f, 0xf4, 0xca, 0xeb, - 0x6a, 0x34, 0xf8, 0x19, 0x00, 0x00, 0xff, 0xff, 0x0d, 0x64, 0x41, 0x83, 0x40, 0x05, 0x00, 0x00, + // 984 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x3d, 0x6f, 0x23, 0x45, + 0x18, 0xce, 0xc6, 0xf9, 0x70, 0xc6, 0x09, 0x97, 0x0c, 0x01, 0x8c, 0x0b, 0x3b, 0x32, 0x05, 0xe6, + 0xe0, 0x76, 0x2f, 0xe1, 0x40, 0x27, 0x24, 0x90, 0xbc, 0x60, 0x09, 0xa4, 0xf8, 0x2e, 0x9a, 0x84, + 0x13, 0x42, 0x14, 0x4c, 0x76, 0xdf, 0xdb, 0x2c, 0xf6, 0xee, 0x2c, 0x33, 0x63, 0x43, 0x3a, 0x2a, + 0x3a, 0x24, 0x68, 0xf9, 0x29, 0x94, 0x54, 0xa1, 0xbb, 0xf2, 0x2a, 0x8b, 0x2c, 0x35, 0x7f, 0x20, + 0x15, 0x9a, 0xd9, 0x89, 0xbd, 0xb1, 0xd7, 0x9c, 0xd3, 0x5c, 0xe7, 0xf7, 0xe3, 0x79, 0xde, 0xef, + 0x59, 0xa3, 0x4f, 0x7a, 0x0f, 0x85, 0x1d, 0x32, 0xa7, 0x37, 0x38, 0x05, 0x1e, 0x83, 0x04, 0xe1, + 0x0c, 0x21, 0xf6, 0x19, 0x77, 0x8c, 0x81, 0x26, 0xa1, 0x23, 0x24, 0xe3, 0x34, 0x00, 0x67, 0xb8, + 0xef, 0x04, 0x10, 0x03, 0xa7, 0x12, 0x7c, 0x3b, 0xe1, 0x4c, 0x32, 0xfc, 0x5a, 0xe6, 0x66, 0xd3, + 0x24, 0xb4, 0x8d, 0x9b, 0x3d, 0xdc, 0xaf, 0xdd, 0x0b, 0x42, 0x79, 0x36, 0x38, 0xb5, 0x3d, 0x16, + 0x39, 0x01, 0x0b, 0x98, 0xa3, 0xbd, 0x4f, 0x07, 0x4f, 0xb5, 0xa4, 0x05, 0xfd, 0x2b, 0x63, 0xa9, + 0x35, 0x73, 0xc1, 0x3c, 0xc6, 0x8b, 0x22, 0xd5, 0x1e, 0x4c, 0x7c, 0x22, 0xea, 0x9d, 0x85, 0x31, + 0xf0, 0x73, 0x27, 0xe9, 0x05, 0x4a, 0x21, 0x9c, 0x08, 0x24, 0x2d, 0x42, 0x39, 0xf3, 0x50, 0x7c, + 0x10, 0xcb, 0x30, 0x82, 0x19, 0xc0, 0x87, 0x2f, 0x02, 0x08, 0xef, 0x0c, 0x22, 0x3a, 0x8d, 0x6b, + 0xfe, 0xb2, 0x86, 0x36, 0x8f, 0xb3, 0x06, 0x7c, 0xda, 0xa7, 0x42, 0xe0, 0x6f, 0x51, 0x59, 0x25, + 0xe5, 0x53, 0x49, 0xab, 0xd6, 0x9e, 0xd5, 0xaa, 0x1c, 0xdc, 0xb7, 0x27, 0xcd, 0x1a, 0x73, 0xdb, + 0x49, 0x2f, 0x50, 0x0a, 0x61, 0x2b, 0x6f, 0x7b, 0xb8, 0x6f, 0x3f, 0x3e, 0xfd, 0x0e, 0x3c, 0xd9, + 0x05, 0x49, 0x5d, 0x7c, 0x31, 0x6a, 0x2c, 0xa5, 0xa3, 0x06, 0x9a, 0xe8, 0xc8, 0x98, 0x15, 0x7f, + 0x80, 0x2a, 0x09, 0x67, 0xc3, 0x50, 0x84, 0x2c, 0x06, 0x5e, 0x5d, 0xde, 0xb3, 0x5a, 0x1b, 0xee, + 0xab, 0x06, 0x52, 0x39, 0x9a, 0x98, 0x48, 0xde, 0x0f, 0x07, 0x08, 0x25, 0x94, 0xd3, 0x08, 0x24, + 0x70, 0x51, 0x2d, 0xed, 0x95, 0x5a, 0x95, 0x83, 0xf7, 0xed, 0xc2, 0x39, 0xda, 0xf9, 0x8a, 0xec, + 0xa3, 0x31, 0xaa, 0x13, 0x4b, 0x7e, 0x3e, 0xc9, 0x6e, 0x62, 0x20, 0x39, 0x6a, 0xdc, 0x43, 0x5b, + 0x1c, 0xbc, 0x3e, 0x0d, 0xa3, 0x23, 0xd6, 0x0f, 0xbd, 0xf3, 0xea, 0x8a, 0xce, 0xb0, 0x93, 0x8e, + 0x1a, 0x5b, 0x24, 0x6f, 0xb8, 0x1a, 0x35, 0xee, 0xcf, 0x6e, 0x80, 0x7d, 0x04, 0x5c, 0x84, 0x42, + 0x42, 0x2c, 0x9f, 0xb0, 0xfe, 0x20, 0x82, 0x1b, 0x18, 0x72, 0x93, 0x1b, 0x3f, 0x40, 0x9b, 0x11, + 0x1b, 0xc4, 0xf2, 0x71, 0x22, 0x43, 0x16, 0x8b, 0xea, 0xea, 0x5e, 0xa9, 0xb5, 0xe1, 0x6e, 0xa7, + 0xa3, 0xc6, 0x66, 0x37, 0xa7, 0x27, 0x37, 0xbc, 0xf0, 0x21, 0xda, 0xa5, 0xfd, 0x3e, 0xfb, 0x21, + 0x0b, 0xd0, 0xf9, 0x31, 0xa1, 0xb1, 0xea, 0x52, 0x75, 0x6d, 0xcf, 0x6a, 0x95, 0xdd, 0x6a, 0x3a, + 0x6a, 0xec, 0xb6, 0x0b, 0xec, 0xa4, 0x10, 0x85, 0xbf, 0x42, 0x3b, 0x43, 0xad, 0x72, 0xc3, 0xd8, + 0x0f, 0xe3, 0xa0, 0xcb, 0x7c, 0xa8, 0xae, 0xeb, 0xa2, 0xef, 0xa6, 0xa3, 0xc6, 0xce, 0x93, 0x69, + 0xe3, 0x55, 0x91, 0x92, 0xcc, 0x92, 0xe0, 0xef, 0xd1, 0x8e, 0x8e, 0x08, 0xfe, 0x09, 0x4b, 0x58, + 0x9f, 0x05, 0x21, 0x88, 0x6a, 0x59, 0x8f, 0xae, 0x95, 0x1f, 0x9d, 0x6a, 0x9d, 0x9a, 0x9b, 0xf1, + 0x3a, 0x3f, 0x86, 0x3e, 0x78, 0x92, 0xf1, 0x13, 0xe0, 0x91, 0xfb, 0xa6, 0x99, 0xd7, 0x4e, 0x7b, + 0x9a, 0x8a, 0xcc, 0xb2, 0xd7, 0x3e, 0x46, 0x77, 0xa6, 0x06, 0x8e, 0xb7, 0x51, 0xa9, 0x07, 0xe7, + 0x7a, 0x9b, 0x37, 0x88, 0xfa, 0x89, 0x77, 0xd1, 0xea, 0x90, 0xf6, 0x07, 0x90, 0x2d, 0x1f, 0xc9, + 0x84, 0x8f, 0x96, 0x1f, 0x5a, 0xcd, 0x3f, 0x2c, 0xb4, 0x9d, 0xdf, 0x9e, 0xc3, 0x50, 0x48, 0xfc, + 0xcd, 0xcc, 0x4d, 0xd8, 0x8b, 0xdd, 0x84, 0x42, 0xeb, 0x8b, 0xd8, 0x36, 0x35, 0x94, 0xaf, 0x35, + 0xb9, 0x7b, 0xf8, 0x1c, 0xad, 0x86, 0x12, 0x22, 0x51, 0x5d, 0xd6, 0x8d, 0x79, 0x6b, 0x81, 0x9d, + 0x76, 0xb7, 0x0c, 0xdf, 0xea, 0x17, 0x0a, 0x49, 0x32, 0x82, 0xe6, 0xef, 0xcb, 0x68, 0x3b, 0x9b, + 0x4b, 0x5b, 0x4a, 0xea, 0x9d, 0x45, 0x10, 0xcb, 0x97, 0x70, 0xd0, 0x5d, 0xb4, 0x22, 0x12, 0xf0, + 0x74, 0x33, 0x2b, 0x07, 0xef, 0xce, 0xc9, 0x7f, 0x3a, 0xb1, 0xe3, 0x04, 0x3c, 0x77, 0xd3, 0x10, + 0xaf, 0x28, 0x89, 0x68, 0x1a, 0xfc, 0x25, 0x5a, 0x13, 0x92, 0xca, 0x81, 0x3a, 0x72, 0x45, 0x78, + 0x6f, 0x51, 0x42, 0x0d, 0x72, 0x5f, 0x31, 0x94, 0x6b, 0x99, 0x4c, 0x0c, 0x59, 0xf3, 0x4f, 0x0b, + 0xed, 0x4e, 0x43, 0x5e, 0xc2, 0x74, 0x0f, 0x6f, 0x4e, 0xf7, 0xed, 0x05, 0x8b, 0x99, 0x33, 0xe1, + 0xa7, 0xe8, 0xf5, 0x99, 0xb2, 0xd9, 0x80, 0x7b, 0xa0, 0x9e, 0x84, 0x64, 0xea, 0xe1, 0x79, 0x44, + 0x23, 0xc8, 0xb6, 0x3e, 0x7b, 0x12, 0x8e, 0x0a, 0xec, 0xa4, 0x10, 0xd5, 0xfc, 0xab, 0xa0, 0x59, + 0x6a, 0x44, 0xf8, 0x3d, 0x54, 0xa6, 0x5a, 0x03, 0xdc, 0x50, 0x8f, 0x8b, 0x6f, 0x1b, 0x3d, 0x19, + 0x7b, 0xe8, 0x51, 0xea, 0xf4, 0xcc, 0x6e, 0x2c, 0x3c, 0x4a, 0x0d, 0xca, 0x8d, 0x52, 0xcb, 0xc4, + 0x90, 0xa9, 0x24, 0x62, 0xe6, 0x67, 0xf5, 0x95, 0x6e, 0x26, 0xf1, 0xc8, 0xe8, 0xc9, 0xd8, 0xa3, + 0xf9, 0x6f, 0xa9, 0xa0, 0x69, 0x7a, 0x27, 0x72, 0xd5, 0xf8, 0xba, 0x9a, 0xf2, 0x4c, 0x35, 0xfe, + 0xb8, 0x1a, 0x1f, 0xff, 0x66, 0x21, 0x4c, 0xc7, 0x14, 0xdd, 0xeb, 0x9d, 0xc9, 0x06, 0xdb, 0xb9, + 0xd5, 0x96, 0xda, 0xed, 0x19, 0x9e, 0xec, 0xe3, 0x54, 0x33, 0xf1, 0xf1, 0xac, 0x03, 0x29, 0x08, + 0x8e, 0x7d, 0x54, 0xc9, 0xb4, 0x1d, 0xce, 0x19, 0x37, 0x17, 0xd3, 0xfc, 0xdf, 0x5c, 0xb4, 0xa7, + 0x5b, 0x57, 0x1f, 0xdb, 0xf6, 0x04, 0x7a, 0x35, 0x6a, 0x54, 0x72, 0x76, 0x92, 0xa7, 0x55, 0x51, + 0x7c, 0x98, 0x44, 0x59, 0xb9, 0x5d, 0x94, 0xcf, 0x60, 0x7e, 0x94, 0x1c, 0x6d, 0xad, 0x83, 0xde, + 0x98, 0xd3, 0x96, 0x5b, 0x3d, 0xe1, 0x3f, 0x5b, 0x28, 0x1f, 0x03, 0x1f, 0xa2, 0x15, 0xf5, 0x0f, + 0xc8, 0xdc, 0xf6, 0xdd, 0xc5, 0x6e, 0xfb, 0x24, 0x8c, 0x60, 0xf2, 0x3a, 0x29, 0x89, 0x68, 0x16, + 0xfc, 0x0e, 0x5a, 0x8f, 0x40, 0x08, 0x1a, 0x98, 0xc8, 0xee, 0x1d, 0xe3, 0xb4, 0xde, 0xcd, 0xd4, + 0xe4, 0xda, 0xee, 0xb6, 0x2e, 0x2e, 0xeb, 0x4b, 0xcf, 0x2e, 0xeb, 0x4b, 0xcf, 0x2f, 0xeb, 0x4b, + 0x3f, 0xa5, 0x75, 0xeb, 0x22, 0xad, 0x5b, 0xcf, 0xd2, 0xba, 0xf5, 0x3c, 0xad, 0x5b, 0x7f, 0xa7, + 0x75, 0xeb, 0xd7, 0x7f, 0xea, 0x4b, 0x5f, 0x2f, 0x0f, 0xf7, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, + 0x85, 0x2a, 0x88, 0xc0, 0xcf, 0x0a, 0x00, 0x00, } diff --git a/vendor/k8s.io/api/storage/v1/generated.proto b/vendor/k8s.io/api/storage/v1/generated.proto index 1b8102c0..668c8544 100644 --- a/vendor/k8s.io/api/storage/v1/generated.proto +++ b/vendor/k8s.io/api/storage/v1/generated.proto @@ -88,3 +88,99 @@ message StorageClassList { repeated StorageClass items = 2; } +// VolumeAttachment captures the intent to attach or detach the specified volume +// to/from the specified node. +// +// VolumeAttachment objects are non-namespaced. +message VolumeAttachment { + // Standard object metadata. + // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata + // +optional + optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + + // Specification of the desired attach/detach volume behavior. + // Populated by the Kubernetes system. + optional VolumeAttachmentSpec spec = 2; + + // Status of the VolumeAttachment request. + // Populated by the entity completing the attach or detach + // operation, i.e. the external-attacher. + // +optional + optional VolumeAttachmentStatus status = 3; +} + +// VolumeAttachmentList is a collection of VolumeAttachment objects. +message VolumeAttachmentList { + // Standard list metadata + // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata + // +optional + optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + + // Items is the list of VolumeAttachments + repeated VolumeAttachment items = 2; +} + +// VolumeAttachmentSource represents a volume that should be attached. +// Right now only PersistenVolumes can be attached via external attacher, +// in future we may allow also inline volumes in pods. +// Exactly one member can be set. +message VolumeAttachmentSource { + // Name of the persistent volume to attach. + // +optional + optional string persistentVolumeName = 1; +} + +// VolumeAttachmentSpec is the specification of a VolumeAttachment request. +message VolumeAttachmentSpec { + // Attacher indicates the name of the volume driver that MUST handle this + // request. This is the name returned by GetPluginName(). + optional string attacher = 1; + + // Source represents the volume that should be attached. + optional VolumeAttachmentSource source = 2; + + // The node that the volume should be attached to. + optional string nodeName = 3; +} + +// VolumeAttachmentStatus is the status of a VolumeAttachment request. +message VolumeAttachmentStatus { + // Indicates the volume is successfully attached. + // This field must only be set by the entity completing the attach + // operation, i.e. the external-attacher. + optional bool attached = 1; + + // Upon successful attach, this field is populated with any + // information returned by the attach operation that must be passed + // into subsequent WaitForAttach or Mount calls. + // This field must only be set by the entity completing the attach + // operation, i.e. the external-attacher. + // +optional + map attachmentMetadata = 2; + + // The last error encountered during attach operation, if any. + // This field must only be set by the entity completing the attach + // operation, i.e. the external-attacher. + // +optional + optional VolumeError attachError = 3; + + // The last error encountered during detach operation, if any. + // This field must only be set by the entity completing the detach + // operation, i.e. the external-attacher. + // +optional + optional VolumeError detachError = 4; +} + +// VolumeError captures an error encountered during a volume operation. +message VolumeError { + // Time the error was encountered. + // +optional + optional k8s.io.apimachinery.pkg.apis.meta.v1.Time time = 1; + + // String detailing the error encountered during Attach or Detach operation. + // This string maybe logged, so it should not contain sensitive + // information. + // +optional + optional string message = 2; +} + diff --git a/vendor/k8s.io/api/storage/v1/register.go b/vendor/k8s.io/api/storage/v1/register.go index c058add8..473c6872 100644 --- a/vendor/k8s.io/api/storage/v1/register.go +++ b/vendor/k8s.io/api/storage/v1/register.go @@ -46,6 +46,9 @@ func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &StorageClass{}, &StorageClassList{}, + + &VolumeAttachment{}, + &VolumeAttachmentList{}, ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) diff --git a/vendor/k8s.io/api/storage/v1/types.go b/vendor/k8s.io/api/storage/v1/types.go index 30e6d6d2..9f2f67b6 100644 --- a/vendor/k8s.io/api/storage/v1/types.go +++ b/vendor/k8s.io/api/storage/v1/types.go @@ -102,3 +102,110 @@ const ( // binding will occur during Pod scheduing. VolumeBindingWaitForFirstConsumer VolumeBindingMode = "WaitForFirstConsumer" ) + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// VolumeAttachment captures the intent to attach or detach the specified volume +// to/from the specified node. +// +// VolumeAttachment objects are non-namespaced. +type VolumeAttachment struct { + metav1.TypeMeta `json:",inline"` + + // Standard object metadata. + // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // Specification of the desired attach/detach volume behavior. + // Populated by the Kubernetes system. + Spec VolumeAttachmentSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` + + // Status of the VolumeAttachment request. + // Populated by the entity completing the attach or detach + // operation, i.e. the external-attacher. + // +optional + Status VolumeAttachmentStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// VolumeAttachmentList is a collection of VolumeAttachment objects. +type VolumeAttachmentList struct { + metav1.TypeMeta `json:",inline"` + // Standard list metadata + // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // Items is the list of VolumeAttachments + Items []VolumeAttachment `json:"items" protobuf:"bytes,2,rep,name=items"` +} + +// VolumeAttachmentSpec is the specification of a VolumeAttachment request. +type VolumeAttachmentSpec struct { + // Attacher indicates the name of the volume driver that MUST handle this + // request. This is the name returned by GetPluginName(). + Attacher string `json:"attacher" protobuf:"bytes,1,opt,name=attacher"` + + // Source represents the volume that should be attached. + Source VolumeAttachmentSource `json:"source" protobuf:"bytes,2,opt,name=source"` + + // The node that the volume should be attached to. + NodeName string `json:"nodeName" protobuf:"bytes,3,opt,name=nodeName"` +} + +// VolumeAttachmentSource represents a volume that should be attached. +// Right now only PersistenVolumes can be attached via external attacher, +// in future we may allow also inline volumes in pods. +// Exactly one member can be set. +type VolumeAttachmentSource struct { + // Name of the persistent volume to attach. + // +optional + PersistentVolumeName *string `json:"persistentVolumeName,omitempty" protobuf:"bytes,1,opt,name=persistentVolumeName"` + + // Placeholder for *VolumeSource to accommodate inline volumes in pods. +} + +// VolumeAttachmentStatus is the status of a VolumeAttachment request. +type VolumeAttachmentStatus struct { + // Indicates the volume is successfully attached. + // This field must only be set by the entity completing the attach + // operation, i.e. the external-attacher. + Attached bool `json:"attached" protobuf:"varint,1,opt,name=attached"` + + // Upon successful attach, this field is populated with any + // information returned by the attach operation that must be passed + // into subsequent WaitForAttach or Mount calls. + // This field must only be set by the entity completing the attach + // operation, i.e. the external-attacher. + // +optional + AttachmentMetadata map[string]string `json:"attachmentMetadata,omitempty" protobuf:"bytes,2,rep,name=attachmentMetadata"` + + // The last error encountered during attach operation, if any. + // This field must only be set by the entity completing the attach + // operation, i.e. the external-attacher. + // +optional + AttachError *VolumeError `json:"attachError,omitempty" protobuf:"bytes,3,opt,name=attachError,casttype=VolumeError"` + + // The last error encountered during detach operation, if any. + // This field must only be set by the entity completing the detach + // operation, i.e. the external-attacher. + // +optional + DetachError *VolumeError `json:"detachError,omitempty" protobuf:"bytes,4,opt,name=detachError,casttype=VolumeError"` +} + +// VolumeError captures an error encountered during a volume operation. +type VolumeError struct { + // Time the error was encountered. + // +optional + Time metav1.Time `json:"time,omitempty" protobuf:"bytes,1,opt,name=time"` + + // String detailing the error encountered during Attach or Detach operation. + // This string maybe logged, so it should not contain sensitive + // information. + // +optional + Message string `json:"message,omitempty" protobuf:"bytes,2,opt,name=message"` +} diff --git a/vendor/k8s.io/api/storage/v1/types_swagger_doc_generated.go b/vendor/k8s.io/api/storage/v1/types_swagger_doc_generated.go index 23b76e28..d4a022d5 100644 --- a/vendor/k8s.io/api/storage/v1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/storage/v1/types_swagger_doc_generated.go @@ -53,4 +53,67 @@ func (StorageClassList) SwaggerDoc() map[string]string { return map_StorageClassList } +var map_VolumeAttachment = map[string]string{ + "": "VolumeAttachment captures the intent to attach or detach the specified volume to/from the specified node.\n\nVolumeAttachment objects are non-namespaced.", + "metadata": "Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", + "spec": "Specification of the desired attach/detach volume behavior. Populated by the Kubernetes system.", + "status": "Status of the VolumeAttachment request. Populated by the entity completing the attach or detach operation, i.e. the external-attacher.", +} + +func (VolumeAttachment) SwaggerDoc() map[string]string { + return map_VolumeAttachment +} + +var map_VolumeAttachmentList = map[string]string{ + "": "VolumeAttachmentList is a collection of VolumeAttachment objects.", + "metadata": "Standard list metadata More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", + "items": "Items is the list of VolumeAttachments", +} + +func (VolumeAttachmentList) SwaggerDoc() map[string]string { + return map_VolumeAttachmentList +} + +var map_VolumeAttachmentSource = map[string]string{ + "": "VolumeAttachmentSource represents a volume that should be attached. Right now only PersistenVolumes can be attached via external attacher, in future we may allow also inline volumes in pods. Exactly one member can be set.", + "persistentVolumeName": "Name of the persistent volume to attach.", +} + +func (VolumeAttachmentSource) SwaggerDoc() map[string]string { + return map_VolumeAttachmentSource +} + +var map_VolumeAttachmentSpec = map[string]string{ + "": "VolumeAttachmentSpec is the specification of a VolumeAttachment request.", + "attacher": "Attacher indicates the name of the volume driver that MUST handle this request. This is the name returned by GetPluginName().", + "source": "Source represents the volume that should be attached.", + "nodeName": "The node that the volume should be attached to.", +} + +func (VolumeAttachmentSpec) SwaggerDoc() map[string]string { + return map_VolumeAttachmentSpec +} + +var map_VolumeAttachmentStatus = map[string]string{ + "": "VolumeAttachmentStatus is the status of a VolumeAttachment request.", + "attached": "Indicates the volume is successfully attached. This field must only be set by the entity completing the attach operation, i.e. the external-attacher.", + "attachmentMetadata": "Upon successful attach, this field is populated with any information returned by the attach operation that must be passed into subsequent WaitForAttach or Mount calls. This field must only be set by the entity completing the attach operation, i.e. the external-attacher.", + "attachError": "The last error encountered during attach operation, if any. This field must only be set by the entity completing the attach operation, i.e. the external-attacher.", + "detachError": "The last error encountered during detach operation, if any. This field must only be set by the entity completing the detach operation, i.e. the external-attacher.", +} + +func (VolumeAttachmentStatus) SwaggerDoc() map[string]string { + return map_VolumeAttachmentStatus +} + +var map_VolumeError = map[string]string{ + "": "VolumeError captures an error encountered during a volume operation.", + "time": "Time the error was encountered.", + "message": "String detailing the error encountered during Attach or Detach operation. This string maybe logged, so it should not contain sensitive information.", +} + +func (VolumeError) SwaggerDoc() map[string]string { + return map_VolumeError +} + // AUTO-GENERATED FUNCTIONS END HERE diff --git a/vendor/k8s.io/api/storage/v1/zz_generated.deepcopy.go b/vendor/k8s.io/api/storage/v1/zz_generated.deepcopy.go index 0e850dc3..3157ec67 100644 --- a/vendor/k8s.io/api/storage/v1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/storage/v1/zz_generated.deepcopy.go @@ -117,3 +117,152 @@ func (in *StorageClassList) DeepCopyObject() runtime.Object { } return nil } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VolumeAttachment) DeepCopyInto(out *VolumeAttachment) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeAttachment. +func (in *VolumeAttachment) DeepCopy() *VolumeAttachment { + if in == nil { + return nil + } + out := new(VolumeAttachment) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VolumeAttachment) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VolumeAttachmentList) DeepCopyInto(out *VolumeAttachmentList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]VolumeAttachment, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeAttachmentList. +func (in *VolumeAttachmentList) DeepCopy() *VolumeAttachmentList { + if in == nil { + return nil + } + out := new(VolumeAttachmentList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VolumeAttachmentList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VolumeAttachmentSource) DeepCopyInto(out *VolumeAttachmentSource) { + *out = *in + if in.PersistentVolumeName != nil { + in, out := &in.PersistentVolumeName, &out.PersistentVolumeName + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeAttachmentSource. +func (in *VolumeAttachmentSource) DeepCopy() *VolumeAttachmentSource { + if in == nil { + return nil + } + out := new(VolumeAttachmentSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VolumeAttachmentSpec) DeepCopyInto(out *VolumeAttachmentSpec) { + *out = *in + in.Source.DeepCopyInto(&out.Source) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeAttachmentSpec. +func (in *VolumeAttachmentSpec) DeepCopy() *VolumeAttachmentSpec { + if in == nil { + return nil + } + out := new(VolumeAttachmentSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VolumeAttachmentStatus) DeepCopyInto(out *VolumeAttachmentStatus) { + *out = *in + if in.AttachmentMetadata != nil { + in, out := &in.AttachmentMetadata, &out.AttachmentMetadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.AttachError != nil { + in, out := &in.AttachError, &out.AttachError + *out = new(VolumeError) + (*in).DeepCopyInto(*out) + } + if in.DetachError != nil { + in, out := &in.DetachError, &out.DetachError + *out = new(VolumeError) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeAttachmentStatus. +func (in *VolumeAttachmentStatus) DeepCopy() *VolumeAttachmentStatus { + if in == nil { + return nil + } + out := new(VolumeAttachmentStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VolumeError) DeepCopyInto(out *VolumeError) { + *out = *in + in.Time.DeepCopyInto(&out.Time) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeError. +func (in *VolumeError) DeepCopy() *VolumeError { + if in == nil { + return nil + } + out := new(VolumeError) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/k8s.io/apiextensions-apiserver/Godeps/Godeps.json b/vendor/k8s.io/apiextensions-apiserver/Godeps/Godeps.json index 2837a912..d08e861a 100644 --- a/vendor/k8s.io/apiextensions-apiserver/Godeps/Godeps.json +++ b/vendor/k8s.io/apiextensions-apiserver/Godeps/Godeps.json @@ -458,10 +458,6 @@ "ImportPath": "github.com/gogo/protobuf/sortkeys", "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" }, - { - "ImportPath": "github.com/golang/glog", - "Rev": "44145f04b68cf362d9c4df2182967c2275eaefed" - }, { "ImportPath": "github.com/golang/groupcache/lru", "Rev": "02826c3e79038b59d737d3b1c0a1d937f71a4433" @@ -724,35 +720,35 @@ }, { "ImportPath": "golang.org/x/net/context", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + "Rev": "0ed95abb35c445290478a5348a7b38bb154135fd" }, { "ImportPath": "golang.org/x/net/http2", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + "Rev": "0ed95abb35c445290478a5348a7b38bb154135fd" }, { "ImportPath": "golang.org/x/net/http2/hpack", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + "Rev": "0ed95abb35c445290478a5348a7b38bb154135fd" }, { "ImportPath": "golang.org/x/net/idna", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + "Rev": "0ed95abb35c445290478a5348a7b38bb154135fd" }, { "ImportPath": "golang.org/x/net/internal/timeseries", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + "Rev": "0ed95abb35c445290478a5348a7b38bb154135fd" }, { "ImportPath": "golang.org/x/net/lex/httplex", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + "Rev": "0ed95abb35c445290478a5348a7b38bb154135fd" }, { "ImportPath": "golang.org/x/net/trace", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + "Rev": "0ed95abb35c445290478a5348a7b38bb154135fd" }, { "ImportPath": "golang.org/x/net/websocket", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + "Rev": "0ed95abb35c445290478a5348a7b38bb154135fd" }, { "ImportPath": "golang.org/x/oauth2", @@ -824,79 +820,111 @@ }, { "ImportPath": "google.golang.org/grpc", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" + "Rev": "168a6198bcb0ef175f7dacec0b8691fc141dc9b8" }, { "ImportPath": "google.golang.org/grpc/balancer", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" + "Rev": "168a6198bcb0ef175f7dacec0b8691fc141dc9b8" + }, + { + "ImportPath": "google.golang.org/grpc/balancer/base", + "Rev": "168a6198bcb0ef175f7dacec0b8691fc141dc9b8" + }, + { + "ImportPath": "google.golang.org/grpc/balancer/roundrobin", + "Rev": "168a6198bcb0ef175f7dacec0b8691fc141dc9b8" }, { "ImportPath": "google.golang.org/grpc/codes", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" + "Rev": "168a6198bcb0ef175f7dacec0b8691fc141dc9b8" }, { "ImportPath": "google.golang.org/grpc/connectivity", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" + "Rev": "168a6198bcb0ef175f7dacec0b8691fc141dc9b8" }, { "ImportPath": "google.golang.org/grpc/credentials", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" + "Rev": "168a6198bcb0ef175f7dacec0b8691fc141dc9b8" }, { - "ImportPath": "google.golang.org/grpc/grpclb/grpc_lb_v1/messages", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" + "ImportPath": "google.golang.org/grpc/encoding", + "Rev": "168a6198bcb0ef175f7dacec0b8691fc141dc9b8" + }, + { + "ImportPath": "google.golang.org/grpc/encoding/proto", + "Rev": "168a6198bcb0ef175f7dacec0b8691fc141dc9b8" }, { "ImportPath": "google.golang.org/grpc/grpclog", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" + "Rev": "168a6198bcb0ef175f7dacec0b8691fc141dc9b8" }, { "ImportPath": "google.golang.org/grpc/health", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" + "Rev": "168a6198bcb0ef175f7dacec0b8691fc141dc9b8" }, { "ImportPath": "google.golang.org/grpc/health/grpc_health_v1", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" + "Rev": "168a6198bcb0ef175f7dacec0b8691fc141dc9b8" }, { "ImportPath": "google.golang.org/grpc/internal", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" + "Rev": "168a6198bcb0ef175f7dacec0b8691fc141dc9b8" + }, + { + "ImportPath": "google.golang.org/grpc/internal/backoff", + "Rev": "168a6198bcb0ef175f7dacec0b8691fc141dc9b8" + }, + { + "ImportPath": "google.golang.org/grpc/internal/channelz", + "Rev": "168a6198bcb0ef175f7dacec0b8691fc141dc9b8" + }, + { + "ImportPath": "google.golang.org/grpc/internal/grpcrand", + "Rev": "168a6198bcb0ef175f7dacec0b8691fc141dc9b8" }, { "ImportPath": "google.golang.org/grpc/keepalive", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" + "Rev": "168a6198bcb0ef175f7dacec0b8691fc141dc9b8" }, { "ImportPath": "google.golang.org/grpc/metadata", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" + "Rev": "168a6198bcb0ef175f7dacec0b8691fc141dc9b8" }, { "ImportPath": "google.golang.org/grpc/naming", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" + "Rev": "168a6198bcb0ef175f7dacec0b8691fc141dc9b8" }, { "ImportPath": "google.golang.org/grpc/peer", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" + "Rev": "168a6198bcb0ef175f7dacec0b8691fc141dc9b8" }, { "ImportPath": "google.golang.org/grpc/resolver", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" + "Rev": "168a6198bcb0ef175f7dacec0b8691fc141dc9b8" + }, + { + "ImportPath": "google.golang.org/grpc/resolver/dns", + "Rev": "168a6198bcb0ef175f7dacec0b8691fc141dc9b8" + }, + { + "ImportPath": "google.golang.org/grpc/resolver/passthrough", + "Rev": "168a6198bcb0ef175f7dacec0b8691fc141dc9b8" }, { "ImportPath": "google.golang.org/grpc/stats", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" + "Rev": "168a6198bcb0ef175f7dacec0b8691fc141dc9b8" }, { "ImportPath": "google.golang.org/grpc/status", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" + "Rev": "168a6198bcb0ef175f7dacec0b8691fc141dc9b8" }, { "ImportPath": "google.golang.org/grpc/tap", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" + "Rev": "168a6198bcb0ef175f7dacec0b8691fc141dc9b8" }, { "ImportPath": "google.golang.org/grpc/transport", - "Rev": "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" + "Rev": "168a6198bcb0ef175f7dacec0b8691fc141dc9b8" }, { "ImportPath": "gopkg.in/inf.v0", @@ -912,1363 +940,1399 @@ }, { "ImportPath": "k8s.io/api/admission/v1beta1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/admissionregistration/v1alpha1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/admissionregistration/v1beta1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/apps/v1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/apps/v1beta1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/apps/v1beta2", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/auditregistration/v1alpha1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/authentication/v1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/authentication/v1beta1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/authorization/v1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/authorization/v1beta1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/autoscaling/v1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/autoscaling/v2beta1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/autoscaling/v2beta2", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/batch/v1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/batch/v1beta1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/batch/v2alpha1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/certificates/v1beta1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/coordination/v1beta1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/core/v1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/events/v1beta1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/extensions/v1beta1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/networking/v1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/policy/v1beta1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/rbac/v1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/rbac/v1alpha1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/rbac/v1beta1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/scheduling/v1alpha1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/scheduling/v1beta1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/settings/v1alpha1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/storage/v1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/storage/v1alpha1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/storage/v1beta1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/apitesting", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/apitesting/fuzzer", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/apitesting/roundtrip", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/equality", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/errors", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/meta", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/meta/table", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/resource", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/validation", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/validation/path", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/fuzzer", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/validation", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1beta1", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/conversion", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/fields", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/labels", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/schema", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/selection", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/types", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/cache", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/clock", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/diff", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/duration", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/errors", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/framer", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/intstr", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/json", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/naming", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/net", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/rand", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/runtime", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/sets", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/uuid", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/validation", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/validation/field", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/wait", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/waitgroup", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/yaml", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/version", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/watch", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apiserver/pkg/admission", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/admission/configuration", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/admission/initializer", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/admission/metrics", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/admission/plugin/initialization", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/admission/plugin/namespace/lifecycle", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/admission/plugin/webhook/config", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/admission/plugin/webhook/config/apis/webhookadmission/v1alpha1", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/admission/plugin/webhook/errors", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/admission/plugin/webhook/generic", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/admission/plugin/webhook/mutating", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/admission/plugin/webhook/namespace", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/admission/plugin/webhook/request", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/admission/plugin/webhook/rules", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/admission/plugin/webhook/util", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/admission/plugin/webhook/validating", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/apis/apiserver", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/apis/apiserver/install", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/apis/apiserver/v1alpha1", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/apis/audit", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/apis/audit/install", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/apis/audit/v1", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/apis/audit/v1alpha1", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/apis/audit/v1beta1", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/apis/audit/validation", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/audit", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" + }, + { + "ImportPath": "k8s.io/apiserver/pkg/audit/event", + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/audit/policy", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" + }, + { + "ImportPath": "k8s.io/apiserver/pkg/audit/util", + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/authentication/authenticator", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/authentication/authenticatorfactory", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/authentication/group", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/authentication/request/anonymous", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/authentication/request/bearertoken", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/authentication/request/headerrequest", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/authentication/request/union", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/authentication/request/websocket", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/authentication/request/x509", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/authentication/serviceaccount", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/authentication/token/cache", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/authentication/token/tokenfile", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/authentication/user", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/authorization/authorizer", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/authorization/authorizerfactory", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/authorization/path", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/authorization/union", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/endpoints", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/endpoints/discovery", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/endpoints/filters", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/endpoints/handlers", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/endpoints/handlers/negotiation", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/endpoints/handlers/responsewriters", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/endpoints/metrics", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/endpoints/openapi", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/endpoints/request", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/features", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/registry/generic", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/registry/generic/registry", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/registry/generic/testing", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/registry/rest", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/registry/rest/resttest", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/server", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/server/filters", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/server/healthz", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/server/httplog", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/server/mux", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/server/options", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/server/resourceconfig", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/server/routes", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/server/routes/data/swagger", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/server/storage", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/storage", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/storage/cacher", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/storage/errors", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/storage/etcd", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/storage/etcd/etcdtest", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/storage/etcd/metrics", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/storage/etcd/testing", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/storage/etcd/testing/testingcert", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/storage/etcd3", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/storage/names", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/storage/storagebackend", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/storage/storagebackend/factory", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/storage/testing", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/storage/value", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/util/dryrun", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/util/feature", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" + }, + { + "ImportPath": "k8s.io/apiserver/pkg/util/feature/testing", + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/util/flag", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/util/flushwriter", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/util/logs", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/util/openapi", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" + }, + { + "ImportPath": "k8s.io/apiserver/pkg/util/proxy", + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/util/trace", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/util/webhook", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/pkg/util/wsstream", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/plugin/pkg/audit/buffered", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" + }, + { + "ImportPath": "k8s.io/apiserver/plugin/pkg/audit/dynamic", + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" + }, + { + "ImportPath": "k8s.io/apiserver/plugin/pkg/audit/dynamic/enforced", + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/plugin/pkg/audit/log", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/plugin/pkg/audit/truncate", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/plugin/pkg/audit/webhook", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/plugin/pkg/authenticator/token/webhook", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/apiserver/plugin/pkg/authorizer/webhook", - "Rev": "fd4989fe40fcacb222a886a56d34643d1a44d0da" + "Rev": "6b360527ed84a1a6bb3883faef76c71cc17499ba" }, { "ImportPath": "k8s.io/client-go/discovery", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/discovery/fake", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/dynamic", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/admissionregistration", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/admissionregistration/v1alpha1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/admissionregistration/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/apps", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/apps/v1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/apps/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/apps/v1beta2", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/auditregistration", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/auditregistration/v1alpha1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/autoscaling", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/autoscaling/v1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/autoscaling/v2beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/autoscaling/v2beta2", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/batch", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/batch/v1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/batch/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/batch/v2alpha1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/certificates", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/certificates/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/coordination", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/coordination/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/core", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/core/v1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/events", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/events/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/extensions", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/extensions/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/internalinterfaces", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/networking", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/networking/v1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/policy", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/policy/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/rbac", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/rbac/v1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/rbac/v1alpha1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/rbac/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/scheduling", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/scheduling/v1alpha1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/scheduling/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/settings", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/settings/v1alpha1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/storage", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/storage/v1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/storage/v1alpha1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/informers/storage/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/kubernetes", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/kubernetes/scheme", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/apps/v1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/apps/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/apps/v1beta2", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/authentication/v1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/authentication/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/authorization/v1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/authorization/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/autoscaling/v1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/batch/v1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/batch/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/batch/v2alpha1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/certificates/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/coordination/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/core/v1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/events/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/extensions/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/networking/v1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/policy/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/rbac/v1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/rbac/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/scheduling/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/settings/v1alpha1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/storage/v1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/storage/v1alpha1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/kubernetes/typed/storage/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/listers/admissionregistration/v1alpha1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/listers/admissionregistration/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/listers/apps/v1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/listers/apps/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/listers/apps/v1beta2", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/listers/auditregistration/v1alpha1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/listers/autoscaling/v1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/listers/autoscaling/v2beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/listers/autoscaling/v2beta2", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/listers/batch/v1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/listers/batch/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/listers/batch/v2alpha1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/listers/certificates/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/listers/coordination/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/listers/core/v1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/listers/events/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/listers/extensions/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/listers/networking/v1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/listers/policy/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/listers/rbac/v1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/listers/rbac/v1alpha1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/listers/rbac/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/listers/scheduling/v1alpha1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/listers/scheduling/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/listers/settings/v1alpha1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/listers/storage/v1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/listers/storage/v1alpha1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/listers/storage/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/pkg/apis/clientauthentication", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/pkg/apis/clientauthentication/v1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/pkg/version", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/plugin/pkg/client/auth/exec", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/rest", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/rest/watch", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/restmapper", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/scale", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/scale/scheme", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/scale/scheme/appsint", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/scale/scheme/appsv1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/scale/scheme/appsv1beta2", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/scale/scheme/autoscalingv1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/scale/scheme/extensionsint", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/scale/scheme/extensionsv1beta1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/testing", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/third_party/forked/golang/template", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/tools/auth", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/tools/cache", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/tools/clientcmd", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/tools/clientcmd/api", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/tools/clientcmd/api/latest", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/tools/clientcmd/api/v1", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/tools/metrics", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/tools/pager", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" + }, + { + "ImportPath": "k8s.io/client-go/tools/record", + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/tools/reference", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/transport", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/util/buffer", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/util/cert", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/util/connrotation", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/util/flowcontrol", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/util/homedir", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/util/integer", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/util/jsonpath", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/util/retry", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" }, { "ImportPath": "k8s.io/client-go/util/workqueue", - "Rev": "3d0291ef797fa2930ab6889b541fa3c3a9f633d9" + "Rev": "46a8dc78ec29761d6cb89a9eb50ddde947c84030" + }, + { + "ImportPath": "k8s.io/klog", + "Rev": "8139d8cb77af419532b33dfa7dd09fbc5f1d344f" }, { "ImportPath": "k8s.io/kube-openapi/pkg/builder", - "Rev": "72693cb1fadd73ae2742f6fe29af77d1aecdd8cd" + "Rev": "c59034cc13d587f5ef4e85ca0ade0c1866ae8e1d" }, { "ImportPath": "k8s.io/kube-openapi/pkg/common", - "Rev": "72693cb1fadd73ae2742f6fe29af77d1aecdd8cd" + "Rev": "c59034cc13d587f5ef4e85ca0ade0c1866ae8e1d" }, { "ImportPath": "k8s.io/kube-openapi/pkg/handler", - "Rev": "72693cb1fadd73ae2742f6fe29af77d1aecdd8cd" + "Rev": "c59034cc13d587f5ef4e85ca0ade0c1866ae8e1d" }, { "ImportPath": "k8s.io/kube-openapi/pkg/util", - "Rev": "72693cb1fadd73ae2742f6fe29af77d1aecdd8cd" + "Rev": "c59034cc13d587f5ef4e85ca0ade0c1866ae8e1d" }, { "ImportPath": "k8s.io/kube-openapi/pkg/util/proto", - "Rev": "72693cb1fadd73ae2742f6fe29af77d1aecdd8cd" + "Rev": "c59034cc13d587f5ef4e85ca0ade0c1866ae8e1d" + }, + { + "ImportPath": "sigs.k8s.io/yaml", + "Rev": "fd68e9863619f6ec2fdd8625fe1f02e7c877e480" } ] } diff --git a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1/example.go b/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1/example.go index b9408f1c..5b5df88f 100644 --- a/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1/example.go +++ b/vendor/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/typed/cr/v1/example.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + v1 "k8s.io/apiextensions-apiserver/examples/client-go/pkg/apis/cr/v1" scheme "k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -75,11 +77,16 @@ func (c *examples) Get(name string, options metav1.GetOptions) (result *v1.Examp // List takes label and field selectors, and returns the list of Examples that match those selectors. func (c *examples) List(opts metav1.ListOptions) (result *v1.ExampleList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.ExampleList{} err = c.client.Get(). Namespace(c.ns). Resource("examples"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -87,11 +94,16 @@ func (c *examples) List(opts metav1.ListOptions) (result *v1.ExampleList, err er // Watch returns a watch.Interface that watches the requested examples. func (c *examples) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("examples"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -133,10 +145,15 @@ func (c *examples) Delete(name string, options *metav1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *examples) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("examples"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/apiextensions-apiserver/main.go b/vendor/k8s.io/apiextensions-apiserver/main.go index 888a04b1..eeac2e68 100644 --- a/vendor/k8s.io/apiextensions-apiserver/main.go +++ b/vendor/k8s.io/apiextensions-apiserver/main.go @@ -20,7 +20,7 @@ import ( "flag" "os" - "github.com/golang/glog" + "k8s.io/klog" "k8s.io/apiextensions-apiserver/pkg/cmd/server" genericapiserver "k8s.io/apiserver/pkg/server" @@ -35,6 +35,6 @@ func main() { cmd := server.NewServerCommand(os.Stdout, os.Stderr, stopCh) cmd.Flags().AddGoFlagSet(flag.CommandLine) if err := cmd.Execute(); err != nil { - glog.Fatal(err) + klog.Fatal(err) } } diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/types.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/types.go index cda76ff7..fcbd8bd1 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/types.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/types.go @@ -44,8 +44,14 @@ type CustomResourceDefinitionSpec struct { // Scope indicates whether this resource is cluster or namespace scoped. Default is namespaced Scope ResourceScope // Validation describes the validation methods for CustomResources + // Optional, the global validation schema for all versions. + // Top-level and per-version schemas are mutually exclusive. + // +optional Validation *CustomResourceValidation - // Subresources describes the subresources for CustomResources + // Subresources describes the subresources for CustomResource + // Optional, the global subresources for all versions. + // Top-level and per-version subresources are mutually exclusive. + // +optional Subresources *CustomResourceSubresources // Versions is the list of all supported versions for this resource. // If Version field is provided, this field is optional. @@ -60,6 +66,9 @@ type CustomResourceDefinitionSpec struct { // v10, v2, v1, v11beta2, v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10. Versions []CustomResourceDefinitionVersion // AdditionalPrinterColumns are additional columns shown e.g. in kubectl next to the name. Defaults to a created-at column. + // Optional, the global columns for all versions. + // Top-level and per-version columns are mutually exclusive. + // +optional AdditionalPrinterColumns []CustomResourceColumnDefinition // `conversion` defines conversion settings for the CRD. @@ -149,6 +158,27 @@ type CustomResourceDefinitionVersion struct { // Storage flags the version as storage version. There must be exactly one flagged // as storage version. Storage bool + // Schema describes the schema for CustomResource used in validation, pruning, and defaulting. + // Top-level and per-version schemas are mutually exclusive. + // Per-version schemas must not all be set to identical values (top-level validation schema should be used instead) + // This field is alpha-level and is only honored by servers that enable the CustomResourceWebhookConversion feature. + // +optional + Schema *CustomResourceValidation + // Subresources describes the subresources for CustomResource + // Top-level and per-version subresources are mutually exclusive. + // Per-version subresources must not all be set to identical values (top-level subresources should be used instead) + // This field is alpha-level and is only honored by servers that enable the CustomResourceWebhookConversion feature. + // +optional + Subresources *CustomResourceSubresources + // AdditionalPrinterColumns are additional columns shown e.g. in kubectl next to the name. Defaults to a created-at column. + // Top-level and per-version columns are mutually exclusive. + // Per-version columns must not all be set to identical values (top-level columns should be used instead) + // This field is alpha-level and is only honored by servers that enable the CustomResourceWebhookConversion feature. + // NOTE: CRDs created prior to 1.13 populated the top-level additionalPrinterColumns field by default. To apply an + // update that changes to per-version additionalPrinterColumns, the top-level additionalPrinterColumns field must + // be explicitly set to null + // +optional + AdditionalPrinterColumns []CustomResourceColumnDefinition } // CustomResourceColumnDefinition specifies a column for server side printing. diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/defaults.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/defaults.go index 2e3c2146..5aae97cf 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/defaults.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/defaults.go @@ -19,12 +19,9 @@ package v1beta1 import ( "strings" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" ) -var swaggerMetadataDescriptions = metav1.ObjectMeta{}.SwaggerDoc() - func addDefaultingFuncs(scheme *runtime.Scheme) error { scheme.AddTypeDefaultingFunc(&CustomResourceDefinition{}, func(obj interface{}) { SetDefaults_CustomResourceDefinition(obj.(*CustomResourceDefinition)) }) // TODO figure out why I can't seem to get my defaulter generated @@ -66,14 +63,19 @@ func SetDefaults_CustomResourceDefinitionSpec(obj *CustomResourceDefinitionSpec) if len(obj.Version) == 0 && len(obj.Versions) != 0 { obj.Version = obj.Versions[0].Name } - if len(obj.AdditionalPrinterColumns) == 0 { - obj.AdditionalPrinterColumns = []CustomResourceColumnDefinition{ - {Name: "Age", Type: "date", Description: swaggerMetadataDescriptions["creationTimestamp"], JSONPath: ".metadata.creationTimestamp"}, - } - } if obj.Conversion == nil { obj.Conversion = &CustomResourceConversion{ Strategy: NoneConverter, } } } + +// hasPerVersionColumns returns true if a CRD uses per-version columns. +func hasPerVersionColumns(versions []CustomResourceDefinitionVersion) bool { + for _, v := range versions { + if len(v.AdditionalPrinterColumns) > 0 { + return true + } + } + return false +} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.pb.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.pb.go index 12aa2ddd..ef2dfe16 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.pb.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.pb.go @@ -785,6 +785,38 @@ func (m *CustomResourceDefinitionVersion) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0 } i++ + if m.Schema != nil { + dAtA[i] = 0x22 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.Schema.Size())) + n15, err := m.Schema.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n15 + } + if m.Subresources != nil { + dAtA[i] = 0x2a + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.Subresources.Size())) + n16, err := m.Subresources.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n16 + } + if len(m.AdditionalPrinterColumns) > 0 { + for _, msg := range m.AdditionalPrinterColumns { + dAtA[i] = 0x32 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } return i, nil } @@ -857,21 +889,21 @@ func (m *CustomResourceSubresources) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Status.Size())) - n15, err := m.Status.MarshalTo(dAtA[i:]) + n17, err := m.Status.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n15 + i += n17 } if m.Scale != nil { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Scale.Size())) - n16, err := m.Scale.MarshalTo(dAtA[i:]) + n18, err := m.Scale.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n16 + i += n18 } return i, nil } @@ -895,11 +927,11 @@ func (m *CustomResourceValidation) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.OpenAPIV3Schema.Size())) - n17, err := m.OpenAPIV3Schema.MarshalTo(dAtA[i:]) + n19, err := m.OpenAPIV3Schema.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n17 + i += n19 } return i, nil } @@ -1003,11 +1035,11 @@ func (m *JSONSchemaProps) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x42 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Default.Size())) - n18, err := m.Default.MarshalTo(dAtA[i:]) + n20, err := m.Default.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n18 + i += n20 } if m.Maximum != nil { dAtA[i] = 0x49 @@ -1134,11 +1166,11 @@ func (m *JSONSchemaProps) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Items.Size())) - n19, err := m.Items.MarshalTo(dAtA[i:]) + n21, err := m.Items.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n19 + i += n21 } if len(m.AllOf) > 0 { for _, msg := range m.AllOf { @@ -1188,11 +1220,11 @@ func (m *JSONSchemaProps) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Not.Size())) - n20, err := m.Not.MarshalTo(dAtA[i:]) + n22, err := m.Not.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n20 + i += n22 } if len(m.Properties) > 0 { keysForProperties := make([]string, 0, len(m.Properties)) @@ -1220,11 +1252,11 @@ func (m *JSONSchemaProps) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64((&v).Size())) - n21, err := (&v).MarshalTo(dAtA[i:]) + n23, err := (&v).MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n21 + i += n23 } } if m.AdditionalProperties != nil { @@ -1233,11 +1265,11 @@ func (m *JSONSchemaProps) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.AdditionalProperties.Size())) - n22, err := m.AdditionalProperties.MarshalTo(dAtA[i:]) + n24, err := m.AdditionalProperties.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n22 + i += n24 } if len(m.PatternProperties) > 0 { keysForPatternProperties := make([]string, 0, len(m.PatternProperties)) @@ -1265,11 +1297,11 @@ func (m *JSONSchemaProps) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64((&v).Size())) - n23, err := (&v).MarshalTo(dAtA[i:]) + n25, err := (&v).MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n23 + i += n25 } } if len(m.Dependencies) > 0 { @@ -1298,11 +1330,11 @@ func (m *JSONSchemaProps) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64((&v).Size())) - n24, err := (&v).MarshalTo(dAtA[i:]) + n26, err := (&v).MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n24 + i += n26 } } if m.AdditionalItems != nil { @@ -1311,11 +1343,11 @@ func (m *JSONSchemaProps) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.AdditionalItems.Size())) - n25, err := m.AdditionalItems.MarshalTo(dAtA[i:]) + n27, err := m.AdditionalItems.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n25 + i += n27 } if len(m.Definitions) > 0 { keysForDefinitions := make([]string, 0, len(m.Definitions)) @@ -1343,11 +1375,11 @@ func (m *JSONSchemaProps) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64((&v).Size())) - n26, err := (&v).MarshalTo(dAtA[i:]) + n28, err := (&v).MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n26 + i += n28 } } if m.ExternalDocs != nil { @@ -1356,11 +1388,11 @@ func (m *JSONSchemaProps) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ExternalDocs.Size())) - n27, err := m.ExternalDocs.MarshalTo(dAtA[i:]) + n29, err := m.ExternalDocs.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n27 + i += n29 } if m.Example != nil { dAtA[i] = 0xa2 @@ -1368,11 +1400,11 @@ func (m *JSONSchemaProps) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Example.Size())) - n28, err := m.Example.MarshalTo(dAtA[i:]) + n30, err := m.Example.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n28 + i += n30 } return i, nil } @@ -1396,11 +1428,11 @@ func (m *JSONSchemaPropsOrArray) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Schema.Size())) - n29, err := m.Schema.MarshalTo(dAtA[i:]) + n31, err := m.Schema.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n29 + i += n31 } if len(m.JSONSchemas) > 0 { for _, msg := range m.JSONSchemas { @@ -1444,11 +1476,11 @@ func (m *JSONSchemaPropsOrBool) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Schema.Size())) - n30, err := m.Schema.MarshalTo(dAtA[i:]) + n32, err := m.Schema.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n30 + i += n32 } return i, nil } @@ -1472,11 +1504,11 @@ func (m *JSONSchemaPropsOrStringArray) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Schema.Size())) - n31, err := m.Schema.MarshalTo(dAtA[i:]) + n33, err := m.Schema.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n31 + i += n33 } if len(m.Property) > 0 { for _, s := range m.Property { @@ -1547,11 +1579,11 @@ func (m *WebhookClientConfig) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Service.Size())) - n32, err := m.Service.MarshalTo(dAtA[i:]) + n34, err := m.Service.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n32 + i += n34 } if m.CABundle != nil { dAtA[i] = 0x12 @@ -1785,6 +1817,20 @@ func (m *CustomResourceDefinitionVersion) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) n += 2 n += 2 + if m.Schema != nil { + l = m.Schema.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Subresources != nil { + l = m.Subresources.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.AdditionalPrinterColumns) > 0 { + for _, e := range m.AdditionalPrinterColumns { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } return n } @@ -2239,6 +2285,9 @@ func (this *CustomResourceDefinitionVersion) String() string { `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `Served:` + fmt.Sprintf("%v", this.Served) + `,`, `Storage:` + fmt.Sprintf("%v", this.Storage) + `,`, + `Schema:` + strings.Replace(fmt.Sprintf("%v", this.Schema), "CustomResourceValidation", "CustomResourceValidation", 1) + `,`, + `Subresources:` + strings.Replace(fmt.Sprintf("%v", this.Subresources), "CustomResourceSubresources", "CustomResourceSubresources", 1) + `,`, + `AdditionalPrinterColumns:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.AdditionalPrinterColumns), "CustomResourceColumnDefinition", "CustomResourceColumnDefinition", 1), `&`, ``, 1) + `,`, `}`, }, "") return s @@ -4414,6 +4463,103 @@ func (m *CustomResourceDefinitionVersion) Unmarshal(dAtA []byte) error { } } m.Storage = bool(v != 0) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Schema", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Schema == nil { + m.Schema = &CustomResourceValidation{} + } + if err := m.Schema.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Subresources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Subresources == nil { + m.Subresources = &CustomResourceSubresources{} + } + if err := m.Subresources.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AdditionalPrinterColumns", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AdditionalPrinterColumns = append(m.AdditionalPrinterColumns, CustomResourceColumnDefinition{}) + if err := m.AdditionalPrinterColumns[len(m.AdditionalPrinterColumns)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -7107,175 +7253,177 @@ func init() { } var fileDescriptorGenerated = []byte{ - // 2711 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x5a, 0xdd, 0x6f, 0x24, 0x47, - 0x11, 0xbf, 0xd9, 0xf5, 0xda, 0xeb, 0xb6, 0x7d, 0xb6, 0xfb, 0xe2, 0xcb, 0x9c, 0xb9, 0xec, 0xda, - 0x1b, 0x12, 0x99, 0x70, 0xb7, 0xce, 0x1d, 0x09, 0x09, 0x91, 0x78, 0xf0, 0xda, 0x4e, 0xe4, 0x70, - 0x3e, 0x9b, 0xde, 0xbb, 0x0b, 0x90, 0xcf, 0xf6, 0x4c, 0xef, 0x7a, 0xce, 0xf3, 0x75, 0xd3, 0x33, - 0x6b, 0x5b, 0x7c, 0x08, 0x12, 0x45, 0x20, 0x04, 0x04, 0x91, 0x13, 0x12, 0x02, 0x1e, 0x00, 0xf1, - 0x82, 0x10, 0x3c, 0xc0, 0x1b, 0xfc, 0x01, 0xf7, 0x18, 0xf1, 0x94, 0xa7, 0x15, 0xb7, 0xfc, 0x0b, - 0x48, 0x48, 0x7e, 0x42, 0xfd, 0x31, 0x3d, 0xb3, 0xb3, 0xbb, 0x39, 0x2b, 0xb7, 0x9b, 0x7b, 0xf3, - 0x54, 0x55, 0xd7, 0xaf, 0xba, 0xba, 0xaa, 0xba, 0xaa, 0xd7, 0xa0, 0x71, 0xf0, 0x22, 0xad, 0x5a, - 0xde, 0xea, 0x41, 0xb4, 0x47, 0x02, 0x97, 0x84, 0x84, 0xae, 0xb6, 0x88, 0x6b, 0x7a, 0xc1, 0xaa, - 0x64, 0x60, 0xdf, 0x22, 0x47, 0x21, 0x71, 0xa9, 0xe5, 0xb9, 0xf4, 0x32, 0xf6, 0x2d, 0x4a, 0x82, - 0x16, 0x09, 0x56, 0xfd, 0x83, 0x26, 0xe3, 0xd1, 0x6e, 0x81, 0xd5, 0xd6, 0x95, 0x3d, 0x12, 0xe2, - 0x2b, 0xab, 0x4d, 0xe2, 0x92, 0x00, 0x87, 0xc4, 0xac, 0xfa, 0x81, 0x17, 0x7a, 0xf0, 0xab, 0x42, - 0x5d, 0xb5, 0x4b, 0xfa, 0x6d, 0xa5, 0xae, 0xea, 0x1f, 0x34, 0x19, 0x8f, 0x76, 0x0b, 0x54, 0xa5, - 0xba, 0xc5, 0xcb, 0x4d, 0x2b, 0xdc, 0x8f, 0xf6, 0xaa, 0x86, 0xe7, 0xac, 0x36, 0xbd, 0xa6, 0xb7, - 0xca, 0xb5, 0xee, 0x45, 0x0d, 0xfe, 0xc5, 0x3f, 0xf8, 0x5f, 0x02, 0x6d, 0xf1, 0xb9, 0xc4, 0x78, - 0x07, 0x1b, 0xfb, 0x96, 0x4b, 0x82, 0xe3, 0xc4, 0x62, 0x87, 0x84, 0x78, 0xb5, 0xd5, 0x63, 0xe3, - 0xe2, 0xea, 0xa0, 0x55, 0x41, 0xe4, 0x86, 0x96, 0x43, 0x7a, 0x16, 0x7c, 0xf9, 0x41, 0x0b, 0xa8, - 0xb1, 0x4f, 0x1c, 0x9c, 0x5d, 0x57, 0x39, 0xd1, 0xc0, 0xfc, 0xba, 0xe7, 0xb6, 0x48, 0xc0, 0x76, - 0x89, 0xc8, 0x9d, 0x88, 0xd0, 0x10, 0xd6, 0x40, 0x3e, 0xb2, 0x4c, 0x5d, 0x5b, 0xd2, 0x56, 0x26, - 0x6b, 0xcf, 0xde, 0x6b, 0x97, 0xcf, 0x74, 0xda, 0xe5, 0xfc, 0xcd, 0xad, 0x8d, 0x93, 0x76, 0x79, - 0x79, 0x10, 0x52, 0x78, 0xec, 0x13, 0x5a, 0xbd, 0xb9, 0xb5, 0x81, 0xd8, 0x62, 0xf8, 0x0a, 0x98, - 0x37, 0x09, 0xb5, 0x02, 0x62, 0xae, 0xed, 0x6e, 0xdd, 0x12, 0xfa, 0xf5, 0x1c, 0xd7, 0x78, 0x41, - 0x6a, 0x9c, 0xdf, 0xc8, 0x0a, 0xa0, 0xde, 0x35, 0xf0, 0x1b, 0x60, 0xc2, 0xdb, 0xbb, 0x4d, 0x8c, - 0x90, 0xea, 0xf9, 0xa5, 0xfc, 0xca, 0xd4, 0xd5, 0xcb, 0xd5, 0xe4, 0x04, 0x95, 0x09, 0xfc, 0xd8, - 0xe4, 0x66, 0xab, 0x08, 0x1f, 0x6e, 0xc6, 0x27, 0x57, 0x9b, 0x95, 0x68, 0x13, 0x3b, 0x42, 0x0b, - 0x8a, 0xd5, 0x55, 0xfe, 0x90, 0x03, 0x30, 0xbd, 0x79, 0xea, 0x7b, 0x2e, 0x25, 0x43, 0xd9, 0x3d, - 0x05, 0x73, 0x06, 0xd7, 0x1c, 0x12, 0x53, 0xe2, 0xea, 0xb9, 0x4f, 0x63, 0xbd, 0x2e, 0xf1, 0xe7, - 0xd6, 0x33, 0xea, 0x50, 0x0f, 0x00, 0xbc, 0x01, 0xc6, 0x03, 0x42, 0x23, 0x3b, 0xd4, 0xf3, 0x4b, - 0xda, 0xca, 0xd4, 0xd5, 0x4b, 0x03, 0xa1, 0x78, 0x7c, 0xb3, 0xe0, 0xab, 0xb6, 0xae, 0x54, 0xeb, - 0x21, 0x0e, 0x23, 0x5a, 0x3b, 0x2b, 0x91, 0xc6, 0x11, 0xd7, 0x81, 0xa4, 0xae, 0xca, 0x8f, 0x72, - 0x60, 0x2e, 0xed, 0xa5, 0x96, 0x45, 0x0e, 0xe1, 0x21, 0x98, 0x08, 0x44, 0xb0, 0x70, 0x3f, 0x4d, - 0x5d, 0xdd, 0xad, 0x3e, 0x54, 0x5a, 0x55, 0x7b, 0x82, 0xb0, 0x36, 0xc5, 0xce, 0x4c, 0x7e, 0xa0, - 0x18, 0x0d, 0x7e, 0x1b, 0x14, 0x03, 0x79, 0x50, 0x3c, 0x9a, 0xa6, 0xae, 0x7e, 0x7d, 0x88, 0xc8, - 0x42, 0x71, 0x6d, 0xba, 0xd3, 0x2e, 0x17, 0xe3, 0x2f, 0xa4, 0x00, 0x2b, 0x1f, 0xe6, 0x40, 0x69, - 0x3d, 0xa2, 0xa1, 0xe7, 0x20, 0x42, 0xbd, 0x28, 0x30, 0xc8, 0xba, 0x67, 0x47, 0x8e, 0xbb, 0x41, - 0x1a, 0x96, 0x6b, 0x85, 0x2c, 0x5a, 0x97, 0xc0, 0x98, 0x8b, 0x1d, 0x22, 0xa3, 0x67, 0x5a, 0xfa, - 0x74, 0xec, 0x3a, 0x76, 0x08, 0xe2, 0x1c, 0x26, 0xc1, 0x82, 0x45, 0xe6, 0x82, 0x92, 0xb8, 0x71, - 0xec, 0x13, 0xc4, 0x39, 0xf0, 0x69, 0x30, 0xde, 0xf0, 0x02, 0x07, 0x8b, 0x73, 0x9c, 0x4c, 0x4e, - 0xe6, 0x65, 0x4e, 0x45, 0x92, 0x0b, 0x9f, 0x07, 0x53, 0x26, 0xa1, 0x46, 0x60, 0xf9, 0x0c, 0x5a, - 0x1f, 0xe3, 0xc2, 0xe7, 0xa4, 0xf0, 0xd4, 0x46, 0xc2, 0x42, 0x69, 0x39, 0x78, 0x09, 0x14, 0xfd, - 0xc0, 0xf2, 0x02, 0x2b, 0x3c, 0xd6, 0x0b, 0x4b, 0xda, 0x4a, 0xa1, 0x36, 0x27, 0xd7, 0x14, 0x77, - 0x25, 0x1d, 0x29, 0x09, 0xb8, 0x04, 0x8a, 0xaf, 0xd6, 0x77, 0xae, 0xef, 0xe2, 0x70, 0x5f, 0x1f, - 0xe7, 0x08, 0x63, 0x4c, 0x1a, 0x15, 0x6f, 0x4b, 0x6a, 0xe5, 0xdd, 0x1c, 0xd0, 0xb3, 0x5e, 0x89, - 0x5d, 0x0a, 0x5f, 0x06, 0x45, 0x1a, 0xb2, 0x8a, 0xd3, 0x3c, 0x96, 0x3e, 0x79, 0x26, 0x06, 0xab, - 0x4b, 0xfa, 0x49, 0xbb, 0x7c, 0x3e, 0x59, 0x11, 0x53, 0xb9, 0x3f, 0xd4, 0x5a, 0xf8, 0x5b, 0x0d, - 0x9c, 0x3b, 0x24, 0x7b, 0xfb, 0x9e, 0x77, 0xb0, 0x6e, 0x5b, 0xc4, 0x0d, 0xd7, 0x3d, 0xb7, 0x61, - 0x35, 0x65, 0x0c, 0xa0, 0x87, 0x8c, 0x81, 0xd7, 0x7a, 0x35, 0xd7, 0x1e, 0xef, 0xb4, 0xcb, 0xe7, - 0xfa, 0x30, 0x50, 0x3f, 0x3b, 0x2a, 0xef, 0xe5, 0xb3, 0x4e, 0x48, 0x05, 0xc5, 0x3b, 0xa0, 0xc8, - 0x92, 0xcd, 0xc4, 0x21, 0x96, 0xe9, 0xf2, 0xec, 0xe9, 0x52, 0x53, 0x64, 0xf6, 0x36, 0x09, 0x71, - 0x0d, 0x4a, 0xb7, 0x81, 0x84, 0x86, 0x94, 0x56, 0xf8, 0x5d, 0x30, 0x46, 0x7d, 0x62, 0x48, 0x77, - 0xbc, 0xfe, 0xb0, 0x29, 0x31, 0x60, 0x23, 0x75, 0x9f, 0x18, 0x49, 0xc4, 0xb2, 0x2f, 0xc4, 0x61, - 0xe1, 0xfb, 0x1a, 0x18, 0xa7, 0xbc, 0x8c, 0xc8, 0xd2, 0xf3, 0xe6, 0xa8, 0x2c, 0xc8, 0xd4, 0x2a, - 0xf1, 0x8d, 0x24, 0x78, 0xe5, 0xbf, 0x39, 0xb0, 0x3c, 0x68, 0xe9, 0xba, 0xe7, 0x9a, 0xe2, 0x38, - 0xb6, 0x64, 0x06, 0x8a, 0x78, 0x7c, 0x3e, 0x9d, 0x81, 0x27, 0xed, 0xf2, 0x53, 0x0f, 0x54, 0x90, - 0x4a, 0xd5, 0xaf, 0xa8, 0x7d, 0x8b, 0x74, 0x5e, 0xee, 0x36, 0xec, 0xa4, 0x5d, 0x9e, 0x55, 0xcb, - 0xba, 0x6d, 0x85, 0x2d, 0x00, 0x6d, 0x4c, 0xc3, 0x1b, 0x01, 0x76, 0xa9, 0x50, 0x6b, 0x39, 0x44, - 0xba, 0xef, 0x99, 0xd3, 0x85, 0x07, 0x5b, 0x51, 0x5b, 0x94, 0x90, 0xf0, 0x5a, 0x8f, 0x36, 0xd4, - 0x07, 0x81, 0x55, 0x97, 0x80, 0x60, 0xaa, 0x0a, 0x46, 0xaa, 0xee, 0x33, 0x2a, 0x92, 0x5c, 0xf8, - 0x05, 0x30, 0xe1, 0x10, 0x4a, 0x71, 0x93, 0xf0, 0x2a, 0x31, 0x99, 0x5c, 0xa4, 0xdb, 0x82, 0x8c, - 0x62, 0x3e, 0xeb, 0x22, 0x2e, 0x0e, 0xf2, 0xda, 0x35, 0x8b, 0x86, 0xf0, 0x8d, 0x9e, 0x04, 0xa8, - 0x9e, 0x6e, 0x87, 0x6c, 0x35, 0x0f, 0x7f, 0x55, 0xa2, 0x62, 0x4a, 0x2a, 0xf8, 0xbf, 0x03, 0x0a, - 0x56, 0x48, 0x9c, 0xf8, 0x86, 0x7d, 0x6d, 0x44, 0xb1, 0x57, 0x9b, 0x91, 0x36, 0x14, 0xb6, 0x18, - 0x1a, 0x12, 0xa0, 0x95, 0x3f, 0xe6, 0xc0, 0x13, 0x83, 0x96, 0xb0, 0xb2, 0x4f, 0x99, 0xc7, 0x7d, - 0x3b, 0x0a, 0xb0, 0x2d, 0x23, 0x4e, 0x79, 0x7c, 0x97, 0x53, 0x91, 0xe4, 0xb2, 0xc2, 0x4c, 0x2d, - 0xb7, 0x19, 0xd9, 0x38, 0x90, 0xe1, 0xa4, 0x76, 0x5d, 0x97, 0x74, 0xa4, 0x24, 0x60, 0x15, 0x00, - 0xba, 0xef, 0x05, 0x21, 0xc7, 0xe0, 0xad, 0xd1, 0x64, 0xed, 0x2c, 0x2b, 0x10, 0x75, 0x45, 0x45, - 0x29, 0x09, 0x76, 0xef, 0x1c, 0x58, 0xae, 0x29, 0x4f, 0x5d, 0x65, 0xf1, 0xd7, 0x2c, 0xd7, 0x44, - 0x9c, 0xc3, 0xf0, 0x6d, 0x8b, 0x86, 0x8c, 0x22, 0x8f, 0xbc, 0xcb, 0xeb, 0x5c, 0x52, 0x49, 0x30, - 0x7c, 0x83, 0xd5, 0x66, 0x2f, 0xb0, 0x08, 0xd5, 0xc7, 0x13, 0xfc, 0x75, 0x45, 0x45, 0x29, 0x89, - 0xca, 0xaf, 0x8b, 0x83, 0x83, 0x84, 0x95, 0x12, 0xf8, 0x24, 0x28, 0x34, 0x03, 0x2f, 0xf2, 0xa5, - 0x97, 0x94, 0xb7, 0x5f, 0x61, 0x44, 0x24, 0x78, 0x2c, 0x2a, 0x5b, 0x5d, 0xcd, 0xa4, 0x8a, 0xca, - 0xb8, 0x85, 0x8c, 0xf9, 0xf0, 0x07, 0x1a, 0x28, 0xb8, 0xd2, 0x39, 0x2c, 0xe4, 0xde, 0x18, 0x51, - 0x5c, 0x70, 0xf7, 0x26, 0xe6, 0x0a, 0xcf, 0x0b, 0x64, 0xf8, 0x1c, 0x28, 0x50, 0xc3, 0xf3, 0x89, - 0xf4, 0x7a, 0x29, 0x16, 0xaa, 0x33, 0xe2, 0x49, 0xbb, 0x3c, 0x13, 0xab, 0xe3, 0x04, 0x24, 0x84, - 0xe1, 0x0f, 0x35, 0x00, 0x5a, 0xd8, 0xb6, 0x4c, 0xcc, 0x2f, 0xf6, 0x02, 0x37, 0x7f, 0xb8, 0x61, - 0x7d, 0x4b, 0xa9, 0x17, 0x87, 0x96, 0x7c, 0xa3, 0x14, 0x34, 0xfc, 0x40, 0x03, 0xd3, 0x34, 0xda, - 0x0b, 0xe4, 0x2a, 0xca, 0x5b, 0x80, 0xa9, 0xab, 0xdf, 0x1c, 0xaa, 0x2d, 0xf5, 0x14, 0x40, 0x6d, - 0xae, 0xd3, 0x2e, 0x4f, 0xa7, 0x29, 0xa8, 0xcb, 0x00, 0xf8, 0x13, 0x0d, 0x14, 0xe5, 0x09, 0x53, - 0x7d, 0x82, 0x27, 0xfc, 0x5b, 0x23, 0x3a, 0x58, 0x19, 0x51, 0x49, 0x16, 0x48, 0x02, 0x45, 0xca, - 0x02, 0xf8, 0x0f, 0x0d, 0xe8, 0xd8, 0x14, 0x05, 0x1e, 0xdb, 0xbb, 0x81, 0xe5, 0x86, 0x24, 0x10, - 0x5d, 0x21, 0xd5, 0x8b, 0xdc, 0xbc, 0xe1, 0xde, 0x85, 0xd9, 0x8e, 0xb3, 0xb6, 0x24, 0xad, 0xd3, - 0xd7, 0x06, 0x98, 0x81, 0x06, 0x1a, 0xc8, 0x03, 0xcd, 0x50, 0xad, 0x97, 0x3e, 0x39, 0x82, 0x40, - 0x4b, 0x3a, 0x3b, 0x59, 0x1d, 0x92, 0x76, 0x3b, 0x05, 0x5d, 0xf9, 0x20, 0x9f, 0x6d, 0xad, 0xb3, - 0x97, 0x3e, 0xbc, 0x2b, 0x8c, 0x15, 0x5b, 0xa1, 0xba, 0xc6, 0x9d, 0xfb, 0xce, 0x88, 0xce, 0x5e, - 0xdd, 0xda, 0x49, 0xe3, 0xa5, 0x48, 0x14, 0xa5, 0xec, 0x80, 0xbf, 0xd2, 0xc0, 0x0c, 0x36, 0x0c, - 0xe2, 0x87, 0xc4, 0x14, 0xb5, 0x38, 0xf7, 0x19, 0x94, 0x9b, 0x05, 0x69, 0xd5, 0xcc, 0x5a, 0x1a, - 0x1a, 0x75, 0x5b, 0x02, 0x5f, 0x02, 0x67, 0x69, 0xe8, 0x05, 0xc4, 0x8c, 0x23, 0x57, 0xde, 0x13, - 0xb0, 0xd3, 0x2e, 0x9f, 0xad, 0x77, 0x71, 0x50, 0x46, 0xb2, 0xf2, 0x4b, 0x0d, 0x94, 0x1f, 0x90, - 0x19, 0xa7, 0x98, 0x76, 0x9e, 0x06, 0xe3, 0x7c, 0xbb, 0x26, 0xf7, 0x4a, 0x31, 0xd5, 0xb9, 0x71, - 0x2a, 0x92, 0x5c, 0x56, 0xd7, 0x19, 0x3e, 0xeb, 0x36, 0xf2, 0x5c, 0x50, 0xd5, 0xf5, 0xba, 0x20, - 0xa3, 0x98, 0x5f, 0xf9, 0x9f, 0x96, 0x0d, 0x95, 0x54, 0xb9, 0xa8, 0x1b, 0xd8, 0x26, 0x70, 0x03, - 0xcc, 0xb1, 0xbe, 0x14, 0x11, 0xdf, 0xb6, 0x0c, 0x4c, 0xf9, 0xf0, 0x22, 0x6c, 0x54, 0xf3, 0x74, - 0x3d, 0xc3, 0x47, 0x3d, 0x2b, 0xe0, 0xab, 0x00, 0x8a, 0x5e, 0xad, 0x4b, 0x8f, 0xb8, 0x76, 0x54, - 0xd7, 0x55, 0xef, 0x91, 0x40, 0x7d, 0x56, 0xc1, 0x75, 0x30, 0x6f, 0xe3, 0x3d, 0x62, 0xd7, 0x89, - 0x4d, 0x8c, 0xd0, 0x0b, 0xb8, 0x2a, 0x31, 0xde, 0x2d, 0x74, 0xda, 0xe5, 0xf9, 0x6b, 0x59, 0x26, - 0xea, 0x95, 0xaf, 0x2c, 0x67, 0x4f, 0x24, 0xbd, 0x71, 0xd1, 0x01, 0xff, 0x2e, 0x07, 0x16, 0x07, - 0x57, 0x57, 0xf8, 0x6e, 0xd2, 0xa8, 0x8b, 0x3e, 0xec, 0xad, 0x51, 0x55, 0x72, 0xd9, 0xa9, 0x83, - 0xde, 0x2e, 0x1d, 0x7e, 0x8f, 0x5d, 0x8a, 0xd8, 0x8e, 0x07, 0xf8, 0x37, 0x47, 0x66, 0x02, 0x03, - 0xa9, 0x4d, 0x8a, 0xfb, 0x16, 0xdb, 0xfc, 0x7a, 0xc5, 0x36, 0xa9, 0xfc, 0x49, 0xcb, 0xce, 0x6a, - 0xc9, 0xed, 0x07, 0x7f, 0xaa, 0x81, 0x59, 0xcf, 0x27, 0xee, 0xda, 0xee, 0xd6, 0xad, 0x2f, 0xd5, - 0xf9, 0xab, 0x99, 0x74, 0xd5, 0xf5, 0x87, 0xb4, 0x93, 0x8d, 0xd1, 0x42, 0xe1, 0x6e, 0xe0, 0xf9, - 0xb4, 0x76, 0xae, 0xd3, 0x2e, 0xcf, 0xee, 0x74, 0x43, 0xa1, 0x2c, 0x76, 0xc5, 0x01, 0x0b, 0x9b, - 0x47, 0x21, 0x09, 0x5c, 0x6c, 0x6f, 0x78, 0x46, 0xe4, 0x10, 0x37, 0x14, 0x86, 0x66, 0xa6, 0x7f, - 0xed, 0x94, 0xd3, 0xff, 0x13, 0x20, 0x1f, 0x05, 0xb6, 0x8c, 0xe2, 0x29, 0xf5, 0xba, 0x85, 0xae, - 0x21, 0x46, 0xaf, 0x2c, 0x83, 0x31, 0x66, 0x27, 0xbc, 0x00, 0xf2, 0x01, 0x3e, 0xe4, 0x5a, 0xa7, - 0x6b, 0x13, 0x4c, 0x04, 0xe1, 0x43, 0xc4, 0x68, 0x95, 0x3f, 0x5f, 0x04, 0xb3, 0x99, 0xbd, 0xc0, - 0x45, 0x90, 0x53, 0x4f, 0x66, 0x40, 0x2a, 0xcd, 0x6d, 0x6d, 0xa0, 0x9c, 0x65, 0xc2, 0x17, 0xc0, - 0xb8, 0x78, 0x7d, 0x94, 0xa0, 0x65, 0x55, 0x02, 0x38, 0x95, 0x75, 0x41, 0x89, 0x3a, 0x66, 0x88, - 0x14, 0xe7, 0x36, 0x90, 0x86, 0xcc, 0x12, 0x61, 0x03, 0x69, 0x20, 0x46, 0xfb, 0xb4, 0x4f, 0x1f, - 0xf1, 0xdb, 0x4b, 0xe1, 0x14, 0x6f, 0x2f, 0xe3, 0x9f, 0xf8, 0xf6, 0xf2, 0x24, 0x28, 0x84, 0x56, - 0x68, 0x13, 0x7d, 0xa2, 0xbb, 0x59, 0xbd, 0xc1, 0x88, 0x48, 0xf0, 0xe0, 0x6d, 0x30, 0x61, 0x92, - 0x06, 0x8e, 0xec, 0x50, 0x2f, 0xf2, 0x10, 0x5a, 0x1f, 0x42, 0x08, 0x89, 0x87, 0xb1, 0x0d, 0xa1, - 0x17, 0xc5, 0x00, 0xf0, 0x29, 0x30, 0xe1, 0xe0, 0x23, 0xcb, 0x89, 0x1c, 0x7e, 0x8d, 0x6b, 0x42, - 0x6c, 0x5b, 0x90, 0x50, 0xcc, 0x63, 0x95, 0x91, 0x1c, 0x19, 0x76, 0x44, 0xad, 0x16, 0x91, 0x4c, - 0x1d, 0xf0, 0x82, 0xab, 0x2a, 0xe3, 0x66, 0x86, 0x8f, 0x7a, 0x56, 0x70, 0x30, 0xcb, 0xe5, 0x8b, - 0xa7, 0x52, 0x60, 0x82, 0x84, 0x62, 0x5e, 0x37, 0x98, 0x94, 0x9f, 0x1e, 0x04, 0x26, 0x17, 0xf7, - 0xac, 0x80, 0x5f, 0x04, 0x93, 0x0e, 0x3e, 0xba, 0x46, 0xdc, 0x66, 0xb8, 0xaf, 0xcf, 0x2c, 0x69, - 0x2b, 0xf9, 0xda, 0x4c, 0xa7, 0x5d, 0x9e, 0xdc, 0x8e, 0x89, 0x28, 0xe1, 0x73, 0x61, 0xcb, 0x95, - 0xc2, 0x67, 0x53, 0xc2, 0x31, 0x11, 0x25, 0x7c, 0x76, 0xe9, 0xf8, 0x38, 0x64, 0xc9, 0xa5, 0xcf, - 0x76, 0x0f, 0x13, 0xbb, 0x82, 0x8c, 0x62, 0x3e, 0x5c, 0x01, 0x45, 0x07, 0x1f, 0xf1, 0xc1, 0x4f, - 0x9f, 0xe3, 0x6a, 0xf9, 0x23, 0xe1, 0xb6, 0xa4, 0x21, 0xc5, 0xe5, 0x92, 0x96, 0x2b, 0x24, 0xe7, - 0x53, 0x92, 0x92, 0x86, 0x14, 0x97, 0x05, 0x71, 0xe4, 0x5a, 0x77, 0x22, 0x22, 0x84, 0x21, 0xf7, - 0x8c, 0x0a, 0xe2, 0x9b, 0x09, 0x0b, 0xa5, 0xe5, 0xd8, 0xe0, 0xe5, 0x44, 0x76, 0x68, 0xf9, 0x36, - 0xd9, 0x69, 0xe8, 0xe7, 0xb8, 0xff, 0x79, 0x6b, 0xb5, 0xad, 0xa8, 0x28, 0x25, 0x01, 0x09, 0x18, - 0x23, 0x6e, 0xe4, 0xe8, 0x8f, 0xf1, 0x86, 0x69, 0x28, 0x21, 0xa8, 0x32, 0x67, 0xd3, 0x8d, 0x1c, - 0xc4, 0xd5, 0xc3, 0x17, 0xc0, 0x8c, 0x83, 0x8f, 0x58, 0x39, 0x20, 0x41, 0xc8, 0x46, 0xc2, 0x05, - 0xbe, 0xf9, 0x79, 0xd6, 0xa4, 0x6c, 0xa7, 0x19, 0xa8, 0x5b, 0x8e, 0x2f, 0xb4, 0xdc, 0xd4, 0xc2, - 0xf3, 0xa9, 0x85, 0x69, 0x06, 0xea, 0x96, 0x63, 0x9e, 0x0e, 0xc8, 0x9d, 0xc8, 0x0a, 0x88, 0xa9, - 0x3f, 0xce, 0xfb, 0x1a, 0xf9, 0x70, 0x2b, 0x68, 0x48, 0x71, 0x61, 0x2b, 0x7e, 0x21, 0xd0, 0x79, - 0x1a, 0xde, 0x1c, 0x6e, 0x25, 0xdf, 0x09, 0xd6, 0x82, 0x00, 0x1f, 0x8b, 0x9b, 0x26, 0xfd, 0x36, - 0x00, 0x29, 0x28, 0x60, 0xdb, 0xde, 0x69, 0xe8, 0x17, 0xb8, 0xef, 0x87, 0x7d, 0x83, 0xa8, 0xaa, - 0xb3, 0xc6, 0x40, 0x90, 0xc0, 0x62, 0xa0, 0x9e, 0xcb, 0x42, 0x63, 0x71, 0xb4, 0xa0, 0x3b, 0x0c, - 0x04, 0x09, 0x2c, 0xbe, 0x53, 0xf7, 0x78, 0xa7, 0xa1, 0x7f, 0x6e, 0xc4, 0x3b, 0x65, 0x20, 0x48, - 0x60, 0x41, 0x0b, 0xe4, 0x5d, 0x2f, 0xd4, 0x2f, 0x8e, 0xe4, 0x7a, 0xe6, 0x17, 0xce, 0x75, 0x2f, - 0x44, 0x0c, 0x03, 0xfe, 0x42, 0x03, 0xc0, 0x4f, 0x42, 0xf4, 0x89, 0xa1, 0x0c, 0x9e, 0x19, 0xc8, - 0x6a, 0x12, 0xdb, 0x9b, 0x6e, 0x18, 0x1c, 0x27, 0xa3, 0x47, 0x2a, 0x07, 0x52, 0x56, 0xc0, 0xdf, - 0x6b, 0xe0, 0xb1, 0xf4, 0x6c, 0xa7, 0xcc, 0x2b, 0x71, 0x8f, 0xdc, 0x18, 0x76, 0x98, 0xd7, 0x3c, - 0xcf, 0xae, 0xe9, 0x9d, 0x76, 0xf9, 0xb1, 0xb5, 0x3e, 0xa8, 0xa8, 0xaf, 0x2d, 0xf0, 0x2f, 0x1a, - 0x98, 0x97, 0x55, 0x34, 0x65, 0x61, 0x99, 0x3b, 0x90, 0x0c, 0xdb, 0x81, 0x59, 0x1c, 0xe1, 0x47, - 0xf5, 0x83, 0x63, 0x0f, 0x1f, 0xf5, 0x9a, 0x06, 0xff, 0xae, 0x81, 0x69, 0x93, 0xf8, 0xc4, 0x35, - 0x89, 0x6b, 0x30, 0x5b, 0x97, 0x86, 0x32, 0x69, 0x66, 0x6d, 0xdd, 0x48, 0x41, 0x08, 0x33, 0xab, - 0xd2, 0xcc, 0xe9, 0x34, 0xeb, 0xa4, 0x5d, 0x3e, 0x9f, 0x2c, 0x4d, 0x73, 0x50, 0x97, 0x95, 0xf0, - 0x43, 0x0d, 0xcc, 0x26, 0x07, 0x20, 0xae, 0x94, 0xe5, 0x11, 0xc6, 0x01, 0x6f, 0x5f, 0xd7, 0xba, - 0x01, 0x51, 0xd6, 0x02, 0xf8, 0x57, 0x8d, 0x75, 0x6a, 0xf1, 0xdc, 0x48, 0xf5, 0x0a, 0xf7, 0xe5, - 0xdb, 0x43, 0xf7, 0xa5, 0x42, 0x10, 0xae, 0xbc, 0x94, 0xb4, 0x82, 0x8a, 0x73, 0xd2, 0x2e, 0x2f, - 0xa4, 0x3d, 0xa9, 0x18, 0x28, 0x6d, 0x21, 0xfc, 0xb1, 0x06, 0xa6, 0x49, 0xd2, 0x71, 0x53, 0xfd, - 0xc9, 0xa1, 0x38, 0xb1, 0x6f, 0x13, 0x2f, 0x5e, 0xbb, 0x52, 0x2c, 0x8a, 0xba, 0xb0, 0x59, 0x07, - 0x49, 0x8e, 0xb0, 0xe3, 0xdb, 0x44, 0xff, 0xfc, 0x90, 0x3b, 0xc8, 0x4d, 0xa1, 0x17, 0xc5, 0x00, - 0x8b, 0x6c, 0xf2, 0xc9, 0x64, 0x0e, 0x9c, 0x03, 0xf9, 0x03, 0x22, 0x7f, 0xb9, 0x43, 0xec, 0x4f, - 0x68, 0x82, 0x42, 0x0b, 0xdb, 0x51, 0x3c, 0xbc, 0x0d, 0xb9, 0xea, 0x22, 0xa1, 0xfc, 0xa5, 0xdc, - 0x8b, 0xda, 0xe2, 0x5d, 0x0d, 0x9c, 0xef, 0x9f, 0xd0, 0x8f, 0xd4, 0xac, 0xdf, 0x68, 0x60, 0xbe, - 0x27, 0x77, 0xfb, 0x58, 0x74, 0xa7, 0xdb, 0xa2, 0xd7, 0x87, 0x9d, 0x84, 0xf5, 0x30, 0xb0, 0xdc, - 0x26, 0xef, 0x3c, 0xd2, 0xe6, 0xfd, 0x4c, 0x03, 0x73, 0xd9, 0x74, 0x78, 0x94, 0xfe, 0xaa, 0xdc, - 0xcd, 0x81, 0xf3, 0xfd, 0x1b, 0x26, 0x18, 0xa8, 0xc9, 0x70, 0x34, 0x13, 0x36, 0x48, 0xa6, 0x4c, - 0x35, 0x54, 0xbe, 0xaf, 0x81, 0xa9, 0xdb, 0x4a, 0x2e, 0xfe, 0xcd, 0x68, 0xe8, 0xb3, 0x7d, 0x5c, - 0x7f, 0x12, 0x06, 0x45, 0x69, 0xdc, 0xca, 0xdf, 0x34, 0xb0, 0xd0, 0xb7, 0xb0, 0xb2, 0x11, 0x14, - 0xdb, 0xb6, 0x77, 0x28, 0x9e, 0x68, 0x52, 0x4f, 0x66, 0x6b, 0x9c, 0x8a, 0x24, 0x37, 0xe5, 0xbd, - 0xdc, 0x67, 0xe5, 0xbd, 0xca, 0x3f, 0x35, 0x70, 0xf1, 0x93, 0x22, 0xf1, 0x91, 0x1c, 0xe9, 0x0a, - 0x28, 0xca, 0xa6, 0xe8, 0x98, 0x1f, 0xa7, 0x9c, 0x03, 0x64, 0xd1, 0xe0, 0xff, 0xcc, 0x20, 0xfe, - 0xaa, 0xbc, 0xa7, 0x81, 0xb9, 0x3a, 0x09, 0x5a, 0x96, 0x41, 0x10, 0x69, 0x90, 0x80, 0xb8, 0x06, - 0x81, 0xab, 0x60, 0x92, 0xff, 0x58, 0xe3, 0x63, 0x23, 0x7e, 0xc9, 0x9c, 0x97, 0x2e, 0x9f, 0xbc, - 0x1e, 0x33, 0x50, 0x22, 0xa3, 0x5e, 0x3d, 0x73, 0x03, 0x5f, 0x3d, 0x2f, 0x82, 0x31, 0x3f, 0x79, - 0xe0, 0x2b, 0x32, 0x2e, 0x7f, 0xd3, 0xe3, 0xd4, 0xca, 0xbf, 0x34, 0xd0, 0xef, 0x1f, 0x0b, 0x60, - 0x0b, 0x4c, 0x50, 0x61, 0x9c, 0x74, 0xde, 0xce, 0x43, 0x3a, 0x2f, 0xbb, 0x55, 0x51, 0xf8, 0x63, - 0x6a, 0x0c, 0xc6, 0xfc, 0x67, 0xe0, 0x5a, 0xe4, 0x9a, 0xf2, 0x49, 0x6e, 0x5a, 0xf8, 0x6f, 0x7d, - 0x4d, 0xd0, 0x90, 0xe2, 0xc2, 0x0b, 0xe2, 0xf1, 0x28, 0xf5, 0x22, 0x13, 0x3f, 0x1c, 0xd5, 0x2e, - 0xdf, 0xbb, 0x5f, 0x3a, 0xf3, 0xd1, 0xfd, 0xd2, 0x99, 0x8f, 0xef, 0x97, 0xce, 0x7c, 0xbf, 0x53, - 0xd2, 0xee, 0x75, 0x4a, 0xda, 0x47, 0x9d, 0x92, 0xf6, 0x71, 0xa7, 0xa4, 0xfd, 0xbb, 0x53, 0xd2, - 0x7e, 0xfe, 0x9f, 0xd2, 0x99, 0x6f, 0x4d, 0x48, 0xd3, 0xfe, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xc9, - 0x4a, 0x8d, 0x8a, 0xee, 0x27, 0x00, 0x00, + // 2740 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x5a, 0xcd, 0x73, 0x1c, 0x47, + 0x15, 0xf7, 0xec, 0x6a, 0xa5, 0x55, 0x4b, 0xb2, 0xa4, 0xb6, 0xe5, 0x8c, 0x85, 0xbd, 0x2b, 0xad, + 0x49, 0x4a, 0x04, 0x7b, 0x15, 0x9b, 0x84, 0x84, 0x54, 0x71, 0xd0, 0x4a, 0x4a, 0x4a, 0xc6, 0xfa, + 0xa0, 0xd7, 0x76, 0x80, 0x7c, 0xb6, 0x66, 0x7b, 0x57, 0x63, 0xcd, 0x97, 0xa7, 0x67, 0x56, 0x52, + 0x05, 0x28, 0x48, 0x2a, 0x05, 0x45, 0x01, 0xa1, 0x88, 0x2f, 0x14, 0x70, 0x00, 0x8a, 0x0b, 0x45, + 0xc1, 0x01, 0x6e, 0xf0, 0x07, 0xf8, 0x98, 0xe2, 0x94, 0xd3, 0x16, 0xde, 0xfc, 0x0b, 0x54, 0x51, + 0xa5, 0x13, 0xd5, 0x1f, 0xd3, 0x33, 0x3b, 0xbb, 0x6b, 0xab, 0xe2, 0xdd, 0x98, 0x9b, 0xe6, 0xbd, + 0xd7, 0xef, 0xf7, 0xfa, 0xf5, 0x7b, 0xaf, 0x5f, 0xbf, 0x15, 0xa8, 0xef, 0xbf, 0x44, 0xcb, 0xa6, + 0xbb, 0xbc, 0x1f, 0xee, 0x12, 0xdf, 0x21, 0x01, 0xa1, 0xcb, 0x4d, 0xe2, 0xd4, 0x5c, 0x7f, 0x59, + 0x32, 0xb0, 0x67, 0x92, 0xc3, 0x80, 0x38, 0xd4, 0x74, 0x1d, 0x7a, 0x05, 0x7b, 0x26, 0x25, 0x7e, + 0x93, 0xf8, 0xcb, 0xde, 0x7e, 0x83, 0xf1, 0x68, 0xa7, 0xc0, 0x72, 0xf3, 0xea, 0x2e, 0x09, 0xf0, + 0xd5, 0xe5, 0x06, 0x71, 0x88, 0x8f, 0x03, 0x52, 0x2b, 0x7b, 0xbe, 0x1b, 0xb8, 0xf0, 0xeb, 0x42, + 0x5d, 0xb9, 0x43, 0xfa, 0x6d, 0xa5, 0xae, 0xec, 0xed, 0x37, 0x18, 0x8f, 0x76, 0x0a, 0x94, 0xa5, + 0xba, 0xf9, 0x2b, 0x0d, 0x33, 0xd8, 0x0b, 0x77, 0xcb, 0x86, 0x6b, 0x2f, 0x37, 0xdc, 0x86, 0xbb, + 0xcc, 0xb5, 0xee, 0x86, 0x75, 0xfe, 0xc5, 0x3f, 0xf8, 0x5f, 0x02, 0x6d, 0xfe, 0xf9, 0xd8, 0x78, + 0x1b, 0x1b, 0x7b, 0xa6, 0x43, 0xfc, 0xa3, 0xd8, 0x62, 0x9b, 0x04, 0x78, 0xb9, 0xd9, 0x65, 0xe3, + 0xfc, 0x72, 0xbf, 0x55, 0x7e, 0xe8, 0x04, 0xa6, 0x4d, 0xba, 0x16, 0x7c, 0xf5, 0x51, 0x0b, 0xa8, + 0xb1, 0x47, 0x6c, 0x9c, 0x5e, 0x57, 0x3a, 0xd6, 0xc0, 0xec, 0xaa, 0xeb, 0x34, 0x89, 0xcf, 0x76, + 0x89, 0xc8, 0xdd, 0x90, 0xd0, 0x00, 0x56, 0x40, 0x36, 0x34, 0x6b, 0xba, 0xb6, 0xa0, 0x2d, 0x8d, + 0x57, 0x9e, 0xbb, 0xdf, 0x2a, 0x9e, 0x6a, 0xb7, 0x8a, 0xd9, 0x5b, 0x1b, 0x6b, 0xc7, 0xad, 0xe2, + 0x62, 0x3f, 0xa4, 0xe0, 0xc8, 0x23, 0xb4, 0x7c, 0x6b, 0x63, 0x0d, 0xb1, 0xc5, 0xf0, 0x55, 0x30, + 0x5b, 0x23, 0xd4, 0xf4, 0x49, 0x6d, 0x65, 0x67, 0xe3, 0xb6, 0xd0, 0xaf, 0x67, 0xb8, 0xc6, 0xf3, + 0x52, 0xe3, 0xec, 0x5a, 0x5a, 0x00, 0x75, 0xaf, 0x81, 0xdf, 0x02, 0x63, 0xee, 0xee, 0x1d, 0x62, + 0x04, 0x54, 0xcf, 0x2e, 0x64, 0x97, 0x26, 0xae, 0x5d, 0x29, 0xc7, 0x27, 0xa8, 0x4c, 0xe0, 0xc7, + 0x26, 0x37, 0x5b, 0x46, 0xf8, 0x60, 0x3d, 0x3a, 0xb9, 0xca, 0xb4, 0x44, 0x1b, 0xdb, 0x16, 0x5a, + 0x50, 0xa4, 0xae, 0xf4, 0x87, 0x0c, 0x80, 0xc9, 0xcd, 0x53, 0xcf, 0x75, 0x28, 0x19, 0xc8, 0xee, + 0x29, 0x98, 0x31, 0xb8, 0xe6, 0x80, 0xd4, 0x24, 0xae, 0x9e, 0xf9, 0x2c, 0xd6, 0xeb, 0x12, 0x7f, + 0x66, 0x35, 0xa5, 0x0e, 0x75, 0x01, 0xc0, 0x9b, 0x60, 0xd4, 0x27, 0x34, 0xb4, 0x02, 0x3d, 0xbb, + 0xa0, 0x2d, 0x4d, 0x5c, 0xbb, 0xdc, 0x17, 0x8a, 0xc7, 0x37, 0x0b, 0xbe, 0x72, 0xf3, 0x6a, 0xb9, + 0x1a, 0xe0, 0x20, 0xa4, 0x95, 0xd3, 0x12, 0x69, 0x14, 0x71, 0x1d, 0x48, 0xea, 0x2a, 0xfd, 0x38, + 0x03, 0x66, 0x92, 0x5e, 0x6a, 0x9a, 0xe4, 0x00, 0x1e, 0x80, 0x31, 0x5f, 0x04, 0x0b, 0xf7, 0xd3, + 0xc4, 0xb5, 0x9d, 0xf2, 0x63, 0xa5, 0x55, 0xb9, 0x2b, 0x08, 0x2b, 0x13, 0xec, 0xcc, 0xe4, 0x07, + 0x8a, 0xd0, 0xe0, 0xbb, 0x20, 0xef, 0xcb, 0x83, 0xe2, 0xd1, 0x34, 0x71, 0xed, 0x9b, 0x03, 0x44, + 0x16, 0x8a, 0x2b, 0x93, 0xed, 0x56, 0x31, 0x1f, 0x7d, 0x21, 0x05, 0x58, 0xfa, 0x28, 0x03, 0x0a, + 0xab, 0x21, 0x0d, 0x5c, 0x1b, 0x11, 0xea, 0x86, 0xbe, 0x41, 0x56, 0x5d, 0x2b, 0xb4, 0x9d, 0x35, + 0x52, 0x37, 0x1d, 0x33, 0x60, 0xd1, 0xba, 0x00, 0x46, 0x1c, 0x6c, 0x13, 0x19, 0x3d, 0x93, 0xd2, + 0xa7, 0x23, 0x5b, 0xd8, 0x26, 0x88, 0x73, 0x98, 0x04, 0x0b, 0x16, 0x99, 0x0b, 0x4a, 0xe2, 0xe6, + 0x91, 0x47, 0x10, 0xe7, 0xc0, 0x67, 0xc0, 0x68, 0xdd, 0xf5, 0x6d, 0x2c, 0xce, 0x71, 0x3c, 0x3e, + 0x99, 0x57, 0x38, 0x15, 0x49, 0x2e, 0x7c, 0x01, 0x4c, 0xd4, 0x08, 0x35, 0x7c, 0xd3, 0x63, 0xd0, + 0xfa, 0x08, 0x17, 0x3e, 0x23, 0x85, 0x27, 0xd6, 0x62, 0x16, 0x4a, 0xca, 0xc1, 0xcb, 0x20, 0xef, + 0xf9, 0xa6, 0xeb, 0x9b, 0xc1, 0x91, 0x9e, 0x5b, 0xd0, 0x96, 0x72, 0x95, 0x19, 0xb9, 0x26, 0xbf, + 0x23, 0xe9, 0x48, 0x49, 0xc0, 0x05, 0x90, 0xbf, 0x5e, 0xdd, 0xde, 0xda, 0xc1, 0xc1, 0x9e, 0x3e, + 0xca, 0x11, 0x46, 0x98, 0x34, 0xca, 0xdf, 0x91, 0xd4, 0xd2, 0x7b, 0x19, 0xa0, 0xa7, 0xbd, 0x12, + 0xb9, 0x14, 0xbe, 0x02, 0xf2, 0x34, 0x60, 0x15, 0xa7, 0x71, 0x24, 0x7d, 0xf2, 0x6c, 0x04, 0x56, + 0x95, 0xf4, 0xe3, 0x56, 0xf1, 0x5c, 0xbc, 0x22, 0xa2, 0x72, 0x7f, 0xa8, 0xb5, 0xf0, 0xb7, 0x1a, + 0x38, 0x73, 0x40, 0x76, 0xf7, 0x5c, 0x77, 0x7f, 0xd5, 0x32, 0x89, 0x13, 0xac, 0xba, 0x4e, 0xdd, + 0x6c, 0xc8, 0x18, 0x40, 0x8f, 0x19, 0x03, 0xaf, 0x75, 0x6b, 0xae, 0x3c, 0xd5, 0x6e, 0x15, 0xcf, + 0xf4, 0x60, 0xa0, 0x5e, 0x76, 0x94, 0xde, 0xcf, 0xa6, 0x9d, 0x90, 0x08, 0x8a, 0x77, 0x40, 0x9e, + 0x25, 0x5b, 0x0d, 0x07, 0x58, 0xa6, 0xcb, 0x73, 0x27, 0x4b, 0x4d, 0x91, 0xd9, 0x9b, 0x24, 0xc0, + 0x15, 0x28, 0xdd, 0x06, 0x62, 0x1a, 0x52, 0x5a, 0xe1, 0xf7, 0xc0, 0x08, 0xf5, 0x88, 0x21, 0xdd, + 0xf1, 0xfa, 0xe3, 0xa6, 0x44, 0x9f, 0x8d, 0x54, 0x3d, 0x62, 0xc4, 0x11, 0xcb, 0xbe, 0x10, 0x87, + 0x85, 0x1f, 0x68, 0x60, 0x94, 0xf2, 0x32, 0x22, 0x4b, 0xcf, 0x9b, 0xc3, 0xb2, 0x20, 0x55, 0xab, + 0xc4, 0x37, 0x92, 0xe0, 0xa5, 0xff, 0x64, 0xc0, 0x62, 0xbf, 0xa5, 0xab, 0xae, 0x53, 0x13, 0xc7, + 0xb1, 0x21, 0x33, 0x50, 0xc4, 0xe3, 0x0b, 0xc9, 0x0c, 0x3c, 0x6e, 0x15, 0x9f, 0x7e, 0xa4, 0x82, + 0x44, 0xaa, 0x7e, 0x4d, 0xed, 0x5b, 0xa4, 0xf3, 0x62, 0xa7, 0x61, 0xc7, 0xad, 0xe2, 0xb4, 0x5a, + 0xd6, 0x69, 0x2b, 0x6c, 0x02, 0x68, 0x61, 0x1a, 0xdc, 0xf4, 0xb1, 0x43, 0x85, 0x5a, 0xd3, 0x26, + 0xd2, 0x7d, 0xcf, 0x9e, 0x2c, 0x3c, 0xd8, 0x8a, 0xca, 0xbc, 0x84, 0x84, 0x37, 0xba, 0xb4, 0xa1, + 0x1e, 0x08, 0xac, 0xba, 0xf8, 0x04, 0x53, 0x55, 0x30, 0x12, 0x75, 0x9f, 0x51, 0x91, 0xe4, 0xc2, + 0x2f, 0x81, 0x31, 0x9b, 0x50, 0x8a, 0x1b, 0x84, 0x57, 0x89, 0xf1, 0xf8, 0x22, 0xdd, 0x14, 0x64, + 0x14, 0xf1, 0x59, 0x17, 0x71, 0xa1, 0x9f, 0xd7, 0x6e, 0x98, 0x34, 0x80, 0x6f, 0x74, 0x25, 0x40, + 0xf9, 0x64, 0x3b, 0x64, 0xab, 0x79, 0xf8, 0xab, 0x12, 0x15, 0x51, 0x12, 0xc1, 0xff, 0x5d, 0x90, + 0x33, 0x03, 0x62, 0x47, 0x37, 0xec, 0x6b, 0x43, 0x8a, 0xbd, 0xca, 0x94, 0xb4, 0x21, 0xb7, 0xc1, + 0xd0, 0x90, 0x00, 0x2d, 0xfd, 0x31, 0x03, 0x2e, 0xf6, 0x5b, 0xc2, 0xca, 0x3e, 0x65, 0x1e, 0xf7, + 0xac, 0xd0, 0xc7, 0x96, 0x8c, 0x38, 0xe5, 0xf1, 0x1d, 0x4e, 0x45, 0x92, 0xcb, 0x0a, 0x33, 0x35, + 0x9d, 0x46, 0x68, 0x61, 0x5f, 0x86, 0x93, 0xda, 0x75, 0x55, 0xd2, 0x91, 0x92, 0x80, 0x65, 0x00, + 0xe8, 0x9e, 0xeb, 0x07, 0x1c, 0x83, 0xb7, 0x46, 0xe3, 0x95, 0xd3, 0xac, 0x40, 0x54, 0x15, 0x15, + 0x25, 0x24, 0xd8, 0xbd, 0xb3, 0x6f, 0x3a, 0x35, 0x79, 0xea, 0x2a, 0x8b, 0xbf, 0x61, 0x3a, 0x35, + 0xc4, 0x39, 0x0c, 0xdf, 0x32, 0x69, 0xc0, 0x28, 0xf2, 0xc8, 0x3b, 0xbc, 0xce, 0x25, 0x95, 0x04, + 0xc3, 0x37, 0x58, 0x6d, 0x76, 0x7d, 0x93, 0x50, 0x7d, 0x34, 0xc6, 0x5f, 0x55, 0x54, 0x94, 0x90, + 0x28, 0xfd, 0x3a, 0xdf, 0x3f, 0x48, 0x58, 0x29, 0x81, 0x97, 0x40, 0xae, 0xe1, 0xbb, 0xa1, 0x27, + 0xbd, 0xa4, 0xbc, 0xfd, 0x2a, 0x23, 0x22, 0xc1, 0x63, 0x51, 0xd9, 0xec, 0x68, 0x26, 0x55, 0x54, + 0x46, 0x2d, 0x64, 0xc4, 0x87, 0x3f, 0xd4, 0x40, 0xce, 0x91, 0xce, 0x61, 0x21, 0xf7, 0xc6, 0x90, + 0xe2, 0x82, 0xbb, 0x37, 0x36, 0x57, 0x78, 0x5e, 0x20, 0xc3, 0xe7, 0x41, 0x8e, 0x1a, 0xae, 0x47, + 0xa4, 0xd7, 0x0b, 0x91, 0x50, 0x95, 0x11, 0x8f, 0x5b, 0xc5, 0xa9, 0x48, 0x1d, 0x27, 0x20, 0x21, + 0x0c, 0x7f, 0xa4, 0x01, 0xd0, 0xc4, 0x96, 0x59, 0xc3, 0xfc, 0x62, 0xcf, 0x71, 0xf3, 0x07, 0x1b, + 0xd6, 0xb7, 0x95, 0x7a, 0x71, 0x68, 0xf1, 0x37, 0x4a, 0x40, 0xc3, 0x0f, 0x35, 0x30, 0x49, 0xc3, + 0x5d, 0x5f, 0xae, 0xa2, 0xbc, 0x05, 0x98, 0xb8, 0xf6, 0xed, 0x81, 0xda, 0x52, 0x4d, 0x00, 0x54, + 0x66, 0xda, 0xad, 0xe2, 0x64, 0x92, 0x82, 0x3a, 0x0c, 0x80, 0x3f, 0xd5, 0x40, 0x5e, 0x9e, 0x30, + 0xd5, 0xc7, 0x78, 0xc2, 0xbf, 0x35, 0xa4, 0x83, 0x95, 0x11, 0x15, 0x67, 0x81, 0x24, 0x50, 0xa4, + 0x2c, 0x80, 0xff, 0xd0, 0x80, 0x8e, 0x6b, 0xa2, 0xc0, 0x63, 0x6b, 0xc7, 0x37, 0x9d, 0x80, 0xf8, + 0xa2, 0x2b, 0xa4, 0x7a, 0x9e, 0x9b, 0x37, 0xd8, 0xbb, 0x30, 0xdd, 0x71, 0x56, 0x16, 0xa4, 0x75, + 0xfa, 0x4a, 0x1f, 0x33, 0x50, 0x5f, 0x03, 0x79, 0xa0, 0x19, 0xaa, 0xf5, 0xd2, 0xc7, 0x87, 0x10, + 0x68, 0x71, 0x67, 0x27, 0xab, 0x43, 0xdc, 0x6e, 0x27, 0xa0, 0x4b, 0x1f, 0x66, 0xd3, 0xad, 0x75, + 0xfa, 0xd2, 0x87, 0xf7, 0x84, 0xb1, 0x62, 0x2b, 0x54, 0xd7, 0xb8, 0x73, 0xdf, 0x19, 0xd2, 0xd9, + 0xab, 0x5b, 0x3b, 0x6e, 0xbc, 0x14, 0x89, 0xa2, 0x84, 0x1d, 0xf0, 0x57, 0x1a, 0x98, 0xc2, 0x86, + 0x41, 0xbc, 0x80, 0xd4, 0x44, 0x2d, 0xce, 0x7c, 0x0e, 0xe5, 0x66, 0x4e, 0x5a, 0x35, 0xb5, 0x92, + 0x84, 0x46, 0x9d, 0x96, 0xc0, 0x97, 0xc1, 0x69, 0x1a, 0xb8, 0x3e, 0xa9, 0x45, 0x91, 0x2b, 0xef, + 0x09, 0xd8, 0x6e, 0x15, 0x4f, 0x57, 0x3b, 0x38, 0x28, 0x25, 0x59, 0xfa, 0x74, 0x04, 0x14, 0x1f, + 0x91, 0x19, 0x27, 0x78, 0xed, 0x3c, 0x03, 0x46, 0xf9, 0x76, 0x6b, 0xdc, 0x2b, 0xf9, 0x44, 0xe7, + 0xc6, 0xa9, 0x48, 0x72, 0x59, 0x5d, 0x67, 0xf8, 0xac, 0xdb, 0xc8, 0x72, 0x41, 0x55, 0xd7, 0xab, + 0x82, 0x8c, 0x22, 0x3e, 0x7c, 0x17, 0x8c, 0x8a, 0x69, 0x06, 0x2f, 0xaa, 0x43, 0x2c, 0x8c, 0x80, + 0xdb, 0xc9, 0xa1, 0x90, 0x84, 0xec, 0x2e, 0x88, 0xb9, 0x27, 0x5d, 0x10, 0x1f, 0x5a, 0x81, 0x46, + 0xff, 0xcf, 0x2b, 0x50, 0xe9, 0xbf, 0x5a, 0x3a, 0xef, 0x13, 0x5b, 0xad, 0x1a, 0xd8, 0x22, 0x70, + 0x0d, 0xcc, 0xb0, 0x47, 0x06, 0x22, 0x9e, 0x65, 0x1a, 0x98, 0xf2, 0x97, 0xa8, 0x08, 0x38, 0x35, + 0x1c, 0xa9, 0xa6, 0xf8, 0xa8, 0x6b, 0x05, 0xbc, 0x0e, 0xa0, 0x68, 0xbc, 0x3b, 0xf4, 0x88, 0x1e, + 0x42, 0xb5, 0xd0, 0xd5, 0x2e, 0x09, 0xd4, 0x63, 0x15, 0x5c, 0x05, 0xb3, 0x16, 0xde, 0x25, 0x56, + 0x95, 0x58, 0xc4, 0x08, 0x5c, 0x9f, 0xab, 0x12, 0x6f, 0xf5, 0xb9, 0x76, 0xab, 0x38, 0x7b, 0x23, + 0xcd, 0x44, 0xdd, 0xf2, 0xa5, 0xc5, 0x74, 0x7a, 0x25, 0x37, 0x2e, 0x9e, 0x33, 0xbf, 0xcb, 0x80, + 0xf9, 0xfe, 0x91, 0x01, 0xdf, 0x8b, 0x5f, 0x5d, 0xa2, 0xa9, 0x7e, 0x6b, 0x58, 0x51, 0x28, 0x9f, + 0x5d, 0xa0, 0xfb, 0xc9, 0x05, 0xbf, 0xcf, 0x3a, 0x1c, 0x6c, 0x45, 0xd3, 0x98, 0x37, 0x87, 0x66, + 0x02, 0x03, 0xa9, 0x8c, 0x8b, 0xe6, 0x09, 0x5b, 0xbc, 0x57, 0xc2, 0x16, 0x29, 0xfd, 0x49, 0x4b, + 0x3f, 0xbc, 0xe3, 0x0c, 0x86, 0x3f, 0xd3, 0xc0, 0xb4, 0xeb, 0x11, 0x67, 0x65, 0x67, 0xe3, 0xf6, + 0x57, 0x44, 0x26, 0x4b, 0x57, 0x6d, 0x3d, 0xa6, 0x9d, 0xd7, 0xab, 0xdb, 0x5b, 0x42, 0xe1, 0x8e, + 0xef, 0x7a, 0xb4, 0x72, 0xa6, 0xdd, 0x2a, 0x4e, 0x6f, 0x77, 0x42, 0xa1, 0x34, 0x76, 0xc9, 0x06, + 0x73, 0xeb, 0x87, 0x01, 0xf1, 0x1d, 0x6c, 0xad, 0xb9, 0x46, 0x68, 0x13, 0x27, 0x10, 0x86, 0xa6, + 0x46, 0x39, 0xda, 0x09, 0x47, 0x39, 0x17, 0x41, 0x36, 0xf4, 0x2d, 0x19, 0xc5, 0x13, 0x6a, 0x54, + 0x89, 0x6e, 0x20, 0x46, 0x2f, 0x2d, 0x82, 0x11, 0x66, 0x27, 0x3c, 0x0f, 0xb2, 0x3e, 0x3e, 0xe0, + 0x5a, 0x27, 0x2b, 0x63, 0x4c, 0x04, 0xe1, 0x03, 0xc4, 0x68, 0xa5, 0x3f, 0x5f, 0x00, 0xd3, 0xa9, + 0xbd, 0xc0, 0x79, 0x90, 0x51, 0xf3, 0x4f, 0x20, 0x95, 0x66, 0x36, 0xd6, 0x50, 0xc6, 0xac, 0xc1, + 0x17, 0x55, 0xf1, 0x15, 0xa0, 0x45, 0x55, 0xcf, 0x39, 0x95, 0xb5, 0xb4, 0xb1, 0x3a, 0x66, 0x48, + 0x54, 0x38, 0x99, 0x0d, 0xa4, 0x2e, 0xb3, 0x44, 0xd8, 0x40, 0xea, 0x88, 0xd1, 0x3e, 0xeb, 0x1c, + 0x2b, 0x1a, 0xa4, 0xe5, 0x4e, 0x30, 0x48, 0x1b, 0x7d, 0xe8, 0x20, 0xed, 0x12, 0xc8, 0x05, 0x66, + 0x60, 0x11, 0x7d, 0xac, 0xf3, 0xe5, 0x71, 0x93, 0x11, 0x91, 0xe0, 0xc1, 0x3b, 0x60, 0xac, 0x46, + 0xea, 0x38, 0xb4, 0x02, 0x3d, 0xcf, 0x43, 0x68, 0x75, 0x00, 0x21, 0x24, 0xa6, 0x9c, 0x6b, 0x42, + 0x2f, 0x8a, 0x00, 0xe0, 0xd3, 0x60, 0xcc, 0xc6, 0x87, 0xa6, 0x1d, 0xda, 0xbc, 0x27, 0xd3, 0x84, + 0xd8, 0xa6, 0x20, 0xa1, 0x88, 0xc7, 0x2a, 0x23, 0x39, 0x34, 0xac, 0x90, 0x9a, 0x4d, 0x22, 0x99, + 0x3a, 0xe0, 0xb7, 0xa7, 0xaa, 0x8c, 0xeb, 0x29, 0x3e, 0xea, 0x5a, 0xc1, 0xc1, 0x4c, 0x87, 0x2f, + 0x9e, 0x48, 0x80, 0x09, 0x12, 0x8a, 0x78, 0x9d, 0x60, 0x52, 0x7e, 0xb2, 0x1f, 0x98, 0x5c, 0xdc, + 0xb5, 0x02, 0x7e, 0x19, 0x8c, 0xdb, 0xf8, 0xf0, 0x06, 0x71, 0x1a, 0xc1, 0x9e, 0x3e, 0xb5, 0xa0, + 0x2d, 0x65, 0x2b, 0x53, 0xed, 0x56, 0x71, 0x7c, 0x33, 0x22, 0xa2, 0x98, 0xcf, 0x85, 0x4d, 0x47, + 0x0a, 0x9f, 0x4e, 0x08, 0x47, 0x44, 0x14, 0xf3, 0x59, 0x07, 0xe1, 0xe1, 0x80, 0x25, 0x97, 0x3e, + 0xdd, 0xf9, 0x32, 0xdc, 0x11, 0x64, 0x14, 0xf1, 0xe1, 0x12, 0xc8, 0xdb, 0xf8, 0x90, 0xbf, 0xe2, + 0xf5, 0x19, 0xae, 0x96, 0x4f, 0x7c, 0x37, 0x25, 0x0d, 0x29, 0x2e, 0x97, 0x34, 0x1d, 0x21, 0x39, + 0x9b, 0x90, 0x94, 0x34, 0xa4, 0xb8, 0x2c, 0x88, 0x43, 0xc7, 0xbc, 0x1b, 0x12, 0x21, 0x0c, 0xb9, + 0x67, 0x54, 0x10, 0xdf, 0x8a, 0x59, 0x28, 0x29, 0xc7, 0x5e, 0xd1, 0x76, 0x68, 0x05, 0xa6, 0x67, + 0x91, 0xed, 0xba, 0x7e, 0x86, 0xfb, 0x9f, 0xf7, 0xc9, 0x9b, 0x8a, 0x8a, 0x12, 0x12, 0x90, 0x80, + 0x11, 0xe2, 0x84, 0xb6, 0x7e, 0x96, 0x5f, 0xec, 0x03, 0x09, 0x41, 0x95, 0x39, 0xeb, 0x4e, 0x68, + 0x23, 0xae, 0x1e, 0xbe, 0x08, 0xa6, 0x6c, 0x7c, 0xc8, 0xca, 0x01, 0xf1, 0x03, 0xf6, 0xbe, 0x9f, + 0xe3, 0x9b, 0x9f, 0x65, 0x1d, 0xe7, 0x66, 0x92, 0x81, 0x3a, 0xe5, 0xf8, 0x42, 0xd3, 0x49, 0x2c, + 0x3c, 0x97, 0x58, 0x98, 0x64, 0xa0, 0x4e, 0x39, 0xe6, 0x69, 0x9f, 0xdc, 0x0d, 0x4d, 0x9f, 0xd4, + 0xf4, 0xa7, 0x78, 0x93, 0x2a, 0xa7, 0xf0, 0x82, 0x86, 0x14, 0x17, 0x36, 0xa3, 0x71, 0x8f, 0xce, + 0xd3, 0xf0, 0xd6, 0x60, 0x2b, 0xf9, 0xb6, 0xbf, 0xe2, 0xfb, 0xf8, 0x48, 0xdc, 0x34, 0xc9, 0x41, + 0x0f, 0xa4, 0x20, 0x87, 0x2d, 0x6b, 0xbb, 0xae, 0x9f, 0xe7, 0xbe, 0x1f, 0xf4, 0x0d, 0xa2, 0xaa, + 0xce, 0x0a, 0x03, 0x41, 0x02, 0x8b, 0x81, 0xba, 0x0e, 0x0b, 0x8d, 0xf9, 0xe1, 0x82, 0x6e, 0x33, + 0x10, 0x24, 0xb0, 0xf8, 0x4e, 0x9d, 0xa3, 0xed, 0xba, 0xfe, 0x85, 0x21, 0xef, 0x94, 0x81, 0x20, + 0x81, 0x05, 0x4d, 0x90, 0x75, 0xdc, 0x40, 0xbf, 0x30, 0x94, 0xeb, 0x99, 0x5f, 0x38, 0x5b, 0x6e, + 0x80, 0x18, 0x06, 0xfc, 0xa5, 0x06, 0x80, 0x17, 0x87, 0xe8, 0xc5, 0x81, 0x4c, 0x11, 0x52, 0x90, + 0xe5, 0x38, 0xb6, 0xd7, 0x9d, 0xc0, 0x3f, 0x8a, 0xdf, 0x91, 0x89, 0x1c, 0x48, 0x58, 0x01, 0x7f, + 0xaf, 0x81, 0xb3, 0xc9, 0x36, 0x59, 0x99, 0x57, 0xe0, 0x1e, 0xb9, 0x39, 0xe8, 0x30, 0xaf, 0xb8, + 0xae, 0x55, 0xd1, 0xdb, 0xad, 0xe2, 0xd9, 0x95, 0x1e, 0xa8, 0xa8, 0xa7, 0x2d, 0xf0, 0x2f, 0x1a, + 0x98, 0x95, 0x55, 0x34, 0x61, 0x61, 0x91, 0x3b, 0x90, 0x0c, 0xda, 0x81, 0x69, 0x1c, 0xe1, 0x47, + 0xf5, 0xeb, 0x71, 0x17, 0x1f, 0x75, 0x9b, 0x06, 0xff, 0xae, 0x81, 0xc9, 0x1a, 0xf1, 0x88, 0x53, + 0x23, 0x8e, 0xc1, 0x6c, 0x5d, 0x18, 0xc8, 0xd8, 0x20, 0x6d, 0xeb, 0x5a, 0x02, 0x42, 0x98, 0x59, + 0x96, 0x66, 0x4e, 0x26, 0x59, 0xc7, 0xad, 0xe2, 0xb9, 0x78, 0x69, 0x92, 0x83, 0x3a, 0xac, 0x84, + 0x1f, 0x69, 0x60, 0x3a, 0x3e, 0x00, 0x71, 0xa5, 0x2c, 0x0e, 0x31, 0x0e, 0x78, 0xfb, 0xba, 0xd2, + 0x09, 0x88, 0xd2, 0x16, 0xc0, 0xbf, 0x6a, 0xac, 0x53, 0x8b, 0xde, 0x7d, 0x54, 0x2f, 0x71, 0x5f, + 0xbe, 0x3d, 0x70, 0x5f, 0x2a, 0x04, 0xe1, 0xca, 0xcb, 0x71, 0x2b, 0xa8, 0x38, 0xc7, 0xad, 0xe2, + 0x5c, 0xd2, 0x93, 0x8a, 0x81, 0x92, 0x16, 0xc2, 0x9f, 0x68, 0x60, 0x92, 0xc4, 0x1d, 0x37, 0xd5, + 0x2f, 0x0d, 0xc4, 0x89, 0x3d, 0x9b, 0x78, 0xf1, 0x52, 0x4f, 0xb0, 0x28, 0xea, 0xc0, 0x66, 0x1d, + 0x24, 0x39, 0xc4, 0xb6, 0x67, 0x11, 0xfd, 0x8b, 0x03, 0xee, 0x20, 0xd7, 0x85, 0x5e, 0x14, 0x01, + 0xcc, 0xb3, 0x97, 0x4f, 0x2a, 0x73, 0xe0, 0x0c, 0xc8, 0xee, 0x13, 0xf9, 0x33, 0x2c, 0x62, 0x7f, + 0xc2, 0x1a, 0xc8, 0x35, 0xb1, 0x15, 0x46, 0x8f, 0xb7, 0x01, 0x57, 0x5d, 0x24, 0x94, 0xbf, 0x9c, + 0x79, 0x49, 0x9b, 0xbf, 0xa7, 0x81, 0x73, 0xbd, 0x13, 0xfa, 0x89, 0x9a, 0xf5, 0x1b, 0x0d, 0xcc, + 0x76, 0xe5, 0x6e, 0x0f, 0x8b, 0xee, 0x76, 0x5a, 0xf4, 0xfa, 0xa0, 0x93, 0xb0, 0x1a, 0xf8, 0xa6, + 0xd3, 0xe0, 0x9d, 0x47, 0xd2, 0xbc, 0x9f, 0x6b, 0x60, 0x26, 0x9d, 0x0e, 0x4f, 0xd2, 0x5f, 0xa5, + 0x7b, 0x19, 0x70, 0xae, 0x77, 0xc3, 0x04, 0x7d, 0xf5, 0x32, 0x1c, 0xce, 0x0b, 0xbb, 0xd7, 0x34, + 0xee, 0x03, 0x0d, 0x4c, 0xdc, 0x51, 0x72, 0xd1, 0x0f, 0x80, 0x03, 0x7f, 0xdb, 0x47, 0xf5, 0x27, + 0x66, 0x50, 0x94, 0xc4, 0x2d, 0xfd, 0x4d, 0x03, 0x73, 0x3d, 0x0b, 0x2b, 0x7b, 0x82, 0x62, 0xcb, + 0x72, 0x0f, 0xc4, 0x88, 0x26, 0x31, 0xff, 0x5c, 0xe1, 0x54, 0x24, 0xb9, 0x09, 0xef, 0x65, 0x3e, + 0x2f, 0xef, 0x95, 0xfe, 0xa9, 0x81, 0x0b, 0x0f, 0x8b, 0xc4, 0x27, 0x72, 0xa4, 0x4b, 0x20, 0x2f, + 0x9b, 0xa2, 0x23, 0x7e, 0x9c, 0xf2, 0x1d, 0x20, 0x8b, 0x06, 0xff, 0xcf, 0x14, 0xf1, 0x57, 0xe9, + 0x7d, 0x0d, 0xcc, 0x54, 0x89, 0xdf, 0x34, 0x0d, 0x82, 0x48, 0x9d, 0xf8, 0xc4, 0x31, 0x08, 0x5c, + 0x06, 0xe3, 0xfc, 0x97, 0x37, 0x0f, 0x1b, 0xd1, 0x58, 0x7a, 0x56, 0xba, 0x7c, 0x7c, 0x2b, 0x62, + 0xa0, 0x58, 0x46, 0x8d, 0xb0, 0x33, 0x7d, 0x47, 0xd8, 0x17, 0xc0, 0x88, 0x17, 0x0f, 0xf8, 0xf2, + 0x8c, 0xcb, 0x67, 0x7a, 0x9c, 0x5a, 0xfa, 0x97, 0x06, 0x7a, 0xfd, 0x97, 0x08, 0x6c, 0x82, 0x31, + 0x2a, 0x8c, 0x93, 0xce, 0xdb, 0x7e, 0x4c, 0xe7, 0xa5, 0xb7, 0x2a, 0x0a, 0x7f, 0x44, 0x8d, 0xc0, + 0x98, 0xff, 0x0c, 0x5c, 0x09, 0x9d, 0x9a, 0x1c, 0xc9, 0x4d, 0x0a, 0xff, 0xad, 0xae, 0x08, 0x1a, + 0x52, 0x5c, 0x78, 0x5e, 0x0c, 0x8f, 0x12, 0x13, 0x99, 0x68, 0x70, 0x54, 0xb9, 0x72, 0xff, 0x41, + 0xe1, 0xd4, 0xc7, 0x0f, 0x0a, 0xa7, 0x3e, 0x79, 0x50, 0x38, 0xf5, 0x83, 0x76, 0x41, 0xbb, 0xdf, + 0x2e, 0x68, 0x1f, 0xb7, 0x0b, 0xda, 0x27, 0xed, 0x82, 0xf6, 0xef, 0x76, 0x41, 0xfb, 0xc5, 0xa7, + 0x85, 0x53, 0xdf, 0x19, 0x93, 0xa6, 0xfd, 0x2f, 0x00, 0x00, 0xff, 0xff, 0xe7, 0xc5, 0xe4, 0x3a, + 0xbb, 0x29, 0x00, 0x00, } diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.proto b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.proto index 615c0306..8ee83cf5 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.proto +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.proto @@ -203,10 +203,14 @@ message CustomResourceDefinitionSpec { optional string scope = 4; // Validation describes the validation methods for CustomResources + // Optional, the global validation schema for all versions. + // Top-level and per-version schemas are mutually exclusive. // +optional optional CustomResourceValidation validation = 5; - // Subresources describes the subresources for CustomResources + // Subresources describes the subresources for CustomResource + // Optional, the global subresources for all versions. + // Top-level and per-version subresources are mutually exclusive. // +optional optional CustomResourceSubresources subresources = 6; @@ -225,6 +229,8 @@ message CustomResourceDefinitionSpec { repeated CustomResourceDefinitionVersion versions = 7; // AdditionalPrinterColumns are additional columns shown e.g. in kubectl next to the name. Defaults to a created-at column. + // Optional, the global columns for all versions. + // Top-level and per-version columns are mutually exclusive. // +optional repeated CustomResourceColumnDefinition additionalPrinterColumns = 8; @@ -262,6 +268,30 @@ message CustomResourceDefinitionVersion { // Storage flags the version as storage version. There must be exactly one // flagged as storage version. optional bool storage = 3; + + // Schema describes the schema for CustomResource used in validation, pruning, and defaulting. + // Top-level and per-version schemas are mutually exclusive. + // Per-version schemas must not all be set to identical values (top-level validation schema should be used instead) + // This field is alpha-level and is only honored by servers that enable the CustomResourceWebhookConversion feature. + // +optional + optional CustomResourceValidation schema = 4; + + // Subresources describes the subresources for CustomResource + // Top-level and per-version subresources are mutually exclusive. + // Per-version subresources must not all be set to identical values (top-level subresources should be used instead) + // This field is alpha-level and is only honored by servers that enable the CustomResourceWebhookConversion feature. + // +optional + optional CustomResourceSubresources subresources = 5; + + // AdditionalPrinterColumns are additional columns shown e.g. in kubectl next to the name. Defaults to a created-at column. + // Top-level and per-version columns are mutually exclusive. + // Per-version columns must not all be set to identical values (top-level columns should be used instead) + // This field is alpha-level and is only honored by servers that enable the CustomResourceWebhookConversion feature. + // NOTE: CRDs created prior to 1.13 populated the top-level additionalPrinterColumns field by default. To apply an + // update that changes to per-version additionalPrinterColumns, the top-level additionalPrinterColumns field must + // be explicitly set to null + // +optional + repeated CustomResourceColumnDefinition additionalPrinterColumns = 6; } // CustomResourceSubresourceScale defines how to serve the scale subresource for CustomResources. diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types.go index f810ef76..e99d9e49 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types.go @@ -47,9 +47,13 @@ type CustomResourceDefinitionSpec struct { // Scope indicates whether this resource is cluster or namespace scoped. Default is namespaced Scope ResourceScope `json:"scope" protobuf:"bytes,4,opt,name=scope,casttype=ResourceScope"` // Validation describes the validation methods for CustomResources + // Optional, the global validation schema for all versions. + // Top-level and per-version schemas are mutually exclusive. // +optional Validation *CustomResourceValidation `json:"validation,omitempty" protobuf:"bytes,5,opt,name=validation"` - // Subresources describes the subresources for CustomResources + // Subresources describes the subresources for CustomResource + // Optional, the global subresources for all versions. + // Top-level and per-version subresources are mutually exclusive. // +optional Subresources *CustomResourceSubresources `json:"subresources,omitempty" protobuf:"bytes,6,opt,name=subresources"` // Versions is the list of all supported versions for this resource. @@ -66,6 +70,8 @@ type CustomResourceDefinitionSpec struct { // +optional Versions []CustomResourceDefinitionVersion `json:"versions,omitempty" protobuf:"bytes,7,rep,name=versions"` // AdditionalPrinterColumns are additional columns shown e.g. in kubectl next to the name. Defaults to a created-at column. + // Optional, the global columns for all versions. + // Top-level and per-version columns are mutually exclusive. // +optional AdditionalPrinterColumns []CustomResourceColumnDefinition `json:"additionalPrinterColumns,omitempty" protobuf:"bytes,8,rep,name=additionalPrinterColumns"` @@ -159,6 +165,27 @@ type CustomResourceDefinitionVersion struct { // Storage flags the version as storage version. There must be exactly one // flagged as storage version. Storage bool `json:"storage" protobuf:"varint,3,opt,name=storage"` + // Schema describes the schema for CustomResource used in validation, pruning, and defaulting. + // Top-level and per-version schemas are mutually exclusive. + // Per-version schemas must not all be set to identical values (top-level validation schema should be used instead) + // This field is alpha-level and is only honored by servers that enable the CustomResourceWebhookConversion feature. + // +optional + Schema *CustomResourceValidation `json:"schema,omitempty" protobuf:"bytes,4,opt,name=schema"` + // Subresources describes the subresources for CustomResource + // Top-level and per-version subresources are mutually exclusive. + // Per-version subresources must not all be set to identical values (top-level subresources should be used instead) + // This field is alpha-level and is only honored by servers that enable the CustomResourceWebhookConversion feature. + // +optional + Subresources *CustomResourceSubresources `json:"subresources,omitempty" protobuf:"bytes,5,opt,name=subresources"` + // AdditionalPrinterColumns are additional columns shown e.g. in kubectl next to the name. Defaults to a created-at column. + // Top-level and per-version columns are mutually exclusive. + // Per-version columns must not all be set to identical values (top-level columns should be used instead) + // This field is alpha-level and is only honored by servers that enable the CustomResourceWebhookConversion feature. + // NOTE: CRDs created prior to 1.13 populated the top-level additionalPrinterColumns field by default. To apply an + // update that changes to per-version additionalPrinterColumns, the top-level additionalPrinterColumns field must + // be explicitly set to null + // +optional + AdditionalPrinterColumns []CustomResourceColumnDefinition `json:"additionalPrinterColumns,omitempty" protobuf:"bytes,6,rep,name=additionalPrinterColumns"` } // CustomResourceColumnDefinition specifies a column for server side printing. diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.conversion.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.conversion.go index 0980caef..cab8019b 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.conversion.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.conversion.go @@ -464,7 +464,17 @@ func autoConvert_v1beta1_CustomResourceDefinitionSpec_To_apiextensions_CustomRes out.Validation = nil } out.Subresources = (*apiextensions.CustomResourceSubresources)(unsafe.Pointer(in.Subresources)) - out.Versions = *(*[]apiextensions.CustomResourceDefinitionVersion)(unsafe.Pointer(&in.Versions)) + if in.Versions != nil { + in, out := &in.Versions, &out.Versions + *out = make([]apiextensions.CustomResourceDefinitionVersion, len(*in)) + for i := range *in { + if err := Convert_v1beta1_CustomResourceDefinitionVersion_To_apiextensions_CustomResourceDefinitionVersion(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Versions = nil + } out.AdditionalPrinterColumns = *(*[]apiextensions.CustomResourceColumnDefinition)(unsafe.Pointer(&in.AdditionalPrinterColumns)) out.Conversion = (*apiextensions.CustomResourceConversion)(unsafe.Pointer(in.Conversion)) return nil @@ -492,7 +502,17 @@ func autoConvert_apiextensions_CustomResourceDefinitionSpec_To_v1beta1_CustomRes out.Validation = nil } out.Subresources = (*CustomResourceSubresources)(unsafe.Pointer(in.Subresources)) - out.Versions = *(*[]CustomResourceDefinitionVersion)(unsafe.Pointer(&in.Versions)) + if in.Versions != nil { + in, out := &in.Versions, &out.Versions + *out = make([]CustomResourceDefinitionVersion, len(*in)) + for i := range *in { + if err := Convert_apiextensions_CustomResourceDefinitionVersion_To_v1beta1_CustomResourceDefinitionVersion(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Versions = nil + } out.AdditionalPrinterColumns = *(*[]CustomResourceColumnDefinition)(unsafe.Pointer(&in.AdditionalPrinterColumns)) out.Conversion = (*CustomResourceConversion)(unsafe.Pointer(in.Conversion)) return nil @@ -535,6 +555,17 @@ func autoConvert_v1beta1_CustomResourceDefinitionVersion_To_apiextensions_Custom out.Name = in.Name out.Served = in.Served out.Storage = in.Storage + if in.Schema != nil { + in, out := &in.Schema, &out.Schema + *out = new(apiextensions.CustomResourceValidation) + if err := Convert_v1beta1_CustomResourceValidation_To_apiextensions_CustomResourceValidation(*in, *out, s); err != nil { + return err + } + } else { + out.Schema = nil + } + out.Subresources = (*apiextensions.CustomResourceSubresources)(unsafe.Pointer(in.Subresources)) + out.AdditionalPrinterColumns = *(*[]apiextensions.CustomResourceColumnDefinition)(unsafe.Pointer(&in.AdditionalPrinterColumns)) return nil } @@ -547,6 +578,17 @@ func autoConvert_apiextensions_CustomResourceDefinitionVersion_To_v1beta1_Custom out.Name = in.Name out.Served = in.Served out.Storage = in.Storage + if in.Schema != nil { + in, out := &in.Schema, &out.Schema + *out = new(CustomResourceValidation) + if err := Convert_apiextensions_CustomResourceValidation_To_v1beta1_CustomResourceValidation(*in, *out, s); err != nil { + return err + } + } else { + out.Schema = nil + } + out.Subresources = (*CustomResourceSubresources)(unsafe.Pointer(in.Subresources)) + out.AdditionalPrinterColumns = *(*[]CustomResourceColumnDefinition)(unsafe.Pointer(&in.AdditionalPrinterColumns)) return nil } diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.deepcopy.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.deepcopy.go index e98a7acf..8dd7a87b 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.deepcopy.go @@ -264,7 +264,9 @@ func (in *CustomResourceDefinitionSpec) DeepCopyInto(out *CustomResourceDefiniti if in.Versions != nil { in, out := &in.Versions, &out.Versions *out = make([]CustomResourceDefinitionVersion, len(*in)) - copy(*out, *in) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } } if in.AdditionalPrinterColumns != nil { in, out := &in.AdditionalPrinterColumns, &out.AdditionalPrinterColumns @@ -321,6 +323,21 @@ func (in *CustomResourceDefinitionStatus) DeepCopy() *CustomResourceDefinitionSt // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CustomResourceDefinitionVersion) DeepCopyInto(out *CustomResourceDefinitionVersion) { *out = *in + if in.Schema != nil { + in, out := &in.Schema, &out.Schema + *out = new(CustomResourceValidation) + (*in).DeepCopyInto(*out) + } + if in.Subresources != nil { + in, out := &in.Subresources, &out.Subresources + *out = new(CustomResourceSubresources) + (*in).DeepCopyInto(*out) + } + if in.AdditionalPrinterColumns != nil { + in, out := &in.AdditionalPrinterColumns, &out.AdditionalPrinterColumns + *out = make([]CustomResourceColumnDefinition, len(*in)) + copy(*out, *in) + } return } diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation.go index 91b01ce7..4f16ccce 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation.go @@ -18,15 +18,16 @@ package validation import ( "fmt" - "k8s.io/apiserver/pkg/util/webhook" "reflect" "strings" + apiequality "k8s.io/apimachinery/pkg/api/equality" genericvalidation "k8s.io/apimachinery/pkg/api/validation" "k8s.io/apimachinery/pkg/util/sets" validationutil "k8s.io/apimachinery/pkg/util/validation" "k8s.io/apimachinery/pkg/util/validation/field" utilfeature "k8s.io/apiserver/pkg/util/feature" + "k8s.io/apiserver/pkg/util/webhook" "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" apiservervalidation "k8s.io/apiextensions-apiserver/pkg/apiserver/validation" @@ -99,6 +100,17 @@ func ValidateUpdateCustomResourceDefinitionStatus(obj, oldObj *apiextensions.Cus return allErrs } +// ValidateCustomResourceDefinitionVersion statically validates. +func ValidateCustomResourceDefinitionVersion(version *apiextensions.CustomResourceDefinitionVersion, fldPath *field.Path, statusEnabled bool) field.ErrorList { + allErrs := field.ErrorList{} + allErrs = append(allErrs, ValidateCustomResourceDefinitionValidation(version.Schema, statusEnabled, fldPath.Child("schema"))...) + allErrs = append(allErrs, ValidateCustomResourceDefinitionSubresources(version.Subresources, fldPath.Child("subresources"))...) + for i := range version.AdditionalPrinterColumns { + allErrs = append(allErrs, ValidateCustomResourceColumnDefinition(&version.AdditionalPrinterColumns[i], fldPath.Child("additionalPrinterColumns").Index(i))...) + } + return allErrs +} + // ValidateCustomResourceDefinitionSpec statically validates func ValidateCustomResourceDefinitionSpec(spec *apiextensions.CustomResourceDefinitionSpec, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} @@ -128,7 +140,32 @@ func ValidateCustomResourceDefinitionSpec(spec *apiextensions.CustomResourceDefi if errs := validationutil.IsDNS1035Label(version.Name); len(errs) > 0 { allErrs = append(allErrs, field.Invalid(fldPath.Child("versions").Index(i).Child("name"), spec.Versions[i].Name, strings.Join(errs, ","))) } + subresources := getSubresourcesForVersion(spec, version.Name) + allErrs = append(allErrs, ValidateCustomResourceDefinitionVersion(&version, fldPath.Child("versions").Index(i), hasStatusEnabled(subresources))...) } + + // The top-level and per-version fields are mutual exclusive + if spec.Validation != nil && hasPerVersionSchema(spec.Versions) { + allErrs = append(allErrs, field.Forbidden(fldPath.Child("validation"), "top-level and per-version schemas are mutually exclusive")) + } + if spec.Subresources != nil && hasPerVersionSubresources(spec.Versions) { + allErrs = append(allErrs, field.Forbidden(fldPath.Child("subresources"), "top-level and per-version subresources are mutually exclusive")) + } + if len(spec.AdditionalPrinterColumns) > 0 && hasPerVersionColumns(spec.Versions) { + allErrs = append(allErrs, field.Forbidden(fldPath.Child("additionalPrinterColumns"), "top-level and per-version additionalPrinterColumns are mutually exclusive")) + } + + // Per-version fields may not all be set to identical values (top-level field should be used instead) + if hasIdenticalPerVersionSchema(spec.Versions) { + allErrs = append(allErrs, field.Invalid(fldPath.Child("versions"), spec.Versions, "per-version schemas may not all be set to identical values (top-level validation should be used instead)")) + } + if hasIdenticalPerVersionSubresources(spec.Versions) { + allErrs = append(allErrs, field.Invalid(fldPath.Child("versions"), spec.Versions, "per-version subresources may not all be set to identical values (top-level subresources should be used instead)")) + } + if hasIdenticalPerVersionColumns(spec.Versions) { + allErrs = append(allErrs, field.Invalid(fldPath.Child("versions"), spec.Versions, "per-version additionalPrinterColumns may not all be set to identical values (top-level additionalPrinterColumns should be used instead)")) + } + if !uniqueNames { allErrs = append(allErrs, field.Invalid(fldPath.Child("versions"), spec.Versions, "must contain unique version names")) } @@ -161,11 +198,7 @@ func ValidateCustomResourceDefinitionSpec(spec *apiextensions.CustomResourceDefi allErrs = append(allErrs, ValidateCustomResourceDefinitionNames(&spec.Names, fldPath.Child("names"))...) if utilfeature.DefaultFeatureGate.Enabled(apiextensionsfeatures.CustomResourceValidation) { - statusEnabled := false - if spec.Subresources != nil && spec.Subresources.Status != nil { - statusEnabled = true - } - allErrs = append(allErrs, ValidateCustomResourceDefinitionValidation(spec.Validation, statusEnabled, fldPath.Child("validation"))...) + allErrs = append(allErrs, ValidateCustomResourceDefinitionValidation(spec.Validation, hasAnyStatusEnabled(spec), fldPath.Child("validation"))...) } else if spec.Validation != nil { allErrs = append(allErrs, field.Forbidden(fldPath.Child("validation"), "disabled by feature-gate CustomResourceValidation")) } @@ -177,7 +210,7 @@ func ValidateCustomResourceDefinitionSpec(spec *apiextensions.CustomResourceDefi } for i := range spec.AdditionalPrinterColumns { - if errs := ValidateCustomResourceColumnDefinition(&spec.AdditionalPrinterColumns[i], fldPath.Child("columns").Index(i)); len(errs) > 0 { + if errs := ValidateCustomResourceColumnDefinition(&spec.AdditionalPrinterColumns[i], fldPath.Child("additionalPrinterColumns").Index(i)); len(errs) > 0 { allErrs = append(allErrs, errs...) } } @@ -250,6 +283,118 @@ func ValidateCustomResourceDefinitionSpecUpdate(spec, oldSpec *apiextensions.Cus return allErrs } +// getSubresourcesForVersion returns the subresources for given version in given CRD spec. +// NOTE That this function assumes version always exist since it's used by the validation process +// that iterates through the existing versions. +func getSubresourcesForVersion(crd *apiextensions.CustomResourceDefinitionSpec, version string) *apiextensions.CustomResourceSubresources { + if !hasPerVersionSubresources(crd.Versions) { + return crd.Subresources + } + for _, v := range crd.Versions { + if version == v.Name { + return v.Subresources + } + } + return nil +} + +// hasAnyStatusEnabled returns true if given CRD spec has at least one Status Subresource set +// among the top-level and per-version Subresources. +func hasAnyStatusEnabled(crd *apiextensions.CustomResourceDefinitionSpec) bool { + if hasStatusEnabled(crd.Subresources) { + return true + } + for _, v := range crd.Versions { + if hasStatusEnabled(v.Subresources) { + return true + } + } + return false +} + +// hasStatusEnabled returns true if given CRD Subresources has non-nil Status set. +func hasStatusEnabled(subresources *apiextensions.CustomResourceSubresources) bool { + if subresources != nil && subresources.Status != nil { + return true + } + return false +} + +// hasPerVersionSchema returns true if a CRD uses per-version schema. +func hasPerVersionSchema(versions []apiextensions.CustomResourceDefinitionVersion) bool { + for _, v := range versions { + if v.Schema != nil { + return true + } + } + return false +} + +// hasPerVersionSubresources returns true if a CRD uses per-version subresources. +func hasPerVersionSubresources(versions []apiextensions.CustomResourceDefinitionVersion) bool { + for _, v := range versions { + if v.Subresources != nil { + return true + } + } + return false +} + +// hasPerVersionColumns returns true if a CRD uses per-version columns. +func hasPerVersionColumns(versions []apiextensions.CustomResourceDefinitionVersion) bool { + for _, v := range versions { + if len(v.AdditionalPrinterColumns) > 0 { + return true + } + } + return false +} + +// hasIdenticalPerVersionSchema returns true if a CRD sets identical non-nil values +// to all per-version schemas +func hasIdenticalPerVersionSchema(versions []apiextensions.CustomResourceDefinitionVersion) bool { + if len(versions) == 0 { + return false + } + value := versions[0].Schema + for _, v := range versions { + if v.Schema == nil || !apiequality.Semantic.DeepEqual(v.Schema, value) { + return false + } + } + return true +} + +// hasIdenticalPerVersionSubresources returns true if a CRD sets identical non-nil values +// to all per-version subresources +func hasIdenticalPerVersionSubresources(versions []apiextensions.CustomResourceDefinitionVersion) bool { + if len(versions) == 0 { + return false + } + value := versions[0].Subresources + for _, v := range versions { + if v.Subresources == nil || !apiequality.Semantic.DeepEqual(v.Subresources, value) { + return false + } + } + return true +} + +// hasIdenticalPerVersionColumns returns true if a CRD sets identical non-nil values +// to all per-version columns +func hasIdenticalPerVersionColumns(versions []apiextensions.CustomResourceDefinitionVersion) bool { + if len(versions) == 0 { + return false + } + value := versions[0].AdditionalPrinterColumns + for _, v := range versions { + if len(v.AdditionalPrinterColumns) == 0 || !apiequality.Semantic.DeepEqual(v.AdditionalPrinterColumns, value) { + return false + } + } + return true +} + // ValidateCustomResourceDefinitionStatus statically validates func ValidateCustomResourceDefinitionStatus(status *apiextensions.CustomResourceDefinitionStatus, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation_test.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation_test.go index 24cd454b..692aa8b0 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation_test.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation_test.go @@ -594,6 +594,55 @@ func TestValidateCustomResourceDefinition(t *testing.T) { }, errors: []validationMatch{}, }, + { + name: "per-version fields may not all be set to identical values (top-level field should be used instead)", + resource: &apiextensions.CustomResourceDefinition{ + ObjectMeta: metav1.ObjectMeta{Name: "plural.group.com"}, + Spec: apiextensions.CustomResourceDefinitionSpec{ + Group: "group.com", + Version: "version", + Versions: []apiextensions.CustomResourceDefinitionVersion{ + { + Name: "version", + Served: true, + Storage: true, + Schema: &apiextensions.CustomResourceValidation{ + OpenAPIV3Schema: validValidationSchema, + }, + Subresources: &apiextensions.CustomResourceSubresources{}, + AdditionalPrinterColumns: []apiextensions.CustomResourceColumnDefinition{{Name: "Alpha", Type: "string", JSONPath: ".spec.alpha"}}, + }, + { + Name: "version2", + Served: true, + Storage: false, + Schema: &apiextensions.CustomResourceValidation{ + OpenAPIV3Schema: validValidationSchema, + }, + Subresources: &apiextensions.CustomResourceSubresources{}, + AdditionalPrinterColumns: []apiextensions.CustomResourceColumnDefinition{{Name: "Alpha", Type: "string", JSONPath: ".spec.alpha"}}, + }, + }, + Scope: apiextensions.NamespaceScoped, + Names: apiextensions.CustomResourceDefinitionNames{ + Plural: "plural", + Singular: "singular", + Kind: "Plural", + ListKind: "PluralList", + }, + }, + Status: apiextensions.CustomResourceDefinitionStatus{ + StoredVersions: []string{"version"}, + }, + }, + errors: []validationMatch{ + // Per-version schema/subresources/columns may not all be set to identical values. + // Note that the test will fail if we de-duplicate the expected errors below. + invalid("spec", "versions"), + invalid("spec", "versions"), + invalid("spec", "versions"), + }, + }, } for _, tc := range tests { @@ -1003,6 +1052,87 @@ func TestValidateCustomResourceDefinitionUpdate(t *testing.T) { immutable("spec", "names", "plural"), }, }, + { + name: "top-level and per-version fields are mutually exclusive", + old: &apiextensions.CustomResourceDefinition{ + ObjectMeta: metav1.ObjectMeta{ + Name: "plural.group.com", + ResourceVersion: "42", + }, + Spec: apiextensions.CustomResourceDefinitionSpec{ + Group: "group.com", + Version: "version", + Versions: []apiextensions.CustomResourceDefinitionVersion{ + { + Name: "version", + Served: true, + Storage: true, + Subresources: &apiextensions.CustomResourceSubresources{}, + }, + { + Name: "version2", + Served: true, + Storage: false, + }, + }, + Scope: apiextensions.NamespaceScoped, + Names: apiextensions.CustomResourceDefinitionNames{ + Plural: "plural", + Singular: "singular", + Kind: "Plural", + ListKind: "PluralList", + }, + }, + Status: apiextensions.CustomResourceDefinitionStatus{ + StoredVersions: []string{"version"}, + }, + }, + resource: &apiextensions.CustomResourceDefinition{ + ObjectMeta: metav1.ObjectMeta{ + Name: "plural.group.com", + ResourceVersion: "42", + }, + Spec: apiextensions.CustomResourceDefinitionSpec{ + Group: "group.com", + Version: "version", + Versions: []apiextensions.CustomResourceDefinitionVersion{ + { + Name: "version", + Served: true, + Storage: true, + }, + { + Name: "version2", + Served: true, + Storage: false, + Schema: &apiextensions.CustomResourceValidation{ + OpenAPIV3Schema: validValidationSchema, + }, + Subresources: &apiextensions.CustomResourceSubresources{}, + AdditionalPrinterColumns: []apiextensions.CustomResourceColumnDefinition{{Name: "Alpha", Type: "string", JSONPath: ".spec.alpha"}}, + }, + }, + Validation: &apiextensions.CustomResourceValidation{ + OpenAPIV3Schema: validValidationSchema, + }, + Subresources: &apiextensions.CustomResourceSubresources{}, + Scope: apiextensions.NamespaceScoped, + Names: apiextensions.CustomResourceDefinitionNames{ + Plural: "plural", + Singular: "singular", + Kind: "Plural", + ListKind: "PluralList", + }, + }, + Status: apiextensions.CustomResourceDefinitionStatus{ + StoredVersions: []string{"version"}, + }, + }, + errors: []validationMatch{ + forbidden("spec", "validation"), + forbidden("spec", "subresources"), + }, + }, } for _, tc := range tests { @@ -1090,36 +1220,7 @@ func TestValidateCustomResourceDefinitionValidation(t *testing.T) { { name: "all allowed fields at the root of the schema with status", input: apiextensions.CustomResourceValidation{ - OpenAPIV3Schema: &apiextensions.JSONSchemaProps{ - Description: "This is a description", - Type: "object", - Format: "date-time", - Title: "This is a title", - Maximum: float64Ptr(10), - ExclusiveMaximum: true, - Minimum: float64Ptr(5), - ExclusiveMinimum: true, - MaxLength: int64Ptr(10), - MinLength: int64Ptr(5), - Pattern: "^[a-z]$", - MaxItems: int64Ptr(10), - MinItems: int64Ptr(5), - MultipleOf: float64Ptr(3), - Required: []string{"spec", "status"}, - Items: &apiextensions.JSONSchemaPropsOrArray{ - Schema: &apiextensions.JSONSchemaProps{ - Description: "This is a schema nested under Items", - }, - }, - Properties: map[string]apiextensions.JSONSchemaProps{ - "spec": {}, - "status": {}, - }, - ExternalDocs: &apiextensions.ExternalDocumentation{ - Description: "This is an external documentation description", - }, - Example: &example, - }, + OpenAPIV3Schema: validValidationSchema, }, statusEnabled: true, wantError: false, @@ -1139,6 +1240,37 @@ func TestValidateCustomResourceDefinitionValidation(t *testing.T) { var example = apiextensions.JSON(`"This is an example"`) +var validValidationSchema = &apiextensions.JSONSchemaProps{ + Description: "This is a description", + Type: "object", + Format: "date-time", + Title: "This is a title", + Maximum: float64Ptr(10), + ExclusiveMaximum: true, + Minimum: float64Ptr(5), + ExclusiveMinimum: true, + MaxLength: int64Ptr(10), + MinLength: int64Ptr(5), + Pattern: "^[a-z]$", + MaxItems: int64Ptr(10), + MinItems: int64Ptr(5), + MultipleOf: float64Ptr(3), + Required: []string{"spec", "status"}, + Items: &apiextensions.JSONSchemaPropsOrArray{ + Schema: &apiextensions.JSONSchemaProps{ + Description: "This is a schema nested under Items", + }, + }, + Properties: map[string]apiextensions.JSONSchemaProps{ + "spec": {}, + "status": {}, + }, + ExternalDocs: &apiextensions.ExternalDocumentation{ + Description: "This is an external documentation description", + }, + Example: &example, +} + func float64Ptr(f float64) *float64 { return &f } diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/zz_generated.deepcopy.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/zz_generated.deepcopy.go index 1b4fb335..5a013075 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/zz_generated.deepcopy.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/zz_generated.deepcopy.go @@ -182,7 +182,9 @@ func (in *CustomResourceDefinitionSpec) DeepCopyInto(out *CustomResourceDefiniti if in.Versions != nil { in, out := &in.Versions, &out.Versions *out = make([]CustomResourceDefinitionVersion, len(*in)) - copy(*out, *in) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } } if in.AdditionalPrinterColumns != nil { in, out := &in.AdditionalPrinterColumns, &out.AdditionalPrinterColumns @@ -239,6 +241,21 @@ func (in *CustomResourceDefinitionStatus) DeepCopy() *CustomResourceDefinitionSt // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CustomResourceDefinitionVersion) DeepCopyInto(out *CustomResourceDefinitionVersion) { *out = *in + if in.Schema != nil { + in, out := &in.Schema, &out.Schema + *out = new(CustomResourceValidation) + (*in).DeepCopyInto(*out) + } + if in.Subresources != nil { + in, out := &in.Subresources, &out.Subresources + *out = new(CustomResourceSubresources) + (*in).DeepCopyInto(*out) + } + if in.AdditionalPrinterColumns != nil { + in, out := &in.AdditionalPrinterColumns, &out.AdditionalPrinterColumns + *out = make([]CustomResourceColumnDefinition, len(*in)) + copy(*out, *in) + } return } diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/apiserver.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/apiserver.go index f1fc89ba..b6830d76 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/apiserver.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/apiserver.go @@ -31,6 +31,7 @@ import ( "k8s.io/apiserver/pkg/registry/rest" genericapiserver "k8s.io/apiserver/pkg/server" serverstorage "k8s.io/apiserver/pkg/server/storage" + "k8s.io/apiserver/pkg/util/webhook" "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/install" @@ -78,6 +79,11 @@ type ExtraConfig struct { // MasterCount is used to detect whether cluster is HA, and if it is // the CRD Establishing will be hold by 5 seconds. MasterCount int + + // ServiceResolver is used in CR webhook converters to resolve webhook's service names + ServiceResolver webhook.ServiceResolver + // AuthResolverWrapper is used in CR webhook converters + AuthResolverWrapper webhook.AuthenticationInfoResolverWrapper } type Config struct { @@ -167,7 +173,7 @@ func (c completedConfig) New(delegationTarget genericapiserver.DelegationTarget) delegate: delegateHandler, } establishingController := establish.NewEstablishingController(s.Informers.Apiextensions().InternalVersion().CustomResourceDefinitions(), crdClient.Apiextensions()) - crdHandler := NewCustomResourceDefinitionHandler( + crdHandler, err := NewCustomResourceDefinitionHandler( versionDiscoveryHandler, groupDiscoveryHandler, s.Informers.Apiextensions().InternalVersion().CustomResourceDefinitions(), @@ -175,8 +181,13 @@ func (c completedConfig) New(delegationTarget genericapiserver.DelegationTarget) c.ExtraConfig.CRDRESTOptionsGetter, c.GenericConfig.AdmissionControl, establishingController, + c.ExtraConfig.ServiceResolver, + c.ExtraConfig.AuthResolverWrapper, c.ExtraConfig.MasterCount, ) + if err != nil { + return nil, err + } s.GenericAPIServer.Handler.NonGoRestfulMux.Handle("/apis", crdHandler) s.GenericAPIServer.Handler.NonGoRestfulMux.HandlePrefix("/apis/", crdHandler) diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/conversion/converter.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/conversion/converter.go index a66f8296..9345e9bd 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/conversion/converter.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/conversion/converter.go @@ -20,39 +20,74 @@ import ( "fmt" "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" + apiextensionsfeatures "k8s.io/apiextensions-apiserver/pkg/features" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" + utilfeature "k8s.io/apiserver/pkg/util/feature" + "k8s.io/apiserver/pkg/util/webhook" ) -// NewCRDConverter returns a new CRD converter based on the conversion settings in crd object. -func NewCRDConverter(crd *apiextensions.CustomResourceDefinition) (safe, unsafe runtime.ObjectConvertor) { +// CRConverterFactory is the factory for all CR converters. +type CRConverterFactory struct { + // webhookConverterFactory is the factory for webhook converters. + // This field should not be used if CustomResourceWebhookConversion feature is disabled. + webhookConverterFactory *webhookConverterFactory +} + +// NewCRConverterFactory creates a new CRConverterFactory +func NewCRConverterFactory(serviceResolver webhook.ServiceResolver, authResolverWrapper webhook.AuthenticationInfoResolverWrapper) (*CRConverterFactory, error) { + converterFactory := &CRConverterFactory{} + if utilfeature.DefaultFeatureGate.Enabled(apiextensionsfeatures.CustomResourceWebhookConversion) { + webhookConverterFactory, err := newWebhookConverterFactory(serviceResolver, authResolverWrapper) + if err != nil { + return nil, err + } + converterFactory.webhookConverterFactory = webhookConverterFactory + } + return converterFactory, nil +} + +// NewConverter returns a new CR converter based on the conversion settings in crd object. +func (m *CRConverterFactory) NewConverter(crd *apiextensions.CustomResourceDefinition) (safe, unsafe runtime.ObjectConvertor, err error) { validVersions := map[schema.GroupVersion]bool{} for _, version := range crd.Spec.Versions { validVersions[schema.GroupVersion{Group: crd.Spec.Group, Version: version.Name}] = true } - // The only converter right now is nopConverter. More converters will be returned based on the - // CRD object when they introduced. - unsafe = &crdConverter{ - clusterScoped: crd.Spec.Scope == apiextensions.ClusterScoped, - delegate: &nopConverter{ - validVersions: validVersions, - }, + switch crd.Spec.Conversion.Strategy { + case apiextensions.NoneConverter: + unsafe = &crConverter{ + clusterScoped: crd.Spec.Scope == apiextensions.ClusterScoped, + delegate: &nopConverter{ + validVersions: validVersions, + }, + } + return &safeConverterWrapper{unsafe}, unsafe, nil + case apiextensions.WebhookConverter: + if !utilfeature.DefaultFeatureGate.Enabled(apiextensionsfeatures.CustomResourceWebhookConversion) { + return nil, nil, fmt.Errorf("webhook conversion is disabled on this cluster") + } + unsafe, err := m.webhookConverterFactory.NewWebhookConverter(validVersions, crd) + if err != nil { + return nil, nil, err + } + return &safeConverterWrapper{unsafe}, unsafe, nil } - return &safeConverterWrapper{unsafe}, unsafe + + return nil, nil, fmt.Errorf("unknown conversion strategy %q for CRD %s", crd.Spec.Conversion.Strategy, crd.Name) } -var _ runtime.ObjectConvertor = &crdConverter{} +var _ runtime.ObjectConvertor = &crConverter{} -// crdConverter extends the delegate with generic CRD conversion behaviour. The delegate will implement the +// crConverter extends the delegate with generic CR conversion behaviour. The delegate will implement the // user defined conversion strategy given in the CustomResourceDefinition. -type crdConverter struct { +type crConverter struct { delegate runtime.ObjectConvertor clusterScoped bool } -func (c *crdConverter) ConvertFieldLabel(gvk schema.GroupVersionKind, label, value string) (string, string, error) { +func (c *crConverter) ConvertFieldLabel(gvk schema.GroupVersionKind, label, value string) (string, string, error) { // We currently only support metadata.namespace and metadata.name. switch { case label == "metadata.name": @@ -64,12 +99,12 @@ func (c *crdConverter) ConvertFieldLabel(gvk schema.GroupVersionKind, label, val } } -func (c *crdConverter) Convert(in, out, context interface{}) error { +func (c *crConverter) Convert(in, out, context interface{}) error { return c.delegate.Convert(in, out, context) } // ConvertToVersion converts in object to the given gvk in place and returns the same `in` object. -func (c *crdConverter) ConvertToVersion(in runtime.Object, target runtime.GroupVersioner) (runtime.Object, error) { +func (c *crConverter) ConvertToVersion(in runtime.Object, target runtime.GroupVersioner) (runtime.Object, error) { // Run the converter on the list items instead of list itself if list, ok := in.(*unstructured.UnstructuredList); ok { for i := range list.Items { diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/conversion/nop_converter.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/conversion/nop_converter.go index 7fae8137..8791238c 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/conversion/nop_converter.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/conversion/nop_converter.go @@ -49,11 +49,11 @@ func (c *nopConverter) Convert(in, out, context interface{}) error { outGVK := unstructOut.GroupVersionKind() if !c.validVersions[outGVK.GroupVersion()] { - return fmt.Errorf("request to convert CRD from an invalid group/version: %s", outGVK.String()) + return fmt.Errorf("request to convert CR from an invalid group/version: %s", outGVK.String()) } inGVK := unstructIn.GroupVersionKind() if !c.validVersions[inGVK.GroupVersion()] { - return fmt.Errorf("request to convert CRD to an invalid group/version: %s", inGVK.String()) + return fmt.Errorf("request to convert CR to an invalid group/version: %s", inGVK.String()) } unstructOut.SetUnstructuredContent(unstructIn.UnstructuredContent()) @@ -72,7 +72,7 @@ func (c *nopConverter) ConvertToVersion(in runtime.Object, target runtime.GroupV return nil, fmt.Errorf("%v is unstructured and is not suitable for converting to %q", kind, target) } if !c.validVersions[gvk.GroupVersion()] { - return nil, fmt.Errorf("request to convert CRD to an invalid group/version: %s", gvk.String()) + return nil, fmt.Errorf("request to convert CR to an invalid group/version: %s", gvk.String()) } in.GetObjectKind().SetGroupVersionKind(gvk) return in, nil diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/conversion/webhook_converter.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/conversion/webhook_converter.go new file mode 100644 index 00000000..3cc295ea --- /dev/null +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/conversion/webhook_converter.go @@ -0,0 +1,350 @@ +/* +Copyright 2018 The Kubernetes Authors. + +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 conversion + +import ( + "context" + "errors" + "fmt" + + "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/util/uuid" + "k8s.io/apiserver/pkg/util/webhook" + "k8s.io/client-go/rest" + + internal "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" +) + +type webhookConverterFactory struct { + clientManager webhook.ClientManager +} + +func newWebhookConverterFactory(serviceResolver webhook.ServiceResolver, authResolverWrapper webhook.AuthenticationInfoResolverWrapper) (*webhookConverterFactory, error) { + clientManager, err := webhook.NewClientManager(v1beta1.SchemeGroupVersion, v1beta1.AddToScheme) + if err != nil { + return nil, err + } + authInfoResolver, err := webhook.NewDefaultAuthenticationInfoResolver("") + if err != nil { + return nil, err + } + // Set defaults which may be overridden later. + clientManager.SetAuthenticationInfoResolver(authInfoResolver) + clientManager.SetAuthenticationInfoResolverWrapper(authResolverWrapper) + clientManager.SetServiceResolver(serviceResolver) + return &webhookConverterFactory{clientManager}, nil +} + +// webhookConverter is a converter that calls an external webhook to do the CR conversion. +type webhookConverter struct { + validVersions map[schema.GroupVersion]bool + clientManager webhook.ClientManager + restClient *rest.RESTClient + name string + nopConverter nopConverter +} + +func webhookClientConfigForCRD(crd *internal.CustomResourceDefinition) *webhook.ClientConfig { + apiConfig := crd.Spec.Conversion.WebhookClientConfig + ret := webhook.ClientConfig{ + Name: fmt.Sprintf("conversion_webhook_for_%s", crd.Name), + CABundle: apiConfig.CABundle, + } + if apiConfig.URL != nil { + ret.URL = *apiConfig.URL + } + if apiConfig.Service != nil { + ret.Service = &webhook.ClientConfigService{ + Name: apiConfig.Service.Name, + Namespace: apiConfig.Service.Namespace, + } + if apiConfig.Service.Path != nil { + ret.Service.Path = *apiConfig.Service.Path + } + } + return &ret +} + +var _ runtime.ObjectConvertor = &webhookConverter{} + +func (f *webhookConverterFactory) NewWebhookConverter(validVersions map[schema.GroupVersion]bool, crd *internal.CustomResourceDefinition) (*webhookConverter, error) { + restClient, err := f.clientManager.HookClient(*webhookClientConfigForCRD(crd)) + if err != nil { + return nil, err + } + return &webhookConverter{ + clientManager: f.clientManager, + validVersions: validVersions, + restClient: restClient, + name: crd.Name, + nopConverter: nopConverter{validVersions: validVersions}, + }, nil +} + +func (webhookConverter) ConvertFieldLabel(gvk schema.GroupVersionKind, label, value string) (string, string, error) { + return "", "", errors.New("unstructured cannot convert field labels") +} + +func (c *webhookConverter) Convert(in, out, context interface{}) error { + unstructIn, ok := in.(*unstructured.Unstructured) + if !ok { + return fmt.Errorf("input type %T in not valid for unstructured conversion", in) + } + + unstructOut, ok := out.(*unstructured.Unstructured) + if !ok { + return fmt.Errorf("output type %T in not valid for unstructured conversion", out) + } + + outGVK := unstructOut.GroupVersionKind() + if !c.validVersions[outGVK.GroupVersion()] { + return fmt.Errorf("request to convert CR from an invalid group/version: %s", outGVK.String()) + } + inGVK := unstructIn.GroupVersionKind() + if !c.validVersions[inGVK.GroupVersion()] { + return fmt.Errorf("request to convert CR to an invalid group/version: %s", inGVK.String()) + } + + converted, err := c.ConvertToVersion(unstructIn, outGVK.GroupVersion()) + if err != nil { + return err + } + unstructuredConverted, ok := converted.(runtime.Unstructured) + if !ok { + // this should not happened + return fmt.Errorf("CR conversion failed") + } + unstructOut.SetUnstructuredContent(unstructuredConverted.UnstructuredContent()) + return nil +} + +func createConversionReview(obj runtime.Object, apiVersion string) *v1beta1.ConversionReview { + listObj, isList := obj.(*unstructured.UnstructuredList) + var objects []runtime.RawExtension + if isList { + for i := 0; i < len(listObj.Items); i++ { + // Only sent item for conversion, if the apiVersion is different + if listObj.Items[i].GetAPIVersion() != apiVersion { + objects = append(objects, runtime.RawExtension{Object: &listObj.Items[i]}) + } + } + } else { + if obj.GetObjectKind().GroupVersionKind().GroupVersion().String() != apiVersion { + objects = []runtime.RawExtension{{Object: obj}} + } + } + return &v1beta1.ConversionReview{ + Request: &v1beta1.ConversionRequest{ + Objects: objects, + DesiredAPIVersion: apiVersion, + UID: uuid.NewUUID(), + }, + Response: &v1beta1.ConversionResponse{}, + } +} + +func getRawExtensionObject(rx runtime.RawExtension) (runtime.Object, error) { + if rx.Object != nil { + return rx.Object, nil + } + u := unstructured.Unstructured{} + err := u.UnmarshalJSON(rx.Raw) + if err != nil { + return nil, err + } + return &u, nil +} + +// getTargetGroupVersion returns group/version which should be used to convert in objects to. +// String version of the return item is APIVersion. +func getTargetGroupVersion(in runtime.Object, target runtime.GroupVersioner) (schema.GroupVersion, error) { + fromGVK := in.GetObjectKind().GroupVersionKind() + toGVK, ok := target.KindForGroupVersionKinds([]schema.GroupVersionKind{fromGVK}) + if !ok { + // TODO: should this be a typed error? + return schema.GroupVersion{}, fmt.Errorf("%v is unstructured and is not suitable for converting to %q", fromGVK.String(), target) + } + return toGVK.GroupVersion(), nil +} + +func (c *webhookConverter) ConvertToVersion(in runtime.Object, target runtime.GroupVersioner) (runtime.Object, error) { + // In general, the webhook should not do any defaulting or validation. A special case of that is an empty object + // conversion that must result an empty object and practically is the same as nopConverter. + // A smoke test in API machinery calls the converter on empty objects. As this case happens consistently + // it special cased here not to call webhook converter. The test initiated here: + // https://github.com/kubernetes/kubernetes/blob/dbb448bbdcb9e440eee57024ffa5f1698956a054/staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go#L201 + if isEmptyUnstructuredObject(in) { + return c.nopConverter.ConvertToVersion(in, target) + } + + toGV, err := getTargetGroupVersion(in, target) + if err != nil { + return nil, err + } + if !c.validVersions[toGV] { + return nil, fmt.Errorf("request to convert CR to an invalid group/version: %s", toGV.String()) + } + fromGV := in.GetObjectKind().GroupVersionKind().GroupVersion() + if !c.validVersions[fromGV] { + return nil, fmt.Errorf("request to convert CR from an invalid group/version: %s", fromGV.String()) + } + listObj, isList := in.(*unstructured.UnstructuredList) + if isList { + for i, item := range listObj.Items { + fromGV := item.GroupVersionKind().GroupVersion() + if !c.validVersions[fromGV] { + return nil, fmt.Errorf("input list has invalid group/version `%v` at `%v` index", fromGV, i) + } + } + } + + request := createConversionReview(in, toGV.String()) + if len(request.Request.Objects) == 0 { + if !isList { + return in, nil + } + out := listObj.DeepCopy() + out.SetAPIVersion(toGV.String()) + return out, nil + } + response := &v1beta1.ConversionReview{} + // TODO: Figure out if adding one second timeout make sense here. + ctx := context.TODO() + r := c.restClient.Post().Context(ctx).Body(request).Do() + if err := r.Into(response); err != nil { + // TODO: Return a webhook specific error to be able to convert it to meta.Status + return nil, fmt.Errorf("calling to conversion webhook failed for %s: %v", c.name, err) + } + + if response.Response == nil { + // TODO: Return a webhook specific error to be able to convert it to meta.Status + return nil, fmt.Errorf("conversion webhook response was absent for %s", c.name) + } + + if response.Response.Result.Status != v1.StatusSuccess { + // TODO return status message as error + return nil, fmt.Errorf("conversion request failed for %v, Response: %v", in.GetObjectKind(), response) + } + + if len(response.Response.ConvertedObjects) != len(request.Request.Objects) { + return nil, fmt.Errorf("expected %v converted objects, got %v", len(request.Request.Objects), len(response.Response.ConvertedObjects)) + } + + if isList { + convertedList := listObj.DeepCopy() + // Collection of items sent for conversion is different than list items + // because only items that needed conversion has been sent. + convertedIndex := 0 + for i := 0; i < len(listObj.Items); i++ { + if listObj.Items[i].GetAPIVersion() == toGV.String() { + // This item has not been sent for conversion, skip it. + continue + } + converted, err := getRawExtensionObject(response.Response.ConvertedObjects[convertedIndex]) + convertedIndex++ + original := listObj.Items[i] + if err != nil { + return nil, fmt.Errorf("invalid converted object at index %v: %v", convertedIndex, err) + } + if e, a := toGV, converted.GetObjectKind().GroupVersionKind().GroupVersion(); e != a { + return nil, fmt.Errorf("invalid converted object at index %v: invalid groupVersion, e=%v, a=%v", convertedIndex, e, a) + } + if e, a := original.GetObjectKind().GroupVersionKind().Kind, converted.GetObjectKind().GroupVersionKind().Kind; e != a { + return nil, fmt.Errorf("invalid converted object at index %v: invalid kind, e=%v, a=%v", convertedIndex, e, a) + } + unstructConverted, ok := converted.(*unstructured.Unstructured) + if !ok { + // this should not happened + return nil, fmt.Errorf("CR conversion failed") + } + if err := validateConvertedObject(&listObj.Items[i], unstructConverted); err != nil { + return nil, fmt.Errorf("invalid converted object at index %v: %v", convertedIndex, err) + } + convertedList.Items[i] = *unstructConverted + } + convertedList.SetAPIVersion(toGV.String()) + return convertedList, nil + } + + if len(response.Response.ConvertedObjects) != 1 { + // This should not happened + return nil, fmt.Errorf("CR conversion failed") + } + converted, err := getRawExtensionObject(response.Response.ConvertedObjects[0]) + if err != nil { + return nil, err + } + if e, a := toGV, converted.GetObjectKind().GroupVersionKind().GroupVersion(); e != a { + return nil, fmt.Errorf("invalid converted object: invalid groupVersion, e=%v, a=%v", e, a) + } + if e, a := in.GetObjectKind().GroupVersionKind().Kind, converted.GetObjectKind().GroupVersionKind().Kind; e != a { + return nil, fmt.Errorf("invalid converted object: invalid kind, e=%v, a=%v", e, a) + } + unstructConverted, ok := converted.(*unstructured.Unstructured) + if !ok { + // this should not happened + return nil, fmt.Errorf("CR conversion failed") + } + unstructIn, ok := in.(*unstructured.Unstructured) + if !ok { + // this should not happened + return nil, fmt.Errorf("CR conversion failed") + } + if err := validateConvertedObject(unstructIn, unstructConverted); err != nil { + return nil, fmt.Errorf("invalid converted object: %v", err) + } + return converted, nil +} + +func validateConvertedObject(unstructIn, unstructOut *unstructured.Unstructured) error { + if e, a := unstructIn.GetKind(), unstructOut.GetKind(); e != a { + return fmt.Errorf("must have the same kind: %v != %v", e, a) + } + if e, a := unstructIn.GetName(), unstructOut.GetName(); e != a { + return fmt.Errorf("must have the same name: %v != %v", e, a) + } + if e, a := unstructIn.GetNamespace(), unstructOut.GetNamespace(); e != a { + return fmt.Errorf("must have the same namespace: %v != %v", e, a) + } + if e, a := unstructIn.GetUID(), unstructOut.GetUID(); e != a { + return fmt.Errorf("must have the same UID: %v != %v", e, a) + } + return nil +} + +// isEmptyUnstructuredObject returns true if in is an empty unstructured object, i.e. an unstructured object that does +// not have any field except apiVersion and kind. +func isEmptyUnstructuredObject(in runtime.Object) bool { + u, ok := in.(*unstructured.Unstructured) + if !ok { + return false + } + if len(u.Object) != 2 { + return false + } + if _, ok := u.Object["kind"]; !ok { + return false + } + if _, ok := u.Object["apiVersion"]; !ok { + return false + } + return true +} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_discovery_controller.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_discovery_controller.go index e3b3d0a4..3b13e835 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_discovery_controller.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_discovery_controller.go @@ -21,7 +21,7 @@ import ( "sort" "time" - "github.com/golang/glog" + "k8s.io/klog" autoscaling "k8s.io/api/autoscaling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -136,7 +136,11 @@ func (c *DiscoveryController) sync(version schema.GroupVersion) error { Categories: crd.Status.AcceptedNames.Categories, }) - if crd.Spec.Subresources != nil && crd.Spec.Subresources.Status != nil { + subresources, err := getSubresourcesForVersion(crd, version.Version) + if err != nil { + return err + } + if subresources != nil && subresources.Status != nil { apiResourcesForDiscovery = append(apiResourcesForDiscovery, metav1.APIResource{ Name: crd.Status.AcceptedNames.Plural + "/status", Namespaced: crd.Spec.Scope == apiextensions.NamespaceScoped, @@ -145,7 +149,7 @@ func (c *DiscoveryController) sync(version schema.GroupVersion) error { }) } - if crd.Spec.Subresources != nil && crd.Spec.Subresources.Scale != nil { + if subresources != nil && subresources.Scale != nil { apiResourcesForDiscovery = append(apiResourcesForDiscovery, metav1.APIResource{ Group: autoscaling.GroupName, Version: "v1", @@ -194,9 +198,9 @@ func sortGroupDiscoveryByKubeAwareVersion(gd []metav1.GroupVersionForDiscovery) func (c *DiscoveryController) Run(stopCh <-chan struct{}) { defer utilruntime.HandleCrash() defer c.queue.ShutDown() - defer glog.Infof("Shutting down DiscoveryController") + defer klog.Infof("Shutting down DiscoveryController") - glog.Infof("Starting DiscoveryController") + klog.Infof("Starting DiscoveryController") if !cache.WaitForCacheSync(stopCh, c.crdsSynced) { utilruntime.HandleError(fmt.Errorf("timed out waiting for caches to sync")) @@ -242,14 +246,14 @@ func (c *DiscoveryController) enqueue(obj *apiextensions.CustomResourceDefinitio func (c *DiscoveryController) addCustomResourceDefinition(obj interface{}) { castObj := obj.(*apiextensions.CustomResourceDefinition) - glog.V(4).Infof("Adding customresourcedefinition %s", castObj.Name) + klog.V(4).Infof("Adding customresourcedefinition %s", castObj.Name) c.enqueue(castObj) } func (c *DiscoveryController) updateCustomResourceDefinition(oldObj, newObj interface{}) { castNewObj := newObj.(*apiextensions.CustomResourceDefinition) castOldObj := oldObj.(*apiextensions.CustomResourceDefinition) - glog.V(4).Infof("Updating customresourcedefinition %s", castOldObj.Name) + klog.V(4).Infof("Updating customresourcedefinition %s", castOldObj.Name) // Enqueue both old and new object to make sure we remove and add appropriate Versions. // The working queue will resolve any duplicates and only changes will stay in the queue. c.enqueue(castNewObj) @@ -261,15 +265,15 @@ func (c *DiscoveryController) deleteCustomResourceDefinition(obj interface{}) { if !ok { tombstone, ok := obj.(cache.DeletedFinalStateUnknown) if !ok { - glog.Errorf("Couldn't get object from tombstone %#v", obj) + klog.Errorf("Couldn't get object from tombstone %#v", obj) return } castObj, ok = tombstone.Obj.(*apiextensions.CustomResourceDefinition) if !ok { - glog.Errorf("Tombstone contained object that is not expected %#v", obj) + klog.Errorf("Tombstone contained object that is not expected %#v", obj) return } } - glog.V(4).Infof("Deleting customresourcedefinition %q", castObj.Name) + klog.V(4).Infof("Deleting customresourcedefinition %q", castObj.Name) c.enqueue(castObj) } diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler.go index e8d175ad..2ad59dfe 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler.go @@ -28,7 +28,7 @@ import ( "github.com/go-openapi/spec" "github.com/go-openapi/strfmt" "github.com/go-openapi/validate" - "github.com/golang/glog" + "k8s.io/klog" apiequality "k8s.io/apimachinery/pkg/api/equality" apierrors "k8s.io/apimachinery/pkg/api/errors" @@ -67,6 +67,7 @@ import ( apiextensionsfeatures "k8s.io/apiextensions-apiserver/pkg/features" "k8s.io/apiextensions-apiserver/pkg/registry/customresource" "k8s.io/apiextensions-apiserver/pkg/registry/customresource/tableconvertor" + "k8s.io/apiserver/pkg/util/webhook" ) // crdHandler serves the `/apis` endpoint. @@ -93,6 +94,8 @@ type crdHandler struct { // MasterCount is used to implement sleep to improve // CRD establishing process for HA clusters. masterCount int + + converterFactory *conversion.CRConverterFactory } // crdInfo stores enough information to serve the storage for the custom resource @@ -129,7 +132,9 @@ func NewCustomResourceDefinitionHandler( restOptionsGetter generic.RESTOptionsGetter, admission admission.Interface, establishingController *establish.EstablishingController, - masterCount int) *crdHandler { + serviceResolver webhook.ServiceResolver, + authResolverWrapper webhook.AuthenticationInfoResolverWrapper, + masterCount int) (*crdHandler, error) { ret := &crdHandler{ versionDiscoveryHandler: versionDiscoveryHandler, groupDiscoveryHandler: groupDiscoveryHandler, @@ -147,10 +152,15 @@ func NewCustomResourceDefinitionHandler( ret.removeDeadStorage() }, }) + crConverterFactory, err := conversion.NewCRConverterFactory(serviceResolver, authResolverWrapper) + if err != nil { + return nil, err + } + ret.converterFactory = crConverterFactory ret.customStorage.Store(crdStorageMap{}) - return ret + return ret, nil } func (r *crdHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) { @@ -220,10 +230,16 @@ func (r *crdHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) { } var handler http.HandlerFunc + subresources, err := getSubresourcesForVersion(crd, requestInfo.APIVersion) + if err != nil { + utilruntime.HandleError(err) + http.Error(w, "the server could not properly serve the CR subresources", http.StatusInternalServerError) + return + } switch { - case subresource == "status" && crd.Spec.Subresources != nil && crd.Spec.Subresources.Status != nil: + case subresource == "status" && subresources != nil && subresources.Status != nil: handler = r.serveStatus(w, req, requestInfo, crdInfo, terminating, supportedTypes) - case subresource == "scale" && crd.Spec.Subresources != nil && crd.Spec.Subresources.Scale != nil: + case subresource == "scale" && subresources != nil && subresources.Scale != nil: handler = r.serveScale(w, req, requestInfo, crdInfo, terminating, supportedTypes) case len(subresource) == 0: handler = r.serveResource(w, req, requestInfo, crdInfo, terminating, supportedTypes) @@ -334,11 +350,11 @@ func (r *crdHandler) updateCustomResourceDefinition(oldObj, newObj interface{}) return } if apiequality.Semantic.DeepEqual(&newCRD.Spec, oldInfo.spec) && apiequality.Semantic.DeepEqual(&newCRD.Status.AcceptedNames, oldInfo.acceptedNames) { - glog.V(6).Infof("Ignoring customresourcedefinition %s update because neither spec, nor accepted names changed", oldCRD.Name) + klog.V(6).Infof("Ignoring customresourcedefinition %s update because neither spec, nor accepted names changed", oldCRD.Name) return } - glog.V(4).Infof("Updating customresourcedefinition %s", oldCRD.Name) + klog.V(4).Infof("Updating customresourcedefinition %s", oldCRD.Name) // Copy because we cannot write to storageMap without a race // as it is used without locking elsewhere. @@ -378,7 +394,7 @@ func (r *crdHandler) removeDeadStorage() { } } if !found { - glog.V(4).Infof("Removing dead CRD storage for %s/%s", s.spec.Group, s.spec.Names.Kind) + klog.V(4).Infof("Removing dead CRD storage for %s/%s", s.spec.Group, s.spec.Names.Kind) for _, storage := range s.storages { // destroy only the main storage. Those for the subresources share cacher and etcd clients. storage.CustomResource.DestroyFunc() @@ -427,7 +443,10 @@ func (r *crdHandler) getOrCreateServingInfoFor(crd *apiextensions.CustomResource scaleScopes := map[string]handlers.RequestScope{} for _, v := range crd.Spec.Versions { - safeConverter, unsafeConverter := conversion.NewCRDConverter(crd) + safeConverter, unsafeConverter, err := r.converterFactory.NewConverter(crd) + if err != nil { + return nil, err + } // In addition to Unstructured objects (Custom Resources), we also may sometimes need to // decode unversioned Options objects, so we delegate to parameterScheme for such types. parameterScheme := runtime.NewScheme() @@ -443,19 +462,28 @@ func (r *crdHandler) getOrCreateServingInfoFor(crd *apiextensions.CustomResource typer := newUnstructuredObjectTyper(parameterScheme) creator := unstructuredCreator{} - validator, _, err := apiservervalidation.NewSchemaValidator(crd.Spec.Validation) + validationSchema, err := getSchemaForVersion(crd, v.Name) + if err != nil { + utilruntime.HandleError(err) + return nil, fmt.Errorf("the server could not properly serve the CR schema") + } + validator, _, err := apiservervalidation.NewSchemaValidator(validationSchema) if err != nil { return nil, err } var statusSpec *apiextensions.CustomResourceSubresourceStatus var statusValidator *validate.SchemaValidator - if utilfeature.DefaultFeatureGate.Enabled(apiextensionsfeatures.CustomResourceSubresources) && crd.Spec.Subresources != nil && crd.Spec.Subresources.Status != nil { - statusSpec = crd.Spec.Subresources.Status - + subresources, err := getSubresourcesForVersion(crd, v.Name) + if err != nil { + utilruntime.HandleError(err) + return nil, fmt.Errorf("the server could not properly serve the CR subresources") + } + if utilfeature.DefaultFeatureGate.Enabled(apiextensionsfeatures.CustomResourceSubresources) && subresources != nil && subresources.Status != nil { + statusSpec = subresources.Status // for the status subresource, validate only against the status schema - if crd.Spec.Validation != nil && crd.Spec.Validation.OpenAPIV3Schema != nil && crd.Spec.Validation.OpenAPIV3Schema.Properties != nil { - if statusSchema, ok := crd.Spec.Validation.OpenAPIV3Schema.Properties["status"]; ok { + if validationSchema != nil && validationSchema.OpenAPIV3Schema != nil && validationSchema.OpenAPIV3Schema.Properties != nil { + if statusSchema, ok := validationSchema.OpenAPIV3Schema.Properties["status"]; ok { openapiSchema := &spec.Schema{} if err := apiservervalidation.ConvertJSONSchemaProps(&statusSchema, openapiSchema); err != nil { return nil, err @@ -466,13 +494,18 @@ func (r *crdHandler) getOrCreateServingInfoFor(crd *apiextensions.CustomResource } var scaleSpec *apiextensions.CustomResourceSubresourceScale - if utilfeature.DefaultFeatureGate.Enabled(apiextensionsfeatures.CustomResourceSubresources) && crd.Spec.Subresources != nil && crd.Spec.Subresources.Scale != nil { - scaleSpec = crd.Spec.Subresources.Scale + if utilfeature.DefaultFeatureGate.Enabled(apiextensionsfeatures.CustomResourceSubresources) && subresources != nil && subresources.Scale != nil { + scaleSpec = subresources.Scale } - table, err := tableconvertor.New(crd.Spec.AdditionalPrinterColumns) + columns, err := getColumnsForVersion(crd, v.Name) if err != nil { - glog.V(2).Infof("The CRD for %v has an invalid printer specification, falling back to default printing: %v", kind, err) + utilruntime.HandleError(err) + return nil, fmt.Errorf("the server could not properly serve the CR columns") + } + table, err := tableconvertor.New(columns) + if err != nil { + klog.V(2).Infof("The CRD for %v has an invalid printer specification, falling back to default printing: %v", kind, err) } storages[v.Name] = customresource.NewStorage( diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler_test.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler_test.go index fa7c84e6..62ed7cca 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler_test.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler_test.go @@ -79,14 +79,24 @@ func TestConvertFieldLabel(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { - crd := apiextensions.CustomResourceDefinition{} + crd := apiextensions.CustomResourceDefinition{ + Spec: apiextensions.CustomResourceDefinitionSpec{ + Conversion: &apiextensions.CustomResourceConversion{ + Strategy: "None", + }, + }, + } if test.clusterScoped { crd.Spec.Scope = apiextensions.ClusterScoped } else { crd.Spec.Scope = apiextensions.NamespaceScoped } - _, c := conversion.NewCRDConverter(&crd) + f, err := conversion.NewCRConverterFactory(nil, nil) + if err != nil { + t.Fatal(err) + } + _, c, err := f.NewConverter(&crd) label, value, err := c.ConvertFieldLabel(schema.GroupVersionKind{}, test.label, "value") if e, a := test.expectError, err != nil; e != a { diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/helpers.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/helpers.go new file mode 100644 index 00000000..ae77bfcd --- /dev/null +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/helpers.go @@ -0,0 +1,117 @@ +/* +Copyright 2018 The Kubernetes Authors. + +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 apiserver + +import ( + "fmt" + + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" +) + +// getSchemaForVersion returns the validation schema for given version in given CRD. +func getSchemaForVersion(crd *apiextensions.CustomResourceDefinition, version string) (*apiextensions.CustomResourceValidation, error) { + if !hasPerVersionSchema(crd.Spec.Versions) { + return crd.Spec.Validation, nil + } + if crd.Spec.Validation != nil { + return nil, fmt.Errorf("malformed CustomResourceDefinition %s version %s: top-level and per-version schemas must be mutual exclusive", crd.Name, version) + } + for _, v := range crd.Spec.Versions { + if version == v.Name { + return v.Schema, nil + } + } + return nil, fmt.Errorf("version %s not found in CustomResourceDefinition: %v", version, crd.Name) +} + +// getSubresourcesForVersion returns the subresources for given version in given CRD. +func getSubresourcesForVersion(crd *apiextensions.CustomResourceDefinition, version string) (*apiextensions.CustomResourceSubresources, error) { + if !hasPerVersionSubresources(crd.Spec.Versions) { + return crd.Spec.Subresources, nil + } + if crd.Spec.Subresources != nil { + return nil, fmt.Errorf("malformed CustomResourceDefinition %s version %s: top-level and per-version subresources must be mutual exclusive", crd.Name, version) + } + for _, v := range crd.Spec.Versions { + if version == v.Name { + return v.Subresources, nil + } + } + return nil, fmt.Errorf("version %s not found in CustomResourceDefinition: %v", version, crd.Name) +} + +// getColumnsForVersion returns the columns for given version in given CRD. +// NOTE: the newly logically-defaulted columns is not pointing to the original CRD object. +// One cannot mutate the original CRD columns using the logically-defaulted columns. Please iterate through +// the original CRD object instead. +func getColumnsForVersion(crd *apiextensions.CustomResourceDefinition, version string) ([]apiextensions.CustomResourceColumnDefinition, error) { + if !hasPerVersionColumns(crd.Spec.Versions) { + return serveDefaultColumnsIfEmpty(crd.Spec.AdditionalPrinterColumns), nil + } + if len(crd.Spec.AdditionalPrinterColumns) > 0 { + return nil, fmt.Errorf("malformed CustomResourceDefinition %s version %s: top-level and per-version additionalPrinterColumns must be mutual exclusive", crd.Name, version) + } + for _, v := range crd.Spec.Versions { + if version == v.Name { + return serveDefaultColumnsIfEmpty(v.AdditionalPrinterColumns), nil + } + } + return nil, fmt.Errorf("version %s not found in CustomResourceDefinition: %v", version, crd.Name) +} + +// serveDefaultColumnsIfEmpty applies logically defaulting to columns, if the input columns is empty. +// NOTE: in this way, the newly logically-defaulted columns is not pointing to the original CRD object. +// One cannot mutate the original CRD columns using the logically-defaulted columns. Please iterate through +// the original CRD object instead. +func serveDefaultColumnsIfEmpty(columns []apiextensions.CustomResourceColumnDefinition) []apiextensions.CustomResourceColumnDefinition { + if len(columns) > 0 { + return columns + } + return []apiextensions.CustomResourceColumnDefinition{ + {Name: "Age", Type: "date", Description: swaggerMetadataDescriptions["creationTimestamp"], JSONPath: ".metadata.creationTimestamp"}, + } +} + +// hasPerVersionSchema returns true if a CRD uses per-version schema. +func hasPerVersionSchema(versions []apiextensions.CustomResourceDefinitionVersion) bool { + for _, v := range versions { + if v.Schema != nil { + return true + } + } + return false +} + +// hasPerVersionSubresources returns true if a CRD uses per-version subresources. +func hasPerVersionSubresources(versions []apiextensions.CustomResourceDefinitionVersion) bool { + for _, v := range versions { + if v.Subresources != nil { + return true + } + } + return false +} + +// hasPerVersionColumns returns true if a CRD uses per-version columns. +func hasPerVersionColumns(versions []apiextensions.CustomResourceDefinitionVersion) bool { + for _, v := range versions { + if len(v.AdditionalPrinterColumns) > 0 { + return true + } + } + return false +} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/customresourcedefinition.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/customresourcedefinition.go index f25a6ce3..c925313a 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/customresourcedefinition.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/customresourcedefinition.go @@ -19,6 +19,8 @@ limitations under the License. package v1beta1 import ( + "time" + v1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" scheme "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -73,10 +75,15 @@ func (c *customResourceDefinitions) Get(name string, options v1.GetOptions) (res // List takes label and field selectors, and returns the list of CustomResourceDefinitions that match those selectors. func (c *customResourceDefinitions) List(opts v1.ListOptions) (result *v1beta1.CustomResourceDefinitionList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1beta1.CustomResourceDefinitionList{} err = c.client.Get(). Resource("customresourcedefinitions"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -84,10 +91,15 @@ func (c *customResourceDefinitions) List(opts v1.ListOptions) (result *v1beta1.C // Watch returns a watch.Interface that watches the requested customResourceDefinitions. func (c *customResourceDefinitions) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Resource("customresourcedefinitions"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -141,9 +153,14 @@ func (c *customResourceDefinitions) Delete(name string, options *v1.DeleteOption // DeleteCollection deletes a collection of objects. func (c *customResourceDefinitions) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Resource("customresourcedefinitions"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/typed/apiextensions/internalversion/customresourcedefinition.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/typed/apiextensions/internalversion/customresourcedefinition.go index f3ddc804..57243868 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/typed/apiextensions/internalversion/customresourcedefinition.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/typed/apiextensions/internalversion/customresourcedefinition.go @@ -19,6 +19,8 @@ limitations under the License. package internalversion import ( + "time" + apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" scheme "k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -73,10 +75,15 @@ func (c *customResourceDefinitions) Get(name string, options v1.GetOptions) (res // List takes label and field selectors, and returns the list of CustomResourceDefinitions that match those selectors. func (c *customResourceDefinitions) List(opts v1.ListOptions) (result *apiextensions.CustomResourceDefinitionList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &apiextensions.CustomResourceDefinitionList{} err = c.client.Get(). Resource("customresourcedefinitions"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -84,10 +91,15 @@ func (c *customResourceDefinitions) List(opts v1.ListOptions) (result *apiextens // Watch returns a watch.Interface that watches the requested customResourceDefinitions. func (c *customResourceDefinitions) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Resource("customresourcedefinitions"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -141,9 +153,14 @@ func (c *customResourceDefinitions) Delete(name string, options *v1.DeleteOption // DeleteCollection deletes a collection of objects. func (c *customResourceDefinitions) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Resource("customresourcedefinitions"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/cmd/server/options/options.go b/vendor/k8s.io/apiextensions-apiserver/pkg/cmd/server/options/options.go index 995a3155..c787aa64 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/cmd/server/options/options.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/cmd/server/options/options.go @@ -20,6 +20,7 @@ import ( "fmt" "io" "net" + "net/url" "github.com/spf13/pflag" @@ -30,6 +31,9 @@ import ( genericregistry "k8s.io/apiserver/pkg/registry/generic" genericapiserver "k8s.io/apiserver/pkg/server" genericoptions "k8s.io/apiserver/pkg/server/options" + "k8s.io/apiserver/pkg/util/proxy" + "k8s.io/apiserver/pkg/util/webhook" + "k8s.io/client-go/listers/core/v1" ) const defaultEtcdPathPrefix = "/registry/apiextensions.kubernetes.io" @@ -46,8 +50,12 @@ type CustomResourceDefinitionsServerOptions struct { // NewCustomResourceDefinitionsServerOptions creates default options of an apiextensions-apiserver. func NewCustomResourceDefinitionsServerOptions(out, errOut io.Writer) *CustomResourceDefinitionsServerOptions { o := &CustomResourceDefinitionsServerOptions{ - RecommendedOptions: genericoptions.NewRecommendedOptions(defaultEtcdPathPrefix, apiserver.Codecs.LegacyCodec(v1beta1.SchemeGroupVersion)), - APIEnablement: genericoptions.NewAPIEnablementOptions(), + RecommendedOptions: genericoptions.NewRecommendedOptions( + defaultEtcdPathPrefix, + apiserver.Codecs.LegacyCodec(v1beta1.SchemeGroupVersion), + genericoptions.NewProcessInfo("apiextensions-apiserver", "kube-system"), + ), + APIEnablement: genericoptions.NewAPIEnablementOptions(), StdOut: out, StdErr: errOut, @@ -94,6 +102,8 @@ func (o CustomResourceDefinitionsServerOptions) Config() (*apiserver.Config, err GenericConfig: serverConfig, ExtraConfig: apiserver.ExtraConfig{ CRDRESTOptionsGetter: NewCRDRESTOptionsGetter(*o.RecommendedOptions.Etcd), + ServiceResolver: &serviceResolver{serverConfig.SharedInformerFactory.Core().V1().Services().Lister()}, + AuthResolverWrapper: webhook.NewDefaultAuthenticationInfoResolverWrapper(nil, serverConfig.LoopbackClientConfig), }, } return config, nil @@ -114,3 +124,11 @@ func NewCRDRESTOptionsGetter(etcdOptions genericoptions.EtcdOptions) genericregi return ret } + +type serviceResolver struct { + services v1.ServiceLister +} + +func (r *serviceResolver) ResolveEndpoint(namespace, name string) (*url.URL, error) { + return proxy.ResolveCluster(r.services, namespace, name) +} diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/controller/establish/establishing_controller.go b/vendor/k8s.io/apiextensions-apiserver/pkg/controller/establish/establishing_controller.go index 6420c3a6..d0414855 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/controller/establish/establishing_controller.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/controller/establish/establishing_controller.go @@ -20,12 +20,12 @@ import ( "fmt" "time" - "github.com/golang/glog" apierrors "k8s.io/apimachinery/pkg/api/errors" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/tools/cache" "k8s.io/client-go/util/workqueue" + "k8s.io/klog" "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" client "k8s.io/apiextensions-apiserver/pkg/client/clientset/internalclientset/typed/apiextensions/internalversion" @@ -70,8 +70,8 @@ func (ec *EstablishingController) Run(stopCh <-chan struct{}) { defer utilruntime.HandleCrash() defer ec.queue.ShutDown() - glog.Infof("Starting EstablishingController") - defer glog.Infof("Shutting down EstablishingController") + klog.Infof("Starting EstablishingController") + defer klog.Infof("Shutting down EstablishingController") if !cache.WaitForCacheSync(stopCh, ec.crdSynced) { return diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/controller/finalizer/crd_finalizer.go b/vendor/k8s.io/apiextensions-apiserver/pkg/controller/finalizer/crd_finalizer.go index f881427e..c2ebdcf1 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/controller/finalizer/crd_finalizer.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/controller/finalizer/crd_finalizer.go @@ -21,7 +21,7 @@ import ( "reflect" "time" - "github.com/golang/glog" + "k8s.io/klog" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" @@ -216,7 +216,7 @@ func (c *CRDFinalizer) deleteInstances(crd *apiextensions.CustomResourceDefiniti if len(listObj.(*unstructured.UnstructuredList).Items) == 0 { return true, nil } - glog.V(2).Infof("%s.%s waiting for %d items to be removed", crd.Status.AcceptedNames.Plural, crd.Spec.Group, len(listObj.(*unstructured.UnstructuredList).Items)) + klog.V(2).Infof("%s.%s waiting for %d items to be removed", crd.Status.AcceptedNames.Plural, crd.Spec.Group, len(listObj.(*unstructured.UnstructuredList).Items)) return false, nil }) if err != nil { @@ -239,8 +239,8 @@ func (c *CRDFinalizer) Run(workers int, stopCh <-chan struct{}) { defer utilruntime.HandleCrash() defer c.queue.ShutDown() - glog.Infof("Starting CRDFinalizer") - defer glog.Infof("Shutting down CRDFinalizer") + klog.Infof("Starting CRDFinalizer") + defer klog.Infof("Shutting down CRDFinalizer") if !cache.WaitForCacheSync(stopCh, c.crdSynced) { return diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/controller/status/naming_controller.go b/vendor/k8s.io/apiextensions-apiserver/pkg/controller/status/naming_controller.go index f00def4b..fe5c9479 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/controller/status/naming_controller.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/controller/status/naming_controller.go @@ -22,7 +22,7 @@ import ( "strings" "time" - "github.com/golang/glog" + "k8s.io/klog" "k8s.io/apimachinery/pkg/api/equality" apierrors "k8s.io/apimachinery/pkg/api/errors" @@ -281,8 +281,8 @@ func (c *NamingConditionController) Run(stopCh <-chan struct{}) { defer utilruntime.HandleCrash() defer c.queue.ShutDown() - glog.Infof("Starting NamingConditionController") - defer glog.Infof("Shutting down NamingConditionController") + klog.Infof("Starting NamingConditionController") + defer klog.Infof("Shutting down NamingConditionController") if !cache.WaitForCacheSync(stopCh, c.crdSynced) { return @@ -331,13 +331,13 @@ func (c *NamingConditionController) enqueue(obj *apiextensions.CustomResourceDef func (c *NamingConditionController) addCustomResourceDefinition(obj interface{}) { castObj := obj.(*apiextensions.CustomResourceDefinition) - glog.V(4).Infof("Adding %s", castObj.Name) + klog.V(4).Infof("Adding %s", castObj.Name) c.enqueue(castObj) } func (c *NamingConditionController) updateCustomResourceDefinition(obj, _ interface{}) { castObj := obj.(*apiextensions.CustomResourceDefinition) - glog.V(4).Infof("Updating %s", castObj.Name) + klog.V(4).Infof("Updating %s", castObj.Name) c.enqueue(castObj) } @@ -346,16 +346,16 @@ func (c *NamingConditionController) deleteCustomResourceDefinition(obj interface if !ok { tombstone, ok := obj.(cache.DeletedFinalStateUnknown) if !ok { - glog.Errorf("Couldn't get object from tombstone %#v", obj) + klog.Errorf("Couldn't get object from tombstone %#v", obj) return } castObj, ok = tombstone.Obj.(*apiextensions.CustomResourceDefinition) if !ok { - glog.Errorf("Tombstone contained object that is not expected %#v", obj) + klog.Errorf("Tombstone contained object that is not expected %#v", obj) return } } - glog.V(4).Infof("Deleting %q", castObj.Name) + klog.V(4).Infof("Deleting %q", castObj.Name) c.enqueue(castObj) } diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/features/kube_features.go b/vendor/k8s.io/apiextensions-apiserver/pkg/features/kube_features.go index 0690e10d..8af73d2e 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/features/kube_features.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/features/kube_features.go @@ -41,7 +41,7 @@ const ( // CustomResourceSubresources defines the subresources for CustomResources CustomResourceSubresources utilfeature.Feature = "CustomResourceSubresources" - // owner: @mbohlool + // owner: @mbohlool, @roycaihw // alpha: v1.13 // // CustomResourceWebhookConversion defines the webhook conversion for Custom Resources. diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresourcedefinition/strategy.go b/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresourcedefinition/strategy.go index 8beeaa9d..ee3d8eaf 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresourcedefinition/strategy.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/registry/customresourcedefinition/strategy.go @@ -57,9 +57,25 @@ func (strategy) PrepareForCreate(ctx context.Context, obj runtime.Object) { // if the feature gate is disabled, drop the feature. if !utilfeature.DefaultFeatureGate.Enabled(apiextensionsfeatures.CustomResourceValidation) { crd.Spec.Validation = nil + for i := range crd.Spec.Versions { + crd.Spec.Versions[i].Schema = nil + } } if !utilfeature.DefaultFeatureGate.Enabled(apiextensionsfeatures.CustomResourceSubresources) { crd.Spec.Subresources = nil + for i := range crd.Spec.Versions { + crd.Spec.Versions[i].Subresources = nil + } + } + // On CREATE, if the CustomResourceWebhookConversion feature gate is off, we auto-clear + // the per-version fields. This is to be consistent with the other built-in types, as the + // apiserver drops unknown fields. + if !utilfeature.DefaultFeatureGate.Enabled(apiextensionsfeatures.CustomResourceWebhookConversion) { + for i := range crd.Spec.Versions { + crd.Spec.Versions[i].Schema = nil + crd.Spec.Versions[i].Subresources = nil + crd.Spec.Versions[i].AdditionalPrinterColumns = nil + } } if !utilfeature.DefaultFeatureGate.Enabled(apiextensionsfeatures.CustomResourceWebhookConversion) && crd.Spec.Conversion != nil { crd.Spec.Conversion.WebhookClientConfig = nil @@ -96,10 +112,36 @@ func (strategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object) { if !utilfeature.DefaultFeatureGate.Enabled(apiextensionsfeatures.CustomResourceValidation) { newCRD.Spec.Validation = nil oldCRD.Spec.Validation = nil + for i := range newCRD.Spec.Versions { + newCRD.Spec.Versions[i].Schema = nil + } + for i := range oldCRD.Spec.Versions { + oldCRD.Spec.Versions[i].Schema = nil + } } if !utilfeature.DefaultFeatureGate.Enabled(apiextensionsfeatures.CustomResourceSubresources) { newCRD.Spec.Subresources = nil oldCRD.Spec.Subresources = nil + for i := range newCRD.Spec.Versions { + newCRD.Spec.Versions[i].Subresources = nil + } + for i := range oldCRD.Spec.Versions { + oldCRD.Spec.Versions[i].Subresources = nil + } + } + + // On UPDATE, if the CustomResourceWebhookConversion feature gate is off, we auto-clear + // the per-version fields if the old CRD doesn't use per-version fields already. + // This is to be consistent with the other built-in types, as the apiserver drops unknown + // fields. If the old CRD already uses per-version fields, the CRD is allowed to continue + // use per-version fields. + if !utilfeature.DefaultFeatureGate.Enabled(apiextensionsfeatures.CustomResourceWebhookConversion) && + !hasPerVersionField(oldCRD.Spec.Versions) { + for i := range newCRD.Spec.Versions { + newCRD.Spec.Versions[i].Schema = nil + newCRD.Spec.Versions[i].Subresources = nil + newCRD.Spec.Versions[i].AdditionalPrinterColumns = nil + } } if !utilfeature.DefaultFeatureGate.Enabled(apiextensionsfeatures.CustomResourceWebhookConversion) && newCRD.Spec.Conversion != nil { if oldCRD.Spec.Conversion == nil || newCRD.Spec.Conversion.WebhookClientConfig == nil { @@ -117,6 +159,16 @@ func (strategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object) { } } +// hasPerVersionField returns true if a CRD uses per-version schema/subresources/columns fields. +func hasPerVersionField(versions []apiextensions.CustomResourceDefinitionVersion) bool { + for _, v := range versions { + if v.Schema != nil || v.Subresources != nil || len(v.AdditionalPrinterColumns) > 0 { + return true + } + } + return false +} + // Validate validates a new CustomResourceDefinition. func (strategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList { return validation.ValidateCustomResourceDefinition(obj.(*apiextensions.CustomResourceDefinition)) diff --git a/vendor/k8s.io/apiextensions-apiserver/test/integration/fixtures/resources.go b/vendor/k8s.io/apiextensions-apiserver/test/integration/fixtures/resources.go index 9a1f2d84..7230725d 100644 --- a/vendor/k8s.io/apiextensions-apiserver/test/integration/fixtures/resources.go +++ b/vendor/k8s.io/apiextensions-apiserver/test/integration/fixtures/resources.go @@ -370,13 +370,13 @@ func DeleteCustomResourceDefinition(crd *apiextensionsv1beta1.CustomResourceDefi return nil } -// CreateNewScaleClient returns a scale client. -func CreateNewScaleClient(crd *apiextensionsv1beta1.CustomResourceDefinition, config *rest.Config) (scale.ScalesGetter, error) { +// CreateNewVersionedScaleClient returns a scale client. +func CreateNewVersionedScaleClient(crd *apiextensionsv1beta1.CustomResourceDefinition, config *rest.Config, version string) (scale.ScalesGetter, error) { discoveryClient, err := discovery.NewDiscoveryClientForConfig(config) if err != nil { return nil, err } - groupResource, err := discoveryClient.ServerResourcesForGroupVersion(crd.Spec.Group + "/" + crd.Spec.Version) + groupResource, err := discoveryClient.ServerResourcesForGroupVersion(crd.Spec.Group + "/" + version) if err != nil { return nil, err } @@ -386,12 +386,12 @@ func CreateNewScaleClient(crd *apiextensionsv1beta1.CustomResourceDefinition, co Group: metav1.APIGroup{ Name: crd.Spec.Group, Versions: []metav1.GroupVersionForDiscovery{ - {Version: crd.Spec.Version}, + {Version: version}, }, - PreferredVersion: metav1.GroupVersionForDiscovery{Version: crd.Spec.Version}, + PreferredVersion: metav1.GroupVersionForDiscovery{Version: version}, }, VersionedResources: map[string][]metav1.APIResource{ - crd.Spec.Version: groupResource.APIResources, + version: groupResource.APIResources, }, }, } diff --git a/vendor/k8s.io/apiextensions-apiserver/test/integration/helpers.go b/vendor/k8s.io/apiextensions-apiserver/test/integration/helpers.go index 76344034..7a7d6611 100644 --- a/vendor/k8s.io/apiextensions-apiserver/test/integration/helpers.go +++ b/vendor/k8s.io/apiextensions-apiserver/test/integration/helpers.go @@ -30,6 +30,8 @@ import ( "k8s.io/client-go/dynamic" ) +var swaggerMetadataDescriptions = metav1.ObjectMeta{}.SwaggerDoc() + func instantiateCustomResource(t *testing.T, instanceToCreate *unstructured.Unstructured, client dynamic.ResourceInterface, definition *apiextensionsv1beta1.CustomResourceDefinition) (*unstructured.Unstructured, error) { return instantiateVersionedCustomResource(t, instanceToCreate, client, definition, definition.Spec.Versions[0].Name) } @@ -74,8 +76,8 @@ func newNamespacedCustomResourceClient(ns string, client dynamic.Interface, crd return newNamespacedCustomResourceVersionedClient(ns, client, crd, crd.Spec.Versions[0].Name) } -// updateCustomResourceDefinitionWithRetry updates a CRD, retrying up to 5 times on version conflict errors. -func updateCustomResourceDefinitionWithRetry(client clientset.Interface, name string, update func(*apiextensionsv1beta1.CustomResourceDefinition)) (*apiextensionsv1beta1.CustomResourceDefinition, error) { +// UpdateCustomResourceDefinitionWithRetry updates a CRD, retrying up to 5 times on version conflict errors. +func UpdateCustomResourceDefinitionWithRetry(client clientset.Interface, name string, update func(*apiextensionsv1beta1.CustomResourceDefinition)) (*apiextensionsv1beta1.CustomResourceDefinition, error) { for i := 0; i < 5; i++ { crd, err := client.ApiextensionsV1beta1().CustomResourceDefinitions().Get(name, metav1.GetOptions{}) if err != nil { @@ -92,3 +94,97 @@ func updateCustomResourceDefinitionWithRetry(client clientset.Interface, name st } return nil, fmt.Errorf("too many retries after conflicts updating CustomResourceDefinition %q", name) } + +// getSchemaForVersion returns the validation schema for given version in given CRD. +func getSchemaForVersion(crd *apiextensionsv1beta1.CustomResourceDefinition, version string) (*apiextensionsv1beta1.CustomResourceValidation, error) { + if !hasPerVersionSchema(crd.Spec.Versions) { + return crd.Spec.Validation, nil + } + if crd.Spec.Validation != nil { + return nil, fmt.Errorf("malformed CustomResourceDefinition %s version %s: top-level and per-version schemas must be mutual exclusive", crd.Name, version) + } + for _, v := range crd.Spec.Versions { + if version == v.Name { + return v.Schema, nil + } + } + return nil, fmt.Errorf("version %s not found in CustomResourceDefinition: %v", version, crd.Name) +} + +// getSubresourcesForVersion returns the subresources for given version in given CRD. +func getSubresourcesForVersion(crd *apiextensionsv1beta1.CustomResourceDefinition, version string) (*apiextensionsv1beta1.CustomResourceSubresources, error) { + if !hasPerVersionSubresources(crd.Spec.Versions) { + return crd.Spec.Subresources, nil + } + if crd.Spec.Subresources != nil { + return nil, fmt.Errorf("malformed CustomResourceDefinition %s version %s: top-level and per-version subresources must be mutual exclusive", crd.Name, version) + } + for _, v := range crd.Spec.Versions { + if version == v.Name { + return v.Subresources, nil + } + } + return nil, fmt.Errorf("version %s not found in CustomResourceDefinition: %v", version, crd.Name) +} + +// getColumnsForVersion returns the columns for given version in given CRD. +// NOTE: the newly logically-defaulted columns is not pointing to the original CRD object. +// One cannot mutate the original CRD columns using the logically-defaulted columns. Please iterate through +// the original CRD object instead. +func getColumnsForVersion(crd *apiextensionsv1beta1.CustomResourceDefinition, version string) ([]apiextensionsv1beta1.CustomResourceColumnDefinition, error) { + if !hasPerVersionColumns(crd.Spec.Versions) { + return serveDefaultColumnsIfEmpty(crd.Spec.AdditionalPrinterColumns), nil + } + if len(crd.Spec.AdditionalPrinterColumns) > 0 { + return nil, fmt.Errorf("malformed CustomResourceDefinition %s version %s: top-level and per-version additionalPrinterColumns must be mutual exclusive", crd.Name, version) + } + for _, v := range crd.Spec.Versions { + if version == v.Name { + return serveDefaultColumnsIfEmpty(v.AdditionalPrinterColumns), nil + } + } + return nil, fmt.Errorf("version %s not found in CustomResourceDefinition: %v", version, crd.Name) +} + +// serveDefaultColumnsIfEmpty applies logically defaulting to columns, if the input columns is empty. +// NOTE: in this way, the newly logically-defaulted columns is not pointing to the original CRD object. +// One cannot mutate the original CRD columns using the logically-defaulted columns. Please iterate through +// the original CRD object instead. +func serveDefaultColumnsIfEmpty(columns []apiextensionsv1beta1.CustomResourceColumnDefinition) []apiextensionsv1beta1.CustomResourceColumnDefinition { + if len(columns) > 0 { + return columns + } + return []apiextensionsv1beta1.CustomResourceColumnDefinition{ + {Name: "Age", Type: "date", Description: swaggerMetadataDescriptions["creationTimestamp"], JSONPath: ".metadata.creationTimestamp"}, + } +} + +// hasPerVersionSchema returns true if a CRD uses per-version schema. +func hasPerVersionSchema(versions []apiextensionsv1beta1.CustomResourceDefinitionVersion) bool { + for _, v := range versions { + if v.Schema != nil { + return true + } + } + return false +} + +// hasPerVersionSubresources returns true if a CRD uses per-version subresources. +func hasPerVersionSubresources(versions []apiextensionsv1beta1.CustomResourceDefinitionVersion) bool { + for _, v := range versions { + if v.Subresources != nil { + return true + } + } + return false +} + +// hasPerVersionColumns returns true if a CRD uses per-version columns. +func hasPerVersionColumns(versions []apiextensionsv1beta1.CustomResourceDefinitionVersion) bool { + for _, v := range versions { + if len(v.AdditionalPrinterColumns) > 0 { + return true + } + } + return false +} diff --git a/vendor/k8s.io/apiextensions-apiserver/test/integration/subresources_test.go b/vendor/k8s.io/apiextensions-apiserver/test/integration/subresources_test.go index 3c0f8976..c3a7c1cb 100644 --- a/vendor/k8s.io/apiextensions-apiserver/test/integration/subresources_test.go +++ b/vendor/k8s.io/apiextensions-apiserver/test/integration/subresources_test.go @@ -17,6 +17,7 @@ limitations under the License. package integration import ( + "fmt" "math" "reflect" "sort" @@ -29,49 +30,108 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" + utilfeature "k8s.io/apiserver/pkg/util/feature" + utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" "k8s.io/client-go/dynamic" apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" + apiextensionsfeatures "k8s.io/apiextensions-apiserver/pkg/features" "k8s.io/apiextensions-apiserver/test/integration/fixtures" ) var labelSelectorPath = ".status.labelSelector" +var anotherLabelSelectorPath = ".status.anotherLabelSelector" -func NewNoxuSubresourcesCRD(scope apiextensionsv1beta1.ResourceScope) *apiextensionsv1beta1.CustomResourceDefinition { - return &apiextensionsv1beta1.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{Name: "noxus.mygroup.example.com"}, - Spec: apiextensionsv1beta1.CustomResourceDefinitionSpec{ - Group: "mygroup.example.com", - Version: "v1beta1", - Names: apiextensionsv1beta1.CustomResourceDefinitionNames{ - Plural: "noxus", - Singular: "nonenglishnoxu", - Kind: "WishIHadChosenNoxu", - ShortNames: []string{"foo", "bar", "abc", "def"}, - ListKind: "NoxuItemList", +func NewNoxuSubresourcesCRDs(scope apiextensionsv1beta1.ResourceScope) []*apiextensionsv1beta1.CustomResourceDefinition { + return []*apiextensionsv1beta1.CustomResourceDefinition{ + // CRD that uses top-level subresources + { + ObjectMeta: metav1.ObjectMeta{Name: "noxus.mygroup.example.com"}, + Spec: apiextensionsv1beta1.CustomResourceDefinitionSpec{ + Group: "mygroup.example.com", + Version: "v1beta1", + Names: apiextensionsv1beta1.CustomResourceDefinitionNames{ + Plural: "noxus", + Singular: "nonenglishnoxu", + Kind: "WishIHadChosenNoxu", + ShortNames: []string{"foo", "bar", "abc", "def"}, + ListKind: "NoxuItemList", + }, + Scope: scope, + Versions: []apiextensionsv1beta1.CustomResourceDefinitionVersion{ + { + Name: "v1beta1", + Served: true, + Storage: true, + }, + { + Name: "v1", + Served: true, + Storage: false, + }, + }, + Subresources: &apiextensionsv1beta1.CustomResourceSubresources{ + Status: &apiextensionsv1beta1.CustomResourceSubresourceStatus{}, + Scale: &apiextensionsv1beta1.CustomResourceSubresourceScale{ + SpecReplicasPath: ".spec.replicas", + StatusReplicasPath: ".status.replicas", + LabelSelectorPath: &labelSelectorPath, + }, + }, }, - Versions: []apiextensionsv1beta1.CustomResourceDefinitionVersion{ - {Name: "v1beta1", Served: true, Storage: false}, - {Name: "v1", Served: true, Storage: true}, - }, - Scope: scope, - Subresources: &apiextensionsv1beta1.CustomResourceSubresources{ - Status: &apiextensionsv1beta1.CustomResourceSubresourceStatus{}, - Scale: &apiextensionsv1beta1.CustomResourceSubresourceScale{ - SpecReplicasPath: ".spec.replicas", - StatusReplicasPath: ".status.replicas", - LabelSelectorPath: &labelSelectorPath, + }, + // CRD that uses per-version subresources + { + ObjectMeta: metav1.ObjectMeta{Name: "noxus.mygroup.example.com"}, + Spec: apiextensionsv1beta1.CustomResourceDefinitionSpec{ + Group: "mygroup.example.com", + Version: "v1beta1", + Names: apiextensionsv1beta1.CustomResourceDefinitionNames{ + Plural: "noxus", + Singular: "nonenglishnoxu", + Kind: "WishIHadChosenNoxu", + ShortNames: []string{"foo", "bar", "abc", "def"}, + ListKind: "NoxuItemList", + }, + Scope: scope, + Versions: []apiextensionsv1beta1.CustomResourceDefinitionVersion{ + { + Name: "v1beta1", + Served: true, + Storage: true, + Subresources: &apiextensionsv1beta1.CustomResourceSubresources{ + Status: &apiextensionsv1beta1.CustomResourceSubresourceStatus{}, + Scale: &apiextensionsv1beta1.CustomResourceSubresourceScale{ + SpecReplicasPath: ".spec.replicas", + StatusReplicasPath: ".status.replicas", + LabelSelectorPath: &labelSelectorPath, + }, + }, + }, + { + Name: "v1", + Served: true, + Storage: false, + Subresources: &apiextensionsv1beta1.CustomResourceSubresources{ + Status: &apiextensionsv1beta1.CustomResourceSubresourceStatus{}, + Scale: &apiextensionsv1beta1.CustomResourceSubresourceScale{ + SpecReplicasPath: ".spec.replicas", + StatusReplicasPath: ".status.replicas", + LabelSelectorPath: &anotherLabelSelectorPath, + }, + }, + }, }, }, }, } } -func NewNoxuSubresourceInstance(namespace, name string) *unstructured.Unstructured { +func NewNoxuSubresourceInstance(namespace, name, version string) *unstructured.Unstructured { return &unstructured.Unstructured{ Object: map[string]interface{}{ - "apiVersion": "mygroup.example.com/v1beta1", + "apiVersion": fmt.Sprintf("mygroup.example.com/%s", version), "kind": "WishIHadChosenNoxu", "metadata": map[string]interface{}{ "namespace": namespace, @@ -89,112 +149,120 @@ func NewNoxuSubresourceInstance(namespace, name string) *unstructured.Unstructur } func TestStatusSubresource(t *testing.T) { + defer utilfeaturetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, apiextensionsfeatures.CustomResourceWebhookConversion, true)() tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) if err != nil { t.Fatal(err) } defer tearDown() - noxuDefinition := NewNoxuSubresourcesCRD(apiextensionsv1beta1.NamespaceScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } + noxuDefinitions := NewNoxuSubresourcesCRDs(apiextensionsv1beta1.NamespaceScoped) + for _, noxuDefinition := range noxuDefinitions { + noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) + if err != nil { + t.Fatal(err) + } - ns := "not-the-default" - noxuResourceClient := newNamespacedCustomResourceClient(ns, dynamicClient, noxuDefinition) - _, err = instantiateCustomResource(t, NewNoxuSubresourceInstance(ns, "foo"), noxuResourceClient, noxuDefinition) - if err != nil { - t.Fatalf("unable to create noxu instance: %v", err) - } + ns := "not-the-default" + for _, v := range noxuDefinition.Spec.Versions { + noxuResourceClient := newNamespacedCustomResourceVersionedClient(ns, dynamicClient, noxuDefinition, v.Name) + _, err = instantiateVersionedCustomResource(t, NewNoxuSubresourceInstance(ns, "foo", v.Name), noxuResourceClient, noxuDefinition, v.Name) + if err != nil { + t.Fatalf("unable to create noxu instance: %v", err) + } + gottenNoxuInstance, err := noxuResourceClient.Get("foo", metav1.GetOptions{}) + if err != nil { + t.Fatal(err) + } + // status should not be set after creation + if val, ok := gottenNoxuInstance.Object["status"]; ok { + t.Fatalf("status should not be set after creation, got %v", val) + } - gottenNoxuInstance, err := noxuResourceClient.Get("foo", metav1.GetOptions{}) - if err != nil { - t.Fatal(err) - } + // .status.num = 20 + err = unstructured.SetNestedField(gottenNoxuInstance.Object, int64(20), "status", "num") + if err != nil { + t.Fatalf("unexpected error: %v", err) + } - // status should not be set after creation - if val, ok := gottenNoxuInstance.Object["status"]; ok { - t.Fatalf("status should not be set after creation, got %v", val) - } + // .spec.num = 20 + err = unstructured.SetNestedField(gottenNoxuInstance.Object, int64(20), "spec", "num") + if err != nil { + t.Fatalf("unexpected error: %v", err) + } - // .status.num = 20 - err = unstructured.SetNestedField(gottenNoxuInstance.Object, int64(20), "status", "num") - if err != nil { - t.Fatalf("unexpected error: %v", err) - } + // UpdateStatus should not update spec. + // Check that .spec.num = 10 and .status.num = 20 + updatedStatusInstance, err := noxuResourceClient.UpdateStatus(gottenNoxuInstance, metav1.UpdateOptions{}) + if err != nil { + t.Fatalf("unable to update status: %v", err) + } - // .spec.num = 20 - err = unstructured.SetNestedField(gottenNoxuInstance.Object, int64(20), "spec", "num") - if err != nil { - t.Fatalf("unexpected error: %v", err) - } + specNum, found, err := unstructured.NestedInt64(updatedStatusInstance.Object, "spec", "num") + if !found || err != nil { + t.Fatalf("unable to get .spec.num") + } + if specNum != int64(10) { + t.Fatalf(".spec.num: expected: %v, got: %v", int64(10), specNum) + } - // UpdateStatus should not update spec. - // Check that .spec.num = 10 and .status.num = 20 - updatedStatusInstance, err := noxuResourceClient.UpdateStatus(gottenNoxuInstance, metav1.UpdateOptions{}) - if err != nil { - t.Fatalf("unable to update status: %v", err) - } + statusNum, found, err := unstructured.NestedInt64(updatedStatusInstance.Object, "status", "num") + if !found || err != nil { + t.Fatalf("unable to get .status.num") + } + if statusNum != int64(20) { + t.Fatalf(".status.num: expected: %v, got: %v", int64(20), statusNum) + } - specNum, found, err := unstructured.NestedInt64(updatedStatusInstance.Object, "spec", "num") - if !found || err != nil { - t.Fatalf("unable to get .spec.num") - } - if specNum != int64(10) { - t.Fatalf(".spec.num: expected: %v, got: %v", int64(10), specNum) - } + gottenNoxuInstance, err = noxuResourceClient.Get("foo", metav1.GetOptions{}) + if err != nil { + t.Fatal(err) + } - statusNum, found, err := unstructured.NestedInt64(updatedStatusInstance.Object, "status", "num") - if !found || err != nil { - t.Fatalf("unable to get .status.num") - } - if statusNum != int64(20) { - t.Fatalf(".status.num: expected: %v, got: %v", int64(20), statusNum) - } + // .status.num = 40 + err = unstructured.SetNestedField(gottenNoxuInstance.Object, int64(40), "status", "num") + if err != nil { + t.Fatalf("unexpected error: %v", err) + } - gottenNoxuInstance, err = noxuResourceClient.Get("foo", metav1.GetOptions{}) - if err != nil { - t.Fatal(err) - } + // .spec.num = 40 + err = unstructured.SetNestedField(gottenNoxuInstance.Object, int64(40), "spec", "num") + if err != nil { + t.Fatalf("unexpected error: %v", err) + } - // .status.num = 40 - err = unstructured.SetNestedField(gottenNoxuInstance.Object, int64(40), "status", "num") - if err != nil { - t.Fatalf("unexpected error: %v", err) - } + // Update should not update status. + // Check that .spec.num = 40 and .status.num = 20 + updatedInstance, err := noxuResourceClient.Update(gottenNoxuInstance, metav1.UpdateOptions{}) + if err != nil { + t.Fatalf("unable to update instance: %v", err) + } - // .spec.num = 40 - err = unstructured.SetNestedField(gottenNoxuInstance.Object, int64(40), "spec", "num") - if err != nil { - t.Fatalf("unexpected error: %v", err) - } + specNum, found, err = unstructured.NestedInt64(updatedInstance.Object, "spec", "num") + if !found || err != nil { + t.Fatalf("unable to get .spec.num") + } + if specNum != int64(40) { + t.Fatalf(".spec.num: expected: %v, got: %v", int64(40), specNum) + } - // Update should not update status. - // Check that .spec.num = 40 and .status.num = 20 - updatedInstance, err := noxuResourceClient.Update(gottenNoxuInstance, metav1.UpdateOptions{}) - if err != nil { - t.Fatalf("unable to update instance: %v", err) - } - - specNum, found, err = unstructured.NestedInt64(updatedInstance.Object, "spec", "num") - if !found || err != nil { - t.Fatalf("unable to get .spec.num") - } - if specNum != int64(40) { - t.Fatalf(".spec.num: expected: %v, got: %v", int64(40), specNum) - } - - statusNum, found, err = unstructured.NestedInt64(updatedInstance.Object, "status", "num") - if !found || err != nil { - t.Fatalf("unable to get .status.num") - } - if statusNum != int64(20) { - t.Fatalf(".status.num: expected: %v, got: %v", int64(20), statusNum) + statusNum, found, err = unstructured.NestedInt64(updatedInstance.Object, "status", "num") + if !found || err != nil { + t.Fatalf("unable to get .status.num") + } + if statusNum != int64(20) { + t.Fatalf(".status.num: expected: %v, got: %v", int64(20), statusNum) + } + noxuResourceClient.Delete("foo", &metav1.DeleteOptions{}) + } + if err := fixtures.DeleteCustomResourceDefinition(noxuDefinition, apiExtensionClient); err != nil { + t.Fatal(err) + } } } func TestScaleSubresource(t *testing.T) { + defer utilfeaturetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, apiextensionsfeatures.CustomResourceWebhookConversion, true)() groupResource := schema.GroupResource{ Group: "mygroup.example.com", Resource: "noxus", @@ -215,117 +283,132 @@ func TestScaleSubresource(t *testing.T) { t.Fatal(err) } - noxuDefinition := NewNoxuSubresourcesCRD(apiextensionsv1beta1.NamespaceScoped) + noxuDefinitions := NewNoxuSubresourcesCRDs(apiextensionsv1beta1.NamespaceScoped) + for _, noxuDefinition := range noxuDefinitions { + for _, v := range noxuDefinition.Spec.Versions { + // Start with a new CRD, so that the object doesn't have resourceVersion + noxuDefinition := noxuDefinition.DeepCopy() - // set invalid json path for specReplicasPath - noxuDefinition.Spec.Subresources.Scale.SpecReplicasPath = "foo,bar" - _, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err == nil { - t.Fatalf("unexpected non-error: specReplicasPath should be a valid json path under .spec") - } + subresources, err := getSubresourcesForVersion(noxuDefinition, v.Name) + if err != nil { + t.Fatal(err) + } + // set invalid json path for specReplicasPath + subresources.Scale.SpecReplicasPath = "foo,bar" + _, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) + if err == nil { + t.Fatalf("unexpected non-error: specReplicasPath should be a valid json path under .spec") + } - noxuDefinition.Spec.Subresources.Scale.SpecReplicasPath = ".spec.replicas" - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } + subresources.Scale.SpecReplicasPath = ".spec.replicas" + noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) + if err != nil { + t.Fatal(err) + } - ns := "not-the-default" - noxuResourceClient := newNamespacedCustomResourceClient(ns, dynamicClient, noxuDefinition) - _, err = instantiateCustomResource(t, NewNoxuSubresourceInstance(ns, "foo"), noxuResourceClient, noxuDefinition) - if err != nil { - t.Fatalf("unable to create noxu instance: %v", err) - } + ns := "not-the-default" + noxuResourceClient := newNamespacedCustomResourceVersionedClient(ns, dynamicClient, noxuDefinition, v.Name) + _, err = instantiateVersionedCustomResource(t, NewNoxuSubresourceInstance(ns, "foo", v.Name), noxuResourceClient, noxuDefinition, v.Name) + if err != nil { + t.Fatalf("unable to create noxu instance: %v", err) + } - scaleClient, err := fixtures.CreateNewScaleClient(noxuDefinition, config) - if err != nil { - t.Fatal(err) - } + scaleClient, err := fixtures.CreateNewVersionedScaleClient(noxuDefinition, config, v.Name) + if err != nil { + t.Fatal(err) + } - // set .status.labelSelector = bar - gottenNoxuInstance, err := noxuResourceClient.Get("foo", metav1.GetOptions{}) - if err != nil { - t.Fatal(err) - } - err = unstructured.SetNestedField(gottenNoxuInstance.Object, "bar", "status", "labelSelector") - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - _, err = noxuResourceClient.UpdateStatus(gottenNoxuInstance, metav1.UpdateOptions{}) - if err != nil { - t.Fatalf("unable to update status: %v", err) - } + // set .status.labelSelector = bar + gottenNoxuInstance, err := noxuResourceClient.Get("foo", metav1.GetOptions{}) + if err != nil { + t.Fatal(err) + } + err = unstructured.SetNestedField(gottenNoxuInstance.Object, "bar", strings.Split((*subresources.Scale.LabelSelectorPath)[1:], ".")...) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + _, err = noxuResourceClient.UpdateStatus(gottenNoxuInstance, metav1.UpdateOptions{}) + if err != nil { + t.Fatalf("unable to update status: %v", err) + } - // get the scale object - gottenScale, err := scaleClient.Scales("not-the-default").Get(groupResource, "foo") - if err != nil { - t.Fatal(err) - } - if gottenScale.Spec.Replicas != 3 { - t.Fatalf("Scale.Spec.Replicas: expected: %v, got: %v", 3, gottenScale.Spec.Replicas) - } - if gottenScale.Status.Selector != "bar" { - t.Fatalf("Scale.Status.Selector: expected: %v, got: %v", "bar", gottenScale.Status.Selector) - } + // get the scale object + gottenScale, err := scaleClient.Scales("not-the-default").Get(groupResource, "foo") + if err != nil { + t.Fatal(err) + } + if gottenScale.Spec.Replicas != 3 { + t.Fatalf("Scale.Spec.Replicas: expected: %v, got: %v", 3, gottenScale.Spec.Replicas) + } + if gottenScale.Status.Selector != "bar" { + t.Fatalf("Scale.Status.Selector: expected: %v, got: %v", "bar", gottenScale.Status.Selector) + } - // check self link - expectedSelfLink := "/apis/mygroup.example.com/v1beta1/namespaces/not-the-default/noxus/foo/scale" - if gottenScale.GetSelfLink() != expectedSelfLink { - t.Fatalf("Scale.Metadata.SelfLink: expected: %v, got: %v", expectedSelfLink, gottenScale.GetSelfLink()) - } + // check self link + expectedSelfLink := fmt.Sprintf("/apis/mygroup.example.com/%s/namespaces/not-the-default/noxus/foo/scale", v.Name) + if gottenScale.GetSelfLink() != expectedSelfLink { + t.Fatalf("Scale.Metadata.SelfLink: expected: %v, got: %v", expectedSelfLink, gottenScale.GetSelfLink()) + } - // update the scale object - // check that spec is updated, but status is not - gottenScale.Spec.Replicas = 5 - gottenScale.Status.Selector = "baz" - updatedScale, err := scaleClient.Scales("not-the-default").Update(groupResource, gottenScale) - if err != nil { - t.Fatal(err) - } - if updatedScale.Spec.Replicas != 5 { - t.Fatalf("replicas: expected: %v, got: %v", 5, updatedScale.Spec.Replicas) - } - if updatedScale.Status.Selector != "bar" { - t.Fatalf("scale should not update status: expected %v, got: %v", "bar", updatedScale.Status.Selector) - } + // update the scale object + // check that spec is updated, but status is not + gottenScale.Spec.Replicas = 5 + gottenScale.Status.Selector = "baz" + updatedScale, err := scaleClient.Scales("not-the-default").Update(groupResource, gottenScale) + if err != nil { + t.Fatal(err) + } + if updatedScale.Spec.Replicas != 5 { + t.Fatalf("replicas: expected: %v, got: %v", 5, updatedScale.Spec.Replicas) + } + if updatedScale.Status.Selector != "bar" { + t.Fatalf("scale should not update status: expected %v, got: %v", "bar", updatedScale.Status.Selector) + } - // check that .spec.replicas = 5, but status is not updated - updatedNoxuInstance, err := noxuResourceClient.Get("foo", metav1.GetOptions{}) - if err != nil { - t.Fatal(err) - } - specReplicas, found, err := unstructured.NestedInt64(updatedNoxuInstance.Object, "spec", "replicas") - if !found || err != nil { - t.Fatalf("unable to get .spec.replicas") - } - if specReplicas != 5 { - t.Fatalf("replicas: expected: %v, got: %v", 5, specReplicas) - } - statusLabelSelector, found, err := unstructured.NestedString(updatedNoxuInstance.Object, "status", "labelSelector") - if !found || err != nil { - t.Fatalf("unable to get .status.labelSelector") - } - if statusLabelSelector != "bar" { - t.Fatalf("scale should not update status: expected %v, got: %v", "bar", statusLabelSelector) - } + // check that .spec.replicas = 5, but status is not updated + updatedNoxuInstance, err := noxuResourceClient.Get("foo", metav1.GetOptions{}) + if err != nil { + t.Fatal(err) + } + specReplicas, found, err := unstructured.NestedInt64(updatedNoxuInstance.Object, "spec", "replicas") + if !found || err != nil { + t.Fatalf("unable to get .spec.replicas") + } + if specReplicas != 5 { + t.Fatalf("replicas: expected: %v, got: %v", 5, specReplicas) + } + statusLabelSelector, found, err := unstructured.NestedString(updatedNoxuInstance.Object, strings.Split((*subresources.Scale.LabelSelectorPath)[1:], ".")...) + if !found || err != nil { + t.Fatalf("unable to get %s", *subresources.Scale.LabelSelectorPath) + } + if statusLabelSelector != "bar" { + t.Fatalf("scale should not update status: expected %v, got: %v", "bar", statusLabelSelector) + } - // validate maximum value - // set .spec.replicas = math.MaxInt64 - gottenNoxuInstance, err = noxuResourceClient.Get("foo", metav1.GetOptions{}) - if err != nil { - t.Fatal(err) - } - err = unstructured.SetNestedField(gottenNoxuInstance.Object, int64(math.MaxInt64), "spec", "replicas") - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - _, err = noxuResourceClient.Update(gottenNoxuInstance, metav1.UpdateOptions{}) - if err == nil { - t.Fatalf("unexpected non-error: .spec.replicas should be less than 2147483647") + // validate maximum value + // set .spec.replicas = math.MaxInt64 + gottenNoxuInstance, err = noxuResourceClient.Get("foo", metav1.GetOptions{}) + if err != nil { + t.Fatal(err) + } + err = unstructured.SetNestedField(gottenNoxuInstance.Object, int64(math.MaxInt64), "spec", "replicas") + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + _, err = noxuResourceClient.Update(gottenNoxuInstance, metav1.UpdateOptions{}) + if err == nil { + t.Fatalf("unexpected non-error: .spec.replicas should be less than 2147483647") + } + noxuResourceClient.Delete("foo", &metav1.DeleteOptions{}) + if err := fixtures.DeleteCustomResourceDefinition(noxuDefinition, apiExtensionClient); err != nil { + t.Fatal(err) + } + } } } func TestValidationSchemaWithStatus(t *testing.T) { + defer utilfeaturetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, apiextensionsfeatures.CustomResourceWebhookConversion, true)() tearDown, config, _, err := fixtures.StartDefaultServer(t) if err != nil { t.Fatal(err) @@ -342,7 +425,7 @@ func TestValidationSchemaWithStatus(t *testing.T) { } // fields other than properties in root schema are not allowed - noxuDefinition := newNoxuValidationCRD(apiextensionsv1beta1.NamespaceScoped) + noxuDefinition := newNoxuValidationCRDs(apiextensionsv1beta1.NamespaceScoped)[0] noxuDefinition.Spec.Subresources = &apiextensionsv1beta1.CustomResourceSubresources{ Status: &apiextensionsv1beta1.CustomResourceSubresourceStatus{}, } @@ -373,6 +456,7 @@ func TestValidationSchemaWithStatus(t *testing.T) { } func TestValidateOnlyStatus(t *testing.T) { + defer utilfeaturetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, apiextensionsfeatures.CustomResourceWebhookConversion, true)() tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) if err != nil { t.Fatal(err) @@ -407,59 +491,79 @@ func TestValidateOnlyStatus(t *testing.T) { }, } - noxuDefinition := NewNoxuSubresourcesCRD(apiextensionsv1beta1.NamespaceScoped) - noxuDefinition.Spec.Validation = &apiextensionsv1beta1.CustomResourceValidation{ - OpenAPIV3Schema: schema, - } + noxuDefinitions := NewNoxuSubresourcesCRDs(apiextensionsv1beta1.NamespaceScoped) + for i, noxuDefinition := range noxuDefinitions { + if i == 0 { + noxuDefinition.Spec.Validation = &apiextensionsv1beta1.CustomResourceValidation{ + OpenAPIV3Schema: schema, + } + } else { + noxuDefinition.Spec.Versions[0].Schema = &apiextensionsv1beta1.CustomResourceValidation{ + OpenAPIV3Schema: schema, + } + schemaWithDescription := schema.DeepCopy() + schemaWithDescription.Description = "test" + noxuDefinition.Spec.Versions[1].Schema = &apiextensionsv1beta1.CustomResourceValidation{ + OpenAPIV3Schema: schemaWithDescription, + } + } - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - ns := "not-the-default" - noxuResourceClient := newNamespacedCustomResourceClient(ns, dynamicClient, noxuDefinition) + noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) + if err != nil { + t.Fatal(err) + } + ns := "not-the-default" + for _, v := range noxuDefinition.Spec.Versions { + noxuResourceClient := newNamespacedCustomResourceVersionedClient(ns, dynamicClient, noxuDefinition, v.Name) - // set .spec.num = 10 and .status.num = 10 - noxuInstance := NewNoxuSubresourceInstance(ns, "foo") - err = unstructured.SetNestedField(noxuInstance.Object, int64(10), "status", "num") - if err != nil { - t.Fatalf("unexpected error: %v", err) - } + // set .spec.num = 10 and .status.num = 10 + noxuInstance := NewNoxuSubresourceInstance(ns, "foo", v.Name) + err = unstructured.SetNestedField(noxuInstance.Object, int64(10), "status", "num") + if err != nil { + t.Fatalf("unexpected error: %v", err) + } - createdNoxuInstance, err := instantiateCustomResource(t, noxuInstance, noxuResourceClient, noxuDefinition) - if err != nil { - t.Fatalf("unable to create noxu instance: %v", err) - } + createdNoxuInstance, err := instantiateVersionedCustomResource(t, noxuInstance, noxuResourceClient, noxuDefinition, v.Name) + if err != nil { + t.Fatalf("unable to create noxu instance: %v", err) + } - // update the spec with .spec.num = 15, expecting no error - err = unstructured.SetNestedField(createdNoxuInstance.Object, int64(15), "spec", "num") - if err != nil { - t.Fatalf("unexpected error setting .spec.num: %v", err) - } - createdNoxuInstance, err = noxuResourceClient.UpdateStatus(createdNoxuInstance, metav1.UpdateOptions{}) - if err != nil { - t.Errorf("unexpected error: %v", err) - } + // update the spec with .spec.num = 15, expecting no error + err = unstructured.SetNestedField(createdNoxuInstance.Object, int64(15), "spec", "num") + if err != nil { + t.Fatalf("unexpected error setting .spec.num: %v", err) + } + createdNoxuInstance, err = noxuResourceClient.UpdateStatus(createdNoxuInstance, metav1.UpdateOptions{}) + if err != nil { + t.Errorf("unexpected error: %v", err) + } - // update with .status.num = 15, expecting an error - err = unstructured.SetNestedField(createdNoxuInstance.Object, int64(15), "status", "num") - if err != nil { - t.Fatalf("unexpected error setting .status.num: %v", err) - } - createdNoxuInstance, err = noxuResourceClient.UpdateStatus(createdNoxuInstance, metav1.UpdateOptions{}) - if err == nil { - t.Fatal("expected error, but got none") - } - statusError, isStatus := err.(*apierrors.StatusError) - if !isStatus || statusError == nil { - t.Fatalf("expected status error, got %T: %v", err, err) - } - if !strings.Contains(statusError.Error(), "Invalid value") { - t.Fatalf("expected 'Invalid value' in error, got: %v", err) + // update with .status.num = 15, expecting an error + err = unstructured.SetNestedField(createdNoxuInstance.Object, int64(15), "status", "num") + if err != nil { + t.Fatalf("unexpected error setting .status.num: %v", err) + } + createdNoxuInstance, err = noxuResourceClient.UpdateStatus(createdNoxuInstance, metav1.UpdateOptions{}) + if err == nil { + t.Fatal("expected error, but got none") + } + statusError, isStatus := err.(*apierrors.StatusError) + if !isStatus || statusError == nil { + t.Fatalf("expected status error, got %T: %v", err, err) + } + if !strings.Contains(statusError.Error(), "Invalid value") { + t.Fatalf("expected 'Invalid value' in error, got: %v", err) + } + noxuResourceClient.Delete("foo", &metav1.DeleteOptions{}) + } + if err := fixtures.DeleteCustomResourceDefinition(noxuDefinition, apiExtensionClient); err != nil { + t.Fatal(err) + } } } func TestSubresourcesDiscovery(t *testing.T) { + defer utilfeaturetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, apiextensionsfeatures.CustomResourceWebhookConversion, true)() tearDown, config, _, err := fixtures.StartDefaultServer(t) if err != nil { t.Fatal(err) @@ -475,140 +579,157 @@ func TestSubresourcesDiscovery(t *testing.T) { t.Fatal(err) } - noxuDefinition := NewNoxuSubresourcesCRD(apiextensionsv1beta1.NamespaceScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } + noxuDefinitions := NewNoxuSubresourcesCRDs(apiextensionsv1beta1.NamespaceScoped) + for _, noxuDefinition := range noxuDefinitions { + noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) + if err != nil { + t.Fatal(err) + } - group := "mygroup.example.com" - version := "v1beta1" + for _, v := range noxuDefinition.Spec.Versions { + group := "mygroup.example.com" + version := v.Name - resources, err := apiExtensionClient.Discovery().ServerResourcesForGroupVersion(group + "/" + version) - if err != nil { - t.Fatal(err) - } + resources, err := apiExtensionClient.Discovery().ServerResourcesForGroupVersion(group + "/" + version) + if err != nil { + t.Fatal(err) + } - if len(resources.APIResources) != 3 { - t.Fatalf("Expected exactly the resources \"noxus\", \"noxus/status\" and \"noxus/scale\" in group version %v/%v via discovery, got: %v", group, version, resources.APIResources) - } + if len(resources.APIResources) != 3 { + t.Fatalf("Expected exactly the resources \"noxus\", \"noxus/status\" and \"noxus/scale\" in group version %v/%v via discovery, got: %v", group, version, resources.APIResources) + } - // check discovery info for status - status := resources.APIResources[1] + // check discovery info for status + status := resources.APIResources[1] - if status.Name != "noxus/status" { - t.Fatalf("incorrect status via discovery: expected name: %v, got: %v", "noxus/status", status.Name) - } + if status.Name != "noxus/status" { + t.Fatalf("incorrect status via discovery: expected name: %v, got: %v", "noxus/status", status.Name) + } - if status.Namespaced != true { - t.Fatalf("incorrect status via discovery: expected namespace: %v, got: %v", true, status.Namespaced) - } + if status.Namespaced != true { + t.Fatalf("incorrect status via discovery: expected namespace: %v, got: %v", true, status.Namespaced) + } - if status.Kind != "WishIHadChosenNoxu" { - t.Fatalf("incorrect status via discovery: expected kind: %v, got: %v", "WishIHadChosenNoxu", status.Kind) - } + if status.Kind != "WishIHadChosenNoxu" { + t.Fatalf("incorrect status via discovery: expected kind: %v, got: %v", "WishIHadChosenNoxu", status.Kind) + } - expectedVerbs := []string{"get", "patch", "update"} - sort.Strings(status.Verbs) - if !reflect.DeepEqual([]string(status.Verbs), expectedVerbs) { - t.Fatalf("incorrect status via discovery: expected: %v, got: %v", expectedVerbs, status.Verbs) - } + expectedVerbs := []string{"get", "patch", "update"} + sort.Strings(status.Verbs) + if !reflect.DeepEqual([]string(status.Verbs), expectedVerbs) { + t.Fatalf("incorrect status via discovery: expected: %v, got: %v", expectedVerbs, status.Verbs) + } - // check discovery info for scale - scale := resources.APIResources[2] + // check discovery info for scale + scale := resources.APIResources[2] - if scale.Group != autoscaling.GroupName { - t.Fatalf("incorrect scale via discovery: expected group: %v, got: %v", autoscaling.GroupName, scale.Group) - } + if scale.Group != autoscaling.GroupName { + t.Fatalf("incorrect scale via discovery: expected group: %v, got: %v", autoscaling.GroupName, scale.Group) + } - if scale.Version != "v1" { - t.Fatalf("incorrect scale via discovery: expected version: %v, got %v", "v1", scale.Version) - } + if scale.Version != "v1" { + t.Fatalf("incorrect scale via discovery: expected version: %v, got %v", "v1", scale.Version) + } - if scale.Name != "noxus/scale" { - t.Fatalf("incorrect scale via discovery: expected name: %v, got: %v", "noxus/scale", scale.Name) - } + if scale.Name != "noxus/scale" { + t.Fatalf("incorrect scale via discovery: expected name: %v, got: %v", "noxus/scale", scale.Name) + } - if scale.Namespaced != true { - t.Fatalf("incorrect scale via discovery: expected namespace: %v, got: %v", true, scale.Namespaced) - } + if scale.Namespaced != true { + t.Fatalf("incorrect scale via discovery: expected namespace: %v, got: %v", true, scale.Namespaced) + } - if scale.Kind != "Scale" { - t.Fatalf("incorrect scale via discovery: expected kind: %v, got: %v", "Scale", scale.Kind) - } + if scale.Kind != "Scale" { + t.Fatalf("incorrect scale via discovery: expected kind: %v, got: %v", "Scale", scale.Kind) + } - sort.Strings(scale.Verbs) - if !reflect.DeepEqual([]string(scale.Verbs), expectedVerbs) { - t.Fatalf("incorrect scale via discovery: expected: %v, got: %v", expectedVerbs, scale.Verbs) + sort.Strings(scale.Verbs) + if !reflect.DeepEqual([]string(scale.Verbs), expectedVerbs) { + t.Fatalf("incorrect scale via discovery: expected: %v, got: %v", expectedVerbs, scale.Verbs) + } + } + if err := fixtures.DeleteCustomResourceDefinition(noxuDefinition, apiExtensionClient); err != nil { + t.Fatal(err) + } } } func TestGeneration(t *testing.T) { + defer utilfeaturetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, apiextensionsfeatures.CustomResourceWebhookConversion, true)() tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) if err != nil { t.Fatal(err) } defer tearDown() - noxuDefinition := NewNoxuSubresourcesCRD(apiextensionsv1beta1.NamespaceScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } + noxuDefinitions := NewNoxuSubresourcesCRDs(apiextensionsv1beta1.NamespaceScoped) + for _, noxuDefinition := range noxuDefinitions { + noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) + if err != nil { + t.Fatal(err) + } - ns := "not-the-default" - noxuResourceClient := newNamespacedCustomResourceClient(ns, dynamicClient, noxuDefinition) - _, err = instantiateCustomResource(t, NewNoxuSubresourceInstance(ns, "foo"), noxuResourceClient, noxuDefinition) - if err != nil { - t.Fatalf("unable to create noxu instance: %v", err) - } + ns := "not-the-default" + for _, v := range noxuDefinition.Spec.Versions { + noxuResourceClient := newNamespacedCustomResourceVersionedClient(ns, dynamicClient, noxuDefinition, v.Name) + _, err = instantiateVersionedCustomResource(t, NewNoxuSubresourceInstance(ns, "foo", v.Name), noxuResourceClient, noxuDefinition, v.Name) + if err != nil { + t.Fatalf("unable to create noxu instance: %v", err) + } - // .metadata.generation = 1 - gottenNoxuInstance, err := noxuResourceClient.Get("foo", metav1.GetOptions{}) - if err != nil { - t.Fatal(err) - } - if gottenNoxuInstance.GetGeneration() != 1 { - t.Fatalf(".metadata.generation should be 1 after creation") - } + // .metadata.generation = 1 + gottenNoxuInstance, err := noxuResourceClient.Get("foo", metav1.GetOptions{}) + if err != nil { + t.Fatal(err) + } + if gottenNoxuInstance.GetGeneration() != 1 { + t.Fatalf(".metadata.generation should be 1 after creation") + } - // .status.num = 20 - err = unstructured.SetNestedField(gottenNoxuInstance.Object, int64(20), "status", "num") - if err != nil { - t.Fatalf("unexpected error: %v", err) - } + // .status.num = 20 + err = unstructured.SetNestedField(gottenNoxuInstance.Object, int64(20), "status", "num") + if err != nil { + t.Fatalf("unexpected error: %v", err) + } - // UpdateStatus does not increment generation - updatedStatusInstance, err := noxuResourceClient.UpdateStatus(gottenNoxuInstance, metav1.UpdateOptions{}) - if err != nil { - t.Fatalf("unable to update status: %v", err) - } - if updatedStatusInstance.GetGeneration() != 1 { - t.Fatalf("updating status should not increment .metadata.generation: expected: %v, got: %v", 1, updatedStatusInstance.GetGeneration()) - } + // UpdateStatus does not increment generation + updatedStatusInstance, err := noxuResourceClient.UpdateStatus(gottenNoxuInstance, metav1.UpdateOptions{}) + if err != nil { + t.Fatalf("unable to update status: %v", err) + } + if updatedStatusInstance.GetGeneration() != 1 { + t.Fatalf("updating status should not increment .metadata.generation: expected: %v, got: %v", 1, updatedStatusInstance.GetGeneration()) + } - gottenNoxuInstance, err = noxuResourceClient.Get("foo", metav1.GetOptions{}) - if err != nil { - t.Fatal(err) - } + gottenNoxuInstance, err = noxuResourceClient.Get("foo", metav1.GetOptions{}) + if err != nil { + t.Fatal(err) + } - // .spec.num = 20 - err = unstructured.SetNestedField(gottenNoxuInstance.Object, int64(20), "spec", "num") - if err != nil { - t.Fatalf("unexpected error: %v", err) - } + // .spec.num = 20 + err = unstructured.SetNestedField(gottenNoxuInstance.Object, int64(20), "spec", "num") + if err != nil { + t.Fatalf("unexpected error: %v", err) + } - // Update increments generation - updatedInstance, err := noxuResourceClient.Update(gottenNoxuInstance, metav1.UpdateOptions{}) - if err != nil { - t.Fatalf("unable to update instance: %v", err) - } - if updatedInstance.GetGeneration() != 2 { - t.Fatalf("updating spec should increment .metadata.generation: expected: %v, got: %v", 2, updatedStatusInstance.GetGeneration()) + // Update increments generation + updatedInstance, err := noxuResourceClient.Update(gottenNoxuInstance, metav1.UpdateOptions{}) + if err != nil { + t.Fatalf("unable to update instance: %v", err) + } + if updatedInstance.GetGeneration() != 2 { + t.Fatalf("updating spec should increment .metadata.generation: expected: %v, got: %v", 2, updatedStatusInstance.GetGeneration()) + } + noxuResourceClient.Delete("foo", &metav1.DeleteOptions{}) + } + if err := fixtures.DeleteCustomResourceDefinition(noxuDefinition, apiExtensionClient); err != nil { + t.Fatal(err) + } } } func TestSubresourcePatch(t *testing.T) { + defer utilfeaturetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, apiextensionsfeatures.CustomResourceWebhookConversion, true)() groupResource := schema.GroupResource{ Group: "mygroup.example.com", Resource: "noxus", @@ -629,146 +750,155 @@ func TestSubresourcePatch(t *testing.T) { t.Fatal(err) } - noxuDefinition := NewNoxuSubresourcesCRD(apiextensionsv1beta1.NamespaceScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } + noxuDefinitions := NewNoxuSubresourcesCRDs(apiextensionsv1beta1.NamespaceScoped) + for _, noxuDefinition := range noxuDefinitions { + noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) + if err != nil { + t.Fatal(err) + } - ns := "not-the-default" - noxuResourceClient := newNamespacedCustomResourceClient(ns, dynamicClient, noxuDefinition) + ns := "not-the-default" + for _, v := range noxuDefinition.Spec.Versions { + noxuResourceClient := newNamespacedCustomResourceVersionedClient(ns, dynamicClient, noxuDefinition, v.Name) - t.Logf("Creating foo") - _, err = instantiateCustomResource(t, NewNoxuSubresourceInstance(ns, "foo"), noxuResourceClient, noxuDefinition) - if err != nil { - t.Fatalf("unable to create noxu instance: %v", err) - } + t.Logf("Creating foo") + _, err = instantiateVersionedCustomResource(t, NewNoxuSubresourceInstance(ns, "foo", v.Name), noxuResourceClient, noxuDefinition, v.Name) + if err != nil { + t.Fatalf("unable to create noxu instance: %v", err) + } - scaleClient, err := fixtures.CreateNewScaleClient(noxuDefinition, config) - if err != nil { - t.Fatal(err) - } + scaleClient, err := fixtures.CreateNewVersionedScaleClient(noxuDefinition, config, v.Name) + if err != nil { + t.Fatal(err) + } - t.Logf("Patching .status.num to 999") - patch := []byte(`{"spec": {"num":999}, "status": {"num":999}}`) - patchedNoxuInstance, err := noxuResourceClient.Patch("foo", types.MergePatchType, patch, metav1.UpdateOptions{}, "status") - if err != nil { - t.Fatalf("unexpected error: %v", err) - } + t.Logf("Patching .status.num to 999") + patch := []byte(`{"spec": {"num":999}, "status": {"num":999}}`) + patchedNoxuInstance, err := noxuResourceClient.Patch("foo", types.MergePatchType, patch, metav1.UpdateOptions{}, "status") + if err != nil { + t.Fatalf("unexpected error: %v", err) + } - expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 999, "status", "num") // .status.num should be 999 - expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 10, "spec", "num") // .spec.num should remain 10 - rv, found, err := unstructured.NestedString(patchedNoxuInstance.UnstructuredContent(), "metadata", "resourceVersion") - if err != nil { - t.Fatal(err) - } - if !found { - t.Fatalf("metadata.resourceVersion not found") - } + expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 999, "status", "num") // .status.num should be 999 + expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 10, "spec", "num") // .spec.num should remain 10 + rv, found, err := unstructured.NestedString(patchedNoxuInstance.UnstructuredContent(), "metadata", "resourceVersion") + if err != nil { + t.Fatal(err) + } + if !found { + t.Fatalf("metadata.resourceVersion not found") + } - // this call waits for the resourceVersion to be reached in the cache before returning. - // We need to do this because the patch gets its initial object from the storage, and the cache serves that. - // If it is out of date, then our initial patch is applied to an old resource version, which conflicts - // and then the updated object shows a conflicting diff, which permanently fails the patch. - // This gives expected stability in the patch without retrying on an known number of conflicts below in the test. - // See https://issue.k8s.io/42644 - _, err = noxuResourceClient.Get("foo", metav1.GetOptions{ResourceVersion: patchedNoxuInstance.GetResourceVersion()}) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } + // this call waits for the resourceVersion to be reached in the cache before returning. + // We need to do this because the patch gets its initial object from the storage, and the cache serves that. + // If it is out of date, then our initial patch is applied to an old resource version, which conflicts + // and then the updated object shows a conflicting diff, which permanently fails the patch. + // This gives expected stability in the patch without retrying on an known number of conflicts below in the test. + // See https://issue.k8s.io/42644 + _, err = noxuResourceClient.Get("foo", metav1.GetOptions{ResourceVersion: patchedNoxuInstance.GetResourceVersion()}) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } - // no-op patch - t.Logf("Patching .status.num again to 999") - patchedNoxuInstance, err = noxuResourceClient.Patch("foo", types.MergePatchType, patch, metav1.UpdateOptions{}, "status") - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - // make sure no-op patch does not increment resourceVersion - expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 999, "status", "num") - expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 10, "spec", "num") - expectString(t, patchedNoxuInstance.UnstructuredContent(), rv, "metadata", "resourceVersion") + // no-op patch + t.Logf("Patching .status.num again to 999") + patchedNoxuInstance, err = noxuResourceClient.Patch("foo", types.MergePatchType, patch, metav1.UpdateOptions{}, "status") + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + // make sure no-op patch does not increment resourceVersion + expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 999, "status", "num") + expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 10, "spec", "num") + expectString(t, patchedNoxuInstance.UnstructuredContent(), rv, "metadata", "resourceVersion") - // empty patch - t.Logf("Applying empty patch") - patchedNoxuInstance, err = noxuResourceClient.Patch("foo", types.MergePatchType, []byte(`{}`), metav1.UpdateOptions{}, "status") - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - // an empty patch is a no-op patch. make sure it does not increment resourceVersion - expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 999, "status", "num") - expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 10, "spec", "num") - expectString(t, patchedNoxuInstance.UnstructuredContent(), rv, "metadata", "resourceVersion") + // empty patch + t.Logf("Applying empty patch") + patchedNoxuInstance, err = noxuResourceClient.Patch("foo", types.MergePatchType, []byte(`{}`), metav1.UpdateOptions{}, "status") + if err != nil { + t.Fatalf("unexpected error: %v", err) + } - t.Logf("Patching .spec.replicas to 7") - patch = []byte(`{"spec": {"replicas":7}, "status": {"replicas":7}}`) - patchedNoxuInstance, err = noxuResourceClient.Patch("foo", types.MergePatchType, patch, metav1.UpdateOptions{}, "scale") - if err != nil { - t.Fatalf("unexpected error: %v", err) - } + // an empty patch is a no-op patch. make sure it does not increment resourceVersion + expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 999, "status", "num") + expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 10, "spec", "num") + expectString(t, patchedNoxuInstance.UnstructuredContent(), rv, "metadata", "resourceVersion") - expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 7, "spec", "replicas") - expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 0, "status", "replicas") // .status.replicas should remain 0 - rv, found, err = unstructured.NestedString(patchedNoxuInstance.UnstructuredContent(), "metadata", "resourceVersion") - if err != nil { - t.Fatal(err) - } - if !found { - t.Fatalf("metadata.resourceVersion not found") - } + t.Logf("Patching .spec.replicas to 7") + patch = []byte(`{"spec": {"replicas":7}, "status": {"replicas":7}}`) + patchedNoxuInstance, err = noxuResourceClient.Patch("foo", types.MergePatchType, patch, metav1.UpdateOptions{}, "scale") + if err != nil { + t.Fatalf("unexpected error: %v", err) + } - // this call waits for the resourceVersion to be reached in the cache before returning. - // We need to do this because the patch gets its initial object from the storage, and the cache serves that. - // If it is out of date, then our initial patch is applied to an old resource version, which conflicts - // and then the updated object shows a conflicting diff, which permanently fails the patch. - // This gives expected stability in the patch without retrying on an known number of conflicts below in the test. - // See https://issue.k8s.io/42644 - _, err = noxuResourceClient.Get("foo", metav1.GetOptions{ResourceVersion: patchedNoxuInstance.GetResourceVersion()}) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } + expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 7, "spec", "replicas") + expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 0, "status", "replicas") // .status.replicas should remain 0 + rv, found, err = unstructured.NestedString(patchedNoxuInstance.UnstructuredContent(), "metadata", "resourceVersion") + if err != nil { + t.Fatal(err) + } + if !found { + t.Fatalf("metadata.resourceVersion not found") + } - // Scale.Spec.Replicas = 7 but Scale.Status.Replicas should remain 0 - gottenScale, err := scaleClient.Scales("not-the-default").Get(groupResource, "foo") - if err != nil { - t.Fatal(err) - } - if gottenScale.Spec.Replicas != 7 { - t.Fatalf("Scale.Spec.Replicas: expected: %v, got: %v", 7, gottenScale.Spec.Replicas) - } - if gottenScale.Status.Replicas != 0 { - t.Fatalf("Scale.Status.Replicas: expected: %v, got: %v", 0, gottenScale.Spec.Replicas) - } + // this call waits for the resourceVersion to be reached in the cache before returning. + // We need to do this because the patch gets its initial object from the storage, and the cache serves that. + // If it is out of date, then our initial patch is applied to an old resource version, which conflicts + // and then the updated object shows a conflicting diff, which permanently fails the patch. + // This gives expected stability in the patch without retrying on an known number of conflicts below in the test. + // See https://issue.k8s.io/42644 + _, err = noxuResourceClient.Get("foo", metav1.GetOptions{ResourceVersion: patchedNoxuInstance.GetResourceVersion()}) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } - // no-op patch - t.Logf("Patching .spec.replicas again to 7") - patchedNoxuInstance, err = noxuResourceClient.Patch("foo", types.MergePatchType, patch, metav1.UpdateOptions{}, "scale") - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - // make sure no-op patch does not increment resourceVersion - expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 7, "spec", "replicas") - expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 0, "status", "replicas") - expectString(t, patchedNoxuInstance.UnstructuredContent(), rv, "metadata", "resourceVersion") + // Scale.Spec.Replicas = 7 but Scale.Status.Replicas should remain 0 + gottenScale, err := scaleClient.Scales("not-the-default").Get(groupResource, "foo") + if err != nil { + t.Fatal(err) + } + if gottenScale.Spec.Replicas != 7 { + t.Fatalf("Scale.Spec.Replicas: expected: %v, got: %v", 7, gottenScale.Spec.Replicas) + } + if gottenScale.Status.Replicas != 0 { + t.Fatalf("Scale.Status.Replicas: expected: %v, got: %v", 0, gottenScale.Spec.Replicas) + } - // empty patch - t.Logf("Applying empty patch") - patchedNoxuInstance, err = noxuResourceClient.Patch("foo", types.MergePatchType, []byte(`{}`), metav1.UpdateOptions{}, "scale") - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - // an empty patch is a no-op patch. make sure it does not increment resourceVersion - expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 7, "spec", "replicas") - expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 0, "status", "replicas") - expectString(t, patchedNoxuInstance.UnstructuredContent(), rv, "metadata", "resourceVersion") + // no-op patch + t.Logf("Patching .spec.replicas again to 7") + patchedNoxuInstance, err = noxuResourceClient.Patch("foo", types.MergePatchType, patch, metav1.UpdateOptions{}, "scale") + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + // make sure no-op patch does not increment resourceVersion + expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 7, "spec", "replicas") + expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 0, "status", "replicas") + expectString(t, patchedNoxuInstance.UnstructuredContent(), rv, "metadata", "resourceVersion") - // make sure strategic merge patch is not supported for both status and scale - _, err = noxuResourceClient.Patch("foo", types.StrategicMergePatchType, patch, metav1.UpdateOptions{}, "status") - if err == nil { - t.Fatalf("unexpected non-error: strategic merge patch is not supported for custom resources") - } + // empty patch + t.Logf("Applying empty patch") + patchedNoxuInstance, err = noxuResourceClient.Patch("foo", types.MergePatchType, []byte(`{}`), metav1.UpdateOptions{}, "scale") + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + // an empty patch is a no-op patch. make sure it does not increment resourceVersion + expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 7, "spec", "replicas") + expectInt64(t, patchedNoxuInstance.UnstructuredContent(), 0, "status", "replicas") + expectString(t, patchedNoxuInstance.UnstructuredContent(), rv, "metadata", "resourceVersion") - _, err = noxuResourceClient.Patch("foo", types.StrategicMergePatchType, patch, metav1.UpdateOptions{}, "scale") - if err == nil { - t.Fatalf("unexpected non-error: strategic merge patch is not supported for custom resources") + // make sure strategic merge patch is not supported for both status and scale + _, err = noxuResourceClient.Patch("foo", types.StrategicMergePatchType, patch, metav1.UpdateOptions{}, "status") + if err == nil { + t.Fatalf("unexpected non-error: strategic merge patch is not supported for custom resources") + } + + _, err = noxuResourceClient.Patch("foo", types.StrategicMergePatchType, patch, metav1.UpdateOptions{}, "scale") + if err == nil { + t.Fatalf("unexpected non-error: strategic merge patch is not supported for custom resources") + } + noxuResourceClient.Delete("foo", &metav1.DeleteOptions{}) + } + if err := fixtures.DeleteCustomResourceDefinition(noxuDefinition, apiExtensionClient); err != nil { + t.Fatal(err) + } } } diff --git a/vendor/k8s.io/apiextensions-apiserver/test/integration/table_test.go b/vendor/k8s.io/apiextensions-apiserver/test/integration/table_test.go index 7aab4f40..a10a72ec 100644 --- a/vendor/k8s.io/apiextensions-apiserver/test/integration/table_test.go +++ b/vendor/k8s.io/apiextensions-apiserver/test/integration/table_test.go @@ -28,10 +28,14 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/serializer" + "k8s.io/apimachinery/pkg/types" + utilfeature "k8s.io/apiserver/pkg/util/feature" + utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" "k8s.io/client-go/dynamic" "k8s.io/client-go/rest" apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + apiextensionsfeatures "k8s.io/apiextensions-apiserver/pkg/features" "k8s.io/apiextensions-apiserver/test/integration/fixtures" ) @@ -48,12 +52,32 @@ func newTableCRD() *apiextensionsv1beta1.CustomResourceDefinition { ListKind: "TablemList", }, Scope: apiextensionsv1beta1.ClusterScoped, - AdditionalPrinterColumns: []apiextensionsv1beta1.CustomResourceColumnDefinition{ - {Name: "Age", Type: "date", JSONPath: ".metadata.creationTimestamp"}, - {Name: "Alpha", Type: "string", JSONPath: ".spec.alpha"}, - {Name: "Beta", Type: "integer", Description: "the beta field", Format: "int64", Priority: 42, JSONPath: ".spec.beta"}, - {Name: "Gamma", Type: "integer", Description: "a column with wrongly typed values", JSONPath: ".spec.gamma"}, - {Name: "Epsilon", Type: "string", Description: "an array of integers as string", JSONPath: ".spec.epsilon"}, + Versions: []apiextensionsv1beta1.CustomResourceDefinitionVersion{ + { + Name: "v1beta1", + Served: true, + Storage: false, + AdditionalPrinterColumns: []apiextensionsv1beta1.CustomResourceColumnDefinition{ + {Name: "Age", Type: "date", JSONPath: ".metadata.creationTimestamp"}, + {Name: "Alpha", Type: "string", JSONPath: ".spec.alpha"}, + {Name: "Beta", Type: "integer", Description: "the beta field", Format: "int64", Priority: 42, JSONPath: ".spec.beta"}, + {Name: "Gamma", Type: "integer", Description: "a column with wrongly typed values", JSONPath: ".spec.gamma"}, + {Name: "Epsilon", Type: "string", Description: "an array of integers as string", JSONPath: ".spec.epsilon"}, + }, + }, + { + Name: "v1", + Served: true, + Storage: true, + AdditionalPrinterColumns: []apiextensionsv1beta1.CustomResourceColumnDefinition{ + {Name: "Age", Type: "date", JSONPath: ".metadata.creationTimestamp"}, + {Name: "Alpha", Type: "string", JSONPath: ".spec.alpha"}, + {Name: "Beta", Type: "integer", Description: "the beta field", Format: "int64", Priority: 42, JSONPath: ".spec.beta"}, + {Name: "Gamma", Type: "integer", Description: "a column with wrongly typed values", JSONPath: ".spec.gamma"}, + {Name: "Epsilon", Type: "string", Description: "an array of integers as string", JSONPath: ".spec.epsilon"}, + {Name: "Zeta", Type: "integer", Description: "the zeta field", Format: "int64", Priority: 42, JSONPath: ".spec.zeta"}, + }, + }, }, }, } @@ -62,7 +86,7 @@ func newTableCRD() *apiextensionsv1beta1.CustomResourceDefinition { func newTableInstance(name string) *unstructured.Unstructured { return &unstructured.Unstructured{ Object: map[string]interface{}{ - "apiVersion": "mygroup.example.com/v1beta1", + "apiVersion": "mygroup.example.com/v1", "kind": "Table", "metadata": map[string]interface{}{ "name": name, @@ -73,12 +97,14 @@ func newTableInstance(name string) *unstructured.Unstructured { "gamma": "bar", "delta": "hello", "epsilon": []int64{1, 2, 3}, + "zeta": 5, }, }, } } func TestTableGet(t *testing.T) { + defer utilfeaturetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, apiextensionsfeatures.CustomResourceWebhookConversion, true)() tearDown, config, _, err := fixtures.StartDefaultServer(t) if err != nil { t.Fatal(err) @@ -107,107 +133,219 @@ func TestTableGet(t *testing.T) { } t.Logf("table crd created: %#v", crd) - crClient := newNamespacedCustomResourceClient("", dynamicClient, crd) + crClient := newNamespacedCustomResourceVersionedClient("", dynamicClient, crd, "v1") foo, err := crClient.Create(newTableInstance("foo"), metav1.CreateOptions{}) if err != nil { t.Fatalf("unable to create noxu instance: %v", err) } t.Logf("foo created: %#v", foo.UnstructuredContent()) - gv := schema.GroupVersion{Group: crd.Spec.Group, Version: crd.Spec.Version} - gvk := gv.WithKind(crd.Spec.Names.Kind) + for i, v := range crd.Spec.Versions { + gv := schema.GroupVersion{Group: crd.Spec.Group, Version: v.Name} + gvk := gv.WithKind(crd.Spec.Names.Kind) - scheme := runtime.NewScheme() - codecs := serializer.NewCodecFactory(scheme) - parameterCodec := runtime.NewParameterCodec(scheme) - metav1.AddToGroupVersion(scheme, gv) - scheme.AddKnownTypes(gv, &metav1beta1.Table{}, &metav1beta1.TableOptions{}) - scheme.AddKnownTypes(metav1beta1.SchemeGroupVersion, &metav1beta1.Table{}, &metav1beta1.TableOptions{}) + scheme := runtime.NewScheme() + codecs := serializer.NewCodecFactory(scheme) + parameterCodec := runtime.NewParameterCodec(scheme) + metav1.AddToGroupVersion(scheme, gv) + scheme.AddKnownTypes(gv, &metav1beta1.Table{}, &metav1beta1.TableOptions{}) + scheme.AddKnownTypes(metav1beta1.SchemeGroupVersion, &metav1beta1.Table{}, &metav1beta1.TableOptions{}) - crConfig := *config - crConfig.GroupVersion = &gv - crConfig.APIPath = "/apis" - crConfig.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: codecs} - crRestClient, err := rest.RESTClientFor(&crConfig) + crConfig := *config + crConfig.GroupVersion = &gv + crConfig.APIPath = "/apis" + crConfig.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: codecs} + crRestClient, err := rest.RESTClientFor(&crConfig) + if err != nil { + t.Fatal(err) + } + + ret, err := crRestClient.Get(). + Resource(crd.Spec.Names.Plural). + SetHeader("Accept", fmt.Sprintf("application/json;as=Table;v=%s;g=%s, application/json", metav1beta1.SchemeGroupVersion.Version, metav1beta1.GroupName)). + VersionedParams(&metav1beta1.TableOptions{}, parameterCodec). + Do(). + Get() + if err != nil { + t.Fatalf("failed to list %v resources: %v", gvk, err) + } + + tbl, ok := ret.(*metav1beta1.Table) + if !ok { + t.Fatalf("expected metav1beta1.Table, got %T", ret) + } + t.Logf("%v table list: %#v", gvk, tbl) + + columns, err := getColumnsForVersion(crd, v.Name) + if err != nil { + t.Fatal(err) + } + expectColumnNum := len(columns) + 1 + if got, expected := len(tbl.ColumnDefinitions), expectColumnNum; got != expected { + t.Errorf("expected %d headers, got %d", expected, got) + } else { + age := metav1beta1.TableColumnDefinition{Name: "Age", Type: "date", Format: "", Description: "Custom resource definition column (in JSONPath format): .metadata.creationTimestamp", Priority: 0} + if got, expected := tbl.ColumnDefinitions[1], age; got != expected { + t.Errorf("expected column definition %#v, got %#v", expected, got) + } + + alpha := metav1beta1.TableColumnDefinition{Name: "Alpha", Type: "string", Format: "", Description: "Custom resource definition column (in JSONPath format): .spec.alpha", Priority: 0} + if got, expected := tbl.ColumnDefinitions[2], alpha; got != expected { + t.Errorf("expected column definition %#v, got %#v", expected, got) + } + + beta := metav1beta1.TableColumnDefinition{Name: "Beta", Type: "integer", Format: "int64", Description: "the beta field", Priority: 42} + if got, expected := tbl.ColumnDefinitions[3], beta; got != expected { + t.Errorf("expected column definition %#v, got %#v", expected, got) + } + + gamma := metav1beta1.TableColumnDefinition{Name: "Gamma", Type: "integer", Description: "a column with wrongly typed values"} + if got, expected := tbl.ColumnDefinitions[4], gamma; got != expected { + t.Errorf("expected column definition %#v, got %#v", expected, got) + } + + epsilon := metav1beta1.TableColumnDefinition{Name: "Epsilon", Type: "string", Description: "an array of integers as string"} + if got, expected := tbl.ColumnDefinitions[5], epsilon; got != expected { + t.Errorf("expected column definition %#v, got %#v", expected, got) + } + + // Validate extra column for v1 + if i == 1 { + zeta := metav1beta1.TableColumnDefinition{Name: "Zeta", Type: "integer", Format: "int64", Description: "the zeta field", Priority: 42} + if got, expected := tbl.ColumnDefinitions[6], zeta; got != expected { + t.Errorf("expected column definition %#v, got %#v", expected, got) + } + } + } + if got, expected := len(tbl.Rows), 1; got != expected { + t.Errorf("expected %d rows, got %d", expected, got) + } else if got, expected := len(tbl.Rows[0].Cells), expectColumnNum; got != expected { + t.Errorf("expected %d cells, got %d", expected, got) + } else { + if got, expected := tbl.Rows[0].Cells[0], "foo"; got != expected { + t.Errorf("expected cell[0] to equal %q, got %q", expected, got) + } + if s, ok := tbl.Rows[0].Cells[1].(string); !ok { + t.Errorf("expected cell[1] to be a string, got: %#v", tbl.Rows[0].Cells[1]) + } else { + dur, err := time.ParseDuration(s) + if err != nil { + t.Errorf("expected cell[1] to be a duration: %v", err) + } else if abs(dur.Seconds()) > 30.0 { + t.Errorf("expected cell[1] to be a small age, but got: %v", dur) + } + } + if got, expected := tbl.Rows[0].Cells[2], "foo_123"; got != expected { + t.Errorf("expected cell[2] to equal %q, got %q", expected, got) + } + if got, expected := tbl.Rows[0].Cells[3], int64(10); got != expected { + t.Errorf("expected cell[3] to equal %#v, got %#v", expected, got) + } + if got, expected := tbl.Rows[0].Cells[4], interface{}(nil); got != expected { + t.Errorf("expected cell[4] to equal %#v although the type does not match the column, got %#v", expected, got) + } + if got, expected := tbl.Rows[0].Cells[5], "[1 2 3]"; got != expected { + t.Errorf("expected cell[5] to equal %q, got %q", expected, got) + } + // Validate extra column for v1 + if i == 1 { + if got, expected := tbl.Rows[0].Cells[6], int64(5); got != expected { + t.Errorf("expected cell[6] to equal %q, got %q", expected, got) + } + } + } + } +} + +// TestColumnsPatch tests the case that a CRD was created with no top-level or +// per-version columns. One should be able to PATCH the CRD setting per-version columns. +func TestColumnsPatch(t *testing.T) { + defer utilfeaturetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, apiextensionsfeatures.CustomResourceWebhookConversion, true)() + tearDown, config, _, err := fixtures.StartDefaultServer(t) + if err != nil { + t.Fatal(err) + } + defer tearDown() + + apiExtensionClient, err := clientset.NewForConfig(config) if err != nil { t.Fatal(err) } - ret, err := crRestClient.Get(). - Resource(crd.Spec.Names.Plural). - SetHeader("Accept", fmt.Sprintf("application/json;as=Table;v=%s;g=%s, application/json", metav1beta1.SchemeGroupVersion.Version, metav1beta1.GroupName)). - VersionedParams(&metav1beta1.TableOptions{}, parameterCodec). - Do(). - Get() + dynamicClient, err := dynamic.NewForConfig(config) if err != nil { - t.Fatalf("failed to list %v resources: %v", gvk, err) + t.Fatal(err) } - tbl, ok := ret.(*metav1beta1.Table) - if !ok { - t.Fatalf("expected metav1beta1.Table, got %T", ret) + // CRD with no top-level and per-version columns should be created successfully + crd := NewNoxuSubresourcesCRDs(apiextensionsv1beta1.NamespaceScoped)[0] + crd, err = fixtures.CreateNewCustomResourceDefinition(crd, apiExtensionClient, dynamicClient) + if err != nil { + t.Fatal(err) } - t.Logf("%v table list: %#v", gvk, tbl) - if got, expected := len(tbl.ColumnDefinitions), 6; got != expected { - t.Errorf("expected %d headers, got %d", expected, got) - } else { - age := metav1beta1.TableColumnDefinition{Name: "Age", Type: "date", Format: "", Description: "Custom resource definition column (in JSONPath format): .metadata.creationTimestamp", Priority: 0} - if got, expected := tbl.ColumnDefinitions[1], age; got != expected { - t.Errorf("expected column definition %#v, got %#v", expected, got) - } + // One should be able to patch the CRD to use per-version columns. The top-level columns + // should not be defaulted during creation, and apiserver should not return validation + // error about top-level and per-version columns being mutual exclusive. + patch := []byte(`{"spec":{"versions":[{"name":"v1beta1","served":true,"storage":true,"additionalPrinterColumns":[{"name":"Age","type":"date","JSONPath":".metadata.creationTimestamp"}]},{"name":"v1","served":true,"storage":false,"additionalPrinterColumns":[{"name":"Age2","type":"date","JSONPath":".metadata.creationTimestamp"}]}]}}`) - alpha := metav1beta1.TableColumnDefinition{Name: "Alpha", Type: "string", Format: "", Description: "Custom resource definition column (in JSONPath format): .spec.alpha", Priority: 0} - if got, expected := tbl.ColumnDefinitions[2], alpha; got != expected { - t.Errorf("expected column definition %#v, got %#v", expected, got) - } - - beta := metav1beta1.TableColumnDefinition{Name: "Beta", Type: "integer", Format: "int64", Description: "the beta field", Priority: 42} - if got, expected := tbl.ColumnDefinitions[3], beta; got != expected { - t.Errorf("expected column definition %#v, got %#v", expected, got) - } - - gamma := metav1beta1.TableColumnDefinition{Name: "Gamma", Type: "integer", Description: "a column with wrongly typed values"} - if got, expected := tbl.ColumnDefinitions[4], gamma; got != expected { - t.Errorf("expected column definition %#v, got %#v", expected, got) - } - - epsilon := metav1beta1.TableColumnDefinition{Name: "Epsilon", Type: "string", Description: "an array of integers as string"} - if got, expected := tbl.ColumnDefinitions[5], epsilon; got != expected { - t.Errorf("expected column definition %#v, got %#v", expected, got) - } + _, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Patch(crd.Name, types.MergePatchType, patch) + if err != nil { + t.Fatal(err) } - if got, expected := len(tbl.Rows), 1; got != expected { - t.Errorf("expected %d rows, got %d", expected, got) - } else if got, expected := len(tbl.Rows[0].Cells), 6; got != expected { - t.Errorf("expected %d cells, got %d", expected, got) - } else { - if got, expected := tbl.Rows[0].Cells[0], "foo"; got != expected { - t.Errorf("expected cell[0] to equal %q, got %q", expected, got) - } - if s, ok := tbl.Rows[0].Cells[1].(string); !ok { - t.Errorf("expected cell[1] to be a string, got: %#v", tbl.Rows[0].Cells[1]) - } else { - dur, err := time.ParseDuration(s) - if err != nil { - t.Errorf("expected cell[1] to be a duration: %v", err) - } else if abs(dur.Seconds()) > 30.0 { - t.Errorf("expected cell[1] to be a small age, but got: %v", dur) - } - } - if got, expected := tbl.Rows[0].Cells[2], "foo_123"; got != expected { - t.Errorf("expected cell[2] to equal %q, got %q", expected, got) - } - if got, expected := tbl.Rows[0].Cells[3], int64(10); got != expected { - t.Errorf("expected cell[3] to equal %#v, got %#v", expected, got) - } - if got, expected := tbl.Rows[0].Cells[4], interface{}(nil); got != expected { - t.Errorf("expected cell[4] to equal %#v although the type does not match the column, got %#v", expected, got) - } - if got, expected := tbl.Rows[0].Cells[5], "[1 2 3]"; got != expected { - t.Errorf("expected cell[5] to equal %q, got %q", expected, got) - } + + crd, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(crd.Name, metav1.GetOptions{}) + if err != nil { + t.Fatal(err) } + t.Logf("columns crd patched: %#v", crd) +} + +// TestPatchCleanTopLevelColumns tests the case that a CRD was created with top-level columns. +// One should be able to PATCH the CRD cleaning the top-level columns and setting per-version +// columns. +func TestPatchCleanTopLevelColumns(t *testing.T) { + defer utilfeaturetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, apiextensionsfeatures.CustomResourceWebhookConversion, true)() + tearDown, config, _, err := fixtures.StartDefaultServer(t) + if err != nil { + t.Fatal(err) + } + defer tearDown() + + apiExtensionClient, err := clientset.NewForConfig(config) + if err != nil { + t.Fatal(err) + } + + dynamicClient, err := dynamic.NewForConfig(config) + if err != nil { + t.Fatal(err) + } + + crd := NewNoxuSubresourcesCRDs(apiextensionsv1beta1.NamespaceScoped)[0] + crd.Spec.AdditionalPrinterColumns = []apiextensionsv1beta1.CustomResourceColumnDefinition{ + {Name: "Age", Type: "date", Description: swaggerMetadataDescriptions["creationTimestamp"], JSONPath: ".metadata.creationTimestamp"}, + } + crd, err = fixtures.CreateNewCustomResourceDefinition(crd, apiExtensionClient, dynamicClient) + if err != nil { + t.Fatal(err) + } + t.Logf("columns crd created: %#v", crd) + + // One should be able to patch the CRD to use per-version columns by cleaning + // the top-level columns. + patch := []byte(`{"spec":{"additionalPrinterColumns":null,"versions":[{"name":"v1beta1","served":true,"storage":true,"additionalPrinterColumns":[{"name":"Age","type":"date","JSONPath":".metadata.creationTimestamp"}]},{"name":"v1","served":true,"storage":false,"additionalPrinterColumns":[{"name":"Age2","type":"date","JSONPath":".metadata.creationTimestamp"}]}]}}`) + + _, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Patch(crd.Name, types.MergePatchType, patch) + if err != nil { + t.Fatal(err) + } + + crd, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(crd.Name, metav1.GetOptions{}) + if err != nil { + t.Fatal(err) + } + t.Logf("columns crd patched: %#v", crd) } func abs(x float64) float64 { diff --git a/vendor/k8s.io/apiextensions-apiserver/test/integration/validation_test.go b/vendor/k8s.io/apiextensions-apiserver/test/integration/validation_test.go index 37f9d094..997183c5 100644 --- a/vendor/k8s.io/apiextensions-apiserver/test/integration/validation_test.go +++ b/vendor/k8s.io/apiextensions-apiserver/test/integration/validation_test.go @@ -17,6 +17,7 @@ limitations under the License. package integration import ( + "fmt" "strings" "testing" "time" @@ -25,8 +26,11 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/util/wait" + utilfeature "k8s.io/apiserver/pkg/util/feature" + utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + apiextensionsfeatures "k8s.io/apiextensions-apiserver/pkg/features" "k8s.io/apiextensions-apiserver/test/integration/fixtures" ) @@ -84,64 +88,114 @@ func TestForProperValidationErrors(t *testing.T) { } } -func newNoxuValidationCRD(scope apiextensionsv1beta1.ResourceScope) *apiextensionsv1beta1.CustomResourceDefinition { - return &apiextensionsv1beta1.CustomResourceDefinition{ - ObjectMeta: metav1.ObjectMeta{Name: "noxus.mygroup.example.com"}, - Spec: apiextensionsv1beta1.CustomResourceDefinitionSpec{ - Group: "mygroup.example.com", - Version: "v1beta1", - Names: apiextensionsv1beta1.CustomResourceDefinitionNames{ - Plural: "noxus", - Singular: "nonenglishnoxu", - Kind: "WishIHadChosenNoxu", - ShortNames: []string{"foo", "bar", "abc", "def"}, - ListKind: "NoxuItemList", +func newNoxuValidationCRDs(scope apiextensionsv1beta1.ResourceScope) []*apiextensionsv1beta1.CustomResourceDefinition { + validationSchema := &apiextensionsv1beta1.JSONSchemaProps{ + Required: []string{"alpha", "beta"}, + AdditionalProperties: &apiextensionsv1beta1.JSONSchemaPropsOrBool{ + Allows: true, + }, + Properties: map[string]apiextensionsv1beta1.JSONSchemaProps{ + "alpha": { + Description: "Alpha is an alphanumeric string with underscores", + Type: "string", + Pattern: "^[a-zA-Z0-9_]*$", }, - Scope: apiextensionsv1beta1.NamespaceScoped, - Validation: &apiextensionsv1beta1.CustomResourceValidation{ - OpenAPIV3Schema: &apiextensionsv1beta1.JSONSchemaProps{ - Required: []string{"alpha", "beta"}, - AdditionalProperties: &apiextensionsv1beta1.JSONSchemaPropsOrBool{ - Allows: true, + "beta": { + Description: "Minimum value of beta is 10", + Type: "number", + Minimum: float64Ptr(10), + }, + "gamma": { + Description: "Gamma is restricted to foo, bar and baz", + Type: "string", + Enum: []apiextensionsv1beta1.JSON{ + { + Raw: []byte(`"foo"`), }, - Properties: map[string]apiextensionsv1beta1.JSONSchemaProps{ - "alpha": { - Description: "Alpha is an alphanumeric string with underscores", - Type: "string", - Pattern: "^[a-zA-Z0-9_]*$", + { + Raw: []byte(`"bar"`), + }, + { + Raw: []byte(`"baz"`), + }, + }, + }, + "delta": { + Description: "Delta is a string with a maximum length of 5 or a number with a minimum value of 0", + AnyOf: []apiextensionsv1beta1.JSONSchemaProps{ + { + Type: "string", + MaxLength: int64Ptr(5), + }, + { + Type: "number", + Minimum: float64Ptr(0), + }, + }, + }, + }, + } + validationSchemaWithDescription := validationSchema.DeepCopy() + validationSchemaWithDescription.Description = "test" + return []*apiextensionsv1beta1.CustomResourceDefinition{ + { + ObjectMeta: metav1.ObjectMeta{Name: "noxus.mygroup.example.com"}, + Spec: apiextensionsv1beta1.CustomResourceDefinitionSpec{ + Group: "mygroup.example.com", + Version: "v1beta1", + Names: apiextensionsv1beta1.CustomResourceDefinitionNames{ + Plural: "noxus", + Singular: "nonenglishnoxu", + Kind: "WishIHadChosenNoxu", + ShortNames: []string{"foo", "bar", "abc", "def"}, + ListKind: "NoxuItemList", + }, + Scope: apiextensionsv1beta1.NamespaceScoped, + Validation: &apiextensionsv1beta1.CustomResourceValidation{ + OpenAPIV3Schema: validationSchema, + }, + Versions: []apiextensionsv1beta1.CustomResourceDefinitionVersion{ + { + Name: "v1beta1", + Served: true, + Storage: true, + }, + { + Name: "v1", + Served: true, + Storage: false, + }, + }, + }, + }, + { + ObjectMeta: metav1.ObjectMeta{Name: "noxus.mygroup.example.com"}, + Spec: apiextensionsv1beta1.CustomResourceDefinitionSpec{ + Group: "mygroup.example.com", + Version: "v1beta1", + Names: apiextensionsv1beta1.CustomResourceDefinitionNames{ + Plural: "noxus", + Singular: "nonenglishnoxu", + Kind: "WishIHadChosenNoxu", + ShortNames: []string{"foo", "bar", "abc", "def"}, + ListKind: "NoxuItemList", + }, + Scope: apiextensionsv1beta1.NamespaceScoped, + Versions: []apiextensionsv1beta1.CustomResourceDefinitionVersion{ + { + Name: "v1beta1", + Served: true, + Storage: true, + Schema: &apiextensionsv1beta1.CustomResourceValidation{ + OpenAPIV3Schema: validationSchema, }, - "beta": { - Description: "Minimum value of beta is 10", - Type: "number", - Minimum: float64Ptr(10), - }, - "gamma": { - Description: "Gamma is restricted to foo, bar and baz", - Type: "string", - Enum: []apiextensionsv1beta1.JSON{ - { - Raw: []byte(`"foo"`), - }, - { - Raw: []byte(`"bar"`), - }, - { - Raw: []byte(`"baz"`), - }, - }, - }, - "delta": { - Description: "Delta is a string with a maximum length of 5 or a number with a minimum value of 0", - AnyOf: []apiextensionsv1beta1.JSONSchemaProps{ - { - Type: "string", - MaxLength: int64Ptr(5), - }, - { - Type: "number", - Minimum: float64Ptr(0), - }, - }, + }, + { + Name: "v1", + Served: true, + Storage: false, + Schema: &apiextensionsv1beta1.CustomResourceValidation{ + OpenAPIV3Schema: validationSchemaWithDescription, }, }, }, @@ -168,253 +222,320 @@ func newNoxuValidationInstance(namespace, name string) *unstructured.Unstructure } func TestCustomResourceValidation(t *testing.T) { + defer utilfeaturetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, apiextensionsfeatures.CustomResourceWebhookConversion, true)() tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) if err != nil { t.Fatal(err) } defer tearDown() - noxuDefinition := newNoxuValidationCRD(apiextensionsv1beta1.NamespaceScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } + noxuDefinitions := newNoxuValidationCRDs(apiextensionsv1beta1.NamespaceScoped) + for _, noxuDefinition := range noxuDefinitions { + noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) + if err != nil { + t.Fatal(err) + } - ns := "not-the-default" - noxuResourceClient := newNamespacedCustomResourceClient(ns, dynamicClient, noxuDefinition) - _, err = instantiateCustomResource(t, newNoxuValidationInstance(ns, "foo"), noxuResourceClient, noxuDefinition) - if err != nil { - t.Fatalf("unable to create noxu instance: %v", err) + ns := "not-the-default" + for _, v := range noxuDefinition.Spec.Versions { + noxuResourceClient := newNamespacedCustomResourceVersionedClient(ns, dynamicClient, noxuDefinition, v.Name) + instanceToCreate := newNoxuValidationInstance(ns, "foo") + instanceToCreate.Object["apiVersion"] = fmt.Sprintf("%s/%s", noxuDefinition.Spec.Group, v.Name) + _, err = instantiateVersionedCustomResource(t, instanceToCreate, noxuResourceClient, noxuDefinition, v.Name) + if err != nil { + t.Fatalf("unable to create noxu instance: %v", err) + } + noxuResourceClient.Delete("foo", &metav1.DeleteOptions{}) + } + if err := fixtures.DeleteCustomResourceDefinition(noxuDefinition, apiExtensionClient); err != nil { + t.Fatal(err) + } } } func TestCustomResourceUpdateValidation(t *testing.T) { + defer utilfeaturetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, apiextensionsfeatures.CustomResourceWebhookConversion, true)() tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) if err != nil { t.Fatal(err) } defer tearDown() - noxuDefinition := newNoxuValidationCRD(apiextensionsv1beta1.NamespaceScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } + noxuDefinitions := newNoxuValidationCRDs(apiextensionsv1beta1.NamespaceScoped) + for _, noxuDefinition := range noxuDefinitions { + noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) + if err != nil { + t.Fatal(err) + } - ns := "not-the-default" - noxuResourceClient := newNamespacedCustomResourceClient(ns, dynamicClient, noxuDefinition) - _, err = instantiateCustomResource(t, newNoxuValidationInstance(ns, "foo"), noxuResourceClient, noxuDefinition) - if err != nil { - t.Fatalf("unable to create noxu instance: %v", err) - } + ns := "not-the-default" + for _, v := range noxuDefinition.Spec.Versions { + noxuResourceClient := newNamespacedCustomResourceVersionedClient(ns, dynamicClient, noxuDefinition, v.Name) + instanceToCreate := newNoxuValidationInstance(ns, "foo") + instanceToCreate.Object["apiVersion"] = fmt.Sprintf("%s/%s", noxuDefinition.Spec.Group, v.Name) + _, err = instantiateVersionedCustomResource(t, instanceToCreate, noxuResourceClient, noxuDefinition, v.Name) + if err != nil { + t.Fatalf("unable to create noxu instance: %v", err) + } - gottenNoxuInstance, err := noxuResourceClient.Get("foo", metav1.GetOptions{}) - if err != nil { - t.Fatal(err) - } + gottenNoxuInstance, err := noxuResourceClient.Get("foo", metav1.GetOptions{}) + if err != nil { + t.Fatal(err) + } - // invalidate the instance - gottenNoxuInstance.Object = map[string]interface{}{ - "apiVersion": "mygroup.example.com/v1beta1", - "kind": "WishIHadChosenNoxu", - "metadata": map[string]interface{}{ - "namespace": "not-the-default", - "name": "foo", - }, - "gamma": "bar", - "delta": "hello", - } + // invalidate the instance + gottenNoxuInstance.Object = map[string]interface{}{ + "apiVersion": "mygroup.example.com/v1beta1", + "kind": "WishIHadChosenNoxu", + "metadata": map[string]interface{}{ + "namespace": "not-the-default", + "name": "foo", + }, + "gamma": "bar", + "delta": "hello", + } - _, err = noxuResourceClient.Update(gottenNoxuInstance, metav1.UpdateOptions{}) - if err == nil { - t.Fatalf("unexpected non-error: alpha and beta should be present while updating %v", gottenNoxuInstance) + _, err = noxuResourceClient.Update(gottenNoxuInstance, metav1.UpdateOptions{}) + if err == nil { + t.Fatalf("unexpected non-error: alpha and beta should be present while updating %v", gottenNoxuInstance) + } + noxuResourceClient.Delete("foo", &metav1.DeleteOptions{}) + } + if err := fixtures.DeleteCustomResourceDefinition(noxuDefinition, apiExtensionClient); err != nil { + t.Fatal(err) + } } } func TestCustomResourceValidationErrors(t *testing.T) { + defer utilfeaturetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, apiextensionsfeatures.CustomResourceWebhookConversion, true)() tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) if err != nil { t.Fatal(err) } defer tearDown() - noxuDefinition := newNoxuValidationCRD(apiextensionsv1beta1.NamespaceScoped) - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - - ns := "not-the-default" - noxuResourceClient := newNamespacedCustomResourceClient(ns, dynamicClient, noxuDefinition) - - tests := []struct { - name string - instanceFn func() *unstructured.Unstructured - expectedError string - }{ - { - name: "bad alpha", - instanceFn: func() *unstructured.Unstructured { - instance := newNoxuValidationInstance(ns, "foo") - instance.Object["alpha"] = "foo_123!" - return instance - }, - expectedError: "alpha in body should match '^[a-zA-Z0-9_]*$'", - }, - { - name: "bad beta", - instanceFn: func() *unstructured.Unstructured { - instance := newNoxuValidationInstance(ns, "foo") - instance.Object["beta"] = 5 - return instance - }, - expectedError: "beta in body should be greater than or equal to 10", - }, - { - name: "bad gamma", - instanceFn: func() *unstructured.Unstructured { - instance := newNoxuValidationInstance(ns, "foo") - instance.Object["gamma"] = "qux" - return instance - }, - expectedError: "gamma in body should be one of [foo bar baz]", - }, - { - name: "bad delta", - instanceFn: func() *unstructured.Unstructured { - instance := newNoxuValidationInstance(ns, "foo") - instance.Object["delta"] = "foobarbaz" - return instance - }, - expectedError: "must validate at least one schema (anyOf)\ndelta in body should be at most 5 chars long", - }, - { - name: "absent alpha and beta", - instanceFn: func() *unstructured.Unstructured { - instance := newNoxuValidationInstance(ns, "foo") - instance.Object = map[string]interface{}{ - "apiVersion": "mygroup.example.com/v1beta1", - "kind": "WishIHadChosenNoxu", - "metadata": map[string]interface{}{ - "namespace": "not-the-default", - "name": "foo", - }, - "gamma": "bar", - "delta": "hello", - } - return instance - }, - expectedError: ".alpha in body is required\n.beta in body is required", - }, - } - - for _, tc := range tests { - _, err := noxuResourceClient.Create(tc.instanceFn(), metav1.CreateOptions{}) - if err == nil { - t.Errorf("%v: expected %v", tc.name, tc.expectedError) - continue + noxuDefinitions := newNoxuValidationCRDs(apiextensionsv1beta1.NamespaceScoped) + for _, noxuDefinition := range noxuDefinitions { + noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) + if err != nil { + t.Fatal(err) } - // this only works when status errors contain the expect kind and version, so this effectively tests serializations too - if !strings.Contains(err.Error(), tc.expectedError) { - t.Errorf("%v: expected %v, got %v", tc.name, tc.expectedError, err) - continue + + ns := "not-the-default" + + tests := []struct { + name string + instanceFn func() *unstructured.Unstructured + expectedError string + }{ + { + name: "bad alpha", + instanceFn: func() *unstructured.Unstructured { + instance := newNoxuValidationInstance(ns, "foo") + instance.Object["alpha"] = "foo_123!" + return instance + }, + expectedError: "alpha in body should match '^[a-zA-Z0-9_]*$'", + }, + { + name: "bad beta", + instanceFn: func() *unstructured.Unstructured { + instance := newNoxuValidationInstance(ns, "foo") + instance.Object["beta"] = 5 + return instance + }, + expectedError: "beta in body should be greater than or equal to 10", + }, + { + name: "bad gamma", + instanceFn: func() *unstructured.Unstructured { + instance := newNoxuValidationInstance(ns, "foo") + instance.Object["gamma"] = "qux" + return instance + }, + expectedError: "gamma in body should be one of [foo bar baz]", + }, + { + name: "bad delta", + instanceFn: func() *unstructured.Unstructured { + instance := newNoxuValidationInstance(ns, "foo") + instance.Object["delta"] = "foobarbaz" + return instance + }, + expectedError: "must validate at least one schema (anyOf)\ndelta in body should be at most 5 chars long", + }, + { + name: "absent alpha and beta", + instanceFn: func() *unstructured.Unstructured { + instance := newNoxuValidationInstance(ns, "foo") + instance.Object = map[string]interface{}{ + "apiVersion": "mygroup.example.com/v1beta1", + "kind": "WishIHadChosenNoxu", + "metadata": map[string]interface{}{ + "namespace": "not-the-default", + "name": "foo", + }, + "gamma": "bar", + "delta": "hello", + } + return instance + }, + expectedError: ".alpha in body is required\n.beta in body is required", + }, + } + + for _, tc := range tests { + for _, v := range noxuDefinition.Spec.Versions { + noxuResourceClient := newNamespacedCustomResourceVersionedClient(ns, dynamicClient, noxuDefinition, v.Name) + instanceToCreate := tc.instanceFn() + instanceToCreate.Object["apiVersion"] = fmt.Sprintf("%s/%s", noxuDefinition.Spec.Group, v.Name) + _, err := noxuResourceClient.Create(instanceToCreate, metav1.CreateOptions{}) + if err == nil { + t.Errorf("%v: expected %v", tc.name, tc.expectedError) + continue + } + // this only works when status errors contain the expect kind and version, so this effectively tests serializations too + if !strings.Contains(err.Error(), tc.expectedError) { + t.Errorf("%v: expected %v, got %v", tc.name, tc.expectedError, err) + continue + } + } + } + if err := fixtures.DeleteCustomResourceDefinition(noxuDefinition, apiExtensionClient); err != nil { + t.Fatal(err) } } } func TestCRValidationOnCRDUpdate(t *testing.T) { + defer utilfeaturetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, apiextensionsfeatures.CustomResourceWebhookConversion, true)() tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) if err != nil { t.Fatal(err) } defer tearDown() - noxuDefinition := newNoxuValidationCRD(apiextensionsv1beta1.NamespaceScoped) + noxuDefinitions := newNoxuValidationCRDs(apiextensionsv1beta1.NamespaceScoped) + for i, noxuDefinition := range noxuDefinitions { + for _, v := range noxuDefinition.Spec.Versions { + // Re-define the CRD to make sure we start with a clean CRD + noxuDefinition := newNoxuValidationCRDs(apiextensionsv1beta1.NamespaceScoped)[i] + validationSchema, err := getSchemaForVersion(noxuDefinition, v.Name) + if err != nil { + t.Fatal(err) + } - // set stricter schema - noxuDefinition.Spec.Validation.OpenAPIV3Schema.Required = []string{"alpha", "beta", "epsilon"} + // set stricter schema + validationSchema.OpenAPIV3Schema.Required = []string{"alpha", "beta", "epsilon"} - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) - } - ns := "not-the-default" - noxuResourceClient := newNamespacedCustomResourceClient(ns, dynamicClient, noxuDefinition) + noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) + if err != nil { + t.Fatal(err) + } + ns := "not-the-default" + noxuResourceClient := newNamespacedCustomResourceVersionedClient(ns, dynamicClient, noxuDefinition, v.Name) + instanceToCreate := newNoxuValidationInstance(ns, "foo") + instanceToCreate.Object["apiVersion"] = fmt.Sprintf("%s/%s", noxuDefinition.Spec.Group, v.Name) - // CR is rejected - _, err = instantiateCustomResource(t, newNoxuValidationInstance(ns, "foo"), noxuResourceClient, noxuDefinition) - if err == nil { - t.Fatalf("unexpected non-error: CR should be rejected") - } + // CR is rejected + _, err = instantiateVersionedCustomResource(t, instanceToCreate, noxuResourceClient, noxuDefinition, v.Name) + if err == nil { + t.Fatalf("unexpected non-error: CR should be rejected") + } - // update the CRD to a less stricter schema - _, err = updateCustomResourceDefinitionWithRetry(apiExtensionClient, "noxus.mygroup.example.com", func(crd *apiextensionsv1beta1.CustomResourceDefinition) { - crd.Spec.Validation.OpenAPIV3Schema.Required = []string{"alpha", "beta"} - }) - if err != nil { - t.Fatal(err) - } + // update the CRD to a less stricter schema + _, err = UpdateCustomResourceDefinitionWithRetry(apiExtensionClient, "noxus.mygroup.example.com", func(crd *apiextensionsv1beta1.CustomResourceDefinition) { + validationSchema, err := getSchemaForVersion(crd, v.Name) + if err != nil { + t.Fatal(err) + } + validationSchema.OpenAPIV3Schema.Required = []string{"alpha", "beta"} + }) + if err != nil { + t.Fatal(err) + } - // CR is now accepted - err = wait.Poll(500*time.Millisecond, wait.ForeverTestTimeout, func() (bool, error) { - _, err := noxuResourceClient.Create(newNoxuValidationInstance(ns, "foo"), metav1.CreateOptions{}) - if statusError, isStatus := err.(*apierrors.StatusError); isStatus { - if strings.Contains(statusError.Error(), "is invalid") { - return false, nil + // CR is now accepted + err = wait.Poll(500*time.Millisecond, wait.ForeverTestTimeout, func() (bool, error) { + _, err := noxuResourceClient.Create(instanceToCreate, metav1.CreateOptions{}) + if _, isStatus := err.(*apierrors.StatusError); isStatus { + if apierrors.IsInvalid(err) { + return false, nil + } + } + if err != nil { + return false, err + } + return true, nil + }) + if err != nil { + t.Fatal(err) + } + noxuResourceClient.Delete("foo", &metav1.DeleteOptions{}) + if err := fixtures.DeleteCustomResourceDefinition(noxuDefinition, apiExtensionClient); err != nil { + t.Fatal(err) } } - if err != nil { - return false, err - } - return true, nil - }) - if err != nil { - t.Fatal(err) } } func TestForbiddenFieldsInSchema(t *testing.T) { + defer utilfeaturetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, apiextensionsfeatures.CustomResourceWebhookConversion, true)() tearDown, apiExtensionClient, dynamicClient, err := fixtures.StartDefaultServerWithClients(t) if err != nil { t.Fatal(err) } defer tearDown() - noxuDefinition := newNoxuValidationCRD(apiextensionsv1beta1.NamespaceScoped) - noxuDefinition.Spec.Validation.OpenAPIV3Schema.AdditionalProperties.Allows = false + noxuDefinitions := newNoxuValidationCRDs(apiextensionsv1beta1.NamespaceScoped) + for i, noxuDefinition := range noxuDefinitions { + for _, v := range noxuDefinition.Spec.Versions { + // Re-define the CRD to make sure we start with a clean CRD + noxuDefinition := newNoxuValidationCRDs(apiextensionsv1beta1.NamespaceScoped)[i] + validationSchema, err := getSchemaForVersion(noxuDefinition, v.Name) + if err != nil { + t.Fatal(err) + } + validationSchema.OpenAPIV3Schema.AdditionalProperties.Allows = false - _, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err == nil { - t.Fatalf("unexpected non-error: additionalProperties cannot be set to false") - } + _, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) + if err == nil { + t.Fatalf("unexpected non-error: additionalProperties cannot be set to false") + } - noxuDefinition.Spec.Validation.OpenAPIV3Schema.Properties["zeta"] = apiextensionsv1beta1.JSONSchemaProps{ - Type: "array", - UniqueItems: true, - } - noxuDefinition.Spec.Validation.OpenAPIV3Schema.AdditionalProperties.Allows = true + validationSchema.OpenAPIV3Schema.Properties["zeta"] = apiextensionsv1beta1.JSONSchemaProps{ + Type: "array", + UniqueItems: true, + } + validationSchema.OpenAPIV3Schema.AdditionalProperties.Allows = true - _, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err == nil { - t.Fatalf("unexpected non-error: uniqueItems cannot be set to true") - } + _, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) + if err == nil { + t.Fatalf("unexpected non-error: uniqueItems cannot be set to true") + } - noxuDefinition.Spec.Validation.OpenAPIV3Schema.Ref = strPtr("#/definition/zeta") - noxuDefinition.Spec.Validation.OpenAPIV3Schema.Properties["zeta"] = apiextensionsv1beta1.JSONSchemaProps{ - Type: "array", - UniqueItems: false, - } + validationSchema.OpenAPIV3Schema.Ref = strPtr("#/definition/zeta") + validationSchema.OpenAPIV3Schema.Properties["zeta"] = apiextensionsv1beta1.JSONSchemaProps{ + Type: "array", + UniqueItems: false, + } - _, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err == nil { - t.Fatal("unexpected non-error: $ref cannot be non-empty string") - } + _, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) + if err == nil { + t.Fatal("unexpected non-error: $ref cannot be non-empty string") + } - noxuDefinition.Spec.Validation.OpenAPIV3Schema.Ref = nil + validationSchema.OpenAPIV3Schema.Ref = nil - noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) - if err != nil { - t.Fatal(err) + noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) + if err != nil { + t.Fatal(err) + } + if err := fixtures.DeleteCustomResourceDefinition(noxuDefinition, apiExtensionClient); err != nil { + t.Fatal(err) + } + } } } diff --git a/vendor/k8s.io/apiextensions-apiserver/test/integration/versioning_test.go b/vendor/k8s.io/apiextensions-apiserver/test/integration/versioning_test.go index 7a813ab4..b56d3950 100644 --- a/vendor/k8s.io/apiextensions-apiserver/test/integration/versioning_test.go +++ b/vendor/k8s.io/apiextensions-apiserver/test/integration/versioning_test.go @@ -64,7 +64,7 @@ func TestInternalVersionIsHandlerVersion(t *testing.T) { // update validation via update because the cache priming in CreateNewCustomResourceDefinition will fail otherwise t.Logf("Updating CRD to validate apiVersion") - noxuDefinition, err = updateCustomResourceDefinitionWithRetry(apiExtensionClient, noxuDefinition.Name, func(crd *apiextensionsv1beta1.CustomResourceDefinition) { + noxuDefinition, err = UpdateCustomResourceDefinitionWithRetry(apiExtensionClient, noxuDefinition.Name, func(crd *apiextensionsv1beta1.CustomResourceDefinition) { crd.Spec.Validation = &apiextensionsv1beta1.CustomResourceValidation{ OpenAPIV3Schema: &apiextensionsv1beta1.JSONSchemaProps{ Properties: map[string]apiextensionsv1beta1.JSONSchemaProps{ diff --git a/vendor/k8s.io/apiextensions-apiserver/test/integration/yaml_test.go b/vendor/k8s.io/apiextensions-apiserver/test/integration/yaml_test.go index 45e5176b..e4989d25 100644 --- a/vendor/k8s.io/apiextensions-apiserver/test/integration/yaml_test.go +++ b/vendor/k8s.io/apiextensions-apiserver/test/integration/yaml_test.go @@ -22,15 +22,18 @@ import ( "net/http" "testing" - "github.com/ghodss/yaml" + "sigs.k8s.io/yaml" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/types" + utilfeature "k8s.io/apiserver/pkg/util/feature" + utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" "k8s.io/client-go/dynamic" apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" + apiextensionsfeatures "k8s.io/apiextensions-apiserver/pkg/features" "k8s.io/apiextensions-apiserver/test/integration/fixtures" ) @@ -354,6 +357,7 @@ values: } func TestYAMLSubresource(t *testing.T) { + defer utilfeaturetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, apiextensionsfeatures.CustomResourceWebhookConversion, true)() tearDown, config, _, err := fixtures.StartDefaultServer(t) if err != nil { t.Fatal(err) @@ -369,7 +373,7 @@ func TestYAMLSubresource(t *testing.T) { t.Fatal(err) } - noxuDefinition := NewNoxuSubresourcesCRD(apiextensionsv1beta1.ClusterScoped) + noxuDefinition := NewNoxuSubresourcesCRDs(apiextensionsv1beta1.ClusterScoped)[0] noxuDefinition, err = fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient) if err != nil { t.Fatal(err) diff --git a/vendor/k8s.io/apimachinery/Godeps/Godeps.json b/vendor/k8s.io/apimachinery/Godeps/Godeps.json index bbb5a8a3..c647d9b4 100644 --- a/vendor/k8s.io/apimachinery/Godeps/Godeps.json +++ b/vendor/k8s.io/apimachinery/Godeps/Godeps.json @@ -26,10 +26,6 @@ "ImportPath": "github.com/evanphx/json-patch", "Rev": "36442dbdb585210f8d5a1b45e67aa323c197d5c4" }, - { - "ImportPath": "github.com/ghodss/yaml", - "Rev": "c7ce16629ff4cd059ed96ed06419dd3856fd3577" - }, { "ImportPath": "github.com/gogo/protobuf/proto", "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" @@ -38,10 +34,6 @@ "ImportPath": "github.com/gogo/protobuf/sortkeys", "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" }, - { - "ImportPath": "github.com/golang/glog", - "Rev": "44145f04b68cf362d9c4df2182967c2275eaefed" - }, { "ImportPath": "github.com/golang/groupcache/lru", "Rev": "02826c3e79038b59d737d3b1c0a1d937f71a4433" @@ -128,31 +120,31 @@ }, { "ImportPath": "golang.org/x/net/html", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + "Rev": "0ed95abb35c445290478a5348a7b38bb154135fd" }, { "ImportPath": "golang.org/x/net/html/atom", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + "Rev": "0ed95abb35c445290478a5348a7b38bb154135fd" }, { "ImportPath": "golang.org/x/net/http2", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + "Rev": "0ed95abb35c445290478a5348a7b38bb154135fd" }, { "ImportPath": "golang.org/x/net/http2/hpack", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + "Rev": "0ed95abb35c445290478a5348a7b38bb154135fd" }, { "ImportPath": "golang.org/x/net/idna", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + "Rev": "0ed95abb35c445290478a5348a7b38bb154135fd" }, { "ImportPath": "golang.org/x/net/lex/httplex", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + "Rev": "0ed95abb35c445290478a5348a7b38bb154135fd" }, { "ImportPath": "golang.org/x/net/websocket", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + "Rev": "0ed95abb35c445290478a5348a7b38bb154135fd" }, { "ImportPath": "golang.org/x/text/secure/bidirule", @@ -178,9 +170,17 @@ "ImportPath": "gopkg.in/yaml.v2", "Rev": "5420a8b6744d3b0345ab293f6fcba19c978f1183" }, + { + "ImportPath": "k8s.io/klog", + "Rev": "8139d8cb77af419532b33dfa7dd09fbc5f1d344f" + }, { "ImportPath": "k8s.io/kube-openapi/pkg/util/proto", - "Rev": "72693cb1fadd73ae2742f6fe29af77d1aecdd8cd" + "Rev": "c59034cc13d587f5ef4e85ca0ade0c1866ae8e1d" + }, + { + "ImportPath": "sigs.k8s.io/yaml", + "Rev": "fd68e9863619f6ec2fdd8625fe1f02e7c877e480" } ] } diff --git a/vendor/k8s.io/apimachinery/pkg/api/meta/meta.go b/vendor/k8s.io/apimachinery/pkg/api/meta/meta.go index 854bd30f..6fe7458f 100644 --- a/vendor/k8s.io/apimachinery/pkg/api/meta/meta.go +++ b/vendor/k8s.io/apimachinery/pkg/api/meta/meta.go @@ -20,7 +20,7 @@ import ( "fmt" "reflect" - "github.com/golang/glog" + "k8s.io/klog" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1beta1 "k8s.io/apimachinery/pkg/apis/meta/v1beta1" @@ -607,7 +607,7 @@ func (a genericAccessor) GetOwnerReferences() []metav1.OwnerReference { var ret []metav1.OwnerReference s := a.ownerReferences if s.Kind() != reflect.Ptr || s.Elem().Kind() != reflect.Slice { - glog.Errorf("expect %v to be a pointer to slice", s) + klog.Errorf("expect %v to be a pointer to slice", s) return ret } s = s.Elem() @@ -615,7 +615,7 @@ func (a genericAccessor) GetOwnerReferences() []metav1.OwnerReference { ret = make([]metav1.OwnerReference, s.Len(), s.Len()+1) for i := 0; i < s.Len(); i++ { if err := extractFromOwnerReference(s.Index(i), &ret[i]); err != nil { - glog.Errorf("extractFromOwnerReference failed: %v", err) + klog.Errorf("extractFromOwnerReference failed: %v", err) return ret } } @@ -625,13 +625,13 @@ func (a genericAccessor) GetOwnerReferences() []metav1.OwnerReference { func (a genericAccessor) SetOwnerReferences(references []metav1.OwnerReference) { s := a.ownerReferences if s.Kind() != reflect.Ptr || s.Elem().Kind() != reflect.Slice { - glog.Errorf("expect %v to be a pointer to slice", s) + klog.Errorf("expect %v to be a pointer to slice", s) } s = s.Elem() newReferences := reflect.MakeSlice(s.Type(), len(references), len(references)) for i := 0; i < len(references); i++ { if err := setOwnerReference(newReferences.Index(i), &references[i]); err != nil { - glog.Errorf("setOwnerReference failed: %v", err) + klog.Errorf("setOwnerReference failed: %v", err) return } } diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/duration_test.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/duration_test.go index 7230cb28..34ca6b5d 100644 --- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/duration_test.go +++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/duration_test.go @@ -21,7 +21,7 @@ import ( "testing" "time" - "github.com/ghodss/yaml" + "sigs.k8s.io/yaml" ) type DurationHolder struct { diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time_test.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time_test.go index 985aa70b..b08e3f23 100644 --- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time_test.go +++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time_test.go @@ -22,7 +22,7 @@ import ( "testing" "time" - "github.com/ghodss/yaml" + "sigs.k8s.io/yaml" ) type MicroTimeHolder struct { diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/time_test.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/time_test.go index 0bf6c360..7ade16f6 100644 --- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/time_test.go +++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/time_test.go @@ -22,7 +22,7 @@ import ( "testing" "time" - "github.com/ghodss/yaml" + "sigs.k8s.io/yaml" ) type TimeHolder struct { diff --git a/vendor/k8s.io/apimachinery/pkg/labels/selector.go b/vendor/k8s.io/apimachinery/pkg/labels/selector.go index 374d2ef1..f5a08889 100644 --- a/vendor/k8s.io/apimachinery/pkg/labels/selector.go +++ b/vendor/k8s.io/apimachinery/pkg/labels/selector.go @@ -23,10 +23,10 @@ import ( "strconv" "strings" - "github.com/golang/glog" "k8s.io/apimachinery/pkg/selection" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/validation" + "k8s.io/klog" ) // Requirements is AND of all requirements. @@ -211,13 +211,13 @@ func (r *Requirement) Matches(ls Labels) bool { } lsValue, err := strconv.ParseInt(ls.Get(r.key), 10, 64) if err != nil { - glog.V(10).Infof("ParseInt failed for value %+v in label %+v, %+v", ls.Get(r.key), ls, err) + klog.V(10).Infof("ParseInt failed for value %+v in label %+v, %+v", ls.Get(r.key), ls, err) return false } // There should be only one strValue in r.strValues, and can be converted to a integer. if len(r.strValues) != 1 { - glog.V(10).Infof("Invalid values count %+v of requirement %#v, for 'Gt', 'Lt' operators, exactly one value is required", len(r.strValues), r) + klog.V(10).Infof("Invalid values count %+v of requirement %#v, for 'Gt', 'Lt' operators, exactly one value is required", len(r.strValues), r) return false } @@ -225,7 +225,7 @@ func (r *Requirement) Matches(ls Labels) bool { for i := range r.strValues { rValue, err = strconv.ParseInt(r.strValues[i], 10, 64) if err != nil { - glog.V(10).Infof("ParseInt failed for value %+v in requirement %#v, for 'Gt', 'Lt' operators, the value must be an integer", r.strValues[i], r) + klog.V(10).Infof("ParseInt failed for value %+v in requirement %#v, for 'Gt', 'Lt' operators, the value must be an integer", r.strValues[i], r) return false } } diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/converter.go b/vendor/k8s.io/apimachinery/pkg/runtime/converter.go index 291d7a4e..dff56e03 100644 --- a/vendor/k8s.io/apimachinery/pkg/runtime/converter.go +++ b/vendor/k8s.io/apimachinery/pkg/runtime/converter.go @@ -33,7 +33,7 @@ import ( "k8s.io/apimachinery/pkg/util/json" utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "github.com/golang/glog" + "k8s.io/klog" ) // UnstructuredConverter is an interface for converting between interface{} @@ -133,10 +133,10 @@ func (c *unstructuredConverter) FromUnstructured(u map[string]interface{}, obj i newObj := reflect.New(t.Elem()).Interface() newErr := fromUnstructuredViaJSON(u, newObj) if (err != nil) != (newErr != nil) { - glog.Fatalf("FromUnstructured unexpected error for %v: error: %v", u, err) + klog.Fatalf("FromUnstructured unexpected error for %v: error: %v", u, err) } if err == nil && !c.comparison.DeepEqual(obj, newObj) { - glog.Fatalf("FromUnstructured mismatch\nobj1: %#v\nobj2: %#v", obj, newObj) + klog.Fatalf("FromUnstructured mismatch\nobj1: %#v\nobj2: %#v", obj, newObj) } } return err @@ -424,10 +424,10 @@ func (c *unstructuredConverter) ToUnstructured(obj interface{}) (map[string]inte newUnstr := map[string]interface{}{} newErr := toUnstructuredViaJSON(obj, &newUnstr) if (err != nil) != (newErr != nil) { - glog.Fatalf("ToUnstructured unexpected error for %v: error: %v; newErr: %v", obj, err, newErr) + klog.Fatalf("ToUnstructured unexpected error for %v: error: %v; newErr: %v", obj, err, newErr) } if err == nil && !c.comparison.DeepEqual(u, newUnstr) { - glog.Fatalf("ToUnstructured mismatch\nobj1: %#v\nobj2: %#v", u, newUnstr) + klog.Fatalf("ToUnstructured mismatch\nobj1: %#v\nobj2: %#v", u, newUnstr) } } if err != nil { diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/serializer/codec_test.go b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/codec_test.go index d27da113..90a2962b 100644 --- a/vendor/k8s.io/apimachinery/pkg/runtime/serializer/codec_test.go +++ b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/codec_test.go @@ -32,9 +32,9 @@ import ( serializertesting "k8s.io/apimachinery/pkg/runtime/serializer/testing" "k8s.io/apimachinery/pkg/util/diff" - "github.com/ghodss/yaml" "github.com/google/gofuzz" flag "github.com/spf13/pflag" + "sigs.k8s.io/yaml" ) var fuzzIters = flag.Int("fuzz-iters", 50, "How many fuzzing iterations to do.") diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/serializer/json/json.go b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/json/json.go index 382c4858..8987e74c 100644 --- a/vendor/k8s.io/apimachinery/pkg/runtime/serializer/json/json.go +++ b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/json/json.go @@ -22,9 +22,9 @@ import ( "strconv" "unsafe" - "github.com/ghodss/yaml" jsoniter "github.com/json-iterator/go" "github.com/modern-go/reflect2" + "sigs.k8s.io/yaml" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/connection.go b/vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/connection.go index 3dc8e23a..9d222faa 100644 --- a/vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/connection.go +++ b/vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/connection.go @@ -23,8 +23,8 @@ import ( "time" "github.com/docker/spdystream" - "github.com/golang/glog" "k8s.io/apimachinery/pkg/util/httpstream" + "k8s.io/klog" ) // connection maintains state about a spdystream.Connection and its associated @@ -128,7 +128,7 @@ func (c *connection) newSpdyStream(stream *spdystream.Stream) { err := c.newStreamHandler(stream, replySent) rejectStream := (err != nil) if rejectStream { - glog.Warningf("Stream rejected: %v", err) + klog.Warningf("Stream rejected: %v", err) stream.Reset() return } diff --git a/vendor/k8s.io/apimachinery/pkg/util/intstr/intstr.go b/vendor/k8s.io/apimachinery/pkg/util/intstr/intstr.go index 642b83ce..5b26ed26 100644 --- a/vendor/k8s.io/apimachinery/pkg/util/intstr/intstr.go +++ b/vendor/k8s.io/apimachinery/pkg/util/intstr/intstr.go @@ -25,8 +25,8 @@ import ( "strconv" "strings" - "github.com/golang/glog" "github.com/google/gofuzz" + "k8s.io/klog" ) // IntOrString is a type that can hold an int32 or a string. When used in @@ -58,7 +58,7 @@ const ( // TODO: convert to (val int32) func FromInt(val int) IntOrString { if val > math.MaxInt32 || val < math.MinInt32 { - glog.Errorf("value: %d overflows int32\n%s\n", val, debug.Stack()) + klog.Errorf("value: %d overflows int32\n%s\n", val, debug.Stack()) } return IntOrString{Type: Int, IntVal: int32(val)} } diff --git a/vendor/k8s.io/apimachinery/pkg/util/intstr/intstr_test.go b/vendor/k8s.io/apimachinery/pkg/util/intstr/intstr_test.go index 690fe2d5..f6e08298 100644 --- a/vendor/k8s.io/apimachinery/pkg/util/intstr/intstr_test.go +++ b/vendor/k8s.io/apimachinery/pkg/util/intstr/intstr_test.go @@ -21,7 +21,7 @@ import ( "reflect" "testing" - "github.com/ghodss/yaml" + "sigs.k8s.io/yaml" ) func TestFromInt(t *testing.T) { diff --git a/vendor/k8s.io/apimachinery/pkg/util/jsonmergepatch/patch_test.go b/vendor/k8s.io/apimachinery/pkg/util/jsonmergepatch/patch_test.go index 9672deaa..25435206 100644 --- a/vendor/k8s.io/apimachinery/pkg/util/jsonmergepatch/patch_test.go +++ b/vendor/k8s.io/apimachinery/pkg/util/jsonmergepatch/patch_test.go @@ -23,8 +23,8 @@ import ( "github.com/davecgh/go-spew/spew" "github.com/evanphx/json-patch" - "github.com/ghodss/yaml" "k8s.io/apimachinery/pkg/util/json" + "sigs.k8s.io/yaml" ) type FilterNullTestCases struct { diff --git a/vendor/k8s.io/apimachinery/pkg/util/mergepatch/util.go b/vendor/k8s.io/apimachinery/pkg/util/mergepatch/util.go index d09a939b..990fa0d4 100644 --- a/vendor/k8s.io/apimachinery/pkg/util/mergepatch/util.go +++ b/vendor/k8s.io/apimachinery/pkg/util/mergepatch/util.go @@ -21,7 +21,7 @@ import ( "reflect" "github.com/davecgh/go-spew/spew" - "github.com/ghodss/yaml" + "sigs.k8s.io/yaml" ) // PreconditionFunc asserts that an incompatible change is not present within a patch. diff --git a/vendor/k8s.io/apimachinery/pkg/util/net/http.go b/vendor/k8s.io/apimachinery/pkg/util/net/http.go index 7c2a5e62..155667cd 100644 --- a/vendor/k8s.io/apimachinery/pkg/util/net/http.go +++ b/vendor/k8s.io/apimachinery/pkg/util/net/http.go @@ -31,8 +31,8 @@ import ( "strconv" "strings" - "github.com/golang/glog" "golang.org/x/net/http2" + "k8s.io/klog" ) // JoinPreservingTrailingSlash does a path.Join of the specified elements, @@ -107,10 +107,10 @@ func SetTransportDefaults(t *http.Transport) *http.Transport { t = SetOldTransportDefaults(t) // Allow clients to disable http2 if needed. if s := os.Getenv("DISABLE_HTTP2"); len(s) > 0 { - glog.Infof("HTTP2 has been explicitly disabled") + klog.Infof("HTTP2 has been explicitly disabled") } else { if err := http2.ConfigureTransport(t); err != nil { - glog.Warningf("Transport failed http2 configuration: %v", err) + klog.Warningf("Transport failed http2 configuration: %v", err) } } return t @@ -368,7 +368,7 @@ redirectLoop: resp, err := http.ReadResponse(respReader, nil) if err != nil { // Unable to read the backend response; let the client handle it. - glog.Warningf("Error reading backend response: %v", err) + klog.Warningf("Error reading backend response: %v", err) break redirectLoop } diff --git a/vendor/k8s.io/apimachinery/pkg/util/net/interface.go b/vendor/k8s.io/apimachinery/pkg/util/net/interface.go index 0ab9b360..daf5d249 100644 --- a/vendor/k8s.io/apimachinery/pkg/util/net/interface.go +++ b/vendor/k8s.io/apimachinery/pkg/util/net/interface.go @@ -26,7 +26,7 @@ import ( "strings" - "github.com/golang/glog" + "k8s.io/klog" ) type AddressFamily uint @@ -193,7 +193,7 @@ func isInterfaceUp(intf *net.Interface) bool { return false } if intf.Flags&net.FlagUp != 0 { - glog.V(4).Infof("Interface %v is up", intf.Name) + klog.V(4).Infof("Interface %v is up", intf.Name) return true } return false @@ -208,20 +208,20 @@ func isLoopbackOrPointToPoint(intf *net.Interface) bool { func getMatchingGlobalIP(addrs []net.Addr, family AddressFamily) (net.IP, error) { if len(addrs) > 0 { for i := range addrs { - glog.V(4).Infof("Checking addr %s.", addrs[i].String()) + klog.V(4).Infof("Checking addr %s.", addrs[i].String()) ip, _, err := net.ParseCIDR(addrs[i].String()) if err != nil { return nil, err } if memberOf(ip, family) { if ip.IsGlobalUnicast() { - glog.V(4).Infof("IP found %v", ip) + klog.V(4).Infof("IP found %v", ip) return ip, nil } else { - glog.V(4).Infof("Non-global unicast address found %v", ip) + klog.V(4).Infof("Non-global unicast address found %v", ip) } } else { - glog.V(4).Infof("%v is not an IPv%d address", ip, int(family)) + klog.V(4).Infof("%v is not an IPv%d address", ip, int(family)) } } @@ -241,13 +241,13 @@ func getIPFromInterface(intfName string, forFamily AddressFamily, nw networkInte if err != nil { return nil, err } - glog.V(4).Infof("Interface %q has %d addresses :%v.", intfName, len(addrs), addrs) + klog.V(4).Infof("Interface %q has %d addresses :%v.", intfName, len(addrs), addrs) matchingIP, err := getMatchingGlobalIP(addrs, forFamily) if err != nil { return nil, err } if matchingIP != nil { - glog.V(4).Infof("Found valid IPv%d address %v for interface %q.", int(forFamily), matchingIP, intfName) + klog.V(4).Infof("Found valid IPv%d address %v for interface %q.", int(forFamily), matchingIP, intfName) return matchingIP, nil } } @@ -275,14 +275,14 @@ func chooseIPFromHostInterfaces(nw networkInterfacer) (net.IP, error) { return nil, fmt.Errorf("no interfaces found on host.") } for _, family := range []AddressFamily{familyIPv4, familyIPv6} { - glog.V(4).Infof("Looking for system interface with a global IPv%d address", uint(family)) + klog.V(4).Infof("Looking for system interface with a global IPv%d address", uint(family)) for _, intf := range intfs { if !isInterfaceUp(&intf) { - glog.V(4).Infof("Skipping: down interface %q", intf.Name) + klog.V(4).Infof("Skipping: down interface %q", intf.Name) continue } if isLoopbackOrPointToPoint(&intf) { - glog.V(4).Infof("Skipping: LB or P2P interface %q", intf.Name) + klog.V(4).Infof("Skipping: LB or P2P interface %q", intf.Name) continue } addrs, err := nw.Addrs(&intf) @@ -290,7 +290,7 @@ func chooseIPFromHostInterfaces(nw networkInterfacer) (net.IP, error) { return nil, err } if len(addrs) == 0 { - glog.V(4).Infof("Skipping: no addresses on interface %q", intf.Name) + klog.V(4).Infof("Skipping: no addresses on interface %q", intf.Name) continue } for _, addr := range addrs { @@ -299,15 +299,15 @@ func chooseIPFromHostInterfaces(nw networkInterfacer) (net.IP, error) { return nil, fmt.Errorf("Unable to parse CIDR for interface %q: %s", intf.Name, err) } if !memberOf(ip, family) { - glog.V(4).Infof("Skipping: no address family match for %q on interface %q.", ip, intf.Name) + klog.V(4).Infof("Skipping: no address family match for %q on interface %q.", ip, intf.Name) continue } // TODO: Decide if should open up to allow IPv6 LLAs in future. if !ip.IsGlobalUnicast() { - glog.V(4).Infof("Skipping: non-global address %q on interface %q.", ip, intf.Name) + klog.V(4).Infof("Skipping: non-global address %q on interface %q.", ip, intf.Name) continue } - glog.V(4).Infof("Found global unicast address %q on interface %q.", ip, intf.Name) + klog.V(4).Infof("Found global unicast address %q on interface %q.", ip, intf.Name) return ip, nil } } @@ -381,23 +381,23 @@ func getAllDefaultRoutes() ([]Route, error) { // an IPv4 IP, and then will look at each IPv6 route for an IPv6 IP. func chooseHostInterfaceFromRoute(routes []Route, nw networkInterfacer) (net.IP, error) { for _, family := range []AddressFamily{familyIPv4, familyIPv6} { - glog.V(4).Infof("Looking for default routes with IPv%d addresses", uint(family)) + klog.V(4).Infof("Looking for default routes with IPv%d addresses", uint(family)) for _, route := range routes { if route.Family != family { continue } - glog.V(4).Infof("Default route transits interface %q", route.Interface) + klog.V(4).Infof("Default route transits interface %q", route.Interface) finalIP, err := getIPFromInterface(route.Interface, family, nw) if err != nil { return nil, err } if finalIP != nil { - glog.V(4).Infof("Found active IP %v ", finalIP) + klog.V(4).Infof("Found active IP %v ", finalIP) return finalIP, nil } } } - glog.V(4).Infof("No active IP found by looking at default routes") + klog.V(4).Infof("No active IP found by looking at default routes") return nil, fmt.Errorf("unable to select an IP from default routes.") } diff --git a/vendor/k8s.io/apimachinery/pkg/util/proxy/dial.go b/vendor/k8s.io/apimachinery/pkg/util/proxy/dial.go index 37a5be48..a59b24c8 100644 --- a/vendor/k8s.io/apimachinery/pkg/util/proxy/dial.go +++ b/vendor/k8s.io/apimachinery/pkg/util/proxy/dial.go @@ -24,7 +24,7 @@ import ( "net/http" "net/url" - "github.com/golang/glog" + "k8s.io/klog" utilnet "k8s.io/apimachinery/pkg/util/net" "k8s.io/apimachinery/third_party/forked/golang/netutil" @@ -35,7 +35,7 @@ func DialURL(ctx context.Context, url *url.URL, transport http.RoundTripper) (ne dialer, err := utilnet.DialerFor(transport) if err != nil { - glog.V(5).Infof("Unable to unwrap transport %T to get dialer: %v", transport, err) + klog.V(5).Infof("Unable to unwrap transport %T to get dialer: %v", transport, err) } switch url.Scheme { @@ -52,7 +52,7 @@ func DialURL(ctx context.Context, url *url.URL, transport http.RoundTripper) (ne var err error tlsConfig, err = utilnet.TLSClientConfig(transport) if err != nil { - glog.V(5).Infof("Unable to unwrap transport %T to get at TLS config: %v", transport, err) + klog.V(5).Infof("Unable to unwrap transport %T to get at TLS config: %v", transport, err) } if dialer != nil { @@ -64,7 +64,7 @@ func DialURL(ctx context.Context, url *url.URL, transport http.RoundTripper) (ne } if tlsConfig == nil { // tls.Client requires non-nil config - glog.Warningf("using custom dialer with no TLSClientConfig. Defaulting to InsecureSkipVerify") + klog.Warningf("using custom dialer with no TLSClientConfig. Defaulting to InsecureSkipVerify") // tls.Handshake() requires ServerName or InsecureSkipVerify tlsConfig = &tls.Config{ InsecureSkipVerify: true, diff --git a/vendor/k8s.io/apimachinery/pkg/util/proxy/transport.go b/vendor/k8s.io/apimachinery/pkg/util/proxy/transport.go index 6c34ab52..3c8cf6da 100644 --- a/vendor/k8s.io/apimachinery/pkg/util/proxy/transport.go +++ b/vendor/k8s.io/apimachinery/pkg/util/proxy/transport.go @@ -27,9 +27,9 @@ import ( "path" "strings" - "github.com/golang/glog" "golang.org/x/net/html" "golang.org/x/net/html/atom" + "k8s.io/klog" "k8s.io/apimachinery/pkg/util/net" "k8s.io/apimachinery/pkg/util/sets" @@ -236,7 +236,7 @@ func (t *Transport) rewriteResponse(req *http.Request, resp *http.Response) (*ht // This is fine default: // Some encoding we don't understand-- don't try to parse this - glog.Errorf("Proxy encountered encoding %v for text/html; can't understand this so not fixing links.", encoding) + klog.Errorf("Proxy encountered encoding %v for text/html; can't understand this so not fixing links.", encoding) return resp, nil } @@ -245,7 +245,7 @@ func (t *Transport) rewriteResponse(req *http.Request, resp *http.Response) (*ht } err := rewriteHTML(reader, writer, urlRewriter) if err != nil { - glog.Errorf("Failed to rewrite URLs: %v", err) + klog.Errorf("Failed to rewrite URLs: %v", err) return resp, err } diff --git a/vendor/k8s.io/apimachinery/pkg/util/proxy/upgradeaware.go b/vendor/k8s.io/apimachinery/pkg/util/proxy/upgradeaware.go index 269c5331..596b1888 100644 --- a/vendor/k8s.io/apimachinery/pkg/util/proxy/upgradeaware.go +++ b/vendor/k8s.io/apimachinery/pkg/util/proxy/upgradeaware.go @@ -34,8 +34,8 @@ import ( utilnet "k8s.io/apimachinery/pkg/util/net" utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "github.com/golang/glog" "github.com/mxk/go-flowrate/flowrate" + "k8s.io/klog" ) // UpgradeRequestRoundTripper provides an additional method to decorate a request @@ -235,7 +235,7 @@ func (h *UpgradeAwareHandler) ServeHTTP(w http.ResponseWriter, req *http.Request // tryUpgrade returns true if the request was handled. func (h *UpgradeAwareHandler) tryUpgrade(w http.ResponseWriter, req *http.Request) bool { if !httpstream.IsUpgradeRequest(req) { - glog.V(6).Infof("Request was not an upgrade") + klog.V(6).Infof("Request was not an upgrade") return false } @@ -257,15 +257,15 @@ func (h *UpgradeAwareHandler) tryUpgrade(w http.ResponseWriter, req *http.Reques // handles this in the non-upgrade path. utilnet.AppendForwardedForHeader(clone) if h.InterceptRedirects { - glog.V(6).Infof("Connecting to backend proxy (intercepting redirects) %s\n Headers: %v", &location, clone.Header) + klog.V(6).Infof("Connecting to backend proxy (intercepting redirects) %s\n Headers: %v", &location, clone.Header) backendConn, rawResponse, err = utilnet.ConnectWithRedirects(req.Method, &location, clone.Header, req.Body, utilnet.DialerFunc(h.DialForUpgrade), h.RequireSameHostRedirects) } else { - glog.V(6).Infof("Connecting to backend proxy (direct dial) %s\n Headers: %v", &location, clone.Header) + klog.V(6).Infof("Connecting to backend proxy (direct dial) %s\n Headers: %v", &location, clone.Header) clone.URL = &location backendConn, err = h.DialForUpgrade(clone) } if err != nil { - glog.V(6).Infof("Proxy connection error: %v", err) + klog.V(6).Infof("Proxy connection error: %v", err) h.Responder.Error(w, req, err) return true } @@ -275,13 +275,13 @@ func (h *UpgradeAwareHandler) tryUpgrade(w http.ResponseWriter, req *http.Reques // hijacking should be the last step in the upgrade. requestHijacker, ok := w.(http.Hijacker) if !ok { - glog.V(6).Infof("Unable to hijack response writer: %T", w) + klog.V(6).Infof("Unable to hijack response writer: %T", w) h.Responder.Error(w, req, fmt.Errorf("request connection cannot be hijacked: %T", w)) return true } requestHijackedConn, _, err := requestHijacker.Hijack() if err != nil { - glog.V(6).Infof("Unable to hijack response: %v", err) + klog.V(6).Infof("Unable to hijack response: %v", err) h.Responder.Error(w, req, fmt.Errorf("error hijacking connection: %v", err)) return true } @@ -289,7 +289,7 @@ func (h *UpgradeAwareHandler) tryUpgrade(w http.ResponseWriter, req *http.Reques // Forward raw response bytes back to client. if len(rawResponse) > 0 { - glog.V(6).Infof("Writing %d bytes to hijacked connection", len(rawResponse)) + klog.V(6).Infof("Writing %d bytes to hijacked connection", len(rawResponse)) if _, err = requestHijackedConn.Write(rawResponse); err != nil { utilruntime.HandleError(fmt.Errorf("Error proxying response from backend to client: %v", err)) } @@ -311,7 +311,7 @@ func (h *UpgradeAwareHandler) tryUpgrade(w http.ResponseWriter, req *http.Reques } _, err := io.Copy(writer, requestHijackedConn) if err != nil && !strings.Contains(err.Error(), "use of closed network connection") { - glog.Errorf("Error proxying data from client to backend: %v", err) + klog.Errorf("Error proxying data from client to backend: %v", err) } close(writerComplete) }() @@ -325,7 +325,7 @@ func (h *UpgradeAwareHandler) tryUpgrade(w http.ResponseWriter, req *http.Reques } _, err := io.Copy(requestHijackedConn, reader) if err != nil && !strings.Contains(err.Error(), "use of closed network connection") { - glog.Errorf("Error proxying data from backend to client: %v", err) + klog.Errorf("Error proxying data from backend to client: %v", err) } close(readerComplete) }() @@ -336,7 +336,7 @@ func (h *UpgradeAwareHandler) tryUpgrade(w http.ResponseWriter, req *http.Reques case <-writerComplete: case <-readerComplete: } - glog.V(6).Infof("Disconnecting from backend proxy %s\n Headers: %v", &location, clone.Header) + klog.V(6).Infof("Disconnecting from backend proxy %s\n Headers: %v", &location, clone.Header) return true } diff --git a/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go b/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go index da32fe12..8e34f926 100644 --- a/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go +++ b/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go @@ -22,7 +22,7 @@ import ( "sync" "time" - "github.com/golang/glog" + "k8s.io/klog" ) var ( @@ -63,7 +63,11 @@ func HandleCrash(additionalHandlers ...func(interface{})) { // logPanic logs the caller tree when a panic occurs. func logPanic(r interface{}) { callers := getCallers(r) - glog.Errorf("Observed a panic: %#v (%v)\n%v", r, r, callers) + if _, ok := r.(string); ok { + klog.Errorf("Observed a panic: %s\n%v", r, callers) + } else { + klog.Errorf("Observed a panic: %#v (%v)\n%v", r, r, callers) + } } func getCallers(r interface{}) string { @@ -111,7 +115,7 @@ func HandleError(err error) { // logError prints an error with the call stack of the location it was reported func logError(err error) { - glog.ErrorDepth(2, err) + klog.ErrorDepth(2, err) } type rudimentaryErrorBackoff struct { diff --git a/vendor/k8s.io/apimachinery/pkg/util/strategicpatch/patch_test.go b/vendor/k8s.io/apimachinery/pkg/util/strategicpatch/patch_test.go index 4721803c..6a0166e5 100644 --- a/vendor/k8s.io/apimachinery/pkg/util/strategicpatch/patch_test.go +++ b/vendor/k8s.io/apimachinery/pkg/util/strategicpatch/patch_test.go @@ -24,7 +24,7 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/ghodss/yaml" + "sigs.k8s.io/yaml" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/json" diff --git a/vendor/k8s.io/apimachinery/pkg/util/yaml/decoder.go b/vendor/k8s.io/apimachinery/pkg/util/yaml/decoder.go index 3cd85515..63d735a8 100644 --- a/vendor/k8s.io/apimachinery/pkg/util/yaml/decoder.go +++ b/vendor/k8s.io/apimachinery/pkg/util/yaml/decoder.go @@ -26,8 +26,8 @@ import ( "strings" "unicode" - "github.com/ghodss/yaml" - "github.com/golang/glog" + "k8s.io/klog" + "sigs.k8s.io/yaml" ) // ToJSON converts a single YAML document into a JSON document @@ -217,11 +217,11 @@ func (d *YAMLOrJSONDecoder) Decode(into interface{}) error { if d.decoder == nil { buffer, origData, isJSON := GuessJSONStream(d.r, d.bufferSize) if isJSON { - glog.V(4).Infof("decoding stream as JSON") + klog.V(4).Infof("decoding stream as JSON") d.decoder = json.NewDecoder(buffer) d.rawData = origData } else { - glog.V(4).Infof("decoding stream as YAML") + klog.V(4).Infof("decoding stream as YAML") d.decoder = NewYAMLToJSONDecoder(buffer) } } @@ -230,7 +230,7 @@ func (d *YAMLOrJSONDecoder) Decode(into interface{}) error { if syntax, ok := err.(*json.SyntaxError); ok { data, readErr := ioutil.ReadAll(jsonDecoder.Buffered()) if readErr != nil { - glog.V(4).Infof("reading stream failed: %v", readErr) + klog.V(4).Infof("reading stream failed: %v", readErr) } js := string(data) diff --git a/vendor/k8s.io/apimachinery/pkg/watch/streamwatcher.go b/vendor/k8s.io/apimachinery/pkg/watch/streamwatcher.go index 93bb1cdf..d61cf5a2 100644 --- a/vendor/k8s.io/apimachinery/pkg/watch/streamwatcher.go +++ b/vendor/k8s.io/apimachinery/pkg/watch/streamwatcher.go @@ -20,10 +20,10 @@ import ( "io" "sync" - "github.com/golang/glog" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/net" utilruntime "k8s.io/apimachinery/pkg/util/runtime" + "k8s.io/klog" ) // Decoder allows StreamWatcher to watch any stream for which a Decoder can be written. @@ -100,13 +100,13 @@ func (sw *StreamWatcher) receive() { case io.EOF: // watch closed normally case io.ErrUnexpectedEOF: - glog.V(1).Infof("Unexpected EOF during watch stream event decoding: %v", err) + klog.V(1).Infof("Unexpected EOF during watch stream event decoding: %v", err) default: msg := "Unable to decode an event from the watch stream: %v" if net.IsProbableEOF(err) { - glog.V(5).Infof(msg, err) + klog.V(5).Infof(msg, err) } else { - glog.Errorf(msg, err) + klog.Errorf(msg, err) } } return diff --git a/vendor/k8s.io/apimachinery/pkg/watch/watch.go b/vendor/k8s.io/apimachinery/pkg/watch/watch.go index a627d1d5..be9c90c0 100644 --- a/vendor/k8s.io/apimachinery/pkg/watch/watch.go +++ b/vendor/k8s.io/apimachinery/pkg/watch/watch.go @@ -20,7 +20,7 @@ import ( "fmt" "sync" - "github.com/golang/glog" + "k8s.io/klog" "k8s.io/apimachinery/pkg/runtime" ) @@ -106,7 +106,7 @@ func (f *FakeWatcher) Stop() { f.Lock() defer f.Unlock() if !f.Stopped { - glog.V(4).Infof("Stopping fake watcher.") + klog.V(4).Infof("Stopping fake watcher.") close(f.result) f.Stopped = true } @@ -173,7 +173,7 @@ func (f *RaceFreeFakeWatcher) Stop() { f.Lock() defer f.Unlock() if !f.Stopped { - glog.V(4).Infof("Stopping fake watcher.") + klog.V(4).Infof("Stopping fake watcher.") close(f.result) f.Stopped = true } diff --git a/vendor/k8s.io/client-go/Godeps/Godeps.json b/vendor/k8s.io/client-go/Godeps/Godeps.json index 574d7bda..9f668220 100644 --- a/vendor/k8s.io/client-go/Godeps/Godeps.json +++ b/vendor/k8s.io/client-go/Godeps/Godeps.json @@ -58,10 +58,6 @@ "ImportPath": "github.com/evanphx/json-patch", "Rev": "36442dbdb585210f8d5a1b45e67aa323c197d5c4" }, - { - "ImportPath": "github.com/ghodss/yaml", - "Rev": "c7ce16629ff4cd059ed96ed06419dd3856fd3577" - }, { "ImportPath": "github.com/gogo/protobuf/proto", "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" @@ -70,10 +66,6 @@ "ImportPath": "github.com/gogo/protobuf/sortkeys", "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" }, - { - "ImportPath": "github.com/golang/glog", - "Rev": "44145f04b68cf362d9c4df2182967c2275eaefed" - }, { "ImportPath": "github.com/golang/groupcache/lru", "Rev": "02826c3e79038b59d737d3b1c0a1d937f71a4433" @@ -200,27 +192,27 @@ }, { "ImportPath": "golang.org/x/net/context", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + "Rev": "0ed95abb35c445290478a5348a7b38bb154135fd" }, { "ImportPath": "golang.org/x/net/context/ctxhttp", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + "Rev": "0ed95abb35c445290478a5348a7b38bb154135fd" }, { "ImportPath": "golang.org/x/net/http2", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + "Rev": "0ed95abb35c445290478a5348a7b38bb154135fd" }, { "ImportPath": "golang.org/x/net/http2/hpack", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + "Rev": "0ed95abb35c445290478a5348a7b38bb154135fd" }, { "ImportPath": "golang.org/x/net/idna", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + "Rev": "0ed95abb35c445290478a5348a7b38bb154135fd" }, { "ImportPath": "golang.org/x/net/lex/httplex", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" + "Rev": "0ed95abb35c445290478a5348a7b38bb154135fd" }, { "ImportPath": "golang.org/x/oauth2", @@ -280,343 +272,351 @@ }, { "ImportPath": "k8s.io/api/admissionregistration/v1alpha1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/admissionregistration/v1beta1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/apps/v1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/apps/v1beta1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/apps/v1beta2", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/auditregistration/v1alpha1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/authentication/v1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/authentication/v1beta1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/authorization/v1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/authorization/v1beta1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/autoscaling/v1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/autoscaling/v2beta1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/autoscaling/v2beta2", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/batch/v1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/batch/v1beta1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/batch/v2alpha1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/certificates/v1beta1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/coordination/v1beta1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/core/v1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/events/v1beta1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/extensions/v1beta1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/imagepolicy/v1alpha1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/networking/v1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/policy/v1beta1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/rbac/v1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/rbac/v1alpha1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/rbac/v1beta1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/scheduling/v1alpha1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/scheduling/v1beta1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/settings/v1alpha1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/storage/v1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/storage/v1alpha1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/api/storage/v1beta1", - "Rev": "f6dfa44405f0e49522290bd277f3eee3c3fc74d1" + "Rev": "d01564359763a39d310efc27866b63d4f5c92f1d" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/apitesting", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/apitesting/fuzzer", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/apitesting/roundtrip", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/equality", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/errors", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/meta", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/resource", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/fuzzer", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1beta1", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/conversion", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/fields", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/labels", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/schema", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/selection", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/types", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/cache", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/clock", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/diff", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/errors", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/framer", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/httpstream", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/httpstream/spdy", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/intstr", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/json", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/naming", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/net", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/remotecommand", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/runtime", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/sets", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/validation", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/validation/field", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/wait", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/yaml", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/version", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/pkg/watch", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" }, { "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect", - "Rev": "ffd2ae06646c02ab214c0fe691dff61cb464ed87" + "Rev": "0028e7a3cc82b29fea214c5793c77c24a23bb3ef" + }, + { + "ImportPath": "k8s.io/klog", + "Rev": "8139d8cb77af419532b33dfa7dd09fbc5f1d344f" }, { "ImportPath": "k8s.io/kube-openapi/pkg/util/proto", - "Rev": "72693cb1fadd73ae2742f6fe29af77d1aecdd8cd" + "Rev": "c59034cc13d587f5ef4e85ca0ade0c1866ae8e1d" + }, + { + "ImportPath": "sigs.k8s.io/yaml", + "Rev": "fd68e9863619f6ec2fdd8625fe1f02e7c877e480" } ] } diff --git a/vendor/k8s.io/client-go/discovery/cached_discovery.go b/vendor/k8s.io/client-go/discovery/cached_discovery.go index 90cd3420..df69d6a1 100644 --- a/vendor/k8s.io/client-go/discovery/cached_discovery.go +++ b/vendor/k8s.io/client-go/discovery/cached_discovery.go @@ -25,8 +25,8 @@ import ( "sync" "time" - "github.com/golang/glog" "github.com/googleapis/gnostic/OpenAPIv2" + "k8s.io/klog" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -67,23 +67,23 @@ func (d *CachedDiscoveryClient) ServerResourcesForGroupVersion(groupVersion stri if err == nil { cachedResources := &metav1.APIResourceList{} if err := runtime.DecodeInto(scheme.Codecs.UniversalDecoder(), cachedBytes, cachedResources); err == nil { - glog.V(10).Infof("returning cached discovery info from %v", filename) + klog.V(10).Infof("returning cached discovery info from %v", filename) return cachedResources, nil } } liveResources, err := d.delegate.ServerResourcesForGroupVersion(groupVersion) if err != nil { - glog.V(3).Infof("skipped caching discovery info due to %v", err) + klog.V(3).Infof("skipped caching discovery info due to %v", err) return liveResources, err } if liveResources == nil || len(liveResources.APIResources) == 0 { - glog.V(3).Infof("skipped caching discovery info, no resources found") + klog.V(3).Infof("skipped caching discovery info, no resources found") return liveResources, err } if err := d.writeCachedFile(filename, liveResources); err != nil { - glog.V(1).Infof("failed to write cache to %v due to %v", filename, err) + klog.V(1).Infof("failed to write cache to %v due to %v", filename, err) } return liveResources, nil @@ -103,23 +103,23 @@ func (d *CachedDiscoveryClient) ServerGroups() (*metav1.APIGroupList, error) { if err == nil { cachedGroups := &metav1.APIGroupList{} if err := runtime.DecodeInto(scheme.Codecs.UniversalDecoder(), cachedBytes, cachedGroups); err == nil { - glog.V(10).Infof("returning cached discovery info from %v", filename) + klog.V(10).Infof("returning cached discovery info from %v", filename) return cachedGroups, nil } } liveGroups, err := d.delegate.ServerGroups() if err != nil { - glog.V(3).Infof("skipped caching discovery info due to %v", err) + klog.V(3).Infof("skipped caching discovery info due to %v", err) return liveGroups, err } if liveGroups == nil || len(liveGroups.Groups) == 0 { - glog.V(3).Infof("skipped caching discovery info, no groups found") + klog.V(3).Infof("skipped caching discovery info, no groups found") return liveGroups, err } if err := d.writeCachedFile(filename, liveGroups); err != nil { - glog.V(1).Infof("failed to write cache to %v due to %v", filename, err) + klog.V(1).Infof("failed to write cache to %v due to %v", filename, err) } return liveGroups, nil diff --git a/vendor/k8s.io/client-go/discovery/round_tripper.go b/vendor/k8s.io/client-go/discovery/round_tripper.go index 75b7f520..4e2bc24e 100644 --- a/vendor/k8s.io/client-go/discovery/round_tripper.go +++ b/vendor/k8s.io/client-go/discovery/round_tripper.go @@ -20,10 +20,10 @@ import ( "net/http" "path/filepath" - "github.com/golang/glog" "github.com/gregjones/httpcache" "github.com/gregjones/httpcache/diskcache" "github.com/peterbourgon/diskv" + "k8s.io/klog" ) type cacheRoundTripper struct { @@ -55,7 +55,7 @@ func (rt *cacheRoundTripper) CancelRequest(req *http.Request) { if cr, ok := rt.rt.Transport.(canceler); ok { cr.CancelRequest(req) } else { - glog.Errorf("CancelRequest not implemented by %T", rt.rt.Transport) + klog.Errorf("CancelRequest not implemented by %T", rt.rt.Transport) } } diff --git a/vendor/k8s.io/client-go/examples/workqueue/main.go b/vendor/k8s.io/client-go/examples/workqueue/main.go index 6768f5d9..c306aaae 100644 --- a/vendor/k8s.io/client-go/examples/workqueue/main.go +++ b/vendor/k8s.io/client-go/examples/workqueue/main.go @@ -21,7 +21,7 @@ import ( "fmt" "time" - "github.com/golang/glog" + "k8s.io/klog" "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -72,7 +72,7 @@ func (c *Controller) processNextItem() bool { func (c *Controller) syncToStdout(key string) error { obj, exists, err := c.indexer.GetByKey(key) if err != nil { - glog.Errorf("Fetching object with key %s from store failed with %v", key, err) + klog.Errorf("Fetching object with key %s from store failed with %v", key, err) return err } @@ -99,7 +99,7 @@ func (c *Controller) handleErr(err error, key interface{}) { // This controller retries 5 times if something goes wrong. After that, it stops trying. if c.queue.NumRequeues(key) < 5 { - glog.Infof("Error syncing pod %v: %v", key, err) + klog.Infof("Error syncing pod %v: %v", key, err) // Re-enqueue the key rate limited. Based on the rate limiter on the // queue and the re-enqueue history, the key will be processed later again. @@ -110,7 +110,7 @@ func (c *Controller) handleErr(err error, key interface{}) { c.queue.Forget(key) // Report to an external entity that, even after several retries, we could not successfully process this key runtime.HandleError(err) - glog.Infof("Dropping pod %q out of the queue: %v", key, err) + klog.Infof("Dropping pod %q out of the queue: %v", key, err) } func (c *Controller) Run(threadiness int, stopCh chan struct{}) { @@ -118,7 +118,7 @@ func (c *Controller) Run(threadiness int, stopCh chan struct{}) { // Let the workers stop when we are done defer c.queue.ShutDown() - glog.Info("Starting Pod controller") + klog.Info("Starting Pod controller") go c.informer.Run(stopCh) @@ -133,7 +133,7 @@ func (c *Controller) Run(threadiness int, stopCh chan struct{}) { } <-stopCh - glog.Info("Stopping Pod controller") + klog.Info("Stopping Pod controller") } func (c *Controller) runWorker() { @@ -152,13 +152,13 @@ func main() { // creates the connection config, err := clientcmd.BuildConfigFromFlags(master, kubeconfig) if err != nil { - glog.Fatal(err) + klog.Fatal(err) } // creates the clientset clientset, err := kubernetes.NewForConfig(config) if err != nil { - glog.Fatal(err) + klog.Fatal(err) } // create the pod watcher diff --git a/vendor/k8s.io/client-go/informers/generic.go b/vendor/k8s.io/client-go/informers/generic.go index ab9abf87..09a5efe2 100644 --- a/vendor/k8s.io/client-go/informers/generic.go +++ b/vendor/k8s.io/client-go/informers/generic.go @@ -262,6 +262,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource // Group=storage.k8s.io, Version=v1 case storagev1.SchemeGroupVersion.WithResource("storageclasses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1().StorageClasses().Informer()}, nil + case storagev1.SchemeGroupVersion.WithResource("volumeattachments"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1().VolumeAttachments().Informer()}, nil // Group=storage.k8s.io, Version=v1alpha1 case storagev1alpha1.SchemeGroupVersion.WithResource("volumeattachments"): diff --git a/vendor/k8s.io/client-go/informers/storage/v1/interface.go b/vendor/k8s.io/client-go/informers/storage/v1/interface.go index d7e4b5c4..64fc2bd8 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1/interface.go +++ b/vendor/k8s.io/client-go/informers/storage/v1/interface.go @@ -26,6 +26,8 @@ import ( type Interface interface { // StorageClasses returns a StorageClassInformer. StorageClasses() StorageClassInformer + // VolumeAttachments returns a VolumeAttachmentInformer. + VolumeAttachments() VolumeAttachmentInformer } type version struct { @@ -43,3 +45,8 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList func (v *version) StorageClasses() StorageClassInformer { return &storageClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } + +// VolumeAttachments returns a VolumeAttachmentInformer. +func (v *version) VolumeAttachments() VolumeAttachmentInformer { + return &volumeAttachmentInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} diff --git a/vendor/k8s.io/client-go/informers/storage/v1/volumeattachment.go b/vendor/k8s.io/client-go/informers/storage/v1/volumeattachment.go new file mode 100644 index 00000000..7ca3b86f --- /dev/null +++ b/vendor/k8s.io/client-go/informers/storage/v1/volumeattachment.go @@ -0,0 +1,88 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + time "time" + + storagev1 "k8s.io/api/storage/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + kubernetes "k8s.io/client-go/kubernetes" + v1 "k8s.io/client-go/listers/storage/v1" + cache "k8s.io/client-go/tools/cache" +) + +// VolumeAttachmentInformer provides access to a shared informer and lister for +// VolumeAttachments. +type VolumeAttachmentInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.VolumeAttachmentLister +} + +type volumeAttachmentInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewVolumeAttachmentInformer constructs a new informer for VolumeAttachment type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewVolumeAttachmentInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredVolumeAttachmentInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredVolumeAttachmentInformer constructs a new informer for VolumeAttachment type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredVolumeAttachmentInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1().VolumeAttachments().List(options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1().VolumeAttachments().Watch(options) + }, + }, + &storagev1.VolumeAttachment{}, + resyncPeriod, + indexers, + ) +} + +func (f *volumeAttachmentInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredVolumeAttachmentInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *volumeAttachmentInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&storagev1.VolumeAttachment{}, f.defaultInformer) +} + +func (f *volumeAttachmentInformer) Lister() v1.VolumeAttachmentLister { + return v1.NewVolumeAttachmentLister(f.Informer().GetIndexer()) +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/initializerconfiguration.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/initializerconfiguration.go index e014ea72..7b8acece 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/initializerconfiguration.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/initializerconfiguration.go @@ -19,6 +19,8 @@ limitations under the License. package v1alpha1 import ( + "time" + v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -72,10 +74,15 @@ func (c *initializerConfigurations) Get(name string, options v1.GetOptions) (res // List takes label and field selectors, and returns the list of InitializerConfigurations that match those selectors. func (c *initializerConfigurations) List(opts v1.ListOptions) (result *v1alpha1.InitializerConfigurationList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1alpha1.InitializerConfigurationList{} err = c.client.Get(). Resource("initializerconfigurations"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -83,10 +90,15 @@ func (c *initializerConfigurations) List(opts v1.ListOptions) (result *v1alpha1. // Watch returns a watch.Interface that watches the requested initializerConfigurations. func (c *initializerConfigurations) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Resource("initializerconfigurations"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -125,9 +137,14 @@ func (c *initializerConfigurations) Delete(name string, options *v1.DeleteOption // DeleteCollection deletes a collection of objects. func (c *initializerConfigurations) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Resource("initializerconfigurations"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go index cb015710..4524896c 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go @@ -19,6 +19,8 @@ limitations under the License. package v1beta1 import ( + "time" + v1beta1 "k8s.io/api/admissionregistration/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -72,10 +74,15 @@ func (c *mutatingWebhookConfigurations) Get(name string, options v1.GetOptions) // List takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors. func (c *mutatingWebhookConfigurations) List(opts v1.ListOptions) (result *v1beta1.MutatingWebhookConfigurationList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1beta1.MutatingWebhookConfigurationList{} err = c.client.Get(). Resource("mutatingwebhookconfigurations"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -83,10 +90,15 @@ func (c *mutatingWebhookConfigurations) List(opts v1.ListOptions) (result *v1bet // Watch returns a watch.Interface that watches the requested mutatingWebhookConfigurations. func (c *mutatingWebhookConfigurations) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Resource("mutatingwebhookconfigurations"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -125,9 +137,14 @@ func (c *mutatingWebhookConfigurations) Delete(name string, options *v1.DeleteOp // DeleteCollection deletes a collection of objects. func (c *mutatingWebhookConfigurations) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Resource("mutatingwebhookconfigurations"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go index 3a9339f6..7e711b30 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go @@ -19,6 +19,8 @@ limitations under the License. package v1beta1 import ( + "time" + v1beta1 "k8s.io/api/admissionregistration/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -72,10 +74,15 @@ func (c *validatingWebhookConfigurations) Get(name string, options v1.GetOptions // List takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors. func (c *validatingWebhookConfigurations) List(opts v1.ListOptions) (result *v1beta1.ValidatingWebhookConfigurationList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1beta1.ValidatingWebhookConfigurationList{} err = c.client.Get(). Resource("validatingwebhookconfigurations"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -83,10 +90,15 @@ func (c *validatingWebhookConfigurations) List(opts v1.ListOptions) (result *v1b // Watch returns a watch.Interface that watches the requested validatingWebhookConfigurations. func (c *validatingWebhookConfigurations) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Resource("validatingwebhookconfigurations"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -125,9 +137,14 @@ func (c *validatingWebhookConfigurations) Delete(name string, options *v1.Delete // DeleteCollection deletes a collection of objects. func (c *validatingWebhookConfigurations) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Resource("validatingwebhookconfigurations"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/controllerrevision.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/controllerrevision.go index 1ddaa1a7..e28e4d2a 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/controllerrevision.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/controllerrevision.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + v1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -75,11 +77,16 @@ func (c *controllerRevisions) Get(name string, options metav1.GetOptions) (resul // List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. func (c *controllerRevisions) List(opts metav1.ListOptions) (result *v1.ControllerRevisionList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.ControllerRevisionList{} err = c.client.Get(). Namespace(c.ns). Resource("controllerrevisions"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -87,11 +94,16 @@ func (c *controllerRevisions) List(opts metav1.ListOptions) (result *v1.Controll // Watch returns a watch.Interface that watches the requested controllerRevisions. func (c *controllerRevisions) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("controllerrevisions"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -133,10 +145,15 @@ func (c *controllerRevisions) Delete(name string, options *metav1.DeleteOptions) // DeleteCollection deletes a collection of objects. func (c *controllerRevisions) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("controllerrevisions"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/daemonset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/daemonset.go index 03a87069..a535cdab 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/daemonset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/daemonset.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + v1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -76,11 +78,16 @@ func (c *daemonSets) Get(name string, options metav1.GetOptions) (result *v1.Dae // List takes label and field selectors, and returns the list of DaemonSets that match those selectors. func (c *daemonSets) List(opts metav1.ListOptions) (result *v1.DaemonSetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.DaemonSetList{} err = c.client.Get(). Namespace(c.ns). Resource("daemonsets"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -88,11 +95,16 @@ func (c *daemonSets) List(opts metav1.ListOptions) (result *v1.DaemonSetList, er // Watch returns a watch.Interface that watches the requested daemonSets. func (c *daemonSets) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("daemonsets"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -150,10 +162,15 @@ func (c *daemonSets) Delete(name string, options *metav1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *daemonSets) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("daemonsets"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/deployment.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/deployment.go index 503eb4b7..f9799a45 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/deployment.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/deployment.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + v1 "k8s.io/api/apps/v1" autoscalingv1 "k8s.io/api/autoscaling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -80,11 +82,16 @@ func (c *deployments) Get(name string, options metav1.GetOptions) (result *v1.De // List takes label and field selectors, and returns the list of Deployments that match those selectors. func (c *deployments) List(opts metav1.ListOptions) (result *v1.DeploymentList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.DeploymentList{} err = c.client.Get(). Namespace(c.ns). Resource("deployments"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -92,11 +99,16 @@ func (c *deployments) List(opts metav1.ListOptions) (result *v1.DeploymentList, // Watch returns a watch.Interface that watches the requested deployments. func (c *deployments) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("deployments"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -154,10 +166,15 @@ func (c *deployments) Delete(name string, options *metav1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *deployments) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("deployments"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/replicaset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/replicaset.go index ea6efb68..ff3504e7 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/replicaset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/replicaset.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + v1 "k8s.io/api/apps/v1" autoscalingv1 "k8s.io/api/autoscaling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -80,11 +82,16 @@ func (c *replicaSets) Get(name string, options metav1.GetOptions) (result *v1.Re // List takes label and field selectors, and returns the list of ReplicaSets that match those selectors. func (c *replicaSets) List(opts metav1.ListOptions) (result *v1.ReplicaSetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.ReplicaSetList{} err = c.client.Get(). Namespace(c.ns). Resource("replicasets"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -92,11 +99,16 @@ func (c *replicaSets) List(opts metav1.ListOptions) (result *v1.ReplicaSetList, // Watch returns a watch.Interface that watches the requested replicaSets. func (c *replicaSets) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("replicasets"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -154,10 +166,15 @@ func (c *replicaSets) Delete(name string, options *metav1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *replicaSets) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("replicasets"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/statefulset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/statefulset.go index 66e522ba..c12c470b 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/statefulset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/statefulset.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + v1 "k8s.io/api/apps/v1" autoscalingv1 "k8s.io/api/autoscaling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -80,11 +82,16 @@ func (c *statefulSets) Get(name string, options metav1.GetOptions) (result *v1.S // List takes label and field selectors, and returns the list of StatefulSets that match those selectors. func (c *statefulSets) List(opts metav1.ListOptions) (result *v1.StatefulSetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.StatefulSetList{} err = c.client.Get(). Namespace(c.ns). Resource("statefulsets"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -92,11 +99,16 @@ func (c *statefulSets) List(opts metav1.ListOptions) (result *v1.StatefulSetList // Watch returns a watch.Interface that watches the requested statefulSets. func (c *statefulSets) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("statefulsets"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -154,10 +166,15 @@ func (c *statefulSets) Delete(name string, options *metav1.DeleteOptions) error // DeleteCollection deletes a collection of objects. func (c *statefulSets) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("statefulsets"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/controllerrevision.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/controllerrevision.go index ec8fa924..45ddb915 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/controllerrevision.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/controllerrevision.go @@ -19,6 +19,8 @@ limitations under the License. package v1beta1 import ( + "time" + v1beta1 "k8s.io/api/apps/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -75,11 +77,16 @@ func (c *controllerRevisions) Get(name string, options v1.GetOptions) (result *v // List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. func (c *controllerRevisions) List(opts v1.ListOptions) (result *v1beta1.ControllerRevisionList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1beta1.ControllerRevisionList{} err = c.client.Get(). Namespace(c.ns). Resource("controllerrevisions"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -87,11 +94,16 @@ func (c *controllerRevisions) List(opts v1.ListOptions) (result *v1beta1.Control // Watch returns a watch.Interface that watches the requested controllerRevisions. func (c *controllerRevisions) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("controllerrevisions"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -133,10 +145,15 @@ func (c *controllerRevisions) Delete(name string, options *v1.DeleteOptions) err // DeleteCollection deletes a collection of objects. func (c *controllerRevisions) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("controllerrevisions"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/deployment.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/deployment.go index 365e06f3..05fdcb7a 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/deployment.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/deployment.go @@ -19,6 +19,8 @@ limitations under the License. package v1beta1 import ( + "time" + v1beta1 "k8s.io/api/apps/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -76,11 +78,16 @@ func (c *deployments) Get(name string, options v1.GetOptions) (result *v1beta1.D // List takes label and field selectors, and returns the list of Deployments that match those selectors. func (c *deployments) List(opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1beta1.DeploymentList{} err = c.client.Get(). Namespace(c.ns). Resource("deployments"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -88,11 +95,16 @@ func (c *deployments) List(opts v1.ListOptions) (result *v1beta1.DeploymentList, // Watch returns a watch.Interface that watches the requested deployments. func (c *deployments) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("deployments"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -150,10 +162,15 @@ func (c *deployments) Delete(name string, options *v1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *deployments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("deployments"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/statefulset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/statefulset.go index 65174545..c4b35b42 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/statefulset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/statefulset.go @@ -19,6 +19,8 @@ limitations under the License. package v1beta1 import ( + "time" + v1beta1 "k8s.io/api/apps/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -76,11 +78,16 @@ func (c *statefulSets) Get(name string, options v1.GetOptions) (result *v1beta1. // List takes label and field selectors, and returns the list of StatefulSets that match those selectors. func (c *statefulSets) List(opts v1.ListOptions) (result *v1beta1.StatefulSetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1beta1.StatefulSetList{} err = c.client.Get(). Namespace(c.ns). Resource("statefulsets"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -88,11 +95,16 @@ func (c *statefulSets) List(opts v1.ListOptions) (result *v1beta1.StatefulSetLis // Watch returns a watch.Interface that watches the requested statefulSets. func (c *statefulSets) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("statefulsets"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -150,10 +162,15 @@ func (c *statefulSets) Delete(name string, options *v1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *statefulSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("statefulsets"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/controllerrevision.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/controllerrevision.go index 1271cc62..e1d60251 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/controllerrevision.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/controllerrevision.go @@ -19,6 +19,8 @@ limitations under the License. package v1beta2 import ( + "time" + v1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -75,11 +77,16 @@ func (c *controllerRevisions) Get(name string, options v1.GetOptions) (result *v // List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. func (c *controllerRevisions) List(opts v1.ListOptions) (result *v1beta2.ControllerRevisionList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1beta2.ControllerRevisionList{} err = c.client.Get(). Namespace(c.ns). Resource("controllerrevisions"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -87,11 +94,16 @@ func (c *controllerRevisions) List(opts v1.ListOptions) (result *v1beta2.Control // Watch returns a watch.Interface that watches the requested controllerRevisions. func (c *controllerRevisions) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("controllerrevisions"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -133,10 +145,15 @@ func (c *controllerRevisions) Delete(name string, options *v1.DeleteOptions) err // DeleteCollection deletes a collection of objects. func (c *controllerRevisions) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("controllerrevisions"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/daemonset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/daemonset.go index 683c0681..f8b7ac25 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/daemonset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/daemonset.go @@ -19,6 +19,8 @@ limitations under the License. package v1beta2 import ( + "time" + v1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -76,11 +78,16 @@ func (c *daemonSets) Get(name string, options v1.GetOptions) (result *v1beta2.Da // List takes label and field selectors, and returns the list of DaemonSets that match those selectors. func (c *daemonSets) List(opts v1.ListOptions) (result *v1beta2.DaemonSetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1beta2.DaemonSetList{} err = c.client.Get(). Namespace(c.ns). Resource("daemonsets"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -88,11 +95,16 @@ func (c *daemonSets) List(opts v1.ListOptions) (result *v1beta2.DaemonSetList, e // Watch returns a watch.Interface that watches the requested daemonSets. func (c *daemonSets) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("daemonsets"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -150,10 +162,15 @@ func (c *daemonSets) Delete(name string, options *v1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *daemonSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("daemonsets"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/deployment.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/deployment.go index 9a04513f..510250b0 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/deployment.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/deployment.go @@ -19,6 +19,8 @@ limitations under the License. package v1beta2 import ( + "time" + v1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -76,11 +78,16 @@ func (c *deployments) Get(name string, options v1.GetOptions) (result *v1beta2.D // List takes label and field selectors, and returns the list of Deployments that match those selectors. func (c *deployments) List(opts v1.ListOptions) (result *v1beta2.DeploymentList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1beta2.DeploymentList{} err = c.client.Get(). Namespace(c.ns). Resource("deployments"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -88,11 +95,16 @@ func (c *deployments) List(opts v1.ListOptions) (result *v1beta2.DeploymentList, // Watch returns a watch.Interface that watches the requested deployments. func (c *deployments) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("deployments"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -150,10 +162,15 @@ func (c *deployments) Delete(name string, options *v1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *deployments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("deployments"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/replicaset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/replicaset.go index 9fd9de93..7b738774 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/replicaset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/replicaset.go @@ -19,6 +19,8 @@ limitations under the License. package v1beta2 import ( + "time" + v1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -76,11 +78,16 @@ func (c *replicaSets) Get(name string, options v1.GetOptions) (result *v1beta2.R // List takes label and field selectors, and returns the list of ReplicaSets that match those selectors. func (c *replicaSets) List(opts v1.ListOptions) (result *v1beta2.ReplicaSetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1beta2.ReplicaSetList{} err = c.client.Get(). Namespace(c.ns). Resource("replicasets"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -88,11 +95,16 @@ func (c *replicaSets) List(opts v1.ListOptions) (result *v1beta2.ReplicaSetList, // Watch returns a watch.Interface that watches the requested replicaSets. func (c *replicaSets) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("replicasets"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -150,10 +162,15 @@ func (c *replicaSets) Delete(name string, options *v1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *replicaSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("replicasets"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/statefulset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/statefulset.go index 095601e1..de7c3db8 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/statefulset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/statefulset.go @@ -19,6 +19,8 @@ limitations under the License. package v1beta2 import ( + "time" + v1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -79,11 +81,16 @@ func (c *statefulSets) Get(name string, options v1.GetOptions) (result *v1beta2. // List takes label and field selectors, and returns the list of StatefulSets that match those selectors. func (c *statefulSets) List(opts v1.ListOptions) (result *v1beta2.StatefulSetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1beta2.StatefulSetList{} err = c.client.Get(). Namespace(c.ns). Resource("statefulsets"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -91,11 +98,16 @@ func (c *statefulSets) List(opts v1.ListOptions) (result *v1beta2.StatefulSetLis // Watch returns a watch.Interface that watches the requested statefulSets. func (c *statefulSets) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("statefulsets"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -153,10 +165,15 @@ func (c *statefulSets) Delete(name string, options *v1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *statefulSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("statefulsets"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/auditsink.go b/vendor/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/auditsink.go index 4f91f527..414d4800 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/auditsink.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/auditsink.go @@ -19,6 +19,8 @@ limitations under the License. package v1alpha1 import ( + "time" + v1alpha1 "k8s.io/api/auditregistration/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -72,10 +74,15 @@ func (c *auditSinks) Get(name string, options v1.GetOptions) (result *v1alpha1.A // List takes label and field selectors, and returns the list of AuditSinks that match those selectors. func (c *auditSinks) List(opts v1.ListOptions) (result *v1alpha1.AuditSinkList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1alpha1.AuditSinkList{} err = c.client.Get(). Resource("auditsinks"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -83,10 +90,15 @@ func (c *auditSinks) List(opts v1.ListOptions) (result *v1alpha1.AuditSinkList, // Watch returns a watch.Interface that watches the requested auditSinks. func (c *auditSinks) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Resource("auditsinks"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -125,9 +137,14 @@ func (c *auditSinks) Delete(name string, options *v1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *auditSinks) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Resource("auditsinks"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go index 6891b6b6..0e0839fb 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + v1 "k8s.io/api/autoscaling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -76,11 +78,16 @@ func (c *horizontalPodAutoscalers) Get(name string, options metav1.GetOptions) ( // List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. func (c *horizontalPodAutoscalers) List(opts metav1.ListOptions) (result *v1.HorizontalPodAutoscalerList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.HorizontalPodAutoscalerList{} err = c.client.Get(). Namespace(c.ns). Resource("horizontalpodautoscalers"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -88,11 +95,16 @@ func (c *horizontalPodAutoscalers) List(opts metav1.ListOptions) (result *v1.Hor // Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. func (c *horizontalPodAutoscalers) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("horizontalpodautoscalers"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -150,10 +162,15 @@ func (c *horizontalPodAutoscalers) Delete(name string, options *metav1.DeleteOpt // DeleteCollection deletes a collection of objects. func (c *horizontalPodAutoscalers) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("horizontalpodautoscalers"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go index 4ac8cce7..02d5cfb9 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go @@ -19,6 +19,8 @@ limitations under the License. package v2beta1 import ( + "time" + v2beta1 "k8s.io/api/autoscaling/v2beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -76,11 +78,16 @@ func (c *horizontalPodAutoscalers) Get(name string, options v1.GetOptions) (resu // List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. func (c *horizontalPodAutoscalers) List(opts v1.ListOptions) (result *v2beta1.HorizontalPodAutoscalerList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v2beta1.HorizontalPodAutoscalerList{} err = c.client.Get(). Namespace(c.ns). Resource("horizontalpodautoscalers"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -88,11 +95,16 @@ func (c *horizontalPodAutoscalers) List(opts v1.ListOptions) (result *v2beta1.Ho // Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. func (c *horizontalPodAutoscalers) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("horizontalpodautoscalers"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -150,10 +162,15 @@ func (c *horizontalPodAutoscalers) Delete(name string, options *v1.DeleteOptions // DeleteCollection deletes a collection of objects. func (c *horizontalPodAutoscalers) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("horizontalpodautoscalers"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/horizontalpodautoscaler.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/horizontalpodautoscaler.go index ddabda7e..91a0fa64 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/horizontalpodautoscaler.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/horizontalpodautoscaler.go @@ -19,6 +19,8 @@ limitations under the License. package v2beta2 import ( + "time" + v2beta2 "k8s.io/api/autoscaling/v2beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -76,11 +78,16 @@ func (c *horizontalPodAutoscalers) Get(name string, options v1.GetOptions) (resu // List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. func (c *horizontalPodAutoscalers) List(opts v1.ListOptions) (result *v2beta2.HorizontalPodAutoscalerList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v2beta2.HorizontalPodAutoscalerList{} err = c.client.Get(). Namespace(c.ns). Resource("horizontalpodautoscalers"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -88,11 +95,16 @@ func (c *horizontalPodAutoscalers) List(opts v1.ListOptions) (result *v2beta2.Ho // Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. func (c *horizontalPodAutoscalers) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("horizontalpodautoscalers"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -150,10 +162,15 @@ func (c *horizontalPodAutoscalers) Delete(name string, options *v1.DeleteOptions // DeleteCollection deletes a collection of objects. func (c *horizontalPodAutoscalers) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("horizontalpodautoscalers"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/job.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/job.go index ba8332a9..b55c602b 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/job.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/job.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + v1 "k8s.io/api/batch/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -76,11 +78,16 @@ func (c *jobs) Get(name string, options metav1.GetOptions) (result *v1.Job, err // List takes label and field selectors, and returns the list of Jobs that match those selectors. func (c *jobs) List(opts metav1.ListOptions) (result *v1.JobList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.JobList{} err = c.client.Get(). Namespace(c.ns). Resource("jobs"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -88,11 +95,16 @@ func (c *jobs) List(opts metav1.ListOptions) (result *v1.JobList, err error) { // Watch returns a watch.Interface that watches the requested jobs. func (c *jobs) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("jobs"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -150,10 +162,15 @@ func (c *jobs) Delete(name string, options *metav1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *jobs) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("jobs"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/cronjob.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/cronjob.go index 04637c36..d89d2fa2 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/cronjob.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/cronjob.go @@ -19,6 +19,8 @@ limitations under the License. package v1beta1 import ( + "time" + v1beta1 "k8s.io/api/batch/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -76,11 +78,16 @@ func (c *cronJobs) Get(name string, options v1.GetOptions) (result *v1beta1.Cron // List takes label and field selectors, and returns the list of CronJobs that match those selectors. func (c *cronJobs) List(opts v1.ListOptions) (result *v1beta1.CronJobList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1beta1.CronJobList{} err = c.client.Get(). Namespace(c.ns). Resource("cronjobs"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -88,11 +95,16 @@ func (c *cronJobs) List(opts v1.ListOptions) (result *v1beta1.CronJobList, err e // Watch returns a watch.Interface that watches the requested cronJobs. func (c *cronJobs) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("cronjobs"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -150,10 +162,15 @@ func (c *cronJobs) Delete(name string, options *v1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *cronJobs) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("cronjobs"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/cronjob.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/cronjob.go index 4d922f9a..19123b60 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/cronjob.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/cronjob.go @@ -19,6 +19,8 @@ limitations under the License. package v2alpha1 import ( + "time" + v2alpha1 "k8s.io/api/batch/v2alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -76,11 +78,16 @@ func (c *cronJobs) Get(name string, options v1.GetOptions) (result *v2alpha1.Cro // List takes label and field selectors, and returns the list of CronJobs that match those selectors. func (c *cronJobs) List(opts v1.ListOptions) (result *v2alpha1.CronJobList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v2alpha1.CronJobList{} err = c.client.Get(). Namespace(c.ns). Resource("cronjobs"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -88,11 +95,16 @@ func (c *cronJobs) List(opts v1.ListOptions) (result *v2alpha1.CronJobList, err // Watch returns a watch.Interface that watches the requested cronJobs. func (c *cronJobs) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("cronjobs"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -150,10 +162,15 @@ func (c *cronJobs) Delete(name string, options *v1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *cronJobs) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("cronjobs"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go index b39169a8..712d3a01 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go @@ -19,6 +19,8 @@ limitations under the License. package v1beta1 import ( + "time" + v1beta1 "k8s.io/api/certificates/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -73,10 +75,15 @@ func (c *certificateSigningRequests) Get(name string, options v1.GetOptions) (re // List takes label and field selectors, and returns the list of CertificateSigningRequests that match those selectors. func (c *certificateSigningRequests) List(opts v1.ListOptions) (result *v1beta1.CertificateSigningRequestList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1beta1.CertificateSigningRequestList{} err = c.client.Get(). Resource("certificatesigningrequests"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -84,10 +91,15 @@ func (c *certificateSigningRequests) List(opts v1.ListOptions) (result *v1beta1. // Watch returns a watch.Interface that watches the requested certificateSigningRequests. func (c *certificateSigningRequests) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Resource("certificatesigningrequests"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -141,9 +153,14 @@ func (c *certificateSigningRequests) Delete(name string, options *v1.DeleteOptio // DeleteCollection deletes a collection of objects. func (c *certificateSigningRequests) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Resource("certificatesigningrequests"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/lease.go b/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/lease.go index 16277255..490d815a 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/lease.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/lease.go @@ -19,6 +19,8 @@ limitations under the License. package v1beta1 import ( + "time" + v1beta1 "k8s.io/api/coordination/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -75,11 +77,16 @@ func (c *leases) Get(name string, options v1.GetOptions) (result *v1beta1.Lease, // List takes label and field selectors, and returns the list of Leases that match those selectors. func (c *leases) List(opts v1.ListOptions) (result *v1beta1.LeaseList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1beta1.LeaseList{} err = c.client.Get(). Namespace(c.ns). Resource("leases"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -87,11 +94,16 @@ func (c *leases) List(opts v1.ListOptions) (result *v1beta1.LeaseList, err error // Watch returns a watch.Interface that watches the requested leases. func (c *leases) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("leases"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -133,10 +145,15 @@ func (c *leases) Delete(name string, options *v1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *leases) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("leases"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/componentstatus.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/componentstatus.go index e497661c..302b2fdc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/componentstatus.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/componentstatus.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -72,10 +74,15 @@ func (c *componentStatuses) Get(name string, options metav1.GetOptions) (result // List takes label and field selectors, and returns the list of ComponentStatuses that match those selectors. func (c *componentStatuses) List(opts metav1.ListOptions) (result *v1.ComponentStatusList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.ComponentStatusList{} err = c.client.Get(). Resource("componentstatuses"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -83,10 +90,15 @@ func (c *componentStatuses) List(opts metav1.ListOptions) (result *v1.ComponentS // Watch returns a watch.Interface that watches the requested componentStatuses. func (c *componentStatuses) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Resource("componentstatuses"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -125,9 +137,14 @@ func (c *componentStatuses) Delete(name string, options *metav1.DeleteOptions) e // DeleteCollection deletes a collection of objects. func (c *componentStatuses) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Resource("componentstatuses"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/configmap.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/configmap.go index 0984ae70..18ce954a 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/configmap.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/configmap.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -75,11 +77,16 @@ func (c *configMaps) Get(name string, options metav1.GetOptions) (result *v1.Con // List takes label and field selectors, and returns the list of ConfigMaps that match those selectors. func (c *configMaps) List(opts metav1.ListOptions) (result *v1.ConfigMapList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.ConfigMapList{} err = c.client.Get(). Namespace(c.ns). Resource("configmaps"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -87,11 +94,16 @@ func (c *configMaps) List(opts metav1.ListOptions) (result *v1.ConfigMapList, er // Watch returns a watch.Interface that watches the requested configMaps. func (c *configMaps) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("configmaps"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -133,10 +145,15 @@ func (c *configMaps) Delete(name string, options *metav1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *configMaps) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("configmaps"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/endpoints.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/endpoints.go index dd821678..978a2a19 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/endpoints.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/endpoints.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -75,11 +77,16 @@ func (c *endpoints) Get(name string, options metav1.GetOptions) (result *v1.Endp // List takes label and field selectors, and returns the list of Endpoints that match those selectors. func (c *endpoints) List(opts metav1.ListOptions) (result *v1.EndpointsList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.EndpointsList{} err = c.client.Get(). Namespace(c.ns). Resource("endpoints"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -87,11 +94,16 @@ func (c *endpoints) List(opts metav1.ListOptions) (result *v1.EndpointsList, err // Watch returns a watch.Interface that watches the requested endpoints. func (c *endpoints) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("endpoints"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -133,10 +145,15 @@ func (c *endpoints) Delete(name string, options *metav1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *endpoints) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("endpoints"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/event.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/event.go index 57d30f9f..55cfa090 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/event.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/event.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -75,11 +77,16 @@ func (c *events) Get(name string, options metav1.GetOptions) (result *v1.Event, // List takes label and field selectors, and returns the list of Events that match those selectors. func (c *events) List(opts metav1.ListOptions) (result *v1.EventList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.EventList{} err = c.client.Get(). Namespace(c.ns). Resource("events"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -87,11 +94,16 @@ func (c *events) List(opts metav1.ListOptions) (result *v1.EventList, err error) // Watch returns a watch.Interface that watches the requested events. func (c *events) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("events"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -133,10 +145,15 @@ func (c *events) Delete(name string, options *metav1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *events) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("events"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/limitrange.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/limitrange.go index 5b385668..2eeae11a 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/limitrange.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/limitrange.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -75,11 +77,16 @@ func (c *limitRanges) Get(name string, options metav1.GetOptions) (result *v1.Li // List takes label and field selectors, and returns the list of LimitRanges that match those selectors. func (c *limitRanges) List(opts metav1.ListOptions) (result *v1.LimitRangeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.LimitRangeList{} err = c.client.Get(). Namespace(c.ns). Resource("limitranges"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -87,11 +94,16 @@ func (c *limitRanges) List(opts metav1.ListOptions) (result *v1.LimitRangeList, // Watch returns a watch.Interface that watches the requested limitRanges. func (c *limitRanges) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("limitranges"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -133,10 +145,15 @@ func (c *limitRanges) Delete(name string, options *metav1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *limitRanges) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("limitranges"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/namespace.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/namespace.go index e22d07de..8a81fe85 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/namespace.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/namespace.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -72,10 +74,15 @@ func (c *namespaces) Get(name string, options metav1.GetOptions) (result *v1.Nam // List takes label and field selectors, and returns the list of Namespaces that match those selectors. func (c *namespaces) List(opts metav1.ListOptions) (result *v1.NamespaceList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.NamespaceList{} err = c.client.Get(). Resource("namespaces"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -83,10 +90,15 @@ func (c *namespaces) List(opts metav1.ListOptions) (result *v1.NamespaceList, er // Watch returns a watch.Interface that watches the requested namespaces. func (c *namespaces) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Resource("namespaces"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/node.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/node.go index 5c769c11..d19fab89 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/node.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/node.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -73,10 +75,15 @@ func (c *nodes) Get(name string, options metav1.GetOptions) (result *v1.Node, er // List takes label and field selectors, and returns the list of Nodes that match those selectors. func (c *nodes) List(opts metav1.ListOptions) (result *v1.NodeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.NodeList{} err = c.client.Get(). Resource("nodes"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -84,10 +91,15 @@ func (c *nodes) List(opts metav1.ListOptions) (result *v1.NodeList, err error) { // Watch returns a watch.Interface that watches the requested nodes. func (c *nodes) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Resource("nodes"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -141,9 +153,14 @@ func (c *nodes) Delete(name string, options *metav1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *nodes) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Resource("nodes"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolume.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolume.go index d5f19aef..74514825 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolume.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolume.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -73,10 +75,15 @@ func (c *persistentVolumes) Get(name string, options metav1.GetOptions) (result // List takes label and field selectors, and returns the list of PersistentVolumes that match those selectors. func (c *persistentVolumes) List(opts metav1.ListOptions) (result *v1.PersistentVolumeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.PersistentVolumeList{} err = c.client.Get(). Resource("persistentvolumes"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -84,10 +91,15 @@ func (c *persistentVolumes) List(opts metav1.ListOptions) (result *v1.Persistent // Watch returns a watch.Interface that watches the requested persistentVolumes. func (c *persistentVolumes) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Resource("persistentvolumes"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -141,9 +153,14 @@ func (c *persistentVolumes) Delete(name string, options *metav1.DeleteOptions) e // DeleteCollection deletes a collection of objects. func (c *persistentVolumes) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Resource("persistentvolumes"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolumeclaim.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolumeclaim.go index d32ae5df..410ab37d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolumeclaim.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolumeclaim.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -76,11 +78,16 @@ func (c *persistentVolumeClaims) Get(name string, options metav1.GetOptions) (re // List takes label and field selectors, and returns the list of PersistentVolumeClaims that match those selectors. func (c *persistentVolumeClaims) List(opts metav1.ListOptions) (result *v1.PersistentVolumeClaimList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.PersistentVolumeClaimList{} err = c.client.Get(). Namespace(c.ns). Resource("persistentvolumeclaims"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -88,11 +95,16 @@ func (c *persistentVolumeClaims) List(opts metav1.ListOptions) (result *v1.Persi // Watch returns a watch.Interface that watches the requested persistentVolumeClaims. func (c *persistentVolumeClaims) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("persistentvolumeclaims"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -150,10 +162,15 @@ func (c *persistentVolumeClaims) Delete(name string, options *metav1.DeleteOptio // DeleteCollection deletes a collection of objects. func (c *persistentVolumeClaims) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("persistentvolumeclaims"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod.go index b19c5a5c..8d6b6e87 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -76,11 +78,16 @@ func (c *pods) Get(name string, options metav1.GetOptions) (result *v1.Pod, err // List takes label and field selectors, and returns the list of Pods that match those selectors. func (c *pods) List(opts metav1.ListOptions) (result *v1.PodList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.PodList{} err = c.client.Get(). Namespace(c.ns). Resource("pods"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -88,11 +95,16 @@ func (c *pods) List(opts metav1.ListOptions) (result *v1.PodList, err error) { // Watch returns a watch.Interface that watches the requested pods. func (c *pods) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("pods"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -150,10 +162,15 @@ func (c *pods) Delete(name string, options *metav1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *pods) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("pods"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/podtemplate.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/podtemplate.go index d644e17d..84d7c980 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/podtemplate.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/podtemplate.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -75,11 +77,16 @@ func (c *podTemplates) Get(name string, options metav1.GetOptions) (result *v1.P // List takes label and field selectors, and returns the list of PodTemplates that match those selectors. func (c *podTemplates) List(opts metav1.ListOptions) (result *v1.PodTemplateList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.PodTemplateList{} err = c.client.Get(). Namespace(c.ns). Resource("podtemplates"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -87,11 +94,16 @@ func (c *podTemplates) List(opts metav1.ListOptions) (result *v1.PodTemplateList // Watch returns a watch.Interface that watches the requested podTemplates. func (c *podTemplates) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("podtemplates"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -133,10 +145,15 @@ func (c *podTemplates) Delete(name string, options *metav1.DeleteOptions) error // DeleteCollection deletes a collection of objects. func (c *podTemplates) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("podtemplates"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/replicationcontroller.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/replicationcontroller.go index f3e41612..dd3182db 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/replicationcontroller.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/replicationcontroller.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + autoscalingv1 "k8s.io/api/autoscaling/v1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -80,11 +82,16 @@ func (c *replicationControllers) Get(name string, options metav1.GetOptions) (re // List takes label and field selectors, and returns the list of ReplicationControllers that match those selectors. func (c *replicationControllers) List(opts metav1.ListOptions) (result *v1.ReplicationControllerList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.ReplicationControllerList{} err = c.client.Get(). Namespace(c.ns). Resource("replicationcontrollers"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -92,11 +99,16 @@ func (c *replicationControllers) List(opts metav1.ListOptions) (result *v1.Repli // Watch returns a watch.Interface that watches the requested replicationControllers. func (c *replicationControllers) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("replicationcontrollers"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -154,10 +166,15 @@ func (c *replicationControllers) Delete(name string, options *metav1.DeleteOptio // DeleteCollection deletes a collection of objects. func (c *replicationControllers) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("replicationcontrollers"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/resourcequota.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/resourcequota.go index 8b74a404..5a178990 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/resourcequota.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/resourcequota.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -76,11 +78,16 @@ func (c *resourceQuotas) Get(name string, options metav1.GetOptions) (result *v1 // List takes label and field selectors, and returns the list of ResourceQuotas that match those selectors. func (c *resourceQuotas) List(opts metav1.ListOptions) (result *v1.ResourceQuotaList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.ResourceQuotaList{} err = c.client.Get(). Namespace(c.ns). Resource("resourcequotas"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -88,11 +95,16 @@ func (c *resourceQuotas) List(opts metav1.ListOptions) (result *v1.ResourceQuota // Watch returns a watch.Interface that watches the requested resourceQuotas. func (c *resourceQuotas) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("resourcequotas"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -150,10 +162,15 @@ func (c *resourceQuotas) Delete(name string, options *metav1.DeleteOptions) erro // DeleteCollection deletes a collection of objects. func (c *resourceQuotas) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("resourcequotas"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/secret.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/secret.go index 4ea9796b..85c143b1 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/secret.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/secret.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -75,11 +77,16 @@ func (c *secrets) Get(name string, options metav1.GetOptions) (result *v1.Secret // List takes label and field selectors, and returns the list of Secrets that match those selectors. func (c *secrets) List(opts metav1.ListOptions) (result *v1.SecretList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.SecretList{} err = c.client.Get(). Namespace(c.ns). Resource("secrets"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -87,11 +94,16 @@ func (c *secrets) List(opts metav1.ListOptions) (result *v1.SecretList, err erro // Watch returns a watch.Interface that watches the requested secrets. func (c *secrets) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("secrets"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -133,10 +145,15 @@ func (c *secrets) Delete(name string, options *metav1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *secrets) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("secrets"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/service.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/service.go index 6c42ca87..b0e09413 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/service.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/service.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -75,11 +77,16 @@ func (c *services) Get(name string, options metav1.GetOptions) (result *v1.Servi // List takes label and field selectors, and returns the list of Services that match those selectors. func (c *services) List(opts metav1.ListOptions) (result *v1.ServiceList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.ServiceList{} err = c.client.Get(). Namespace(c.ns). Resource("services"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -87,11 +94,16 @@ func (c *services) List(opts metav1.ListOptions) (result *v1.ServiceList, err er // Watch returns a watch.Interface that watches the requested services. func (c *services) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("services"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount.go index f3ab7eb8..50af6a21 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -75,11 +77,16 @@ func (c *serviceAccounts) Get(name string, options metav1.GetOptions) (result *v // List takes label and field selectors, and returns the list of ServiceAccounts that match those selectors. func (c *serviceAccounts) List(opts metav1.ListOptions) (result *v1.ServiceAccountList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.ServiceAccountList{} err = c.client.Get(). Namespace(c.ns). Resource("serviceaccounts"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -87,11 +94,16 @@ func (c *serviceAccounts) List(opts metav1.ListOptions) (result *v1.ServiceAccou // Watch returns a watch.Interface that watches the requested serviceAccounts. func (c *serviceAccounts) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("serviceaccounts"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -133,10 +145,15 @@ func (c *serviceAccounts) Delete(name string, options *metav1.DeleteOptions) err // DeleteCollection deletes a collection of objects. func (c *serviceAccounts) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("serviceaccounts"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/event.go b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/event.go index af7d060d..143281b2 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/event.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/event.go @@ -19,6 +19,8 @@ limitations under the License. package v1beta1 import ( + "time" + v1beta1 "k8s.io/api/events/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -75,11 +77,16 @@ func (c *events) Get(name string, options v1.GetOptions) (result *v1beta1.Event, // List takes label and field selectors, and returns the list of Events that match those selectors. func (c *events) List(opts v1.ListOptions) (result *v1beta1.EventList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1beta1.EventList{} err = c.client.Get(). Namespace(c.ns). Resource("events"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -87,11 +94,16 @@ func (c *events) List(opts v1.ListOptions) (result *v1beta1.EventList, err error // Watch returns a watch.Interface that watches the requested events. func (c *events) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("events"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -133,10 +145,15 @@ func (c *events) Delete(name string, options *v1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *events) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("events"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/daemonset.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/daemonset.go index 85294be4..93b1ae9b 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/daemonset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/daemonset.go @@ -19,6 +19,8 @@ limitations under the License. package v1beta1 import ( + "time" + v1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -76,11 +78,16 @@ func (c *daemonSets) Get(name string, options v1.GetOptions) (result *v1beta1.Da // List takes label and field selectors, and returns the list of DaemonSets that match those selectors. func (c *daemonSets) List(opts v1.ListOptions) (result *v1beta1.DaemonSetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1beta1.DaemonSetList{} err = c.client.Get(). Namespace(c.ns). Resource("daemonsets"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -88,11 +95,16 @@ func (c *daemonSets) List(opts v1.ListOptions) (result *v1beta1.DaemonSetList, e // Watch returns a watch.Interface that watches the requested daemonSets. func (c *daemonSets) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("daemonsets"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -150,10 +162,15 @@ func (c *daemonSets) Delete(name string, options *v1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *daemonSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("daemonsets"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment.go index 89183d28..5557b9f2 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment.go @@ -19,6 +19,8 @@ limitations under the License. package v1beta1 import ( + "time" + v1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -79,11 +81,16 @@ func (c *deployments) Get(name string, options v1.GetOptions) (result *v1beta1.D // List takes label and field selectors, and returns the list of Deployments that match those selectors. func (c *deployments) List(opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1beta1.DeploymentList{} err = c.client.Get(). Namespace(c.ns). Resource("deployments"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -91,11 +98,16 @@ func (c *deployments) List(opts v1.ListOptions) (result *v1beta1.DeploymentList, // Watch returns a watch.Interface that watches the requested deployments. func (c *deployments) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("deployments"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -153,10 +165,15 @@ func (c *deployments) Delete(name string, options *v1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *deployments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("deployments"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/ingress.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/ingress.go index f8b664cb..4da51c36 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/ingress.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/ingress.go @@ -19,6 +19,8 @@ limitations under the License. package v1beta1 import ( + "time" + v1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -76,11 +78,16 @@ func (c *ingresses) Get(name string, options v1.GetOptions) (result *v1beta1.Ing // List takes label and field selectors, and returns the list of Ingresses that match those selectors. func (c *ingresses) List(opts v1.ListOptions) (result *v1beta1.IngressList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1beta1.IngressList{} err = c.client.Get(). Namespace(c.ns). Resource("ingresses"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -88,11 +95,16 @@ func (c *ingresses) List(opts v1.ListOptions) (result *v1beta1.IngressList, err // Watch returns a watch.Interface that watches the requested ingresses. func (c *ingresses) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("ingresses"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -150,10 +162,15 @@ func (c *ingresses) Delete(name string, options *v1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *ingresses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("ingresses"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/podsecuritypolicy.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/podsecuritypolicy.go index 8099d773..a947a54a 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/podsecuritypolicy.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/podsecuritypolicy.go @@ -19,6 +19,8 @@ limitations under the License. package v1beta1 import ( + "time" + v1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -72,10 +74,15 @@ func (c *podSecurityPolicies) Get(name string, options v1.GetOptions) (result *v // List takes label and field selectors, and returns the list of PodSecurityPolicies that match those selectors. func (c *podSecurityPolicies) List(opts v1.ListOptions) (result *v1beta1.PodSecurityPolicyList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1beta1.PodSecurityPolicyList{} err = c.client.Get(). Resource("podsecuritypolicies"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -83,10 +90,15 @@ func (c *podSecurityPolicies) List(opts v1.ListOptions) (result *v1beta1.PodSecu // Watch returns a watch.Interface that watches the requested podSecurityPolicies. func (c *podSecurityPolicies) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Resource("podsecuritypolicies"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -125,9 +137,14 @@ func (c *podSecurityPolicies) Delete(name string, options *v1.DeleteOptions) err // DeleteCollection deletes a collection of objects. func (c *podSecurityPolicies) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Resource("podsecuritypolicies"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/replicaset.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/replicaset.go index 7e61fa2d..44402905 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/replicaset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/replicaset.go @@ -19,6 +19,8 @@ limitations under the License. package v1beta1 import ( + "time" + v1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -79,11 +81,16 @@ func (c *replicaSets) Get(name string, options v1.GetOptions) (result *v1beta1.R // List takes label and field selectors, and returns the list of ReplicaSets that match those selectors. func (c *replicaSets) List(opts v1.ListOptions) (result *v1beta1.ReplicaSetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1beta1.ReplicaSetList{} err = c.client.Get(). Namespace(c.ns). Resource("replicasets"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -91,11 +98,16 @@ func (c *replicaSets) List(opts v1.ListOptions) (result *v1beta1.ReplicaSetList, // Watch returns a watch.Interface that watches the requested replicaSets. func (c *replicaSets) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("replicasets"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -153,10 +165,15 @@ func (c *replicaSets) Delete(name string, options *v1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *replicaSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("replicasets"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/networkpolicy.go b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/networkpolicy.go index d8f0a6b4..3f39be95 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/networkpolicy.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/networkpolicy.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + v1 "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -75,11 +77,16 @@ func (c *networkPolicies) Get(name string, options metav1.GetOptions) (result *v // List takes label and field selectors, and returns the list of NetworkPolicies that match those selectors. func (c *networkPolicies) List(opts metav1.ListOptions) (result *v1.NetworkPolicyList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.NetworkPolicyList{} err = c.client.Get(). Namespace(c.ns). Resource("networkpolicies"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -87,11 +94,16 @@ func (c *networkPolicies) List(opts metav1.ListOptions) (result *v1.NetworkPolic // Watch returns a watch.Interface that watches the requested networkPolicies. func (c *networkPolicies) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("networkpolicies"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -133,10 +145,15 @@ func (c *networkPolicies) Delete(name string, options *metav1.DeleteOptions) err // DeleteCollection deletes a collection of objects. func (c *networkPolicies) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("networkpolicies"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go index a11f27eb..864af9a2 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go @@ -19,6 +19,8 @@ limitations under the License. package v1beta1 import ( + "time" + v1beta1 "k8s.io/api/policy/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -76,11 +78,16 @@ func (c *podDisruptionBudgets) Get(name string, options v1.GetOptions) (result * // List takes label and field selectors, and returns the list of PodDisruptionBudgets that match those selectors. func (c *podDisruptionBudgets) List(opts v1.ListOptions) (result *v1beta1.PodDisruptionBudgetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1beta1.PodDisruptionBudgetList{} err = c.client.Get(). Namespace(c.ns). Resource("poddisruptionbudgets"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -88,11 +95,16 @@ func (c *podDisruptionBudgets) List(opts v1.ListOptions) (result *v1beta1.PodDis // Watch returns a watch.Interface that watches the requested podDisruptionBudgets. func (c *podDisruptionBudgets) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("poddisruptionbudgets"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -150,10 +162,15 @@ func (c *podDisruptionBudgets) Delete(name string, options *v1.DeleteOptions) er // DeleteCollection deletes a collection of objects. func (c *podDisruptionBudgets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("poddisruptionbudgets"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/podsecuritypolicy.go b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/podsecuritypolicy.go index 355be1e9..d02096d7 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/podsecuritypolicy.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/podsecuritypolicy.go @@ -19,6 +19,8 @@ limitations under the License. package v1beta1 import ( + "time" + v1beta1 "k8s.io/api/policy/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -72,10 +74,15 @@ func (c *podSecurityPolicies) Get(name string, options v1.GetOptions) (result *v // List takes label and field selectors, and returns the list of PodSecurityPolicies that match those selectors. func (c *podSecurityPolicies) List(opts v1.ListOptions) (result *v1beta1.PodSecurityPolicyList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1beta1.PodSecurityPolicyList{} err = c.client.Get(). Resource("podsecuritypolicies"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -83,10 +90,15 @@ func (c *podSecurityPolicies) List(opts v1.ListOptions) (result *v1beta1.PodSecu // Watch returns a watch.Interface that watches the requested podSecurityPolicies. func (c *podSecurityPolicies) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Resource("podsecuritypolicies"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -125,9 +137,14 @@ func (c *podSecurityPolicies) Delete(name string, options *v1.DeleteOptions) err // DeleteCollection deletes a collection of objects. func (c *podSecurityPolicies) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Resource("podsecuritypolicies"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrole.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrole.go index c4299d4c..0a47c441 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrole.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrole.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + v1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -72,10 +74,15 @@ func (c *clusterRoles) Get(name string, options metav1.GetOptions) (result *v1.C // List takes label and field selectors, and returns the list of ClusterRoles that match those selectors. func (c *clusterRoles) List(opts metav1.ListOptions) (result *v1.ClusterRoleList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.ClusterRoleList{} err = c.client.Get(). Resource("clusterroles"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -83,10 +90,15 @@ func (c *clusterRoles) List(opts metav1.ListOptions) (result *v1.ClusterRoleList // Watch returns a watch.Interface that watches the requested clusterRoles. func (c *clusterRoles) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Resource("clusterroles"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -125,9 +137,14 @@ func (c *clusterRoles) Delete(name string, options *metav1.DeleteOptions) error // DeleteCollection deletes a collection of objects. func (c *clusterRoles) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Resource("clusterroles"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrolebinding.go index 30c0469a..c16ebc31 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrolebinding.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + v1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -72,10 +74,15 @@ func (c *clusterRoleBindings) Get(name string, options metav1.GetOptions) (resul // List takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. func (c *clusterRoleBindings) List(opts metav1.ListOptions) (result *v1.ClusterRoleBindingList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.ClusterRoleBindingList{} err = c.client.Get(). Resource("clusterrolebindings"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -83,10 +90,15 @@ func (c *clusterRoleBindings) List(opts metav1.ListOptions) (result *v1.ClusterR // Watch returns a watch.Interface that watches the requested clusterRoleBindings. func (c *clusterRoleBindings) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Resource("clusterrolebindings"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -125,9 +137,14 @@ func (c *clusterRoleBindings) Delete(name string, options *metav1.DeleteOptions) // DeleteCollection deletes a collection of objects. func (c *clusterRoleBindings) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Resource("clusterrolebindings"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/role.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/role.go index 81ea12a9..a17d791f 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/role.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/role.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + v1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -75,11 +77,16 @@ func (c *roles) Get(name string, options metav1.GetOptions) (result *v1.Role, er // List takes label and field selectors, and returns the list of Roles that match those selectors. func (c *roles) List(opts metav1.ListOptions) (result *v1.RoleList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.RoleList{} err = c.client.Get(). Namespace(c.ns). Resource("roles"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -87,11 +94,16 @@ func (c *roles) List(opts metav1.ListOptions) (result *v1.RoleList, err error) { // Watch returns a watch.Interface that watches the requested roles. func (c *roles) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("roles"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -133,10 +145,15 @@ func (c *roles) Delete(name string, options *metav1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *roles) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("roles"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/rolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/rolebinding.go index 17c6f991..c87e4571 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/rolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/rolebinding.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + v1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -75,11 +77,16 @@ func (c *roleBindings) Get(name string, options metav1.GetOptions) (result *v1.R // List takes label and field selectors, and returns the list of RoleBindings that match those selectors. func (c *roleBindings) List(opts metav1.ListOptions) (result *v1.RoleBindingList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.RoleBindingList{} err = c.client.Get(). Namespace(c.ns). Resource("rolebindings"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -87,11 +94,16 @@ func (c *roleBindings) List(opts metav1.ListOptions) (result *v1.RoleBindingList // Watch returns a watch.Interface that watches the requested roleBindings. func (c *roleBindings) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("rolebindings"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -133,10 +145,15 @@ func (c *roleBindings) Delete(name string, options *metav1.DeleteOptions) error // DeleteCollection deletes a collection of objects. func (c *roleBindings) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("rolebindings"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrole.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrole.go index 37a54576..77e66877 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrole.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrole.go @@ -19,6 +19,8 @@ limitations under the License. package v1alpha1 import ( + "time" + v1alpha1 "k8s.io/api/rbac/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -72,10 +74,15 @@ func (c *clusterRoles) Get(name string, options v1.GetOptions) (result *v1alpha1 // List takes label and field selectors, and returns the list of ClusterRoles that match those selectors. func (c *clusterRoles) List(opts v1.ListOptions) (result *v1alpha1.ClusterRoleList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1alpha1.ClusterRoleList{} err = c.client.Get(). Resource("clusterroles"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -83,10 +90,15 @@ func (c *clusterRoles) List(opts v1.ListOptions) (result *v1alpha1.ClusterRoleLi // Watch returns a watch.Interface that watches the requested clusterRoles. func (c *clusterRoles) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Resource("clusterroles"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -125,9 +137,14 @@ func (c *clusterRoles) Delete(name string, options *v1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *clusterRoles) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Resource("clusterroles"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go index 60507890..0d1b9d20 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go @@ -19,6 +19,8 @@ limitations under the License. package v1alpha1 import ( + "time" + v1alpha1 "k8s.io/api/rbac/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -72,10 +74,15 @@ func (c *clusterRoleBindings) Get(name string, options v1.GetOptions) (result *v // List takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. func (c *clusterRoleBindings) List(opts v1.ListOptions) (result *v1alpha1.ClusterRoleBindingList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1alpha1.ClusterRoleBindingList{} err = c.client.Get(). Resource("clusterrolebindings"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -83,10 +90,15 @@ func (c *clusterRoleBindings) List(opts v1.ListOptions) (result *v1alpha1.Cluste // Watch returns a watch.Interface that watches the requested clusterRoleBindings. func (c *clusterRoleBindings) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Resource("clusterrolebindings"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -125,9 +137,14 @@ func (c *clusterRoleBindings) Delete(name string, options *v1.DeleteOptions) err // DeleteCollection deletes a collection of objects. func (c *clusterRoleBindings) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Resource("clusterrolebindings"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/role.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/role.go index aa6954bb..4a4b6724 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/role.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/role.go @@ -19,6 +19,8 @@ limitations under the License. package v1alpha1 import ( + "time" + v1alpha1 "k8s.io/api/rbac/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -75,11 +77,16 @@ func (c *roles) Get(name string, options v1.GetOptions) (result *v1alpha1.Role, // List takes label and field selectors, and returns the list of Roles that match those selectors. func (c *roles) List(opts v1.ListOptions) (result *v1alpha1.RoleList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1alpha1.RoleList{} err = c.client.Get(). Namespace(c.ns). Resource("roles"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -87,11 +94,16 @@ func (c *roles) List(opts v1.ListOptions) (result *v1alpha1.RoleList, err error) // Watch returns a watch.Interface that watches the requested roles. func (c *roles) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("roles"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -133,10 +145,15 @@ func (c *roles) Delete(name string, options *v1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *roles) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("roles"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rolebinding.go index 0941b8e8..bf4e5a10 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rolebinding.go @@ -19,6 +19,8 @@ limitations under the License. package v1alpha1 import ( + "time" + v1alpha1 "k8s.io/api/rbac/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -75,11 +77,16 @@ func (c *roleBindings) Get(name string, options v1.GetOptions) (result *v1alpha1 // List takes label and field selectors, and returns the list of RoleBindings that match those selectors. func (c *roleBindings) List(opts v1.ListOptions) (result *v1alpha1.RoleBindingList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1alpha1.RoleBindingList{} err = c.client.Get(). Namespace(c.ns). Resource("rolebindings"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -87,11 +94,16 @@ func (c *roleBindings) List(opts v1.ListOptions) (result *v1alpha1.RoleBindingLi // Watch returns a watch.Interface that watches the requested roleBindings. func (c *roleBindings) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("rolebindings"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -133,10 +145,15 @@ func (c *roleBindings) Delete(name string, options *v1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *roleBindings) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("rolebindings"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrole.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrole.go index bac951c8..21d3cab3 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrole.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrole.go @@ -19,6 +19,8 @@ limitations under the License. package v1beta1 import ( + "time" + v1beta1 "k8s.io/api/rbac/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -72,10 +74,15 @@ func (c *clusterRoles) Get(name string, options v1.GetOptions) (result *v1beta1. // List takes label and field selectors, and returns the list of ClusterRoles that match those selectors. func (c *clusterRoles) List(opts v1.ListOptions) (result *v1beta1.ClusterRoleList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1beta1.ClusterRoleList{} err = c.client.Get(). Resource("clusterroles"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -83,10 +90,15 @@ func (c *clusterRoles) List(opts v1.ListOptions) (result *v1beta1.ClusterRoleLis // Watch returns a watch.Interface that watches the requested clusterRoles. func (c *clusterRoles) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Resource("clusterroles"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -125,9 +137,14 @@ func (c *clusterRoles) Delete(name string, options *v1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *clusterRoles) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Resource("clusterroles"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go index 96c91de6..47eb9e4e 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go @@ -19,6 +19,8 @@ limitations under the License. package v1beta1 import ( + "time" + v1beta1 "k8s.io/api/rbac/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -72,10 +74,15 @@ func (c *clusterRoleBindings) Get(name string, options v1.GetOptions) (result *v // List takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. func (c *clusterRoleBindings) List(opts v1.ListOptions) (result *v1beta1.ClusterRoleBindingList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1beta1.ClusterRoleBindingList{} err = c.client.Get(). Resource("clusterrolebindings"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -83,10 +90,15 @@ func (c *clusterRoleBindings) List(opts v1.ListOptions) (result *v1beta1.Cluster // Watch returns a watch.Interface that watches the requested clusterRoleBindings. func (c *clusterRoleBindings) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Resource("clusterrolebindings"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -125,9 +137,14 @@ func (c *clusterRoleBindings) Delete(name string, options *v1.DeleteOptions) err // DeleteCollection deletes a collection of objects. func (c *clusterRoleBindings) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Resource("clusterrolebindings"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/role.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/role.go index 66f382c0..2b61aad5 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/role.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/role.go @@ -19,6 +19,8 @@ limitations under the License. package v1beta1 import ( + "time" + v1beta1 "k8s.io/api/rbac/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -75,11 +77,16 @@ func (c *roles) Get(name string, options v1.GetOptions) (result *v1beta1.Role, e // List takes label and field selectors, and returns the list of Roles that match those selectors. func (c *roles) List(opts v1.ListOptions) (result *v1beta1.RoleList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1beta1.RoleList{} err = c.client.Get(). Namespace(c.ns). Resource("roles"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -87,11 +94,16 @@ func (c *roles) List(opts v1.ListOptions) (result *v1beta1.RoleList, err error) // Watch returns a watch.Interface that watches the requested roles. func (c *roles) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("roles"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -133,10 +145,15 @@ func (c *roles) Delete(name string, options *v1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *roles) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("roles"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/rolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/rolebinding.go index 67d3d331..0bd118fd 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/rolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/rolebinding.go @@ -19,6 +19,8 @@ limitations under the License. package v1beta1 import ( + "time" + v1beta1 "k8s.io/api/rbac/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -75,11 +77,16 @@ func (c *roleBindings) Get(name string, options v1.GetOptions) (result *v1beta1. // List takes label and field selectors, and returns the list of RoleBindings that match those selectors. func (c *roleBindings) List(opts v1.ListOptions) (result *v1beta1.RoleBindingList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1beta1.RoleBindingList{} err = c.client.Get(). Namespace(c.ns). Resource("rolebindings"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -87,11 +94,16 @@ func (c *roleBindings) List(opts v1.ListOptions) (result *v1beta1.RoleBindingLis // Watch returns a watch.Interface that watches the requested roleBindings. func (c *roleBindings) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("rolebindings"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -133,10 +145,15 @@ func (c *roleBindings) Delete(name string, options *v1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *roleBindings) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("rolebindings"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/priorityclass.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/priorityclass.go index 6845d25c..29d646fb 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/priorityclass.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/priorityclass.go @@ -19,6 +19,8 @@ limitations under the License. package v1alpha1 import ( + "time" + v1alpha1 "k8s.io/api/scheduling/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -72,10 +74,15 @@ func (c *priorityClasses) Get(name string, options v1.GetOptions) (result *v1alp // List takes label and field selectors, and returns the list of PriorityClasses that match those selectors. func (c *priorityClasses) List(opts v1.ListOptions) (result *v1alpha1.PriorityClassList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1alpha1.PriorityClassList{} err = c.client.Get(). Resource("priorityclasses"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -83,10 +90,15 @@ func (c *priorityClasses) List(opts v1.ListOptions) (result *v1alpha1.PriorityCl // Watch returns a watch.Interface that watches the requested priorityClasses. func (c *priorityClasses) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Resource("priorityclasses"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -125,9 +137,14 @@ func (c *priorityClasses) Delete(name string, options *v1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *priorityClasses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Resource("priorityclasses"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/priorityclass.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/priorityclass.go index 57b9766e..5e402f8e 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/priorityclass.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/priorityclass.go @@ -19,6 +19,8 @@ limitations under the License. package v1beta1 import ( + "time" + v1beta1 "k8s.io/api/scheduling/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -72,10 +74,15 @@ func (c *priorityClasses) Get(name string, options v1.GetOptions) (result *v1bet // List takes label and field selectors, and returns the list of PriorityClasses that match those selectors. func (c *priorityClasses) List(opts v1.ListOptions) (result *v1beta1.PriorityClassList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1beta1.PriorityClassList{} err = c.client.Get(). Resource("priorityclasses"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -83,10 +90,15 @@ func (c *priorityClasses) List(opts v1.ListOptions) (result *v1beta1.PriorityCla // Watch returns a watch.Interface that watches the requested priorityClasses. func (c *priorityClasses) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Resource("priorityclasses"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -125,9 +137,14 @@ func (c *priorityClasses) Delete(name string, options *v1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *priorityClasses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Resource("priorityclasses"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/podpreset.go b/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/podpreset.go index f000ae48..8fd6adc5 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/podpreset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/podpreset.go @@ -19,6 +19,8 @@ limitations under the License. package v1alpha1 import ( + "time" + v1alpha1 "k8s.io/api/settings/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -75,11 +77,16 @@ func (c *podPresets) Get(name string, options v1.GetOptions) (result *v1alpha1.P // List takes label and field selectors, and returns the list of PodPresets that match those selectors. func (c *podPresets) List(opts v1.ListOptions) (result *v1alpha1.PodPresetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1alpha1.PodPresetList{} err = c.client.Get(). Namespace(c.ns). Resource("podpresets"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -87,11 +94,16 @@ func (c *podPresets) List(opts v1.ListOptions) (result *v1alpha1.PodPresetList, // Watch returns a watch.Interface that watches the requested podPresets. func (c *podPresets) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("podpresets"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -133,10 +145,15 @@ func (c *podPresets) Delete(name string, options *v1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *podPresets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("podpresets"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storage_client.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storage_client.go index fc6f98cf..967a5285 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storage_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_storage_client.go @@ -32,6 +32,10 @@ func (c *FakeStorageV1) StorageClasses() v1.StorageClassInterface { return &FakeStorageClasses{c} } +func (c *FakeStorageV1) VolumeAttachments() v1.VolumeAttachmentInterface { + return &FakeVolumeAttachments{c} +} + // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeStorageV1) RESTClient() rest.Interface { diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_volumeattachment.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_volumeattachment.go new file mode 100644 index 00000000..58e09da4 --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/fake/fake_volumeattachment.go @@ -0,0 +1,131 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + storagev1 "k8s.io/api/storage/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeVolumeAttachments implements VolumeAttachmentInterface +type FakeVolumeAttachments struct { + Fake *FakeStorageV1 +} + +var volumeattachmentsResource = schema.GroupVersionResource{Group: "storage.k8s.io", Version: "v1", Resource: "volumeattachments"} + +var volumeattachmentsKind = schema.GroupVersionKind{Group: "storage.k8s.io", Version: "v1", Kind: "VolumeAttachment"} + +// Get takes name of the volumeAttachment, and returns the corresponding volumeAttachment object, and an error if there is any. +func (c *FakeVolumeAttachments) Get(name string, options v1.GetOptions) (result *storagev1.VolumeAttachment, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(volumeattachmentsResource, name), &storagev1.VolumeAttachment{}) + if obj == nil { + return nil, err + } + return obj.(*storagev1.VolumeAttachment), err +} + +// List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. +func (c *FakeVolumeAttachments) List(opts v1.ListOptions) (result *storagev1.VolumeAttachmentList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(volumeattachmentsResource, volumeattachmentsKind, opts), &storagev1.VolumeAttachmentList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &storagev1.VolumeAttachmentList{ListMeta: obj.(*storagev1.VolumeAttachmentList).ListMeta} + for _, item := range obj.(*storagev1.VolumeAttachmentList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested volumeAttachments. +func (c *FakeVolumeAttachments) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(volumeattachmentsResource, opts)) +} + +// Create takes the representation of a volumeAttachment and creates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. +func (c *FakeVolumeAttachments) Create(volumeAttachment *storagev1.VolumeAttachment) (result *storagev1.VolumeAttachment, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(volumeattachmentsResource, volumeAttachment), &storagev1.VolumeAttachment{}) + if obj == nil { + return nil, err + } + return obj.(*storagev1.VolumeAttachment), err +} + +// Update takes the representation of a volumeAttachment and updates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. +func (c *FakeVolumeAttachments) Update(volumeAttachment *storagev1.VolumeAttachment) (result *storagev1.VolumeAttachment, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(volumeattachmentsResource, volumeAttachment), &storagev1.VolumeAttachment{}) + if obj == nil { + return nil, err + } + return obj.(*storagev1.VolumeAttachment), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeVolumeAttachments) UpdateStatus(volumeAttachment *storagev1.VolumeAttachment) (*storagev1.VolumeAttachment, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(volumeattachmentsResource, "status", volumeAttachment), &storagev1.VolumeAttachment{}) + if obj == nil { + return nil, err + } + return obj.(*storagev1.VolumeAttachment), err +} + +// Delete takes name of the volumeAttachment and deletes it. Returns an error if one occurs. +func (c *FakeVolumeAttachments) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(volumeattachmentsResource, name), &storagev1.VolumeAttachment{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVolumeAttachments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(volumeattachmentsResource, listOptions) + + _, err := c.Fake.Invokes(action, &storagev1.VolumeAttachmentList{}) + return err +} + +// Patch applies the patch and returns the patched volumeAttachment. +func (c *FakeVolumeAttachments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *storagev1.VolumeAttachment, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(volumeattachmentsResource, name, pt, data, subresources...), &storagev1.VolumeAttachment{}) + if obj == nil { + return nil, err + } + return obj.(*storagev1.VolumeAttachment), err +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/generated_expansion.go index 2bea7ec7..ccac1611 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/generated_expansion.go @@ -19,3 +19,5 @@ limitations under the License. package v1 type StorageClassExpansion interface{} + +type VolumeAttachmentExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storage_client.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storage_client.go index ac48f491..92378cf7 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storage_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storage_client.go @@ -28,6 +28,7 @@ import ( type StorageV1Interface interface { RESTClient() rest.Interface StorageClassesGetter + VolumeAttachmentsGetter } // StorageV1Client is used to interact with features provided by the storage.k8s.io group. @@ -39,6 +40,10 @@ func (c *StorageV1Client) StorageClasses() StorageClassInterface { return newStorageClasses(c) } +func (c *StorageV1Client) VolumeAttachments() VolumeAttachmentInterface { + return newVolumeAttachments(c) +} + // NewForConfig creates a new StorageV1Client for the given config. func NewForConfig(c *rest.Config) (*StorageV1Client, error) { config := *c diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storageclass.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storageclass.go index 0f7f57f0..3f4c48f0 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storageclass.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storageclass.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + v1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -72,10 +74,15 @@ func (c *storageClasses) Get(name string, options metav1.GetOptions) (result *v1 // List takes label and field selectors, and returns the list of StorageClasses that match those selectors. func (c *storageClasses) List(opts metav1.ListOptions) (result *v1.StorageClassList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.StorageClassList{} err = c.client.Get(). Resource("storageclasses"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -83,10 +90,15 @@ func (c *storageClasses) List(opts metav1.ListOptions) (result *v1.StorageClassL // Watch returns a watch.Interface that watches the requested storageClasses. func (c *storageClasses) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Resource("storageclasses"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -125,9 +137,14 @@ func (c *storageClasses) Delete(name string, options *metav1.DeleteOptions) erro // DeleteCollection deletes a collection of objects. func (c *storageClasses) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Resource("storageclasses"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/volumeattachment.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/volumeattachment.go new file mode 100644 index 00000000..0f45097b --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/volumeattachment.go @@ -0,0 +1,180 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "time" + + v1 "k8s.io/api/storage/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + scheme "k8s.io/client-go/kubernetes/scheme" + rest "k8s.io/client-go/rest" +) + +// VolumeAttachmentsGetter has a method to return a VolumeAttachmentInterface. +// A group's client should implement this interface. +type VolumeAttachmentsGetter interface { + VolumeAttachments() VolumeAttachmentInterface +} + +// VolumeAttachmentInterface has methods to work with VolumeAttachment resources. +type VolumeAttachmentInterface interface { + Create(*v1.VolumeAttachment) (*v1.VolumeAttachment, error) + Update(*v1.VolumeAttachment) (*v1.VolumeAttachment, error) + UpdateStatus(*v1.VolumeAttachment) (*v1.VolumeAttachment, error) + Delete(name string, options *metav1.DeleteOptions) error + DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error + Get(name string, options metav1.GetOptions) (*v1.VolumeAttachment, error) + List(opts metav1.ListOptions) (*v1.VolumeAttachmentList, error) + Watch(opts metav1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.VolumeAttachment, err error) + VolumeAttachmentExpansion +} + +// volumeAttachments implements VolumeAttachmentInterface +type volumeAttachments struct { + client rest.Interface +} + +// newVolumeAttachments returns a VolumeAttachments +func newVolumeAttachments(c *StorageV1Client) *volumeAttachments { + return &volumeAttachments{ + client: c.RESTClient(), + } +} + +// Get takes name of the volumeAttachment, and returns the corresponding volumeAttachment object, and an error if there is any. +func (c *volumeAttachments) Get(name string, options metav1.GetOptions) (result *v1.VolumeAttachment, err error) { + result = &v1.VolumeAttachment{} + err = c.client.Get(). + Resource("volumeattachments"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. +func (c *volumeAttachments) List(opts metav1.ListOptions) (result *v1.VolumeAttachmentList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.VolumeAttachmentList{} + err = c.client.Get(). + Resource("volumeattachments"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested volumeAttachments. +func (c *volumeAttachments) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("volumeattachments"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch() +} + +// Create takes the representation of a volumeAttachment and creates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. +func (c *volumeAttachments) Create(volumeAttachment *v1.VolumeAttachment) (result *v1.VolumeAttachment, err error) { + result = &v1.VolumeAttachment{} + err = c.client.Post(). + Resource("volumeattachments"). + Body(volumeAttachment). + Do(). + Into(result) + return +} + +// Update takes the representation of a volumeAttachment and updates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. +func (c *volumeAttachments) Update(volumeAttachment *v1.VolumeAttachment) (result *v1.VolumeAttachment, err error) { + result = &v1.VolumeAttachment{} + err = c.client.Put(). + Resource("volumeattachments"). + Name(volumeAttachment.Name). + Body(volumeAttachment). + Do(). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + +func (c *volumeAttachments) UpdateStatus(volumeAttachment *v1.VolumeAttachment) (result *v1.VolumeAttachment, err error) { + result = &v1.VolumeAttachment{} + err = c.client.Put(). + Resource("volumeattachments"). + Name(volumeAttachment.Name). + SubResource("status"). + Body(volumeAttachment). + Do(). + Into(result) + return +} + +// Delete takes name of the volumeAttachment and deletes it. Returns an error if one occurs. +func (c *volumeAttachments) Delete(name string, options *metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("volumeattachments"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *volumeAttachments) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("volumeattachments"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched volumeAttachment. +func (c *volumeAttachments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.VolumeAttachment, err error) { + result = &v1.VolumeAttachment{} + err = c.client.Patch(pt). + Resource("volumeattachments"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/volumeattachment.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/volumeattachment.go index e6af0018..7fef94e8 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/volumeattachment.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/volumeattachment.go @@ -19,6 +19,8 @@ limitations under the License. package v1alpha1 import ( + "time" + v1alpha1 "k8s.io/api/storage/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -73,10 +75,15 @@ func (c *volumeAttachments) Get(name string, options v1.GetOptions) (result *v1a // List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. func (c *volumeAttachments) List(opts v1.ListOptions) (result *v1alpha1.VolumeAttachmentList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1alpha1.VolumeAttachmentList{} err = c.client.Get(). Resource("volumeattachments"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -84,10 +91,15 @@ func (c *volumeAttachments) List(opts v1.ListOptions) (result *v1alpha1.VolumeAt // Watch returns a watch.Interface that watches the requested volumeAttachments. func (c *volumeAttachments) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Resource("volumeattachments"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -141,9 +153,14 @@ func (c *volumeAttachments) Delete(name string, options *v1.DeleteOptions) error // DeleteCollection deletes a collection of objects. func (c *volumeAttachments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Resource("volumeattachments"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storageclass.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storageclass.go index fbe1fd4c..8a8f3891 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storageclass.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storageclass.go @@ -19,6 +19,8 @@ limitations under the License. package v1beta1 import ( + "time" + v1beta1 "k8s.io/api/storage/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -72,10 +74,15 @@ func (c *storageClasses) Get(name string, options v1.GetOptions) (result *v1beta // List takes label and field selectors, and returns the list of StorageClasses that match those selectors. func (c *storageClasses) List(opts v1.ListOptions) (result *v1beta1.StorageClassList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1beta1.StorageClassList{} err = c.client.Get(). Resource("storageclasses"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -83,10 +90,15 @@ func (c *storageClasses) List(opts v1.ListOptions) (result *v1beta1.StorageClass // Watch returns a watch.Interface that watches the requested storageClasses. func (c *storageClasses) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Resource("storageclasses"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -125,9 +137,14 @@ func (c *storageClasses) Delete(name string, options *v1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *storageClasses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Resource("storageclasses"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/volumeattachment.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/volumeattachment.go index 5cd2d391..d319407f 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/volumeattachment.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/volumeattachment.go @@ -19,6 +19,8 @@ limitations under the License. package v1beta1 import ( + "time" + v1beta1 "k8s.io/api/storage/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -73,10 +75,15 @@ func (c *volumeAttachments) Get(name string, options v1.GetOptions) (result *v1b // List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. func (c *volumeAttachments) List(opts v1.ListOptions) (result *v1beta1.VolumeAttachmentList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1beta1.VolumeAttachmentList{} err = c.client.Get(). Resource("volumeattachments"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -84,10 +91,15 @@ func (c *volumeAttachments) List(opts v1.ListOptions) (result *v1beta1.VolumeAtt // Watch returns a watch.Interface that watches the requested volumeAttachments. func (c *volumeAttachments) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Resource("volumeattachments"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -141,9 +153,14 @@ func (c *volumeAttachments) Delete(name string, options *v1.DeleteOptions) error // DeleteCollection deletes a collection of objects. func (c *volumeAttachments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Resource("volumeattachments"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/client-go/kubernetes_test/timeout_test.go b/vendor/k8s.io/client-go/kubernetes_test/timeout_test.go new file mode 100644 index 00000000..055fb490 --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes_test/timeout_test.go @@ -0,0 +1,60 @@ +/* +Copyright 2018 The Kubernetes Authors. + +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 kubernetes_test + +import ( + "bytes" + "io/ioutil" + "net/http" + "testing" + + "github.com/davecgh/go-spew/spew" + + appsv1 "k8s.io/api/apps/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes" + "k8s.io/client-go/kubernetes/scheme" + "k8s.io/client-go/rest" + manualfake "k8s.io/client-go/rest/fake" +) + +func TestListTimeout(t *testing.T) { + fakeClient := &manualfake.RESTClient{ + GroupVersion: appsv1.SchemeGroupVersion, + NegotiatedSerializer: scheme.Codecs, + Client: manualfake.CreateHTTPClient(func(req *http.Request) (*http.Response, error) { + if req.URL.Query().Get("timeout") != "21s" { + t.Fatal(spew.Sdump(req.URL.Query())) + } + return &http.Response{StatusCode: http.StatusNotFound, Body: ioutil.NopCloser(&bytes.Buffer{})}, nil + }), + } + clientConfig := &rest.Config{ + APIPath: "/apis", + ContentConfig: rest.ContentConfig{ + NegotiatedSerializer: scheme.Codecs, + GroupVersion: &appsv1.SchemeGroupVersion, + }, + } + restClient, _ := rest.RESTClientFor(clientConfig) + restClient.Client = fakeClient.Client + realClient := kubernetes.New(restClient) + + timeout := int64(21) + realClient.AppsV1().DaemonSets("").List(metav1.ListOptions{TimeoutSeconds: &timeout}) + realClient.AppsV1().DaemonSets("").Watch(metav1.ListOptions{TimeoutSeconds: &timeout}) +} diff --git a/vendor/k8s.io/client-go/listers/policy/v1beta1/poddisruptionbudget_expansion.go b/vendor/k8s.io/client-go/listers/policy/v1beta1/poddisruptionbudget_expansion.go index c0ab9d3e..d07d11a9 100644 --- a/vendor/k8s.io/client-go/listers/policy/v1beta1/poddisruptionbudget_expansion.go +++ b/vendor/k8s.io/client-go/listers/policy/v1beta1/poddisruptionbudget_expansion.go @@ -19,11 +19,11 @@ package v1beta1 import ( "fmt" - "github.com/golang/glog" "k8s.io/api/core/v1" policy "k8s.io/api/policy/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" + "k8s.io/klog" ) // PodDisruptionBudgetListerExpansion allows custom methods to be added to @@ -54,7 +54,7 @@ func (s *podDisruptionBudgetLister) GetPodPodDisruptionBudgets(pod *v1.Pod) ([]* pdb := list[i] selector, err = metav1.LabelSelectorAsSelector(pdb.Spec.Selector) if err != nil { - glog.Warningf("invalid selector: %v", err) + klog.Warningf("invalid selector: %v", err) // TODO(mml): add an event to the PDB continue } diff --git a/vendor/k8s.io/client-go/listers/storage/v1/expansion_generated.go b/vendor/k8s.io/client-go/listers/storage/v1/expansion_generated.go index d9324706..9d7d8887 100644 --- a/vendor/k8s.io/client-go/listers/storage/v1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/storage/v1/expansion_generated.go @@ -21,3 +21,7 @@ package v1 // StorageClassListerExpansion allows custom methods to be added to // StorageClassLister. type StorageClassListerExpansion interface{} + +// VolumeAttachmentListerExpansion allows custom methods to be added to +// VolumeAttachmentLister. +type VolumeAttachmentListerExpansion interface{} diff --git a/vendor/k8s.io/client-go/listers/storage/v1/volumeattachment.go b/vendor/k8s.io/client-go/listers/storage/v1/volumeattachment.go new file mode 100644 index 00000000..14888812 --- /dev/null +++ b/vendor/k8s.io/client-go/listers/storage/v1/volumeattachment.go @@ -0,0 +1,65 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/storage/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// VolumeAttachmentLister helps list VolumeAttachments. +type VolumeAttachmentLister interface { + // List lists all VolumeAttachments in the indexer. + List(selector labels.Selector) (ret []*v1.VolumeAttachment, err error) + // Get retrieves the VolumeAttachment from the index for a given name. + Get(name string) (*v1.VolumeAttachment, error) + VolumeAttachmentListerExpansion +} + +// volumeAttachmentLister implements the VolumeAttachmentLister interface. +type volumeAttachmentLister struct { + indexer cache.Indexer +} + +// NewVolumeAttachmentLister returns a new VolumeAttachmentLister. +func NewVolumeAttachmentLister(indexer cache.Indexer) VolumeAttachmentLister { + return &volumeAttachmentLister{indexer: indexer} +} + +// List lists all VolumeAttachments in the indexer. +func (s *volumeAttachmentLister) List(selector labels.Selector) (ret []*v1.VolumeAttachment, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.VolumeAttachment)) + }) + return ret, err +} + +// Get retrieves the VolumeAttachment from the index for a given name. +func (s *volumeAttachmentLister) Get(name string) (*v1.VolumeAttachment, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("volumeattachment"), name) + } + return obj.(*v1.VolumeAttachment), nil +} diff --git a/vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/azure.go b/vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/azure.go index 9858963e..d42449fc 100644 --- a/vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/azure.go +++ b/vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/azure.go @@ -27,7 +27,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/adal" "github.com/Azure/go-autorest/autorest/azure" - "github.com/golang/glog" + "k8s.io/klog" "k8s.io/apimachinery/pkg/util/net" restclient "k8s.io/client-go/rest" @@ -50,7 +50,7 @@ const ( func init() { if err := restclient.RegisterAuthProviderPlugin("azure", newAzureAuthProvider); err != nil { - glog.Fatalf("Failed to register azure auth plugin: %v", err) + klog.Fatalf("Failed to register azure auth plugin: %v", err) } } @@ -124,7 +124,7 @@ func (r *azureRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) token, err := r.tokenSource.Token() if err != nil { - glog.Errorf("Failed to acquire a token: %v", err) + klog.Errorf("Failed to acquire a token: %v", err) return nil, fmt.Errorf("acquiring a token for authorization header: %v", err) } diff --git a/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go b/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go index cae9d0d6..4d725265 100644 --- a/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go +++ b/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go @@ -31,7 +31,6 @@ import ( "sync" "time" - "github.com/golang/glog" "golang.org/x/crypto/ssh/terminal" "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -44,6 +43,7 @@ import ( "k8s.io/client-go/tools/clientcmd/api" "k8s.io/client-go/transport" "k8s.io/client-go/util/connrotation" + "k8s.io/klog" ) const execInfoEnv = "KUBERNETES_EXEC_INFO" @@ -228,7 +228,7 @@ func (r *roundTripper) RoundTrip(req *http.Request) (*http.Response, error) { Code: int32(res.StatusCode), } if err := r.a.maybeRefreshCreds(creds, resp); err != nil { - glog.Errorf("refreshing credentials: %v", err) + klog.Errorf("refreshing credentials: %v", err) } } return res, nil diff --git a/vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/gcp.go b/vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/gcp.go index 2bc6c447..e44c2ada 100644 --- a/vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/gcp.go +++ b/vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/gcp.go @@ -27,18 +27,18 @@ import ( "sync" "time" - "github.com/golang/glog" "golang.org/x/oauth2" "golang.org/x/oauth2/google" "k8s.io/apimachinery/pkg/util/net" "k8s.io/apimachinery/pkg/util/yaml" restclient "k8s.io/client-go/rest" "k8s.io/client-go/util/jsonpath" + "k8s.io/klog" ) func init() { if err := restclient.RegisterAuthProviderPlugin("gcp", newGCPAuthProvider); err != nil { - glog.Fatalf("Failed to register gcp auth plugin: %v", err) + klog.Fatalf("Failed to register gcp auth plugin: %v", err) } } @@ -223,7 +223,7 @@ func (t *cachedTokenSource) Token() (*oauth2.Token, error) { cache := t.update(tok) if t.persister != nil { if err := t.persister.Persist(cache); err != nil { - glog.V(4).Infof("Failed to persist token: %v", err) + klog.V(4).Infof("Failed to persist token: %v", err) } } return tok, nil @@ -329,7 +329,7 @@ func (c *commandTokenSource) parseTokenCmdOutput(output []byte) (*oauth2.Token, } var expiry time.Time if t, err := time.Parse(c.timeFmt, expiryStr); err != nil { - glog.V(4).Infof("Failed to parse token expiry from %s (fmt=%s): %v", expiryStr, c.timeFmt, err) + klog.V(4).Infof("Failed to parse token expiry from %s (fmt=%s): %v", expiryStr, c.timeFmt, err) } else { expiry = t } @@ -373,7 +373,7 @@ func (t *conditionalTransport) RoundTrip(req *http.Request) (*http.Response, err } if res.StatusCode == 401 { - glog.V(4).Infof("The credentials that were supplied are invalid for the target cluster") + klog.V(4).Infof("The credentials that were supplied are invalid for the target cluster") t.persister.Persist(t.resetCache) } diff --git a/vendor/k8s.io/client-go/plugin/pkg/client/auth/oidc/oidc.go b/vendor/k8s.io/client-go/plugin/pkg/client/auth/oidc/oidc.go index 9c3ea0ab..1383a97c 100644 --- a/vendor/k8s.io/client-go/plugin/pkg/client/auth/oidc/oidc.go +++ b/vendor/k8s.io/client-go/plugin/pkg/client/auth/oidc/oidc.go @@ -28,10 +28,10 @@ import ( "sync" "time" - "github.com/golang/glog" "golang.org/x/oauth2" "k8s.io/apimachinery/pkg/util/net" restclient "k8s.io/client-go/rest" + "k8s.io/klog" ) const ( @@ -49,7 +49,7 @@ const ( func init() { if err := restclient.RegisterAuthProviderPlugin("oidc", newOIDCAuthProvider); err != nil { - glog.Fatalf("Failed to register oidc auth plugin: %v", err) + klog.Fatalf("Failed to register oidc auth plugin: %v", err) } } @@ -124,7 +124,7 @@ func newOIDCAuthProvider(_ string, cfg map[string]string, persister restclient.A } if len(cfg[cfgExtraScopes]) > 0 { - glog.V(2).Infof("%s auth provider field depricated, refresh request don't send scopes", + klog.V(2).Infof("%s auth provider field depricated, refresh request don't send scopes", cfgExtraScopes) } diff --git a/vendor/k8s.io/client-go/plugin/pkg/client/auth/openstack/openstack.go b/vendor/k8s.io/client-go/plugin/pkg/client/auth/openstack/openstack.go index e6d7f049..fab5104e 100644 --- a/vendor/k8s.io/client-go/plugin/pkg/client/auth/openstack/openstack.go +++ b/vendor/k8s.io/client-go/plugin/pkg/client/auth/openstack/openstack.go @@ -22,9 +22,9 @@ import ( "sync" "time" - "github.com/golang/glog" "github.com/gophercloud/gophercloud" "github.com/gophercloud/gophercloud/openstack" + "k8s.io/klog" "k8s.io/apimachinery/pkg/util/net" restclient "k8s.io/client-go/rest" @@ -32,7 +32,7 @@ import ( func init() { if err := restclient.RegisterAuthProviderPlugin("openstack", newOpenstackAuthProvider); err != nil { - glog.Fatalf("Failed to register openstack auth plugin: %s", err) + klog.Fatalf("Failed to register openstack auth plugin: %s", err) } } @@ -62,7 +62,7 @@ func (t *tokenGetter) Token() (string, error) { var err error if t.authOpt == nil { // reads the config from the environment - glog.V(4).Info("reading openstack config from the environment variables") + klog.V(4).Info("reading openstack config from the environment variables") options, err = openstack.AuthOptionsFromEnv() if err != nil { return "", fmt.Errorf("failed to read openstack env vars: %s", err) @@ -126,7 +126,7 @@ func (t *tokenRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) if err == nil { req.Header.Set("Authorization", "Bearer "+token) } else { - glog.V(4).Infof("failed to get token: %s", err) + klog.V(4).Infof("failed to get token: %s", err) } return t.RoundTripper.RoundTrip(req) @@ -140,7 +140,7 @@ func newOpenstackAuthProvider(_ string, config map[string]string, persister rest var ttlDuration time.Duration var err error - glog.Warningf("WARNING: in-tree openstack auth plugin is now deprecated. please use the \"client-keystone-auth\" kubectl/client-go credential plugin instead") + klog.Warningf("WARNING: in-tree openstack auth plugin is now deprecated. please use the \"client-keystone-auth\" kubectl/client-go credential plugin instead") ttl, found := config["ttl"] if !found { ttlDuration = DefaultTTLDuration diff --git a/vendor/k8s.io/client-go/rest/config.go b/vendor/k8s.io/client-go/rest/config.go index d5ef8406..438eb3be 100644 --- a/vendor/k8s.io/client-go/rest/config.go +++ b/vendor/k8s.io/client-go/rest/config.go @@ -29,7 +29,6 @@ import ( "strings" "time" - "github.com/golang/glog" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" @@ -37,6 +36,7 @@ import ( clientcmdapi "k8s.io/client-go/tools/clientcmd/api" certutil "k8s.io/client-go/util/cert" "k8s.io/client-go/util/flowcontrol" + "k8s.io/klog" ) const ( @@ -331,7 +331,7 @@ func InClusterConfig() (*Config, error) { tlsClientConfig := TLSClientConfig{} if _, err := certutil.NewPool(rootCAFile); err != nil { - glog.Errorf("Expected to load root CA config from %s, but got err: %v", rootCAFile, err) + klog.Errorf("Expected to load root CA config from %s, but got err: %v", rootCAFile, err) } else { tlsClientConfig.CAFile = rootCAFile } diff --git a/vendor/k8s.io/client-go/rest/plugin.go b/vendor/k8s.io/client-go/rest/plugin.go index cf8fbabf..83ef5ae3 100644 --- a/vendor/k8s.io/client-go/rest/plugin.go +++ b/vendor/k8s.io/client-go/rest/plugin.go @@ -21,7 +21,7 @@ import ( "net/http" "sync" - "github.com/golang/glog" + "k8s.io/klog" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" ) @@ -57,7 +57,7 @@ func RegisterAuthProviderPlugin(name string, plugin Factory) error { if _, found := plugins[name]; found { return fmt.Errorf("Auth Provider Plugin %q was registered twice", name) } - glog.V(4).Infof("Registered Auth Provider Plugin %q", name) + klog.V(4).Infof("Registered Auth Provider Plugin %q", name) plugins[name] = plugin return nil } diff --git a/vendor/k8s.io/client-go/rest/request.go b/vendor/k8s.io/client-go/rest/request.go index 9bb31144..64901fba 100644 --- a/vendor/k8s.io/client-go/rest/request.go +++ b/vendor/k8s.io/client-go/rest/request.go @@ -32,7 +32,6 @@ import ( "strings" "time" - "github.com/golang/glog" "golang.org/x/net/http2" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -44,6 +43,7 @@ import ( restclientwatch "k8s.io/client-go/rest/watch" "k8s.io/client-go/tools/metrics" "k8s.io/client-go/util/flowcontrol" + "k8s.io/klog" ) var ( @@ -114,7 +114,7 @@ type Request struct { // NewRequest creates a new request helper object for accessing runtime.Objects on a server. func NewRequest(client HTTPClient, verb string, baseURL *url.URL, versionedAPIPath string, content ContentConfig, serializers Serializers, backoff BackoffManager, throttle flowcontrol.RateLimiter, timeout time.Duration) *Request { if backoff == nil { - glog.V(2).Infof("Not implementing request backoff strategy.") + klog.V(2).Infof("Not implementing request backoff strategy.") backoff = &NoBackoff{} } @@ -527,7 +527,7 @@ func (r *Request) tryThrottle() { r.throttle.Accept() } if latency := time.Since(now); latency > longThrottleLatency { - glog.V(4).Infof("Throttling request took %v, request: %s:%s", latency, r.verb, r.URL().String()) + klog.V(4).Infof("Throttling request took %v, request: %s:%s", latency, r.verb, r.URL().String()) } } @@ -683,7 +683,7 @@ func (r *Request) request(fn func(*http.Request, *http.Response)) error { }() if r.err != nil { - glog.V(4).Infof("Error in request: %v", r.err) + klog.V(4).Infof("Error in request: %v", r.err) return r.err } @@ -770,13 +770,13 @@ func (r *Request) request(fn func(*http.Request, *http.Response)) error { if seeker, ok := r.body.(io.Seeker); ok && r.body != nil { _, err := seeker.Seek(0, 0) if err != nil { - glog.V(4).Infof("Could not retry request, can't Seek() back to beginning of body for %T", r.body) + klog.V(4).Infof("Could not retry request, can't Seek() back to beginning of body for %T", r.body) fn(req, resp) return true } } - glog.V(4).Infof("Got a Retry-After %ds response for attempt %d to %v", seconds, retries, url) + klog.V(4).Infof("Got a Retry-After %ds response for attempt %d to %v", seconds, retries, url) r.backoffMgr.Sleep(time.Duration(seconds) * time.Second) return false } @@ -844,13 +844,13 @@ func (r *Request) transformResponse(resp *http.Response, req *http.Request) Resu // 2. Apiserver sends back the headers and then part of the body // 3. Apiserver closes connection. // 4. client-go should catch this and return an error. - glog.V(2).Infof("Stream error %#v when reading response body, may be caused by closed connection.", err) + klog.V(2).Infof("Stream error %#v when reading response body, may be caused by closed connection.", err) streamErr := fmt.Errorf("Stream error %#v when reading response body, may be caused by closed connection. Please retry.", err) return Result{ err: streamErr, } default: - glog.Errorf("Unexpected error when reading response body: %#v", err) + klog.Errorf("Unexpected error when reading response body: %#v", err) unexpectedErr := fmt.Errorf("Unexpected error %#v when reading response body. Please retry.", err) return Result{ err: unexpectedErr, @@ -914,11 +914,11 @@ func (r *Request) transformResponse(resp *http.Response, req *http.Request) Resu func truncateBody(body string) string { max := 0 switch { - case bool(glog.V(10)): + case bool(klog.V(10)): return body - case bool(glog.V(9)): + case bool(klog.V(9)): max = 10240 - case bool(glog.V(8)): + case bool(klog.V(8)): max = 1024 } @@ -933,13 +933,13 @@ func truncateBody(body string) string { // allocating a new string for the body output unless necessary. Uses a simple heuristic to determine // whether the body is printable. func glogBody(prefix string, body []byte) { - if glog.V(8) { + if klog.V(8) { if bytes.IndexFunc(body, func(r rune) bool { return r < 0x0a }) != -1 { - glog.Infof("%s:\n%s", prefix, truncateBody(hex.Dump(body))) + klog.Infof("%s:\n%s", prefix, truncateBody(hex.Dump(body))) } else { - glog.Infof("%s: %s", prefix, truncateBody(string(body))) + klog.Infof("%s: %s", prefix, truncateBody(string(body))) } } } @@ -1141,7 +1141,7 @@ func (r Result) Error() error { // to be backwards compatible with old servers that do not return a version, default to "v1" out, _, err := r.decoder.Decode(r.body, &schema.GroupVersionKind{Version: "v1"}, nil) if err != nil { - glog.V(5).Infof("body was not decodable (unable to check for Status): %v", err) + klog.V(5).Infof("body was not decodable (unable to check for Status): %v", err) return r.err } switch t := out.(type) { diff --git a/vendor/k8s.io/client-go/rest/request_test.go b/vendor/k8s.io/client-go/rest/request_test.go index 2660c0be..a415f60a 100755 --- a/vendor/k8s.io/client-go/rest/request_test.go +++ b/vendor/k8s.io/client-go/rest/request_test.go @@ -35,7 +35,7 @@ import ( "testing" "time" - "github.com/golang/glog" + "k8s.io/klog" "k8s.io/api/core/v1" apiequality "k8s.io/apimachinery/pkg/api/equality" @@ -1855,6 +1855,10 @@ func buildString(length int) string { return string(s) } +func init() { + klog.InitFlags(nil) +} + func TestTruncateBody(t *testing.T) { tests := []struct { body string @@ -1904,7 +1908,7 @@ func TestTruncateBody(t *testing.T) { }, } - l := flag.Lookup("v").Value.(flag.Getter).Get().(glog.Level) + l := flag.Lookup("v").Value.(flag.Getter).Get().(klog.Level) for _, test := range tests { flag.Set("v", test.level) got := truncateBody(test.body) diff --git a/vendor/k8s.io/client-go/rest/token_source.go b/vendor/k8s.io/client-go/rest/token_source.go index e0a6eb7d..c251b5eb 100644 --- a/vendor/k8s.io/client-go/rest/token_source.go +++ b/vendor/k8s.io/client-go/rest/token_source.go @@ -24,8 +24,8 @@ import ( "sync" "time" - "github.com/golang/glog" "golang.org/x/oauth2" + "k8s.io/klog" ) // TokenSourceWrapTransport returns a WrapTransport that injects bearer tokens @@ -131,7 +131,7 @@ func (ts *cachingTokenSource) Token() (*oauth2.Token, error) { if ts.tok == nil { return nil, err } - glog.Errorf("Unable to rotate token: %v", err) + klog.Errorf("Unable to rotate token: %v", err) return ts.tok, nil } diff --git a/vendor/k8s.io/client-go/rest/urlbackoff.go b/vendor/k8s.io/client-go/rest/urlbackoff.go index eff848ab..d00e42f8 100644 --- a/vendor/k8s.io/client-go/rest/urlbackoff.go +++ b/vendor/k8s.io/client-go/rest/urlbackoff.go @@ -20,9 +20,9 @@ import ( "net/url" "time" - "github.com/golang/glog" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/client-go/util/flowcontrol" + "k8s.io/klog" ) // Set of resp. Codes that we backoff for. @@ -64,7 +64,7 @@ func (n *NoBackoff) Sleep(d time.Duration) { // Disable makes the backoff trivial, i.e., sets it to zero. This might be used // by tests which want to run 1000s of mock requests without slowing down. func (b *URLBackoff) Disable() { - glog.V(4).Infof("Disabling backoff strategy") + klog.V(4).Infof("Disabling backoff strategy") b.Backoff = flowcontrol.NewBackOff(0*time.Second, 0*time.Second) } @@ -76,7 +76,7 @@ func (b *URLBackoff) baseUrlKey(rawurl *url.URL) string { // in the future. host, err := url.Parse(rawurl.String()) if err != nil { - glog.V(4).Infof("Error extracting url: %v", rawurl) + klog.V(4).Infof("Error extracting url: %v", rawurl) panic("bad url!") } return host.Host @@ -89,7 +89,7 @@ func (b *URLBackoff) UpdateBackoff(actualUrl *url.URL, err error, responseCode i b.Backoff.Next(b.baseUrlKey(actualUrl), b.Backoff.Clock.Now()) return } else if responseCode >= 300 || err != nil { - glog.V(4).Infof("Client is returning errors: code %v, error %v", responseCode, err) + klog.V(4).Infof("Client is returning errors: code %v, error %v", responseCode, err) } //If we got this far, there is no backoff required for this URL anymore. diff --git a/vendor/k8s.io/client-go/restmapper/discovery.go b/vendor/k8s.io/client-go/restmapper/discovery.go index aa158626..84491f4c 100644 --- a/vendor/k8s.io/client-go/restmapper/discovery.go +++ b/vendor/k8s.io/client-go/restmapper/discovery.go @@ -26,7 +26,7 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/discovery" - "github.com/golang/glog" + "k8s.io/klog" ) // APIGroupResources is an API group with a mapping of versions to @@ -212,7 +212,7 @@ func (d *DeferredDiscoveryRESTMapper) getDelegate() (meta.RESTMapper, error) { // Reset resets the internally cached Discovery information and will // cause the next mapping request to re-discover. func (d *DeferredDiscoveryRESTMapper) Reset() { - glog.V(5).Info("Invalidating discovery information") + klog.V(5).Info("Invalidating discovery information") d.initMu.Lock() defer d.initMu.Unlock() diff --git a/vendor/k8s.io/client-go/restmapper/shortcut.go b/vendor/k8s.io/client-go/restmapper/shortcut.go index d9f4be0b..6f3c9d93 100644 --- a/vendor/k8s.io/client-go/restmapper/shortcut.go +++ b/vendor/k8s.io/client-go/restmapper/shortcut.go @@ -19,7 +19,7 @@ package restmapper import ( "strings" - "github.com/golang/glog" + "k8s.io/klog" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -86,12 +86,12 @@ func (e shortcutExpander) getShortcutMappings() ([]*metav1.APIResourceList, []re // This can return an error *and* the results it was able to find. We don't need to fail on the error. apiResList, err := e.discoveryClient.ServerResources() if err != nil { - glog.V(1).Infof("Error loading discovery information: %v", err) + klog.V(1).Infof("Error loading discovery information: %v", err) } for _, apiResources := range apiResList { gv, err := schema.ParseGroupVersion(apiResources.GroupVersion) if err != nil { - glog.V(1).Infof("Unable to parse groupversion = %s due to = %s", apiResources.GroupVersion, err.Error()) + klog.V(1).Infof("Unable to parse groupversion = %s due to = %s", apiResources.GroupVersion, err.Error()) continue } for _, apiRes := range apiResources.APIResources { diff --git a/vendor/k8s.io/client-go/tools/cache/delta_fifo.go b/vendor/k8s.io/client-go/tools/cache/delta_fifo.go index 45c3b500..f818a293 100644 --- a/vendor/k8s.io/client-go/tools/cache/delta_fifo.go +++ b/vendor/k8s.io/client-go/tools/cache/delta_fifo.go @@ -23,7 +23,7 @@ import ( "k8s.io/apimachinery/pkg/util/sets" - "github.com/golang/glog" + "k8s.io/klog" ) // NewDeltaFIFO returns a Store which can be used process changes to items. @@ -320,17 +320,15 @@ func (f *DeltaFIFO) queueActionLocked(actionType DeltaType, obj interface{}) err newDeltas := append(f.items[id], Delta{actionType, obj}) newDeltas = dedupDeltas(newDeltas) - _, exists := f.items[id] if len(newDeltas) > 0 { - if !exists { + if _, exists := f.items[id]; !exists { f.queue = append(f.queue, id) } f.items[id] = newDeltas f.cond.Broadcast() - } else if exists { - // We need to remove this from our map (extra items - // in the queue are ignored if they are not in the - // map). + } else { + // We need to remove this from our map (extra items in the queue are + // ignored if they are not in the map). delete(f.items, id) } return nil @@ -348,9 +346,6 @@ func (f *DeltaFIFO) List() []interface{} { func (f *DeltaFIFO) listLocked() []interface{} { list := make([]interface{}, 0, len(f.items)) for _, item := range f.items { - // Copy item's slice so operations on this slice - // won't interfere with the object we return. - item = copyDeltas(item) list = append(list, item.Newest().Object) } return list @@ -398,10 +393,7 @@ func (f *DeltaFIFO) GetByKey(key string) (item interface{}, exists bool, err err func (f *DeltaFIFO) IsClosed() bool { f.closedLock.Lock() defer f.closedLock.Unlock() - if f.closed { - return true - } - return false + return f.closed } // Pop blocks until an item is added to the queue, and then returns it. If @@ -432,10 +424,10 @@ func (f *DeltaFIFO) Pop(process PopProcessFunc) (interface{}, error) { } id := f.queue[0] f.queue = f.queue[1:] - item, ok := f.items[id] if f.initialPopulationCount > 0 { f.initialPopulationCount-- } + item, ok := f.items[id] if !ok { // Item may have been deleted subsequently. continue @@ -506,10 +498,10 @@ func (f *DeltaFIFO) Replace(list []interface{}, resourceVersion string) error { deletedObj, exists, err := f.knownObjects.GetByKey(k) if err != nil { deletedObj = nil - glog.Errorf("Unexpected error %v during lookup of key %v, placing DeleteFinalStateUnknown marker without object", err, k) + klog.Errorf("Unexpected error %v during lookup of key %v, placing DeleteFinalStateUnknown marker without object", err, k) } else if !exists { deletedObj = nil - glog.Infof("Key %v does not exist in known objects store, placing DeleteFinalStateUnknown marker without object", k) + klog.Infof("Key %v does not exist in known objects store, placing DeleteFinalStateUnknown marker without object", k) } queuedDeletions++ if err := f.queueActionLocked(Deleted, DeletedFinalStateUnknown{k, deletedObj}); err != nil { @@ -553,10 +545,10 @@ func (f *DeltaFIFO) syncKey(key string) error { func (f *DeltaFIFO) syncKeyLocked(key string) error { obj, exists, err := f.knownObjects.GetByKey(key) if err != nil { - glog.Errorf("Unexpected error %v during lookup of key %v, unable to queue object for sync", err, key) + klog.Errorf("Unexpected error %v during lookup of key %v, unable to queue object for sync", err, key) return nil } else if !exists { - glog.Infof("Key %v does not exist in known objects store, unable to queue object for sync", key) + klog.Infof("Key %v does not exist in known objects store, unable to queue object for sync", key) return nil } diff --git a/vendor/k8s.io/client-go/tools/cache/expiration_cache.go b/vendor/k8s.io/client-go/tools/cache/expiration_cache.go index d284453e..b38fe70b 100644 --- a/vendor/k8s.io/client-go/tools/cache/expiration_cache.go +++ b/vendor/k8s.io/client-go/tools/cache/expiration_cache.go @@ -20,8 +20,8 @@ import ( "sync" "time" - "github.com/golang/glog" "k8s.io/apimachinery/pkg/util/clock" + "k8s.io/klog" ) // ExpirationCache implements the store interface @@ -95,7 +95,7 @@ func (c *ExpirationCache) getOrExpire(key string) (interface{}, bool) { return nil, false } if c.expirationPolicy.IsExpired(timestampedItem) { - glog.V(4).Infof("Entry %v: %+v has expired", key, timestampedItem.obj) + klog.V(4).Infof("Entry %v: %+v has expired", key, timestampedItem.obj) c.cacheStorage.Delete(key) return nil, false } diff --git a/vendor/k8s.io/client-go/tools/cache/listers.go b/vendor/k8s.io/client-go/tools/cache/listers.go index 27d51a6b..ce377329 100644 --- a/vendor/k8s.io/client-go/tools/cache/listers.go +++ b/vendor/k8s.io/client-go/tools/cache/listers.go @@ -17,7 +17,7 @@ limitations under the License. package cache import ( - "github.com/golang/glog" + "k8s.io/klog" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" @@ -60,7 +60,7 @@ func ListAllByNamespace(indexer Indexer, namespace string, selector labels.Selec items, err := indexer.Index(NamespaceIndex, &metav1.ObjectMeta{Namespace: namespace}) if err != nil { // Ignore error; do slow search without index. - glog.Warningf("can not retrieve list of objects using index : %v", err) + klog.Warningf("can not retrieve list of objects using index : %v", err) for _, m := range indexer.List() { metadata, err := meta.Accessor(m) if err != nil { diff --git a/vendor/k8s.io/client-go/tools/cache/mutation_cache.go b/vendor/k8s.io/client-go/tools/cache/mutation_cache.go index cbb6434e..4c6686e9 100644 --- a/vendor/k8s.io/client-go/tools/cache/mutation_cache.go +++ b/vendor/k8s.io/client-go/tools/cache/mutation_cache.go @@ -22,7 +22,7 @@ import ( "sync" "time" - "github.com/golang/glog" + "k8s.io/klog" "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/runtime" @@ -156,7 +156,7 @@ func (c *mutationCache) ByIndex(name string, indexKey string) ([]interface{}, er } elements, err := fn(updated) if err != nil { - glog.V(4).Infof("Unable to calculate an index entry for mutation cache entry %s: %v", key, err) + klog.V(4).Infof("Unable to calculate an index entry for mutation cache entry %s: %v", key, err) continue } for _, inIndex := range elements { diff --git a/vendor/k8s.io/client-go/tools/cache/mutation_detector.go b/vendor/k8s.io/client-go/tools/cache/mutation_detector.go index e2aa4484..adb5b8be 100644 --- a/vendor/k8s.io/client-go/tools/cache/mutation_detector.go +++ b/vendor/k8s.io/client-go/tools/cache/mutation_detector.go @@ -24,7 +24,7 @@ import ( "sync" "time" - "github.com/golang/glog" + "k8s.io/klog" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/diff" @@ -45,7 +45,7 @@ func NewCacheMutationDetector(name string) CacheMutationDetector { if !mutationDetectionEnabled { return dummyMutationDetector{} } - glog.Warningln("Mutation detector is enabled, this will result in memory leakage.") + klog.Warningln("Mutation detector is enabled, this will result in memory leakage.") return &defaultCacheMutationDetector{name: name, period: 1 * time.Second} } diff --git a/vendor/k8s.io/client-go/tools/cache/reflector.go b/vendor/k8s.io/client-go/tools/cache/reflector.go index 9ee7efcb..12e2a334 100644 --- a/vendor/k8s.io/client-go/tools/cache/reflector.go +++ b/vendor/k8s.io/client-go/tools/cache/reflector.go @@ -31,7 +31,6 @@ import ( "syscall" "time" - "github.com/golang/glog" apierrs "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -41,6 +40,7 @@ import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/watch" + "k8s.io/klog" ) // Reflector watches a specified resource and causes all changes to be reflected in the given store. @@ -128,7 +128,7 @@ var internalPackages = []string{"client-go/tools/cache/"} // Run starts a watch and handles watch events. Will restart the watch if it is closed. // Run will exit when stopCh is closed. func (r *Reflector) Run(stopCh <-chan struct{}) { - glog.V(3).Infof("Starting reflector %v (%s) from %s", r.expectedType, r.resyncPeriod, r.name) + klog.V(3).Infof("Starting reflector %v (%s) from %s", r.expectedType, r.resyncPeriod, r.name) wait.Until(func() { if err := r.ListAndWatch(stopCh); err != nil { utilruntime.HandleError(err) @@ -166,7 +166,7 @@ func (r *Reflector) resyncChan() (<-chan time.Time, func() bool) { // and then use the resource version to watch. // It returns error if ListAndWatch didn't even try to initialize watch. func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { - glog.V(3).Infof("Listing and watching %v from %s", r.expectedType, r.name) + klog.V(3).Infof("Listing and watching %v from %s", r.expectedType, r.name) var resourceVersion string // Explicitly set "0" as resource version - it's fine for the List() @@ -212,7 +212,7 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { return } if r.ShouldResync == nil || r.ShouldResync() { - glog.V(4).Infof("%s: forcing resync", r.name) + klog.V(4).Infof("%s: forcing resync", r.name) if err := r.store.Resync(); err != nil { resyncerrc <- err return @@ -246,7 +246,7 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { case io.EOF: // watch closed normally case io.ErrUnexpectedEOF: - glog.V(1).Infof("%s: Watch for %v closed with unexpected EOF: %v", r.name, r.expectedType, err) + klog.V(1).Infof("%s: Watch for %v closed with unexpected EOF: %v", r.name, r.expectedType, err) default: utilruntime.HandleError(fmt.Errorf("%s: Failed to watch %v: %v", r.name, r.expectedType, err)) } @@ -267,7 +267,7 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { if err := r.watchHandler(w, &resourceVersion, resyncerrc, stopCh); err != nil { if err != errorStopRequested { - glog.Warningf("%s: watch of %v ended with: %v", r.name, r.expectedType, err) + klog.Warningf("%s: watch of %v ended with: %v", r.name, r.expectedType, err) } return nil } @@ -354,7 +354,7 @@ loop: r.metrics.numberOfShortWatches.Inc() return fmt.Errorf("very short watch: %s: Unexpected watch close - watch lasted less than a second and no items received", r.name) } - glog.V(4).Infof("%s: Watch close - %v total %v items received", r.name, r.expectedType, eventCount) + klog.V(4).Infof("%s: Watch close - %v total %v items received", r.name, r.expectedType, eventCount) return nil } diff --git a/vendor/k8s.io/client-go/tools/cache/shared_informer.go b/vendor/k8s.io/client-go/tools/cache/shared_informer.go index f29a4b33..e91fc9e9 100644 --- a/vendor/k8s.io/client-go/tools/cache/shared_informer.go +++ b/vendor/k8s.io/client-go/tools/cache/shared_informer.go @@ -28,7 +28,7 @@ import ( "k8s.io/client-go/util/buffer" "k8s.io/client-go/util/retry" - "github.com/golang/glog" + "k8s.io/klog" ) // SharedInformer has a shared data cache and is capable of distributing notifications for changes @@ -116,11 +116,11 @@ func WaitForCacheSync(stopCh <-chan struct{}, cacheSyncs ...InformerSynced) bool }, stopCh) if err != nil { - glog.V(2).Infof("stop requested") + klog.V(2).Infof("stop requested") return false } - glog.V(4).Infof("caches populated") + klog.V(4).Infof("caches populated") return true } @@ -279,11 +279,11 @@ func determineResyncPeriod(desired, check time.Duration) time.Duration { return desired } if check == 0 { - glog.Warningf("The specified resyncPeriod %v is invalid because this shared informer doesn't support resyncing", desired) + klog.Warningf("The specified resyncPeriod %v is invalid because this shared informer doesn't support resyncing", desired) return 0 } if desired < check { - glog.Warningf("The specified resyncPeriod %v is being increased to the minimum resyncCheckPeriod %v", desired, check) + klog.Warningf("The specified resyncPeriod %v is being increased to the minimum resyncCheckPeriod %v", desired, check) return check } return desired @@ -296,19 +296,19 @@ func (s *sharedIndexInformer) AddEventHandlerWithResyncPeriod(handler ResourceEv defer s.startedLock.Unlock() if s.stopped { - glog.V(2).Infof("Handler %v was not added to shared informer because it has stopped already", handler) + klog.V(2).Infof("Handler %v was not added to shared informer because it has stopped already", handler) return } if resyncPeriod > 0 { if resyncPeriod < minimumResyncPeriod { - glog.Warningf("resyncPeriod %d is too small. Changing it to the minimum allowed value of %d", resyncPeriod, minimumResyncPeriod) + klog.Warningf("resyncPeriod %d is too small. Changing it to the minimum allowed value of %d", resyncPeriod, minimumResyncPeriod) resyncPeriod = minimumResyncPeriod } if resyncPeriod < s.resyncCheckPeriod { if s.started { - glog.Warningf("resyncPeriod %d is smaller than resyncCheckPeriod %d and the informer has already started. Changing it to %d", resyncPeriod, s.resyncCheckPeriod, s.resyncCheckPeriod) + klog.Warningf("resyncPeriod %d is smaller than resyncCheckPeriod %d and the informer has already started. Changing it to %d", resyncPeriod, s.resyncCheckPeriod, s.resyncCheckPeriod) resyncPeriod = s.resyncCheckPeriod } else { // if the event handler's resyncPeriod is smaller than the current resyncCheckPeriod, update diff --git a/vendor/k8s.io/client-go/tools/clientcmd/api/helpers_test.go b/vendor/k8s.io/client-go/tools/clientcmd/api/helpers_test.go index 7ec30e5d..48b3cec2 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/api/helpers_test.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/api/helpers_test.go @@ -23,7 +23,7 @@ import ( "reflect" "testing" - "github.com/ghodss/yaml" + "sigs.k8s.io/yaml" ) func newMergedConfig(certFile, certContent, keyFile, keyContent, caFile, caContent string, t *testing.T) Config { diff --git a/vendor/k8s.io/client-go/tools/clientcmd/api/types_test.go b/vendor/k8s.io/client-go/tools/clientcmd/api/types_test.go index bd348345..f7190d93 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/api/types_test.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/api/types_test.go @@ -19,7 +19,7 @@ package api import ( "fmt" - "github.com/ghodss/yaml" + "sigs.k8s.io/yaml" ) func Example_emptyConfig() { diff --git a/vendor/k8s.io/client-go/tools/clientcmd/client_config.go b/vendor/k8s.io/client-go/tools/clientcmd/client_config.go index e5dc921f..dea229c9 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/client_config.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/client_config.go @@ -24,8 +24,8 @@ import ( "os" "strings" - "github.com/golang/glog" "github.com/imdario/mergo" + "k8s.io/klog" restclient "k8s.io/client-go/rest" clientauth "k8s.io/client-go/tools/auth" @@ -545,12 +545,12 @@ func (config *inClusterClientConfig) Possible() bool { // to the default config. func BuildConfigFromFlags(masterUrl, kubeconfigPath string) (*restclient.Config, error) { if kubeconfigPath == "" && masterUrl == "" { - glog.Warningf("Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.") + klog.Warningf("Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.") kubeconfig, err := restclient.InClusterConfig() if err == nil { return kubeconfig, nil } - glog.Warning("error creating inClusterConfig, falling back to default config: ", err) + klog.Warning("error creating inClusterConfig, falling back to default config: ", err) } return NewNonInteractiveDeferredLoadingClientConfig( &ClientConfigLoadingRules{ExplicitPath: kubeconfigPath}, diff --git a/vendor/k8s.io/client-go/tools/clientcmd/config.go b/vendor/k8s.io/client-go/tools/clientcmd/config.go index 9495849b..b8cc3968 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/config.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/config.go @@ -24,7 +24,7 @@ import ( "reflect" "sort" - "github.com/golang/glog" + "k8s.io/klog" restclient "k8s.io/client-go/rest" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" @@ -483,7 +483,7 @@ func getConfigFromFile(filename string) (*clientcmdapi.Config, error) { func GetConfigFromFileOrDie(filename string) *clientcmdapi.Config { config, err := getConfigFromFile(filename) if err != nil { - glog.FatalDepth(1, err) + klog.FatalDepth(1, err) } return config diff --git a/vendor/k8s.io/client-go/tools/clientcmd/loader.go b/vendor/k8s.io/client-go/tools/clientcmd/loader.go index 6038c8d4..7e928a91 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/loader.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/loader.go @@ -27,8 +27,8 @@ import ( goruntime "runtime" "strings" - "github.com/golang/glog" "github.com/imdario/mergo" + "k8s.io/klog" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" @@ -356,7 +356,7 @@ func LoadFromFile(filename string) (*clientcmdapi.Config, error) { if err != nil { return nil, err } - glog.V(6).Infoln("Config loaded from file", filename) + klog.V(6).Infoln("Config loaded from file", filename) // set LocationOfOrigin on every Cluster, User, and Context for key, obj := range config.AuthInfos { diff --git a/vendor/k8s.io/client-go/tools/clientcmd/loader_test.go b/vendor/k8s.io/client-go/tools/clientcmd/loader_test.go index 86eccac4..461d970b 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/loader_test.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/loader_test.go @@ -26,7 +26,7 @@ import ( "strings" "testing" - "github.com/ghodss/yaml" + "sigs.k8s.io/yaml" "k8s.io/apimachinery/pkg/runtime" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" diff --git a/vendor/k8s.io/client-go/tools/clientcmd/merged_client_builder.go b/vendor/k8s.io/client-go/tools/clientcmd/merged_client_builder.go index 05038133..76380db8 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/merged_client_builder.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/merged_client_builder.go @@ -20,7 +20,7 @@ import ( "io" "sync" - "github.com/golang/glog" + "k8s.io/klog" restclient "k8s.io/client-go/rest" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" @@ -119,7 +119,7 @@ func (config *DeferredLoadingClientConfig) ClientConfig() (*restclient.Config, e // check for in-cluster configuration and use it if config.icc.Possible() { - glog.V(4).Infof("Using in-cluster configuration") + klog.V(4).Infof("Using in-cluster configuration") return config.icc.ClientConfig() } @@ -156,7 +156,7 @@ func (config *DeferredLoadingClientConfig) Namespace() (string, bool, error) { } } - glog.V(4).Infof("Using in-cluster namespace") + klog.V(4).Infof("Using in-cluster namespace") // allow the namespace from the service account token directory to be used. return config.icc.Namespace() diff --git a/vendor/k8s.io/client-go/tools/leaderelection/healthzadaptor.go b/vendor/k8s.io/client-go/tools/leaderelection/healthzadaptor.go new file mode 100644 index 00000000..b9353729 --- /dev/null +++ b/vendor/k8s.io/client-go/tools/leaderelection/healthzadaptor.go @@ -0,0 +1,69 @@ +/* +Copyright 2015 The Kubernetes Authors. + +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 leaderelection + +import ( + "net/http" + "sync" + "time" +) + +// HealthzAdaptor associates the /healthz endpoint with the LeaderElection object. +// It helps deal with the /healthz endpoint being set up prior to the LeaderElection. +// This contains the code needed to act as an adaptor between the leader +// election code the health check code. It allows us to provide health +// status about the leader election. Most specifically about if the leader +// has failed to renew without exiting the process. In that case we should +// report not healthy and rely on the kubelet to take down the process. +type HealthzAdaptor struct { + pointerLock sync.Mutex + le *LeaderElector + timeout time.Duration +} + +// Name returns the name of the health check we are implementing. +func (l *HealthzAdaptor) Name() string { + return "leaderElection" +} + +// Check is called by the healthz endpoint handler. +// It fails (returns an error) if we own the lease but had not been able to renew it. +func (l *HealthzAdaptor) Check(req *http.Request) error { + l.pointerLock.Lock() + defer l.pointerLock.Unlock() + if l.le == nil { + return nil + } + return l.le.Check(l.timeout) +} + +// SetLeaderElection ties a leader election object to a HealthzAdaptor +func (l *HealthzAdaptor) SetLeaderElection(le *LeaderElector) { + l.pointerLock.Lock() + defer l.pointerLock.Unlock() + l.le = le +} + +// NewLeaderHealthzAdaptor creates a basic healthz adaptor to monitor a leader election. +// timeout determines the time beyond the lease expiry to be allowed for timeout. +// checks within the timeout period after the lease expires will still return healthy. +func NewLeaderHealthzAdaptor(timeout time.Duration) *HealthzAdaptor { + result := &HealthzAdaptor{ + timeout: timeout, + } + return result +} diff --git a/vendor/k8s.io/client-go/tools/leaderelection/healthzadaptor_test.go b/vendor/k8s.io/client-go/tools/leaderelection/healthzadaptor_test.go new file mode 100644 index 00000000..746d4913 --- /dev/null +++ b/vendor/k8s.io/client-go/tools/leaderelection/healthzadaptor_test.go @@ -0,0 +1,175 @@ +/* +Copyright 2015 The Kubernetes Authors. + +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 leaderelection + +import ( + "fmt" + "testing" + "time" + + "k8s.io/apimachinery/pkg/util/clock" + rl "k8s.io/client-go/tools/leaderelection/resourcelock" + "net/http" +) + +type fakeLock struct { + identity string +} + +// Get is a dummy to allow us to have a fakeLock for testing. +func (fl *fakeLock) Get() (ler *rl.LeaderElectionRecord, err error) { + return nil, nil +} + +// Create is a dummy to allow us to have a fakeLock for testing. +func (fl *fakeLock) Create(ler rl.LeaderElectionRecord) error { + return nil +} + +// Update is a dummy to allow us to have a fakeLock for testing. +func (fl *fakeLock) Update(ler rl.LeaderElectionRecord) error { + return nil +} + +// RecordEvent is a dummy to allow us to have a fakeLock for testing. +func (fl *fakeLock) RecordEvent(string) {} + +// Identity is a dummy to allow us to have a fakeLock for testing. +func (fl *fakeLock) Identity() string { + return fl.identity +} + +// Describe is a dummy to allow us to have a fakeLock for testing. +func (fl *fakeLock) Describe() string { + return "Dummy implementation of lock for testing" +} + +// TestLeaderElectionHealthChecker tests that the healthcheck for leader election handles its edge cases. +func TestLeaderElectionHealthChecker(t *testing.T) { + current := time.Now() + req := &http.Request{} + + tests := []struct { + description string + expected error + adaptorTimeout time.Duration + elector *LeaderElector + }{ + { + description: "call check before leader elector initialized", + expected: nil, + adaptorTimeout: time.Second * 20, + elector: nil, + }, + { + description: "call check when the the lease is far expired", + expected: fmt.Errorf("failed election to renew leadership on lease %s", "foo"), + adaptorTimeout: time.Second * 20, + elector: &LeaderElector{ + config: LeaderElectionConfig{ + Lock: &fakeLock{identity: "healthTest"}, + LeaseDuration: time.Minute, + Name: "foo", + }, + observedRecord: rl.LeaderElectionRecord{ + HolderIdentity: "healthTest", + }, + observedTime: current, + clock: clock.NewFakeClock(current.Add(time.Hour)), + }, + }, + { + description: "call check when the the lease is far expired but held by another server", + expected: nil, + adaptorTimeout: time.Second * 20, + elector: &LeaderElector{ + config: LeaderElectionConfig{ + Lock: &fakeLock{identity: "healthTest"}, + LeaseDuration: time.Minute, + Name: "foo", + }, + observedRecord: rl.LeaderElectionRecord{ + HolderIdentity: "otherServer", + }, + observedTime: current, + clock: clock.NewFakeClock(current.Add(time.Hour)), + }, + }, + { + description: "call check when the the lease is not expired", + expected: nil, + adaptorTimeout: time.Second * 20, + elector: &LeaderElector{ + config: LeaderElectionConfig{ + Lock: &fakeLock{identity: "healthTest"}, + LeaseDuration: time.Minute, + Name: "foo", + }, + observedRecord: rl.LeaderElectionRecord{ + HolderIdentity: "healthTest", + }, + observedTime: current, + clock: clock.NewFakeClock(current), + }, + }, + { + description: "call check when the the lease is expired but inside the timeout", + expected: nil, + adaptorTimeout: time.Second * 20, + elector: &LeaderElector{ + config: LeaderElectionConfig{ + Lock: &fakeLock{identity: "healthTest"}, + LeaseDuration: time.Minute, + Name: "foo", + }, + observedRecord: rl.LeaderElectionRecord{ + HolderIdentity: "healthTest", + }, + observedTime: current, + clock: clock.NewFakeClock(current.Add(time.Minute).Add(time.Second)), + }, + }, + } + + for _, test := range tests { + adaptor := NewLeaderHealthzAdaptor(test.adaptorTimeout) + if adaptor.le != nil { + t.Errorf("[%s] leaderChecker started with a LeaderElector %v", test.description, adaptor.le) + } + if test.elector != nil { + test.elector.config.WatchDog = adaptor + adaptor.SetLeaderElection(test.elector) + if adaptor.le == nil { + t.Errorf("[%s] adaptor failed to set the LeaderElector", test.description) + } + } + err := adaptor.Check(req) + if test.expected == nil { + if err == nil { + continue + } + t.Errorf("[%s] called check, expected no error but received \"%v\"", test.description, err) + } else { + if err == nil { + t.Errorf("[%s] called check and failed to received the expected error \"%v\"", test.description, test.expected) + } + if err.Error() != test.expected.Error() { + t.Errorf("[%s] called check, expected %v, received %v", test.description, test.expected, err) + } + } + } +} diff --git a/vendor/k8s.io/client-go/tools/leaderelection/leaderelection.go b/vendor/k8s.io/client-go/tools/leaderelection/leaderelection.go index be52e85a..2096a599 100644 --- a/vendor/k8s.io/client-go/tools/leaderelection/leaderelection.go +++ b/vendor/k8s.io/client-go/tools/leaderelection/leaderelection.go @@ -56,11 +56,12 @@ import ( "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/clock" "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/wait" rl "k8s.io/client-go/tools/leaderelection/resourcelock" - "github.com/golang/glog" + "k8s.io/klog" ) const ( @@ -90,6 +91,7 @@ func NewLeaderElector(lec LeaderElectionConfig) (*LeaderElector, error) { } return &LeaderElector{ config: lec, + clock: clock.RealClock{}, }, nil } @@ -111,6 +113,13 @@ type LeaderElectionConfig struct { // Callbacks are callbacks that are triggered during certain lifecycle // events of the LeaderElector Callbacks LeaderCallbacks + + // WatchDog is the associated health checker + // WatchDog may be null if its not needed/configured. + WatchDog *HealthzAdaptor + + // Name is the name of the resource lock for debugging + Name string } // LeaderCallbacks are callbacks that are triggered during certain @@ -139,6 +148,12 @@ type LeaderElector struct { // value observedRecord.HolderIdentity if the transition has // not yet been reported. reportedLeader string + + // clock is wrapper around time to allow for less flaky testing + clock clock.Clock + + // name is the name of the resource lock for debugging + name string } // Run starts the leader election loop @@ -163,6 +178,9 @@ func RunOrDie(ctx context.Context, lec LeaderElectionConfig) { if err != nil { panic(err) } + if lec.WatchDog != nil { + lec.WatchDog.SetLeaderElection(le) + } le.Run(ctx) } @@ -184,16 +202,16 @@ func (le *LeaderElector) acquire(ctx context.Context) bool { defer cancel() succeeded := false desc := le.config.Lock.Describe() - glog.Infof("attempting to acquire leader lease %v...", desc) + klog.Infof("attempting to acquire leader lease %v...", desc) wait.JitterUntil(func() { succeeded = le.tryAcquireOrRenew() le.maybeReportTransition() if !succeeded { - glog.V(4).Infof("failed to acquire lease %v", desc) + klog.V(4).Infof("failed to acquire lease %v", desc) return } le.config.Lock.RecordEvent("became leader") - glog.Infof("successfully acquired lease %v", desc) + klog.Infof("successfully acquired lease %v", desc) cancel() }, le.config.RetryPeriod, JitterFactor, true, ctx.Done()) return succeeded @@ -224,11 +242,11 @@ func (le *LeaderElector) renew(ctx context.Context) { le.maybeReportTransition() desc := le.config.Lock.Describe() if err == nil { - glog.V(5).Infof("successfully renewed lease %v", desc) + klog.V(5).Infof("successfully renewed lease %v", desc) return } le.config.Lock.RecordEvent("stopped leading") - glog.Infof("failed to renew lease %v: %v", desc, err) + klog.Infof("failed to renew lease %v: %v", desc, err) cancel() }, le.config.RetryPeriod, ctx.Done()) } @@ -249,26 +267,26 @@ func (le *LeaderElector) tryAcquireOrRenew() bool { oldLeaderElectionRecord, err := le.config.Lock.Get() if err != nil { if !errors.IsNotFound(err) { - glog.Errorf("error retrieving resource lock %v: %v", le.config.Lock.Describe(), err) + klog.Errorf("error retrieving resource lock %v: %v", le.config.Lock.Describe(), err) return false } if err = le.config.Lock.Create(leaderElectionRecord); err != nil { - glog.Errorf("error initially creating leader election record: %v", err) + klog.Errorf("error initially creating leader election record: %v", err) return false } le.observedRecord = leaderElectionRecord - le.observedTime = time.Now() + le.observedTime = le.clock.Now() return true } // 2. Record obtained, check the Identity & Time if !reflect.DeepEqual(le.observedRecord, *oldLeaderElectionRecord) { le.observedRecord = *oldLeaderElectionRecord - le.observedTime = time.Now() + le.observedTime = le.clock.Now() } if le.observedTime.Add(le.config.LeaseDuration).After(now.Time) && !le.IsLeader() { - glog.V(4).Infof("lock is held by %v and has not yet expired", oldLeaderElectionRecord.HolderIdentity) + klog.V(4).Infof("lock is held by %v and has not yet expired", oldLeaderElectionRecord.HolderIdentity) return false } @@ -283,11 +301,11 @@ func (le *LeaderElector) tryAcquireOrRenew() bool { // update the lock itself if err = le.config.Lock.Update(leaderElectionRecord); err != nil { - glog.Errorf("Failed to update lock: %v", err) + klog.Errorf("Failed to update lock: %v", err) return false } le.observedRecord = leaderElectionRecord - le.observedTime = time.Now() + le.observedTime = le.clock.Now() return true } @@ -300,3 +318,19 @@ func (le *LeaderElector) maybeReportTransition() { go le.config.Callbacks.OnNewLeader(le.reportedLeader) } } + +// Check will determine if the current lease is expired by more than timeout. +func (le *LeaderElector) Check(maxTolerableExpiredLease time.Duration) error { + if !le.IsLeader() { + // Currently not concerned with the case that we are hot standby + return nil + } + // If we are more than timeout seconds after the lease duration that is past the timeout + // on the lease renew. Time to start reporting ourselves as unhealthy. We should have + // died but conditions like deadlock can prevent this. (See #70819) + if le.clock.Since(le.observedTime) > le.config.LeaseDuration+maxTolerableExpiredLease { + return fmt.Errorf("failed election to renew leadership on lease %s", le.config.Name) + } + + return nil +} diff --git a/vendor/k8s.io/client-go/tools/leaderelection/leaderelection_test.go b/vendor/k8s.io/client-go/tools/leaderelection/leaderelection_test.go index e99cf57a..842aebda 100644 --- a/vendor/k8s.io/client-go/tools/leaderelection/leaderelection_test.go +++ b/vendor/k8s.io/client-go/tools/leaderelection/leaderelection_test.go @@ -26,6 +26,7 @@ import ( "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/util/clock" fakecorev1 "k8s.io/client-go/kubernetes/typed/core/v1/fake" core "k8s.io/client-go/testing" rl "k8s.io/client-go/tools/leaderelection/resourcelock" @@ -257,6 +258,7 @@ func testTryAcquireOrRenew(t *testing.T, objectType string) { config: lec, observedRecord: test.observedRecord, observedTime: test.observedTime, + clock: clock.RealClock{}, } if test.expectSuccess != le.tryAcquireOrRenew() { diff --git a/vendor/k8s.io/client-go/tools/record/event.go b/vendor/k8s.io/client-go/tools/record/event.go index 168dfa80..2ee69589 100644 --- a/vendor/k8s.io/client-go/tools/record/event.go +++ b/vendor/k8s.io/client-go/tools/record/event.go @@ -33,7 +33,7 @@ import ( "net/http" - "github.com/golang/glog" + "k8s.io/klog" ) const maxTriesPerEvent = 12 @@ -144,7 +144,7 @@ func recordToSink(sink EventSink, event *v1.Event, eventCorrelator *EventCorrela } tries++ if tries >= maxTriesPerEvent { - glog.Errorf("Unable to write event '%#v' (retry limit exceeded!)", event) + klog.Errorf("Unable to write event '%#v' (retry limit exceeded!)", event) break } // Randomize the first sleep so that various clients won't all be @@ -194,13 +194,13 @@ func recordEvent(sink EventSink, event *v1.Event, patch []byte, updateExistingEv switch err.(type) { case *restclient.RequestConstructionError: // We will construct the request the same next time, so don't keep trying. - glog.Errorf("Unable to construct event '%#v': '%v' (will not retry!)", event, err) + klog.Errorf("Unable to construct event '%#v': '%v' (will not retry!)", event, err) return true case *errors.StatusError: if errors.IsAlreadyExists(err) { - glog.V(5).Infof("Server rejected event '%#v': '%v' (will not retry!)", event, err) + klog.V(5).Infof("Server rejected event '%#v': '%v' (will not retry!)", event, err) } else { - glog.Errorf("Server rejected event '%#v': '%v' (will not retry!)", event, err) + klog.Errorf("Server rejected event '%#v': '%v' (will not retry!)", event, err) } return true case *errors.UnexpectedObjectError: @@ -209,7 +209,7 @@ func recordEvent(sink EventSink, event *v1.Event, patch []byte, updateExistingEv default: // This case includes actual http transport errors. Go ahead and retry. } - glog.Errorf("Unable to write event: '%v' (may retry after sleeping)", err) + klog.Errorf("Unable to write event: '%v' (may retry after sleeping)", err) return false } @@ -256,12 +256,12 @@ type recorderImpl struct { func (recorder *recorderImpl) generateEvent(object runtime.Object, annotations map[string]string, timestamp metav1.Time, eventtype, reason, message string) { ref, err := ref.GetReference(recorder.scheme, object) if err != nil { - glog.Errorf("Could not construct reference to: '%#v' due to: '%v'. Will not report event: '%v' '%v' '%v'", object, err, eventtype, reason, message) + klog.Errorf("Could not construct reference to: '%#v' due to: '%v'. Will not report event: '%v' '%v' '%v'", object, err, eventtype, reason, message) return } if !validateEventType(eventtype) { - glog.Errorf("Unsupported event type: '%v'", eventtype) + klog.Errorf("Unsupported event type: '%v'", eventtype) return } diff --git a/vendor/k8s.io/client-go/tools/remotecommand/reader.go b/vendor/k8s.io/client-go/tools/remotecommand/reader.go new file mode 100644 index 00000000..d1f1be34 --- /dev/null +++ b/vendor/k8s.io/client-go/tools/remotecommand/reader.go @@ -0,0 +1,41 @@ +/* +Copyright 2018 The Kubernetes Authors. + +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 remotecommand + +import ( + "io" +) + +// readerWrapper delegates to an io.Reader so that only the io.Reader interface is implemented, +// to keep io.Copy from doing things we don't want when copying from the reader to the data stream. +// +// If the Stdin io.Reader provided to remotecommand implements a WriteTo function (like bytes.Buffer does[1]), +// io.Copy calls that method[2] to attempt to write the entire buffer to the stream in one call. +// That results in an oversized call to spdystream.Stream#Write [3], +// which results in a single oversized data frame[4] that is too large. +// +// [1] https://golang.org/pkg/bytes/#Buffer.WriteTo +// [2] https://golang.org/pkg/io/#Copy +// [3] https://github.com/kubernetes/kubernetes/blob/90295640ef87db9daa0144c5617afe889e7992b2/vendor/github.com/docker/spdystream/stream.go#L66-L73 +// [4] https://github.com/kubernetes/kubernetes/blob/90295640ef87db9daa0144c5617afe889e7992b2/vendor/github.com/docker/spdystream/spdy/write.go#L302-L304 +type readerWrapper struct { + reader io.Reader +} + +func (r readerWrapper) Read(p []byte) (int, error) { + return r.reader.Read(p) +} diff --git a/vendor/k8s.io/client-go/tools/remotecommand/remotecommand.go b/vendor/k8s.io/client-go/tools/remotecommand/remotecommand.go index d2b29861..892d8d10 100644 --- a/vendor/k8s.io/client-go/tools/remotecommand/remotecommand.go +++ b/vendor/k8s.io/client-go/tools/remotecommand/remotecommand.go @@ -22,7 +22,7 @@ import ( "net/http" "net/url" - "github.com/golang/glog" + "k8s.io/klog" "k8s.io/apimachinery/pkg/util/httpstream" "k8s.io/apimachinery/pkg/util/remotecommand" @@ -132,7 +132,7 @@ func (e *streamExecutor) Stream(options StreamOptions) error { case remotecommand.StreamProtocolV2Name: streamer = newStreamProtocolV2(options) case "": - glog.V(4).Infof("The server did not negotiate a streaming protocol version. Falling back to %s", remotecommand.StreamProtocolV1Name) + klog.V(4).Infof("The server did not negotiate a streaming protocol version. Falling back to %s", remotecommand.StreamProtocolV1Name) fallthrough case remotecommand.StreamProtocolV1Name: streamer = newStreamProtocolV1(options) diff --git a/vendor/k8s.io/client-go/tools/remotecommand/v1.go b/vendor/k8s.io/client-go/tools/remotecommand/v1.go index 92dad727..4120f1f5 100644 --- a/vendor/k8s.io/client-go/tools/remotecommand/v1.go +++ b/vendor/k8s.io/client-go/tools/remotecommand/v1.go @@ -22,9 +22,9 @@ import ( "io/ioutil" "net/http" - "github.com/golang/glog" "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/httpstream" + "k8s.io/klog" ) // streamProtocolV1 implements the first version of the streaming exec & attach @@ -53,10 +53,10 @@ func (p *streamProtocolV1) stream(conn streamCreator) error { errorChan := make(chan error) cp := func(s string, dst io.Writer, src io.Reader) { - glog.V(6).Infof("Copying %s", s) - defer glog.V(6).Infof("Done copying %s", s) + klog.V(6).Infof("Copying %s", s) + defer klog.V(6).Infof("Done copying %s", s) if _, err := io.Copy(dst, src); err != nil && err != io.EOF { - glog.Errorf("Error copying %s: %v", s, err) + klog.Errorf("Error copying %s: %v", s, err) } if s == v1.StreamTypeStdout || s == v1.StreamTypeStderr { doneChan <- struct{}{} @@ -127,7 +127,7 @@ func (p *streamProtocolV1) stream(conn streamCreator) error { // because stdin is not closed until the process exits. If we try to call // stdin.Close(), it returns no error but doesn't unblock the copy. It will // exit when the process exits, instead. - go cp(v1.StreamTypeStdin, p.remoteStdin, p.Stdin) + go cp(v1.StreamTypeStdin, p.remoteStdin, readerWrapper{p.Stdin}) } waitCount := 0 diff --git a/vendor/k8s.io/client-go/tools/remotecommand/v2.go b/vendor/k8s.io/client-go/tools/remotecommand/v2.go index b74ae8de..4b000150 100644 --- a/vendor/k8s.io/client-go/tools/remotecommand/v2.go +++ b/vendor/k8s.io/client-go/tools/remotecommand/v2.go @@ -101,7 +101,7 @@ func (p *streamProtocolV2) copyStdin() { // the executed command will remain running. defer once.Do(func() { p.remoteStdin.Close() }) - if _, err := io.Copy(p.remoteStdin, p.Stdin); err != nil { + if _, err := io.Copy(p.remoteStdin, readerWrapper{p.Stdin}); err != nil { runtime.HandleError(err) } }() diff --git a/vendor/k8s.io/client-go/tools/watch/until.go b/vendor/k8s.io/client-go/tools/watch/until.go index 93357884..aa4bbc21 100644 --- a/vendor/k8s.io/client-go/tools/watch/until.go +++ b/vendor/k8s.io/client-go/tools/watch/until.go @@ -22,13 +22,13 @@ import ( "fmt" "time" - "github.com/golang/glog" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/tools/cache" + "k8s.io/klog" ) // PreconditionFunc returns true if the condition has been reached, false if it has not been reached yet, @@ -135,7 +135,7 @@ func UntilWithSync(ctx context.Context, lw cache.ListerWatcher, objType runtime. func ContextWithOptionalTimeout(parent context.Context, timeout time.Duration) (context.Context, context.CancelFunc) { if timeout < 0 { // This should be handled in validation - glog.Errorf("Timeout for context shall not be negative!") + klog.Errorf("Timeout for context shall not be negative!") timeout = 0 } diff --git a/vendor/k8s.io/client-go/transport/round_trippers.go b/vendor/k8s.io/client-go/transport/round_trippers.go index 0ebcbbc8..da417cf9 100644 --- a/vendor/k8s.io/client-go/transport/round_trippers.go +++ b/vendor/k8s.io/client-go/transport/round_trippers.go @@ -22,7 +22,7 @@ import ( "strings" "time" - "github.com/golang/glog" + "k8s.io/klog" utilnet "k8s.io/apimachinery/pkg/util/net" ) @@ -62,13 +62,13 @@ func HTTPWrappersForConfig(config *Config, rt http.RoundTripper) (http.RoundTrip // DebugWrappers wraps a round tripper and logs based on the current log level. func DebugWrappers(rt http.RoundTripper) http.RoundTripper { switch { - case bool(glog.V(9)): + case bool(klog.V(9)): rt = newDebuggingRoundTripper(rt, debugCurlCommand, debugURLTiming, debugResponseHeaders) - case bool(glog.V(8)): + case bool(klog.V(8)): rt = newDebuggingRoundTripper(rt, debugJustURL, debugRequestHeaders, debugResponseStatus, debugResponseHeaders) - case bool(glog.V(7)): + case bool(klog.V(7)): rt = newDebuggingRoundTripper(rt, debugJustURL, debugRequestHeaders, debugResponseStatus) - case bool(glog.V(6)): + case bool(klog.V(6)): rt = newDebuggingRoundTripper(rt, debugURLTiming) } @@ -138,7 +138,7 @@ func (rt *authProxyRoundTripper) CancelRequest(req *http.Request) { if canceler, ok := rt.rt.(requestCanceler); ok { canceler.CancelRequest(req) } else { - glog.Errorf("CancelRequest not implemented by %T", rt.rt) + klog.Errorf("CancelRequest not implemented by %T", rt.rt) } } @@ -166,7 +166,7 @@ func (rt *userAgentRoundTripper) CancelRequest(req *http.Request) { if canceler, ok := rt.rt.(requestCanceler); ok { canceler.CancelRequest(req) } else { - glog.Errorf("CancelRequest not implemented by %T", rt.rt) + klog.Errorf("CancelRequest not implemented by %T", rt.rt) } } @@ -197,7 +197,7 @@ func (rt *basicAuthRoundTripper) CancelRequest(req *http.Request) { if canceler, ok := rt.rt.(requestCanceler); ok { canceler.CancelRequest(req) } else { - glog.Errorf("CancelRequest not implemented by %T", rt.rt) + klog.Errorf("CancelRequest not implemented by %T", rt.rt) } } @@ -257,7 +257,7 @@ func (rt *impersonatingRoundTripper) CancelRequest(req *http.Request) { if canceler, ok := rt.delegate.(requestCanceler); ok { canceler.CancelRequest(req) } else { - glog.Errorf("CancelRequest not implemented by %T", rt.delegate) + klog.Errorf("CancelRequest not implemented by %T", rt.delegate) } } @@ -288,7 +288,7 @@ func (rt *bearerAuthRoundTripper) CancelRequest(req *http.Request) { if canceler, ok := rt.rt.(requestCanceler); ok { canceler.CancelRequest(req) } else { - glog.Errorf("CancelRequest not implemented by %T", rt.rt) + klog.Errorf("CancelRequest not implemented by %T", rt.rt) } } @@ -372,7 +372,7 @@ func (rt *debuggingRoundTripper) CancelRequest(req *http.Request) { if canceler, ok := rt.delegatedRoundTripper.(requestCanceler); ok { canceler.CancelRequest(req) } else { - glog.Errorf("CancelRequest not implemented by %T", rt.delegatedRoundTripper) + klog.Errorf("CancelRequest not implemented by %T", rt.delegatedRoundTripper) } } @@ -380,17 +380,17 @@ func (rt *debuggingRoundTripper) RoundTrip(req *http.Request) (*http.Response, e reqInfo := newRequestInfo(req) if rt.levels[debugJustURL] { - glog.Infof("%s %s", reqInfo.RequestVerb, reqInfo.RequestURL) + klog.Infof("%s %s", reqInfo.RequestVerb, reqInfo.RequestURL) } if rt.levels[debugCurlCommand] { - glog.Infof("%s", reqInfo.toCurl()) + klog.Infof("%s", reqInfo.toCurl()) } if rt.levels[debugRequestHeaders] { - glog.Infof("Request Headers:") + klog.Infof("Request Headers:") for key, values := range reqInfo.RequestHeaders { for _, value := range values { - glog.Infof(" %s: %s", key, value) + klog.Infof(" %s: %s", key, value) } } } @@ -402,16 +402,16 @@ func (rt *debuggingRoundTripper) RoundTrip(req *http.Request) (*http.Response, e reqInfo.complete(response, err) if rt.levels[debugURLTiming] { - glog.Infof("%s %s %s in %d milliseconds", reqInfo.RequestVerb, reqInfo.RequestURL, reqInfo.ResponseStatus, reqInfo.Duration.Nanoseconds()/int64(time.Millisecond)) + klog.Infof("%s %s %s in %d milliseconds", reqInfo.RequestVerb, reqInfo.RequestURL, reqInfo.ResponseStatus, reqInfo.Duration.Nanoseconds()/int64(time.Millisecond)) } if rt.levels[debugResponseStatus] { - glog.Infof("Response Status: %s in %d milliseconds", reqInfo.ResponseStatus, reqInfo.Duration.Nanoseconds()/int64(time.Millisecond)) + klog.Infof("Response Status: %s in %d milliseconds", reqInfo.ResponseStatus, reqInfo.Duration.Nanoseconds()/int64(time.Millisecond)) } if rt.levels[debugResponseHeaders] { - glog.Infof("Response Headers:") + klog.Infof("Response Headers:") for key, values := range reqInfo.ResponseHeaders { for _, value := range values { - glog.Infof(" %s: %s", key, value) + klog.Infof(" %s: %s", key, value) } } } diff --git a/vendor/k8s.io/client-go/util/cert/cert.go b/vendor/k8s.io/client-go/util/cert/cert.go index 0e160dab..3429c82c 100644 --- a/vendor/k8s.io/client-go/util/cert/cert.go +++ b/vendor/k8s.io/client-go/util/cert/cert.go @@ -260,34 +260,6 @@ func GenerateSelfSignedCertKeyWithFixtures(host string, alternateIPs []net.IP, a return certBuffer.Bytes(), keyBuffer.Bytes(), nil } -// FormatBytesCert receives byte array certificate and formats in human-readable format -func FormatBytesCert(cert []byte) (string, error) { - block, _ := pem.Decode(cert) - c, err := x509.ParseCertificate(block.Bytes) - if err != nil { - return "", fmt.Errorf("failed to parse certificate [%v]", err) - } - return FormatCert(c), nil -} - -// FormatCert receives certificate and formats in human-readable format -func FormatCert(c *x509.Certificate) string { - var ips []string - for _, ip := range c.IPAddresses { - ips = append(ips, ip.String()) - } - altNames := append(ips, c.DNSNames...) - res := fmt.Sprintf( - "Issuer: CN=%s | Subject: CN=%s | CA: %t\n", - c.Issuer.CommonName, c.Subject.CommonName, c.IsCA, - ) - res += fmt.Sprintf("Not before: %s Not After: %s", c.NotBefore, c.NotAfter) - if len(altNames) > 0 { - res += fmt.Sprintf("\nAlternate Names: %v", altNames) - } - return res -} - func ipsToStrings(ips []net.IP) []string { ss := make([]string, 0, len(ips)) for _, ip := range ips { diff --git a/vendor/k8s.io/client-go/util/cert/triple/triple.go b/vendor/k8s.io/client-go/util/cert/triple/triple.go deleted file mode 100644 index b89ef724..00000000 --- a/vendor/k8s.io/client-go/util/cert/triple/triple.go +++ /dev/null @@ -1,116 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -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 triple generates key-certificate pairs for the -// triple (CA, Server, Client). -package triple - -import ( - "crypto/rsa" - "crypto/x509" - "fmt" - "net" - - certutil "k8s.io/client-go/util/cert" -) - -type KeyPair struct { - Key *rsa.PrivateKey - Cert *x509.Certificate -} - -func NewCA(name string) (*KeyPair, error) { - key, err := certutil.NewPrivateKey() - if err != nil { - return nil, fmt.Errorf("unable to create a private key for a new CA: %v", err) - } - - config := certutil.Config{ - CommonName: name, - } - - cert, err := certutil.NewSelfSignedCACert(config, key) - if err != nil { - return nil, fmt.Errorf("unable to create a self-signed certificate for a new CA: %v", err) - } - - return &KeyPair{ - Key: key, - Cert: cert, - }, nil -} - -func NewServerKeyPair(ca *KeyPair, commonName, svcName, svcNamespace, dnsDomain string, ips, hostnames []string) (*KeyPair, error) { - key, err := certutil.NewPrivateKey() - if err != nil { - return nil, fmt.Errorf("unable to create a server private key: %v", err) - } - - namespacedName := fmt.Sprintf("%s.%s", svcName, svcNamespace) - internalAPIServerFQDN := []string{ - svcName, - namespacedName, - fmt.Sprintf("%s.svc", namespacedName), - fmt.Sprintf("%s.svc.%s", namespacedName, dnsDomain), - } - - altNames := certutil.AltNames{} - for _, ipStr := range ips { - ip := net.ParseIP(ipStr) - if ip != nil { - altNames.IPs = append(altNames.IPs, ip) - } - } - altNames.DNSNames = append(altNames.DNSNames, hostnames...) - altNames.DNSNames = append(altNames.DNSNames, internalAPIServerFQDN...) - - config := certutil.Config{ - CommonName: commonName, - AltNames: altNames, - Usages: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth}, - } - cert, err := certutil.NewSignedCert(config, key, ca.Cert, ca.Key) - if err != nil { - return nil, fmt.Errorf("unable to sign the server certificate: %v", err) - } - - return &KeyPair{ - Key: key, - Cert: cert, - }, nil -} - -func NewClientKeyPair(ca *KeyPair, commonName string, organizations []string) (*KeyPair, error) { - key, err := certutil.NewPrivateKey() - if err != nil { - return nil, fmt.Errorf("unable to create a client private key: %v", err) - } - - config := certutil.Config{ - CommonName: commonName, - Organization: organizations, - Usages: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth}, - } - cert, err := certutil.NewSignedCert(config, key, ca.Cert, ca.Key) - if err != nil { - return nil, fmt.Errorf("unable to sign the client certificate: %v", err) - } - - return &KeyPair{ - Key: key, - Cert: cert, - }, nil -} diff --git a/vendor/k8s.io/client-go/util/certificate/certificate_manager.go b/vendor/k8s.io/client-go/util/certificate/certificate_manager.go index fbdf4ec7..ed74559e 100644 --- a/vendor/k8s.io/client-go/util/certificate/certificate_manager.go +++ b/vendor/k8s.io/client-go/util/certificate/certificate_manager.go @@ -28,7 +28,7 @@ import ( "sync" "time" - "github.com/golang/glog" + "k8s.io/klog" certificates "k8s.io/api/certificates/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -227,17 +227,17 @@ func (m *manager) Start() { // signing API, so don't start the certificate manager if we don't have a // client. if m.certSigningRequestClient == nil { - glog.V(2).Infof("Certificate rotation is not enabled, no connection to the apiserver.") + klog.V(2).Infof("Certificate rotation is not enabled, no connection to the apiserver.") return } - glog.V(2).Infof("Certificate rotation is enabled.") + klog.V(2).Infof("Certificate rotation is enabled.") templateChanged := make(chan struct{}) go wait.Forever(func() { deadline := m.nextRotationDeadline() if sleepInterval := deadline.Sub(time.Now()); sleepInterval > 0 { - glog.V(2).Infof("Waiting %v for next certificate rotation", sleepInterval) + klog.V(2).Infof("Waiting %v for next certificate rotation", sleepInterval) timer := time.NewTimer(sleepInterval) defer timer.Stop() @@ -250,7 +250,7 @@ func (m *manager) Start() { // if the template now matches what we last requested, restart the rotation deadline loop return } - glog.V(2).Infof("Certificate template changed, rotating") + klog.V(2).Infof("Certificate template changed, rotating") } } @@ -321,7 +321,7 @@ func getCurrentCertificateOrBootstrap( if _, err := store.Update(bootstrapCertificatePEM, bootstrapKeyPEM); err != nil { utilruntime.HandleError(fmt.Errorf("Unable to set the cert/key pair to the bootstrap certificate: %v", err)) } else { - glog.V(4).Infof("Updated the store to contain the initial bootstrap certificate") + klog.V(4).Infof("Updated the store to contain the initial bootstrap certificate") } return &bootstrapCert, true, nil @@ -333,7 +333,7 @@ func getCurrentCertificateOrBootstrap( // This method also keeps track of "server health" by interpreting the responses it gets // from the server on the various calls it makes. func (m *manager) rotateCerts() (bool, error) { - glog.V(2).Infof("Rotating certificates") + klog.V(2).Infof("Rotating certificates") template, csrPEM, keyPEM, privateKey, err := m.generateCSR() if err != nil { @@ -403,7 +403,7 @@ func (m *manager) certSatisfiesTemplateLocked() bool { if template := m.getTemplate(); template != nil { if template.Subject.CommonName != m.cert.Leaf.Subject.CommonName { - glog.V(2).Infof("Current certificate CN (%s) does not match requested CN (%s)", m.cert.Leaf.Subject.CommonName, template.Subject.CommonName) + klog.V(2).Infof("Current certificate CN (%s) does not match requested CN (%s)", m.cert.Leaf.Subject.CommonName, template.Subject.CommonName) return false } @@ -411,7 +411,7 @@ func (m *manager) certSatisfiesTemplateLocked() bool { desiredDNSNames := sets.NewString(template.DNSNames...) missingDNSNames := desiredDNSNames.Difference(currentDNSNames) if len(missingDNSNames) > 0 { - glog.V(2).Infof("Current certificate is missing requested DNS names %v", missingDNSNames.List()) + klog.V(2).Infof("Current certificate is missing requested DNS names %v", missingDNSNames.List()) return false } @@ -425,7 +425,7 @@ func (m *manager) certSatisfiesTemplateLocked() bool { } missingIPs := desiredIPs.Difference(currentIPs) if len(missingIPs) > 0 { - glog.V(2).Infof("Current certificate is missing requested IP addresses %v", missingIPs.List()) + klog.V(2).Infof("Current certificate is missing requested IP addresses %v", missingIPs.List()) return false } @@ -433,7 +433,7 @@ func (m *manager) certSatisfiesTemplateLocked() bool { desiredOrgs := sets.NewString(template.Subject.Organization...) missingOrgs := desiredOrgs.Difference(currentOrgs) if len(missingOrgs) > 0 { - glog.V(2).Infof("Current certificate is missing requested orgs %v", missingOrgs.List()) + klog.V(2).Infof("Current certificate is missing requested orgs %v", missingOrgs.List()) return false } } @@ -468,7 +468,7 @@ func (m *manager) nextRotationDeadline() time.Time { totalDuration := float64(notAfter.Sub(m.cert.Leaf.NotBefore)) deadline := m.cert.Leaf.NotBefore.Add(jitteryDuration(totalDuration)) - glog.V(2).Infof("Certificate expiration is %v, rotation deadline is %v", notAfter, deadline) + klog.V(2).Infof("Certificate expiration is %v, rotation deadline is %v", notAfter, deadline) if m.certificateExpiration != nil { m.certificateExpiration.Set(float64(notAfter.Unix())) } diff --git a/vendor/k8s.io/client-go/util/certificate/certificate_store.go b/vendor/k8s.io/client-go/util/certificate/certificate_store.go index 81a9e764..d2666615 100644 --- a/vendor/k8s.io/client-go/util/certificate/certificate_store.go +++ b/vendor/k8s.io/client-go/util/certificate/certificate_store.go @@ -26,7 +26,7 @@ import ( "strings" "time" - "github.com/golang/glog" + "k8s.io/klog" ) const ( @@ -127,7 +127,7 @@ func (s *fileStore) Current() (*tls.Certificate, error) { if pairFileExists, err := fileExists(pairFile); err != nil { return nil, err } else if pairFileExists { - glog.Infof("Loading cert/key pair from %q.", pairFile) + klog.Infof("Loading cert/key pair from %q.", pairFile) return loadFile(pairFile) } @@ -140,7 +140,7 @@ func (s *fileStore) Current() (*tls.Certificate, error) { return nil, err } if certFileExists && keyFileExists { - glog.Infof("Loading cert/key pair from (%q, %q).", s.certFile, s.keyFile) + klog.Infof("Loading cert/key pair from (%q, %q).", s.certFile, s.keyFile) return loadX509KeyPair(s.certFile, s.keyFile) } @@ -155,7 +155,7 @@ func (s *fileStore) Current() (*tls.Certificate, error) { return nil, err } if certFileExists && keyFileExists { - glog.Infof("Loading cert/key pair from (%q, %q).", c, k) + klog.Infof("Loading cert/key pair from (%q, %q).", c, k) return loadX509KeyPair(c, k) } diff --git a/vendor/k8s.io/client-go/util/certificate/csr/csr.go b/vendor/k8s.io/client-go/util/certificate/csr/csr.go index 4a53352f..6338eef9 100644 --- a/vendor/k8s.io/client-go/util/certificate/csr/csr.go +++ b/vendor/k8s.io/client-go/util/certificate/csr/csr.go @@ -18,23 +18,19 @@ package csr import ( "crypto" - "crypto/sha512" "crypto/x509" - "crypto/x509/pkix" - "encoding/base64" "encoding/pem" "fmt" "reflect" "time" - "github.com/golang/glog" + "k8s.io/klog" certificates "k8s.io/api/certificates/v1beta1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/watch" certificatesclient "k8s.io/client-go/kubernetes/typed/certificates/v1beta1" @@ -43,41 +39,6 @@ import ( certutil "k8s.io/client-go/util/cert" ) -// RequestNodeCertificate will create a certificate signing request for a node -// (Organization and CommonName for the CSR will be set as expected for node -// certificates) and send it to API server, then it will watch the object's -// status, once approved by API server, it will return the API server's issued -// certificate (pem-encoded). If there is any errors, or the watch timeouts, it -// will return an error. This is intended for use on nodes (kubelet and -// kubeadm). -func RequestNodeCertificate(client certificatesclient.CertificateSigningRequestInterface, privateKeyData []byte, nodeName types.NodeName) (certData []byte, err error) { - subject := &pkix.Name{ - Organization: []string{"system:nodes"}, - CommonName: "system:node:" + string(nodeName), - } - - privateKey, err := certutil.ParsePrivateKeyPEM(privateKeyData) - if err != nil { - return nil, fmt.Errorf("invalid private key for certificate request: %v", err) - } - csrData, err := certutil.MakeCSR(privateKey, subject, nil, nil) - if err != nil { - return nil, fmt.Errorf("unable to generate certificate request: %v", err) - } - - usages := []certificates.KeyUsage{ - certificates.UsageDigitalSignature, - certificates.UsageKeyEncipherment, - certificates.UsageClientAuth, - } - name := digestedName(privateKeyData, subject, usages) - req, err := RequestCertificate(client, csrData, name, usages, privateKey) - if err != nil { - return nil, err - } - return WaitForCertificate(client, req, 3600*time.Second) -} - // RequestCertificate will either use an existing (if this process has run // before but not to completion) or create a certificate signing request using the // PEM encoded CSR and send it to API server, then it will watch the object's @@ -104,7 +65,7 @@ func RequestCertificate(client certificatesclient.CertificateSigningRequestInter switch { case err == nil: case errors.IsAlreadyExists(err) && len(name) > 0: - glog.Infof("csr for this node already exists, reusing") + klog.Infof("csr for this node already exists, reusing") req, err = client.Get(name, metav1.GetOptions{}) if err != nil { return nil, formatError("cannot retrieve certificate signing request: %v", err) @@ -112,7 +73,7 @@ func RequestCertificate(client certificatesclient.CertificateSigningRequestInter if err := ensureCompatible(req, csr, privateKey); err != nil { return nil, fmt.Errorf("retrieved csr is not compatible: %v", err) } - glog.Infof("csr for this node is still valid") + klog.Infof("csr for this node is still valid") default: return nil, formatError("cannot create certificate signing request: %v", err) } @@ -168,57 +129,25 @@ func WaitForCertificate(client certificatesclient.CertificateSigningRequestInter return event.Object.(*certificates.CertificateSigningRequest).Status.Certificate, nil } -// This digest should include all the relevant pieces of the CSR we care about. -// We can't direcly hash the serialized CSR because of random padding that we -// regenerate every loop and we include usages which are not contained in the -// CSR. This needs to be kept up to date as we add new fields to the node -// certificates and with ensureCompatible. -func digestedName(privateKeyData []byte, subject *pkix.Name, usages []certificates.KeyUsage) string { - hash := sha512.New512_256() - - // Here we make sure two different inputs can't write the same stream - // to the hash. This delimiter is not in the base64.URLEncoding - // alphabet so there is no way to have spill over collisions. Without - // it 'CN:foo,ORG:bar' hashes to the same value as 'CN:foob,ORG:ar' - const delimiter = '|' - encode := base64.RawURLEncoding.EncodeToString - - write := func(data []byte) { - hash.Write([]byte(encode(data))) - hash.Write([]byte{delimiter}) - } - - write(privateKeyData) - write([]byte(subject.CommonName)) - for _, v := range subject.Organization { - write([]byte(v)) - } - for _, v := range usages { - write([]byte(v)) - } - - return "node-csr-" + encode(hash.Sum(nil)) -} - // ensureCompatible ensures that a CSR object is compatible with an original CSR func ensureCompatible(new, orig *certificates.CertificateSigningRequest, privateKey interface{}) error { - newCsr, err := ParseCSR(new) + newCSR, err := parseCSR(new) if err != nil { return fmt.Errorf("unable to parse new csr: %v", err) } - origCsr, err := ParseCSR(orig) + origCSR, err := parseCSR(orig) if err != nil { return fmt.Errorf("unable to parse original csr: %v", err) } - if !reflect.DeepEqual(newCsr.Subject, origCsr.Subject) { - return fmt.Errorf("csr subjects differ: new: %#v, orig: %#v", newCsr.Subject, origCsr.Subject) + if !reflect.DeepEqual(newCSR.Subject, origCSR.Subject) { + return fmt.Errorf("csr subjects differ: new: %#v, orig: %#v", newCSR.Subject, origCSR.Subject) } signer, ok := privateKey.(crypto.Signer) if !ok { return fmt.Errorf("privateKey is not a signer") } - newCsr.PublicKey = signer.Public() - if err := newCsr.CheckSignature(); err != nil { + newCSR.PublicKey = signer.Public() + if err := newCSR.CheckSignature(); err != nil { return fmt.Errorf("error validating signature new CSR against old key: %v", err) } if len(new.Status.Certificate) > 0 { @@ -247,17 +176,12 @@ func formatError(format string, err error) error { return fmt.Errorf(format, err) } -// ParseCSR extracts the CSR from the API object and decodes it. -func ParseCSR(obj *certificates.CertificateSigningRequest) (*x509.CertificateRequest, error) { +// parseCSR extracts the CSR from the API object and decodes it. +func parseCSR(obj *certificates.CertificateSigningRequest) (*x509.CertificateRequest, error) { // extract PEM from request object - pemBytes := obj.Spec.Request - block, _ := pem.Decode(pemBytes) + block, _ := pem.Decode(obj.Spec.Request) if block == nil || block.Type != "CERTIFICATE REQUEST" { return nil, fmt.Errorf("PEM block type must be CERTIFICATE REQUEST") } - csr, err := x509.ParseCertificateRequest(block.Bytes) - if err != nil { - return nil, err - } - return csr, nil + return x509.ParseCertificateRequest(block.Bytes) } diff --git a/vendor/k8s.io/client-go/util/certificate/csr/csr_test.go b/vendor/k8s.io/client-go/util/certificate/csr/csr_test.go deleted file mode 100644 index d0182abe..00000000 --- a/vendor/k8s.io/client-go/util/certificate/csr/csr_test.go +++ /dev/null @@ -1,135 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -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 csr - -import ( - "fmt" - "testing" - - certificates "k8s.io/api/certificates/v1beta1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - watch "k8s.io/apimachinery/pkg/watch" - certificatesclient "k8s.io/client-go/kubernetes/typed/certificates/v1beta1" - certutil "k8s.io/client-go/util/cert" -) - -func TestRequestNodeCertificateNoKeyData(t *testing.T) { - certData, err := RequestNodeCertificate(&fakeClient{}, []byte{}, "fake-node-name") - if err == nil { - t.Errorf("Got no error, wanted error an error because there was an empty private key passed in.") - } - if certData != nil { - t.Errorf("Got cert data, wanted nothing as there should have been an error.") - } -} - -func TestRequestNodeCertificateErrorCreatingCSR(t *testing.T) { - client := &fakeClient{ - failureType: createError, - } - privateKeyData, err := certutil.MakeEllipticPrivateKeyPEM() - if err != nil { - t.Fatalf("Unable to generate a new private key: %v", err) - } - - certData, err := RequestNodeCertificate(client, privateKeyData, "fake-node-name") - if err == nil { - t.Errorf("Got no error, wanted error an error because client.Create failed.") - } - if certData != nil { - t.Errorf("Got cert data, wanted nothing as there should have been an error.") - } -} - -func TestRequestNodeCertificate(t *testing.T) { - privateKeyData, err := certutil.MakeEllipticPrivateKeyPEM() - if err != nil { - t.Fatalf("Unable to generate a new private key: %v", err) - } - - certData, err := RequestNodeCertificate(&fakeClient{}, privateKeyData, "fake-node-name") - if err != nil { - t.Errorf("Got %v, wanted no error.", err) - } - if certData == nil { - t.Errorf("Got nothing, expected a CSR.") - } -} - -type FailureType int - -const ( - noError FailureType = iota - createError - certificateSigningRequestDenied -) - -type fakeClient struct { - certificatesclient.CertificateSigningRequestInterface - watch *watch.FakeWatcher - failureType FailureType -} - -func (c *fakeClient) Create(*certificates.CertificateSigningRequest) (*certificates.CertificateSigningRequest, error) { - if c.failureType == createError { - return nil, fmt.Errorf("fakeClient failed creating request") - } - csr := certificates.CertificateSigningRequest{ - ObjectMeta: metav1.ObjectMeta{ - UID: "fake-uid", - Name: "fake-certificate-signing-request-name", - }, - } - return &csr, nil -} - -func (c *fakeClient) List(opts metav1.ListOptions) (*certificates.CertificateSigningRequestList, error) { - return &certificates.CertificateSigningRequestList{}, nil -} - -func (c *fakeClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - c.watch = watch.NewFakeWithChanSize(1, false) - c.watch.Add(c.generateCSR()) - c.watch.Stop() - return c.watch, nil -} - -func (c *fakeClient) generateCSR() *certificates.CertificateSigningRequest { - var condition certificates.CertificateSigningRequestCondition - if c.failureType == certificateSigningRequestDenied { - condition = certificates.CertificateSigningRequestCondition{ - Type: certificates.CertificateDenied, - } - } else { - condition = certificates.CertificateSigningRequestCondition{ - Type: certificates.CertificateApproved, - } - } - - csr := certificates.CertificateSigningRequest{ - ObjectMeta: metav1.ObjectMeta{ - UID: "fake-uid", - }, - Status: certificates.CertificateSigningRequestStatus{ - Conditions: []certificates.CertificateSigningRequestCondition{ - condition, - }, - Certificate: []byte{}, - }, - } - return &csr -} diff --git a/vendor/k8s.io/client-go/util/workqueue/metrics.go b/vendor/k8s.io/client-go/util/workqueue/metrics.go index a481bdfb..d4c03d83 100644 --- a/vendor/k8s.io/client-go/util/workqueue/metrics.go +++ b/vendor/k8s.io/client-go/util/workqueue/metrics.go @@ -19,6 +19,8 @@ package workqueue import ( "sync" "time" + + "k8s.io/apimachinery/pkg/util/clock" ) // This file provides abstractions for setting the provider (e.g., prometheus) @@ -28,6 +30,7 @@ type queueMetrics interface { add(item t) get(item t) done(item t) + updateUnfinishedWork() } // GaugeMetric represents a single numerical value that can arbitrarily go up @@ -37,6 +40,12 @@ type GaugeMetric interface { Dec() } +// SettableGaugeMetric represents a single numerical value that can arbitrarily go up +// and down. (Separate from GaugeMetric to preserve backwards compatibility.) +type SettableGaugeMetric interface { + Set(float64) +} + // CounterMetric represents a single numerical value that only ever // goes up. type CounterMetric interface { @@ -52,9 +61,13 @@ type noopMetric struct{} func (noopMetric) Inc() {} func (noopMetric) Dec() {} +func (noopMetric) Set(float64) {} func (noopMetric) Observe(float64) {} +// defaultQueueMetrics expects the caller to lock before setting any metrics. type defaultQueueMetrics struct { + clock clock.Clock + // current depth of a workqueue depth GaugeMetric // total number of adds handled by a workqueue @@ -65,6 +78,10 @@ type defaultQueueMetrics struct { workDuration SummaryMetric addTimes map[t]time.Time processingStartTimes map[t]time.Time + + // how long have current threads been working? + unfinishedWorkSeconds SettableGaugeMetric + longestRunningProcessor SettableGaugeMetric } func (m *defaultQueueMetrics) add(item t) { @@ -75,7 +92,7 @@ func (m *defaultQueueMetrics) add(item t) { m.adds.Inc() m.depth.Inc() if _, exists := m.addTimes[item]; !exists { - m.addTimes[item] = time.Now() + m.addTimes[item] = m.clock.Now() } } @@ -85,9 +102,9 @@ func (m *defaultQueueMetrics) get(item t) { } m.depth.Dec() - m.processingStartTimes[item] = time.Now() + m.processingStartTimes[item] = m.clock.Now() if startTime, exists := m.addTimes[item]; exists { - m.latency.Observe(sinceInMicroseconds(startTime)) + m.latency.Observe(m.sinceInMicroseconds(startTime)) delete(m.addTimes, item) } } @@ -98,14 +115,39 @@ func (m *defaultQueueMetrics) done(item t) { } if startTime, exists := m.processingStartTimes[item]; exists { - m.workDuration.Observe(sinceInMicroseconds(startTime)) + m.workDuration.Observe(m.sinceInMicroseconds(startTime)) delete(m.processingStartTimes, item) } } +func (m *defaultQueueMetrics) updateUnfinishedWork() { + // Note that a summary metric would be better for this, but prometheus + // doesn't seem to have non-hacky ways to reset the summary metrics. + var total float64 + var oldest float64 + for _, t := range m.processingStartTimes { + age := m.sinceInMicroseconds(t) + total += age + if age > oldest { + oldest = age + } + } + // Convert to seconds; microseconds is unhelpfully granular for this. + total /= 1000000 + m.unfinishedWorkSeconds.Set(total) + m.longestRunningProcessor.Set(oldest) // in microseconds. +} + +type noMetrics struct{} + +func (noMetrics) add(item t) {} +func (noMetrics) get(item t) {} +func (noMetrics) done(item t) {} +func (noMetrics) updateUnfinishedWork() {} + // Gets the time since the specified start in microseconds. -func sinceInMicroseconds(start time.Time) float64 { - return float64(time.Since(start).Nanoseconds() / time.Microsecond.Nanoseconds()) +func (m *defaultQueueMetrics) sinceInMicroseconds(start time.Time) float64 { + return float64(m.clock.Since(start).Nanoseconds() / time.Microsecond.Nanoseconds()) } type retryMetrics interface { @@ -130,6 +172,8 @@ type MetricsProvider interface { NewAddsMetric(name string) CounterMetric NewLatencyMetric(name string) SummaryMetric NewWorkDurationMetric(name string) SummaryMetric + NewUnfinishedWorkSecondsMetric(name string) SettableGaugeMetric + NewLongestRunningProcessorMicrosecondsMetric(name string) SettableGaugeMetric NewRetriesMetric(name string) CounterMetric } @@ -151,29 +195,49 @@ func (_ noopMetricsProvider) NewWorkDurationMetric(name string) SummaryMetric { return noopMetric{} } +func (_ noopMetricsProvider) NewUnfinishedWorkSecondsMetric(name string) SettableGaugeMetric { + return noopMetric{} +} + +func (_ noopMetricsProvider) NewLongestRunningProcessorMicrosecondsMetric(name string) SettableGaugeMetric { + return noopMetric{} +} + func (_ noopMetricsProvider) NewRetriesMetric(name string) CounterMetric { return noopMetric{} } -var metricsFactory = struct { - metricsProvider MetricsProvider - setProviders sync.Once -}{ +var globalMetricsFactory = queueMetricsFactory{ metricsProvider: noopMetricsProvider{}, } -func newQueueMetrics(name string) queueMetrics { - var ret *defaultQueueMetrics - if len(name) == 0 { - return ret +type queueMetricsFactory struct { + metricsProvider MetricsProvider + + onlyOnce sync.Once +} + +func (f *queueMetricsFactory) setProvider(mp MetricsProvider) { + f.onlyOnce.Do(func() { + f.metricsProvider = mp + }) +} + +func (f *queueMetricsFactory) newQueueMetrics(name string, clock clock.Clock) queueMetrics { + mp := f.metricsProvider + if len(name) == 0 || mp == (noopMetricsProvider{}) { + return noMetrics{} } return &defaultQueueMetrics{ - depth: metricsFactory.metricsProvider.NewDepthMetric(name), - adds: metricsFactory.metricsProvider.NewAddsMetric(name), - latency: metricsFactory.metricsProvider.NewLatencyMetric(name), - workDuration: metricsFactory.metricsProvider.NewWorkDurationMetric(name), - addTimes: map[t]time.Time{}, - processingStartTimes: map[t]time.Time{}, + clock: clock, + depth: mp.NewDepthMetric(name), + adds: mp.NewAddsMetric(name), + latency: mp.NewLatencyMetric(name), + workDuration: mp.NewWorkDurationMetric(name), + unfinishedWorkSeconds: mp.NewUnfinishedWorkSecondsMetric(name), + longestRunningProcessor: mp.NewLongestRunningProcessorMicrosecondsMetric(name), + addTimes: map[t]time.Time{}, + processingStartTimes: map[t]time.Time{}, } } @@ -183,13 +247,12 @@ func newRetryMetrics(name string) retryMetrics { return ret } return &defaultRetryMetrics{ - retries: metricsFactory.metricsProvider.NewRetriesMetric(name), + retries: globalMetricsFactory.metricsProvider.NewRetriesMetric(name), } } -// SetProvider sets the metrics provider of the metricsFactory. +// SetProvider sets the metrics provider for all subsequently created work +// queues. Only the first call has an effect. func SetProvider(metricsProvider MetricsProvider) { - metricsFactory.setProviders.Do(func() { - metricsFactory.metricsProvider = metricsProvider - }) + globalMetricsFactory.setProvider(metricsProvider) } diff --git a/vendor/k8s.io/client-go/util/workqueue/metrics_test.go b/vendor/k8s.io/client-go/util/workqueue/metrics_test.go new file mode 100644 index 00000000..117f9080 --- /dev/null +++ b/vendor/k8s.io/client-go/util/workqueue/metrics_test.go @@ -0,0 +1,293 @@ +/* +Copyright 2018 The Kubernetes Authors. + +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 workqueue + +import ( + "sync" + "testing" + "time" + + "k8s.io/apimachinery/pkg/util/clock" +) + +type testMetrics struct { + added, gotten, finished int64 + + updateCalled chan<- struct{} +} + +func (m *testMetrics) add(item t) { m.added++ } +func (m *testMetrics) get(item t) { m.gotten++ } +func (m *testMetrics) done(item t) { m.finished++ } +func (m *testMetrics) updateUnfinishedWork() { m.updateCalled <- struct{}{} } + +func TestMetricShutdown(t *testing.T) { + ch := make(chan struct{}) + m := &testMetrics{ + updateCalled: ch, + } + c := clock.NewFakeClock(time.Now()) + q := newQueue(c, m, time.Millisecond) + for !c.HasWaiters() { + // Wait for the go routine to call NewTicker() + time.Sleep(time.Millisecond) + } + + c.Step(time.Millisecond) + <-ch + q.ShutDown() + + c.Step(time.Hour) + select { + default: + return + case <-ch: + t.Errorf("Unexpected update after shutdown was called.") + } +} + +type testMetric struct { + inc int64 + dec int64 + set float64 + + observedValue float64 + observedCount int + + notifyCh chan<- struct{} + + lock sync.Mutex +} + +func (m *testMetric) Inc() { + m.lock.Lock() + defer m.lock.Unlock() + m.inc++ + m.notify() +} + +func (m *testMetric) Dec() { + m.lock.Lock() + defer m.lock.Unlock() + m.dec++ + m.notify() +} + +func (m *testMetric) Set(f float64) { + m.lock.Lock() + defer m.lock.Unlock() + m.set = f + m.notify() +} + +func (m *testMetric) Observe(f float64) { + m.lock.Lock() + defer m.lock.Unlock() + m.observedValue = f + m.observedCount++ + m.notify() +} + +func (m *testMetric) gaugeValue() float64 { + m.lock.Lock() + defer m.lock.Unlock() + if m.set != 0 { + return m.set + } + return float64(m.inc - m.dec) +} + +func (m *testMetric) observationValue() float64 { + m.lock.Lock() + defer m.lock.Unlock() + return m.observedValue +} + +func (m *testMetric) observationCount() int { + m.lock.Lock() + defer m.lock.Unlock() + return m.observedCount +} + +func (m *testMetric) notify() { + if m.notifyCh != nil { + m.notifyCh <- struct{}{} + } +} + +type testMetricsProvider struct { + depth testMetric + adds testMetric + latency testMetric + duration testMetric + unfinished testMetric + longest testMetric + retries testMetric +} + +func (m *testMetricsProvider) NewDepthMetric(name string) GaugeMetric { + return &m.depth +} + +func (m *testMetricsProvider) NewAddsMetric(name string) CounterMetric { + return &m.adds +} + +func (m *testMetricsProvider) NewLatencyMetric(name string) SummaryMetric { + return &m.latency +} + +func (m *testMetricsProvider) NewWorkDurationMetric(name string) SummaryMetric { + return &m.duration +} + +func (m *testMetricsProvider) NewUnfinishedWorkSecondsMetric(name string) SettableGaugeMetric { + return &m.unfinished +} + +func (m *testMetricsProvider) NewLongestRunningProcessorMicrosecondsMetric(name string) SettableGaugeMetric { + return &m.longest +} + +func (m *testMetricsProvider) NewRetriesMetric(name string) CounterMetric { + return &m.retries +} + +func TestSinceInMicroseconds(t *testing.T) { + mp := testMetricsProvider{} + c := clock.NewFakeClock(time.Now()) + mf := queueMetricsFactory{metricsProvider: &mp} + m := mf.newQueueMetrics("test", c) + dqm := m.(*defaultQueueMetrics) + + for _, i := range []int{1, 50, 100, 500, 1000, 10000, 100000, 1000000} { + n := c.Now() + c.Step(time.Duration(i) * time.Microsecond) + if e, a := float64(i), dqm.sinceInMicroseconds(n); e != a { + t.Errorf("Expected %v, got %v", e, a) + } + } +} + +func TestMetrics(t *testing.T) { + mp := testMetricsProvider{} + t0 := time.Unix(0, 0) + c := clock.NewFakeClock(t0) + mf := queueMetricsFactory{metricsProvider: &mp} + m := mf.newQueueMetrics("test", c) + q := newQueue(c, m, time.Millisecond) + defer q.ShutDown() + for !c.HasWaiters() { + // Wait for the go routine to call NewTicker() + time.Sleep(time.Millisecond) + } + + q.Add("foo") + if e, a := 1.0, mp.adds.gaugeValue(); e != a { + t.Errorf("expected %v, got %v", e, a) + } + + if e, a := 1.0, mp.depth.gaugeValue(); e != a { + t.Errorf("expected %v, got %v", e, a) + } + + c.Step(50 * time.Microsecond) + + // Start processing + i, _ := q.Get() + if i != "foo" { + t.Errorf("Expected %v, got %v", "foo", i) + } + + if e, a := 50.0, mp.latency.observationValue(); e != a { + t.Errorf("expected %v, got %v", e, a) + } + if e, a := 1, mp.latency.observationCount(); e != a { + t.Errorf("expected %v, got %v", e, a) + } + if e, a := 0.0, mp.depth.gaugeValue(); e != a { + t.Errorf("expected %v, got %v", e, a) + } + + // Add it back while processing; multiple adds of the same item are + // de-duped. + q.Add(i) + q.Add(i) + q.Add(i) + q.Add(i) + q.Add(i) + if e, a := 2.0, mp.adds.gaugeValue(); e != a { + t.Errorf("expected %v, got %v", e, a) + } + // One thing remains in the queue + if e, a := 1.0, mp.depth.gaugeValue(); e != a { + t.Errorf("expected %v, got %v", e, a) + } + + c.Step(25 * time.Microsecond) + + // Finish it up + q.Done(i) + + if e, a := 25.0, mp.duration.observationValue(); e != a { + t.Errorf("expected %v, got %v", e, a) + } + if e, a := 1, mp.duration.observationCount(); e != a { + t.Errorf("expected %v, got %v", e, a) + } + + // One thing remains in the queue + if e, a := 1.0, mp.depth.gaugeValue(); e != a { + t.Errorf("expected %v, got %v", e, a) + } + + // It should be back on the queue + i, _ = q.Get() + if i != "foo" { + t.Errorf("Expected %v, got %v", "foo", i) + } + + if e, a := 25.0, mp.latency.observationValue(); e != a { + t.Errorf("expected %v, got %v", e, a) + } + if e, a := 2, mp.latency.observationCount(); e != a { + t.Errorf("expected %v, got %v", e, a) + } + + // use a channel to ensure we don't look at the metric before it's + // been set. + ch := make(chan struct{}, 1) + mp.unfinished.notifyCh = ch + c.Step(time.Millisecond) + <-ch + mp.unfinished.notifyCh = nil + if e, a := .001, mp.unfinished.gaugeValue(); e != a { + t.Errorf("expected %v, got %v", e, a) + } + if e, a := 1000.0, mp.longest.gaugeValue(); e != a { + t.Errorf("expected %v, got %v", e, a) + } + + // Finish that one up + q.Done(i) + if e, a := 1000.0, mp.duration.observationValue(); e != a { + t.Errorf("expected %v, got %v", e, a) + } + if e, a := 2, mp.duration.observationCount(); e != a { + t.Errorf("expected %v, got %v", e, a) + } +} diff --git a/vendor/k8s.io/client-go/util/workqueue/queue.go b/vendor/k8s.io/client-go/util/workqueue/queue.go index dc9a7cc7..39009b8e 100644 --- a/vendor/k8s.io/client-go/util/workqueue/queue.go +++ b/vendor/k8s.io/client-go/util/workqueue/queue.go @@ -18,6 +18,9 @@ package workqueue import ( "sync" + "time" + + "k8s.io/apimachinery/pkg/util/clock" ) type Interface interface { @@ -35,14 +38,29 @@ func New() *Type { } func NewNamed(name string) *Type { - return &Type{ - dirty: set{}, - processing: set{}, - cond: sync.NewCond(&sync.Mutex{}), - metrics: newQueueMetrics(name), - } + rc := clock.RealClock{} + return newQueue( + rc, + globalMetricsFactory.newQueueMetrics(name, rc), + defaultUnfinishedWorkUpdatePeriod, + ) } +func newQueue(c clock.Clock, metrics queueMetrics, updatePeriod time.Duration) *Type { + t := &Type{ + clock: c, + dirty: set{}, + processing: set{}, + cond: sync.NewCond(&sync.Mutex{}), + metrics: metrics, + unfinishedWorkUpdatePeriod: updatePeriod, + } + go t.updateUnfinishedWorkLoop() + return t +} + +const defaultUnfinishedWorkUpdatePeriod = 500 * time.Millisecond + // Type is a work queue (see the package comment). type Type struct { // queue defines the order in which we will work on items. Every @@ -64,6 +82,9 @@ type Type struct { shuttingDown bool metrics queueMetrics + + unfinishedWorkUpdatePeriod time.Duration + clock clock.Clock } type empty struct{} @@ -170,3 +191,22 @@ func (q *Type) ShuttingDown() bool { return q.shuttingDown } + +func (q *Type) updateUnfinishedWorkLoop() { + t := q.clock.NewTicker(q.unfinishedWorkUpdatePeriod) + defer t.Stop() + for range t.C() { + if !func() bool { + q.cond.L.Lock() + defer q.cond.L.Unlock() + if !q.shuttingDown { + q.metrics.updateUnfinishedWork() + return true + } + return false + + }() { + return + } + } +} diff --git a/vendor/k8s.io/code-generator/Godeps/Godeps.json b/vendor/k8s.io/code-generator/Godeps/Godeps.json index ad70c9f5..4546feed 100644 --- a/vendor/k8s.io/code-generator/Godeps/Godeps.json +++ b/vendor/k8s.io/code-generator/Godeps/Godeps.json @@ -6,38 +6,6 @@ "./..." ], "Deps": [ - { - "ImportPath": "github.com/PuerkitoBio/purell", - "Rev": "8a290539e2e8629dbc4e6bad948158f790ec31f4" - }, - { - "ImportPath": "github.com/PuerkitoBio/urlesc", - "Rev": "5bd2802263f21d8788851d5305584c82a5c75d7e" - }, - { - "ImportPath": "github.com/emicklei/go-restful", - "Rev": "ff4f55a206334ef123e4f79bbf348980da81ca46" - }, - { - "ImportPath": "github.com/emicklei/go-restful/log", - "Rev": "ff4f55a206334ef123e4f79bbf348980da81ca46" - }, - { - "ImportPath": "github.com/go-openapi/jsonpointer", - "Rev": "ef5f0afec364d3b9396b7b77b43dbe26bf1f8004" - }, - { - "ImportPath": "github.com/go-openapi/jsonreference", - "Rev": "8483a886a90412cd6858df4ea3483dce9c8e35a3" - }, - { - "ImportPath": "github.com/go-openapi/spec", - "Rev": "5bae59e25b21498baea7f9d46e9c147ec106a42e" - }, - { - "ImportPath": "github.com/go-openapi/swag", - "Rev": "5899d5c5e619fda5fa86e14795a835f473ca284c" - }, { "ImportPath": "github.com/gogo/protobuf/gogoproto", "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" @@ -138,74 +106,10 @@ "ImportPath": "github.com/gogo/protobuf/vanity/command", "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" }, - { - "ImportPath": "github.com/golang/glog", - "Rev": "44145f04b68cf362d9c4df2182967c2275eaefed" - }, - { - "ImportPath": "github.com/mailru/easyjson/buffer", - "Rev": "2f5df55504ebc322e4d52d34df6a1f5b503bf26d" - }, - { - "ImportPath": "github.com/mailru/easyjson/jlexer", - "Rev": "2f5df55504ebc322e4d52d34df6a1f5b503bf26d" - }, - { - "ImportPath": "github.com/mailru/easyjson/jwriter", - "Rev": "2f5df55504ebc322e4d52d34df6a1f5b503bf26d" - }, { "ImportPath": "github.com/spf13/pflag", "Rev": "583c0c0531f06d5278b7d917446061adc344b5cd" }, - { - "ImportPath": "golang.org/x/net/idna", - "Rev": "1c05540f6879653db88113bc4a2b70aec4bd491f" - }, - { - "ImportPath": "golang.org/x/text/cases", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/internal", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/internal/tag", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/language", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/runes", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/secure/bidirule", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/secure/precis", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/transform", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/unicode/bidi", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/unicode/norm", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, - { - "ImportPath": "golang.org/x/text/width", - "Rev": "b19bf474d317b857955b12035d2c5acb57ce8b01" - }, { "ImportPath": "golang.org/x/tools/go/ast/astutil", "Rev": "2382e3994d48b1d22acc2c86bcad0a2aff028e32" @@ -214,69 +118,49 @@ "ImportPath": "golang.org/x/tools/imports", "Rev": "2382e3994d48b1d22acc2c86bcad0a2aff028e32" }, - { - "ImportPath": "gopkg.in/yaml.v2", - "Rev": "5420a8b6744d3b0345ab293f6fcba19c978f1183" - }, { "ImportPath": "k8s.io/gengo/args", - "Rev": "fdcf9f9480fdd5bf2b3c3df9bf4ecd22b25b87e2" + "Rev": "51747d6e00da1fc578d5a333a93bb2abcbce7a95" }, { "ImportPath": "k8s.io/gengo/examples/deepcopy-gen/generators", - "Rev": "fdcf9f9480fdd5bf2b3c3df9bf4ecd22b25b87e2" + "Rev": "51747d6e00da1fc578d5a333a93bb2abcbce7a95" }, { "ImportPath": "k8s.io/gengo/examples/defaulter-gen/generators", - "Rev": "fdcf9f9480fdd5bf2b3c3df9bf4ecd22b25b87e2" + "Rev": "51747d6e00da1fc578d5a333a93bb2abcbce7a95" }, { "ImportPath": "k8s.io/gengo/examples/import-boss/generators", - "Rev": "fdcf9f9480fdd5bf2b3c3df9bf4ecd22b25b87e2" + "Rev": "51747d6e00da1fc578d5a333a93bb2abcbce7a95" }, { "ImportPath": "k8s.io/gengo/examples/set-gen/generators", - "Rev": "fdcf9f9480fdd5bf2b3c3df9bf4ecd22b25b87e2" + "Rev": "51747d6e00da1fc578d5a333a93bb2abcbce7a95" }, { "ImportPath": "k8s.io/gengo/examples/set-gen/sets", - "Rev": "fdcf9f9480fdd5bf2b3c3df9bf4ecd22b25b87e2" + "Rev": "51747d6e00da1fc578d5a333a93bb2abcbce7a95" }, { "ImportPath": "k8s.io/gengo/generator", - "Rev": "fdcf9f9480fdd5bf2b3c3df9bf4ecd22b25b87e2" + "Rev": "51747d6e00da1fc578d5a333a93bb2abcbce7a95" }, { "ImportPath": "k8s.io/gengo/namer", - "Rev": "fdcf9f9480fdd5bf2b3c3df9bf4ecd22b25b87e2" + "Rev": "51747d6e00da1fc578d5a333a93bb2abcbce7a95" }, { "ImportPath": "k8s.io/gengo/parser", - "Rev": "fdcf9f9480fdd5bf2b3c3df9bf4ecd22b25b87e2" + "Rev": "51747d6e00da1fc578d5a333a93bb2abcbce7a95" }, { "ImportPath": "k8s.io/gengo/types", - "Rev": "fdcf9f9480fdd5bf2b3c3df9bf4ecd22b25b87e2" + "Rev": "51747d6e00da1fc578d5a333a93bb2abcbce7a95" }, { - "ImportPath": "k8s.io/kube-openapi/cmd/openapi-gen/args", - "Rev": "72693cb1fadd73ae2742f6fe29af77d1aecdd8cd" - }, - { - "ImportPath": "k8s.io/kube-openapi/pkg/common", - "Rev": "72693cb1fadd73ae2742f6fe29af77d1aecdd8cd" - }, - { - "ImportPath": "k8s.io/kube-openapi/pkg/generators", - "Rev": "72693cb1fadd73ae2742f6fe29af77d1aecdd8cd" - }, - { - "ImportPath": "k8s.io/kube-openapi/pkg/generators/rules", - "Rev": "72693cb1fadd73ae2742f6fe29af77d1aecdd8cd" - }, - { - "ImportPath": "k8s.io/kube-openapi/pkg/util/sets", - "Rev": "72693cb1fadd73ae2742f6fe29af77d1aecdd8cd" + "ImportPath": "k8s.io/klog", + "Rev": "8139d8cb77af419532b33dfa7dd09fbc5f1d344f" } ] } diff --git a/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/clustertesttype.go b/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/clustertesttype.go index b6f023f9..559ce47e 100644 --- a/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/clustertesttype.go +++ b/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/clustertesttype.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" @@ -77,10 +79,15 @@ func (c *clusterTestTypes) Get(name string, options metav1.GetOptions) (result * // List takes label and field selectors, and returns the list of ClusterTestTypes that match those selectors. func (c *clusterTestTypes) List(opts metav1.ListOptions) (result *v1.ClusterTestTypeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.ClusterTestTypeList{} err = c.client.Get(). Resource("clustertesttypes"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -88,10 +95,15 @@ func (c *clusterTestTypes) List(opts metav1.ListOptions) (result *v1.ClusterTest // Watch returns a watch.Interface that watches the requested clusterTestTypes. func (c *clusterTestTypes) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Resource("clustertesttypes"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -145,9 +157,14 @@ func (c *clusterTestTypes) Delete(name string, options *metav1.DeleteOptions) er // DeleteCollection deletes a collection of objects. func (c *clusterTestTypes) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Resource("clustertesttypes"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/testtype.go b/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/testtype.go index 3c7b636e..9944e3e7 100644 --- a/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/testtype.go +++ b/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/testtype.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" @@ -76,11 +78,16 @@ func (c *testTypes) Get(name string, options metav1.GetOptions) (result *v1.Test // List takes label and field selectors, and returns the list of TestTypes that match those selectors. func (c *testTypes) List(opts metav1.ListOptions) (result *v1.TestTypeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.TestTypeList{} err = c.client.Get(). Namespace(c.ns). Resource("testtypes"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -88,11 +95,16 @@ func (c *testTypes) List(opts metav1.ListOptions) (result *v1.TestTypeList, err // Watch returns a watch.Interface that watches the requested testTypes. func (c *testTypes) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("testtypes"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -150,10 +162,15 @@ func (c *testTypes) Delete(name string, options *metav1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *testTypes) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("testtypes"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/testtype.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/testtype.go index d19392e8..a06b9461 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/testtype.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/testtype.go @@ -19,6 +19,8 @@ limitations under the License. package internalversion import ( + "time" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" @@ -76,11 +78,16 @@ func (c *testTypes) Get(name string, options v1.GetOptions) (result *example.Tes // List takes label and field selectors, and returns the list of TestTypes that match those selectors. func (c *testTypes) List(opts v1.ListOptions) (result *example.TestTypeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &example.TestTypeList{} err = c.client.Get(). Namespace(c.ns). Resource("testtypes"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -88,11 +95,16 @@ func (c *testTypes) List(opts v1.ListOptions) (result *example.TestTypeList, err // Watch returns a watch.Interface that watches the requested testTypes. func (c *testTypes) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("testtypes"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -150,10 +162,15 @@ func (c *testTypes) Delete(name string, options *v1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *testTypes) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("testtypes"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/testtype.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/testtype.go index 1a2ca789..5380b86c 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/testtype.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/testtype.go @@ -19,6 +19,8 @@ limitations under the License. package internalversion import ( + "time" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" @@ -76,11 +78,16 @@ func (c *testTypes) Get(name string, options v1.GetOptions) (result *example2.Te // List takes label and field selectors, and returns the list of TestTypes that match those selectors. func (c *testTypes) List(opts v1.ListOptions) (result *example2.TestTypeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &example2.TestTypeList{} err = c.client.Get(). Namespace(c.ns). Resource("testtypes"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -88,11 +95,16 @@ func (c *testTypes) List(opts v1.ListOptions) (result *example2.TestTypeList, er // Watch returns a watch.Interface that watches the requested testTypes. func (c *testTypes) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("testtypes"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -150,10 +162,15 @@ func (c *testTypes) Delete(name string, options *v1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *testTypes) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("testtypes"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/testtype.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/testtype.go index 2a060651..e25fd1fc 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/testtype.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/testtype.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" @@ -76,11 +78,16 @@ func (c *testTypes) Get(name string, options metav1.GetOptions) (result *v1.Test // List takes label and field selectors, and returns the list of TestTypes that match those selectors. func (c *testTypes) List(opts metav1.ListOptions) (result *v1.TestTypeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.TestTypeList{} err = c.client.Get(). Namespace(c.ns). Resource("testtypes"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -88,11 +95,16 @@ func (c *testTypes) List(opts metav1.ListOptions) (result *v1.TestTypeList, err // Watch returns a watch.Interface that watches the requested testTypes. func (c *testTypes) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("testtypes"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -150,10 +162,15 @@ func (c *testTypes) Delete(name string, options *metav1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *testTypes) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("testtypes"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/testtype.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/testtype.go index b29bd811..f5afee94 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/testtype.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/testtype.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" @@ -76,11 +78,16 @@ func (c *testTypes) Get(name string, options metav1.GetOptions) (result *v1.Test // List takes label and field selectors, and returns the list of TestTypes that match those selectors. func (c *testTypes) List(opts metav1.ListOptions) (result *v1.TestTypeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.TestTypeList{} err = c.client.Get(). Namespace(c.ns). Resource("testtypes"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -88,11 +95,16 @@ func (c *testTypes) List(opts metav1.ListOptions) (result *v1.TestTypeList, err // Watch returns a watch.Interface that watches the requested testTypes. func (c *testTypes) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("testtypes"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -150,10 +162,15 @@ func (c *testTypes) Delete(name string, options *metav1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *testTypes) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("testtypes"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/clustertesttype.go b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/clustertesttype.go index 30e0e749..1217dd86 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/clustertesttype.go +++ b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/clustertesttype.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" @@ -77,10 +79,15 @@ func (c *clusterTestTypes) Get(name string, options metav1.GetOptions) (result * // List takes label and field selectors, and returns the list of ClusterTestTypes that match those selectors. func (c *clusterTestTypes) List(opts metav1.ListOptions) (result *v1.ClusterTestTypeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.ClusterTestTypeList{} err = c.client.Get(). Resource("clustertesttypes"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -88,10 +95,15 @@ func (c *clusterTestTypes) List(opts metav1.ListOptions) (result *v1.ClusterTest // Watch returns a watch.Interface that watches the requested clusterTestTypes. func (c *clusterTestTypes) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Resource("clustertesttypes"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -145,9 +157,14 @@ func (c *clusterTestTypes) Delete(name string, options *metav1.DeleteOptions) er // DeleteCollection deletes a collection of objects. func (c *clusterTestTypes) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Resource("clustertesttypes"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/testtype.go b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/testtype.go index 6fafb1e1..164b0510 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/testtype.go +++ b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/testtype.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" @@ -76,11 +78,16 @@ func (c *testTypes) Get(name string, options metav1.GetOptions) (result *v1.Test // List takes label and field selectors, and returns the list of TestTypes that match those selectors. func (c *testTypes) List(opts metav1.ListOptions) (result *v1.TestTypeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.TestTypeList{} err = c.client.Get(). Namespace(c.ns). Resource("testtypes"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -88,11 +95,16 @@ func (c *testTypes) List(opts metav1.ListOptions) (result *v1.TestTypeList, err // Watch returns a watch.Interface that watches the requested testTypes. func (c *testTypes) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("testtypes"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -150,10 +162,15 @@ func (c *testTypes) Delete(name string, options *metav1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *testTypes) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("testtypes"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/testtype.go b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/testtype.go index 69b0e64c..2e3194e0 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/testtype.go +++ b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/testtype.go @@ -19,6 +19,8 @@ limitations under the License. package v1 import ( + "time" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" @@ -76,11 +78,16 @@ func (c *testTypes) Get(name string, options metav1.GetOptions) (result *v1.Test // List takes label and field selectors, and returns the list of TestTypes that match those selectors. func (c *testTypes) List(opts metav1.ListOptions) (result *v1.TestTypeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1.TestTypeList{} err = c.client.Get(). Namespace(c.ns). Resource("testtypes"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -88,11 +95,16 @@ func (c *testTypes) List(opts metav1.ListOptions) (result *v1.TestTypeList, err // Watch returns a watch.Interface that watches the requested testTypes. func (c *testTypes) Watch(opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("testtypes"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -150,10 +162,15 @@ func (c *testTypes) Delete(name string, options *metav1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *testTypes) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("testtypes"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/client_generator.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/client_generator.go index bf536878..ee6ebbcf 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/client_generator.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/generators/client_generator.go @@ -32,7 +32,7 @@ import ( "k8s.io/gengo/namer" "k8s.io/gengo/types" - "github.com/golang/glog" + "k8s.io/klog" ) // NameSystems returns the name system used by the generators in this package. @@ -318,12 +318,12 @@ func applyGroupOverrides(universe types.Universe, customArgs *clientgenargs.Cust func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages { boilerplate, err := arguments.LoadGoBoilerplate() if err != nil { - glog.Fatalf("Failed loading boilerplate: %v", err) + klog.Fatalf("Failed loading boilerplate: %v", err) } customArgs, ok := arguments.CustomArgs.(*clientgenargs.CustomArgs) if !ok { - glog.Fatalf("cannot convert arguments.CustomArgs to clientgenargs.CustomArgs") + klog.Fatalf("cannot convert arguments.CustomArgs to clientgenargs.CustomArgs") } includedTypesOverrides := customArgs.IncludedTypesOverrides diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_type.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_type.go index 92e2a97f..3e8fc7c4 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_type.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_type.go @@ -387,11 +387,16 @@ func new$.type|publicPlural$(c *$.GroupGoName$$.Version$Client) *$.type|privateP var listTemplate = ` // List takes label and field selectors, and returns the list of $.resultType|publicPlural$ that match those selectors. func (c *$.type|privatePlural$) List(opts $.ListOptions|raw$) (result *$.resultType|raw$List, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil{ + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &$.resultType|raw$List{} err = c.client.Get(). $if .namespaced$Namespace(c.ns).$end$ Resource("$.type|resource$"). VersionedParams(&opts, $.schemeParameterCodec|raw$). + Timeout(timeout). Do(). Into(result) return @@ -401,6 +406,10 @@ func (c *$.type|privatePlural$) List(opts $.ListOptions|raw$) (result *$.resultT var listSubresourceTemplate = ` // List takes $.type|raw$ name, label and field selectors, and returns the list of $.resultType|publicPlural$ that match those selectors. func (c *$.type|privatePlural$) List($.type|private$Name string, opts $.ListOptions|raw$) (result *$.resultType|raw$List, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil{ + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &$.resultType|raw$List{} err = c.client.Get(). $if .namespaced$Namespace(c.ns).$end$ @@ -408,6 +417,7 @@ func (c *$.type|privatePlural$) List($.type|private$Name string, opts $.ListOpti Name($.type|private$Name). SubResource("$.subresourcePath$"). VersionedParams(&opts, $.schemeParameterCodec|raw$). + Timeout(timeout). Do(). Into(result) return @@ -461,10 +471,15 @@ func (c *$.type|privatePlural$) Delete(name string, options *$.DeleteOptions|raw var deleteCollectionTemplate = ` // DeleteCollection deletes a collection of objects. func (c *$.type|privatePlural$) DeleteCollection(options *$.DeleteOptions|raw$, listOptions $.ListOptions|raw$) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil{ + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). $if .namespaced$Namespace(c.ns).$end$ Resource("$.type|resource$"). VersionedParams(&listOptions, $.schemeParameterCodec|raw$). + Timeout(timeout). Body(options). Do(). Error() @@ -553,11 +568,16 @@ func (c *$.type|privatePlural$) UpdateStatus($.type|private$ *$.type|raw$) (resu var watchTemplate = ` // Watch returns a $.watchInterface|raw$ that watches the requested $.type|privatePlural$. func (c *$.type|privatePlural$) Watch(opts $.ListOptions|raw$) ($.watchInterface|raw$, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil{ + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). $if .namespaced$Namespace(c.ns).$end$ Resource("$.type|resource$"). VersionedParams(&opts, $.schemeParameterCodec|raw$). + Timeout(timeout). Watch() } ` diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/main.go b/vendor/k8s.io/code-generator/cmd/client-gen/main.go index 22c28e35..6e0d187f 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/main.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/main.go @@ -21,9 +21,9 @@ import ( "flag" "path/filepath" - "github.com/golang/glog" "github.com/spf13/pflag" "k8s.io/gengo/args" + "k8s.io/klog" generatorargs "k8s.io/code-generator/cmd/client-gen/args" "k8s.io/code-generator/cmd/client-gen/generators" @@ -31,6 +31,7 @@ import ( ) func main() { + klog.InitFlags(nil) genericArgs, customArgs := generatorargs.NewDefaults() // Override defaults. @@ -52,7 +53,7 @@ func main() { } if err := generatorargs.Validate(genericArgs); err != nil { - glog.Fatalf("Error: %v", err) + klog.Fatalf("Error: %v", err) } if err := genericArgs.Execute( @@ -60,6 +61,6 @@ func main() { generators.DefaultNameSystem(), generators.Packages, ); err != nil { - glog.Fatalf("Error: %v", err) + klog.Fatalf("Error: %v", err) } } diff --git a/vendor/k8s.io/code-generator/cmd/conversion-gen/generators/conversion.go b/vendor/k8s.io/code-generator/cmd/conversion-gen/generators/conversion.go index 422237e1..775972d1 100644 --- a/vendor/k8s.io/code-generator/cmd/conversion-gen/generators/conversion.go +++ b/vendor/k8s.io/code-generator/cmd/conversion-gen/generators/conversion.go @@ -29,7 +29,7 @@ import ( "k8s.io/gengo/namer" "k8s.io/gengo/types" - "github.com/golang/glog" + "k8s.io/klog" conversionargs "k8s.io/code-generator/cmd/conversion-gen/args" ) @@ -124,10 +124,10 @@ type conversionFuncMap map[conversionPair]*types.Type // Returns all manually-defined conversion functions in the package. func getManualConversionFunctions(context *generator.Context, pkg *types.Package, manualMap conversionFuncMap) { if pkg == nil { - glog.Warningf("Skipping nil package passed to getManualConversionFunctions") + klog.Warningf("Skipping nil package passed to getManualConversionFunctions") return } - glog.V(5).Infof("Scanning for conversion functions in %v", pkg.Name) + klog.V(5).Infof("Scanning for conversion functions in %v", pkg.Name) scopeName := types.Ref(conversionPackagePath, "Scope").Name errorName := types.Ref("", "error").Name @@ -136,34 +136,34 @@ func getManualConversionFunctions(context *generator.Context, pkg *types.Package for _, f := range pkg.Functions { if f.Underlying == nil || f.Underlying.Kind != types.Func { - glog.Errorf("Malformed function: %#v", f) + klog.Errorf("Malformed function: %#v", f) continue } if f.Underlying.Signature == nil { - glog.Errorf("Function without signature: %#v", f) + klog.Errorf("Function without signature: %#v", f) continue } - glog.V(8).Infof("Considering function %s", f.Name) + klog.V(8).Infof("Considering function %s", f.Name) signature := f.Underlying.Signature // Check whether the function is conversion function. // Note that all of them have signature: // func Convert_inType_To_outType(inType, outType, conversion.Scope) error if signature.Receiver != nil { - glog.V(8).Infof("%s has a receiver", f.Name) + klog.V(8).Infof("%s has a receiver", f.Name) continue } if len(signature.Parameters) != 3 || signature.Parameters[2].Name != scopeName { - glog.V(8).Infof("%s has wrong parameters", f.Name) + klog.V(8).Infof("%s has wrong parameters", f.Name) continue } if len(signature.Results) != 1 || signature.Results[0].Name != errorName { - glog.V(8).Infof("%s has wrong results", f.Name) + klog.V(8).Infof("%s has wrong results", f.Name) continue } inType := signature.Parameters[0] outType := signature.Parameters[1] if inType.Kind != types.Pointer || outType.Kind != types.Pointer { - glog.V(8).Infof("%s has wrong parameter types", f.Name) + klog.V(8).Infof("%s has wrong parameter types", f.Name) continue } // Now check if the name satisfies the convention. @@ -171,7 +171,7 @@ func getManualConversionFunctions(context *generator.Context, pkg *types.Package args := argsFromType(inType.Elem, outType.Elem) sw.Do("Convert_$.inType|public$_To_$.outType|public$", args) if f.Name.Name == buffer.String() { - glog.V(4).Infof("Found conversion function %s", f.Name) + klog.V(4).Infof("Found conversion function %s", f.Name) key := conversionPair{inType.Elem, outType.Elem} // We might scan the same package twice, and that's OK. if v, ok := manualMap[key]; ok && v != nil && v.Name.Package != pkg.Path { @@ -181,9 +181,9 @@ func getManualConversionFunctions(context *generator.Context, pkg *types.Package } else { // prevent user error when they don't get the correct conversion signature if strings.HasPrefix(f.Name.Name, "Convert_") { - glog.Errorf("Rename function %s %s -> %s to match expected conversion signature", f.Name.Package, f.Name.Name, buffer.String()) + klog.Errorf("Rename function %s %s -> %s to match expected conversion signature", f.Name.Package, f.Name.Name, buffer.String()) } - glog.V(8).Infof("%s has wrong name", f.Name) + klog.V(8).Infof("%s has wrong name", f.Name) } buffer.Reset() } @@ -192,7 +192,7 @@ func getManualConversionFunctions(context *generator.Context, pkg *types.Package func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages { boilerplate, err := arguments.LoadGoBoilerplate() if err != nil { - glog.Fatalf("Failed loading boilerplate: %v", err) + klog.Fatalf("Failed loading boilerplate: %v", err) } packages := generator.Packages{} @@ -220,7 +220,7 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat } processed[i] = true - glog.V(5).Infof("considering pkg %q", i) + klog.V(5).Infof("considering pkg %q", i) pkg := context.Universe[i] // typesPkg is where the versioned types are defined. Sometimes it is // different from pkg. For example, kubernetes core/v1 types are defined @@ -239,9 +239,9 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat // in their doc.go file. peerPkgs := extractTag(pkg.Comments) if peerPkgs != nil { - glog.V(5).Infof(" tags: %q", peerPkgs) + klog.V(5).Infof(" tags: %q", peerPkgs) } else { - glog.V(5).Infof(" no tag") + klog.V(5).Infof(" no tag") continue } skipUnsafe := false @@ -255,14 +255,14 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat externalTypesValues := extractExternalTypesTag(pkg.Comments) if externalTypesValues != nil { if len(externalTypesValues) != 1 { - glog.Fatalf(" expect only one value for %q tag, got: %q", externalTypesTagName, externalTypesValues) + klog.Fatalf(" expect only one value for %q tag, got: %q", externalTypesTagName, externalTypesValues) } externalTypes := externalTypesValues[0] - glog.V(5).Infof(" external types tags: %q", externalTypes) + klog.V(5).Infof(" external types tags: %q", externalTypes) var err error typesPkg, err = context.AddDirectory(externalTypes) if err != nil { - glog.Fatalf("cannot import package %s", externalTypes) + klog.Fatalf("cannot import package %s", externalTypes) } // update context.Order to the latest context.Universe orderer := namer.Orderer{Namer: namer.NewPublicNamer(1)} @@ -291,7 +291,7 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat context.AddDir(pp) p := context.Universe[pp] if nil == p { - glog.Fatalf("failed to find pkg: %s", pp) + klog.Fatalf("failed to find pkg: %s", pp) } getManualConversionFunctions(context, p, manualConversions) } @@ -335,7 +335,7 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat // from being a candidate for unsafe conversion for k, v := range manualConversions { if isCopyOnly(v.CommentLines) { - glog.V(5).Infof("Conversion function %s will not block memory copy because it is copy-only", v.Name) + klog.V(5).Infof("Conversion function %s will not block memory copy because it is copy-only", v.Name) continue } // this type should be excluded from all equivalence, because the converter must be called. @@ -518,9 +518,9 @@ func (g *genConversion) convertibleOnlyWithinPackage(inType, outType *types.Type tagvals := extractTag(t.CommentLines) if tagvals != nil { if tagvals[0] != "false" { - glog.Fatalf("Type %v: unsupported %s value: %q", t, tagName, tagvals[0]) + klog.Fatalf("Type %v: unsupported %s value: %q", t, tagName, tagvals[0]) } - glog.V(5).Infof("type %v requests no conversion generation, skipping", t) + klog.V(5).Infof("type %v requests no conversion generation, skipping", t) return false } // TODO: Consider generating functions for other kinds too. @@ -582,10 +582,10 @@ func (g *genConversion) preexists(inType, outType *types.Type) (*types.Type, boo } func (g *genConversion) Init(c *generator.Context, w io.Writer) error { - if glog.V(5) { + if klog.V(5) { if m, ok := g.useUnsafe.(equalMemoryTypes); ok { var result []string - glog.Infof("All objects without identical memory layout:") + klog.Infof("All objects without identical memory layout:") for k, v := range m { if v { continue @@ -594,7 +594,7 @@ func (g *genConversion) Init(c *generator.Context, w io.Writer) error { } sort.Strings(result) for _, s := range result { - glog.Infof(s) + klog.Infof(s) } } } @@ -643,7 +643,7 @@ func (g *genConversion) Init(c *generator.Context, w io.Writer) error { } func (g *genConversion) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - glog.V(5).Infof("generating for type %v", t) + klog.V(5).Infof("generating for type %v", t) peerType := getPeerTypeFor(c, t, g.peerPackages) sw := generator.NewSnippetWriter(w, c, "$", "$") g.generateConversion(t, peerType, sw) @@ -664,10 +664,10 @@ func (g *genConversion) generateConversion(inType, outType *types.Type, sw *gene // There is a public manual Conversion method: use it. } else if skipped := g.skippedFields[inType]; len(skipped) != 0 { // The inType had some fields we could not generate. - glog.Errorf("Warning: could not find nor generate a final Conversion function for %v -> %v", inType, outType) - glog.Errorf(" the following fields need manual conversion:") + klog.Errorf("Warning: could not find nor generate a final Conversion function for %v -> %v", inType, outType) + klog.Errorf(" the following fields need manual conversion:") for _, f := range skipped { - glog.Errorf(" - %v", f) + klog.Errorf(" - %v", f) } } else { // Emit a public conversion function. @@ -682,7 +682,7 @@ func (g *genConversion) generateConversion(inType, outType *types.Type, sw *gene // at any nesting level. This makes the autogenerator easy to understand, and // the compiler shouldn't care. func (g *genConversion) generateFor(inType, outType *types.Type, sw *generator.SnippetWriter) { - glog.V(5).Infof("generating %v -> %v", inType, outType) + klog.V(5).Infof("generating %v -> %v", inType, outType) var f func(*types.Type, *types.Type, *generator.SnippetWriter) switch inType.Kind { @@ -853,7 +853,7 @@ func (g *genConversion) doStruct(inType, outType *types.Type, sw *generator.Snip sw.Do("}\n", nil) continue } - glog.V(5).Infof("Skipped function %s because it is copy-only and we can use direct assignment", function.Name) + klog.V(5).Infof("Skipped function %s because it is copy-only and we can use direct assignment", function.Name) } // If we can't auto-convert, punt before we emit any code. diff --git a/vendor/k8s.io/code-generator/cmd/conversion-gen/main.go b/vendor/k8s.io/code-generator/cmd/conversion-gen/main.go index f2b91cc2..698baa7d 100644 --- a/vendor/k8s.io/code-generator/cmd/conversion-gen/main.go +++ b/vendor/k8s.io/code-generator/cmd/conversion-gen/main.go @@ -38,9 +38,9 @@ import ( "flag" "path/filepath" - "github.com/golang/glog" "github.com/spf13/pflag" "k8s.io/gengo/args" + "k8s.io/klog" generatorargs "k8s.io/code-generator/cmd/conversion-gen/args" "k8s.io/code-generator/cmd/conversion-gen/generators" @@ -48,6 +48,7 @@ import ( ) func main() { + klog.InitFlags(nil) genericArgs, customArgs := generatorargs.NewDefaults() // Override defaults. @@ -61,7 +62,7 @@ func main() { pflag.Parse() if err := generatorargs.Validate(genericArgs); err != nil { - glog.Fatalf("Error: %v", err) + klog.Fatalf("Error: %v", err) } // Run it. @@ -70,7 +71,7 @@ func main() { generators.DefaultNameSystem(), generators.Packages, ); err != nil { - glog.Fatalf("Error: %v", err) + klog.Fatalf("Error: %v", err) } - glog.V(2).Info("Completed successfully.") + klog.V(2).Info("Completed successfully.") } diff --git a/vendor/k8s.io/code-generator/cmd/deepcopy-gen/main.go b/vendor/k8s.io/code-generator/cmd/deepcopy-gen/main.go index cce65b77..96fb2987 100644 --- a/vendor/k8s.io/code-generator/cmd/deepcopy-gen/main.go +++ b/vendor/k8s.io/code-generator/cmd/deepcopy-gen/main.go @@ -46,16 +46,17 @@ import ( "flag" "path/filepath" - "github.com/golang/glog" "github.com/spf13/pflag" "k8s.io/gengo/args" "k8s.io/gengo/examples/deepcopy-gen/generators" + "k8s.io/klog" generatorargs "k8s.io/code-generator/cmd/deepcopy-gen/args" "k8s.io/code-generator/pkg/util" ) func main() { + klog.InitFlags(nil) genericArgs, customArgs := generatorargs.NewDefaults() // Override defaults. @@ -69,7 +70,7 @@ func main() { pflag.Parse() if err := generatorargs.Validate(genericArgs); err != nil { - glog.Fatalf("Error: %v", err) + klog.Fatalf("Error: %v", err) } // Run it. @@ -78,7 +79,7 @@ func main() { generators.DefaultNameSystem(), generators.Packages, ); err != nil { - glog.Fatalf("Error: %v", err) + klog.Fatalf("Error: %v", err) } - glog.V(2).Info("Completed successfully.") + klog.V(2).Info("Completed successfully.") } diff --git a/vendor/k8s.io/code-generator/cmd/defaulter-gen/main.go b/vendor/k8s.io/code-generator/cmd/defaulter-gen/main.go index 9d33f700..40bb875e 100644 --- a/vendor/k8s.io/code-generator/cmd/defaulter-gen/main.go +++ b/vendor/k8s.io/code-generator/cmd/defaulter-gen/main.go @@ -45,16 +45,17 @@ import ( "flag" "path/filepath" - "github.com/golang/glog" "github.com/spf13/pflag" "k8s.io/gengo/args" "k8s.io/gengo/examples/defaulter-gen/generators" + "k8s.io/klog" generatorargs "k8s.io/code-generator/cmd/defaulter-gen/args" "k8s.io/code-generator/pkg/util" ) func main() { + klog.InitFlags(nil) genericArgs, customArgs := generatorargs.NewDefaults() // Override defaults. @@ -68,7 +69,7 @@ func main() { pflag.Parse() if err := generatorargs.Validate(genericArgs); err != nil { - glog.Fatalf("Error: %v", err) + klog.Fatalf("Error: %v", err) } // Run it. @@ -77,7 +78,7 @@ func main() { generators.DefaultNameSystem(), generators.Packages, ); err != nil { - glog.Fatalf("Error: %v", err) + klog.Fatalf("Error: %v", err) } - glog.V(2).Info("Completed successfully.") + klog.V(2).Info("Completed successfully.") } diff --git a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/generator.go b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/generator.go index 49e8297d..1a9803dc 100644 --- a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/generator.go +++ b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/generator.go @@ -25,7 +25,7 @@ import ( "strconv" "strings" - "github.com/golang/glog" + "k8s.io/klog" "k8s.io/gengo/generator" "k8s.io/gengo/namer" @@ -85,7 +85,7 @@ func (g *genProtoIDL) Filter(c *generator.Context, t *types.Type) bool { // Type specified "true". return true } - glog.Fatalf(`Comment tag "protobuf" must be true or false, found: %q`, tagVals[0]) + klog.Fatalf(`Comment tag "protobuf" must be true or false, found: %q`, tagVals[0]) } if !g.generateAll { // We're not generating everything. diff --git a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/tags.go b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/tags.go index 2dff5b92..8e2a1917 100644 --- a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/tags.go +++ b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/tags.go @@ -17,8 +17,8 @@ limitations under the License. package protobuf import ( - "github.com/golang/glog" "k8s.io/gengo/types" + "k8s.io/klog" ) // extractBoolTagOrDie gets the comment-tags for the key and asserts that, if @@ -27,7 +27,7 @@ import ( func extractBoolTagOrDie(key string, lines []string) bool { val, err := types.ExtractSingleBoolCommentTag("+", key, false, lines) if err != nil { - glog.Fatal(err) + klog.Fatal(err) } return val } diff --git a/vendor/k8s.io/code-generator/cmd/import-boss/main.go b/vendor/k8s.io/code-generator/cmd/import-boss/main.go index d9989944..c0f10c3a 100644 --- a/vendor/k8s.io/code-generator/cmd/import-boss/main.go +++ b/vendor/k8s.io/code-generator/cmd/import-boss/main.go @@ -63,10 +63,11 @@ import ( "k8s.io/gengo/args" "k8s.io/gengo/examples/import-boss/generators" - "github.com/golang/glog" + "k8s.io/klog" ) func main() { + klog.InitFlags(nil) arguments := args.Default() // Override defaults. @@ -82,8 +83,8 @@ func main() { generators.DefaultNameSystem(), generators.Packages, ); err != nil { - glog.Errorf("Error: %v", err) + klog.Errorf("Error: %v", err) os.Exit(1) } - glog.V(2).Info("Completed successfully.") + klog.V(2).Info("Completed successfully.") } diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/factory.go b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/factory.go index 5c557db7..62ae109a 100644 --- a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/factory.go +++ b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/factory.go @@ -25,7 +25,7 @@ import ( "k8s.io/gengo/namer" "k8s.io/gengo/types" - "github.com/golang/glog" + "k8s.io/klog" ) // factoryGenerator produces a file of listers for a given GroupVersion and @@ -65,7 +65,7 @@ func (g *factoryGenerator) Imports(c *generator.Context) (imports []string) { func (g *factoryGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { sw := generator.NewSnippetWriter(w, c, "{{", "}}") - glog.V(5).Infof("processing type %v", t) + klog.V(5).Infof("processing type %v", t) gvInterfaces := make(map[string]*types.Type) gvNewFuncs := make(map[string]*types.Type) diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/factoryinterface.go b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/factoryinterface.go index 92cde148..fc0668c5 100644 --- a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/factoryinterface.go +++ b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/factoryinterface.go @@ -23,7 +23,7 @@ import ( "k8s.io/gengo/namer" "k8s.io/gengo/types" - "github.com/golang/glog" + "k8s.io/klog" ) // factoryInterfaceGenerator produces a file of interfaces used to break a dependency cycle for @@ -60,7 +60,7 @@ func (g *factoryInterfaceGenerator) Imports(c *generator.Context) (imports []str func (g *factoryInterfaceGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { sw := generator.NewSnippetWriter(w, c, "{{", "}}") - glog.V(5).Infof("processing type %v", t) + klog.V(5).Infof("processing type %v", t) m := map[string]interface{}{ "cacheSharedIndexInformer": c.Universe.Type(cacheSharedIndexInformer), diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/informer.go b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/informer.go index 88cc08df..9204d621 100644 --- a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/informer.go +++ b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/informer.go @@ -28,7 +28,7 @@ import ( "k8s.io/code-generator/cmd/client-gen/generators/util" clientgentypes "k8s.io/code-generator/cmd/client-gen/types" - "github.com/golang/glog" + "k8s.io/klog" ) // informerGenerator produces a file of listers for a given GroupVersion and @@ -66,7 +66,7 @@ func (g *informerGenerator) Imports(c *generator.Context) (imports []string) { func (g *informerGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { sw := generator.NewSnippetWriter(w, c, "$", "$") - glog.V(5).Infof("processing type %v", t) + klog.V(5).Infof("processing type %v", t) listerPackage := fmt.Sprintf("%s/%s/%s", g.listersPackage, g.groupPkgName, strings.ToLower(g.groupVersion.Version.NonEmpty())) clientSetInterface := c.Universe.Type(types.Name{Package: g.clientSetPackage, Name: "Interface"}) diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/packages.go b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/packages.go index 642f9a46..cfb91ceb 100644 --- a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/packages.go +++ b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/packages.go @@ -22,11 +22,11 @@ import ( "path/filepath" "strings" - "github.com/golang/glog" "k8s.io/gengo/args" "k8s.io/gengo/generator" "k8s.io/gengo/namer" "k8s.io/gengo/types" + "k8s.io/klog" "k8s.io/code-generator/cmd/client-gen/generators/util" clientgentypes "k8s.io/code-generator/cmd/client-gen/types" @@ -102,12 +102,12 @@ func vendorless(p string) string { func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages { boilerplate, err := arguments.LoadGoBoilerplate() if err != nil { - glog.Fatalf("Failed loading boilerplate: %v", err) + klog.Fatalf("Failed loading boilerplate: %v", err) } customArgs, ok := arguments.CustomArgs.(*informergenargs.CustomArgs) if !ok { - glog.Fatalf("Wrong CustomArgs type: %T", arguments.CustomArgs) + klog.Fatalf("Wrong CustomArgs type: %T", arguments.CustomArgs) } internalVersionPackagePath := filepath.Join(arguments.OutputPackagePath) @@ -128,7 +128,7 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat objectMeta, internal, err := objectMetaForPackage(p) if err != nil { - glog.Fatal(err) + klog.Fatal(err) } if objectMeta == nil { // no types in this package had genclient @@ -141,7 +141,7 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat if internal { lastSlash := strings.LastIndex(p.Path, "/") if lastSlash == -1 { - glog.Fatalf("error constructing internal group version for package %q", p.Path) + klog.Fatalf("error constructing internal group version for package %q", p.Path) } gv.Group = clientgentypes.Group(p.Path[lastSlash+1:]) targetGroupVersions = internalGroupVersions diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/tags.go b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/tags.go index afa28781..d25d5b63 100644 --- a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/tags.go +++ b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/tags.go @@ -17,8 +17,8 @@ limitations under the License. package generators import ( - "github.com/golang/glog" "k8s.io/gengo/types" + "k8s.io/klog" ) // extractBoolTagOrDie gets the comment-tags for the key and asserts that, if @@ -27,7 +27,7 @@ import ( func extractBoolTagOrDie(key string, lines []string) bool { val, err := types.ExtractSingleBoolCommentTag("+", key, false, lines) if err != nil { - glog.Fatal(err) + klog.Fatal(err) } return val } diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/main.go b/vendor/k8s.io/code-generator/cmd/informer-gen/main.go index bfe82608..14f3e923 100644 --- a/vendor/k8s.io/code-generator/cmd/informer-gen/main.go +++ b/vendor/k8s.io/code-generator/cmd/informer-gen/main.go @@ -20,16 +20,17 @@ import ( "flag" "path/filepath" - "github.com/golang/glog" "github.com/spf13/pflag" "k8s.io/code-generator/cmd/informer-gen/generators" "k8s.io/code-generator/pkg/util" "k8s.io/gengo/args" + "k8s.io/klog" generatorargs "k8s.io/code-generator/cmd/informer-gen/args" ) func main() { + klog.InitFlags(nil) genericArgs, customArgs := generatorargs.NewDefaults() // Override defaults. @@ -47,7 +48,7 @@ func main() { pflag.Parse() if err := generatorargs.Validate(genericArgs); err != nil { - glog.Fatalf("Error: %v", err) + klog.Fatalf("Error: %v", err) } // Run it. @@ -56,7 +57,7 @@ func main() { generators.DefaultNameSystem(), generators.Packages, ); err != nil { - glog.Fatalf("Error: %v", err) + klog.Fatalf("Error: %v", err) } - glog.V(2).Info("Completed successfully.") + klog.V(2).Info("Completed successfully.") } diff --git a/vendor/k8s.io/code-generator/cmd/lister-gen/generators/lister.go b/vendor/k8s.io/code-generator/cmd/lister-gen/generators/lister.go index cde6e2f7..c8ed5ad4 100644 --- a/vendor/k8s.io/code-generator/cmd/lister-gen/generators/lister.go +++ b/vendor/k8s.io/code-generator/cmd/lister-gen/generators/lister.go @@ -30,7 +30,7 @@ import ( "k8s.io/code-generator/cmd/client-gen/generators/util" clientgentypes "k8s.io/code-generator/cmd/client-gen/types" - "github.com/golang/glog" + "k8s.io/klog" ) // NameSystems returns the name system used by the generators in this package. @@ -66,7 +66,7 @@ func DefaultNameSystem() string { func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages { boilerplate, err := arguments.LoadGoBoilerplate() if err != nil { - glog.Fatalf("Failed loading boilerplate: %v", err) + klog.Fatalf("Failed loading boilerplate: %v", err) } var packageList generator.Packages @@ -75,7 +75,7 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat objectMeta, internal, err := objectMetaForPackage(p) if err != nil { - glog.Fatal(err) + klog.Fatal(err) } if objectMeta == nil { // no types in this package had genclient @@ -88,7 +88,7 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat if internal { lastSlash := strings.LastIndex(p.Path, "/") if lastSlash == -1 { - glog.Fatalf("error constructing internal group version for package %q", p.Path) + klog.Fatalf("error constructing internal group version for package %q", p.Path) } gv.Group = clientgentypes.Group(p.Path[lastSlash+1:]) internalGVPkg = p.Path @@ -223,7 +223,7 @@ func (g *listerGenerator) Imports(c *generator.Context) (imports []string) { func (g *listerGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { sw := generator.NewSnippetWriter(w, c, "$", "$") - glog.V(5).Infof("processing type %v", t) + klog.V(5).Infof("processing type %v", t) m := map[string]interface{}{ "Resource": c.Universe.Function(types.Name{Package: t.Name.Package, Name: "Resource"}), "type": t, diff --git a/vendor/k8s.io/code-generator/cmd/lister-gen/generators/tags.go b/vendor/k8s.io/code-generator/cmd/lister-gen/generators/tags.go index afa28781..d25d5b63 100644 --- a/vendor/k8s.io/code-generator/cmd/lister-gen/generators/tags.go +++ b/vendor/k8s.io/code-generator/cmd/lister-gen/generators/tags.go @@ -17,8 +17,8 @@ limitations under the License. package generators import ( - "github.com/golang/glog" "k8s.io/gengo/types" + "k8s.io/klog" ) // extractBoolTagOrDie gets the comment-tags for the key and asserts that, if @@ -27,7 +27,7 @@ import ( func extractBoolTagOrDie(key string, lines []string) bool { val, err := types.ExtractSingleBoolCommentTag("+", key, false, lines) if err != nil { - glog.Fatal(err) + klog.Fatal(err) } return val } diff --git a/vendor/k8s.io/code-generator/cmd/lister-gen/main.go b/vendor/k8s.io/code-generator/cmd/lister-gen/main.go index d5ff8e46..aca16b2b 100644 --- a/vendor/k8s.io/code-generator/cmd/lister-gen/main.go +++ b/vendor/k8s.io/code-generator/cmd/lister-gen/main.go @@ -20,16 +20,17 @@ import ( "flag" "path/filepath" - "github.com/golang/glog" "github.com/spf13/pflag" "k8s.io/code-generator/cmd/lister-gen/generators" "k8s.io/code-generator/pkg/util" "k8s.io/gengo/args" + "k8s.io/klog" generatorargs "k8s.io/code-generator/cmd/lister-gen/args" ) func main() { + klog.InitFlags(nil) genericArgs, customArgs := generatorargs.NewDefaults() // Override defaults. @@ -44,7 +45,7 @@ func main() { pflag.Parse() if err := generatorargs.Validate(genericArgs); err != nil { - glog.Fatalf("Error: %v", err) + klog.Fatalf("Error: %v", err) } // Run it. @@ -53,7 +54,7 @@ func main() { generators.DefaultNameSystem(), generators.Packages, ); err != nil { - glog.Fatalf("Error: %v", err) + klog.Fatalf("Error: %v", err) } - glog.V(2).Info("Completed successfully.") + klog.V(2).Info("Completed successfully.") } diff --git a/vendor/k8s.io/code-generator/cmd/openapi-gen/README b/vendor/k8s.io/code-generator/cmd/openapi-gen/README deleted file mode 100644 index e6dcc85d..00000000 --- a/vendor/k8s.io/code-generator/cmd/openapi-gen/README +++ /dev/null @@ -1,13 +0,0 @@ -# Generate OpenAPI definitions - -- To generate definition for a specific type or package add "+k8s:openapi-gen=true" tag to the type/package comment lines. -- To exclude a type or a member from a tagged package/type, add "+k8s:openapi-gen=false" tag to the comment lines. - -# OpenAPI Extensions -OpenAPI spec can have extensions on types. To define one or more extensions on a type or its member -add "+k8s:openapi-gen=x-kubernetes-$NAME:$VALUE" to the comment lines before type/member. A type/member can -have multiple extensions. The rest of the line in the comment will be used as $VALUE so there is no need to -escape or quote the value string. Extensions can be use to pass more information to client generators or -documentation generators. For example a type my have a friendly name to be displayed in documentation or -being used in a client's fluent interface. - diff --git a/vendor/k8s.io/code-generator/cmd/openapi-gen/args/args.go b/vendor/k8s.io/code-generator/cmd/openapi-gen/args/args.go deleted file mode 100644 index f9bb17e1..00000000 --- a/vendor/k8s.io/code-generator/cmd/openapi-gen/args/args.go +++ /dev/null @@ -1,53 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -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 args - -import ( - "fmt" - - "github.com/spf13/pflag" - "k8s.io/gengo/args" -) - -// CustomArgs is used by the gengo framework to pass args specific to this generator. -type CustomArgs struct{} - -// NewDefaults returns default arguments for the generator. -func NewDefaults() (*args.GeneratorArgs, *CustomArgs) { - genericArgs := args.Default().WithoutDefaultFlagParsing() - customArgs := &CustomArgs{} - genericArgs.CustomArgs = customArgs - genericArgs.OutputFileBaseName = "openapi_generated" - return genericArgs, customArgs -} - -// AddFlags add the generator flags to the flag set. -func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet) {} - -// Validate checks the given arguments. -func Validate(genericArgs *args.GeneratorArgs) error { - _ = genericArgs.CustomArgs.(*CustomArgs) - - if len(genericArgs.OutputFileBaseName) == 0 { - return fmt.Errorf("output file base name cannot be empty") - } - if len(genericArgs.OutputPackagePath) == 0 { - return fmt.Errorf("output package cannot be empty") - } - - return nil -} diff --git a/vendor/k8s.io/code-generator/cmd/openapi-gen/main.go b/vendor/k8s.io/code-generator/cmd/openapi-gen/main.go deleted file mode 100644 index fbafc502..00000000 --- a/vendor/k8s.io/code-generator/cmd/openapi-gen/main.go +++ /dev/null @@ -1,61 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This package generates openAPI definition file to be used in open API spec generation on API servers. To generate -// definition for a specific type or package add "+k8s:openapi-gen=true" tag to the type/package comment lines. To -// exclude a type from a tagged package, add "+k8s:openapi-gen=false" tag to the type comment lines. -package main - -import ( - "flag" - "path/filepath" - - "github.com/golang/glog" - "github.com/spf13/pflag" - "k8s.io/gengo/args" - "k8s.io/kube-openapi/pkg/generators" - - generatorargs "k8s.io/code-generator/cmd/openapi-gen/args" - "k8s.io/code-generator/pkg/util" -) - -func main() { - genericArgs, customArgs := generatorargs.NewDefaults() - - // Override defaults. - // TODO: move this out of openapi-gen - genericArgs.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), util.BoilerplatePath()) - - genericArgs.AddFlags(pflag.CommandLine) - customArgs.AddFlags(pflag.CommandLine) - flag.Set("logtostderr", "true") - pflag.CommandLine.AddGoFlagSet(flag.CommandLine) - pflag.Parse() - - if err := generatorargs.Validate(genericArgs); err != nil { - glog.Fatalf("Error: %v", err) - } - - // Run it. - if err := genericArgs.Execute( - generators.NameSystems(), - generators.DefaultNameSystem(), - generators.Packages, - ); err != nil { - glog.Fatalf("Error: %v", err) - } - glog.V(2).Info("Completed successfully.") -} diff --git a/vendor/k8s.io/code-generator/cmd/register-gen/generators/packages.go b/vendor/k8s.io/code-generator/cmd/register-gen/generators/packages.go index ca13ca85..5186e421 100644 --- a/vendor/k8s.io/code-generator/cmd/register-gen/generators/packages.go +++ b/vendor/k8s.io/code-generator/cmd/register-gen/generators/packages.go @@ -22,7 +22,7 @@ import ( "path" "strings" - "github.com/golang/glog" + "k8s.io/klog" clientgentypes "k8s.io/code-generator/cmd/client-gen/types" "k8s.io/gengo/args" @@ -46,7 +46,7 @@ func DefaultNameSystem() string { func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages { boilerplate, err := arguments.LoadGoBoilerplate() if err != nil { - glog.Fatalf("Failed loading boilerplate: %v", err) + klog.Fatalf("Failed loading boilerplate: %v", err) } packages := generator.Packages{} @@ -54,27 +54,27 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat pkg := context.Universe.Package(inputDir) internal, err := isInternal(pkg) if err != nil { - glog.V(5).Infof("skipping the generation of %s file, due to err %v", arguments.OutputFileBaseName, err) + klog.V(5).Infof("skipping the generation of %s file, due to err %v", arguments.OutputFileBaseName, err) continue } if internal { - glog.V(5).Infof("skipping the generation of %s file because %s package contains internal types, note that internal types don't have \"json\" tags", arguments.OutputFileBaseName, pkg.Name) + klog.V(5).Infof("skipping the generation of %s file because %s package contains internal types, note that internal types don't have \"json\" tags", arguments.OutputFileBaseName, pkg.Name) continue } registerFileName := "register.go" searchPath := path.Join(args.DefaultSourceTree(), inputDir, registerFileName) if _, err := os.Stat(path.Join(searchPath)); err == nil { - glog.V(5).Infof("skipping the generation of %s file because %s already exists in the path %s", arguments.OutputFileBaseName, registerFileName, searchPath) + klog.V(5).Infof("skipping the generation of %s file because %s already exists in the path %s", arguments.OutputFileBaseName, registerFileName, searchPath) continue } else if err != nil && !os.IsNotExist(err) { - glog.Fatalf("an error %v has occurred while checking if %s exists", err, registerFileName) + klog.Fatalf("an error %v has occurred while checking if %s exists", err, registerFileName) } gv := clientgentypes.GroupVersion{} { pathParts := strings.Split(pkg.Path, "/") if len(pathParts) < 2 { - glog.Errorf("the path of the package must contain the group name and the version, path = %s", pkg.Path) + klog.Errorf("the path of the package must contain the group name and the version, path = %s", pkg.Path) continue } gv.Group = clientgentypes.Group(pathParts[len(pathParts)-2]) @@ -84,14 +84,14 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat // extract the fully qualified API group name from it and overwrite the group inferred from the package path if override := types.ExtractCommentTags("+", pkg.DocComments)["groupName"]; override != nil { groupName := override[0] - glog.V(5).Infof("overriding the group name with = %s", groupName) + klog.V(5).Infof("overriding the group name with = %s", groupName) gv.Group = clientgentypes.Group(groupName) } } typesToRegister := []*types.Type{} for _, t := range pkg.Types { - glog.V(5).Infof("considering type = %s", t.Name.String()) + klog.V(5).Infof("considering type = %s", t.Name.String()) for _, typeMember := range t.Members { if typeMember.Name == "TypeMeta" && typeMember.Embedded == true { typesToRegister = append(typesToRegister, t) diff --git a/vendor/k8s.io/code-generator/cmd/register-gen/main.go b/vendor/k8s.io/code-generator/cmd/register-gen/main.go index db02a4af..30a175d8 100644 --- a/vendor/k8s.io/code-generator/cmd/register-gen/main.go +++ b/vendor/k8s.io/code-generator/cmd/register-gen/main.go @@ -20,8 +20,8 @@ import ( "flag" "path/filepath" - "github.com/golang/glog" "github.com/spf13/pflag" + "k8s.io/klog" generatorargs "k8s.io/code-generator/cmd/register-gen/args" "k8s.io/code-generator/cmd/register-gen/generators" @@ -30,6 +30,7 @@ import ( ) func main() { + klog.InitFlags(nil) genericArgs := generatorargs.NewDefaults() genericArgs.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), util.BoilerplatePath()) genericArgs.AddFlags(pflag.CommandLine) @@ -38,7 +39,7 @@ func main() { pflag.Parse() if err := generatorargs.Validate(genericArgs); err != nil { - glog.Fatalf("Error: %v", err) + klog.Fatalf("Error: %v", err) } if err := genericArgs.Execute( @@ -46,7 +47,7 @@ func main() { generators.DefaultNameSystem(), generators.Packages, ); err != nil { - glog.Fatalf("Error: %v", err) + klog.Fatalf("Error: %v", err) } - glog.V(2).Info("Completed successfully.") + klog.V(2).Info("Completed successfully.") } diff --git a/vendor/k8s.io/code-generator/cmd/set-gen/main.go b/vendor/k8s.io/code-generator/cmd/set-gen/main.go index cf8f01d8..45694d4f 100644 --- a/vendor/k8s.io/code-generator/cmd/set-gen/main.go +++ b/vendor/k8s.io/code-generator/cmd/set-gen/main.go @@ -32,10 +32,11 @@ import ( "k8s.io/gengo/args" "k8s.io/gengo/examples/set-gen/generators" - "github.com/golang/glog" + "k8s.io/klog" ) func main() { + klog.InitFlags(nil) arguments := args.Default() // Override defaults. @@ -48,8 +49,8 @@ func main() { generators.DefaultNameSystem(), generators.Packages, ); err != nil { - glog.Errorf("Error: %v", err) + klog.Errorf("Error: %v", err) os.Exit(1) } - glog.V(2).Info("Completed successfully.") + klog.V(2).Info("Completed successfully.") } diff --git a/vendor/github.com/ghodss/yaml/.gitignore b/vendor/sigs.k8s.io/yaml/.gitignore similarity index 100% rename from vendor/github.com/ghodss/yaml/.gitignore rename to vendor/sigs.k8s.io/yaml/.gitignore diff --git a/vendor/sigs.k8s.io/yaml/.travis.yml b/vendor/sigs.k8s.io/yaml/.travis.yml new file mode 100644 index 00000000..03ddc731 --- /dev/null +++ b/vendor/sigs.k8s.io/yaml/.travis.yml @@ -0,0 +1,14 @@ +language: go +dist: xenial +go: + - 1.9.x + - 1.10.x + - 1.11.x +script: + - go get -t -v ./... + - diff -u <(echo -n) <(gofmt -d .) + - diff -u <(echo -n) <(golint $(go list -e ./...) | grep -v YAMLToJSON) + - go tool vet . + - go test -v -race ./... +install: + - go get golang.org/x/lint/golint diff --git a/vendor/sigs.k8s.io/yaml/CONTRIBUTING.md b/vendor/sigs.k8s.io/yaml/CONTRIBUTING.md new file mode 100644 index 00000000..de471151 --- /dev/null +++ b/vendor/sigs.k8s.io/yaml/CONTRIBUTING.md @@ -0,0 +1,31 @@ +# Contributing Guidelines + +Welcome to Kubernetes. We are excited about the prospect of you joining our [community](https://github.com/kubernetes/community)! The Kubernetes community abides by the CNCF [code of conduct](code-of-conduct.md). Here is an excerpt: + +_As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities._ + +## Getting Started + +We have full documentation on how to get started contributing here: + + + +- [Contributor License Agreement](https://git.k8s.io/community/CLA.md) Kubernetes projects require that you sign a Contributor License Agreement (CLA) before we can accept your pull requests +- [Kubernetes Contributor Guide](http://git.k8s.io/community/contributors/guide) - Main contributor documentation, or you can just jump directly to the [contributing section](http://git.k8s.io/community/contributors/guide#contributing) +- [Contributor Cheat Sheet](https://git.k8s.io/community/contributors/guide/contributor-cheatsheet.md) - Common resources for existing developers + +## Mentorship + +- [Mentoring Initiatives](https://git.k8s.io/community/mentoring) - We have a diverse set of mentorship programs available that are always looking for volunteers! + + diff --git a/vendor/github.com/ghodss/yaml/LICENSE b/vendor/sigs.k8s.io/yaml/LICENSE similarity index 100% rename from vendor/github.com/ghodss/yaml/LICENSE rename to vendor/sigs.k8s.io/yaml/LICENSE diff --git a/vendor/sigs.k8s.io/yaml/OWNERS b/vendor/sigs.k8s.io/yaml/OWNERS new file mode 100644 index 00000000..11ad7ce1 --- /dev/null +++ b/vendor/sigs.k8s.io/yaml/OWNERS @@ -0,0 +1,25 @@ +approvers: +- dims +- lavalamp +- smarterclayton +- deads2k +- sttts +- liggitt +- caesarxuchao +reviewers: +- dims +- thockin +- lavalamp +- smarterclayton +- wojtek-t +- deads2k +- derekwaynecarr +- caesarxuchao +- mikedanese +- liggitt +- gmarek +- sttts +- ncdc +- tallclair +labels: +- sig/api-machinery diff --git a/vendor/github.com/ghodss/yaml/README.md b/vendor/sigs.k8s.io/yaml/README.md similarity index 100% rename from vendor/github.com/ghodss/yaml/README.md rename to vendor/sigs.k8s.io/yaml/README.md diff --git a/vendor/sigs.k8s.io/yaml/RELEASE.md b/vendor/sigs.k8s.io/yaml/RELEASE.md new file mode 100644 index 00000000..6b642464 --- /dev/null +++ b/vendor/sigs.k8s.io/yaml/RELEASE.md @@ -0,0 +1,9 @@ +# Release Process + +The `yaml` Project is released on an as-needed basis. The process is as follows: + +1. An issue is proposing a new release with a changelog since the last release +1. All [OWNERS](OWNERS) must LGTM this release +1. An OWNER runs `git tag -s $VERSION` and inserts the changelog and pushes the tag with `git push $VERSION` +1. The release issue is closed +1. An announcement email is sent to `kubernetes-dev@googlegroups.com` with the subject `[ANNOUNCE] kubernetes-template-project $VERSION is released` diff --git a/vendor/sigs.k8s.io/yaml/SECURITY_CONTACTS b/vendor/sigs.k8s.io/yaml/SECURITY_CONTACTS new file mode 100644 index 00000000..0648a8eb --- /dev/null +++ b/vendor/sigs.k8s.io/yaml/SECURITY_CONTACTS @@ -0,0 +1,17 @@ +# Defined below are the security contacts for this repo. +# +# They are the contact point for the Product Security Team to reach out +# to for triaging and handling of incoming issues. +# +# The below names agree to abide by the +# [Embargo Policy](https://github.com/kubernetes/sig-release/blob/master/security-release-process-documentation/security-release-process.md#embargo-policy) +# and will be removed and replaced if they violate that agreement. +# +# DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE +# INSTRUCTIONS AT https://kubernetes.io/security/ + +cjcullen +jessfraz +liggitt +philips +tallclair diff --git a/vendor/sigs.k8s.io/yaml/code-of-conduct.md b/vendor/sigs.k8s.io/yaml/code-of-conduct.md new file mode 100644 index 00000000..0d15c00c --- /dev/null +++ b/vendor/sigs.k8s.io/yaml/code-of-conduct.md @@ -0,0 +1,3 @@ +# Kubernetes Community Code of Conduct + +Please refer to our [Kubernetes Community Code of Conduct](https://git.k8s.io/community/code-of-conduct.md) diff --git a/vendor/github.com/ghodss/yaml/fields.go b/vendor/sigs.k8s.io/yaml/fields.go similarity index 99% rename from vendor/github.com/ghodss/yaml/fields.go rename to vendor/sigs.k8s.io/yaml/fields.go index 58600740..235b7f2c 100644 --- a/vendor/github.com/ghodss/yaml/fields.go +++ b/vendor/sigs.k8s.io/yaml/fields.go @@ -1,6 +1,7 @@ // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. + package yaml import ( diff --git a/vendor/github.com/ghodss/yaml/yaml.go b/vendor/sigs.k8s.io/yaml/yaml.go similarity index 77% rename from vendor/github.com/ghodss/yaml/yaml.go rename to vendor/sigs.k8s.io/yaml/yaml.go index 4fb4054a..02459611 100644 --- a/vendor/github.com/ghodss/yaml/yaml.go +++ b/vendor/sigs.k8s.io/yaml/yaml.go @@ -4,13 +4,14 @@ import ( "bytes" "encoding/json" "fmt" + "io" "reflect" "strconv" "gopkg.in/yaml.v2" ) -// Marshals the object into JSON then converts JSON to YAML and returns the +// Marshal marshals the object into JSON then converts JSON to YAML and returns the // YAML. func Marshal(o interface{}) ([]byte, error) { j, err := json.Marshal(o) @@ -26,15 +27,35 @@ func Marshal(o interface{}) ([]byte, error) { return y, nil } -// Converts YAML to JSON then uses JSON to unmarshal into an object. -func Unmarshal(y []byte, o interface{}) error { +// JSONOpt is a decoding option for decoding from JSON format. +type JSONOpt func(*json.Decoder) *json.Decoder + +// Unmarshal converts YAML to JSON then uses JSON to unmarshal into an object, +// optionally configuring the behavior of the JSON unmarshal. +func Unmarshal(y []byte, o interface{}, opts ...JSONOpt) error { + return yamlUnmarshal(y, o, false, opts...) +} + +// UnmarshalStrict strictly converts YAML to JSON then uses JSON to unmarshal +// into an object, optionally configuring the behavior of the JSON unmarshal. +func UnmarshalStrict(y []byte, o interface{}, opts ...JSONOpt) error { + return yamlUnmarshal(y, o, true, append(opts, DisallowUnknownFields)...) +} + +// yamlUnmarshal unmarshals the given YAML byte stream into the given interface, +// optionally performing the unmarshalling strictly +func yamlUnmarshal(y []byte, o interface{}, strict bool, opts ...JSONOpt) error { vo := reflect.ValueOf(o) - j, err := yamlToJSON(y, &vo) + unmarshalFn := yaml.Unmarshal + if strict { + unmarshalFn = yaml.UnmarshalStrict + } + j, err := yamlToJSON(y, &vo, unmarshalFn) if err != nil { return fmt.Errorf("error converting YAML to JSON: %v", err) } - err = json.Unmarshal(j, o) + err = jsonUnmarshal(bytes.NewReader(j), o, opts...) if err != nil { return fmt.Errorf("error unmarshaling JSON: %v", err) } @@ -42,7 +63,22 @@ func Unmarshal(y []byte, o interface{}) error { return nil } -// Convert JSON to YAML. +// jsonUnmarshal unmarshals the JSON byte stream from the given reader into the +// object, optionally applying decoder options prior to decoding. We are not +// using json.Unmarshal directly as we want the chance to pass in non-default +// options. +func jsonUnmarshal(r io.Reader, o interface{}, opts ...JSONOpt) error { + d := json.NewDecoder(r) + for _, opt := range opts { + d = opt(d) + } + if err := d.Decode(&o); err != nil { + return fmt.Errorf("while decoding JSON: %v", err) + } + return nil +} + +// JSONToYAML Converts JSON to YAML. func JSONToYAML(j []byte) ([]byte, error) { // Convert the JSON to an object. var jsonObj interface{} @@ -60,8 +96,8 @@ func JSONToYAML(j []byte) ([]byte, error) { return yaml.Marshal(jsonObj) } -// Convert YAML to JSON. Since JSON is a subset of YAML, passing JSON through -// this method should be a no-op. +// YAMLToJSON converts YAML to JSON. Since JSON is a subset of YAML, +// passing JSON through this method should be a no-op. // // Things YAML can do that are not supported by JSON: // * In YAML you can have binary and null keys in your maps. These are invalid @@ -70,14 +106,22 @@ func JSONToYAML(j []byte) ([]byte, error) { // use binary data with this library, encode the data as base64 as usual but do // not use the !!binary tag in your YAML. This will ensure the original base64 // encoded data makes it all the way through to the JSON. +// +// For strict decoding of YAML, use YAMLToJSONStrict. func YAMLToJSON(y []byte) ([]byte, error) { - return yamlToJSON(y, nil) + return yamlToJSON(y, nil, yaml.Unmarshal) } -func yamlToJSON(y []byte, jsonTarget *reflect.Value) ([]byte, error) { +// YAMLToJSONStrict is like YAMLToJSON but enables strict YAML decoding, +// returning an error on any duplicate field names. +func YAMLToJSONStrict(y []byte) ([]byte, error) { + return yamlToJSON(y, nil, yaml.UnmarshalStrict) +} + +func yamlToJSON(y []byte, jsonTarget *reflect.Value, yamlUnmarshal func([]byte, interface{}) error) ([]byte, error) { // Convert the YAML to an object. var yamlObj interface{} - err := yaml.Unmarshal(y, &yamlObj) + err := yamlUnmarshal(y, &yamlObj) if err != nil { return nil, err } @@ -272,6 +316,4 @@ func convertToJSONableObject(yamlObj interface{}, jsonTarget *reflect.Value) (in } return yamlObj, nil } - - return nil, nil } diff --git a/vendor/sigs.k8s.io/yaml/yaml_go110.go b/vendor/sigs.k8s.io/yaml/yaml_go110.go new file mode 100644 index 00000000..ab3e06a2 --- /dev/null +++ b/vendor/sigs.k8s.io/yaml/yaml_go110.go @@ -0,0 +1,14 @@ +// This file contains changes that are only compatible with go 1.10 and onwards. + +// +build go1.10 + +package yaml + +import "encoding/json" + +// DisallowUnknownFields configures the JSON decoder to error out if unknown +// fields come along, instead of dropping them by default. +func DisallowUnknownFields(d *json.Decoder) *json.Decoder { + d.DisallowUnknownFields() + return d +} diff --git a/vendor/sigs.k8s.io/yaml/yaml_go110_test.go b/vendor/sigs.k8s.io/yaml/yaml_go110_test.go new file mode 100644 index 00000000..e4707e8a --- /dev/null +++ b/vendor/sigs.k8s.io/yaml/yaml_go110_test.go @@ -0,0 +1,46 @@ +// +build go1.10 + +package yaml + +import ( + "fmt" + "testing" +) + +func TestUnmarshalWithTags(t *testing.T) { + type WithTaggedField struct { + Field string `json:"field"` + } + + t.Run("Known tagged field", func(t *testing.T) { + y := []byte(`field: "hello"`) + v := WithTaggedField{} + if err := Unmarshal(y, &v, DisallowUnknownFields); err != nil { + t.Errorf("unexpected error: %v", err) + } + if v.Field != "hello" { + t.Errorf("v.Field=%v, want 'hello'", v.Field) + } + + }) + t.Run("With unknown tagged field", func(t *testing.T) { + y := []byte(`unknown: "hello"`) + v := WithTaggedField{} + err := Unmarshal(y, &v, DisallowUnknownFields) + if err == nil { + t.Errorf("want error because of unknown field, got : v=%#v", v) + } + }) + +} + +func exampleUnknown() { + type WithTaggedField struct { + Field string `json:"field"` + } + y := []byte(`unknown: "hello"`) + v := WithTaggedField{} + fmt.Printf("%v\n", Unmarshal(y, &v, DisallowUnknownFields)) + // Ouptut: + // unmarshaling JSON: while decoding JSON: json: unknown field "unknown" +} diff --git a/vendor/github.com/ghodss/yaml/yaml_test.go b/vendor/sigs.k8s.io/yaml/yaml_test.go similarity index 62% rename from vendor/github.com/ghodss/yaml/yaml_test.go rename to vendor/sigs.k8s.io/yaml/yaml_test.go index 505af453..42a23156 100644 --- a/vendor/github.com/ghodss/yaml/yaml_test.go +++ b/vendor/sigs.k8s.io/yaml/yaml_test.go @@ -106,8 +106,8 @@ b: unmarshal(t, y, &s5, &e5) } -func unmarshal(t *testing.T, y []byte, s, e interface{}) { - err := Unmarshal(y, s) +func unmarshal(t *testing.T, y []byte, s, e interface{}, opts ...JSONOpt) { + err := Unmarshal(y, s, opts...) if err != nil { t.Errorf("error unmarshaling YAML: %v", err) } @@ -118,6 +118,129 @@ func unmarshal(t *testing.T, y []byte, s, e interface{}) { } } +func TestUnmarshalStrict(t *testing.T) { + y := []byte("a: 1") + s1 := UnmarshalString{} + e1 := UnmarshalString{A: "1"} + unmarshalStrict(t, y, &s1, &e1) + + y = []byte("a: true") + s1 = UnmarshalString{} + e1 = UnmarshalString{A: "true"} + unmarshalStrict(t, y, &s1, &e1) + + y = []byte("true: 1") + s1 = UnmarshalString{} + e1 = UnmarshalString{True: "1"} + unmarshalStrict(t, y, &s1, &e1) + + y = []byte("a:\n a: 1") + s2 := UnmarshalNestedString{} + e2 := UnmarshalNestedString{NestedString{"1"}} + unmarshalStrict(t, y, &s2, &e2) + + y = []byte("a:\n - b: abc\n c: def\n - b: 123\n c: 456\n") + s3 := UnmarshalSlice{} + e3 := UnmarshalSlice{[]NestedSlice{NestedSlice{"abc", strPtr("def")}, NestedSlice{"123", strPtr("456")}}} + unmarshalStrict(t, y, &s3, &e3) + + y = []byte("a:\n b: 1") + s4 := UnmarshalStringMap{} + e4 := UnmarshalStringMap{map[string]string{"b": "1"}} + unmarshalStrict(t, y, &s4, &e4) + + y = []byte(` +a: + name: TestA +b: + name: TestB +`) + type NamedThing struct { + Name string `json:"name"` + } + s5 := map[string]*NamedThing{} + e5 := map[string]*NamedThing{ + "a": &NamedThing{Name: "TestA"}, + "b": &NamedThing{Name: "TestB"}, + } + unmarshal(t, y, &s5, &e5) + + // When using not-so-strict unmarshal, we should + // be picking up the ID-1 as the value in the "id" field + y = []byte(` +a: + name: TestA + id: ID-A + id: ID-1 +`) + type NamedThing2 struct { + Name string `json:"name"` + ID string `json:"id"` + } + s6 := map[string]*NamedThing2{} + e6 := map[string]*NamedThing2{ + "a": {Name: "TestA", ID: "ID-1"}, + } + unmarshal(t, y, &s6, &e6) +} + +func TestUnmarshalStrictFails(t *testing.T) { + y := []byte("a: true\na: false") + s1 := UnmarshalString{} + unmarshalStrictFail(t, y, &s1) + + y = []byte("a:\n - b: abc\n c: 32\n b: 123") + s2 := UnmarshalSlice{} + unmarshalStrictFail(t, y, &s2) + + y = []byte("a:\n b: 1\n c: 3") + s3 := UnmarshalStringMap{} + unmarshalStrictFail(t, y, &s3) + + type NamedThing struct { + Name string `json:"name"` + ID string `json:"id"` + } + // When using strict unmarshal, we should see + // the unmarshal fail if there are multiple keys + y = []byte(` +a: + name: TestA + id: ID-A + id: ID-1 +`) + s4 := NamedThing{} + unmarshalStrictFail(t, y, &s4) + + // Strict unmarshal should fail for unknown fields + y = []byte(` +name: TestB +id: ID-B +unknown: Some-Value +`) + s5 := NamedThing{} + unmarshalStrictFail(t, y, &s5) +} + +func unmarshalStrict(t *testing.T, y []byte, s, e interface{}, opts ...JSONOpt) { + err := UnmarshalStrict(y, s, opts...) + if err != nil { + t.Errorf("error unmarshaling YAML: %v", err) + } + + if !reflect.DeepEqual(s, e) { + t.Errorf("unmarshal YAML was unsuccessful, expected: %+#v, got: %+#v", + e, s) + } +} + +func unmarshalStrictFail(t *testing.T, y []byte, s interface{}, opts ...JSONOpt) { + err := UnmarshalStrict(y, s, opts...) + if err == nil { + t.Errorf("error unmarshaling YAML: %v", err) + } +} + type Case struct { input string output string @@ -285,3 +408,16 @@ func runCases(t *testing.T, runType RunType, cases []Case) { func strPtr(s string) *string { return &s } + +func TestYAMLToJSONStrict(t *testing.T) { + const data = ` +foo: bar +foo: baz +` + if _, err := YAMLToJSON([]byte(data)); err != nil { + t.Error("expected YAMLtoJSON to pass on duplicate field names") + } + if _, err := YAMLToJSONStrict([]byte(data)); err == nil { + t.Error("expected YAMLtoJSONStrict to fail on duplicate field names") + } +}