diff --git a/doc/swagger.yaml b/doc/swagger.yaml index fdad9b6e..b9c2c987 100644 --- a/doc/swagger.yaml +++ b/doc/swagger.yaml @@ -1,703 +1,1972 @@ basePath: / consumes: -- application/json + - application/json definitions: - AccessDefinition: - properties: - allowed_urls: - items: - $ref: '#/definitions/AccessSpec' - type: array - x-go-name: AllowedUrls - api_id: - type: string - x-go-name: ApiId - api_name: - type: string - x-go-name: ApiName - versions: - items: - type: string - type: array - x-go-name: Versions - type: object - x-go-package: github.com/TykTechnologies/mserv/coprocess/bindings/go - AccessSpec: - properties: - methods: - items: - type: string - type: array - x-go-name: Methods - url: - type: string - x-go-name: Url - type: object - x-go-package: github.com/TykTechnologies/mserv/coprocess/bindings/go - BasicAuthData: - properties: - hash: - type: string - x-go-name: Hash - password: + APIDefinition: + properties: + CORS: + properties: + allow_credentials: + type: boolean + x-go-name: AllowCredentials + allowed_headers: + items: + type: string + type: array + x-go-name: AllowedHeaders + allowed_methods: + items: + type: string + type: array + x-go-name: AllowedMethods + allowed_origins: + items: + type: string + type: array + x-go-name: AllowedOrigins + debug: + type: boolean + x-go-name: Debug + enable: + type: boolean + x-go-name: Enable + exposed_headers: + items: + type: string + type: array + x-go-name: ExposedHeaders + max_age: + format: int64 + type: integer + x-go-name: MaxAge + options_passthrough: + type: boolean + x-go-name: OptionsPassthrough + type: object + active: + type: boolean + x-go-name: Active + allowed_ips: + items: + type: string + type: array + x-go-name: AllowedIPs + api_id: + type: string + x-go-name: APIID + auth: + $ref: '#/definitions/AuthConfig' + auth_configs: + additionalProperties: + $ref: '#/definitions/AuthConfig' + type: object + x-go-name: AuthConfigs + auth_provider: + $ref: '#/definitions/AuthProviderMeta' + base_identity_provided_by: + $ref: '#/definitions/AuthTypeEnum' + basic_auth: + properties: + body_password_regexp: + type: string + x-go-name: BodyPasswordRegexp + body_user_regexp: + type: string + x-go-name: BodyUserRegexp + cache_ttl: + format: int64 + type: integer + x-go-name: CacheTTL + disable_caching: + type: boolean + x-go-name: DisableCaching + extract_from_body: + type: boolean + x-go-name: ExtractFromBody + type: object + x-go-name: BasicAuth + blacklisted_ips: + items: + type: string + type: array + x-go-name: BlacklistedIPs + cache_options: + $ref: '#/definitions/CacheOptions' + certificates: + items: + type: string + type: array + x-go-name: Certificates + client_certificates: + items: + type: string + type: array + x-go-name: ClientCertificates + config_data: + additionalProperties: {} + type: object + x-go-name: ConfigData + custom_middleware: + $ref: '#/definitions/MiddlewareSection' + custom_middleware_bundle: + type: string + x-go-name: CustomMiddlewareBundle + definition: + properties: + key: + type: string + x-go-name: Key + location: + type: string + x-go-name: Location + strip_path: + type: boolean + x-go-name: StripPath + type: object + x-go-name: VersionDefinition + disable_quota: + type: boolean + x-go-name: DisableQuota + disable_rate_limit: + type: boolean + x-go-name: DisableRateLimit + do_not_track: + type: boolean + x-go-name: DoNotTrack + domain: + type: string + x-go-name: Domain + dont_set_quota_on_create: + type: boolean + x-go-name: DontSetQuotasOnCreate + enable_batch_request_support: + type: boolean + x-go-name: EnableBatchRequestSupport + enable_context_vars: + type: boolean + x-go-name: EnableContextVars + enable_coprocess_auth: + type: boolean + x-go-name: EnableCoProcessAuth + enable_detailed_recording: + type: boolean + x-go-name: EnableDetailedRecording + enable_ip_blacklisting: + type: boolean + x-go-name: EnableIpBlacklisting + enable_ip_whitelisting: + type: boolean + x-go-name: EnableIpWhiteListing + enable_jwt: + type: boolean + x-go-name: EnableJWT + enable_proxy_protocol: + type: boolean + x-go-name: EnableProxyProtocol + enable_signature_checking: + type: boolean + x-go-name: EnableSignatureChecking + event_handlers: + $ref: '#/definitions/EventHandlerMetaConfig' + expire_analytics_after: + format: int64 + type: integer + x-go-name: ExpireAnalyticsAfter + global_rate_limit: + $ref: '#/definitions/GlobalRateLimit' + hmac_allowed_algorithms: + items: + type: string + type: array + x-go-name: HmacAllowedAlgorithms + hmac_allowed_clock_skew: + format: double + type: number + x-go-name: HmacAllowedClockSkew + id: + type: string + x-go-name: Id + internal: + type: boolean + x-go-name: Internal + jwt_client_base_field: + type: string + x-go-name: JWTClientIDBaseField + jwt_default_policies: + items: + type: string + type: array + x-go-name: JWTDefaultPolicies + jwt_expires_at_validation_skew: + format: uint64 + type: integer + x-go-name: JWTExpiresAtValidationSkew + jwt_identity_base_field: + type: string + x-go-name: JWTIdentityBaseField + jwt_issued_at_validation_skew: + format: uint64 + type: integer + x-go-name: JWTIssuedAtValidationSkew + jwt_not_before_validation_skew: + format: uint64 + type: integer + x-go-name: JWTNotBeforeValidationSkew + jwt_policy_field_name: + type: string + x-go-name: JWTPolicyFieldName + jwt_scope_claim_name: + type: string + x-go-name: JWTScopeClaimName + jwt_scope_to_policy_mapping: + additionalProperties: + type: string + type: object + x-go-name: JWTScopeToPolicyMapping + jwt_signing_method: + type: string + x-go-name: JWTSigningMethod + jwt_skip_kid: + type: boolean + x-go-name: JWTSkipKid + jwt_source: + type: string + x-go-name: JWTSource + listen_port: + format: int64 + type: integer + x-go-name: ListenPort + name: + type: string + x-go-name: Name + notifications: + $ref: '#/definitions/NotificationsManager' + oauth_meta: + properties: + allowed_access_types: + items: + $ref: '#/definitions/AccessRequestType' + type: array + x-go-name: AllowedAccessTypes + allowed_authorize_types: + items: + $ref: '#/definitions/AuthorizeRequestType' + type: array + x-go-name: AllowedAuthorizeTypes + auth_login_redirect: + type: string + x-go-name: AuthorizeLoginRedirect + type: object + x-go-name: Oauth2Meta + openid_options: + $ref: '#/definitions/OpenIDOptions' + org_id: + type: string + x-go-name: OrgID + pinned_public_keys: + additionalProperties: + type: string + type: object + x-go-name: PinnedPublicKeys + protocol: + type: string + x-go-name: Protocol + proxy: + properties: + check_host_against_uptime_tests: + type: boolean + x-go-name: CheckHostAgainstUptimeTests + disable_strip_slash: + type: boolean + x-go-name: DisableStripSlash + enable_load_balancing: + type: boolean + x-go-name: EnableLoadBalancing + listen_path: + type: string + x-go-name: ListenPath + preserve_host_header: + type: boolean + x-go-name: PreserveHostHeader + service_discovery: + $ref: '#/definitions/ServiceDiscoveryConfiguration' + strip_listen_path: + type: boolean + x-go-name: StripListenPath + target_list: + items: + type: string + type: array + x-go-name: Targets + target_url: + type: string + x-go-name: TargetURL + transport: + properties: + proxy_url: + type: string + x-go-name: ProxyURL + ssl_ciphers: + items: + type: string + type: array + x-go-name: SSLCipherSuites + ssl_force_common_name_check: + type: boolean + x-go-name: SSLForceCommonNameCheck + ssl_insecure_skip_verify: + type: boolean + x-go-name: SSLInsecureSkipVerify + ssl_min_version: + format: uint16 + type: integer + x-go-name: SSLMinVersion + type: object + x-go-name: Transport + type: object + x-go-name: Proxy + request_signing: + $ref: '#/definitions/RequestSigningMeta' + response_processors: + items: + $ref: '#/definitions/ResponseProcessor' + type: array + x-go-name: ResponseProcessors + session_lifetime: + format: int64 + type: integer + x-go-name: SessionLifetime + session_provider: + $ref: '#/definitions/SessionProviderMeta' + slug: + type: string + x-go-name: Slug + strip_auth_data: + type: boolean + x-go-name: StripAuthData + tag_headers: + items: + type: string + type: array + x-go-name: TagHeaders + tags: + items: + type: string + type: array + x-go-name: Tags + upstream_certificates: + additionalProperties: + type: string + type: object + x-go-name: UpstreamCertificates + uptime_tests: + properties: + check_list: + items: + $ref: '#/definitions/HostCheckObject' + type: array + x-go-name: CheckList + config: + properties: + expire_utime_after: + format: int64 + type: integer + x-go-name: ExpireUptimeAnalyticsAfter + recheck_wait: + format: int64 + type: integer + x-go-name: RecheckWait + service_discovery: + $ref: '#/definitions/ServiceDiscoveryConfiguration' + type: object + x-go-name: Config + type: object + x-go-name: UptimeTests + use_basic_auth: + type: boolean + x-go-name: UseBasicAuth + use_go_plugin_auth: + type: boolean + x-go-name: UseGoPluginAuth + use_keyless: + type: boolean + x-go-name: UseKeylessAccess + use_mutual_tls_auth: + type: boolean + x-go-name: UseMutualTLSAuth + use_oauth2: + type: boolean + x-go-name: UseOauth2 + use_openid: + type: boolean + x-go-name: UseOpenID + use_standard_auth: + type: boolean + x-go-name: UseStandardAuth + version_data: + properties: + default_version: + type: string + x-go-name: DefaultVersion + not_versioned: + type: boolean + x-go-name: NotVersioned + versions: + additionalProperties: + $ref: '#/definitions/VersionInfo' + type: object + x-go-name: Versions + type: object + x-go-name: VersionData + title: APIDefinition represents the configuration for a single proxied API and it's versions. + type: object + x-go-package: github.com/TykTechnologies/tyk/apidef + APILimit: + description: APILimit stores quota and rate limit on ACL level (per API) + properties: + per: + format: double + type: number + x-go-name: Per + quota_max: + format: int64 + type: integer + x-go-name: QuotaMax + quota_remaining: + format: int64 + type: integer + x-go-name: QuotaRemaining + quota_renewal_rate: + format: int64 + type: integer + x-go-name: QuotaRenewalRate + quota_renews: + format: int64 + type: integer + x-go-name: QuotaRenews + rate: + format: double + type: number + x-go-name: Rate + throttle_interval: + format: double + type: number + x-go-name: ThrottleInterval + throttle_retry_limit: + format: int64 + type: integer + x-go-name: ThrottleRetryLimit + type: object + x-go-package: github.com/TykTechnologies/tyk/user + AccessDefinition: + description: AccessDefinition defines which versions of an API a key has access to + properties: + allowance_scope: + type: string + x-go-name: AllowanceScope + allowed_urls: + items: + $ref: '#/definitions/AccessSpec' + type: array + x-go-name: AllowedURLs + api_id: + type: string + x-go-name: APIID + api_name: + type: string + x-go-name: APIName + limit: + $ref: '#/definitions/APILimit' + versions: + items: + type: string + type: array + x-go-name: Versions + type: object + x-go-package: github.com/TykTechnologies/tyk/user + AccessRequestType: + description: AccessRequestType is the type for OAuth param `grant_type` type: string - x-go-name: Password - type: object - x-go-package: github.com/TykTechnologies/mserv/coprocess/bindings/go - BundleManifest: - properties: - checksum: + x-go-package: github.com/lonelycode/osin + AccessSpec: + description: AccessSpecs define what URLS a user has access to an what methods are enabled + properties: + methods: + items: + type: string + type: array + x-go-name: Methods + url: + type: string + x-go-name: URL + type: object + x-go-package: github.com/TykTechnologies/tyk/user + AuthConfig: + properties: + auth_header_name: + type: string + x-go-name: AuthHeaderName + cookie_name: + type: string + x-go-name: CookieName + param_name: + type: string + x-go-name: ParamName + signature: + $ref: '#/definitions/SignatureConfig' + use_certificate: + type: boolean + x-go-name: UseCertificate + use_cookie: + type: boolean + x-go-name: UseCookie + use_param: + type: boolean + x-go-name: UseParam + validate_signature: + type: boolean + x-go-name: ValidateSignature + type: object + x-go-package: github.com/TykTechnologies/tyk/apidef + AuthProviderCode: type: string - x-go-name: Checksum - custom_middleware: - $ref: '#/definitions/MiddlewareSection' - file_list: - items: - type: string - type: array - x-go-name: FileList - signature: + x-go-package: github.com/TykTechnologies/tyk/apidef + AuthProviderMeta: + properties: + meta: + additionalProperties: {} + type: object + x-go-name: Meta + name: + $ref: '#/definitions/AuthProviderCode' + storage_engine: + $ref: '#/definitions/StorageEngineCode' + type: object + x-go-package: github.com/TykTechnologies/tyk/apidef + AuthTypeEnum: type: string - x-go-name: Signature - type: object - x-go-package: github.com/TykTechnologies/mserv/vendor/github.com/TykTechnologies/tyk/apidef - File: - properties: - Data: - $ref: '#/definitions/File' - Header: - $ref: '#/definitions/FileHeader' - title: File represents an uploaded file. - type: object - x-go-package: github.com/TykTechnologies/mserv/vendor/github.com/go-openapi/runtime - FileHeader: - properties: - Filename: + x-go-package: github.com/TykTechnologies/tyk/apidef + AuthorizeRequestType: + description: AuthorizeRequestType is the type for OAuth param `response_type` type: string - Header: - $ref: '#/definitions/MIMEHeader' - Size: + x-go-package: github.com/lonelycode/osin + BundleManifest: + properties: + checksum: + type: string + x-go-name: Checksum + custom_middleware: + $ref: '#/definitions/MiddlewareSection' + file_list: + items: + type: string + type: array + x-go-name: FileList + signature: + type: string + x-go-name: Signature + type: object + x-go-package: github.com/TykTechnologies/tyk/apidef + CacheMeta: + properties: + cache_key_regex: + type: string + x-go-name: CacheKeyRegex + method: + type: string + x-go-name: Method + path: + type: string + x-go-name: Path + type: object + x-go-package: github.com/TykTechnologies/tyk/apidef + CacheOptions: + properties: + cache_all_safe_requests: + type: boolean + x-go-name: CacheAllSafeRequests + cache_control_ttl_header: + type: string + x-go-name: CacheControlTTLHeader + cache_response_codes: + items: + format: int64 + type: integer + type: array + x-go-name: CacheOnlyResponseCodes + cache_timeout: + format: int64 + type: integer + x-go-name: CacheTimeout + enable_cache: + type: boolean + x-go-name: EnableCache + enable_upstream_cache_control: + type: boolean + x-go-name: EnableUpstreamCacheControl + type: object + x-go-package: github.com/TykTechnologies/tyk/apidef + CheckCommand: + properties: + message: + type: string + x-go-name: Message + name: + type: string + x-go-name: Name + type: object + x-go-package: github.com/TykTechnologies/tyk/apidef + CircuitBreakerMeta: + properties: + method: + type: string + x-go-name: Method + path: + type: string + x-go-name: Path + return_to_service_after: + format: int64 + type: integer + x-go-name: ReturnToServiceAfter + samples: + format: int64 + type: integer + x-go-name: Samples + threshold_percent: + format: double + type: number + x-go-name: ThresholdPercent + type: object + x-go-package: github.com/TykTechnologies/tyk/apidef + Duration: + description: |- + A Duration represents the elapsed time between two instants + as an int64 nanosecond count. The representation limits the + largest representable duration to approximately 290 years. format: int64 type: integer - title: A FileHeader describes a file part of a multipart request. - type: object - x-go-package: mime/multipart - HReport: - properties: - GRPCStarted: - type: boolean - HTTPStarted: - type: boolean - type: object - x-go-package: github.com/TykTechnologies/mserv/health - HookType: - format: int32 - type: integer - x-go-package: github.com/TykTechnologies/mserv/coprocess/bindings/go - IdExtractorSource: - type: string - x-go-package: github.com/TykTechnologies/mserv/vendor/github.com/TykTechnologies/tyk/apidef - IdExtractorType: - type: string - x-go-package: github.com/TykTechnologies/mserv/vendor/github.com/TykTechnologies/tyk/apidef - JWTData: - properties: - secret: - type: string - x-go-name: Secret - type: object - x-go-package: github.com/TykTechnologies/mserv/coprocess/bindings/go - MIMEHeader: - additionalProperties: - items: - type: string - type: array - description: |- - A MIMEHeader represents a MIME-style header mapping - keys to sets of values. - type: object - x-go-package: net/textproto - MW: - properties: - APIID: - type: string - Active: - type: boolean - Added: - format: date-time - type: string - BundleRef: - type: string - DownloadOnly: - type: boolean - Manifest: - $ref: '#/definitions/BundleManifest' - OrgID: - type: string - Plugins: - items: - $ref: '#/definitions/Plugin' - type: array - UID: - type: string - type: object - x-go-package: github.com/TykTechnologies/mserv/storage - MiddlewareDefinition: - properties: - name: - type: string - x-go-name: Name - path: - type: string - x-go-name: Path - raw_body_only: - type: boolean - x-go-name: RawBodyOnly - require_session: - type: boolean - x-go-name: RequireSession - type: object - x-go-package: github.com/TykTechnologies/mserv/vendor/github.com/TykTechnologies/tyk/apidef - MiddlewareDriver: - type: string - x-go-package: github.com/TykTechnologies/mserv/vendor/github.com/TykTechnologies/tyk/apidef - MiddlewareIdExtractor: - properties: - extract_from: - $ref: '#/definitions/IdExtractorSource' - extract_with: - $ref: '#/definitions/IdExtractorType' - extractor_config: - additionalProperties: - type: object - type: object - x-go-name: ExtractorConfig - type: object - x-go-package: github.com/TykTechnologies/mserv/vendor/github.com/TykTechnologies/tyk/apidef - MiddlewareSection: - properties: - auth_check: - $ref: '#/definitions/MiddlewareDefinition' - driver: - $ref: '#/definitions/MiddlewareDriver' - id_extractor: - $ref: '#/definitions/MiddlewareIdExtractor' - post: - items: - $ref: '#/definitions/MiddlewareDefinition' - type: array - x-go-name: Post - post_key_auth: - items: - $ref: '#/definitions/MiddlewareDefinition' - type: array - x-go-name: PostKeyAuth - pre: - items: - $ref: '#/definitions/MiddlewareDefinition' - type: array - x-go-name: Pre - response: - items: - $ref: '#/definitions/MiddlewareDefinition' - type: array - x-go-name: Response - type: object - x-go-package: github.com/TykTechnologies/mserv/vendor/github.com/TykTechnologies/tyk/apidef - MiniRequestObject: - properties: - add_params: - additionalProperties: - type: string + x-go-package: time + EndPointMeta: + properties: + ignore_case: + type: boolean + x-go-name: IgnoreCase + method_actions: + additionalProperties: + $ref: '#/definitions/EndpointMethodMeta' + type: object + x-go-name: MethodActions + path: + type: string + x-go-name: Path type: object - x-go-name: AddParams - body: + x-go-package: github.com/TykTechnologies/tyk/apidef + EndpointMethodAction: type: string - x-go-name: Body - delete_headers: - items: - type: string - type: array - x-go-name: DeleteHeaders - delete_params: - items: - type: string - type: array - x-go-name: DeleteParams - extended_params: - additionalProperties: - type: string + x-go-package: github.com/TykTechnologies/tyk/apidef + EndpointMethodMeta: + properties: + action: + $ref: '#/definitions/EndpointMethodAction' + code: + format: int64 + type: integer + x-go-name: Code + data: + type: string + x-go-name: Data + headers: + additionalProperties: + type: string + type: object + x-go-name: Headers type: object - x-go-name: ExtendedParams - headers: - additionalProperties: - type: string + x-go-package: github.com/TykTechnologies/tyk/apidef + EventHandlerMetaConfig: + properties: + events: + additionalProperties: + items: + $ref: '#/definitions/EventHandlerTriggerConfig' + type: array + type: object + x-go-name: Events type: object - x-go-name: Headers - method: - type: string - x-go-name: Method - params: - additionalProperties: - type: string - type: object - x-go-name: Params - raw_body: - items: - format: uint8 - type: integer - type: array - x-go-name: RawBody - request_uri: - type: string - x-go-name: RequestUri - return_overrides: - $ref: '#/definitions/ReturnOverrides' - scheme: - type: string - x-go-name: Scheme - set_headers: - additionalProperties: - type: string + x-go-package: github.com/TykTechnologies/tyk/apidef + EventHandlerTriggerConfig: + properties: + handler_meta: + additionalProperties: {} + type: object + x-go-name: HandlerMeta + handler_name: + $ref: '#/definitions/TykEventHandlerName' type: object - x-go-name: SetHeaders - url: - type: string - x-go-name: Url - type: object - x-go-package: github.com/TykTechnologies/mserv/coprocess/bindings/go - Monitor: - properties: - trigger_limits: - items: - format: double - type: number - type: array - x-go-name: TriggerLimits - type: object - x-go-package: github.com/TykTechnologies/mserv/coprocess/bindings/go - Object: - properties: - hook_name: - type: string - x-go-name: HookName - hook_type: - $ref: '#/definitions/HookType' - metadata: - additionalProperties: - type: string - type: object - x-go-name: Metadata - request: - $ref: '#/definitions/MiniRequestObject' - session: - $ref: '#/definitions/SessionState' - spec: - additionalProperties: - type: string - type: object - x-go-name: Spec - type: object - x-go-package: github.com/TykTechnologies/mserv/coprocess/bindings/go - Payload: - description: Payload is the default response - properties: - Error: - type: string - Payload: + x-go-package: github.com/TykTechnologies/tyk/apidef + ExtendedPathsSet: + properties: + advance_cache_config: + items: + $ref: '#/definitions/CacheMeta' + type: array + x-go-name: AdvanceCacheConfig + black_list: + items: + $ref: '#/definitions/EndPointMeta' + type: array + x-go-name: BlackList + cache: + items: + type: string + type: array + x-go-name: Cached + circuit_breakers: + items: + $ref: '#/definitions/CircuitBreakerMeta' + type: array + x-go-name: CircuitBreaker + do_not_track_endpoints: + items: + $ref: '#/definitions/TrackEndpointMeta' + type: array + x-go-name: DoNotTrackEndpoints + hard_timeouts: + items: + $ref: '#/definitions/HardTimeoutMeta' + type: array + x-go-name: HardTimeouts + ignored: + items: + $ref: '#/definitions/EndPointMeta' + type: array + x-go-name: Ignored + internal: + items: + $ref: '#/definitions/InternalMeta' + type: array + x-go-name: Internal + method_transforms: + items: + $ref: '#/definitions/MethodTransformMeta' + type: array + x-go-name: MethodTransforms + size_limits: + items: + $ref: '#/definitions/RequestSizeMeta' + type: array + x-go-name: SizeLimit + track_endpoints: + items: + $ref: '#/definitions/TrackEndpointMeta' + type: array + x-go-name: TrackEndpoints + transform: + items: + $ref: '#/definitions/TemplateMeta' + type: array + x-go-name: Transform + transform_headers: + items: + $ref: '#/definitions/HeaderInjectionMeta' + type: array + x-go-name: TransformHeader + transform_jq: + items: + $ref: '#/definitions/TransformJQMeta' + type: array + x-go-name: TransformJQ + transform_jq_response: + items: + $ref: '#/definitions/TransformJQMeta' + type: array + x-go-name: TransformJQResponse + transform_response: + items: + $ref: '#/definitions/TemplateMeta' + type: array + x-go-name: TransformResponse + transform_response_headers: + items: + $ref: '#/definitions/HeaderInjectionMeta' + type: array + x-go-name: TransformResponseHeader + url_rewrites: + items: + $ref: '#/definitions/URLRewriteMeta' + type: array + x-go-name: URLRewrite + validate_json: + items: + $ref: '#/definitions/ValidatePathMeta' + type: array + x-go-name: ValidateJSON + virtual: + items: + $ref: '#/definitions/VirtualMeta' + type: array + x-go-name: Virtual + white_list: + items: + $ref: '#/definitions/EndPointMeta' + type: array + x-go-name: WhiteList type: object - Status: - type: string - type: object - x-go-package: github.com/TykTechnologies/mserv/models - Plugin: - properties: - FileName: - type: string - FileRef: - type: string - Name: - type: string - Type: - $ref: '#/definitions/HookType' - UID: + x-go-package: github.com/TykTechnologies/tyk/apidef + File: + properties: + Data: + $ref: '#/definitions/File' + Header: + $ref: '#/definitions/FileHeader' + title: File represents an uploaded file. + type: object + x-go-package: github.com/go-openapi/swag + FileHeader: + properties: + Filename: + type: string + Header: + $ref: '#/definitions/MIMEHeader' + Size: + format: int64 + type: integer + title: A FileHeader describes a file part of a multipart request. + type: object + x-go-package: mime/multipart + GlobalRateLimit: + properties: + per: + format: double + type: number + x-go-name: Per + rate: + format: double + type: number + x-go-name: Rate + type: object + x-go-package: github.com/TykTechnologies/tyk/apidef + HReport: + properties: + GRPCStarted: + type: boolean + HTTPStarted: + type: boolean + type: object + x-go-package: github.com/TykTechnologies/mserv/health + HardTimeoutMeta: + properties: + method: + type: string + x-go-name: Method + path: + type: string + x-go-name: Path + timeout: + format: int64 + type: integer + x-go-name: TimeOut + type: object + x-go-package: github.com/TykTechnologies/tyk/apidef + HashType: type: string - type: object - x-go-package: github.com/TykTechnologies/mserv/storage - ReturnOverrides: - properties: - headers: - additionalProperties: - type: string + x-go-package: github.com/TykTechnologies/tyk/user + HeaderInjectionMeta: + properties: + act_on: + type: boolean + x-go-name: ActOnResponse + add_headers: + additionalProperties: + type: string + type: object + x-go-name: AddHeaders + delete_headers: + items: + type: string + type: array + x-go-name: DeleteHeaders + method: + type: string + x-go-name: Method + path: + type: string + x-go-name: Path type: object - x-go-name: Headers - response_code: + x-go-package: github.com/TykTechnologies/tyk/apidef + HookType: format: int32 type: integer - x-go-name: ResponseCode - response_error: + x-go-package: github.com/TykTechnologies/mserv/coprocess/bindings/go + HostCheckObject: + properties: + body: + type: string + x-go-name: Body + commands: + items: + $ref: '#/definitions/CheckCommand' + type: array + x-go-name: Commands + enable_proxy_protocol: + type: boolean + x-go-name: EnableProxyProtocol + headers: + additionalProperties: + type: string + type: object + x-go-name: Headers + method: + type: string + x-go-name: Method + protocol: + type: string + x-go-name: Protocol + timeout: + $ref: '#/definitions/Duration' + url: + type: string + x-go-name: CheckURL + type: object + x-go-package: github.com/TykTechnologies/tyk/apidef + IdExtractorSource: + type: string + x-go-package: github.com/TykTechnologies/tyk/apidef + IdExtractorType: type: string - x-go-name: ResponseError - type: object - x-go-package: github.com/TykTechnologies/mserv/coprocess/bindings/go - SessionState: - properties: - access_rights: + x-go-package: github.com/TykTechnologies/tyk/apidef + InternalMeta: + properties: + method: + type: string + x-go-name: Method + path: + type: string + x-go-name: Path + type: object + x-go-package: github.com/TykTechnologies/tyk/apidef + MIMEHeader: additionalProperties: - $ref: '#/definitions/AccessDefinition' + items: + type: string + type: array + description: |- + A MIMEHeader represents a MIME-style header mapping + keys to sets of values. + type: object + x-go-package: net/textproto + MW: + properties: + APIID: + type: string + Active: + type: boolean + Added: + format: date-time + type: string + BundleRef: + type: string + DownloadOnly: + type: boolean + Manifest: + $ref: '#/definitions/BundleManifest' + OrgID: + type: string + Plugins: + items: + $ref: '#/definitions/Plugin' + type: array + UID: + type: string + type: object + x-go-package: github.com/TykTechnologies/mserv/storage + MethodTransformMeta: + properties: + method: + type: string + x-go-name: Method + path: + type: string + x-go-name: Path + to_method: + type: string + x-go-name: ToMethod + type: object + x-go-package: github.com/TykTechnologies/tyk/apidef + MiddlewareDefinition: + properties: + name: + type: string + x-go-name: Name + path: + type: string + x-go-name: Path + raw_body_only: + type: boolean + x-go-name: RawBodyOnly + require_session: + type: boolean + x-go-name: RequireSession type: object - x-go-name: AccessRights - alias: + x-go-package: github.com/TykTechnologies/tyk/apidef + MiddlewareDriver: type: string - x-go-name: Alias - allowance: - format: double - type: number - x-go-name: Allowance - apply_policies: - items: - type: string - type: array - x-go-name: ApplyPolicies - apply_policy_id: + x-go-package: github.com/TykTechnologies/tyk/apidef + MiddlewareIdExtractor: + properties: + extract_from: + $ref: '#/definitions/IdExtractorSource' + extract_with: + $ref: '#/definitions/IdExtractorType' + extractor_config: + additionalProperties: {} + type: object + x-go-name: ExtractorConfig + type: object + x-go-package: github.com/TykTechnologies/tyk/apidef + MiddlewareSection: + properties: + auth_check: + $ref: '#/definitions/MiddlewareDefinition' + driver: + $ref: '#/definitions/MiddlewareDriver' + id_extractor: + $ref: '#/definitions/MiddlewareIdExtractor' + post: + items: + $ref: '#/definitions/MiddlewareDefinition' + type: array + x-go-name: Post + post_key_auth: + items: + $ref: '#/definitions/MiddlewareDefinition' + type: array + x-go-name: PostKeyAuth + pre: + items: + $ref: '#/definitions/MiddlewareDefinition' + type: array + x-go-name: Pre + response: + items: + $ref: '#/definitions/MiddlewareDefinition' + type: array + x-go-name: Response + type: object + x-go-package: github.com/TykTechnologies/tyk/apidef + MiniRequestObject: + properties: + add_params: + additionalProperties: + type: string + type: object + x-go-name: AddParams + body: + type: string + x-go-name: Body + delete_headers: + items: + type: string + type: array + x-go-name: DeleteHeaders + delete_params: + items: + type: string + type: array + x-go-name: DeleteParams + extended_params: + additionalProperties: + type: string + type: object + x-go-name: ExtendedParams + headers: + additionalProperties: + type: string + type: object + x-go-name: Headers + method: + type: string + x-go-name: Method + params: + additionalProperties: + type: string + type: object + x-go-name: Params + raw_body: + items: + format: uint8 + type: integer + type: array + x-go-name: RawBody + request_uri: + type: string + x-go-name: RequestUri + return_overrides: + $ref: '#/definitions/ReturnOverrides' + scheme: + type: string + x-go-name: Scheme + set_headers: + additionalProperties: + type: string + type: object + x-go-name: SetHeaders + url: + type: string + x-go-name: Url + type: object + x-go-package: github.com/TykTechnologies/mserv/coprocess/bindings/go + NotificationsManager: + description: 'TODO: Make this more generic' + properties: + oauth_on_keychange_url: + type: string + x-go-name: OAuthKeyChangeURL + shared_secret: + type: string + x-go-name: SharedSecret + title: NotificationsManager handles sending notifications to OAuth endpoints to notify the provider of key changes. + type: object + x-go-package: github.com/TykTechnologies/tyk/apidef + OIDProviderConfig: + properties: + client_ids: + additionalProperties: + type: string + type: object + x-go-name: ClientIDs + issuer: + type: string + x-go-name: Issuer + type: object + x-go-package: github.com/TykTechnologies/tyk/apidef + Object: + properties: + hook_name: + type: string + x-go-name: HookName + hook_type: + $ref: '#/definitions/HookType' + metadata: + additionalProperties: + type: string + type: object + x-go-name: Metadata + request: + $ref: '#/definitions/MiniRequestObject' + session: + $ref: '#/definitions/SessionState' + spec: + additionalProperties: + type: string + type: object + x-go-name: Spec + type: object + x-go-package: github.com/TykTechnologies/mserv/coprocess/bindings/go + OpenIDOptions: + properties: + providers: + items: + $ref: '#/definitions/OIDProviderConfig' + type: array + x-go-name: Providers + segregate_by_client: + type: boolean + x-go-name: SegregateByClient + type: object + x-go-package: github.com/TykTechnologies/tyk/apidef + Payload: + description: Payload is the default response + properties: + Error: + type: string + Payload: {} + Status: + type: string + type: object + x-go-package: github.com/TykTechnologies/mserv/models + Plugin: + properties: + FileName: + type: string + FileRef: + type: string + Name: + type: string + Type: + $ref: '#/definitions/HookType' + UID: + type: string + type: object + x-go-package: github.com/TykTechnologies/mserv/storage + RequestInputType: type: string - x-go-name: ApplyPolicyId - basic_auth_data: - $ref: '#/definitions/BasicAuthData' - certificate: + x-go-package: github.com/TykTechnologies/tyk/apidef + RequestSigningMeta: + properties: + algorithm: + type: string + x-go-name: Algorithm + certificate_id: + type: string + x-go-name: CertificateId + header_list: + items: + type: string + type: array + x-go-name: HeaderList + is_enabled: + type: boolean + x-go-name: IsEnabled + key_id: + type: string + x-go-name: KeyId + secret: + type: string + x-go-name: Secret + signature_header: + type: string + x-go-name: SignatureHeader + type: object + x-go-package: github.com/TykTechnologies/tyk/apidef + RequestSizeMeta: + properties: + method: + type: string + x-go-name: Method + path: + type: string + x-go-name: Path + size_limit: + format: int64 + type: integer + x-go-name: SizeLimit + type: object + x-go-package: github.com/TykTechnologies/tyk/apidef + ResponseProcessor: + properties: + name: + type: string + x-go-name: Name + options: + x-go-name: Options + type: object + x-go-package: github.com/TykTechnologies/tyk/apidef + ReturnOverrides: + properties: + headers: + additionalProperties: + type: string + type: object + x-go-name: Headers + response_code: + format: int32 + type: integer + x-go-name: ResponseCode + response_error: + type: string + x-go-name: ResponseError + type: object + x-go-package: github.com/TykTechnologies/mserv/coprocess/bindings/go + RoutingTrigger: + properties: + "on": + $ref: '#/definitions/RoutingTriggerOnType' + options: + $ref: '#/definitions/RoutingTriggerOptions' + rewrite_to: + type: string + x-go-name: RewriteTo + type: object + x-go-package: github.com/TykTechnologies/tyk/apidef + RoutingTriggerOnType: type: string - x-go-name: Certificate - data_expires: - format: int64 - type: integer - x-go-name: DataExpires - enable_detailed_recording: - type: boolean - x-go-name: EnableDetailedRecording - expires: - format: int64 - type: integer - x-go-name: Expires - hmac_enabled: - type: boolean - x-go-name: HmacEnabled - hmac_secret: + x-go-package: github.com/TykTechnologies/tyk/apidef + RoutingTriggerOptions: + properties: + header_matches: + additionalProperties: + $ref: '#/definitions/StringRegexMap' + type: object + x-go-name: HeaderMatches + path_part_matches: + additionalProperties: + $ref: '#/definitions/StringRegexMap' + type: object + x-go-name: PathPartMatches + payload_matches: + $ref: '#/definitions/StringRegexMap' + query_val_matches: + additionalProperties: + $ref: '#/definitions/StringRegexMap' + type: object + x-go-name: QueryValMatches + request_context_matches: + additionalProperties: + $ref: '#/definitions/StringRegexMap' + type: object + x-go-name: RequestContextMatches + session_meta_matches: + additionalProperties: + $ref: '#/definitions/StringRegexMap' + type: object + x-go-name: SessionMetaMatches + type: object + x-go-package: github.com/TykTechnologies/tyk/apidef + ServiceDiscoveryConfiguration: + properties: + cache_timeout: + format: int64 + type: integer + x-go-name: CacheTimeout + data_path: + type: string + x-go-name: DataPath + endpoint_returns_list: + type: boolean + x-go-name: EndpointReturnsList + parent_data_path: + type: string + x-go-name: ParentDataPath + port_data_path: + type: string + x-go-name: PortDataPath + query_endpoint: + type: string + x-go-name: QueryEndpoint + target_path: + type: string + x-go-name: TargetPath + use_discovery_service: + type: boolean + x-go-name: UseDiscoveryService + use_nested_query: + type: boolean + x-go-name: UseNestedQuery + use_target_list: + type: boolean + x-go-name: UseTargetList + type: object + x-go-package: github.com/TykTechnologies/tyk/apidef + SessionProviderCode: type: string - x-go-name: HmacSecret - id_extractor_deadline: - format: int64 - type: integer - x-go-name: IdExtractorDeadline - is_inactive: - type: boolean - x-go-name: IsInactive - jwt_data: - $ref: '#/definitions/JWTData' - last_check: - format: int64 - type: integer - x-go-name: LastCheck - last_updated: + x-go-package: github.com/TykTechnologies/tyk/apidef + SessionProviderMeta: + properties: + meta: + additionalProperties: {} + type: object + x-go-name: Meta + name: + $ref: '#/definitions/SessionProviderCode' + storage_engine: + $ref: '#/definitions/StorageEngineCode' + type: object + x-go-package: github.com/TykTechnologies/tyk/apidef + SessionState: + description: 'There''s a data structure that''s based on this and it''s used for Protocol Buffer support, make sure to update "coprocess/proto/coprocess_session_state.proto" and generate the bindings using: cd coprocess/proto && ./update_bindings.sh' + properties: + access_rights: + additionalProperties: + $ref: '#/definitions/AccessDefinition' + type: object + x-go-name: AccessRights + alias: + type: string + x-go-name: Alias + allowance: + format: double + type: number + x-go-name: Allowance + apply_policies: + items: + type: string + type: array + x-go-name: ApplyPolicies + apply_policy_id: + type: string + x-go-name: ApplyPolicyID + basic_auth_data: + properties: + hash_type: + $ref: '#/definitions/HashType' + password: + type: string + x-go-name: Password + type: object + x-go-name: BasicAuthData + certificate: + type: string + x-go-name: Certificate + data_expires: + format: int64 + type: integer + x-go-name: DataExpires + date_created: + format: date-time + type: string + x-go-name: DateCreated + enable_detail_recording: + type: boolean + x-go-name: EnableDetailedRecording + enable_http_signature_validation: + type: boolean + x-go-name: EnableHTTPSignatureValidation + expires: + format: int64 + type: integer + x-go-name: Expires + hmac_enabled: + type: boolean + x-go-name: HMACEnabled + hmac_string: + type: string + x-go-name: HmacSecret + id_extractor_deadline: + format: int64 + type: integer + x-go-name: IdExtractorDeadline + is_inactive: + type: boolean + x-go-name: IsInactive + jwt_data: + properties: + secret: + type: string + x-go-name: Secret + type: object + x-go-name: JWTData + last_check: + format: int64 + type: integer + x-go-name: LastCheck + last_updated: + type: string + x-go-name: LastUpdated + meta_data: + additionalProperties: {} + type: object + x-go-name: MetaData + monitor: + properties: + trigger_limits: + items: + format: double + type: number + type: array + x-go-name: TriggerLimits + type: object + x-go-name: Monitor + oauth_client_id: + type: string + x-go-name: OauthClientID + oauth_keys: + additionalProperties: + type: string + type: object + x-go-name: OauthKeys + org_id: + type: string + x-go-name: OrgID + per: + format: double + type: number + x-go-name: Per + quota_max: + format: int64 + type: integer + x-go-name: QuotaMax + quota_remaining: + format: int64 + type: integer + x-go-name: QuotaRemaining + quota_renewal_rate: + format: int64 + type: integer + x-go-name: QuotaRenewalRate + quota_renews: + format: int64 + type: integer + x-go-name: QuotaRenews + rate: + format: double + type: number + x-go-name: Rate + rsa_certificate_id: + type: string + x-go-name: RSACertificateId + session_lifetime: + format: int64 + type: integer + x-go-name: SessionLifetime + tags: + items: + type: string + type: array + x-go-name: Tags + throttle_interval: + format: double + type: number + x-go-name: ThrottleInterval + throttle_retry_limit: + format: int64 + type: integer + x-go-name: ThrottleRetryLimit + title: SessionState objects represent a current API session, mainly used for rate limiting. + type: object + x-go-package: github.com/TykTechnologies/tyk/user + SignatureConfig: + properties: + algorithm: + type: string + x-go-name: Algorithm + allowed_clock_skew: + format: int64 + type: integer + x-go-name: AllowedClockSkew + error_code: + format: int64 + type: integer + x-go-name: ErrorCode + error_message: + type: string + x-go-name: ErrorMessage + header: + type: string + x-go-name: Header + secret: + type: string + x-go-name: Secret + type: object + x-go-package: github.com/TykTechnologies/tyk/apidef + StorageEngineCode: type: string - x-go-name: LastUpdated - metadata: - additionalProperties: - type: string + x-go-package: github.com/TykTechnologies/tyk/apidef + StringRegexMap: + properties: + match_rx: + type: string + x-go-name: MatchPattern + reverse: + type: boolean + x-go-name: Reverse + type: object + x-go-package: github.com/TykTechnologies/tyk/apidef + TemplateData: + properties: + enable_session: + type: boolean + x-go-name: EnableSession + input_type: + $ref: '#/definitions/RequestInputType' + template_mode: + $ref: '#/definitions/TemplateMode' + template_source: + type: string + x-go-name: TemplateSource type: object - x-go-name: Metadata - monitor: - $ref: '#/definitions/Monitor' - oauth_client_id: + x-go-package: github.com/TykTechnologies/tyk/apidef + TemplateMeta: + properties: + method: + type: string + x-go-name: Method + path: + type: string + x-go-name: Path + template_data: + $ref: '#/definitions/TemplateData' + type: object + x-go-package: github.com/TykTechnologies/tyk/apidef + TemplateMode: type: string - x-go-name: OauthClientId - oauth_keys: - additionalProperties: - type: string + x-go-package: github.com/TykTechnologies/tyk/apidef + TrackEndpointMeta: + properties: + method: + type: string + x-go-name: Method + path: + type: string + x-go-name: Path + type: object + x-go-package: github.com/TykTechnologies/tyk/apidef + TransformJQMeta: + properties: + filter: + type: string + x-go-name: Filter + method: + type: string + x-go-name: Method + path: + type: string + x-go-name: Path type: object - x-go-name: OauthKeys - org_id: + x-go-package: github.com/TykTechnologies/tyk/apidef + TykEventHandlerName: type: string - x-go-name: OrgId - per: - format: double - type: number - x-go-name: Per - quota_max: - format: int64 - type: integer - x-go-name: QuotaMax - quota_remaining: - format: int64 - type: integer - x-go-name: QuotaRemaining - quota_renewal_rate: - format: int64 - type: integer - x-go-name: QuotaRenewalRate - quota_renews: - format: int64 - type: integer - x-go-name: QuotaRenews - rate: - format: double - type: number - x-go-name: Rate - session_lifetime: - format: int64 - type: integer - x-go-name: SessionLifetime - tags: - items: - type: string - type: array - x-go-name: Tags - type: object - x-go-package: github.com/TykTechnologies/mserv/coprocess/bindings/go + x-go-package: github.com/TykTechnologies/tyk/apidef + URLRewriteMeta: + properties: + match_pattern: + type: string + x-go-name: MatchPattern + method: + type: string + x-go-name: Method + path: + type: string + x-go-name: Path + rewrite_to: + type: string + x-go-name: RewriteTo + triggers: + items: + $ref: '#/definitions/RoutingTrigger' + type: array + x-go-name: Triggers + type: object + x-go-package: github.com/TykTechnologies/tyk/apidef + ValidatePathMeta: + properties: + error_response_code: + description: Allows override of default 422 Unprocessible Entity response code for validation errors. + format: int64 + type: integer + x-go-name: ErrorResponseCode + method: + type: string + x-go-name: Method + path: + type: string + x-go-name: Path + schema: + additionalProperties: {} + type: object + x-go-name: Schema + schema_b64: + type: string + x-go-name: SchemaB64 + type: object + x-go-package: github.com/TykTechnologies/tyk/apidef + VersionInfo: + properties: + expires: + type: string + x-go-name: Expires + extended_paths: + $ref: '#/definitions/ExtendedPathsSet' + global_headers: + additionalProperties: + type: string + type: object + x-go-name: GlobalHeaders + global_headers_remove: + items: + type: string + type: array + x-go-name: GlobalHeadersRemove + global_size_limit: + format: int64 + type: integer + x-go-name: GlobalSizeLimit + name: + type: string + x-go-name: Name + override_target: + type: string + x-go-name: OverrideTarget + paths: + properties: + black_list: + items: + type: string + type: array + x-go-name: BlackList + ignored: + items: + type: string + type: array + x-go-name: Ignored + white_list: + items: + type: string + type: array + x-go-name: WhiteList + type: object + x-go-name: Paths + use_extended_paths: + type: boolean + x-go-name: UseExtendedPaths + type: object + x-go-package: github.com/TykTechnologies/tyk/apidef + VirtualMeta: + properties: + function_source_type: + type: string + x-go-name: FunctionSourceType + function_source_uri: + type: string + x-go-name: FunctionSourceURI + method: + type: string + x-go-name: Method + path: + type: string + x-go-name: Path + proxy_on_error: + type: boolean + x-go-name: ProxyOnError + response_function_name: + type: string + x-go-name: ResponseFunctionName + use_session: + type: boolean + x-go-name: UseSession + type: object + x-go-package: github.com/TykTechnologies/tyk/apidef host: localhost:8989 info: - description: Provides access to operations over an Mserv service. - title: Mserv API. - version: 0.0.1 + description: Provides access to operations over an Mserv service. + title: Mserv API. + version: 0.0.1 paths: - /api/mw: - post: - description: Expects a file bundle in `uploadfile` form field. - operationId: mwAdd - parameters: - - in: formData - name: uploadfile - required: true - type: file - x-go-name: UploadFile - - in: query - name: store_only - type: boolean - x-go-name: StoreOnly - - in: query - name: api_id - type: string - x-go-name: APIID - responses: - "200": - $ref: '#/responses/mwIDResponse' - "500": - $ref: '#/responses/genericErrorResponse' - security: - - api_key: [] - summary: Adds a new middleware. If `store_only` field is true it will only be - available for download. - tags: - - mw - /api/mw/{id}: - delete: - operationId: mwDelete - parameters: - - in: path - name: id - required: true - type: string - x-go-name: ID - responses: - "200": - $ref: '#/responses/mwIDResponse' - "500": - $ref: '#/responses/genericErrorResponse' - security: - - api_key: [] - summary: Deletes a middleware specified by {id}. - tags: - - mw - get: - operationId: mwFetch - parameters: - - in: path - name: id - required: true - type: string - x-go-name: ID - responses: - "200": - $ref: '#/responses/mwResponse' - "500": - $ref: '#/responses/genericErrorResponse' - security: - - api_key: [] - summary: Fetches a middleware specified by {id}. - tags: - - mw - put: - description: Expects a file bundle in `uploadfile` form field. - operationId: mwUpdate - parameters: - - in: path - name: id - required: true - type: string - x-go-name: ID - - in: formData - name: uploadfile - required: true - type: file - x-go-name: UploadFile - responses: - "200": - $ref: '#/responses/mwIDResponse' - "500": - $ref: '#/responses/genericErrorResponse' - security: - - api_key: [] - summary: Updates a middleware specified by {id}. - tags: - - mw - /api/mw/bundle/{id}: - get: - operationId: mwFetchBundle - parameters: - - in: path - name: id - required: true - type: string - x-go-name: ID - produces: - - application/octet-stream - responses: - "200": - $ref: '#/responses/mwBundleResponse' - "500": - $ref: '#/responses/genericErrorResponse' - security: - - api_key: [] - summary: Fetches a middleware bundle file specified by {id}. - tags: - - mw - /api/mw/master/all: - get: - operationId: mwListAll - responses: - "200": - $ref: '#/responses/mwListResponse' - "500": - $ref: '#/responses/genericErrorResponse' - security: - - api_key: [] - summary: Lists all middleware. - tags: - - mw - /execute/{name}: - post: - description: Expects a coprocess.Object encoded as JSON in the request body - and returns the result in the same way. - operationId: invoke - parameters: - - in: path - name: name - required: true - type: string - x-go-name: Name - - in: body - name: Body - required: true - schema: - $ref: '#/definitions/Object' - responses: - "200": - $ref: '#/responses/invocationResponse' - "500": - $ref: '#/responses/genericErrorResponse' - security: - - api_key: [] - summary: Invokes a middleware by {name}. - tags: - - invocation - /health: - get: - operationId: health - responses: - "200": - $ref: '#/responses/healthResponse' - "500": - $ref: '#/responses/healthResponse' - summary: Query health status of Mserv service. - tags: - - system + /api/mw: + post: + description: Expects a zipped file bundle in the `uploadfile` form field. + operationId: mwAdd + parameters: + - in: formData + name: uploadfile + required: true + type: file + x-go-name: UploadFile + - in: query + name: store_only + type: boolean + x-go-name: StoreOnly + - in: query + name: api_id + type: string + x-go-name: APIID + responses: + "200": + $ref: '#/responses/mwIDResponse' + "500": + $ref: '#/responses/genericErrorResponse' + security: + - api_key: [] + summary: Adds a new middleware. If `store_only` field is 'true' then it will only be available for download. + tags: + - mw + /api/mw/{id}: + delete: + operationId: mwDelete + parameters: + - in: path + name: id + required: true + type: string + x-go-name: ID + responses: + "200": + $ref: '#/responses/mwIDResponse' + "500": + $ref: '#/responses/genericErrorResponse' + security: + - api_key: [] + summary: Deletes a middleware specified by {id}. + tags: + - mw + get: + operationId: mwFetch + parameters: + - in: path + name: id + required: true + type: string + x-go-name: ID + responses: + "200": + $ref: '#/responses/mwResponse' + "500": + $ref: '#/responses/genericErrorResponse' + security: + - api_key: [] + summary: Fetches a middleware specified by {id}. + tags: + - mw + put: + description: Expects a file bundle in `uploadfile` form field. + operationId: mwUpdate + parameters: + - in: path + name: id + required: true + type: string + x-go-name: ID + - in: formData + name: uploadfile + required: true + type: file + x-go-name: UploadFile + responses: + "200": + $ref: '#/responses/mwIDResponse' + "500": + $ref: '#/responses/genericErrorResponse' + security: + - api_key: [] + summary: Updates a middleware specified by {id}. + tags: + - mw + /api/mw/bundle/{id}: + get: + operationId: mwFetchBundle + parameters: + - in: path + name: id + required: true + type: string + x-go-name: ID + produces: + - application/octet-stream + responses: + "200": + $ref: '#/responses/mwBundleResponse' + "500": + $ref: '#/responses/genericErrorResponse' + security: + - api_key: [] + summary: Fetches a middleware bundle file specified by {id}. + tags: + - mw + /api/mw/master/all: + get: + operationId: mwListAll + responses: + "200": + $ref: '#/responses/mwListResponse' + "500": + $ref: '#/responses/genericErrorResponse' + security: + - api_key: [] + summary: Lists all middleware. + tags: + - mw + /execute/{name}: + post: + description: Expects a coprocess.Object encoded as JSON in the request body and returns the result in the same way. + operationId: invoke + parameters: + - in: path + name: name + required: true + type: string + x-go-name: Name + - in: body + name: Body + required: true + schema: + $ref: '#/definitions/Object' + responses: + "200": + $ref: '#/responses/invocationResponse' + "500": + $ref: '#/responses/genericErrorResponse' + security: + - api_key: [] + summary: Invokes a middleware by {name}. + tags: + - invocation + /health: + get: + operationId: health + responses: + "200": + $ref: '#/responses/healthResponse' + "500": + $ref: '#/responses/healthResponse' + summary: Query health status of Mserv service. + tags: + - system produces: -- application/json + - application/json responses: - genericErrorResponse: - description: Generic error specified by `Status` and `Error` fields - schema: - $ref: '#/definitions/Payload' - healthResponse: - description: Health status response - schema: - properties: - Error: - type: string - Payload: - $ref: '#/definitions/HReport' - Status: - type: string - type: object - invocationResponse: - description: Middleware invocation response - schema: - properties: - Error: - type: string - Payload: - $ref: '#/definitions/Object' - Status: - type: string - type: object - mwBundleResponse: - description: Middleware bundle as a file - schema: - $ref: '#/definitions/File' - mwIDResponse: - description: Response that only includes the ID of the middleware as `BundleID` - in the `Payload` - schema: - properties: - Error: - type: string - Payload: - properties: - BundleID: - type: string - type: object - Status: - type: string - type: object - mwListResponse: - description: List of full middleware representations in the `Payload` - schema: - properties: - Error: - type: string - Payload: - items: - $ref: '#/definitions/MW' - type: array - Status: - type: string - type: object - mwResponse: - description: Full middleware response in the `Payload` - schema: - properties: - Error: - type: string - Payload: - $ref: '#/definitions/MW' - Status: - type: string - type: object + genericErrorResponse: + description: Generic error specified by `Status` and `Error` fields + schema: + $ref: '#/definitions/Payload' + healthResponse: + description: Health status response + schema: + properties: + Error: + type: string + Payload: + $ref: '#/definitions/HReport' + Status: + type: string + type: object + invocationResponse: + description: Middleware invocation response + schema: + properties: + Error: + type: string + Payload: + $ref: '#/definitions/Object' + Status: + type: string + type: object + mwBundleResponse: + description: Middleware bundle as a file + schema: + $ref: '#/definitions/File' + mwIDResponse: + description: Response that only includes the ID of the middleware as `BundleID` in the `Payload` + schema: + properties: + Error: + type: string + Payload: + properties: + BundleID: + type: string + type: object + Status: + type: string + type: object + mwListResponse: + description: List of full middleware representations in the `Payload` + schema: + properties: + Error: + type: string + Payload: + items: + $ref: '#/definitions/MW' + type: array + Status: + type: string + type: object + mwResponse: + description: Full middleware response in the `Payload` + schema: + properties: + Error: + type: string + Payload: + $ref: '#/definitions/MW' + Status: + type: string + type: object schemes: -- http -- https + - http + - https securityDefinitions: - api_key: - in: header - name: X-Api-Key - type: apiKey + api_key: + in: header + name: X-Api-Key + type: apiKey swagger: "2.0" diff --git a/go.mod b/go.mod index 5b1e65bc..f9901d3a 100644 --- a/go.mod +++ b/go.mod @@ -6,11 +6,11 @@ require ( github.com/TykTechnologies/goverify v0.0.0-20160822133757-7ccc57452ade github.com/TykTechnologies/serverless v0.0.0-20180728220237-1d6be198f145 github.com/TykTechnologies/tyk v2.9.3+incompatible - github.com/go-openapi/errors v0.19.2 - github.com/go-openapi/runtime v0.19.11 - github.com/go-openapi/strfmt v0.19.3 - github.com/go-openapi/swag v0.19.5 - github.com/go-openapi/validate v0.19.3 + github.com/go-openapi/errors v0.20.4 + github.com/go-openapi/runtime v0.26.0 + github.com/go-openapi/strfmt v0.21.7 + github.com/go-openapi/swag v0.22.4 + github.com/go-openapi/validate v0.22.1 github.com/golang/protobuf v1.5.3 github.com/google/uuid v1.4.0 github.com/gorilla/mux v1.8.1 @@ -32,13 +32,11 @@ require ( ) require ( - github.com/PuerkitoBio/purell v1.1.1 // indirect - github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect github.com/TykTechnologies/gojsonschema v0.0.0-20170222154038-dcb3e4bb7990 // indirect github.com/agext/levenshtein v1.2.2 // indirect github.com/apparentlymart/go-textseg v1.0.0 // indirect - github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect + github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect github.com/aws/aws-sdk-go v1.47.10 // indirect github.com/aws/aws-sdk-go-v2 v0.7.0 // indirect github.com/clbanning/mxj v1.8.4 // indirect @@ -46,12 +44,14 @@ require ( github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db // indirect github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8 // indirect github.com/fsnotify/fsnotify v1.4.7 // indirect + github.com/go-logr/logr v1.2.3 // indirect + github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.4 // indirect - github.com/go-openapi/analysis v0.19.5 // indirect - github.com/go-openapi/jsonpointer v0.19.3 // indirect - github.com/go-openapi/jsonreference v0.19.2 // indirect - github.com/go-openapi/loads v0.19.3 // indirect - github.com/go-openapi/spec v0.19.3 // indirect + github.com/go-openapi/analysis v0.21.4 // indirect + github.com/go-openapi/jsonpointer v0.19.5 // indirect + github.com/go-openapi/jsonreference v0.20.0 // indirect + github.com/go-openapi/loads v0.21.2 // indirect + github.com/go-openapi/spec v0.20.8 // indirect github.com/golang/snappy v0.0.1 // indirect github.com/hashicorp/errwrap v1.0.0 // indirect github.com/hashicorp/go-multierror v1.0.0 // indirect @@ -61,23 +61,27 @@ require ( github.com/hashicorp/terraform v0.12.20 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect + github.com/josharian/intern v1.0.0 // indirect github.com/jpillora/s3 v1.1.4 // indirect github.com/klauspost/compress v1.13.6 // indirect + github.com/kr/pretty v0.2.1 // indirect github.com/lonelycode/go-uuid v0.0.0-20141202165402-ed3ca8a15a93 // indirect github.com/lonelycode/osin v0.0.0-20160423095202-da239c9dacb6 // indirect github.com/magiconair/properties v1.8.1 // indirect - github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e // indirect + github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.1 // indirect github.com/mattn/go-isatty v0.0.5 // indirect github.com/mattn/go-runewidth v0.0.7 // indirect github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect github.com/mitchellh/go-wordwrap v1.0.0 // indirect - github.com/mitchellh/mapstructure v1.1.2 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect + github.com/oklog/ulid v1.3.1 // indirect github.com/onsi/ginkgo v1.12.0 // indirect github.com/onsi/gomega v1.9.0 // indirect - github.com/pelletier/go-toml v1.6.0 // indirect - github.com/pkg/errors v0.8.1 // indirect + github.com/opentracing/opentracing-go v1.2.0 // indirect + github.com/pelletier/go-toml v1.7.0 // indirect + github.com/pkg/errors v0.9.1 // indirect github.com/pmylund/go-cache v2.1.0+incompatible // indirect github.com/spf13/afero v1.2.2 // indirect github.com/spf13/cast v1.3.1 // indirect @@ -93,6 +97,8 @@ require ( github.com/xeipuuv/gojsonschema v1.2.0 // indirect github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect github.com/zclconf/go-cty v1.2.1 // indirect + go.opentelemetry.io/otel v1.14.0 // indirect + go.opentelemetry.io/otel/trace v1.14.0 // indirect golang.org/x/crypto v0.15.0 // indirect golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect golang.org/x/sys v0.14.0 // indirect @@ -100,8 +106,8 @@ require ( golang.org/x/text v0.14.0 // indirect google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 // indirect google.golang.org/protobuf v1.26.0 // indirect - gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect gopkg.in/ini.v1 v1.52.0 // indirect gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 // indirect - gopkg.in/yaml.v2 v2.2.8 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 2bf568ec..fd5ec629 100644 --- a/go.sum +++ b/go.sum @@ -31,10 +31,7 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022/go.mod h1:nuWgzSkT5PnyOd+272uUmV0dnAnAn42Mk7PiQC5VzN4= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUWq3EgK3CesDbo8upS2Vm9/P3FtgI+Jk= github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= @@ -71,9 +68,9 @@ github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5 github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= +github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= +github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= github.com/aws/aws-sdk-go v1.23.4/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= @@ -107,6 +104,7 @@ github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7 github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -115,8 +113,6 @@ github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8 github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= github.com/dnaeon/go-vcr v0.0.0-20180920040454-5637cf3d8a31/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= -github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dylanmei/iso8601 v0.1.0/go.mod h1:w9KhXSgIyROl1DefbMYIE7UVSIvELTbMrCfx+QkYnoQ= github.com/dylanmei/winrmtest v0.0.0-20190225150635-99b7fe2fddf1/go.mod h1:lcy9/2gH1jn/VCLouHA6tOEwLoNVd4GW6zhuKLmHC2Y= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= @@ -127,69 +123,80 @@ github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2 github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= +github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.4 h1:nNBDSCOigTSiarFpYE9J/KtEA1IOW4CNeqT9TQDqCxI= github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= -github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= -github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= -github.com/go-openapi/analysis v0.19.4/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= -github.com/go-openapi/analysis v0.19.5 h1:8b2ZgKfKIUTVQpTb77MoRDIMEIwvDVw40o3aOXdfYzI= -github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= -github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.19.2 h1:a2kIyV3w+OS3S97zxUndRVD46+FhGOUBDFY7nmu4CsY= -github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= -github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= -github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= +github.com/go-openapi/analysis v0.21.2/go.mod h1:HZwRk4RRisyG8vx2Oe6aqeSQcoxRp47Xkp3+K6q+LdY= +github.com/go-openapi/analysis v0.21.4 h1:ZDFLvSNxpDaomuCueM0BlSXxpANBlFYiBvr+GXrvIHc= +github.com/go-openapi/analysis v0.21.4/go.mod h1:4zQ35W4neeZTqh3ol0rv/O8JBbka9QyAgQRPp9y3pfo= +github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/errors v0.19.9/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/errors v0.20.2/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/errors v0.20.4 h1:unTcVm6PispJsMECE3zWgvG4xTiKda1LIR5rCRWLG6M= +github.com/go-openapi/errors v0.20.4/go.mod h1:Z3FlZ4I8jEGxjUK+bugx3on2mIAk4txuAOhlsB1FSgk= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.19.2 h1:o20suLFB4Ri0tuzpWtyHlh7E7HnkqTNLq6aR6WVNS1w= -github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= -github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= -github.com/go-openapi/loads v0.19.3 h1:jwIoahqCmaA5OBoc/B+1+Mu2L0Gr8xYQnbeyQEo/7b0= -github.com/go-openapi/loads v0.19.3/go.mod h1:YVfqhUCdahYwR3f3iiwQLhicVRvLlU/WO5WPaZvcvSI= -github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= -github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= -github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= -github.com/go-openapi/runtime v0.19.11 h1:6J11dQiIV+BOLlMbk2YmM8RvGaOU38syeqy62qhh3W8= -github.com/go-openapi/runtime v0.19.11/go.mod h1:dhGWCTKRXlAfGnQG0ONViOZpjfg0m2gUt9nTQPQZuoo= -github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= -github.com/go-openapi/spec v0.19.3 h1:0XRyw8kguri6Yw4SxhsQA/atC88yqrk0+G4YhI2wabc= -github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= -github.com/go-openapi/strfmt v0.19.2/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= -github.com/go-openapi/strfmt v0.19.3 h1:eRfyY5SkaNJCAwmmMcADjY31ow9+N7MCLW7oRkbsINA= -github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= -github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= +github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= +github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= +github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= +github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= +github.com/go-openapi/loads v0.21.1/go.mod h1:/DtAMXXneXFjbQMGEtbamCZb+4x7eGwkvZCvBmwUG+g= +github.com/go-openapi/loads v0.21.2 h1:r2a/xFIYeZ4Qd2TnGpWDIQNcP80dIaZgf704za8enro= +github.com/go-openapi/loads v0.21.2/go.mod h1:Jq58Os6SSGz0rzh62ptiu8Z31I+OTHqmULx5e/gJbNw= +github.com/go-openapi/runtime v0.26.0 h1:HYOFtG00FM1UvqrcxbEJg/SwvDRvYLQKGhw2zaQjTcc= +github.com/go-openapi/runtime v0.26.0/go.mod h1:QgRGeZwrUcSHdeh4Ka9Glvo0ug1LC5WyE+EV88plZrQ= +github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I= +github.com/go-openapi/spec v0.20.6/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= +github.com/go-openapi/spec v0.20.8 h1:ubHmXNY3FCIOinT8RNrrPfGc9t7I1qhPtdOGoG2AxRU= +github.com/go-openapi/spec v0.20.8/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= +github.com/go-openapi/strfmt v0.21.0/go.mod h1:ZRQ409bWMj+SOgXofQAGTIo2Ebu72Gs+WaRADcS5iNg= +github.com/go-openapi/strfmt v0.21.1/go.mod h1:I/XVKeLc5+MM5oPNN7P6urMOpuLXEcNrCX/rPGuWb0k= +github.com/go-openapi/strfmt v0.21.3/go.mod h1:k+RzNO0Da+k3FrrynSNN8F7n/peCmQQqbbXjtDfvmGg= +github.com/go-openapi/strfmt v0.21.7 h1:rspiXgNWgeUzhjo1YU01do6qsahtJNByjLVbPLNHb8k= +github.com/go-openapi/strfmt v0.21.7/go.mod h1:adeGTkxE44sPyLk0JV235VQAO/ZXUr8KAzYjclFs3ew= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= -github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= -github.com/go-openapi/validate v0.19.3 h1:PAH/2DylwWcIU1s0Y7k3yNmeAgWOcKrNE2Q7Ww/kCg4= -github.com/go-openapi/validate v0.19.3/go.mod h1:90Vh6jjkTn+OT1Eefm0ZixWNFjhtOH7vS9k0lo6zwJo= +github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= +github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/validate v0.22.1 h1:G+c2ub6q47kfX1sOBLwIQwzBVt8qmOAARyo/9Fqs9NU= +github.com/go-openapi/validate v0.22.1/go.mod h1:rjnrwK57VJ7A8xqfpAOEKRH8yQSGUriMu5/zuPSQ1hg= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-test/deep v1.0.1/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= +github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= +github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= +github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= +github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= +github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= +github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= +github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= +github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= +github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= +github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= +github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= +github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= +github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= +github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= +github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= +github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= +github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= @@ -216,14 +223,13 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/readahead v0.0.0-20161222183148-eaceba169032/go.mod h1:qYysrqQXuV4tzsizt4oOQ6mrBZQ0xnQXP3ylXX8Jk5Y= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -289,6 +295,7 @@ github.com/hashicorp/vault v0.10.4/go.mod h1:KfSyffbKxoVyspOdlaGVjIuwLobi07qD1bA github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= @@ -297,7 +304,10 @@ github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9Y github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/joyent/triton-go v0.0.0-20180313100802-d8f9c0314926/go.mod h1:U+RSyWxWd04xTqnuOQxnai7XGS2PrPY2cfGoDKtMHjA= github.com/jpillora/overseer v1.1.6 h1:3ygYfNcR3FfOr22miu3vR1iQcXKMHbmULBh98rbkIyo= github.com/jpillora/overseer v1.1.6/go.mod h1:aPXQtxuVb9PVWRWTXpo+LdnC/YXQ0IBLNXqKMJmgk88= @@ -310,6 +320,8 @@ github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7 github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= +github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= +github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba/go.mod h1:ghbZscTyKdM07+Fw3KSi0hcJm+AlEUWj8QLlPtijN/M= @@ -318,14 +330,16 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= @@ -337,11 +351,13 @@ github.com/lonelycode/osin v0.0.0-20160423095202-da239c9dacb6/go.mod h1:x4kc0i0i github.com/lusis/go-artifactory v0.0.0-20160115162124-7e4ce345df82/go.mod h1:y54tfGmO3NKssKveTEFFzH8C/akrSOy/iW9qEAUDV84= github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= +github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/masterzen/simplexml v0.0.0-20160608183007-4572e39b1ab9/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc= github.com/masterzen/winrm v0.0.0-20190223112901-5e5c9a7fe54b/go.mod h1:wr1VqkwW0AB5JS0QLy5GpVMS9E3VtRoSYXUYyVk46KY= github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE= @@ -374,8 +390,11 @@ github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZX github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= -github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/panicwrap v1.0.0/go.mod h1:pKvZHwWrZowLUzftuFq7coarnxbBXU4aQh3N0BJOeeA= github.com/mitchellh/prefixedio v0.0.0-20190213213902-5733675afd51/go.mod h1:kB1naBgV9ORnkiTVeyJOI1DavaJkG4oNIq0Af6ZVKUo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= @@ -386,8 +405,10 @@ github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe h1:iruDEfMl2E6f github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/ncw/swift v1.0.49/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.4 h1:vHD/YYe1Wolo78koG299f7V/VAS08c6IpCLn+Ejf/w8= github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA= @@ -397,18 +418,20 @@ github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0 github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.9.0 h1:R1uwffexN6Pr340GtYRIdZmAiN4J+iw6WG4wog1DUXg= github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= +github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= +github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58/go.mod h1:f6Izs6JvFTdnRbziASagjZ2vmf55NSIkC/weStxCHqk= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= -github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml v1.6.0 h1:aetoXYr0Tv7xRU/V4B4IZJ2QcbtMUFoNb3ORp7TzIK4= -github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t2kKREewys= +github.com/pelletier/go-toml v1.7.0 h1:7utD74fnzVc/cpcyy8sjrlFr5vYpypUixARcHIMIGuI= +github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.10.0/go.mod h1:NxmoDg/QLVWluQDUYG7XBZTLUpKeFa8e3aMf1BfjyHk= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -431,6 +454,9 @@ github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo= github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -440,6 +466,9 @@ github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644/go.mod h1:nkxAfR/5quYxwPZhyDxgasBMnRtBZd0FCEpawpjMUFg= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= @@ -459,6 +488,7 @@ github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTd github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= @@ -472,12 +502,15 @@ github.com/spf13/viper v1.6.2 h1:7aKfF+e8/k68gda3LOjo5RxiUqddoFxVq4BKBPrxk5E= github.com/spf13/viper v1.6.2/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/svanharmelen/jsonapi v0.0.0-20180618144545-0c0828c3f16d/go.mod h1:BSTlc8jOjh0niykqEGVXOLXdi9o0r0kR8tCYiMvjFgw= @@ -495,8 +528,12 @@ github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7V github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= +github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= +github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g= github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY= github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4= +github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= +github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6c8= github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c= @@ -519,12 +556,18 @@ github.com/zclconf/go-cty v1.2.1 h1:vGMsygfmeCl4Xb6OA5U5XVAaQZ69FvoG7X2jUtQujb8= github.com/zclconf/go-cty v1.2.1/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= github.com/zclconf/go-cty-yaml v1.0.1/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgKa8XhiVHura0= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.mongodb.org/mongo-driver v1.7.3/go.mod h1:NqaYOwnXWr5Pm7AOpO5QFxKJ503nbMse/R79oO62zWg= +go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng= +go.mongodb.org/mongo-driver v1.10.0/go.mod h1:wsihk0Kdgv8Kqu1Anit4sfK+22vSFbUrAVEYRhCXrA8= go.mongodb.org/mongo-driver v1.13.0 h1:67DgFFjYOCMWdtTEmKFpV3ffWlFnh+CYZ8ZS/tXWUfY= go.mongodb.org/mongo-driver v1.13.0/go.mod h1:/rGBTebI3XYboVmgz+Wv3Bcbl3aD0QF9zl6kDDw18rQ= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM= +go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU= +go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY= +go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M= +go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= @@ -534,12 +577,11 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190222235706-ffb98f73852f/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= @@ -558,7 +600,6 @@ golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -566,18 +607,16 @@ golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191009170851-d66e71096ffb/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= @@ -589,7 +628,10 @@ golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -603,17 +645,20 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -629,6 +674,7 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= @@ -645,11 +691,13 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= @@ -685,9 +733,10 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= @@ -704,9 +753,13 @@ gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bl gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/mservclient/client/invocation/invocation_client.go b/mservclient/client/invocation/invocation_client.go index 1acc9dbb..8b529c98 100644 --- a/mservclient/client/invocation/invocation_client.go +++ b/mservclient/client/invocation/invocation_client.go @@ -25,25 +25,27 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - Invoke(params *InvokeParams, authInfo runtime.ClientAuthInfoWriter) (*InvokeOK, error) + Invoke(params *InvokeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InvokeOK, error) SetTransport(transport runtime.ClientTransport) } /* - Invoke invokes a middleware by name +Invoke invokes a middleware by name - Expects a coprocess.Object encoded as JSON in the request body and returns the result in the same way. +Expects a coprocess.Object encoded as JSON in the request body and returns the result in the same way. */ -func (a *Client) Invoke(params *InvokeParams, authInfo runtime.ClientAuthInfoWriter) (*InvokeOK, error) { +func (a *Client) Invoke(params *InvokeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InvokeOK, error) { // TODO: Validate the params before sending if params == nil { params = NewInvokeParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "invoke", Method: "POST", PathPattern: "/execute/{name}", @@ -55,7 +57,12 @@ func (a *Client) Invoke(params *InvokeParams, authInfo runtime.ClientAuthInfoWri AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/mservclient/client/invocation/invoke_parameters.go b/mservclient/client/invocation/invoke_parameters.go index fdaf1da3..ea2bb3d6 100644 --- a/mservclient/client/invocation/invoke_parameters.go +++ b/mservclient/client/invocation/invoke_parameters.go @@ -18,53 +18,55 @@ import ( "github.com/TykTechnologies/mserv/mservclient/models" ) -// NewInvokeParams creates a new InvokeParams object -// with the default values initialized. +// NewInvokeParams creates a new InvokeParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewInvokeParams() *InvokeParams { - var () return &InvokeParams{ - timeout: cr.DefaultTimeout, } } // NewInvokeParamsWithTimeout creates a new InvokeParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewInvokeParamsWithTimeout(timeout time.Duration) *InvokeParams { - var () return &InvokeParams{ - timeout: timeout, } } // NewInvokeParamsWithContext creates a new InvokeParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewInvokeParamsWithContext(ctx context.Context) *InvokeParams { - var () return &InvokeParams{ - Context: ctx, } } // NewInvokeParamsWithHTTPClient creates a new InvokeParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewInvokeParamsWithHTTPClient(client *http.Client) *InvokeParams { - var () return &InvokeParams{ HTTPClient: client, } } -/*InvokeParams contains all the parameters to send to the API endpoint -for the invoke operation typically these are written to a http.Request +/* +InvokeParams contains all the parameters to send to the API endpoint + + for the invoke operation. + + Typically these are written to a http.Request. */ type InvokeParams struct { - /*Body*/ + // Body. Body *models.Object - /*Name*/ + + // Name. Name string timeout time.Duration @@ -72,6 +74,21 @@ type InvokeParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the invoke params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *InvokeParams) WithDefaults() *InvokeParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the invoke params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *InvokeParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the invoke params func (o *InvokeParams) WithTimeout(timeout time.Duration) *InvokeParams { o.SetTimeout(timeout) @@ -134,7 +151,6 @@ func (o *InvokeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regist return err } var res []error - if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/mservclient/client/invocation/invoke_responses.go b/mservclient/client/invocation/invoke_responses.go index b29c1a74..6abfbf04 100644 --- a/mservclient/client/invocation/invoke_responses.go +++ b/mservclient/client/invocation/invoke_responses.go @@ -6,6 +6,7 @@ package invocation // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" @@ -37,9 +38,8 @@ func (o *InvokeReader) ReadResponse(response runtime.ClientResponse, consumer ru return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("[POST /execute/{name}] invoke", response, response.Code()) } } @@ -48,7 +48,8 @@ func NewInvokeOK() *InvokeOK { return &InvokeOK{} } -/*InvokeOK handles this case with default header values. +/* +InvokeOK describes a response with status code 200, with default header values. Middleware invocation response */ @@ -56,10 +57,44 @@ type InvokeOK struct { Payload *InvokeOKBody } +// IsSuccess returns true when this invoke o k response has a 2xx status code +func (o *InvokeOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this invoke o k response has a 3xx status code +func (o *InvokeOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this invoke o k response has a 4xx status code +func (o *InvokeOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this invoke o k response has a 5xx status code +func (o *InvokeOK) IsServerError() bool { + return false +} + +// IsCode returns true when this invoke o k response a status code equal to that given +func (o *InvokeOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the invoke o k response +func (o *InvokeOK) Code() int { + return 200 +} + func (o *InvokeOK) Error() string { return fmt.Sprintf("[POST /execute/{name}][%d] invokeOK %+v", 200, o.Payload) } +func (o *InvokeOK) String() string { + return fmt.Sprintf("[POST /execute/{name}][%d] invokeOK %+v", 200, o.Payload) +} + func (o *InvokeOK) GetPayload() *InvokeOKBody { return o.Payload } @@ -81,7 +116,8 @@ func NewInvokeInternalServerError() *InvokeInternalServerError { return &InvokeInternalServerError{} } -/*InvokeInternalServerError handles this case with default header values. +/* +InvokeInternalServerError describes a response with status code 500, with default header values. Generic error specified by `Status` and `Error` fields */ @@ -89,10 +125,44 @@ type InvokeInternalServerError struct { Payload *models.Payload } +// IsSuccess returns true when this invoke internal server error response has a 2xx status code +func (o *InvokeInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this invoke internal server error response has a 3xx status code +func (o *InvokeInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this invoke internal server error response has a 4xx status code +func (o *InvokeInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this invoke internal server error response has a 5xx status code +func (o *InvokeInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this invoke internal server error response a status code equal to that given +func (o *InvokeInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the invoke internal server error response +func (o *InvokeInternalServerError) Code() int { + return 500 +} + func (o *InvokeInternalServerError) Error() string { return fmt.Sprintf("[POST /execute/{name}][%d] invokeInternalServerError %+v", 500, o.Payload) } +func (o *InvokeInternalServerError) String() string { + return fmt.Sprintf("[POST /execute/{name}][%d] invokeInternalServerError %+v", 500, o.Payload) +} + func (o *InvokeInternalServerError) GetPayload() *models.Payload { return o.Payload } @@ -109,7 +179,8 @@ func (o *InvokeInternalServerError) readResponse(response runtime.ClientResponse return nil } -/*InvokeOKBody invoke o k body +/* +InvokeOKBody invoke o k body swagger:model InvokeOKBody */ type InvokeOKBody struct { @@ -139,7 +210,6 @@ func (o *InvokeOKBody) Validate(formats strfmt.Registry) error { } func (o *InvokeOKBody) validatePayload(formats strfmt.Registry) error { - if swag.IsZero(o.Payload) { // not required return nil } @@ -148,6 +218,43 @@ func (o *InvokeOKBody) validatePayload(formats strfmt.Registry) error { if err := o.Payload.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("invokeOK" + "." + "Payload") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("invokeOK" + "." + "Payload") + } + return err + } + } + + return nil +} + +// ContextValidate validate this invoke o k body based on the context it is used +func (o *InvokeOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidatePayload(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *InvokeOKBody) contextValidatePayload(ctx context.Context, formats strfmt.Registry) error { + + if o.Payload != nil { + + if swag.IsZero(o.Payload) { // not required + return nil + } + + if err := o.Payload.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("invokeOK" + "." + "Payload") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("invokeOK" + "." + "Payload") } return err } diff --git a/mservclient/client/mserv_client.go b/mservclient/client/mserv_api_client.go similarity index 87% rename from mservclient/client/mserv_client.go rename to mservclient/client/mserv_api_client.go index 955839c9..04a9cf49 100644 --- a/mservclient/client/mserv_client.go +++ b/mservclient/client/mserv_api_client.go @@ -15,7 +15,7 @@ import ( "github.com/TykTechnologies/mserv/mservclient/client/system" ) -// Default mserv HTTP client. +// Default mserv API HTTP client. var Default = NewHTTPClient(nil) const ( @@ -30,14 +30,14 @@ const ( // DefaultSchemes are the default schemes found in Meta (info) section of spec file var DefaultSchemes = []string{"http", "https"} -// NewHTTPClient creates a new mserv HTTP client. -func NewHTTPClient(formats strfmt.Registry) *Mserv { +// NewHTTPClient creates a new mserv API HTTP client. +func NewHTTPClient(formats strfmt.Registry) *MservAPI { return NewHTTPClientWithConfig(formats, nil) } -// NewHTTPClientWithConfig creates a new mserv HTTP client, +// NewHTTPClientWithConfig creates a new mserv API HTTP client, // using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Mserv { +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *MservAPI { // ensure nullable parameters have default if cfg == nil { cfg = DefaultTransportConfig() @@ -48,14 +48,14 @@ func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Mse return New(transport, formats) } -// New creates a new mserv client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Mserv { +// New creates a new mserv API client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *MservAPI { // ensure nullable parameters have default if formats == nil { formats = strfmt.Default } - cli := new(Mserv) + cli := new(MservAPI) cli.Transport = transport cli.Invocation = invocation.New(transport, formats) cli.Mw = mw.New(transport, formats) @@ -102,8 +102,8 @@ func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { return cfg } -// Mserv is a client for mserv -type Mserv struct { +// MservAPI is a client for mserv API +type MservAPI struct { Invocation invocation.ClientService Mw mw.ClientService @@ -114,7 +114,7 @@ type Mserv struct { } // SetTransport changes the transport on the client and all its subresources -func (c *Mserv) SetTransport(transport runtime.ClientTransport) { +func (c *MservAPI) SetTransport(transport runtime.ClientTransport) { c.Transport = transport c.Invocation.SetTransport(transport) c.Mw.SetTransport(transport) diff --git a/mservclient/client/mw/mw_add_parameters.go b/mservclient/client/mw/mw_add_parameters.go index d82eed86..bf7ed6a1 100644 --- a/mservclient/client/mw/mw_add_parameters.go +++ b/mservclient/client/mw/mw_add_parameters.go @@ -17,55 +17,58 @@ import ( "github.com/go-openapi/swag" ) -// NewMwAddParams creates a new MwAddParams object -// with the default values initialized. +// NewMwAddParams creates a new MwAddParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewMwAddParams() *MwAddParams { - var () return &MwAddParams{ - timeout: cr.DefaultTimeout, } } // NewMwAddParamsWithTimeout creates a new MwAddParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewMwAddParamsWithTimeout(timeout time.Duration) *MwAddParams { - var () return &MwAddParams{ - timeout: timeout, } } // NewMwAddParamsWithContext creates a new MwAddParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewMwAddParamsWithContext(ctx context.Context) *MwAddParams { - var () return &MwAddParams{ - Context: ctx, } } // NewMwAddParamsWithHTTPClient creates a new MwAddParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewMwAddParamsWithHTTPClient(client *http.Client) *MwAddParams { - var () return &MwAddParams{ HTTPClient: client, } } -/*MwAddParams contains all the parameters to send to the API endpoint -for the mw add operation typically these are written to a http.Request +/* +MwAddParams contains all the parameters to send to the API endpoint + + for the mw add operation. + + Typically these are written to a http.Request. */ type MwAddParams struct { - /*APIID*/ + // APIID. APIID *string - /*StoreOnly*/ + + // StoreOnly. StoreOnly *bool - /*Uploadfile*/ + + // Uploadfile. UploadFile runtime.NamedReadCloser timeout time.Duration @@ -73,6 +76,21 @@ type MwAddParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the mw add params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *MwAddParams) WithDefaults() *MwAddParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the mw add params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *MwAddParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the mw add params func (o *MwAddParams) WithTimeout(timeout time.Duration) *MwAddParams { o.SetTimeout(timeout) @@ -141,6 +159,7 @@ func (o *MwAddParams) SetUploadFile(uploadfile runtime.NamedReadCloser) { // WriteToRequest writes these params to a swagger request func (o *MwAddParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + if err := r.SetTimeout(o.timeout); err != nil { return err } @@ -150,34 +169,35 @@ func (o *MwAddParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registr // query param api_id var qrAPIID string + if o.APIID != nil { qrAPIID = *o.APIID } qAPIID := qrAPIID if qAPIID != "" { + if err := r.SetQueryParam("api_id", qAPIID); err != nil { return err } } - } if o.StoreOnly != nil { // query param store_only var qrStoreOnly bool + if o.StoreOnly != nil { qrStoreOnly = *o.StoreOnly } qStoreOnly := swag.FormatBool(qrStoreOnly) if qStoreOnly != "" { + if err := r.SetQueryParam("store_only", qStoreOnly); err != nil { return err } } - } - // form file param uploadfile if err := r.SetFileParam("uploadfile", o.UploadFile); err != nil { return err diff --git a/mservclient/client/mw/mw_add_responses.go b/mservclient/client/mw/mw_add_responses.go index 2b5a2f8c..860b31ec 100644 --- a/mservclient/client/mw/mw_add_responses.go +++ b/mservclient/client/mw/mw_add_responses.go @@ -6,6 +6,7 @@ package mw // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" @@ -37,9 +38,8 @@ func (o *MwAddReader) ReadResponse(response runtime.ClientResponse, consumer run return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("[POST /api/mw] mwAdd", response, response.Code()) } } @@ -48,7 +48,8 @@ func NewMwAddOK() *MwAddOK { return &MwAddOK{} } -/*MwAddOK handles this case with default header values. +/* +MwAddOK describes a response with status code 200, with default header values. Response that only includes the ID of the middleware as `BundleID` in the `Payload` */ @@ -56,10 +57,44 @@ type MwAddOK struct { Payload *MwAddOKBody } +// IsSuccess returns true when this mw add o k response has a 2xx status code +func (o *MwAddOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this mw add o k response has a 3xx status code +func (o *MwAddOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this mw add o k response has a 4xx status code +func (o *MwAddOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this mw add o k response has a 5xx status code +func (o *MwAddOK) IsServerError() bool { + return false +} + +// IsCode returns true when this mw add o k response a status code equal to that given +func (o *MwAddOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the mw add o k response +func (o *MwAddOK) Code() int { + return 200 +} + func (o *MwAddOK) Error() string { return fmt.Sprintf("[POST /api/mw][%d] mwAddOK %+v", 200, o.Payload) } +func (o *MwAddOK) String() string { + return fmt.Sprintf("[POST /api/mw][%d] mwAddOK %+v", 200, o.Payload) +} + func (o *MwAddOK) GetPayload() *MwAddOKBody { return o.Payload } @@ -81,7 +116,8 @@ func NewMwAddInternalServerError() *MwAddInternalServerError { return &MwAddInternalServerError{} } -/*MwAddInternalServerError handles this case with default header values. +/* +MwAddInternalServerError describes a response with status code 500, with default header values. Generic error specified by `Status` and `Error` fields */ @@ -89,10 +125,44 @@ type MwAddInternalServerError struct { Payload *models.Payload } +// IsSuccess returns true when this mw add internal server error response has a 2xx status code +func (o *MwAddInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this mw add internal server error response has a 3xx status code +func (o *MwAddInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this mw add internal server error response has a 4xx status code +func (o *MwAddInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this mw add internal server error response has a 5xx status code +func (o *MwAddInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this mw add internal server error response a status code equal to that given +func (o *MwAddInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the mw add internal server error response +func (o *MwAddInternalServerError) Code() int { + return 500 +} + func (o *MwAddInternalServerError) Error() string { return fmt.Sprintf("[POST /api/mw][%d] mwAddInternalServerError %+v", 500, o.Payload) } +func (o *MwAddInternalServerError) String() string { + return fmt.Sprintf("[POST /api/mw][%d] mwAddInternalServerError %+v", 500, o.Payload) +} + func (o *MwAddInternalServerError) GetPayload() *models.Payload { return o.Payload } @@ -109,7 +179,8 @@ func (o *MwAddInternalServerError) readResponse(response runtime.ClientResponse, return nil } -/*MwAddOKBody mw add o k body +/* +MwAddOKBody mw add o k body swagger:model MwAddOKBody */ type MwAddOKBody struct { @@ -139,7 +210,6 @@ func (o *MwAddOKBody) Validate(formats strfmt.Registry) error { } func (o *MwAddOKBody) validatePayload(formats strfmt.Registry) error { - if swag.IsZero(o.Payload) { // not required return nil } @@ -148,6 +218,43 @@ func (o *MwAddOKBody) validatePayload(formats strfmt.Registry) error { if err := o.Payload.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("mwAddOK" + "." + "Payload") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mwAddOK" + "." + "Payload") + } + return err + } + } + + return nil +} + +// ContextValidate validate this mw add o k body based on the context it is used +func (o *MwAddOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidatePayload(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *MwAddOKBody) contextValidatePayload(ctx context.Context, formats strfmt.Registry) error { + + if o.Payload != nil { + + if swag.IsZero(o.Payload) { // not required + return nil + } + + if err := o.Payload.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mwAddOK" + "." + "Payload") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mwAddOK" + "." + "Payload") } return err } @@ -174,7 +281,8 @@ func (o *MwAddOKBody) UnmarshalBinary(b []byte) error { return nil } -/*MwAddOKBodyPayload mw add o k body payload +/* +MwAddOKBodyPayload mw add o k body payload swagger:model MwAddOKBodyPayload */ type MwAddOKBodyPayload struct { @@ -188,6 +296,11 @@ func (o *MwAddOKBodyPayload) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this mw add o k body payload based on context it is used +func (o *MwAddOKBodyPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *MwAddOKBodyPayload) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/mservclient/client/mw/mw_client.go b/mservclient/client/mw/mw_client.go index d665834c..96c492e5 100644 --- a/mservclient/client/mw/mw_client.go +++ b/mservclient/client/mw/mw_client.go @@ -25,35 +25,37 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - MwAdd(params *MwAddParams, authInfo runtime.ClientAuthInfoWriter) (*MwAddOK, error) + MwAdd(params *MwAddParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*MwAddOK, error) - MwDelete(params *MwDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*MwDeleteOK, error) + MwDelete(params *MwDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*MwDeleteOK, error) - MwFetch(params *MwFetchParams, authInfo runtime.ClientAuthInfoWriter) (*MwFetchOK, error) + MwFetch(params *MwFetchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*MwFetchOK, error) - MwFetchBundle(params *MwFetchBundleParams, authInfo runtime.ClientAuthInfoWriter) (*MwFetchBundleOK, error) + MwFetchBundle(params *MwFetchBundleParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*MwFetchBundleOK, error) - MwListAll(params *MwListAllParams, authInfo runtime.ClientAuthInfoWriter) (*MwListAllOK, error) + MwListAll(params *MwListAllParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*MwListAllOK, error) - MwUpdate(params *MwUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*MwUpdateOK, error) + MwUpdate(params *MwUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*MwUpdateOK, error) SetTransport(transport runtime.ClientTransport) } /* - MwAdd adds a new middleware if store only field is true it will only be available for download +MwAdd adds a new middleware if store only field is true then it will only be available for download - Expects a file bundle in `uploadfile` form field. +Expects a zipped file bundle in the `uploadfile` form field. */ -func (a *Client) MwAdd(params *MwAddParams, authInfo runtime.ClientAuthInfoWriter) (*MwAddOK, error) { +func (a *Client) MwAdd(params *MwAddParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*MwAddOK, error) { // TODO: Validate the params before sending if params == nil { params = NewMwAddParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "mwAdd", Method: "POST", PathPattern: "/api/mw", @@ -65,7 +67,12 @@ func (a *Client) MwAdd(params *MwAddParams, authInfo runtime.ClientAuthInfoWrite AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -80,15 +87,14 @@ func (a *Client) MwAdd(params *MwAddParams, authInfo runtime.ClientAuthInfoWrite } /* - MwDelete deletes a middleware specified by id +MwDelete deletes a middleware specified by id */ -func (a *Client) MwDelete(params *MwDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*MwDeleteOK, error) { +func (a *Client) MwDelete(params *MwDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*MwDeleteOK, error) { // TODO: Validate the params before sending if params == nil { params = NewMwDeleteParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "mwDelete", Method: "DELETE", PathPattern: "/api/mw/{id}", @@ -100,7 +106,12 @@ func (a *Client) MwDelete(params *MwDeleteParams, authInfo runtime.ClientAuthInf AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -115,15 +126,14 @@ func (a *Client) MwDelete(params *MwDeleteParams, authInfo runtime.ClientAuthInf } /* - MwFetch fetches a middleware specified by id +MwFetch fetches a middleware specified by id */ -func (a *Client) MwFetch(params *MwFetchParams, authInfo runtime.ClientAuthInfoWriter) (*MwFetchOK, error) { +func (a *Client) MwFetch(params *MwFetchParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*MwFetchOK, error) { // TODO: Validate the params before sending if params == nil { params = NewMwFetchParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "mwFetch", Method: "GET", PathPattern: "/api/mw/{id}", @@ -135,7 +145,12 @@ func (a *Client) MwFetch(params *MwFetchParams, authInfo runtime.ClientAuthInfoW AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -150,15 +165,14 @@ func (a *Client) MwFetch(params *MwFetchParams, authInfo runtime.ClientAuthInfoW } /* - MwFetchBundle fetches a middleware bundle file specified by id +MwFetchBundle fetches a middleware bundle file specified by id */ -func (a *Client) MwFetchBundle(params *MwFetchBundleParams, authInfo runtime.ClientAuthInfoWriter) (*MwFetchBundleOK, error) { +func (a *Client) MwFetchBundle(params *MwFetchBundleParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*MwFetchBundleOK, error) { // TODO: Validate the params before sending if params == nil { params = NewMwFetchBundleParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "mwFetchBundle", Method: "GET", PathPattern: "/api/mw/bundle/{id}", @@ -170,7 +184,12 @@ func (a *Client) MwFetchBundle(params *MwFetchBundleParams, authInfo runtime.Cli AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -185,15 +204,14 @@ func (a *Client) MwFetchBundle(params *MwFetchBundleParams, authInfo runtime.Cli } /* - MwListAll lists all middleware +MwListAll lists all middleware */ -func (a *Client) MwListAll(params *MwListAllParams, authInfo runtime.ClientAuthInfoWriter) (*MwListAllOK, error) { +func (a *Client) MwListAll(params *MwListAllParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*MwListAllOK, error) { // TODO: Validate the params before sending if params == nil { params = NewMwListAllParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "mwListAll", Method: "GET", PathPattern: "/api/mw/master/all", @@ -205,7 +223,12 @@ func (a *Client) MwListAll(params *MwListAllParams, authInfo runtime.ClientAuthI AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } @@ -220,17 +243,16 @@ func (a *Client) MwListAll(params *MwListAllParams, authInfo runtime.ClientAuthI } /* - MwUpdate updates a middleware specified by id +MwUpdate updates a middleware specified by id - Expects a file bundle in `uploadfile` form field. +Expects a file bundle in `uploadfile` form field. */ -func (a *Client) MwUpdate(params *MwUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*MwUpdateOK, error) { +func (a *Client) MwUpdate(params *MwUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*MwUpdateOK, error) { // TODO: Validate the params before sending if params == nil { params = NewMwUpdateParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "mwUpdate", Method: "PUT", PathPattern: "/api/mw/{id}", @@ -242,7 +264,12 @@ func (a *Client) MwUpdate(params *MwUpdateParams, authInfo runtime.ClientAuthInf AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/mservclient/client/mw/mw_delete_parameters.go b/mservclient/client/mw/mw_delete_parameters.go index 57dda8de..ef88092b 100644 --- a/mservclient/client/mw/mw_delete_parameters.go +++ b/mservclient/client/mw/mw_delete_parameters.go @@ -16,51 +16,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewMwDeleteParams creates a new MwDeleteParams object -// with the default values initialized. +// NewMwDeleteParams creates a new MwDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewMwDeleteParams() *MwDeleteParams { - var () return &MwDeleteParams{ - timeout: cr.DefaultTimeout, } } // NewMwDeleteParamsWithTimeout creates a new MwDeleteParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewMwDeleteParamsWithTimeout(timeout time.Duration) *MwDeleteParams { - var () return &MwDeleteParams{ - timeout: timeout, } } // NewMwDeleteParamsWithContext creates a new MwDeleteParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewMwDeleteParamsWithContext(ctx context.Context) *MwDeleteParams { - var () return &MwDeleteParams{ - Context: ctx, } } // NewMwDeleteParamsWithHTTPClient creates a new MwDeleteParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewMwDeleteParamsWithHTTPClient(client *http.Client) *MwDeleteParams { - var () return &MwDeleteParams{ HTTPClient: client, } } -/*MwDeleteParams contains all the parameters to send to the API endpoint -for the mw delete operation typically these are written to a http.Request +/* +MwDeleteParams contains all the parameters to send to the API endpoint + + for the mw delete operation. + + Typically these are written to a http.Request. */ type MwDeleteParams struct { - /*ID*/ + // ID. ID string timeout time.Duration @@ -68,6 +69,21 @@ type MwDeleteParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the mw delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *MwDeleteParams) WithDefaults() *MwDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the mw delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *MwDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the mw delete params func (o *MwDeleteParams) WithTimeout(timeout time.Duration) *MwDeleteParams { o.SetTimeout(timeout) diff --git a/mservclient/client/mw/mw_delete_responses.go b/mservclient/client/mw/mw_delete_responses.go index 7f0b0641..93694e69 100644 --- a/mservclient/client/mw/mw_delete_responses.go +++ b/mservclient/client/mw/mw_delete_responses.go @@ -6,6 +6,7 @@ package mw // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" @@ -37,9 +38,8 @@ func (o *MwDeleteReader) ReadResponse(response runtime.ClientResponse, consumer return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("[DELETE /api/mw/{id}] mwDelete", response, response.Code()) } } @@ -48,7 +48,8 @@ func NewMwDeleteOK() *MwDeleteOK { return &MwDeleteOK{} } -/*MwDeleteOK handles this case with default header values. +/* +MwDeleteOK describes a response with status code 200, with default header values. Response that only includes the ID of the middleware as `BundleID` in the `Payload` */ @@ -56,10 +57,44 @@ type MwDeleteOK struct { Payload *MwDeleteOKBody } +// IsSuccess returns true when this mw delete o k response has a 2xx status code +func (o *MwDeleteOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this mw delete o k response has a 3xx status code +func (o *MwDeleteOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this mw delete o k response has a 4xx status code +func (o *MwDeleteOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this mw delete o k response has a 5xx status code +func (o *MwDeleteOK) IsServerError() bool { + return false +} + +// IsCode returns true when this mw delete o k response a status code equal to that given +func (o *MwDeleteOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the mw delete o k response +func (o *MwDeleteOK) Code() int { + return 200 +} + func (o *MwDeleteOK) Error() string { return fmt.Sprintf("[DELETE /api/mw/{id}][%d] mwDeleteOK %+v", 200, o.Payload) } +func (o *MwDeleteOK) String() string { + return fmt.Sprintf("[DELETE /api/mw/{id}][%d] mwDeleteOK %+v", 200, o.Payload) +} + func (o *MwDeleteOK) GetPayload() *MwDeleteOKBody { return o.Payload } @@ -81,7 +116,8 @@ func NewMwDeleteInternalServerError() *MwDeleteInternalServerError { return &MwDeleteInternalServerError{} } -/*MwDeleteInternalServerError handles this case with default header values. +/* +MwDeleteInternalServerError describes a response with status code 500, with default header values. Generic error specified by `Status` and `Error` fields */ @@ -89,10 +125,44 @@ type MwDeleteInternalServerError struct { Payload *models.Payload } +// IsSuccess returns true when this mw delete internal server error response has a 2xx status code +func (o *MwDeleteInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this mw delete internal server error response has a 3xx status code +func (o *MwDeleteInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this mw delete internal server error response has a 4xx status code +func (o *MwDeleteInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this mw delete internal server error response has a 5xx status code +func (o *MwDeleteInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this mw delete internal server error response a status code equal to that given +func (o *MwDeleteInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the mw delete internal server error response +func (o *MwDeleteInternalServerError) Code() int { + return 500 +} + func (o *MwDeleteInternalServerError) Error() string { return fmt.Sprintf("[DELETE /api/mw/{id}][%d] mwDeleteInternalServerError %+v", 500, o.Payload) } +func (o *MwDeleteInternalServerError) String() string { + return fmt.Sprintf("[DELETE /api/mw/{id}][%d] mwDeleteInternalServerError %+v", 500, o.Payload) +} + func (o *MwDeleteInternalServerError) GetPayload() *models.Payload { return o.Payload } @@ -109,7 +179,8 @@ func (o *MwDeleteInternalServerError) readResponse(response runtime.ClientRespon return nil } -/*MwDeleteOKBody mw delete o k body +/* +MwDeleteOKBody mw delete o k body swagger:model MwDeleteOKBody */ type MwDeleteOKBody struct { @@ -139,7 +210,6 @@ func (o *MwDeleteOKBody) Validate(formats strfmt.Registry) error { } func (o *MwDeleteOKBody) validatePayload(formats strfmt.Registry) error { - if swag.IsZero(o.Payload) { // not required return nil } @@ -148,6 +218,43 @@ func (o *MwDeleteOKBody) validatePayload(formats strfmt.Registry) error { if err := o.Payload.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("mwDeleteOK" + "." + "Payload") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mwDeleteOK" + "." + "Payload") + } + return err + } + } + + return nil +} + +// ContextValidate validate this mw delete o k body based on the context it is used +func (o *MwDeleteOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidatePayload(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *MwDeleteOKBody) contextValidatePayload(ctx context.Context, formats strfmt.Registry) error { + + if o.Payload != nil { + + if swag.IsZero(o.Payload) { // not required + return nil + } + + if err := o.Payload.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mwDeleteOK" + "." + "Payload") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mwDeleteOK" + "." + "Payload") } return err } @@ -174,7 +281,8 @@ func (o *MwDeleteOKBody) UnmarshalBinary(b []byte) error { return nil } -/*MwDeleteOKBodyPayload mw delete o k body payload +/* +MwDeleteOKBodyPayload mw delete o k body payload swagger:model MwDeleteOKBodyPayload */ type MwDeleteOKBodyPayload struct { @@ -188,6 +296,11 @@ func (o *MwDeleteOKBodyPayload) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this mw delete o k body payload based on context it is used +func (o *MwDeleteOKBodyPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *MwDeleteOKBodyPayload) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/mservclient/client/mw/mw_fetch_bundle_parameters.go b/mservclient/client/mw/mw_fetch_bundle_parameters.go index c833046c..b7250fec 100644 --- a/mservclient/client/mw/mw_fetch_bundle_parameters.go +++ b/mservclient/client/mw/mw_fetch_bundle_parameters.go @@ -16,51 +16,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewMwFetchBundleParams creates a new MwFetchBundleParams object -// with the default values initialized. +// NewMwFetchBundleParams creates a new MwFetchBundleParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewMwFetchBundleParams() *MwFetchBundleParams { - var () return &MwFetchBundleParams{ - timeout: cr.DefaultTimeout, } } // NewMwFetchBundleParamsWithTimeout creates a new MwFetchBundleParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewMwFetchBundleParamsWithTimeout(timeout time.Duration) *MwFetchBundleParams { - var () return &MwFetchBundleParams{ - timeout: timeout, } } // NewMwFetchBundleParamsWithContext creates a new MwFetchBundleParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewMwFetchBundleParamsWithContext(ctx context.Context) *MwFetchBundleParams { - var () return &MwFetchBundleParams{ - Context: ctx, } } // NewMwFetchBundleParamsWithHTTPClient creates a new MwFetchBundleParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewMwFetchBundleParamsWithHTTPClient(client *http.Client) *MwFetchBundleParams { - var () return &MwFetchBundleParams{ HTTPClient: client, } } -/*MwFetchBundleParams contains all the parameters to send to the API endpoint -for the mw fetch bundle operation typically these are written to a http.Request +/* +MwFetchBundleParams contains all the parameters to send to the API endpoint + + for the mw fetch bundle operation. + + Typically these are written to a http.Request. */ type MwFetchBundleParams struct { - /*ID*/ + // ID. ID string timeout time.Duration @@ -68,6 +69,21 @@ type MwFetchBundleParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the mw fetch bundle params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *MwFetchBundleParams) WithDefaults() *MwFetchBundleParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the mw fetch bundle params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *MwFetchBundleParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the mw fetch bundle params func (o *MwFetchBundleParams) WithTimeout(timeout time.Duration) *MwFetchBundleParams { o.SetTimeout(timeout) diff --git a/mservclient/client/mw/mw_fetch_bundle_responses.go b/mservclient/client/mw/mw_fetch_bundle_responses.go index be533ccd..a396d7e8 100644 --- a/mservclient/client/mw/mw_fetch_bundle_responses.go +++ b/mservclient/client/mw/mw_fetch_bundle_responses.go @@ -35,9 +35,8 @@ func (o *MwFetchBundleReader) ReadResponse(response runtime.ClientResponse, cons return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("[GET /api/mw/bundle/{id}] mwFetchBundle", response, response.Code()) } } @@ -46,7 +45,8 @@ func NewMwFetchBundleOK() *MwFetchBundleOK { return &MwFetchBundleOK{} } -/*MwFetchBundleOK handles this case with default header values. +/* +MwFetchBundleOK describes a response with status code 200, with default header values. Middleware bundle as a file */ @@ -54,10 +54,44 @@ type MwFetchBundleOK struct { Payload *models.File } +// IsSuccess returns true when this mw fetch bundle o k response has a 2xx status code +func (o *MwFetchBundleOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this mw fetch bundle o k response has a 3xx status code +func (o *MwFetchBundleOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this mw fetch bundle o k response has a 4xx status code +func (o *MwFetchBundleOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this mw fetch bundle o k response has a 5xx status code +func (o *MwFetchBundleOK) IsServerError() bool { + return false +} + +// IsCode returns true when this mw fetch bundle o k response a status code equal to that given +func (o *MwFetchBundleOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the mw fetch bundle o k response +func (o *MwFetchBundleOK) Code() int { + return 200 +} + func (o *MwFetchBundleOK) Error() string { return fmt.Sprintf("[GET /api/mw/bundle/{id}][%d] mwFetchBundleOK %+v", 200, o.Payload) } +func (o *MwFetchBundleOK) String() string { + return fmt.Sprintf("[GET /api/mw/bundle/{id}][%d] mwFetchBundleOK %+v", 200, o.Payload) +} + func (o *MwFetchBundleOK) GetPayload() *models.File { return o.Payload } @@ -79,7 +113,8 @@ func NewMwFetchBundleInternalServerError() *MwFetchBundleInternalServerError { return &MwFetchBundleInternalServerError{} } -/*MwFetchBundleInternalServerError handles this case with default header values. +/* +MwFetchBundleInternalServerError describes a response with status code 500, with default header values. Generic error specified by `Status` and `Error` fields */ @@ -87,10 +122,44 @@ type MwFetchBundleInternalServerError struct { Payload *models.Payload } +// IsSuccess returns true when this mw fetch bundle internal server error response has a 2xx status code +func (o *MwFetchBundleInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this mw fetch bundle internal server error response has a 3xx status code +func (o *MwFetchBundleInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this mw fetch bundle internal server error response has a 4xx status code +func (o *MwFetchBundleInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this mw fetch bundle internal server error response has a 5xx status code +func (o *MwFetchBundleInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this mw fetch bundle internal server error response a status code equal to that given +func (o *MwFetchBundleInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the mw fetch bundle internal server error response +func (o *MwFetchBundleInternalServerError) Code() int { + return 500 +} + func (o *MwFetchBundleInternalServerError) Error() string { return fmt.Sprintf("[GET /api/mw/bundle/{id}][%d] mwFetchBundleInternalServerError %+v", 500, o.Payload) } +func (o *MwFetchBundleInternalServerError) String() string { + return fmt.Sprintf("[GET /api/mw/bundle/{id}][%d] mwFetchBundleInternalServerError %+v", 500, o.Payload) +} + func (o *MwFetchBundleInternalServerError) GetPayload() *models.Payload { return o.Payload } diff --git a/mservclient/client/mw/mw_fetch_parameters.go b/mservclient/client/mw/mw_fetch_parameters.go index 4bf20c09..6e090dad 100644 --- a/mservclient/client/mw/mw_fetch_parameters.go +++ b/mservclient/client/mw/mw_fetch_parameters.go @@ -16,51 +16,52 @@ import ( "github.com/go-openapi/strfmt" ) -// NewMwFetchParams creates a new MwFetchParams object -// with the default values initialized. +// NewMwFetchParams creates a new MwFetchParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewMwFetchParams() *MwFetchParams { - var () return &MwFetchParams{ - timeout: cr.DefaultTimeout, } } // NewMwFetchParamsWithTimeout creates a new MwFetchParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewMwFetchParamsWithTimeout(timeout time.Duration) *MwFetchParams { - var () return &MwFetchParams{ - timeout: timeout, } } // NewMwFetchParamsWithContext creates a new MwFetchParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewMwFetchParamsWithContext(ctx context.Context) *MwFetchParams { - var () return &MwFetchParams{ - Context: ctx, } } // NewMwFetchParamsWithHTTPClient creates a new MwFetchParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewMwFetchParamsWithHTTPClient(client *http.Client) *MwFetchParams { - var () return &MwFetchParams{ HTTPClient: client, } } -/*MwFetchParams contains all the parameters to send to the API endpoint -for the mw fetch operation typically these are written to a http.Request +/* +MwFetchParams contains all the parameters to send to the API endpoint + + for the mw fetch operation. + + Typically these are written to a http.Request. */ type MwFetchParams struct { - /*ID*/ + // ID. ID string timeout time.Duration @@ -68,6 +69,21 @@ type MwFetchParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the mw fetch params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *MwFetchParams) WithDefaults() *MwFetchParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the mw fetch params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *MwFetchParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the mw fetch params func (o *MwFetchParams) WithTimeout(timeout time.Duration) *MwFetchParams { o.SetTimeout(timeout) diff --git a/mservclient/client/mw/mw_fetch_responses.go b/mservclient/client/mw/mw_fetch_responses.go index 97bf4688..bd570b1c 100644 --- a/mservclient/client/mw/mw_fetch_responses.go +++ b/mservclient/client/mw/mw_fetch_responses.go @@ -6,6 +6,7 @@ package mw // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" @@ -37,9 +38,8 @@ func (o *MwFetchReader) ReadResponse(response runtime.ClientResponse, consumer r return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("[GET /api/mw/{id}] mwFetch", response, response.Code()) } } @@ -48,7 +48,8 @@ func NewMwFetchOK() *MwFetchOK { return &MwFetchOK{} } -/*MwFetchOK handles this case with default header values. +/* +MwFetchOK describes a response with status code 200, with default header values. Full middleware response in the `Payload` */ @@ -56,10 +57,44 @@ type MwFetchOK struct { Payload *MwFetchOKBody } +// IsSuccess returns true when this mw fetch o k response has a 2xx status code +func (o *MwFetchOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this mw fetch o k response has a 3xx status code +func (o *MwFetchOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this mw fetch o k response has a 4xx status code +func (o *MwFetchOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this mw fetch o k response has a 5xx status code +func (o *MwFetchOK) IsServerError() bool { + return false +} + +// IsCode returns true when this mw fetch o k response a status code equal to that given +func (o *MwFetchOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the mw fetch o k response +func (o *MwFetchOK) Code() int { + return 200 +} + func (o *MwFetchOK) Error() string { return fmt.Sprintf("[GET /api/mw/{id}][%d] mwFetchOK %+v", 200, o.Payload) } +func (o *MwFetchOK) String() string { + return fmt.Sprintf("[GET /api/mw/{id}][%d] mwFetchOK %+v", 200, o.Payload) +} + func (o *MwFetchOK) GetPayload() *MwFetchOKBody { return o.Payload } @@ -81,7 +116,8 @@ func NewMwFetchInternalServerError() *MwFetchInternalServerError { return &MwFetchInternalServerError{} } -/*MwFetchInternalServerError handles this case with default header values. +/* +MwFetchInternalServerError describes a response with status code 500, with default header values. Generic error specified by `Status` and `Error` fields */ @@ -89,10 +125,44 @@ type MwFetchInternalServerError struct { Payload *models.Payload } +// IsSuccess returns true when this mw fetch internal server error response has a 2xx status code +func (o *MwFetchInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this mw fetch internal server error response has a 3xx status code +func (o *MwFetchInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this mw fetch internal server error response has a 4xx status code +func (o *MwFetchInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this mw fetch internal server error response has a 5xx status code +func (o *MwFetchInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this mw fetch internal server error response a status code equal to that given +func (o *MwFetchInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the mw fetch internal server error response +func (o *MwFetchInternalServerError) Code() int { + return 500 +} + func (o *MwFetchInternalServerError) Error() string { return fmt.Sprintf("[GET /api/mw/{id}][%d] mwFetchInternalServerError %+v", 500, o.Payload) } +func (o *MwFetchInternalServerError) String() string { + return fmt.Sprintf("[GET /api/mw/{id}][%d] mwFetchInternalServerError %+v", 500, o.Payload) +} + func (o *MwFetchInternalServerError) GetPayload() *models.Payload { return o.Payload } @@ -109,7 +179,8 @@ func (o *MwFetchInternalServerError) readResponse(response runtime.ClientRespons return nil } -/*MwFetchOKBody mw fetch o k body +/* +MwFetchOKBody mw fetch o k body swagger:model MwFetchOKBody */ type MwFetchOKBody struct { @@ -139,7 +210,6 @@ func (o *MwFetchOKBody) Validate(formats strfmt.Registry) error { } func (o *MwFetchOKBody) validatePayload(formats strfmt.Registry) error { - if swag.IsZero(o.Payload) { // not required return nil } @@ -148,6 +218,43 @@ func (o *MwFetchOKBody) validatePayload(formats strfmt.Registry) error { if err := o.Payload.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("mwFetchOK" + "." + "Payload") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mwFetchOK" + "." + "Payload") + } + return err + } + } + + return nil +} + +// ContextValidate validate this mw fetch o k body based on the context it is used +func (o *MwFetchOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidatePayload(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *MwFetchOKBody) contextValidatePayload(ctx context.Context, formats strfmt.Registry) error { + + if o.Payload != nil { + + if swag.IsZero(o.Payload) { // not required + return nil + } + + if err := o.Payload.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mwFetchOK" + "." + "Payload") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mwFetchOK" + "." + "Payload") } return err } diff --git a/mservclient/client/mw/mw_list_all_parameters.go b/mservclient/client/mw/mw_list_all_parameters.go index 34277dfa..68edf808 100644 --- a/mservclient/client/mw/mw_list_all_parameters.go +++ b/mservclient/client/mw/mw_list_all_parameters.go @@ -16,47 +16,48 @@ import ( "github.com/go-openapi/strfmt" ) -// NewMwListAllParams creates a new MwListAllParams object -// with the default values initialized. +// NewMwListAllParams creates a new MwListAllParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewMwListAllParams() *MwListAllParams { - return &MwListAllParams{ - timeout: cr.DefaultTimeout, } } // NewMwListAllParamsWithTimeout creates a new MwListAllParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewMwListAllParamsWithTimeout(timeout time.Duration) *MwListAllParams { - return &MwListAllParams{ - timeout: timeout, } } // NewMwListAllParamsWithContext creates a new MwListAllParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewMwListAllParamsWithContext(ctx context.Context) *MwListAllParams { - return &MwListAllParams{ - Context: ctx, } } // NewMwListAllParamsWithHTTPClient creates a new MwListAllParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewMwListAllParamsWithHTTPClient(client *http.Client) *MwListAllParams { - return &MwListAllParams{ HTTPClient: client, } } -/*MwListAllParams contains all the parameters to send to the API endpoint -for the mw list all operation typically these are written to a http.Request +/* +MwListAllParams contains all the parameters to send to the API endpoint + + for the mw list all operation. + + Typically these are written to a http.Request. */ type MwListAllParams struct { timeout time.Duration @@ -64,6 +65,21 @@ type MwListAllParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the mw list all params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *MwListAllParams) WithDefaults() *MwListAllParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the mw list all params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *MwListAllParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the mw list all params func (o *MwListAllParams) WithTimeout(timeout time.Duration) *MwListAllParams { o.SetTimeout(timeout) diff --git a/mservclient/client/mw/mw_list_all_responses.go b/mservclient/client/mw/mw_list_all_responses.go index 2452bab3..a47256bb 100644 --- a/mservclient/client/mw/mw_list_all_responses.go +++ b/mservclient/client/mw/mw_list_all_responses.go @@ -6,6 +6,7 @@ package mw // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "strconv" @@ -38,9 +39,8 @@ func (o *MwListAllReader) ReadResponse(response runtime.ClientResponse, consumer return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("[GET /api/mw/master/all] mwListAll", response, response.Code()) } } @@ -49,7 +49,8 @@ func NewMwListAllOK() *MwListAllOK { return &MwListAllOK{} } -/*MwListAllOK handles this case with default header values. +/* +MwListAllOK describes a response with status code 200, with default header values. List of full middleware representations in the `Payload` */ @@ -57,10 +58,44 @@ type MwListAllOK struct { Payload *MwListAllOKBody } +// IsSuccess returns true when this mw list all o k response has a 2xx status code +func (o *MwListAllOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this mw list all o k response has a 3xx status code +func (o *MwListAllOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this mw list all o k response has a 4xx status code +func (o *MwListAllOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this mw list all o k response has a 5xx status code +func (o *MwListAllOK) IsServerError() bool { + return false +} + +// IsCode returns true when this mw list all o k response a status code equal to that given +func (o *MwListAllOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the mw list all o k response +func (o *MwListAllOK) Code() int { + return 200 +} + func (o *MwListAllOK) Error() string { return fmt.Sprintf("[GET /api/mw/master/all][%d] mwListAllOK %+v", 200, o.Payload) } +func (o *MwListAllOK) String() string { + return fmt.Sprintf("[GET /api/mw/master/all][%d] mwListAllOK %+v", 200, o.Payload) +} + func (o *MwListAllOK) GetPayload() *MwListAllOKBody { return o.Payload } @@ -82,7 +117,8 @@ func NewMwListAllInternalServerError() *MwListAllInternalServerError { return &MwListAllInternalServerError{} } -/*MwListAllInternalServerError handles this case with default header values. +/* +MwListAllInternalServerError describes a response with status code 500, with default header values. Generic error specified by `Status` and `Error` fields */ @@ -90,10 +126,44 @@ type MwListAllInternalServerError struct { Payload *models.Payload } +// IsSuccess returns true when this mw list all internal server error response has a 2xx status code +func (o *MwListAllInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this mw list all internal server error response has a 3xx status code +func (o *MwListAllInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this mw list all internal server error response has a 4xx status code +func (o *MwListAllInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this mw list all internal server error response has a 5xx status code +func (o *MwListAllInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this mw list all internal server error response a status code equal to that given +func (o *MwListAllInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the mw list all internal server error response +func (o *MwListAllInternalServerError) Code() int { + return 500 +} + func (o *MwListAllInternalServerError) Error() string { return fmt.Sprintf("[GET /api/mw/master/all][%d] mwListAllInternalServerError %+v", 500, o.Payload) } +func (o *MwListAllInternalServerError) String() string { + return fmt.Sprintf("[GET /api/mw/master/all][%d] mwListAllInternalServerError %+v", 500, o.Payload) +} + func (o *MwListAllInternalServerError) GetPayload() *models.Payload { return o.Payload } @@ -110,7 +180,8 @@ func (o *MwListAllInternalServerError) readResponse(response runtime.ClientRespo return nil } -/*MwListAllOKBody mw list all o k body +/* +MwListAllOKBody mw list all o k body swagger:model MwListAllOKBody */ type MwListAllOKBody struct { @@ -140,7 +211,6 @@ func (o *MwListAllOKBody) Validate(formats strfmt.Registry) error { } func (o *MwListAllOKBody) validatePayload(formats strfmt.Registry) error { - if swag.IsZero(o.Payload) { // not required return nil } @@ -154,6 +224,47 @@ func (o *MwListAllOKBody) validatePayload(formats strfmt.Registry) error { if err := o.Payload[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("mwListAllOK" + "." + "Payload" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mwListAllOK" + "." + "Payload" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this mw list all o k body based on the context it is used +func (o *MwListAllOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidatePayload(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *MwListAllOKBody) contextValidatePayload(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Payload); i++ { + + if o.Payload[i] != nil { + + if swag.IsZero(o.Payload[i]) { // not required + return nil + } + + if err := o.Payload[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mwListAllOK" + "." + "Payload" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mwListAllOK" + "." + "Payload" + "." + strconv.Itoa(i)) } return err } diff --git a/mservclient/client/mw/mw_update_parameters.go b/mservclient/client/mw/mw_update_parameters.go index e5c3a3b3..c6a4cf06 100644 --- a/mservclient/client/mw/mw_update_parameters.go +++ b/mservclient/client/mw/mw_update_parameters.go @@ -16,53 +16,55 @@ import ( "github.com/go-openapi/strfmt" ) -// NewMwUpdateParams creates a new MwUpdateParams object -// with the default values initialized. +// NewMwUpdateParams creates a new MwUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewMwUpdateParams() *MwUpdateParams { - var () return &MwUpdateParams{ - timeout: cr.DefaultTimeout, } } // NewMwUpdateParamsWithTimeout creates a new MwUpdateParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewMwUpdateParamsWithTimeout(timeout time.Duration) *MwUpdateParams { - var () return &MwUpdateParams{ - timeout: timeout, } } // NewMwUpdateParamsWithContext creates a new MwUpdateParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewMwUpdateParamsWithContext(ctx context.Context) *MwUpdateParams { - var () return &MwUpdateParams{ - Context: ctx, } } // NewMwUpdateParamsWithHTTPClient creates a new MwUpdateParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewMwUpdateParamsWithHTTPClient(client *http.Client) *MwUpdateParams { - var () return &MwUpdateParams{ HTTPClient: client, } } -/*MwUpdateParams contains all the parameters to send to the API endpoint -for the mw update operation typically these are written to a http.Request +/* +MwUpdateParams contains all the parameters to send to the API endpoint + + for the mw update operation. + + Typically these are written to a http.Request. */ type MwUpdateParams struct { - /*ID*/ + // ID. ID string - /*Uploadfile*/ + + // Uploadfile. UploadFile runtime.NamedReadCloser timeout time.Duration @@ -70,6 +72,21 @@ type MwUpdateParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the mw update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *MwUpdateParams) WithDefaults() *MwUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the mw update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *MwUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the mw update params func (o *MwUpdateParams) WithTimeout(timeout time.Duration) *MwUpdateParams { o.SetTimeout(timeout) @@ -137,7 +154,6 @@ func (o *MwUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regi if err := r.SetPathParam("id", o.ID); err != nil { return err } - // form file param uploadfile if err := r.SetFileParam("uploadfile", o.UploadFile); err != nil { return err diff --git a/mservclient/client/mw/mw_update_responses.go b/mservclient/client/mw/mw_update_responses.go index fa40309c..83b738c0 100644 --- a/mservclient/client/mw/mw_update_responses.go +++ b/mservclient/client/mw/mw_update_responses.go @@ -6,6 +6,7 @@ package mw // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" @@ -37,9 +38,8 @@ func (o *MwUpdateReader) ReadResponse(response runtime.ClientResponse, consumer return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("[PUT /api/mw/{id}] mwUpdate", response, response.Code()) } } @@ -48,7 +48,8 @@ func NewMwUpdateOK() *MwUpdateOK { return &MwUpdateOK{} } -/*MwUpdateOK handles this case with default header values. +/* +MwUpdateOK describes a response with status code 200, with default header values. Response that only includes the ID of the middleware as `BundleID` in the `Payload` */ @@ -56,10 +57,44 @@ type MwUpdateOK struct { Payload *MwUpdateOKBody } +// IsSuccess returns true when this mw update o k response has a 2xx status code +func (o *MwUpdateOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this mw update o k response has a 3xx status code +func (o *MwUpdateOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this mw update o k response has a 4xx status code +func (o *MwUpdateOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this mw update o k response has a 5xx status code +func (o *MwUpdateOK) IsServerError() bool { + return false +} + +// IsCode returns true when this mw update o k response a status code equal to that given +func (o *MwUpdateOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the mw update o k response +func (o *MwUpdateOK) Code() int { + return 200 +} + func (o *MwUpdateOK) Error() string { return fmt.Sprintf("[PUT /api/mw/{id}][%d] mwUpdateOK %+v", 200, o.Payload) } +func (o *MwUpdateOK) String() string { + return fmt.Sprintf("[PUT /api/mw/{id}][%d] mwUpdateOK %+v", 200, o.Payload) +} + func (o *MwUpdateOK) GetPayload() *MwUpdateOKBody { return o.Payload } @@ -81,7 +116,8 @@ func NewMwUpdateInternalServerError() *MwUpdateInternalServerError { return &MwUpdateInternalServerError{} } -/*MwUpdateInternalServerError handles this case with default header values. +/* +MwUpdateInternalServerError describes a response with status code 500, with default header values. Generic error specified by `Status` and `Error` fields */ @@ -89,10 +125,44 @@ type MwUpdateInternalServerError struct { Payload *models.Payload } +// IsSuccess returns true when this mw update internal server error response has a 2xx status code +func (o *MwUpdateInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this mw update internal server error response has a 3xx status code +func (o *MwUpdateInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this mw update internal server error response has a 4xx status code +func (o *MwUpdateInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this mw update internal server error response has a 5xx status code +func (o *MwUpdateInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this mw update internal server error response a status code equal to that given +func (o *MwUpdateInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the mw update internal server error response +func (o *MwUpdateInternalServerError) Code() int { + return 500 +} + func (o *MwUpdateInternalServerError) Error() string { return fmt.Sprintf("[PUT /api/mw/{id}][%d] mwUpdateInternalServerError %+v", 500, o.Payload) } +func (o *MwUpdateInternalServerError) String() string { + return fmt.Sprintf("[PUT /api/mw/{id}][%d] mwUpdateInternalServerError %+v", 500, o.Payload) +} + func (o *MwUpdateInternalServerError) GetPayload() *models.Payload { return o.Payload } @@ -109,7 +179,8 @@ func (o *MwUpdateInternalServerError) readResponse(response runtime.ClientRespon return nil } -/*MwUpdateOKBody mw update o k body +/* +MwUpdateOKBody mw update o k body swagger:model MwUpdateOKBody */ type MwUpdateOKBody struct { @@ -139,7 +210,6 @@ func (o *MwUpdateOKBody) Validate(formats strfmt.Registry) error { } func (o *MwUpdateOKBody) validatePayload(formats strfmt.Registry) error { - if swag.IsZero(o.Payload) { // not required return nil } @@ -148,6 +218,43 @@ func (o *MwUpdateOKBody) validatePayload(formats strfmt.Registry) error { if err := o.Payload.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("mwUpdateOK" + "." + "Payload") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mwUpdateOK" + "." + "Payload") + } + return err + } + } + + return nil +} + +// ContextValidate validate this mw update o k body based on the context it is used +func (o *MwUpdateOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidatePayload(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *MwUpdateOKBody) contextValidatePayload(ctx context.Context, formats strfmt.Registry) error { + + if o.Payload != nil { + + if swag.IsZero(o.Payload) { // not required + return nil + } + + if err := o.Payload.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mwUpdateOK" + "." + "Payload") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mwUpdateOK" + "." + "Payload") } return err } @@ -174,7 +281,8 @@ func (o *MwUpdateOKBody) UnmarshalBinary(b []byte) error { return nil } -/*MwUpdateOKBodyPayload mw update o k body payload +/* +MwUpdateOKBodyPayload mw update o k body payload swagger:model MwUpdateOKBodyPayload */ type MwUpdateOKBodyPayload struct { @@ -188,6 +296,11 @@ func (o *MwUpdateOKBodyPayload) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this mw update o k body payload based on context it is used +func (o *MwUpdateOKBodyPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (o *MwUpdateOKBodyPayload) MarshalBinary() ([]byte, error) { if o == nil { diff --git a/mservclient/client/system/health_parameters.go b/mservclient/client/system/health_parameters.go index e4836c5f..129be1a4 100644 --- a/mservclient/client/system/health_parameters.go +++ b/mservclient/client/system/health_parameters.go @@ -16,47 +16,48 @@ import ( "github.com/go-openapi/strfmt" ) -// NewHealthParams creates a new HealthParams object -// with the default values initialized. +// NewHealthParams creates a new HealthParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. func NewHealthParams() *HealthParams { - return &HealthParams{ - timeout: cr.DefaultTimeout, } } // NewHealthParamsWithTimeout creates a new HealthParams object -// with the default values initialized, and the ability to set a timeout on a request +// with the ability to set a timeout on a request. func NewHealthParamsWithTimeout(timeout time.Duration) *HealthParams { - return &HealthParams{ - timeout: timeout, } } // NewHealthParamsWithContext creates a new HealthParams object -// with the default values initialized, and the ability to set a context for a request +// with the ability to set a context for a request. func NewHealthParamsWithContext(ctx context.Context) *HealthParams { - return &HealthParams{ - Context: ctx, } } // NewHealthParamsWithHTTPClient creates a new HealthParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request +// with the ability to set a custom HTTPClient for a request. func NewHealthParamsWithHTTPClient(client *http.Client) *HealthParams { - return &HealthParams{ HTTPClient: client, } } -/*HealthParams contains all the parameters to send to the API endpoint -for the health operation typically these are written to a http.Request +/* +HealthParams contains all the parameters to send to the API endpoint + + for the health operation. + + Typically these are written to a http.Request. */ type HealthParams struct { timeout time.Duration @@ -64,6 +65,21 @@ type HealthParams struct { HTTPClient *http.Client } +// WithDefaults hydrates default values in the health params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *HealthParams) WithDefaults() *HealthParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the health params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *HealthParams) SetDefaults() { + // no default values defined for this parameter +} + // WithTimeout adds the timeout to the health params func (o *HealthParams) WithTimeout(timeout time.Duration) *HealthParams { o.SetTimeout(timeout) diff --git a/mservclient/client/system/health_responses.go b/mservclient/client/system/health_responses.go index 9e7ca744..61033e48 100644 --- a/mservclient/client/system/health_responses.go +++ b/mservclient/client/system/health_responses.go @@ -6,6 +6,7 @@ package system // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" @@ -37,9 +38,8 @@ func (o *HealthReader) ReadResponse(response runtime.ClientResponse, consumer ru return nil, err } return nil, result - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) + return nil, runtime.NewAPIError("[GET /health] health", response, response.Code()) } } @@ -48,7 +48,8 @@ func NewHealthOK() *HealthOK { return &HealthOK{} } -/*HealthOK handles this case with default header values. +/* +HealthOK describes a response with status code 200, with default header values. Health status response */ @@ -56,10 +57,44 @@ type HealthOK struct { Payload *HealthOKBody } +// IsSuccess returns true when this health o k response has a 2xx status code +func (o *HealthOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this health o k response has a 3xx status code +func (o *HealthOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this health o k response has a 4xx status code +func (o *HealthOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this health o k response has a 5xx status code +func (o *HealthOK) IsServerError() bool { + return false +} + +// IsCode returns true when this health o k response a status code equal to that given +func (o *HealthOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the health o k response +func (o *HealthOK) Code() int { + return 200 +} + func (o *HealthOK) Error() string { return fmt.Sprintf("[GET /health][%d] healthOK %+v", 200, o.Payload) } +func (o *HealthOK) String() string { + return fmt.Sprintf("[GET /health][%d] healthOK %+v", 200, o.Payload) +} + func (o *HealthOK) GetPayload() *HealthOKBody { return o.Payload } @@ -81,7 +116,8 @@ func NewHealthInternalServerError() *HealthInternalServerError { return &HealthInternalServerError{} } -/*HealthInternalServerError handles this case with default header values. +/* +HealthInternalServerError describes a response with status code 500, with default header values. Health status response */ @@ -89,10 +125,44 @@ type HealthInternalServerError struct { Payload *HealthInternalServerErrorBody } +// IsSuccess returns true when this health internal server error response has a 2xx status code +func (o *HealthInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this health internal server error response has a 3xx status code +func (o *HealthInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this health internal server error response has a 4xx status code +func (o *HealthInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this health internal server error response has a 5xx status code +func (o *HealthInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this health internal server error response a status code equal to that given +func (o *HealthInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the health internal server error response +func (o *HealthInternalServerError) Code() int { + return 500 +} + func (o *HealthInternalServerError) Error() string { return fmt.Sprintf("[GET /health][%d] healthInternalServerError %+v", 500, o.Payload) } +func (o *HealthInternalServerError) String() string { + return fmt.Sprintf("[GET /health][%d] healthInternalServerError %+v", 500, o.Payload) +} + func (o *HealthInternalServerError) GetPayload() *HealthInternalServerErrorBody { return o.Payload } @@ -109,7 +179,8 @@ func (o *HealthInternalServerError) readResponse(response runtime.ClientResponse return nil } -/*HealthInternalServerErrorBody health internal server error body +/* +HealthInternalServerErrorBody health internal server error body swagger:model HealthInternalServerErrorBody */ type HealthInternalServerErrorBody struct { @@ -139,7 +210,6 @@ func (o *HealthInternalServerErrorBody) Validate(formats strfmt.Registry) error } func (o *HealthInternalServerErrorBody) validatePayload(formats strfmt.Registry) error { - if swag.IsZero(o.Payload) { // not required return nil } @@ -148,6 +218,43 @@ func (o *HealthInternalServerErrorBody) validatePayload(formats strfmt.Registry) if err := o.Payload.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("healthInternalServerError" + "." + "Payload") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("healthInternalServerError" + "." + "Payload") + } + return err + } + } + + return nil +} + +// ContextValidate validate this health internal server error body based on the context it is used +func (o *HealthInternalServerErrorBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidatePayload(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *HealthInternalServerErrorBody) contextValidatePayload(ctx context.Context, formats strfmt.Registry) error { + + if o.Payload != nil { + + if swag.IsZero(o.Payload) { // not required + return nil + } + + if err := o.Payload.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("healthInternalServerError" + "." + "Payload") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("healthInternalServerError" + "." + "Payload") } return err } @@ -174,7 +281,8 @@ func (o *HealthInternalServerErrorBody) UnmarshalBinary(b []byte) error { return nil } -/*HealthOKBody health o k body +/* +HealthOKBody health o k body swagger:model HealthOKBody */ type HealthOKBody struct { @@ -204,7 +312,6 @@ func (o *HealthOKBody) Validate(formats strfmt.Registry) error { } func (o *HealthOKBody) validatePayload(formats strfmt.Registry) error { - if swag.IsZero(o.Payload) { // not required return nil } @@ -213,6 +320,43 @@ func (o *HealthOKBody) validatePayload(formats strfmt.Registry) error { if err := o.Payload.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("healthOK" + "." + "Payload") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("healthOK" + "." + "Payload") + } + return err + } + } + + return nil +} + +// ContextValidate validate this health o k body based on the context it is used +func (o *HealthOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidatePayload(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *HealthOKBody) contextValidatePayload(ctx context.Context, formats strfmt.Registry) error { + + if o.Payload != nil { + + if swag.IsZero(o.Payload) { // not required + return nil + } + + if err := o.Payload.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("healthOK" + "." + "Payload") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("healthOK" + "." + "Payload") } return err } diff --git a/mservclient/client/system/system_client.go b/mservclient/client/system/system_client.go index 63f7f78e..774b6cd5 100644 --- a/mservclient/client/system/system_client.go +++ b/mservclient/client/system/system_client.go @@ -25,23 +25,25 @@ type Client struct { formats strfmt.Registry } +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + // ClientService is the interface for Client methods type ClientService interface { - Health(params *HealthParams) (*HealthOK, error) + Health(params *HealthParams, opts ...ClientOption) (*HealthOK, error) SetTransport(transport runtime.ClientTransport) } /* - Health queries health status of mserv service +Health queries health status of mserv service */ -func (a *Client) Health(params *HealthParams) (*HealthOK, error) { +func (a *Client) Health(params *HealthParams, opts ...ClientOption) (*HealthOK, error) { // TODO: Validate the params before sending if params == nil { params = NewHealthParams() } - - result, err := a.transport.Submit(&runtime.ClientOperation{ + op := &runtime.ClientOperation{ ID: "health", Method: "GET", PathPattern: "/health", @@ -52,7 +54,12 @@ func (a *Client) Health(params *HealthParams) (*HealthOK, error) { Reader: &HealthReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - }) + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) if err != nil { return nil, err } diff --git a/mservclient/models/access_definition.go b/mservclient/models/access_definition.go index 5813bacf..a89b27ef 100644 --- a/mservclient/models/access_definition.go +++ b/mservclient/models/access_definition.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -13,29 +14,39 @@ import ( "github.com/go-openapi/swag" ) -// AccessDefinition access definition +// AccessDefinition AccessDefinition defines which versions of an API a key has access to // // swagger:model AccessDefinition type AccessDefinition struct { - // allowed urls - AllowedUrls []*AccessSpec `json:"allowed_urls"` - - // Api Id + // API ID APIID string `json:"api_id,omitempty"` - // Api name + // API name APIName string `json:"api_name,omitempty"` + // allowance scope + AllowanceScope string `json:"allowance_scope,omitempty"` + + // allowed u r ls + AllowedURLs []*AccessSpec `json:"allowed_urls"` + // versions Versions []string `json:"versions"` + + // limit + Limit *APILimit `json:"limit,omitempty"` } // Validate validates this access definition func (m *AccessDefinition) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateAllowedUrls(formats); err != nil { + if err := m.validateAllowedURLs(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLimit(formats); err != nil { res = append(res, err) } @@ -45,21 +56,84 @@ func (m *AccessDefinition) Validate(formats strfmt.Registry) error { return nil } -func (m *AccessDefinition) validateAllowedUrls(formats strfmt.Registry) error { - - if swag.IsZero(m.AllowedUrls) { // not required +func (m *AccessDefinition) validateAllowedURLs(formats strfmt.Registry) error { + if swag.IsZero(m.AllowedURLs) { // not required return nil } - for i := 0; i < len(m.AllowedUrls); i++ { - if swag.IsZero(m.AllowedUrls[i]) { // not required + for i := 0; i < len(m.AllowedURLs); i++ { + if swag.IsZero(m.AllowedURLs[i]) { // not required continue } - if m.AllowedUrls[i] != nil { - if err := m.AllowedUrls[i].Validate(formats); err != nil { + if m.AllowedURLs[i] != nil { + if err := m.AllowedURLs[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("allowed_urls" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("allowed_urls" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *AccessDefinition) validateLimit(formats strfmt.Registry) error { + if swag.IsZero(m.Limit) { // not required + return nil + } + + if m.Limit != nil { + if err := m.Limit.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("limit") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("limit") + } + return err + } + } + + return nil +} + +// ContextValidate validate this access definition based on the context it is used +func (m *AccessDefinition) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAllowedURLs(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLimit(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AccessDefinition) contextValidateAllowedURLs(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.AllowedURLs); i++ { + + if m.AllowedURLs[i] != nil { + + if swag.IsZero(m.AllowedURLs[i]) { // not required + return nil + } + + if err := m.AllowedURLs[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("allowed_urls" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("allowed_urls" + "." + strconv.Itoa(i)) } return err } @@ -70,6 +144,27 @@ func (m *AccessDefinition) validateAllowedUrls(formats strfmt.Registry) error { return nil } +func (m *AccessDefinition) contextValidateLimit(ctx context.Context, formats strfmt.Registry) error { + + if m.Limit != nil { + + if swag.IsZero(m.Limit) { // not required + return nil + } + + if err := m.Limit.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("limit") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("limit") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *AccessDefinition) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/mservclient/models/access_request_type.go b/mservclient/models/access_request_type.go new file mode 100644 index 00000000..f5a77181 --- /dev/null +++ b/mservclient/models/access_request_type.go @@ -0,0 +1,27 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" +) + +// AccessRequestType AccessRequestType is the type for OAuth param `grant_type` +// +// swagger:model AccessRequestType +type AccessRequestType string + +// Validate validates this access request type +func (m AccessRequestType) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this access request type based on context it is used +func (m AccessRequestType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/mservclient/models/access_spec.go b/mservclient/models/access_spec.go index 0d14764f..bb19f8e4 100644 --- a/mservclient/models/access_spec.go +++ b/mservclient/models/access_spec.go @@ -6,11 +6,13 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) -// AccessSpec access spec +// AccessSpec AccessSpecs define what URLS a user has access to an what methods are enabled // // swagger:model AccessSpec type AccessSpec struct { @@ -18,7 +20,7 @@ type AccessSpec struct { // methods Methods []string `json:"methods"` - // Url + // URL URL string `json:"url,omitempty"` } @@ -27,6 +29,11 @@ func (m *AccessSpec) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this access spec based on context it is used +func (m *AccessSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *AccessSpec) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/mservclient/models/api_definition.go b/mservclient/models/api_definition.go new file mode 100644 index 00000000..d1e49763 --- /dev/null +++ b/mservclient/models/api_definition.go @@ -0,0 +1,2145 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// APIDefinition APIDefinition represents the configuration for a single proxied API and it's versions. +// +// swagger:model APIDefinition +type APIDefinition struct { + + // API ID + APIID string `json:"api_id,omitempty"` + + // active + Active bool `json:"active,omitempty"` + + // allowed i ps + AllowedIPs []string `json:"allowed_ips"` + + // auth configs + AuthConfigs map[string]AuthConfig `json:"auth_configs,omitempty"` + + // blacklisted i ps + BlacklistedIPs []string `json:"blacklisted_ips"` + + // c o r s + CORS *APIDefinitionCORS `json:"CORS,omitempty"` + + // certificates + Certificates []string `json:"certificates"` + + // client certificates + ClientCertificates []string `json:"client_certificates"` + + // config data + ConfigData interface{} `json:"config_data,omitempty"` + + // custom middleware bundle + CustomMiddlewareBundle string `json:"custom_middleware_bundle,omitempty"` + + // disable quota + DisableQuota bool `json:"disable_quota,omitempty"` + + // disable rate limit + DisableRateLimit bool `json:"disable_rate_limit,omitempty"` + + // do not track + DoNotTrack bool `json:"do_not_track,omitempty"` + + // domain + Domain string `json:"domain,omitempty"` + + // dont set quotas on create + DontSetQuotasOnCreate bool `json:"dont_set_quota_on_create,omitempty"` + + // enable batch request support + EnableBatchRequestSupport bool `json:"enable_batch_request_support,omitempty"` + + // enable co process auth + EnableCoProcessAuth bool `json:"enable_coprocess_auth,omitempty"` + + // enable context vars + EnableContextVars bool `json:"enable_context_vars,omitempty"` + + // enable detailed recording + EnableDetailedRecording bool `json:"enable_detailed_recording,omitempty"` + + // enable Ip blacklisting + EnableIPBlacklisting bool `json:"enable_ip_blacklisting,omitempty"` + + // enable Ip white listing + EnableIPWhiteListing bool `json:"enable_ip_whitelisting,omitempty"` + + // enable j w t + EnableJWT bool `json:"enable_jwt,omitempty"` + + // enable proxy protocol + EnableProxyProtocol bool `json:"enable_proxy_protocol,omitempty"` + + // enable signature checking + EnableSignatureChecking bool `json:"enable_signature_checking,omitempty"` + + // expire analytics after + ExpireAnalyticsAfter int64 `json:"expire_analytics_after,omitempty"` + + // hmac allowed algorithms + HmacAllowedAlgorithms []string `json:"hmac_allowed_algorithms"` + + // hmac allowed clock skew + HmacAllowedClockSkew float64 `json:"hmac_allowed_clock_skew,omitempty"` + + // Id + ID string `json:"id,omitempty"` + + // internal + Internal bool `json:"internal,omitempty"` + + // j w t client ID base field + JWTClientIDBaseField string `json:"jwt_client_base_field,omitempty"` + + // j w t default policies + JWTDefaultPolicies []string `json:"jwt_default_policies"` + + // j w t expires at validation skew + JWTExpiresAtValidationSkew uint64 `json:"jwt_expires_at_validation_skew,omitempty"` + + // j w t identity base field + JWTIdentityBaseField string `json:"jwt_identity_base_field,omitempty"` + + // j w t issued at validation skew + JWTIssuedAtValidationSkew uint64 `json:"jwt_issued_at_validation_skew,omitempty"` + + // j w t not before validation skew + JWTNotBeforeValidationSkew uint64 `json:"jwt_not_before_validation_skew,omitempty"` + + // j w t policy field name + JWTPolicyFieldName string `json:"jwt_policy_field_name,omitempty"` + + // j w t scope claim name + JWTScopeClaimName string `json:"jwt_scope_claim_name,omitempty"` + + // j w t scope to policy mapping + JWTScopeToPolicyMapping map[string]string `json:"jwt_scope_to_policy_mapping,omitempty"` + + // j w t signing method + JWTSigningMethod string `json:"jwt_signing_method,omitempty"` + + // j w t skip kid + JWTSkipKid bool `json:"jwt_skip_kid,omitempty"` + + // j w t source + JWTSource string `json:"jwt_source,omitempty"` + + // listen port + ListenPort int64 `json:"listen_port,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // org ID + OrgID string `json:"org_id,omitempty"` + + // pinned public keys + PinnedPublicKeys map[string]string `json:"pinned_public_keys,omitempty"` + + // protocol + Protocol string `json:"protocol,omitempty"` + + // response processors + ResponseProcessors []*ResponseProcessor `json:"response_processors"` + + // session lifetime + SessionLifetime int64 `json:"session_lifetime,omitempty"` + + // slug + Slug string `json:"slug,omitempty"` + + // strip auth data + StripAuthData bool `json:"strip_auth_data,omitempty"` + + // tag headers + TagHeaders []string `json:"tag_headers"` + + // tags + Tags []string `json:"tags"` + + // upstream certificates + UpstreamCertificates map[string]string `json:"upstream_certificates,omitempty"` + + // use basic auth + UseBasicAuth bool `json:"use_basic_auth,omitempty"` + + // use go plugin auth + UseGoPluginAuth bool `json:"use_go_plugin_auth,omitempty"` + + // use keyless access + UseKeylessAccess bool `json:"use_keyless,omitempty"` + + // use mutual TLS auth + UseMutualTLSAuth bool `json:"use_mutual_tls_auth,omitempty"` + + // use oauth2 + UseOauth2 bool `json:"use_oauth2,omitempty"` + + // use open ID + UseOpenID bool `json:"use_openid,omitempty"` + + // use standard auth + UseStandardAuth bool `json:"use_standard_auth,omitempty"` + + // auth + Auth *AuthConfig `json:"auth,omitempty"` + + // auth provider + AuthProvider *AuthProviderMeta `json:"auth_provider,omitempty"` + + // base identity provided by + BaseIdentityProvidedBy AuthTypeEnum `json:"base_identity_provided_by,omitempty"` + + // basic auth + BasicAuth *BasicAuth `json:"basic_auth,omitempty"` + + // cache options + CacheOptions *CacheOptions `json:"cache_options,omitempty"` + + // custom middleware + CustomMiddleware *MiddlewareSection `json:"custom_middleware,omitempty"` + + // definition + Definition *VersionDefinition `json:"definition,omitempty"` + + // event handlers + EventHandlers *EventHandlerMetaConfig `json:"event_handlers,omitempty"` + + // global rate limit + GlobalRateLimit *GlobalRateLimit `json:"global_rate_limit,omitempty"` + + // notifications + Notifications *NotificationsManager `json:"notifications,omitempty"` + + // oauth meta + OauthMeta *Oauth2Meta `json:"oauth_meta,omitempty"` + + // openid options + OpenidOptions *OpenIDOptions `json:"openid_options,omitempty"` + + // proxy + Proxy *Proxy `json:"proxy,omitempty"` + + // request signing + RequestSigning *RequestSigningMeta `json:"request_signing,omitempty"` + + // session provider + SessionProvider *SessionProviderMeta `json:"session_provider,omitempty"` + + // uptime tests + UptimeTests *UptimeTests `json:"uptime_tests,omitempty"` + + // version data + VersionData *VersionData `json:"version_data,omitempty"` +} + +// Validate validates this API definition +func (m *APIDefinition) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAuthConfigs(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCORS(formats); err != nil { + res = append(res, err) + } + + if err := m.validateResponseProcessors(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAuth(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAuthProvider(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBaseIdentityProvidedBy(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBasicAuth(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCacheOptions(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCustomMiddleware(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDefinition(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEventHandlers(formats); err != nil { + res = append(res, err) + } + + if err := m.validateGlobalRateLimit(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNotifications(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOauthMeta(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOpenidOptions(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProxy(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestSigning(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSessionProvider(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUptimeTests(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVersionData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *APIDefinition) validateAuthConfigs(formats strfmt.Registry) error { + if swag.IsZero(m.AuthConfigs) { // not required + return nil + } + + for k := range m.AuthConfigs { + + if err := validate.Required("auth_configs"+"."+k, "body", m.AuthConfigs[k]); err != nil { + return err + } + if val, ok := m.AuthConfigs[k]; ok { + if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("auth_configs" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("auth_configs" + "." + k) + } + return err + } + } + + } + + return nil +} + +func (m *APIDefinition) validateCORS(formats strfmt.Registry) error { + if swag.IsZero(m.CORS) { // not required + return nil + } + + if m.CORS != nil { + if err := m.CORS.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("CORS") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("CORS") + } + return err + } + } + + return nil +} + +func (m *APIDefinition) validateResponseProcessors(formats strfmt.Registry) error { + if swag.IsZero(m.ResponseProcessors) { // not required + return nil + } + + for i := 0; i < len(m.ResponseProcessors); i++ { + if swag.IsZero(m.ResponseProcessors[i]) { // not required + continue + } + + if m.ResponseProcessors[i] != nil { + if err := m.ResponseProcessors[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("response_processors" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("response_processors" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *APIDefinition) validateAuth(formats strfmt.Registry) error { + if swag.IsZero(m.Auth) { // not required + return nil + } + + if m.Auth != nil { + if err := m.Auth.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("auth") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("auth") + } + return err + } + } + + return nil +} + +func (m *APIDefinition) validateAuthProvider(formats strfmt.Registry) error { + if swag.IsZero(m.AuthProvider) { // not required + return nil + } + + if m.AuthProvider != nil { + if err := m.AuthProvider.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("auth_provider") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("auth_provider") + } + return err + } + } + + return nil +} + +func (m *APIDefinition) validateBaseIdentityProvidedBy(formats strfmt.Registry) error { + if swag.IsZero(m.BaseIdentityProvidedBy) { // not required + return nil + } + + if err := m.BaseIdentityProvidedBy.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("base_identity_provided_by") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("base_identity_provided_by") + } + return err + } + + return nil +} + +func (m *APIDefinition) validateBasicAuth(formats strfmt.Registry) error { + if swag.IsZero(m.BasicAuth) { // not required + return nil + } + + if m.BasicAuth != nil { + if err := m.BasicAuth.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("basic_auth") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("basic_auth") + } + return err + } + } + + return nil +} + +func (m *APIDefinition) validateCacheOptions(formats strfmt.Registry) error { + if swag.IsZero(m.CacheOptions) { // not required + return nil + } + + if m.CacheOptions != nil { + if err := m.CacheOptions.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cache_options") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cache_options") + } + return err + } + } + + return nil +} + +func (m *APIDefinition) validateCustomMiddleware(formats strfmt.Registry) error { + if swag.IsZero(m.CustomMiddleware) { // not required + return nil + } + + if m.CustomMiddleware != nil { + if err := m.CustomMiddleware.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("custom_middleware") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("custom_middleware") + } + return err + } + } + + return nil +} + +func (m *APIDefinition) validateDefinition(formats strfmt.Registry) error { + if swag.IsZero(m.Definition) { // not required + return nil + } + + if m.Definition != nil { + if err := m.Definition.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("definition") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("definition") + } + return err + } + } + + return nil +} + +func (m *APIDefinition) validateEventHandlers(formats strfmt.Registry) error { + if swag.IsZero(m.EventHandlers) { // not required + return nil + } + + if m.EventHandlers != nil { + if err := m.EventHandlers.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("event_handlers") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("event_handlers") + } + return err + } + } + + return nil +} + +func (m *APIDefinition) validateGlobalRateLimit(formats strfmt.Registry) error { + if swag.IsZero(m.GlobalRateLimit) { // not required + return nil + } + + if m.GlobalRateLimit != nil { + if err := m.GlobalRateLimit.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("global_rate_limit") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("global_rate_limit") + } + return err + } + } + + return nil +} + +func (m *APIDefinition) validateNotifications(formats strfmt.Registry) error { + if swag.IsZero(m.Notifications) { // not required + return nil + } + + if m.Notifications != nil { + if err := m.Notifications.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("notifications") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("notifications") + } + return err + } + } + + return nil +} + +func (m *APIDefinition) validateOauthMeta(formats strfmt.Registry) error { + if swag.IsZero(m.OauthMeta) { // not required + return nil + } + + if m.OauthMeta != nil { + if err := m.OauthMeta.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("oauth_meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("oauth_meta") + } + return err + } + } + + return nil +} + +func (m *APIDefinition) validateOpenidOptions(formats strfmt.Registry) error { + if swag.IsZero(m.OpenidOptions) { // not required + return nil + } + + if m.OpenidOptions != nil { + if err := m.OpenidOptions.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("openid_options") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("openid_options") + } + return err + } + } + + return nil +} + +func (m *APIDefinition) validateProxy(formats strfmt.Registry) error { + if swag.IsZero(m.Proxy) { // not required + return nil + } + + if m.Proxy != nil { + if err := m.Proxy.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("proxy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("proxy") + } + return err + } + } + + return nil +} + +func (m *APIDefinition) validateRequestSigning(formats strfmt.Registry) error { + if swag.IsZero(m.RequestSigning) { // not required + return nil + } + + if m.RequestSigning != nil { + if err := m.RequestSigning.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("request_signing") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("request_signing") + } + return err + } + } + + return nil +} + +func (m *APIDefinition) validateSessionProvider(formats strfmt.Registry) error { + if swag.IsZero(m.SessionProvider) { // not required + return nil + } + + if m.SessionProvider != nil { + if err := m.SessionProvider.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("session_provider") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("session_provider") + } + return err + } + } + + return nil +} + +func (m *APIDefinition) validateUptimeTests(formats strfmt.Registry) error { + if swag.IsZero(m.UptimeTests) { // not required + return nil + } + + if m.UptimeTests != nil { + if err := m.UptimeTests.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uptime_tests") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uptime_tests") + } + return err + } + } + + return nil +} + +func (m *APIDefinition) validateVersionData(formats strfmt.Registry) error { + if swag.IsZero(m.VersionData) { // not required + return nil + } + + if m.VersionData != nil { + if err := m.VersionData.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("version_data") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("version_data") + } + return err + } + } + + return nil +} + +// ContextValidate validate this API definition based on the context it is used +func (m *APIDefinition) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAuthConfigs(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCORS(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateResponseProcessors(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateAuth(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateAuthProvider(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBaseIdentityProvidedBy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBasicAuth(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCacheOptions(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCustomMiddleware(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDefinition(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEventHandlers(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateGlobalRateLimit(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNotifications(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOauthMeta(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOpenidOptions(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateProxy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRequestSigning(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSessionProvider(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUptimeTests(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVersionData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *APIDefinition) contextValidateAuthConfigs(ctx context.Context, formats strfmt.Registry) error { + + for k := range m.AuthConfigs { + + if val, ok := m.AuthConfigs[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *APIDefinition) contextValidateCORS(ctx context.Context, formats strfmt.Registry) error { + + if m.CORS != nil { + + if swag.IsZero(m.CORS) { // not required + return nil + } + + if err := m.CORS.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("CORS") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("CORS") + } + return err + } + } + + return nil +} + +func (m *APIDefinition) contextValidateResponseProcessors(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ResponseProcessors); i++ { + + if m.ResponseProcessors[i] != nil { + + if swag.IsZero(m.ResponseProcessors[i]) { // not required + return nil + } + + if err := m.ResponseProcessors[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("response_processors" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("response_processors" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *APIDefinition) contextValidateAuth(ctx context.Context, formats strfmt.Registry) error { + + if m.Auth != nil { + + if swag.IsZero(m.Auth) { // not required + return nil + } + + if err := m.Auth.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("auth") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("auth") + } + return err + } + } + + return nil +} + +func (m *APIDefinition) contextValidateAuthProvider(ctx context.Context, formats strfmt.Registry) error { + + if m.AuthProvider != nil { + + if swag.IsZero(m.AuthProvider) { // not required + return nil + } + + if err := m.AuthProvider.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("auth_provider") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("auth_provider") + } + return err + } + } + + return nil +} + +func (m *APIDefinition) contextValidateBaseIdentityProvidedBy(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.BaseIdentityProvidedBy) { // not required + return nil + } + + if err := m.BaseIdentityProvidedBy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("base_identity_provided_by") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("base_identity_provided_by") + } + return err + } + + return nil +} + +func (m *APIDefinition) contextValidateBasicAuth(ctx context.Context, formats strfmt.Registry) error { + + if m.BasicAuth != nil { + + if swag.IsZero(m.BasicAuth) { // not required + return nil + } + + if err := m.BasicAuth.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("basic_auth") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("basic_auth") + } + return err + } + } + + return nil +} + +func (m *APIDefinition) contextValidateCacheOptions(ctx context.Context, formats strfmt.Registry) error { + + if m.CacheOptions != nil { + + if swag.IsZero(m.CacheOptions) { // not required + return nil + } + + if err := m.CacheOptions.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cache_options") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cache_options") + } + return err + } + } + + return nil +} + +func (m *APIDefinition) contextValidateCustomMiddleware(ctx context.Context, formats strfmt.Registry) error { + + if m.CustomMiddleware != nil { + + if swag.IsZero(m.CustomMiddleware) { // not required + return nil + } + + if err := m.CustomMiddleware.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("custom_middleware") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("custom_middleware") + } + return err + } + } + + return nil +} + +func (m *APIDefinition) contextValidateDefinition(ctx context.Context, formats strfmt.Registry) error { + + if m.Definition != nil { + + if swag.IsZero(m.Definition) { // not required + return nil + } + + if err := m.Definition.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("definition") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("definition") + } + return err + } + } + + return nil +} + +func (m *APIDefinition) contextValidateEventHandlers(ctx context.Context, formats strfmt.Registry) error { + + if m.EventHandlers != nil { + + if swag.IsZero(m.EventHandlers) { // not required + return nil + } + + if err := m.EventHandlers.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("event_handlers") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("event_handlers") + } + return err + } + } + + return nil +} + +func (m *APIDefinition) contextValidateGlobalRateLimit(ctx context.Context, formats strfmt.Registry) error { + + if m.GlobalRateLimit != nil { + + if swag.IsZero(m.GlobalRateLimit) { // not required + return nil + } + + if err := m.GlobalRateLimit.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("global_rate_limit") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("global_rate_limit") + } + return err + } + } + + return nil +} + +func (m *APIDefinition) contextValidateNotifications(ctx context.Context, formats strfmt.Registry) error { + + if m.Notifications != nil { + + if swag.IsZero(m.Notifications) { // not required + return nil + } + + if err := m.Notifications.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("notifications") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("notifications") + } + return err + } + } + + return nil +} + +func (m *APIDefinition) contextValidateOauthMeta(ctx context.Context, formats strfmt.Registry) error { + + if m.OauthMeta != nil { + + if swag.IsZero(m.OauthMeta) { // not required + return nil + } + + if err := m.OauthMeta.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("oauth_meta") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("oauth_meta") + } + return err + } + } + + return nil +} + +func (m *APIDefinition) contextValidateOpenidOptions(ctx context.Context, formats strfmt.Registry) error { + + if m.OpenidOptions != nil { + + if swag.IsZero(m.OpenidOptions) { // not required + return nil + } + + if err := m.OpenidOptions.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("openid_options") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("openid_options") + } + return err + } + } + + return nil +} + +func (m *APIDefinition) contextValidateProxy(ctx context.Context, formats strfmt.Registry) error { + + if m.Proxy != nil { + + if swag.IsZero(m.Proxy) { // not required + return nil + } + + if err := m.Proxy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("proxy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("proxy") + } + return err + } + } + + return nil +} + +func (m *APIDefinition) contextValidateRequestSigning(ctx context.Context, formats strfmt.Registry) error { + + if m.RequestSigning != nil { + + if swag.IsZero(m.RequestSigning) { // not required + return nil + } + + if err := m.RequestSigning.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("request_signing") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("request_signing") + } + return err + } + } + + return nil +} + +func (m *APIDefinition) contextValidateSessionProvider(ctx context.Context, formats strfmt.Registry) error { + + if m.SessionProvider != nil { + + if swag.IsZero(m.SessionProvider) { // not required + return nil + } + + if err := m.SessionProvider.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("session_provider") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("session_provider") + } + return err + } + } + + return nil +} + +func (m *APIDefinition) contextValidateUptimeTests(ctx context.Context, formats strfmt.Registry) error { + + if m.UptimeTests != nil { + + if swag.IsZero(m.UptimeTests) { // not required + return nil + } + + if err := m.UptimeTests.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uptime_tests") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uptime_tests") + } + return err + } + } + + return nil +} + +func (m *APIDefinition) contextValidateVersionData(ctx context.Context, formats strfmt.Registry) error { + + if m.VersionData != nil { + + if swag.IsZero(m.VersionData) { // not required + return nil + } + + if err := m.VersionData.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("version_data") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("version_data") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *APIDefinition) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *APIDefinition) UnmarshalBinary(b []byte) error { + var res APIDefinition + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// BasicAuth basic auth +// +// swagger:model BasicAuth +type BasicAuth struct { + + // body password regexp + BodyPasswordRegexp string `json:"body_password_regexp,omitempty"` + + // body user regexp + BodyUserRegexp string `json:"body_user_regexp,omitempty"` + + // cache TTL + CacheTTL int64 `json:"cache_ttl,omitempty"` + + // disable caching + DisableCaching bool `json:"disable_caching,omitempty"` + + // extract from body + ExtractFromBody bool `json:"extract_from_body,omitempty"` +} + +// Validate validates this basic auth +func (m *BasicAuth) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this basic auth based on context it is used +func (m *BasicAuth) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *BasicAuth) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *BasicAuth) UnmarshalBinary(b []byte) error { + var res BasicAuth + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// APIDefinitionCORS API definition c o r s +// +// swagger:model APIDefinitionCORS +type APIDefinitionCORS struct { + + // allow credentials + AllowCredentials bool `json:"allow_credentials,omitempty"` + + // allowed headers + AllowedHeaders []string `json:"allowed_headers"` + + // allowed methods + AllowedMethods []string `json:"allowed_methods"` + + // allowed origins + AllowedOrigins []string `json:"allowed_origins"` + + // debug + Debug bool `json:"debug,omitempty"` + + // enable + Enable bool `json:"enable,omitempty"` + + // exposed headers + ExposedHeaders []string `json:"exposed_headers"` + + // max age + MaxAge int64 `json:"max_age,omitempty"` + + // options passthrough + OptionsPassthrough bool `json:"options_passthrough,omitempty"` +} + +// Validate validates this API definition c o r s +func (m *APIDefinitionCORS) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this API definition c o r s based on context it is used +func (m *APIDefinitionCORS) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *APIDefinitionCORS) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *APIDefinitionCORS) UnmarshalBinary(b []byte) error { + var res APIDefinitionCORS + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// VersionDefinition version definition +// +// swagger:model VersionDefinition +type VersionDefinition struct { + + // key + Key string `json:"key,omitempty"` + + // location + Location string `json:"location,omitempty"` + + // strip path + StripPath bool `json:"strip_path,omitempty"` +} + +// Validate validates this version definition +func (m *VersionDefinition) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this version definition based on context it is used +func (m *VersionDefinition) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *VersionDefinition) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VersionDefinition) UnmarshalBinary(b []byte) error { + var res VersionDefinition + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// Oauth2Meta oauth2 meta +// +// swagger:model Oauth2Meta +type Oauth2Meta struct { + + // allowed access types + AllowedAccessTypes []AccessRequestType `json:"allowed_access_types"` + + // allowed authorize types + AllowedAuthorizeTypes []AuthorizeRequestType `json:"allowed_authorize_types"` + + // authorize login redirect + AuthorizeLoginRedirect string `json:"auth_login_redirect,omitempty"` +} + +// Validate validates this oauth2 meta +func (m *Oauth2Meta) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAllowedAccessTypes(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAllowedAuthorizeTypes(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Oauth2Meta) validateAllowedAccessTypes(formats strfmt.Registry) error { + if swag.IsZero(m.AllowedAccessTypes) { // not required + return nil + } + + for i := 0; i < len(m.AllowedAccessTypes); i++ { + + if err := m.AllowedAccessTypes[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("oauth_meta" + "." + "allowed_access_types" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("oauth_meta" + "." + "allowed_access_types" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *Oauth2Meta) validateAllowedAuthorizeTypes(formats strfmt.Registry) error { + if swag.IsZero(m.AllowedAuthorizeTypes) { // not required + return nil + } + + for i := 0; i < len(m.AllowedAuthorizeTypes); i++ { + + if err := m.AllowedAuthorizeTypes[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("oauth_meta" + "." + "allowed_authorize_types" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("oauth_meta" + "." + "allowed_authorize_types" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +// ContextValidate validate this oauth2 meta based on the context it is used +func (m *Oauth2Meta) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAllowedAccessTypes(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateAllowedAuthorizeTypes(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Oauth2Meta) contextValidateAllowedAccessTypes(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.AllowedAccessTypes); i++ { + + if swag.IsZero(m.AllowedAccessTypes[i]) { // not required + return nil + } + + if err := m.AllowedAccessTypes[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("oauth_meta" + "." + "allowed_access_types" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("oauth_meta" + "." + "allowed_access_types" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *Oauth2Meta) contextValidateAllowedAuthorizeTypes(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.AllowedAuthorizeTypes); i++ { + + if swag.IsZero(m.AllowedAuthorizeTypes[i]) { // not required + return nil + } + + if err := m.AllowedAuthorizeTypes[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("oauth_meta" + "." + "allowed_authorize_types" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("oauth_meta" + "." + "allowed_authorize_types" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Oauth2Meta) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Oauth2Meta) UnmarshalBinary(b []byte) error { + var res Oauth2Meta + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// Proxy proxy +// +// swagger:model Proxy +type Proxy struct { + + // check host against uptime tests + CheckHostAgainstUptimeTests bool `json:"check_host_against_uptime_tests,omitempty"` + + // disable strip slash + DisableStripSlash bool `json:"disable_strip_slash,omitempty"` + + // enable load balancing + EnableLoadBalancing bool `json:"enable_load_balancing,omitempty"` + + // listen path + ListenPath string `json:"listen_path,omitempty"` + + // preserve host header + PreserveHostHeader bool `json:"preserve_host_header,omitempty"` + + // strip listen path + StripListenPath bool `json:"strip_listen_path,omitempty"` + + // target URL + TargetURL string `json:"target_url,omitempty"` + + // targets + Targets []string `json:"target_list"` + + // service discovery + ServiceDiscovery *ServiceDiscoveryConfiguration `json:"service_discovery,omitempty"` + + // transport + Transport *Transport `json:"transport,omitempty"` +} + +// Validate validates this proxy +func (m *Proxy) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateServiceDiscovery(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTransport(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Proxy) validateServiceDiscovery(formats strfmt.Registry) error { + if swag.IsZero(m.ServiceDiscovery) { // not required + return nil + } + + if m.ServiceDiscovery != nil { + if err := m.ServiceDiscovery.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("proxy" + "." + "service_discovery") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("proxy" + "." + "service_discovery") + } + return err + } + } + + return nil +} + +func (m *Proxy) validateTransport(formats strfmt.Registry) error { + if swag.IsZero(m.Transport) { // not required + return nil + } + + if m.Transport != nil { + if err := m.Transport.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("proxy" + "." + "transport") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("proxy" + "." + "transport") + } + return err + } + } + + return nil +} + +// ContextValidate validate this proxy based on the context it is used +func (m *Proxy) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateServiceDiscovery(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTransport(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Proxy) contextValidateServiceDiscovery(ctx context.Context, formats strfmt.Registry) error { + + if m.ServiceDiscovery != nil { + + if swag.IsZero(m.ServiceDiscovery) { // not required + return nil + } + + if err := m.ServiceDiscovery.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("proxy" + "." + "service_discovery") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("proxy" + "." + "service_discovery") + } + return err + } + } + + return nil +} + +func (m *Proxy) contextValidateTransport(ctx context.Context, formats strfmt.Registry) error { + + if m.Transport != nil { + + if swag.IsZero(m.Transport) { // not required + return nil + } + + if err := m.Transport.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("proxy" + "." + "transport") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("proxy" + "." + "transport") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Proxy) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Proxy) UnmarshalBinary(b []byte) error { + var res Proxy + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// Transport transport +// +// swagger:model Transport +type Transport struct { + + // proxy URL + ProxyURL string `json:"proxy_url,omitempty"` + + // s s l cipher suites + SSLCipherSuites []string `json:"ssl_ciphers"` + + // s s l force common name check + SSLForceCommonNameCheck bool `json:"ssl_force_common_name_check,omitempty"` + + // s s l insecure skip verify + SSLInsecureSkipVerify bool `json:"ssl_insecure_skip_verify,omitempty"` + + // s s l min version + SSLMinVersion uint16 `json:"ssl_min_version,omitempty"` +} + +// Validate validates this transport +func (m *Transport) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this transport based on context it is used +func (m *Transport) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Transport) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Transport) UnmarshalBinary(b []byte) error { + var res Transport + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// UptimeTests uptime tests +// +// swagger:model UptimeTests +type UptimeTests struct { + + // check list + CheckList []*HostCheckObject `json:"check_list"` + + // config + Config *Config `json:"config,omitempty"` +} + +// Validate validates this uptime tests +func (m *UptimeTests) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCheckList(formats); err != nil { + res = append(res, err) + } + + if err := m.validateConfig(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UptimeTests) validateCheckList(formats strfmt.Registry) error { + if swag.IsZero(m.CheckList) { // not required + return nil + } + + for i := 0; i < len(m.CheckList); i++ { + if swag.IsZero(m.CheckList[i]) { // not required + continue + } + + if m.CheckList[i] != nil { + if err := m.CheckList[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uptime_tests" + "." + "check_list" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uptime_tests" + "." + "check_list" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UptimeTests) validateConfig(formats strfmt.Registry) error { + if swag.IsZero(m.Config) { // not required + return nil + } + + if m.Config != nil { + if err := m.Config.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uptime_tests" + "." + "config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uptime_tests" + "." + "config") + } + return err + } + } + + return nil +} + +// ContextValidate validate this uptime tests based on the context it is used +func (m *UptimeTests) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCheckList(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UptimeTests) contextValidateCheckList(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.CheckList); i++ { + + if m.CheckList[i] != nil { + + if swag.IsZero(m.CheckList[i]) { // not required + return nil + } + + if err := m.CheckList[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uptime_tests" + "." + "check_list" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uptime_tests" + "." + "check_list" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *UptimeTests) contextValidateConfig(ctx context.Context, formats strfmt.Registry) error { + + if m.Config != nil { + + if swag.IsZero(m.Config) { // not required + return nil + } + + if err := m.Config.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uptime_tests" + "." + "config") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uptime_tests" + "." + "config") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UptimeTests) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UptimeTests) UnmarshalBinary(b []byte) error { + var res UptimeTests + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// Config config +// +// swagger:model Config +type Config struct { + + // expire uptime analytics after + ExpireUptimeAnalyticsAfter int64 `json:"expire_utime_after,omitempty"` + + // recheck wait + RecheckWait int64 `json:"recheck_wait,omitempty"` + + // service discovery + ServiceDiscovery *ServiceDiscoveryConfiguration `json:"service_discovery,omitempty"` +} + +// Validate validates this config +func (m *Config) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateServiceDiscovery(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Config) validateServiceDiscovery(formats strfmt.Registry) error { + if swag.IsZero(m.ServiceDiscovery) { // not required + return nil + } + + if m.ServiceDiscovery != nil { + if err := m.ServiceDiscovery.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uptime_tests" + "." + "config" + "." + "service_discovery") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uptime_tests" + "." + "config" + "." + "service_discovery") + } + return err + } + } + + return nil +} + +// ContextValidate validate this config based on the context it is used +func (m *Config) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateServiceDiscovery(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Config) contextValidateServiceDiscovery(ctx context.Context, formats strfmt.Registry) error { + + if m.ServiceDiscovery != nil { + + if swag.IsZero(m.ServiceDiscovery) { // not required + return nil + } + + if err := m.ServiceDiscovery.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uptime_tests" + "." + "config" + "." + "service_discovery") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uptime_tests" + "." + "config" + "." + "service_discovery") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Config) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Config) UnmarshalBinary(b []byte) error { + var res Config + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// VersionData version data +// +// swagger:model VersionData +type VersionData struct { + + // default version + DefaultVersion string `json:"default_version,omitempty"` + + // not versioned + NotVersioned bool `json:"not_versioned,omitempty"` + + // versions + Versions map[string]VersionInfo `json:"versions,omitempty"` +} + +// Validate validates this version data +func (m *VersionData) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateVersions(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VersionData) validateVersions(formats strfmt.Registry) error { + if swag.IsZero(m.Versions) { // not required + return nil + } + + for k := range m.Versions { + + if err := validate.Required("version_data"+"."+"versions"+"."+k, "body", m.Versions[k]); err != nil { + return err + } + if val, ok := m.Versions[k]; ok { + if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("version_data" + "." + "versions" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("version_data" + "." + "versions" + "." + k) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this version data based on the context it is used +func (m *VersionData) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateVersions(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VersionData) contextValidateVersions(ctx context.Context, formats strfmt.Registry) error { + + for k := range m.Versions { + + if val, ok := m.Versions[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VersionData) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VersionData) UnmarshalBinary(b []byte) error { + var res VersionData + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/api_limit.go b/mservclient/models/api_limit.go new file mode 100644 index 00000000..14777a81 --- /dev/null +++ b/mservclient/models/api_limit.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// APILimit APILimit stores quota and rate limit on ACL level (per API) +// +// swagger:model APILimit +type APILimit struct { + + // per + Per float64 `json:"per,omitempty"` + + // quota max + QuotaMax int64 `json:"quota_max,omitempty"` + + // quota remaining + QuotaRemaining int64 `json:"quota_remaining,omitempty"` + + // quota renewal rate + QuotaRenewalRate int64 `json:"quota_renewal_rate,omitempty"` + + // quota renews + QuotaRenews int64 `json:"quota_renews,omitempty"` + + // rate + Rate float64 `json:"rate,omitempty"` + + // throttle interval + ThrottleInterval float64 `json:"throttle_interval,omitempty"` + + // throttle retry limit + ThrottleRetryLimit int64 `json:"throttle_retry_limit,omitempty"` +} + +// Validate validates this API limit +func (m *APILimit) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this API limit based on context it is used +func (m *APILimit) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *APILimit) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *APILimit) UnmarshalBinary(b []byte) error { + var res APILimit + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/auth_config.go b/mservclient/models/auth_config.go new file mode 100644 index 00000000..e67b78a9 --- /dev/null +++ b/mservclient/models/auth_config.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AuthConfig auth config +// +// swagger:model AuthConfig +type AuthConfig struct { + + // auth header name + AuthHeaderName string `json:"auth_header_name,omitempty"` + + // cookie name + CookieName string `json:"cookie_name,omitempty"` + + // param name + ParamName string `json:"param_name,omitempty"` + + // use certificate + UseCertificate bool `json:"use_certificate,omitempty"` + + // use cookie + UseCookie bool `json:"use_cookie,omitempty"` + + // use param + UseParam bool `json:"use_param,omitempty"` + + // validate signature + ValidateSignature bool `json:"validate_signature,omitempty"` + + // signature + Signature *SignatureConfig `json:"signature,omitempty"` +} + +// Validate validates this auth config +func (m *AuthConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSignature(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AuthConfig) validateSignature(formats strfmt.Registry) error { + if swag.IsZero(m.Signature) { // not required + return nil + } + + if m.Signature != nil { + if err := m.Signature.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("signature") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("signature") + } + return err + } + } + + return nil +} + +// ContextValidate validate this auth config based on the context it is used +func (m *AuthConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateSignature(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AuthConfig) contextValidateSignature(ctx context.Context, formats strfmt.Registry) error { + + if m.Signature != nil { + + if swag.IsZero(m.Signature) { // not required + return nil + } + + if err := m.Signature.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("signature") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("signature") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *AuthConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AuthConfig) UnmarshalBinary(b []byte) error { + var res AuthConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/auth_provider_code.go b/mservclient/models/auth_provider_code.go new file mode 100644 index 00000000..ea98a2e7 --- /dev/null +++ b/mservclient/models/auth_provider_code.go @@ -0,0 +1,27 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" +) + +// AuthProviderCode auth provider code +// +// swagger:model AuthProviderCode +type AuthProviderCode string + +// Validate validates this auth provider code +func (m AuthProviderCode) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this auth provider code based on context it is used +func (m AuthProviderCode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/mservclient/models/auth_provider_meta.go b/mservclient/models/auth_provider_meta.go new file mode 100644 index 00000000..d653cc58 --- /dev/null +++ b/mservclient/models/auth_provider_meta.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AuthProviderMeta auth provider meta +// +// swagger:model AuthProviderMeta +type AuthProviderMeta struct { + + // meta + Meta interface{} `json:"meta,omitempty"` + + // name + Name AuthProviderCode `json:"name,omitempty"` + + // storage engine + StorageEngine StorageEngineCode `json:"storage_engine,omitempty"` +} + +// Validate validates this auth provider meta +func (m *AuthProviderMeta) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStorageEngine(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AuthProviderMeta) validateName(formats strfmt.Registry) error { + if swag.IsZero(m.Name) { // not required + return nil + } + + if err := m.Name.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("name") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("name") + } + return err + } + + return nil +} + +func (m *AuthProviderMeta) validateStorageEngine(formats strfmt.Registry) error { + if swag.IsZero(m.StorageEngine) { // not required + return nil + } + + if err := m.StorageEngine.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storage_engine") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storage_engine") + } + return err + } + + return nil +} + +// ContextValidate validate this auth provider meta based on the context it is used +func (m *AuthProviderMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStorageEngine(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AuthProviderMeta) contextValidateName(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Name) { // not required + return nil + } + + if err := m.Name.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("name") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("name") + } + return err + } + + return nil +} + +func (m *AuthProviderMeta) contextValidateStorageEngine(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.StorageEngine) { // not required + return nil + } + + if err := m.StorageEngine.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storage_engine") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storage_engine") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *AuthProviderMeta) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AuthProviderMeta) UnmarshalBinary(b []byte) error { + var res AuthProviderMeta + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/auth_type_enum.go b/mservclient/models/auth_type_enum.go new file mode 100644 index 00000000..08636ef7 --- /dev/null +++ b/mservclient/models/auth_type_enum.go @@ -0,0 +1,27 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" +) + +// AuthTypeEnum auth type enum +// +// swagger:model AuthTypeEnum +type AuthTypeEnum string + +// Validate validates this auth type enum +func (m AuthTypeEnum) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this auth type enum based on context it is used +func (m AuthTypeEnum) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/mservclient/models/authorize_request_type.go b/mservclient/models/authorize_request_type.go new file mode 100644 index 00000000..7bb0c399 --- /dev/null +++ b/mservclient/models/authorize_request_type.go @@ -0,0 +1,27 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" +) + +// AuthorizeRequestType AuthorizeRequestType is the type for OAuth param `response_type` +// +// swagger:model AuthorizeRequestType +type AuthorizeRequestType string + +// Validate validates this authorize request type +func (m AuthorizeRequestType) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this authorize request type based on context it is used +func (m AuthorizeRequestType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/mservclient/models/basic_auth_data.go b/mservclient/models/basic_auth_data.go deleted file mode 100644 index c3964014..00000000 --- a/mservclient/models/basic_auth_data.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// BasicAuthData basic auth data -// -// swagger:model BasicAuthData -type BasicAuthData struct { - - // hash - Hash string `json:"hash,omitempty"` - - // password - Password string `json:"password,omitempty"` -} - -// Validate validates this basic auth data -func (m *BasicAuthData) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *BasicAuthData) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BasicAuthData) UnmarshalBinary(b []byte) error { - var res BasicAuthData - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/mservclient/models/bundle_manifest.go b/mservclient/models/bundle_manifest.go index 194f6cd1..b960134f 100644 --- a/mservclient/models/bundle_manifest.go +++ b/mservclient/models/bundle_manifest.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -44,7 +46,6 @@ func (m *BundleManifest) Validate(formats strfmt.Registry) error { } func (m *BundleManifest) validateCustomMiddleware(formats strfmt.Registry) error { - if swag.IsZero(m.CustomMiddleware) { // not required return nil } @@ -53,6 +54,43 @@ func (m *BundleManifest) validateCustomMiddleware(formats strfmt.Registry) error if err := m.CustomMiddleware.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("custom_middleware") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("custom_middleware") + } + return err + } + } + + return nil +} + +// ContextValidate validate this bundle manifest based on the context it is used +func (m *BundleManifest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCustomMiddleware(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *BundleManifest) contextValidateCustomMiddleware(ctx context.Context, formats strfmt.Registry) error { + + if m.CustomMiddleware != nil { + + if swag.IsZero(m.CustomMiddleware) { // not required + return nil + } + + if err := m.CustomMiddleware.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("custom_middleware") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("custom_middleware") } return err } diff --git a/mservclient/models/cache_meta.go b/mservclient/models/cache_meta.go new file mode 100644 index 00000000..4ae593f1 --- /dev/null +++ b/mservclient/models/cache_meta.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CacheMeta cache meta +// +// swagger:model CacheMeta +type CacheMeta struct { + + // cache key regex + CacheKeyRegex string `json:"cache_key_regex,omitempty"` + + // method + Method string `json:"method,omitempty"` + + // path + Path string `json:"path,omitempty"` +} + +// Validate validates this cache meta +func (m *CacheMeta) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this cache meta based on context it is used +func (m *CacheMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CacheMeta) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CacheMeta) UnmarshalBinary(b []byte) error { + var res CacheMeta + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/cache_options.go b/mservclient/models/cache_options.go new file mode 100644 index 00000000..fee4cd06 --- /dev/null +++ b/mservclient/models/cache_options.go @@ -0,0 +1,65 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CacheOptions cache options +// +// swagger:model CacheOptions +type CacheOptions struct { + + // cache all safe requests + CacheAllSafeRequests bool `json:"cache_all_safe_requests,omitempty"` + + // cache control TTL header + CacheControlTTLHeader string `json:"cache_control_ttl_header,omitempty"` + + // cache only response codes + CacheOnlyResponseCodes []int64 `json:"cache_response_codes"` + + // cache timeout + CacheTimeout int64 `json:"cache_timeout,omitempty"` + + // enable cache + EnableCache bool `json:"enable_cache,omitempty"` + + // enable upstream cache control + EnableUpstreamCacheControl bool `json:"enable_upstream_cache_control,omitempty"` +} + +// Validate validates this cache options +func (m *CacheOptions) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this cache options based on context it is used +func (m *CacheOptions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CacheOptions) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CacheOptions) UnmarshalBinary(b []byte) error { + var res CacheOptions + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/check_command.go b/mservclient/models/check_command.go new file mode 100644 index 00000000..a033dafe --- /dev/null +++ b/mservclient/models/check_command.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CheckCommand check command +// +// swagger:model CheckCommand +type CheckCommand struct { + + // message + Message string `json:"message,omitempty"` + + // name + Name string `json:"name,omitempty"` +} + +// Validate validates this check command +func (m *CheckCommand) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this check command based on context it is used +func (m *CheckCommand) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CheckCommand) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CheckCommand) UnmarshalBinary(b []byte) error { + var res CheckCommand + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/circuit_breaker_meta.go b/mservclient/models/circuit_breaker_meta.go new file mode 100644 index 00000000..8bd607c1 --- /dev/null +++ b/mservclient/models/circuit_breaker_meta.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CircuitBreakerMeta circuit breaker meta +// +// swagger:model CircuitBreakerMeta +type CircuitBreakerMeta struct { + + // method + Method string `json:"method,omitempty"` + + // path + Path string `json:"path,omitempty"` + + // return to service after + ReturnToServiceAfter int64 `json:"return_to_service_after,omitempty"` + + // samples + Samples int64 `json:"samples,omitempty"` + + // threshold percent + ThresholdPercent float64 `json:"threshold_percent,omitempty"` +} + +// Validate validates this circuit breaker meta +func (m *CircuitBreakerMeta) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this circuit breaker meta based on context it is used +func (m *CircuitBreakerMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CircuitBreakerMeta) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CircuitBreakerMeta) UnmarshalBinary(b []byte) error { + var res CircuitBreakerMeta + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/duration.go b/mservclient/models/duration.go new file mode 100644 index 00000000..8c8f739e --- /dev/null +++ b/mservclient/models/duration.go @@ -0,0 +1,29 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" +) + +// Duration A Duration represents the elapsed time between two instants +// as an int64 nanosecond count. The representation limits the +// largest representable duration to approximately 290 years. +// +// swagger:model Duration +type Duration int64 + +// Validate validates this duration +func (m Duration) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this duration based on context it is used +func (m Duration) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/mservclient/models/end_point_meta.go b/mservclient/models/end_point_meta.go new file mode 100644 index 00000000..0fa893e8 --- /dev/null +++ b/mservclient/models/end_point_meta.go @@ -0,0 +1,117 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// EndPointMeta end point meta +// +// swagger:model EndPointMeta +type EndPointMeta struct { + + // ignore case + IgnoreCase bool `json:"ignore_case,omitempty"` + + // method actions + MethodActions map[string]EndpointMethodMeta `json:"method_actions,omitempty"` + + // path + Path string `json:"path,omitempty"` +} + +// Validate validates this end point meta +func (m *EndPointMeta) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateMethodActions(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *EndPointMeta) validateMethodActions(formats strfmt.Registry) error { + if swag.IsZero(m.MethodActions) { // not required + return nil + } + + for k := range m.MethodActions { + + if err := validate.Required("method_actions"+"."+k, "body", m.MethodActions[k]); err != nil { + return err + } + if val, ok := m.MethodActions[k]; ok { + if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("method_actions" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("method_actions" + "." + k) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this end point meta based on the context it is used +func (m *EndPointMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateMethodActions(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *EndPointMeta) contextValidateMethodActions(ctx context.Context, formats strfmt.Registry) error { + + for k := range m.MethodActions { + + if val, ok := m.MethodActions[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *EndPointMeta) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *EndPointMeta) UnmarshalBinary(b []byte) error { + var res EndPointMeta + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/endpoint_method_action.go b/mservclient/models/endpoint_method_action.go new file mode 100644 index 00000000..92c8ed54 --- /dev/null +++ b/mservclient/models/endpoint_method_action.go @@ -0,0 +1,27 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" +) + +// EndpointMethodAction endpoint method action +// +// swagger:model EndpointMethodAction +type EndpointMethodAction string + +// Validate validates this endpoint method action +func (m EndpointMethodAction) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this endpoint method action based on context it is used +func (m EndpointMethodAction) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/mservclient/models/endpoint_method_meta.go b/mservclient/models/endpoint_method_meta.go new file mode 100644 index 00000000..11426cab --- /dev/null +++ b/mservclient/models/endpoint_method_meta.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// EndpointMethodMeta endpoint method meta +// +// swagger:model EndpointMethodMeta +type EndpointMethodMeta struct { + + // code + Code int64 `json:"code,omitempty"` + + // data + Data string `json:"data,omitempty"` + + // headers + Headers map[string]string `json:"headers,omitempty"` + + // action + Action EndpointMethodAction `json:"action,omitempty"` +} + +// Validate validates this endpoint method meta +func (m *EndpointMethodMeta) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAction(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *EndpointMethodMeta) validateAction(formats strfmt.Registry) error { + if swag.IsZero(m.Action) { // not required + return nil + } + + if err := m.Action.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("action") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("action") + } + return err + } + + return nil +} + +// ContextValidate validate this endpoint method meta based on the context it is used +func (m *EndpointMethodMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAction(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *EndpointMethodMeta) contextValidateAction(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Action) { // not required + return nil + } + + if err := m.Action.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("action") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("action") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *EndpointMethodMeta) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *EndpointMethodMeta) UnmarshalBinary(b []byte) error { + var res EndpointMethodMeta + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/event_handler_meta_config.go b/mservclient/models/event_handler_meta_config.go new file mode 100644 index 00000000..7b18de92 --- /dev/null +++ b/mservclient/models/event_handler_meta_config.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// EventHandlerMetaConfig event handler meta config +// +// swagger:model EventHandlerMetaConfig +type EventHandlerMetaConfig struct { + + // events + Events map[string][]EventHandlerTriggerConfig `json:"events,omitempty"` +} + +// Validate validates this event handler meta config +func (m *EventHandlerMetaConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEvents(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *EventHandlerMetaConfig) validateEvents(formats strfmt.Registry) error { + if swag.IsZero(m.Events) { // not required + return nil + } + + for k := range m.Events { + + if err := validate.Required("events"+"."+k, "body", m.Events[k]); err != nil { + return err + } + + for i := 0; i < len(m.Events[k]); i++ { + + if err := m.Events[k][i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("events" + "." + k + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("events" + "." + k + "." + strconv.Itoa(i)) + } + return err + } + + } + + } + + return nil +} + +// ContextValidate validate this event handler meta config based on the context it is used +func (m *EventHandlerMetaConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateEvents(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *EventHandlerMetaConfig) contextValidateEvents(ctx context.Context, formats strfmt.Registry) error { + + for k := range m.Events { + + for i := 0; i < len(m.Events[k]); i++ { + + if swag.IsZero(m.Events[k][i]) { // not required + return nil + } + + if err := m.Events[k][i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("events" + "." + k + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("events" + "." + k + "." + strconv.Itoa(i)) + } + return err + } + + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *EventHandlerMetaConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *EventHandlerMetaConfig) UnmarshalBinary(b []byte) error { + var res EventHandlerMetaConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/event_handler_trigger_config.go b/mservclient/models/event_handler_trigger_config.go new file mode 100644 index 00000000..a374a95f --- /dev/null +++ b/mservclient/models/event_handler_trigger_config.go @@ -0,0 +1,107 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// EventHandlerTriggerConfig event handler trigger config +// +// swagger:model EventHandlerTriggerConfig +type EventHandlerTriggerConfig struct { + + // handler meta + HandlerMeta interface{} `json:"handler_meta,omitempty"` + + // handler name + HandlerName TykEventHandlerName `json:"handler_name,omitempty"` +} + +// Validate validates this event handler trigger config +func (m *EventHandlerTriggerConfig) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHandlerName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *EventHandlerTriggerConfig) validateHandlerName(formats strfmt.Registry) error { + if swag.IsZero(m.HandlerName) { // not required + return nil + } + + if err := m.HandlerName.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("handler_name") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("handler_name") + } + return err + } + + return nil +} + +// ContextValidate validate this event handler trigger config based on the context it is used +func (m *EventHandlerTriggerConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateHandlerName(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *EventHandlerTriggerConfig) contextValidateHandlerName(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.HandlerName) { // not required + return nil + } + + if err := m.HandlerName.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("handler_name") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("handler_name") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *EventHandlerTriggerConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *EventHandlerTriggerConfig) UnmarshalBinary(b []byte) error { + var res EventHandlerTriggerConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/extended_paths_set.go b/mservclient/models/extended_paths_set.go new file mode 100644 index 00000000..8e829a9c --- /dev/null +++ b/mservclient/models/extended_paths_set.go @@ -0,0 +1,1302 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ExtendedPathsSet extended paths set +// +// swagger:model ExtendedPathsSet +type ExtendedPathsSet struct { + + // advance cache config + AdvanceCacheConfig []*CacheMeta `json:"advance_cache_config"` + + // black list + BlackList []*EndPointMeta `json:"black_list"` + + // cached + Cached []string `json:"cache"` + + // circuit breaker + CircuitBreaker []*CircuitBreakerMeta `json:"circuit_breakers"` + + // do not track endpoints + DoNotTrackEndpoints []*TrackEndpointMeta `json:"do_not_track_endpoints"` + + // hard timeouts + HardTimeouts []*HardTimeoutMeta `json:"hard_timeouts"` + + // ignored + Ignored []*EndPointMeta `json:"ignored"` + + // internal + Internal []*InternalMeta `json:"internal"` + + // method transforms + MethodTransforms []*MethodTransformMeta `json:"method_transforms"` + + // size limit + SizeLimit []*RequestSizeMeta `json:"size_limits"` + + // track endpoints + TrackEndpoints []*TrackEndpointMeta `json:"track_endpoints"` + + // transform + Transform []*TemplateMeta `json:"transform"` + + // transform header + TransformHeader []*HeaderInjectionMeta `json:"transform_headers"` + + // transform j q + TransformJQ []*TransformJQMeta `json:"transform_jq"` + + // transform j q response + TransformJQResponse []*TransformJQMeta `json:"transform_jq_response"` + + // transform response + TransformResponse []*TemplateMeta `json:"transform_response"` + + // transform response header + TransformResponseHeader []*HeaderInjectionMeta `json:"transform_response_headers"` + + // URL rewrite + URLRewrite []*URLRewriteMeta `json:"url_rewrites"` + + // validate JSON + ValidateJSON []*ValidatePathMeta `json:"validate_json"` + + // virtual + Virtual []*VirtualMeta `json:"virtual"` + + // white list + WhiteList []*EndPointMeta `json:"white_list"` +} + +// Validate validates this extended paths set +func (m *ExtendedPathsSet) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAdvanceCacheConfig(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBlackList(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCircuitBreaker(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDoNotTrackEndpoints(formats); err != nil { + res = append(res, err) + } + + if err := m.validateHardTimeouts(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIgnored(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInternal(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMethodTransforms(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSizeLimit(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTrackEndpoints(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTransform(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTransformHeader(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTransformJQ(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTransformJQResponse(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTransformResponse(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTransformResponseHeader(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURLRewrite(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValidateJSON(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVirtual(formats); err != nil { + res = append(res, err) + } + + if err := m.validateWhiteList(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ExtendedPathsSet) validateAdvanceCacheConfig(formats strfmt.Registry) error { + if swag.IsZero(m.AdvanceCacheConfig) { // not required + return nil + } + + for i := 0; i < len(m.AdvanceCacheConfig); i++ { + if swag.IsZero(m.AdvanceCacheConfig[i]) { // not required + continue + } + + if m.AdvanceCacheConfig[i] != nil { + if err := m.AdvanceCacheConfig[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("advance_cache_config" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("advance_cache_config" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) validateBlackList(formats strfmt.Registry) error { + if swag.IsZero(m.BlackList) { // not required + return nil + } + + for i := 0; i < len(m.BlackList); i++ { + if swag.IsZero(m.BlackList[i]) { // not required + continue + } + + if m.BlackList[i] != nil { + if err := m.BlackList[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("black_list" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("black_list" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) validateCircuitBreaker(formats strfmt.Registry) error { + if swag.IsZero(m.CircuitBreaker) { // not required + return nil + } + + for i := 0; i < len(m.CircuitBreaker); i++ { + if swag.IsZero(m.CircuitBreaker[i]) { // not required + continue + } + + if m.CircuitBreaker[i] != nil { + if err := m.CircuitBreaker[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("circuit_breakers" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("circuit_breakers" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) validateDoNotTrackEndpoints(formats strfmt.Registry) error { + if swag.IsZero(m.DoNotTrackEndpoints) { // not required + return nil + } + + for i := 0; i < len(m.DoNotTrackEndpoints); i++ { + if swag.IsZero(m.DoNotTrackEndpoints[i]) { // not required + continue + } + + if m.DoNotTrackEndpoints[i] != nil { + if err := m.DoNotTrackEndpoints[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("do_not_track_endpoints" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("do_not_track_endpoints" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) validateHardTimeouts(formats strfmt.Registry) error { + if swag.IsZero(m.HardTimeouts) { // not required + return nil + } + + for i := 0; i < len(m.HardTimeouts); i++ { + if swag.IsZero(m.HardTimeouts[i]) { // not required + continue + } + + if m.HardTimeouts[i] != nil { + if err := m.HardTimeouts[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("hard_timeouts" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("hard_timeouts" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) validateIgnored(formats strfmt.Registry) error { + if swag.IsZero(m.Ignored) { // not required + return nil + } + + for i := 0; i < len(m.Ignored); i++ { + if swag.IsZero(m.Ignored[i]) { // not required + continue + } + + if m.Ignored[i] != nil { + if err := m.Ignored[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ignored" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ignored" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) validateInternal(formats strfmt.Registry) error { + if swag.IsZero(m.Internal) { // not required + return nil + } + + for i := 0; i < len(m.Internal); i++ { + if swag.IsZero(m.Internal[i]) { // not required + continue + } + + if m.Internal[i] != nil { + if err := m.Internal[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("internal" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("internal" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) validateMethodTransforms(formats strfmt.Registry) error { + if swag.IsZero(m.MethodTransforms) { // not required + return nil + } + + for i := 0; i < len(m.MethodTransforms); i++ { + if swag.IsZero(m.MethodTransforms[i]) { // not required + continue + } + + if m.MethodTransforms[i] != nil { + if err := m.MethodTransforms[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("method_transforms" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("method_transforms" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) validateSizeLimit(formats strfmt.Registry) error { + if swag.IsZero(m.SizeLimit) { // not required + return nil + } + + for i := 0; i < len(m.SizeLimit); i++ { + if swag.IsZero(m.SizeLimit[i]) { // not required + continue + } + + if m.SizeLimit[i] != nil { + if err := m.SizeLimit[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("size_limits" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("size_limits" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) validateTrackEndpoints(formats strfmt.Registry) error { + if swag.IsZero(m.TrackEndpoints) { // not required + return nil + } + + for i := 0; i < len(m.TrackEndpoints); i++ { + if swag.IsZero(m.TrackEndpoints[i]) { // not required + continue + } + + if m.TrackEndpoints[i] != nil { + if err := m.TrackEndpoints[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("track_endpoints" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("track_endpoints" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) validateTransform(formats strfmt.Registry) error { + if swag.IsZero(m.Transform) { // not required + return nil + } + + for i := 0; i < len(m.Transform); i++ { + if swag.IsZero(m.Transform[i]) { // not required + continue + } + + if m.Transform[i] != nil { + if err := m.Transform[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transform" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transform" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) validateTransformHeader(formats strfmt.Registry) error { + if swag.IsZero(m.TransformHeader) { // not required + return nil + } + + for i := 0; i < len(m.TransformHeader); i++ { + if swag.IsZero(m.TransformHeader[i]) { // not required + continue + } + + if m.TransformHeader[i] != nil { + if err := m.TransformHeader[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transform_headers" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transform_headers" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) validateTransformJQ(formats strfmt.Registry) error { + if swag.IsZero(m.TransformJQ) { // not required + return nil + } + + for i := 0; i < len(m.TransformJQ); i++ { + if swag.IsZero(m.TransformJQ[i]) { // not required + continue + } + + if m.TransformJQ[i] != nil { + if err := m.TransformJQ[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transform_jq" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transform_jq" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) validateTransformJQResponse(formats strfmt.Registry) error { + if swag.IsZero(m.TransformJQResponse) { // not required + return nil + } + + for i := 0; i < len(m.TransformJQResponse); i++ { + if swag.IsZero(m.TransformJQResponse[i]) { // not required + continue + } + + if m.TransformJQResponse[i] != nil { + if err := m.TransformJQResponse[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transform_jq_response" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transform_jq_response" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) validateTransformResponse(formats strfmt.Registry) error { + if swag.IsZero(m.TransformResponse) { // not required + return nil + } + + for i := 0; i < len(m.TransformResponse); i++ { + if swag.IsZero(m.TransformResponse[i]) { // not required + continue + } + + if m.TransformResponse[i] != nil { + if err := m.TransformResponse[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transform_response" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transform_response" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) validateTransformResponseHeader(formats strfmt.Registry) error { + if swag.IsZero(m.TransformResponseHeader) { // not required + return nil + } + + for i := 0; i < len(m.TransformResponseHeader); i++ { + if swag.IsZero(m.TransformResponseHeader[i]) { // not required + continue + } + + if m.TransformResponseHeader[i] != nil { + if err := m.TransformResponseHeader[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transform_response_headers" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transform_response_headers" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) validateURLRewrite(formats strfmt.Registry) error { + if swag.IsZero(m.URLRewrite) { // not required + return nil + } + + for i := 0; i < len(m.URLRewrite); i++ { + if swag.IsZero(m.URLRewrite[i]) { // not required + continue + } + + if m.URLRewrite[i] != nil { + if err := m.URLRewrite[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("url_rewrites" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("url_rewrites" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) validateValidateJSON(formats strfmt.Registry) error { + if swag.IsZero(m.ValidateJSON) { // not required + return nil + } + + for i := 0; i < len(m.ValidateJSON); i++ { + if swag.IsZero(m.ValidateJSON[i]) { // not required + continue + } + + if m.ValidateJSON[i] != nil { + if err := m.ValidateJSON[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("validate_json" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("validate_json" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) validateVirtual(formats strfmt.Registry) error { + if swag.IsZero(m.Virtual) { // not required + return nil + } + + for i := 0; i < len(m.Virtual); i++ { + if swag.IsZero(m.Virtual[i]) { // not required + continue + } + + if m.Virtual[i] != nil { + if err := m.Virtual[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("virtual" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("virtual" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) validateWhiteList(formats strfmt.Registry) error { + if swag.IsZero(m.WhiteList) { // not required + return nil + } + + for i := 0; i < len(m.WhiteList); i++ { + if swag.IsZero(m.WhiteList[i]) { // not required + continue + } + + if m.WhiteList[i] != nil { + if err := m.WhiteList[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("white_list" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("white_list" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this extended paths set based on the context it is used +func (m *ExtendedPathsSet) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAdvanceCacheConfig(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBlackList(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCircuitBreaker(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDoNotTrackEndpoints(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateHardTimeouts(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateIgnored(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateInternal(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMethodTransforms(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSizeLimit(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTrackEndpoints(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTransform(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTransformHeader(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTransformJQ(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTransformJQResponse(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTransformResponse(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTransformResponseHeader(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateURLRewrite(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateValidateJSON(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVirtual(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateWhiteList(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ExtendedPathsSet) contextValidateAdvanceCacheConfig(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.AdvanceCacheConfig); i++ { + + if m.AdvanceCacheConfig[i] != nil { + + if swag.IsZero(m.AdvanceCacheConfig[i]) { // not required + return nil + } + + if err := m.AdvanceCacheConfig[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("advance_cache_config" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("advance_cache_config" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) contextValidateBlackList(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.BlackList); i++ { + + if m.BlackList[i] != nil { + + if swag.IsZero(m.BlackList[i]) { // not required + return nil + } + + if err := m.BlackList[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("black_list" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("black_list" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) contextValidateCircuitBreaker(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.CircuitBreaker); i++ { + + if m.CircuitBreaker[i] != nil { + + if swag.IsZero(m.CircuitBreaker[i]) { // not required + return nil + } + + if err := m.CircuitBreaker[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("circuit_breakers" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("circuit_breakers" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) contextValidateDoNotTrackEndpoints(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.DoNotTrackEndpoints); i++ { + + if m.DoNotTrackEndpoints[i] != nil { + + if swag.IsZero(m.DoNotTrackEndpoints[i]) { // not required + return nil + } + + if err := m.DoNotTrackEndpoints[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("do_not_track_endpoints" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("do_not_track_endpoints" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) contextValidateHardTimeouts(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.HardTimeouts); i++ { + + if m.HardTimeouts[i] != nil { + + if swag.IsZero(m.HardTimeouts[i]) { // not required + return nil + } + + if err := m.HardTimeouts[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("hard_timeouts" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("hard_timeouts" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) contextValidateIgnored(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Ignored); i++ { + + if m.Ignored[i] != nil { + + if swag.IsZero(m.Ignored[i]) { // not required + return nil + } + + if err := m.Ignored[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ignored" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ignored" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) contextValidateInternal(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Internal); i++ { + + if m.Internal[i] != nil { + + if swag.IsZero(m.Internal[i]) { // not required + return nil + } + + if err := m.Internal[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("internal" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("internal" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) contextValidateMethodTransforms(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.MethodTransforms); i++ { + + if m.MethodTransforms[i] != nil { + + if swag.IsZero(m.MethodTransforms[i]) { // not required + return nil + } + + if err := m.MethodTransforms[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("method_transforms" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("method_transforms" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) contextValidateSizeLimit(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.SizeLimit); i++ { + + if m.SizeLimit[i] != nil { + + if swag.IsZero(m.SizeLimit[i]) { // not required + return nil + } + + if err := m.SizeLimit[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("size_limits" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("size_limits" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) contextValidateTrackEndpoints(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.TrackEndpoints); i++ { + + if m.TrackEndpoints[i] != nil { + + if swag.IsZero(m.TrackEndpoints[i]) { // not required + return nil + } + + if err := m.TrackEndpoints[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("track_endpoints" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("track_endpoints" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) contextValidateTransform(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Transform); i++ { + + if m.Transform[i] != nil { + + if swag.IsZero(m.Transform[i]) { // not required + return nil + } + + if err := m.Transform[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transform" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transform" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) contextValidateTransformHeader(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.TransformHeader); i++ { + + if m.TransformHeader[i] != nil { + + if swag.IsZero(m.TransformHeader[i]) { // not required + return nil + } + + if err := m.TransformHeader[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transform_headers" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transform_headers" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) contextValidateTransformJQ(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.TransformJQ); i++ { + + if m.TransformJQ[i] != nil { + + if swag.IsZero(m.TransformJQ[i]) { // not required + return nil + } + + if err := m.TransformJQ[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transform_jq" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transform_jq" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) contextValidateTransformJQResponse(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.TransformJQResponse); i++ { + + if m.TransformJQResponse[i] != nil { + + if swag.IsZero(m.TransformJQResponse[i]) { // not required + return nil + } + + if err := m.TransformJQResponse[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transform_jq_response" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transform_jq_response" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) contextValidateTransformResponse(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.TransformResponse); i++ { + + if m.TransformResponse[i] != nil { + + if swag.IsZero(m.TransformResponse[i]) { // not required + return nil + } + + if err := m.TransformResponse[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transform_response" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transform_response" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) contextValidateTransformResponseHeader(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.TransformResponseHeader); i++ { + + if m.TransformResponseHeader[i] != nil { + + if swag.IsZero(m.TransformResponseHeader[i]) { // not required + return nil + } + + if err := m.TransformResponseHeader[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transform_response_headers" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transform_response_headers" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) contextValidateURLRewrite(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.URLRewrite); i++ { + + if m.URLRewrite[i] != nil { + + if swag.IsZero(m.URLRewrite[i]) { // not required + return nil + } + + if err := m.URLRewrite[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("url_rewrites" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("url_rewrites" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) contextValidateValidateJSON(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ValidateJSON); i++ { + + if m.ValidateJSON[i] != nil { + + if swag.IsZero(m.ValidateJSON[i]) { // not required + return nil + } + + if err := m.ValidateJSON[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("validate_json" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("validate_json" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) contextValidateVirtual(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Virtual); i++ { + + if m.Virtual[i] != nil { + + if swag.IsZero(m.Virtual[i]) { // not required + return nil + } + + if err := m.Virtual[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("virtual" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("virtual" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ExtendedPathsSet) contextValidateWhiteList(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.WhiteList); i++ { + + if m.WhiteList[i] != nil { + + if swag.IsZero(m.WhiteList[i]) { // not required + return nil + } + + if err := m.WhiteList[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("white_list" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("white_list" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ExtendedPathsSet) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ExtendedPathsSet) UnmarshalBinary(b []byte) error { + var res ExtendedPathsSet + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/file.go b/mservclient/models/file.go index 05de32ad..52659645 100644 --- a/mservclient/models/file.go +++ b/mservclient/models/file.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -42,7 +44,6 @@ func (m *File) Validate(formats strfmt.Registry) error { } func (m *File) validateData(formats strfmt.Registry) error { - if swag.IsZero(m.Data) { // not required return nil } @@ -51,6 +52,8 @@ func (m *File) validateData(formats strfmt.Registry) error { if err := m.Data.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("Data") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Data") } return err } @@ -60,7 +63,6 @@ func (m *File) validateData(formats strfmt.Registry) error { } func (m *File) validateHeader(formats strfmt.Registry) error { - if swag.IsZero(m.Header) { // not required return nil } @@ -69,6 +71,68 @@ func (m *File) validateHeader(formats strfmt.Registry) error { if err := m.Header.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("Header") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Header") + } + return err + } + } + + return nil +} + +// ContextValidate validate this file based on the context it is used +func (m *File) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateHeader(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *File) contextValidateData(ctx context.Context, formats strfmt.Registry) error { + + if m.Data != nil { + + if swag.IsZero(m.Data) { // not required + return nil + } + + if err := m.Data.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Data") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Data") + } + return err + } + } + + return nil +} + +func (m *File) contextValidateHeader(ctx context.Context, formats strfmt.Registry) error { + + if m.Header != nil { + + if swag.IsZero(m.Header) { // not required + return nil + } + + if err := m.Header.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Header") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Header") } return err } diff --git a/mservclient/models/file_header.go b/mservclient/models/file_header.go index 97d13eb0..60f02122 100644 --- a/mservclient/models/file_header.go +++ b/mservclient/models/file_header.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -41,14 +43,49 @@ func (m *FileHeader) Validate(formats strfmt.Registry) error { } func (m *FileHeader) validateHeader(formats strfmt.Registry) error { + if swag.IsZero(m.Header) { // not required + return nil + } + + if m.Header != nil { + if err := m.Header.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Header") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Header") + } + return err + } + } + + return nil +} + +// ContextValidate validate this file header based on the context it is used +func (m *FileHeader) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateHeader(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FileHeader) contextValidateHeader(ctx context.Context, formats strfmt.Registry) error { if swag.IsZero(m.Header) { // not required return nil } - if err := m.Header.Validate(formats); err != nil { + if err := m.Header.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("Header") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Header") } return err } diff --git a/mservclient/models/global_rate_limit.go b/mservclient/models/global_rate_limit.go new file mode 100644 index 00000000..8e073ce5 --- /dev/null +++ b/mservclient/models/global_rate_limit.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GlobalRateLimit global rate limit +// +// swagger:model GlobalRateLimit +type GlobalRateLimit struct { + + // per + Per float64 `json:"per,omitempty"` + + // rate + Rate float64 `json:"rate,omitempty"` +} + +// Validate validates this global rate limit +func (m *GlobalRateLimit) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this global rate limit based on context it is used +func (m *GlobalRateLimit) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GlobalRateLimit) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GlobalRateLimit) UnmarshalBinary(b []byte) error { + var res GlobalRateLimit + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/h_report.go b/mservclient/models/h_report.go index db3d1f9a..cec5020f 100644 --- a/mservclient/models/h_report.go +++ b/mservclient/models/h_report.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -27,6 +29,11 @@ func (m *HReport) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this h report based on context it is used +func (m *HReport) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *HReport) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/mservclient/models/hard_timeout_meta.go b/mservclient/models/hard_timeout_meta.go new file mode 100644 index 00000000..dd1ac712 --- /dev/null +++ b/mservclient/models/hard_timeout_meta.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HardTimeoutMeta hard timeout meta +// +// swagger:model HardTimeoutMeta +type HardTimeoutMeta struct { + + // method + Method string `json:"method,omitempty"` + + // path + Path string `json:"path,omitempty"` + + // time out + TimeOut int64 `json:"timeout,omitempty"` +} + +// Validate validates this hard timeout meta +func (m *HardTimeoutMeta) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this hard timeout meta based on context it is used +func (m *HardTimeoutMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HardTimeoutMeta) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HardTimeoutMeta) UnmarshalBinary(b []byte) error { + var res HardTimeoutMeta + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/hash_type.go b/mservclient/models/hash_type.go new file mode 100644 index 00000000..19ed46e4 --- /dev/null +++ b/mservclient/models/hash_type.go @@ -0,0 +1,27 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" +) + +// HashType hash type +// +// swagger:model HashType +type HashType string + +// Validate validates this hash type +func (m HashType) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this hash type based on context it is used +func (m HashType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/mservclient/models/header_injection_meta.go b/mservclient/models/header_injection_meta.go new file mode 100644 index 00000000..1c29b60d --- /dev/null +++ b/mservclient/models/header_injection_meta.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HeaderInjectionMeta header injection meta +// +// swagger:model HeaderInjectionMeta +type HeaderInjectionMeta struct { + + // act on response + ActOnResponse bool `json:"act_on,omitempty"` + + // add headers + AddHeaders map[string]string `json:"add_headers,omitempty"` + + // delete headers + DeleteHeaders []string `json:"delete_headers"` + + // method + Method string `json:"method,omitempty"` + + // path + Path string `json:"path,omitempty"` +} + +// Validate validates this header injection meta +func (m *HeaderInjectionMeta) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this header injection meta based on context it is used +func (m *HeaderInjectionMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HeaderInjectionMeta) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HeaderInjectionMeta) UnmarshalBinary(b []byte) error { + var res HeaderInjectionMeta + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/hook_type.go b/mservclient/models/hook_type.go index 6e491b18..b98021bd 100644 --- a/mservclient/models/hook_type.go +++ b/mservclient/models/hook_type.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" ) @@ -18,3 +20,8 @@ type HookType int32 func (m HookType) Validate(formats strfmt.Registry) error { return nil } + +// ContextValidate validates this hook type based on context it is used +func (m HookType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/mservclient/models/host_check_object.go b/mservclient/models/host_check_object.go new file mode 100644 index 00000000..97179364 --- /dev/null +++ b/mservclient/models/host_check_object.go @@ -0,0 +1,185 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HostCheckObject host check object +// +// swagger:model HostCheckObject +type HostCheckObject struct { + + // body + Body string `json:"body,omitempty"` + + // check URL + CheckURL string `json:"url,omitempty"` + + // commands + Commands []*CheckCommand `json:"commands"` + + // enable proxy protocol + EnableProxyProtocol bool `json:"enable_proxy_protocol,omitempty"` + + // headers + Headers map[string]string `json:"headers,omitempty"` + + // method + Method string `json:"method,omitempty"` + + // protocol + Protocol string `json:"protocol,omitempty"` + + // timeout + Timeout Duration `json:"timeout,omitempty"` +} + +// Validate validates this host check object +func (m *HostCheckObject) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCommands(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimeout(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HostCheckObject) validateCommands(formats strfmt.Registry) error { + if swag.IsZero(m.Commands) { // not required + return nil + } + + for i := 0; i < len(m.Commands); i++ { + if swag.IsZero(m.Commands[i]) { // not required + continue + } + + if m.Commands[i] != nil { + if err := m.Commands[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("commands" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("commands" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *HostCheckObject) validateTimeout(formats strfmt.Registry) error { + if swag.IsZero(m.Timeout) { // not required + return nil + } + + if err := m.Timeout.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("timeout") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("timeout") + } + return err + } + + return nil +} + +// ContextValidate validate this host check object based on the context it is used +func (m *HostCheckObject) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCommands(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTimeout(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HostCheckObject) contextValidateCommands(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Commands); i++ { + + if m.Commands[i] != nil { + + if swag.IsZero(m.Commands[i]) { // not required + return nil + } + + if err := m.Commands[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("commands" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("commands" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *HostCheckObject) contextValidateTimeout(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Timeout) { // not required + return nil + } + + if err := m.Timeout.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("timeout") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("timeout") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *HostCheckObject) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HostCheckObject) UnmarshalBinary(b []byte) error { + var res HostCheckObject + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/id_extractor_source.go b/mservclient/models/id_extractor_source.go index 8e1e8589..0f8be06c 100644 --- a/mservclient/models/id_extractor_source.go +++ b/mservclient/models/id_extractor_source.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" ) @@ -18,3 +20,8 @@ type IDExtractorSource string func (m IDExtractorSource) Validate(formats strfmt.Registry) error { return nil } + +// ContextValidate validates this Id extractor source based on context it is used +func (m IDExtractorSource) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/mservclient/models/id_extractor_type.go b/mservclient/models/id_extractor_type.go index e32836fb..a00a3ce1 100644 --- a/mservclient/models/id_extractor_type.go +++ b/mservclient/models/id_extractor_type.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" ) @@ -18,3 +20,8 @@ type IDExtractorType string func (m IDExtractorType) Validate(formats strfmt.Registry) error { return nil } + +// ContextValidate validates this Id extractor type based on context it is used +func (m IDExtractorType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/mservclient/models/internal_meta.go b/mservclient/models/internal_meta.go new file mode 100644 index 00000000..d6cdad05 --- /dev/null +++ b/mservclient/models/internal_meta.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// InternalMeta internal meta +// +// swagger:model InternalMeta +type InternalMeta struct { + + // method + Method string `json:"method,omitempty"` + + // path + Path string `json:"path,omitempty"` +} + +// Validate validates this internal meta +func (m *InternalMeta) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this internal meta based on context it is used +func (m *InternalMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *InternalMeta) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InternalMeta) UnmarshalBinary(b []byte) error { + var res InternalMeta + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/j_w_t_data.go b/mservclient/models/j_w_t_data.go deleted file mode 100644 index 03fb4238..00000000 --- a/mservclient/models/j_w_t_data.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// JWTData j w t data -// -// swagger:model JWTData -type JWTData struct { - - // secret - Secret string `json:"secret,omitempty"` -} - -// Validate validates this j w t data -func (m *JWTData) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *JWTData) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *JWTData) UnmarshalBinary(b []byte) error { - var res JWTData - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/mservclient/models/m_i_m_e_header.go b/mservclient/models/m_i_m_e_header.go index 50da35cc..324dbd1d 100644 --- a/mservclient/models/m_i_m_e_header.go +++ b/mservclient/models/m_i_m_e_header.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" ) @@ -19,3 +21,8 @@ type MIMEHeader map[string][]string func (m MIMEHeader) Validate(formats strfmt.Registry) error { return nil } + +// ContextValidate validates this m i m e header based on context it is used +func (m MIMEHeader) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/mservclient/models/m_w.go b/mservclient/models/m_w.go index 2e5e3dd2..46a258e9 100644 --- a/mservclient/models/m_w.go +++ b/mservclient/models/m_w.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -71,7 +72,6 @@ func (m *MW) Validate(formats strfmt.Registry) error { } func (m *MW) validateAdded(formats strfmt.Registry) error { - if swag.IsZero(m.Added) { // not required return nil } @@ -84,7 +84,6 @@ func (m *MW) validateAdded(formats strfmt.Registry) error { } func (m *MW) validateManifest(formats strfmt.Registry) error { - if swag.IsZero(m.Manifest) { // not required return nil } @@ -93,6 +92,8 @@ func (m *MW) validateManifest(formats strfmt.Registry) error { if err := m.Manifest.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("Manifest") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Manifest") } return err } @@ -102,7 +103,6 @@ func (m *MW) validateManifest(formats strfmt.Registry) error { } func (m *MW) validatePlugins(formats strfmt.Registry) error { - if swag.IsZero(m.Plugins) { // not required return nil } @@ -116,6 +116,72 @@ func (m *MW) validatePlugins(formats strfmt.Registry) error { if err := m.Plugins[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("Plugins" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Plugins" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this m w based on the context it is used +func (m *MW) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateManifest(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePlugins(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MW) contextValidateManifest(ctx context.Context, formats strfmt.Registry) error { + + if m.Manifest != nil { + + if swag.IsZero(m.Manifest) { // not required + return nil + } + + if err := m.Manifest.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Manifest") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Manifest") + } + return err + } + } + + return nil +} + +func (m *MW) contextValidatePlugins(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Plugins); i++ { + + if m.Plugins[i] != nil { + + if swag.IsZero(m.Plugins[i]) { // not required + return nil + } + + if err := m.Plugins[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Plugins" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Plugins" + "." + strconv.Itoa(i)) } return err } diff --git a/mservclient/models/method_transform_meta.go b/mservclient/models/method_transform_meta.go new file mode 100644 index 00000000..b95065e3 --- /dev/null +++ b/mservclient/models/method_transform_meta.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MethodTransformMeta method transform meta +// +// swagger:model MethodTransformMeta +type MethodTransformMeta struct { + + // method + Method string `json:"method,omitempty"` + + // path + Path string `json:"path,omitempty"` + + // to method + ToMethod string `json:"to_method,omitempty"` +} + +// Validate validates this method transform meta +func (m *MethodTransformMeta) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this method transform meta based on context it is used +func (m *MethodTransformMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *MethodTransformMeta) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MethodTransformMeta) UnmarshalBinary(b []byte) error { + var res MethodTransformMeta + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/middleware_definition.go b/mservclient/models/middleware_definition.go index 529ddb02..45bcfe23 100644 --- a/mservclient/models/middleware_definition.go +++ b/mservclient/models/middleware_definition.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -33,6 +35,11 @@ func (m *MiddlewareDefinition) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this middleware definition based on context it is used +func (m *MiddlewareDefinition) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *MiddlewareDefinition) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/mservclient/models/middleware_driver.go b/mservclient/models/middleware_driver.go index 81eec5e7..8fcefd40 100644 --- a/mservclient/models/middleware_driver.go +++ b/mservclient/models/middleware_driver.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" ) @@ -18,3 +20,8 @@ type MiddlewareDriver string func (m MiddlewareDriver) Validate(formats strfmt.Registry) error { return nil } + +// ContextValidate validates this middleware driver based on context it is used +func (m MiddlewareDriver) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/mservclient/models/middleware_id_extractor.go b/mservclient/models/middleware_id_extractor.go index 82af98a9..c8048527 100644 --- a/mservclient/models/middleware_id_extractor.go +++ b/mservclient/models/middleware_id_extractor.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -17,7 +19,7 @@ import ( type MiddlewareIDExtractor struct { // extractor config - ExtractorConfig map[string]interface{} `json:"extractor_config,omitempty"` + ExtractorConfig interface{} `json:"extractor_config,omitempty"` // extract from ExtractFrom IDExtractorSource `json:"extract_from,omitempty"` @@ -45,7 +47,6 @@ func (m *MiddlewareIDExtractor) Validate(formats strfmt.Registry) error { } func (m *MiddlewareIDExtractor) validateExtractFrom(formats strfmt.Registry) error { - if swag.IsZero(m.ExtractFrom) { // not required return nil } @@ -53,6 +54,8 @@ func (m *MiddlewareIDExtractor) validateExtractFrom(formats strfmt.Registry) err if err := m.ExtractFrom.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("extract_from") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("extract_from") } return err } @@ -61,7 +64,6 @@ func (m *MiddlewareIDExtractor) validateExtractFrom(formats strfmt.Registry) err } func (m *MiddlewareIDExtractor) validateExtractWith(formats strfmt.Registry) error { - if swag.IsZero(m.ExtractWith) { // not required return nil } @@ -69,6 +71,62 @@ func (m *MiddlewareIDExtractor) validateExtractWith(formats strfmt.Registry) err if err := m.ExtractWith.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("extract_with") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("extract_with") + } + return err + } + + return nil +} + +// ContextValidate validate this middleware Id extractor based on the context it is used +func (m *MiddlewareIDExtractor) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateExtractFrom(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateExtractWith(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MiddlewareIDExtractor) contextValidateExtractFrom(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.ExtractFrom) { // not required + return nil + } + + if err := m.ExtractFrom.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("extract_from") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("extract_from") + } + return err + } + + return nil +} + +func (m *MiddlewareIDExtractor) contextValidateExtractWith(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.ExtractWith) { // not required + return nil + } + + if err := m.ExtractWith.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("extract_with") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("extract_with") } return err } diff --git a/mservclient/models/middleware_section.go b/mservclient/models/middleware_section.go index 3b657c53..7e77c2c4 100644 --- a/mservclient/models/middleware_section.go +++ b/mservclient/models/middleware_section.go @@ -6,6 +6,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "strconv" "github.com/go-openapi/errors" @@ -79,7 +80,6 @@ func (m *MiddlewareSection) Validate(formats strfmt.Registry) error { } func (m *MiddlewareSection) validatePost(formats strfmt.Registry) error { - if swag.IsZero(m.Post) { // not required return nil } @@ -93,6 +93,8 @@ func (m *MiddlewareSection) validatePost(formats strfmt.Registry) error { if err := m.Post[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("post" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("post" + "." + strconv.Itoa(i)) } return err } @@ -104,7 +106,6 @@ func (m *MiddlewareSection) validatePost(formats strfmt.Registry) error { } func (m *MiddlewareSection) validatePostKeyAuth(formats strfmt.Registry) error { - if swag.IsZero(m.PostKeyAuth) { // not required return nil } @@ -118,6 +119,8 @@ func (m *MiddlewareSection) validatePostKeyAuth(formats strfmt.Registry) error { if err := m.PostKeyAuth[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("post_key_auth" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("post_key_auth" + "." + strconv.Itoa(i)) } return err } @@ -129,7 +132,6 @@ func (m *MiddlewareSection) validatePostKeyAuth(formats strfmt.Registry) error { } func (m *MiddlewareSection) validatePre(formats strfmt.Registry) error { - if swag.IsZero(m.Pre) { // not required return nil } @@ -143,6 +145,8 @@ func (m *MiddlewareSection) validatePre(formats strfmt.Registry) error { if err := m.Pre[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("pre" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pre" + "." + strconv.Itoa(i)) } return err } @@ -154,7 +158,6 @@ func (m *MiddlewareSection) validatePre(formats strfmt.Registry) error { } func (m *MiddlewareSection) validateResponse(formats strfmt.Registry) error { - if swag.IsZero(m.Response) { // not required return nil } @@ -168,6 +171,8 @@ func (m *MiddlewareSection) validateResponse(formats strfmt.Registry) error { if err := m.Response[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("response" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("response" + "." + strconv.Itoa(i)) } return err } @@ -179,7 +184,6 @@ func (m *MiddlewareSection) validateResponse(formats strfmt.Registry) error { } func (m *MiddlewareSection) validateAuthCheck(formats strfmt.Registry) error { - if swag.IsZero(m.AuthCheck) { // not required return nil } @@ -188,6 +192,8 @@ func (m *MiddlewareSection) validateAuthCheck(formats strfmt.Registry) error { if err := m.AuthCheck.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("auth_check") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("auth_check") } return err } @@ -197,7 +203,6 @@ func (m *MiddlewareSection) validateAuthCheck(formats strfmt.Registry) error { } func (m *MiddlewareSection) validateDriver(formats strfmt.Registry) error { - if swag.IsZero(m.Driver) { // not required return nil } @@ -205,6 +210,8 @@ func (m *MiddlewareSection) validateDriver(formats strfmt.Registry) error { if err := m.Driver.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("driver") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("driver") } return err } @@ -213,7 +220,6 @@ func (m *MiddlewareSection) validateDriver(formats strfmt.Registry) error { } func (m *MiddlewareSection) validateIDExtractor(formats strfmt.Registry) error { - if swag.IsZero(m.IDExtractor) { // not required return nil } @@ -222,6 +228,206 @@ func (m *MiddlewareSection) validateIDExtractor(formats strfmt.Registry) error { if err := m.IDExtractor.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("id_extractor") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("id_extractor") + } + return err + } + } + + return nil +} + +// ContextValidate validate this middleware section based on the context it is used +func (m *MiddlewareSection) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidatePost(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePostKeyAuth(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePre(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateResponse(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateAuthCheck(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDriver(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateIDExtractor(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MiddlewareSection) contextValidatePost(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Post); i++ { + + if m.Post[i] != nil { + + if swag.IsZero(m.Post[i]) { // not required + return nil + } + + if err := m.Post[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("post" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("post" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MiddlewareSection) contextValidatePostKeyAuth(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.PostKeyAuth); i++ { + + if m.PostKeyAuth[i] != nil { + + if swag.IsZero(m.PostKeyAuth[i]) { // not required + return nil + } + + if err := m.PostKeyAuth[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("post_key_auth" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("post_key_auth" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MiddlewareSection) contextValidatePre(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Pre); i++ { + + if m.Pre[i] != nil { + + if swag.IsZero(m.Pre[i]) { // not required + return nil + } + + if err := m.Pre[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pre" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pre" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MiddlewareSection) contextValidateResponse(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Response); i++ { + + if m.Response[i] != nil { + + if swag.IsZero(m.Response[i]) { // not required + return nil + } + + if err := m.Response[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("response" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("response" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MiddlewareSection) contextValidateAuthCheck(ctx context.Context, formats strfmt.Registry) error { + + if m.AuthCheck != nil { + + if swag.IsZero(m.AuthCheck) { // not required + return nil + } + + if err := m.AuthCheck.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("auth_check") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("auth_check") + } + return err + } + } + + return nil +} + +func (m *MiddlewareSection) contextValidateDriver(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Driver) { // not required + return nil + } + + if err := m.Driver.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("driver") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("driver") + } + return err + } + + return nil +} + +func (m *MiddlewareSection) contextValidateIDExtractor(ctx context.Context, formats strfmt.Registry) error { + + if m.IDExtractor != nil { + + if swag.IsZero(m.IDExtractor) { // not required + return nil + } + + if err := m.IDExtractor.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("id_extractor") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("id_extractor") } return err } diff --git a/mservclient/models/mini_request_object.go b/mservclient/models/mini_request_object.go index 1945a441..f7f9585b 100644 --- a/mservclient/models/mini_request_object.go +++ b/mservclient/models/mini_request_object.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -74,7 +76,6 @@ func (m *MiniRequestObject) Validate(formats strfmt.Registry) error { } func (m *MiniRequestObject) validateReturnOverrides(formats strfmt.Registry) error { - if swag.IsZero(m.ReturnOverrides) { // not required return nil } @@ -83,6 +84,43 @@ func (m *MiniRequestObject) validateReturnOverrides(formats strfmt.Registry) err if err := m.ReturnOverrides.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("return_overrides") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("return_overrides") + } + return err + } + } + + return nil +} + +// ContextValidate validate this mini request object based on the context it is used +func (m *MiniRequestObject) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateReturnOverrides(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MiniRequestObject) contextValidateReturnOverrides(ctx context.Context, formats strfmt.Registry) error { + + if m.ReturnOverrides != nil { + + if swag.IsZero(m.ReturnOverrides) { // not required + return nil + } + + if err := m.ReturnOverrides.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("return_overrides") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("return_overrides") } return err } diff --git a/mservclient/models/monitor.go b/mservclient/models/monitor.go deleted file mode 100644 index 6eb05b9a..00000000 --- a/mservclient/models/monitor.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// Monitor monitor -// -// swagger:model Monitor -type Monitor struct { - - // trigger limits - TriggerLimits []float64 `json:"trigger_limits"` -} - -// Validate validates this monitor -func (m *Monitor) Validate(formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *Monitor) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Monitor) UnmarshalBinary(b []byte) error { - var res Monitor - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/mservclient/models/notifications_manager.go b/mservclient/models/notifications_manager.go new file mode 100644 index 00000000..b49f8fe1 --- /dev/null +++ b/mservclient/models/notifications_manager.go @@ -0,0 +1,55 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NotificationsManager NotificationsManager handles sending notifications to OAuth endpoints to notify the provider of key changes. +// +// TODO: Make this more generic +// +// swagger:model NotificationsManager +type NotificationsManager struct { + + // o auth key change URL + OAuthKeyChangeURL string `json:"oauth_on_keychange_url,omitempty"` + + // shared secret + SharedSecret string `json:"shared_secret,omitempty"` +} + +// Validate validates this notifications manager +func (m *NotificationsManager) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this notifications manager based on context it is used +func (m *NotificationsManager) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *NotificationsManager) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NotificationsManager) UnmarshalBinary(b []byte) error { + var res NotificationsManager + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/o_id_provider_config.go b/mservclient/models/o_id_provider_config.go new file mode 100644 index 00000000..1d0412c5 --- /dev/null +++ b/mservclient/models/o_id_provider_config.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// OIDProviderConfig o ID provider config +// +// swagger:model OIDProviderConfig +type OIDProviderConfig struct { + + // client i ds + ClientIDs map[string]string `json:"client_ids,omitempty"` + + // issuer + Issuer string `json:"issuer,omitempty"` +} + +// Validate validates this o ID provider config +func (m *OIDProviderConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this o ID provider config based on context it is used +func (m *OIDProviderConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *OIDProviderConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *OIDProviderConfig) UnmarshalBinary(b []byte) error { + var res OIDProviderConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/object.go b/mservclient/models/object.go index e2f3e533..1a0fa9bf 100644 --- a/mservclient/models/object.go +++ b/mservclient/models/object.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -58,7 +60,6 @@ func (m *Object) Validate(formats strfmt.Registry) error { } func (m *Object) validateHookType(formats strfmt.Registry) error { - if swag.IsZero(m.HookType) { // not required return nil } @@ -66,6 +67,8 @@ func (m *Object) validateHookType(formats strfmt.Registry) error { if err := m.HookType.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("hook_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("hook_type") } return err } @@ -74,7 +77,6 @@ func (m *Object) validateHookType(formats strfmt.Registry) error { } func (m *Object) validateRequest(formats strfmt.Registry) error { - if swag.IsZero(m.Request) { // not required return nil } @@ -83,6 +85,8 @@ func (m *Object) validateRequest(formats strfmt.Registry) error { if err := m.Request.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("request") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("request") } return err } @@ -92,7 +96,6 @@ func (m *Object) validateRequest(formats strfmt.Registry) error { } func (m *Object) validateSession(formats strfmt.Registry) error { - if swag.IsZero(m.Session) { // not required return nil } @@ -101,6 +104,90 @@ func (m *Object) validateSession(formats strfmt.Registry) error { if err := m.Session.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("session") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("session") + } + return err + } + } + + return nil +} + +// ContextValidate validate this object based on the context it is used +func (m *Object) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateHookType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRequest(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSession(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Object) contextValidateHookType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.HookType) { // not required + return nil + } + + if err := m.HookType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("hook_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("hook_type") + } + return err + } + + return nil +} + +func (m *Object) contextValidateRequest(ctx context.Context, formats strfmt.Registry) error { + + if m.Request != nil { + + if swag.IsZero(m.Request) { // not required + return nil + } + + if err := m.Request.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("request") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("request") + } + return err + } + } + + return nil +} + +func (m *Object) contextValidateSession(ctx context.Context, formats strfmt.Registry) error { + + if m.Session != nil { + + if swag.IsZero(m.Session) { // not required + return nil + } + + if err := m.Session.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("session") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("session") } return err } diff --git a/mservclient/models/open_id_options.go b/mservclient/models/open_id_options.go new file mode 100644 index 00000000..b3362fe5 --- /dev/null +++ b/mservclient/models/open_id_options.go @@ -0,0 +1,124 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// OpenIDOptions open ID options +// +// swagger:model OpenIDOptions +type OpenIDOptions struct { + + // providers + Providers []*OIDProviderConfig `json:"providers"` + + // segregate by client + SegregateByClient bool `json:"segregate_by_client,omitempty"` +} + +// Validate validates this open ID options +func (m *OpenIDOptions) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateProviders(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *OpenIDOptions) validateProviders(formats strfmt.Registry) error { + if swag.IsZero(m.Providers) { // not required + return nil + } + + for i := 0; i < len(m.Providers); i++ { + if swag.IsZero(m.Providers[i]) { // not required + continue + } + + if m.Providers[i] != nil { + if err := m.Providers[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("providers" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("providers" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this open ID options based on the context it is used +func (m *OpenIDOptions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateProviders(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *OpenIDOptions) contextValidateProviders(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Providers); i++ { + + if m.Providers[i] != nil { + + if swag.IsZero(m.Providers[i]) { // not required + return nil + } + + if err := m.Providers[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("providers" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("providers" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *OpenIDOptions) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *OpenIDOptions) UnmarshalBinary(b []byte) error { + var res OpenIDOptions + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/payload.go b/mservclient/models/payload.go index d6026330..eefea687 100644 --- a/mservclient/models/payload.go +++ b/mservclient/models/payload.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -30,6 +32,11 @@ func (m *Payload) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this payload based on context it is used +func (m *Payload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *Payload) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/mservclient/models/plugin.go b/mservclient/models/plugin.go index 87f2e841..8c7f9b1f 100644 --- a/mservclient/models/plugin.go +++ b/mservclient/models/plugin.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -47,7 +49,6 @@ func (m *Plugin) Validate(formats strfmt.Registry) error { } func (m *Plugin) validateType(formats strfmt.Registry) error { - if swag.IsZero(m.Type) { // not required return nil } @@ -55,6 +56,40 @@ func (m *Plugin) validateType(formats strfmt.Registry) error { if err := m.Type.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("Type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Type") + } + return err + } + + return nil +} + +// ContextValidate validate this plugin based on the context it is used +func (m *Plugin) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateType(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Plugin) contextValidateType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + if err := m.Type.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("Type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("Type") } return err } diff --git a/mservclient/models/request_input_type.go b/mservclient/models/request_input_type.go new file mode 100644 index 00000000..02e2e473 --- /dev/null +++ b/mservclient/models/request_input_type.go @@ -0,0 +1,27 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" +) + +// RequestInputType request input type +// +// swagger:model RequestInputType +type RequestInputType string + +// Validate validates this request input type +func (m RequestInputType) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this request input type based on context it is used +func (m RequestInputType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/mservclient/models/request_signing_meta.go b/mservclient/models/request_signing_meta.go new file mode 100644 index 00000000..533b64b9 --- /dev/null +++ b/mservclient/models/request_signing_meta.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// RequestSigningMeta request signing meta +// +// swagger:model RequestSigningMeta +type RequestSigningMeta struct { + + // algorithm + Algorithm string `json:"algorithm,omitempty"` + + // certificate Id + CertificateID string `json:"certificate_id,omitempty"` + + // header list + HeaderList []string `json:"header_list"` + + // is enabled + IsEnabled bool `json:"is_enabled,omitempty"` + + // key Id + KeyID string `json:"key_id,omitempty"` + + // secret + Secret string `json:"secret,omitempty"` + + // signature header + SignatureHeader string `json:"signature_header,omitempty"` +} + +// Validate validates this request signing meta +func (m *RequestSigningMeta) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this request signing meta based on context it is used +func (m *RequestSigningMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *RequestSigningMeta) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RequestSigningMeta) UnmarshalBinary(b []byte) error { + var res RequestSigningMeta + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/request_size_meta.go b/mservclient/models/request_size_meta.go new file mode 100644 index 00000000..78ecbbb2 --- /dev/null +++ b/mservclient/models/request_size_meta.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// RequestSizeMeta request size meta +// +// swagger:model RequestSizeMeta +type RequestSizeMeta struct { + + // method + Method string `json:"method,omitempty"` + + // path + Path string `json:"path,omitempty"` + + // size limit + SizeLimit int64 `json:"size_limit,omitempty"` +} + +// Validate validates this request size meta +func (m *RequestSizeMeta) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this request size meta based on context it is used +func (m *RequestSizeMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *RequestSizeMeta) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RequestSizeMeta) UnmarshalBinary(b []byte) error { + var res RequestSizeMeta + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/response_processor.go b/mservclient/models/response_processor.go new file mode 100644 index 00000000..fb3548cb --- /dev/null +++ b/mservclient/models/response_processor.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ResponseProcessor response processor +// +// swagger:model ResponseProcessor +type ResponseProcessor struct { + + // name + Name string `json:"name,omitempty"` + + // options + Options interface{} `json:"options,omitempty"` +} + +// Validate validates this response processor +func (m *ResponseProcessor) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this response processor based on context it is used +func (m *ResponseProcessor) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ResponseProcessor) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ResponseProcessor) UnmarshalBinary(b []byte) error { + var res ResponseProcessor + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/return_overrides.go b/mservclient/models/return_overrides.go index 52f67c4d..4f701859 100644 --- a/mservclient/models/return_overrides.go +++ b/mservclient/models/return_overrides.go @@ -6,6 +6,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -30,6 +32,11 @@ func (m *ReturnOverrides) Validate(formats strfmt.Registry) error { return nil } +// ContextValidate validates this return overrides based on context it is used +func (m *ReturnOverrides) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + // MarshalBinary interface implementation func (m *ReturnOverrides) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/mservclient/models/routing_trigger.go b/mservclient/models/routing_trigger.go new file mode 100644 index 00000000..6d1dee78 --- /dev/null +++ b/mservclient/models/routing_trigger.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// RoutingTrigger routing trigger +// +// swagger:model RoutingTrigger +type RoutingTrigger struct { + + // rewrite to + RewriteTo string `json:"rewrite_to,omitempty"` + + // on + On RoutingTriggerOnType `json:"on,omitempty"` + + // options + Options *RoutingTriggerOptions `json:"options,omitempty"` +} + +// Validate validates this routing trigger +func (m *RoutingTrigger) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateOn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOptions(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RoutingTrigger) validateOn(formats strfmt.Registry) error { + if swag.IsZero(m.On) { // not required + return nil + } + + if err := m.On.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("on") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("on") + } + return err + } + + return nil +} + +func (m *RoutingTrigger) validateOptions(formats strfmt.Registry) error { + if swag.IsZero(m.Options) { // not required + return nil + } + + if m.Options != nil { + if err := m.Options.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("options") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("options") + } + return err + } + } + + return nil +} + +// ContextValidate validate this routing trigger based on the context it is used +func (m *RoutingTrigger) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateOn(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOptions(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RoutingTrigger) contextValidateOn(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.On) { // not required + return nil + } + + if err := m.On.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("on") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("on") + } + return err + } + + return nil +} + +func (m *RoutingTrigger) contextValidateOptions(ctx context.Context, formats strfmt.Registry) error { + + if m.Options != nil { + + if swag.IsZero(m.Options) { // not required + return nil + } + + if err := m.Options.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("options") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("options") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RoutingTrigger) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RoutingTrigger) UnmarshalBinary(b []byte) error { + var res RoutingTrigger + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/routing_trigger_on_type.go b/mservclient/models/routing_trigger_on_type.go new file mode 100644 index 00000000..a92a9fba --- /dev/null +++ b/mservclient/models/routing_trigger_on_type.go @@ -0,0 +1,27 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" +) + +// RoutingTriggerOnType routing trigger on type +// +// swagger:model RoutingTriggerOnType +type RoutingTriggerOnType string + +// Validate validates this routing trigger on type +func (m RoutingTriggerOnType) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this routing trigger on type based on context it is used +func (m RoutingTriggerOnType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/mservclient/models/routing_trigger_options.go b/mservclient/models/routing_trigger_options.go new file mode 100644 index 00000000..6af7c84d --- /dev/null +++ b/mservclient/models/routing_trigger_options.go @@ -0,0 +1,370 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// RoutingTriggerOptions routing trigger options +// +// swagger:model RoutingTriggerOptions +type RoutingTriggerOptions struct { + + // header matches + HeaderMatches map[string]StringRegexMap `json:"header_matches,omitempty"` + + // path part matches + PathPartMatches map[string]StringRegexMap `json:"path_part_matches,omitempty"` + + // query val matches + QueryValMatches map[string]StringRegexMap `json:"query_val_matches,omitempty"` + + // request context matches + RequestContextMatches map[string]StringRegexMap `json:"request_context_matches,omitempty"` + + // session meta matches + SessionMetaMatches map[string]StringRegexMap `json:"session_meta_matches,omitempty"` + + // payload matches + PayloadMatches *StringRegexMap `json:"payload_matches,omitempty"` +} + +// Validate validates this routing trigger options +func (m *RoutingTriggerOptions) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHeaderMatches(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePathPartMatches(formats); err != nil { + res = append(res, err) + } + + if err := m.validateQueryValMatches(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestContextMatches(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSessionMetaMatches(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePayloadMatches(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RoutingTriggerOptions) validateHeaderMatches(formats strfmt.Registry) error { + if swag.IsZero(m.HeaderMatches) { // not required + return nil + } + + for k := range m.HeaderMatches { + + if err := validate.Required("header_matches"+"."+k, "body", m.HeaderMatches[k]); err != nil { + return err + } + if val, ok := m.HeaderMatches[k]; ok { + if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("header_matches" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("header_matches" + "." + k) + } + return err + } + } + + } + + return nil +} + +func (m *RoutingTriggerOptions) validatePathPartMatches(formats strfmt.Registry) error { + if swag.IsZero(m.PathPartMatches) { // not required + return nil + } + + for k := range m.PathPartMatches { + + if err := validate.Required("path_part_matches"+"."+k, "body", m.PathPartMatches[k]); err != nil { + return err + } + if val, ok := m.PathPartMatches[k]; ok { + if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("path_part_matches" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("path_part_matches" + "." + k) + } + return err + } + } + + } + + return nil +} + +func (m *RoutingTriggerOptions) validateQueryValMatches(formats strfmt.Registry) error { + if swag.IsZero(m.QueryValMatches) { // not required + return nil + } + + for k := range m.QueryValMatches { + + if err := validate.Required("query_val_matches"+"."+k, "body", m.QueryValMatches[k]); err != nil { + return err + } + if val, ok := m.QueryValMatches[k]; ok { + if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("query_val_matches" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("query_val_matches" + "." + k) + } + return err + } + } + + } + + return nil +} + +func (m *RoutingTriggerOptions) validateRequestContextMatches(formats strfmt.Registry) error { + if swag.IsZero(m.RequestContextMatches) { // not required + return nil + } + + for k := range m.RequestContextMatches { + + if err := validate.Required("request_context_matches"+"."+k, "body", m.RequestContextMatches[k]); err != nil { + return err + } + if val, ok := m.RequestContextMatches[k]; ok { + if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("request_context_matches" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("request_context_matches" + "." + k) + } + return err + } + } + + } + + return nil +} + +func (m *RoutingTriggerOptions) validateSessionMetaMatches(formats strfmt.Registry) error { + if swag.IsZero(m.SessionMetaMatches) { // not required + return nil + } + + for k := range m.SessionMetaMatches { + + if err := validate.Required("session_meta_matches"+"."+k, "body", m.SessionMetaMatches[k]); err != nil { + return err + } + if val, ok := m.SessionMetaMatches[k]; ok { + if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("session_meta_matches" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("session_meta_matches" + "." + k) + } + return err + } + } + + } + + return nil +} + +func (m *RoutingTriggerOptions) validatePayloadMatches(formats strfmt.Registry) error { + if swag.IsZero(m.PayloadMatches) { // not required + return nil + } + + if m.PayloadMatches != nil { + if err := m.PayloadMatches.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("payload_matches") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("payload_matches") + } + return err + } + } + + return nil +} + +// ContextValidate validate this routing trigger options based on the context it is used +func (m *RoutingTriggerOptions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateHeaderMatches(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePathPartMatches(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateQueryValMatches(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRequestContextMatches(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSessionMetaMatches(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePayloadMatches(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RoutingTriggerOptions) contextValidateHeaderMatches(ctx context.Context, formats strfmt.Registry) error { + + for k := range m.HeaderMatches { + + if val, ok := m.HeaderMatches[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *RoutingTriggerOptions) contextValidatePathPartMatches(ctx context.Context, formats strfmt.Registry) error { + + for k := range m.PathPartMatches { + + if val, ok := m.PathPartMatches[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *RoutingTriggerOptions) contextValidateQueryValMatches(ctx context.Context, formats strfmt.Registry) error { + + for k := range m.QueryValMatches { + + if val, ok := m.QueryValMatches[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *RoutingTriggerOptions) contextValidateRequestContextMatches(ctx context.Context, formats strfmt.Registry) error { + + for k := range m.RequestContextMatches { + + if val, ok := m.RequestContextMatches[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *RoutingTriggerOptions) contextValidateSessionMetaMatches(ctx context.Context, formats strfmt.Registry) error { + + for k := range m.SessionMetaMatches { + + if val, ok := m.SessionMetaMatches[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *RoutingTriggerOptions) contextValidatePayloadMatches(ctx context.Context, formats strfmt.Registry) error { + + if m.PayloadMatches != nil { + + if swag.IsZero(m.PayloadMatches) { // not required + return nil + } + + if err := m.PayloadMatches.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("payload_matches") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("payload_matches") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RoutingTriggerOptions) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RoutingTriggerOptions) UnmarshalBinary(b []byte) error { + var res RoutingTriggerOptions + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/service_discovery_configuration.go b/mservclient/models/service_discovery_configuration.go new file mode 100644 index 00000000..78f17151 --- /dev/null +++ b/mservclient/models/service_discovery_configuration.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ServiceDiscoveryConfiguration service discovery configuration +// +// swagger:model ServiceDiscoveryConfiguration +type ServiceDiscoveryConfiguration struct { + + // cache timeout + CacheTimeout int64 `json:"cache_timeout,omitempty"` + + // data path + DataPath string `json:"data_path,omitempty"` + + // endpoint returns list + EndpointReturnsList bool `json:"endpoint_returns_list,omitempty"` + + // parent data path + ParentDataPath string `json:"parent_data_path,omitempty"` + + // port data path + PortDataPath string `json:"port_data_path,omitempty"` + + // query endpoint + QueryEndpoint string `json:"query_endpoint,omitempty"` + + // target path + TargetPath string `json:"target_path,omitempty"` + + // use discovery service + UseDiscoveryService bool `json:"use_discovery_service,omitempty"` + + // use nested query + UseNestedQuery bool `json:"use_nested_query,omitempty"` + + // use target list + UseTargetList bool `json:"use_target_list,omitempty"` +} + +// Validate validates this service discovery configuration +func (m *ServiceDiscoveryConfiguration) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this service discovery configuration based on context it is used +func (m *ServiceDiscoveryConfiguration) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ServiceDiscoveryConfiguration) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ServiceDiscoveryConfiguration) UnmarshalBinary(b []byte) error { + var res ServiceDiscoveryConfiguration + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/session_provider_code.go b/mservclient/models/session_provider_code.go new file mode 100644 index 00000000..daed5b2b --- /dev/null +++ b/mservclient/models/session_provider_code.go @@ -0,0 +1,27 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" +) + +// SessionProviderCode session provider code +// +// swagger:model SessionProviderCode +type SessionProviderCode string + +// Validate validates this session provider code +func (m SessionProviderCode) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this session provider code based on context it is used +func (m SessionProviderCode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/mservclient/models/session_provider_meta.go b/mservclient/models/session_provider_meta.go new file mode 100644 index 00000000..9eff6cd9 --- /dev/null +++ b/mservclient/models/session_provider_meta.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SessionProviderMeta session provider meta +// +// swagger:model SessionProviderMeta +type SessionProviderMeta struct { + + // meta + Meta interface{} `json:"meta,omitempty"` + + // name + Name SessionProviderCode `json:"name,omitempty"` + + // storage engine + StorageEngine StorageEngineCode `json:"storage_engine,omitempty"` +} + +// Validate validates this session provider meta +func (m *SessionProviderMeta) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStorageEngine(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SessionProviderMeta) validateName(formats strfmt.Registry) error { + if swag.IsZero(m.Name) { // not required + return nil + } + + if err := m.Name.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("name") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("name") + } + return err + } + + return nil +} + +func (m *SessionProviderMeta) validateStorageEngine(formats strfmt.Registry) error { + if swag.IsZero(m.StorageEngine) { // not required + return nil + } + + if err := m.StorageEngine.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storage_engine") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storage_engine") + } + return err + } + + return nil +} + +// ContextValidate validate this session provider meta based on the context it is used +func (m *SessionProviderMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStorageEngine(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SessionProviderMeta) contextValidateName(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Name) { // not required + return nil + } + + if err := m.Name.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("name") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("name") + } + return err + } + + return nil +} + +func (m *SessionProviderMeta) contextValidateStorageEngine(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.StorageEngine) { // not required + return nil + } + + if err := m.StorageEngine.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storage_engine") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storage_engine") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SessionProviderMeta) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SessionProviderMeta) UnmarshalBinary(b []byte) error { + var res SessionProviderMeta + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/session_state.go b/mservclient/models/session_state.go index efc4f411..8a2ac976 100644 --- a/mservclient/models/session_state.go +++ b/mservclient/models/session_state.go @@ -6,13 +6,17 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" "github.com/go-openapi/validate" ) -// SessionState session state +// SessionState SessionState objects represent a current API session, mainly used for rate limiting. +// +// There's a data structure that's based on this and it's used for Protocol Buffer support, make sure to update "coprocess/proto/coprocess_session_state.proto" and generate the bindings using: cd coprocess/proto && ./update_bindings.sh // // swagger:model SessionState type SessionState struct { @@ -29,7 +33,7 @@ type SessionState struct { // apply policies ApplyPolicies []string `json:"apply_policies"` - // apply policy Id + // apply policy ID ApplyPolicyID string `json:"apply_policy_id,omitempty"` // certificate @@ -38,17 +42,24 @@ type SessionState struct { // data expires DataExpires int64 `json:"data_expires,omitempty"` + // date created + // Format: date-time + DateCreated strfmt.DateTime `json:"date_created,omitempty"` + // enable detailed recording - EnableDetailedRecording bool `json:"enable_detailed_recording,omitempty"` + EnableDetailedRecording bool `json:"enable_detail_recording,omitempty"` + + // enable HTTP signature validation + EnableHTTPSignatureValidation bool `json:"enable_http_signature_validation,omitempty"` // expires Expires int64 `json:"expires,omitempty"` - // hmac enabled - HmacEnabled bool `json:"hmac_enabled,omitempty"` + // h m a c enabled + HMACEnabled bool `json:"hmac_enabled,omitempty"` // hmac secret - HmacSecret string `json:"hmac_secret,omitempty"` + HmacSecret string `json:"hmac_string,omitempty"` // Id extractor deadline IDExtractorDeadline int64 `json:"id_extractor_deadline,omitempty"` @@ -62,16 +73,16 @@ type SessionState struct { // last updated LastUpdated string `json:"last_updated,omitempty"` - // metadata - Metadata map[string]string `json:"metadata,omitempty"` + // meta data + MetaData interface{} `json:"meta_data,omitempty"` - // oauth client Id + // oauth client ID OauthClientID string `json:"oauth_client_id,omitempty"` // oauth keys OauthKeys map[string]string `json:"oauth_keys,omitempty"` - // org Id + // org ID OrgID string `json:"org_id,omitempty"` // per @@ -89,6 +100,9 @@ type SessionState struct { // quota renews QuotaRenews int64 `json:"quota_renews,omitempty"` + // r s a certificate Id + RSACertificateID string `json:"rsa_certificate_id,omitempty"` + // rate Rate float64 `json:"rate,omitempty"` @@ -98,6 +112,12 @@ type SessionState struct { // tags Tags []string `json:"tags"` + // throttle interval + ThrottleInterval float64 `json:"throttle_interval,omitempty"` + + // throttle retry limit + ThrottleRetryLimit int64 `json:"throttle_retry_limit,omitempty"` + // basic auth data BasicAuthData *BasicAuthData `json:"basic_auth_data,omitempty"` @@ -116,6 +136,10 @@ func (m *SessionState) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateDateCreated(formats); err != nil { + res = append(res, err) + } + if err := m.validateBasicAuthData(formats); err != nil { res = append(res, err) } @@ -135,7 +159,6 @@ func (m *SessionState) Validate(formats strfmt.Registry) error { } func (m *SessionState) validateAccessRights(formats strfmt.Registry) error { - if swag.IsZero(m.AccessRights) { // not required return nil } @@ -147,6 +170,11 @@ func (m *SessionState) validateAccessRights(formats strfmt.Registry) error { } if val, ok := m.AccessRights[k]; ok { if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("access_rights" + "." + k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("access_rights" + "." + k) + } return err } } @@ -156,8 +184,19 @@ func (m *SessionState) validateAccessRights(formats strfmt.Registry) error { return nil } -func (m *SessionState) validateBasicAuthData(formats strfmt.Registry) error { +func (m *SessionState) validateDateCreated(formats strfmt.Registry) error { + if swag.IsZero(m.DateCreated) { // not required + return nil + } + if err := validate.FormatOf("date_created", "body", "date-time", m.DateCreated.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SessionState) validateBasicAuthData(formats strfmt.Registry) error { if swag.IsZero(m.BasicAuthData) { // not required return nil } @@ -166,6 +205,8 @@ func (m *SessionState) validateBasicAuthData(formats strfmt.Registry) error { if err := m.BasicAuthData.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("basic_auth_data") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("basic_auth_data") } return err } @@ -175,7 +216,6 @@ func (m *SessionState) validateBasicAuthData(formats strfmt.Registry) error { } func (m *SessionState) validateJwtData(formats strfmt.Registry) error { - if swag.IsZero(m.JwtData) { // not required return nil } @@ -184,6 +224,8 @@ func (m *SessionState) validateJwtData(formats strfmt.Registry) error { if err := m.JwtData.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("jwt_data") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("jwt_data") } return err } @@ -193,7 +235,6 @@ func (m *SessionState) validateJwtData(formats strfmt.Registry) error { } func (m *SessionState) validateMonitor(formats strfmt.Registry) error { - if swag.IsZero(m.Monitor) { // not required return nil } @@ -202,6 +243,112 @@ func (m *SessionState) validateMonitor(formats strfmt.Registry) error { if err := m.Monitor.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("monitor") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("monitor") + } + return err + } + } + + return nil +} + +// ContextValidate validate this session state based on the context it is used +func (m *SessionState) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAccessRights(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBasicAuthData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateJwtData(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMonitor(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SessionState) contextValidateAccessRights(ctx context.Context, formats strfmt.Registry) error { + + for k := range m.AccessRights { + + if val, ok := m.AccessRights[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + return nil +} + +func (m *SessionState) contextValidateBasicAuthData(ctx context.Context, formats strfmt.Registry) error { + + if m.BasicAuthData != nil { + + if swag.IsZero(m.BasicAuthData) { // not required + return nil + } + + if err := m.BasicAuthData.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("basic_auth_data") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("basic_auth_data") + } + return err + } + } + + return nil +} + +func (m *SessionState) contextValidateJwtData(ctx context.Context, formats strfmt.Registry) error { + + if m.JwtData != nil { + + if swag.IsZero(m.JwtData) { // not required + return nil + } + + if err := m.JwtData.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("jwt_data") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("jwt_data") + } + return err + } + } + + return nil +} + +func (m *SessionState) contextValidateMonitor(ctx context.Context, formats strfmt.Registry) error { + + if m.Monitor != nil { + + if swag.IsZero(m.Monitor) { // not required + return nil + } + + if err := m.Monitor.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("monitor") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("monitor") } return err } @@ -227,3 +374,170 @@ func (m *SessionState) UnmarshalBinary(b []byte) error { *m = res return nil } + +// BasicAuthData basic auth data +// +// swagger:model BasicAuthData +type BasicAuthData struct { + + // password + Password string `json:"password,omitempty"` + + // hash type + HashType HashType `json:"hash_type,omitempty"` +} + +// Validate validates this basic auth data +func (m *BasicAuthData) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHashType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *BasicAuthData) validateHashType(formats strfmt.Registry) error { + if swag.IsZero(m.HashType) { // not required + return nil + } + + if err := m.HashType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("basic_auth_data" + "." + "hash_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("basic_auth_data" + "." + "hash_type") + } + return err + } + + return nil +} + +// ContextValidate validate this basic auth data based on the context it is used +func (m *BasicAuthData) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateHashType(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *BasicAuthData) contextValidateHashType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.HashType) { // not required + return nil + } + + if err := m.HashType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("basic_auth_data" + "." + "hash_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("basic_auth_data" + "." + "hash_type") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *BasicAuthData) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *BasicAuthData) UnmarshalBinary(b []byte) error { + var res BasicAuthData + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// JWTData j w t data +// +// swagger:model JWTData +type JWTData struct { + + // secret + Secret string `json:"secret,omitempty"` +} + +// Validate validates this j w t data +func (m *JWTData) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this j w t data based on context it is used +func (m *JWTData) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *JWTData) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *JWTData) UnmarshalBinary(b []byte) error { + var res JWTData + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// Monitor monitor +// +// swagger:model Monitor +type Monitor struct { + + // trigger limits + TriggerLimits []float64 `json:"trigger_limits"` +} + +// Validate validates this monitor +func (m *Monitor) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this monitor based on context it is used +func (m *Monitor) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Monitor) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Monitor) UnmarshalBinary(b []byte) error { + var res Monitor + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/signature_config.go b/mservclient/models/signature_config.go new file mode 100644 index 00000000..2c5f48c4 --- /dev/null +++ b/mservclient/models/signature_config.go @@ -0,0 +1,65 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SignatureConfig signature config +// +// swagger:model SignatureConfig +type SignatureConfig struct { + + // algorithm + Algorithm string `json:"algorithm,omitempty"` + + // allowed clock skew + AllowedClockSkew int64 `json:"allowed_clock_skew,omitempty"` + + // error code + ErrorCode int64 `json:"error_code,omitempty"` + + // error message + ErrorMessage string `json:"error_message,omitempty"` + + // header + Header string `json:"header,omitempty"` + + // secret + Secret string `json:"secret,omitempty"` +} + +// Validate validates this signature config +func (m *SignatureConfig) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this signature config based on context it is used +func (m *SignatureConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *SignatureConfig) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SignatureConfig) UnmarshalBinary(b []byte) error { + var res SignatureConfig + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/storage_engine_code.go b/mservclient/models/storage_engine_code.go new file mode 100644 index 00000000..ec714585 --- /dev/null +++ b/mservclient/models/storage_engine_code.go @@ -0,0 +1,27 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" +) + +// StorageEngineCode storage engine code +// +// swagger:model StorageEngineCode +type StorageEngineCode string + +// Validate validates this storage engine code +func (m StorageEngineCode) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this storage engine code based on context it is used +func (m StorageEngineCode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/mservclient/models/string_regex_map.go b/mservclient/models/string_regex_map.go new file mode 100644 index 00000000..69500dfe --- /dev/null +++ b/mservclient/models/string_regex_map.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// StringRegexMap string regex map +// +// swagger:model StringRegexMap +type StringRegexMap struct { + + // match pattern + MatchPattern string `json:"match_rx,omitempty"` + + // reverse + Reverse bool `json:"reverse,omitempty"` +} + +// Validate validates this string regex map +func (m *StringRegexMap) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this string regex map based on context it is used +func (m *StringRegexMap) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *StringRegexMap) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *StringRegexMap) UnmarshalBinary(b []byte) error { + var res StringRegexMap + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/template_data.go b/mservclient/models/template_data.go new file mode 100644 index 00000000..8444e582 --- /dev/null +++ b/mservclient/models/template_data.go @@ -0,0 +1,156 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TemplateData template data +// +// swagger:model TemplateData +type TemplateData struct { + + // enable session + EnableSession bool `json:"enable_session,omitempty"` + + // template source + TemplateSource string `json:"template_source,omitempty"` + + // input type + InputType RequestInputType `json:"input_type,omitempty"` + + // template mode + TemplateMode TemplateMode `json:"template_mode,omitempty"` +} + +// Validate validates this template data +func (m *TemplateData) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateInputType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTemplateMode(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TemplateData) validateInputType(formats strfmt.Registry) error { + if swag.IsZero(m.InputType) { // not required + return nil + } + + if err := m.InputType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("input_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("input_type") + } + return err + } + + return nil +} + +func (m *TemplateData) validateTemplateMode(formats strfmt.Registry) error { + if swag.IsZero(m.TemplateMode) { // not required + return nil + } + + if err := m.TemplateMode.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("template_mode") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("template_mode") + } + return err + } + + return nil +} + +// ContextValidate validate this template data based on the context it is used +func (m *TemplateData) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateInputType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTemplateMode(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TemplateData) contextValidateInputType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.InputType) { // not required + return nil + } + + if err := m.InputType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("input_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("input_type") + } + return err + } + + return nil +} + +func (m *TemplateData) contextValidateTemplateMode(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.TemplateMode) { // not required + return nil + } + + if err := m.TemplateMode.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("template_mode") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("template_mode") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TemplateData) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TemplateData) UnmarshalBinary(b []byte) error { + var res TemplateData + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/template_meta.go b/mservclient/models/template_meta.go new file mode 100644 index 00000000..91e64fd3 --- /dev/null +++ b/mservclient/models/template_meta.go @@ -0,0 +1,115 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TemplateMeta template meta +// +// swagger:model TemplateMeta +type TemplateMeta struct { + + // method + Method string `json:"method,omitempty"` + + // path + Path string `json:"path,omitempty"` + + // template data + TemplateData *TemplateData `json:"template_data,omitempty"` +} + +// Validate validates this template meta +func (m *TemplateMeta) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTemplateData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TemplateMeta) validateTemplateData(formats strfmt.Registry) error { + if swag.IsZero(m.TemplateData) { // not required + return nil + } + + if m.TemplateData != nil { + if err := m.TemplateData.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("template_data") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("template_data") + } + return err + } + } + + return nil +} + +// ContextValidate validate this template meta based on the context it is used +func (m *TemplateMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTemplateData(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TemplateMeta) contextValidateTemplateData(ctx context.Context, formats strfmt.Registry) error { + + if m.TemplateData != nil { + + if swag.IsZero(m.TemplateData) { // not required + return nil + } + + if err := m.TemplateData.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("template_data") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("template_data") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TemplateMeta) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TemplateMeta) UnmarshalBinary(b []byte) error { + var res TemplateMeta + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/template_mode.go b/mservclient/models/template_mode.go new file mode 100644 index 00000000..7caca019 --- /dev/null +++ b/mservclient/models/template_mode.go @@ -0,0 +1,27 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" +) + +// TemplateMode template mode +// +// swagger:model TemplateMode +type TemplateMode string + +// Validate validates this template mode +func (m TemplateMode) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this template mode based on context it is used +func (m TemplateMode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/mservclient/models/track_endpoint_meta.go b/mservclient/models/track_endpoint_meta.go new file mode 100644 index 00000000..6e853efe --- /dev/null +++ b/mservclient/models/track_endpoint_meta.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TrackEndpointMeta track endpoint meta +// +// swagger:model TrackEndpointMeta +type TrackEndpointMeta struct { + + // method + Method string `json:"method,omitempty"` + + // path + Path string `json:"path,omitempty"` +} + +// Validate validates this track endpoint meta +func (m *TrackEndpointMeta) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this track endpoint meta based on context it is used +func (m *TrackEndpointMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TrackEndpointMeta) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TrackEndpointMeta) UnmarshalBinary(b []byte) error { + var res TrackEndpointMeta + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/transform_j_q_meta.go b/mservclient/models/transform_j_q_meta.go new file mode 100644 index 00000000..66906165 --- /dev/null +++ b/mservclient/models/transform_j_q_meta.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TransformJQMeta transform j q meta +// +// swagger:model TransformJQMeta +type TransformJQMeta struct { + + // filter + Filter string `json:"filter,omitempty"` + + // method + Method string `json:"method,omitempty"` + + // path + Path string `json:"path,omitempty"` +} + +// Validate validates this transform j q meta +func (m *TransformJQMeta) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this transform j q meta based on context it is used +func (m *TransformJQMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TransformJQMeta) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransformJQMeta) UnmarshalBinary(b []byte) error { + var res TransformJQMeta + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/tyk_event_handler_name.go b/mservclient/models/tyk_event_handler_name.go new file mode 100644 index 00000000..4ad43367 --- /dev/null +++ b/mservclient/models/tyk_event_handler_name.go @@ -0,0 +1,27 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" +) + +// TykEventHandlerName tyk event handler name +// +// swagger:model TykEventHandlerName +type TykEventHandlerName string + +// Validate validates this tyk event handler name +func (m TykEventHandlerName) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this tyk event handler name based on context it is used +func (m TykEventHandlerName) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/mservclient/models/url_rewrite_meta.go b/mservclient/models/url_rewrite_meta.go new file mode 100644 index 00000000..d4f23dbe --- /dev/null +++ b/mservclient/models/url_rewrite_meta.go @@ -0,0 +1,133 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// URLRewriteMeta URL rewrite meta +// +// swagger:model URLRewriteMeta +type URLRewriteMeta struct { + + // match pattern + MatchPattern string `json:"match_pattern,omitempty"` + + // method + Method string `json:"method,omitempty"` + + // path + Path string `json:"path,omitempty"` + + // rewrite to + RewriteTo string `json:"rewrite_to,omitempty"` + + // triggers + Triggers []*RoutingTrigger `json:"triggers"` +} + +// Validate validates this URL rewrite meta +func (m *URLRewriteMeta) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTriggers(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *URLRewriteMeta) validateTriggers(formats strfmt.Registry) error { + if swag.IsZero(m.Triggers) { // not required + return nil + } + + for i := 0; i < len(m.Triggers); i++ { + if swag.IsZero(m.Triggers[i]) { // not required + continue + } + + if m.Triggers[i] != nil { + if err := m.Triggers[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("triggers" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("triggers" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this URL rewrite meta based on the context it is used +func (m *URLRewriteMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTriggers(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *URLRewriteMeta) contextValidateTriggers(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Triggers); i++ { + + if m.Triggers[i] != nil { + + if swag.IsZero(m.Triggers[i]) { // not required + return nil + } + + if err := m.Triggers[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("triggers" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("triggers" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *URLRewriteMeta) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *URLRewriteMeta) UnmarshalBinary(b []byte) error { + var res URLRewriteMeta + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/validate_path_meta.go b/mservclient/models/validate_path_meta.go new file mode 100644 index 00000000..c4d4a040 --- /dev/null +++ b/mservclient/models/validate_path_meta.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ValidatePathMeta validate path meta +// +// swagger:model ValidatePathMeta +type ValidatePathMeta struct { + + // Allows override of default 422 Unprocessible Entity response code for validation errors. + ErrorResponseCode int64 `json:"error_response_code,omitempty"` + + // method + Method string `json:"method,omitempty"` + + // path + Path string `json:"path,omitempty"` + + // schema + Schema interface{} `json:"schema,omitempty"` + + // schema b64 + SchemaB64 string `json:"schema_b64,omitempty"` +} + +// Validate validates this validate path meta +func (m *ValidatePathMeta) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this validate path meta based on context it is used +func (m *ValidatePathMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ValidatePathMeta) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ValidatePathMeta) UnmarshalBinary(b []byte) error { + var res ValidatePathMeta + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/version_info.go b/mservclient/models/version_info.go new file mode 100644 index 00000000..9b27724d --- /dev/null +++ b/mservclient/models/version_info.go @@ -0,0 +1,224 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// VersionInfo version info +// +// swagger:model VersionInfo +type VersionInfo struct { + + // expires + Expires string `json:"expires,omitempty"` + + // global headers + GlobalHeaders map[string]string `json:"global_headers,omitempty"` + + // global headers remove + GlobalHeadersRemove []string `json:"global_headers_remove"` + + // global size limit + GlobalSizeLimit int64 `json:"global_size_limit,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // override target + OverrideTarget string `json:"override_target,omitempty"` + + // use extended paths + UseExtendedPaths bool `json:"use_extended_paths,omitempty"` + + // extended paths + ExtendedPaths *ExtendedPathsSet `json:"extended_paths,omitempty"` + + // paths + Paths *Paths `json:"paths,omitempty"` +} + +// Validate validates this version info +func (m *VersionInfo) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateExtendedPaths(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaths(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VersionInfo) validateExtendedPaths(formats strfmt.Registry) error { + if swag.IsZero(m.ExtendedPaths) { // not required + return nil + } + + if m.ExtendedPaths != nil { + if err := m.ExtendedPaths.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("extended_paths") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("extended_paths") + } + return err + } + } + + return nil +} + +func (m *VersionInfo) validatePaths(formats strfmt.Registry) error { + if swag.IsZero(m.Paths) { // not required + return nil + } + + if m.Paths != nil { + if err := m.Paths.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("paths") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("paths") + } + return err + } + } + + return nil +} + +// ContextValidate validate this version info based on the context it is used +func (m *VersionInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateExtendedPaths(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePaths(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VersionInfo) contextValidateExtendedPaths(ctx context.Context, formats strfmt.Registry) error { + + if m.ExtendedPaths != nil { + + if swag.IsZero(m.ExtendedPaths) { // not required + return nil + } + + if err := m.ExtendedPaths.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("extended_paths") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("extended_paths") + } + return err + } + } + + return nil +} + +func (m *VersionInfo) contextValidatePaths(ctx context.Context, formats strfmt.Registry) error { + + if m.Paths != nil { + + if swag.IsZero(m.Paths) { // not required + return nil + } + + if err := m.Paths.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("paths") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("paths") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VersionInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VersionInfo) UnmarshalBinary(b []byte) error { + var res VersionInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// Paths paths +// +// swagger:model Paths +type Paths struct { + + // black list + BlackList []string `json:"black_list"` + + // ignored + Ignored []string `json:"ignored"` + + // white list + WhiteList []string `json:"white_list"` +} + +// Validate validates this paths +func (m *Paths) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this paths based on context it is used +func (m *Paths) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Paths) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Paths) UnmarshalBinary(b []byte) error { + var res Paths + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservclient/models/virtual_meta.go b/mservclient/models/virtual_meta.go new file mode 100644 index 00000000..4249ea4f --- /dev/null +++ b/mservclient/models/virtual_meta.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// VirtualMeta virtual meta +// +// swagger:model VirtualMeta +type VirtualMeta struct { + + // function source type + FunctionSourceType string `json:"function_source_type,omitempty"` + + // function source URI + FunctionSourceURI string `json:"function_source_uri,omitempty"` + + // method + Method string `json:"method,omitempty"` + + // path + Path string `json:"path,omitempty"` + + // proxy on error + ProxyOnError bool `json:"proxy_on_error,omitempty"` + + // response function name + ResponseFunctionName string `json:"response_function_name,omitempty"` + + // use session + UseSession bool `json:"use_session,omitempty"` +} + +// Validate validates this virtual meta +func (m *VirtualMeta) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this virtual meta based on context it is used +func (m *VirtualMeta) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *VirtualMeta) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VirtualMeta) UnmarshalBinary(b []byte) error { + var res VirtualMeta + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/mservctl/cmd/root.go b/mservctl/cmd/root.go index 3a96109b..0353e107 100644 --- a/mservctl/cmd/root.go +++ b/mservctl/cmd/root.go @@ -16,7 +16,7 @@ import ( var ( cfgFile string - mservapi *client.Mserv + mservapi *client.MservAPI ) var log = logger.GetLogger("mservctl") diff --git a/util/storage/slave/slave.go b/util/storage/slave/slave.go index 4bfa5049..20ece0c1 100644 --- a/util/storage/slave/slave.go +++ b/util/storage/slave/slave.go @@ -27,7 +27,7 @@ func NewSlaveClient() (*Client, error) { type Client struct { conf *StoreConf - mservapi *client.Mserv + mservapi *client.MservAPI tag string }