mirror of https://github.com/vernonkeenan/lib
Compare commits
49 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
d53ad0d601 | |
|
|
bdf29af51a | |
|
|
8e38232555 | |
|
|
e512c18849 | |
|
|
36a1e8b9f8 | |
|
|
e771f8ac65 | |
|
|
cef842bb34 | |
|
|
8ced08e0b0 | |
|
|
e6365d539a | |
|
|
2b0b58d1e1 | |
|
|
e0d2bc6d11 | |
|
|
74bf8cf802 | |
|
|
a0cd40f1cf | |
|
|
543c5dc2e6 | |
|
|
8f853d056d | |
|
|
58ebde8660 | |
|
|
5ad4f6103e | |
|
|
edd36034e6 | |
|
|
9665671b8e | |
|
|
3cd528a60d | |
|
|
5e0f3d888a | |
|
|
c67edb84f3 | |
|
|
5150a23071 | |
|
|
1ceb27f03e | |
|
|
ef728b5483 | |
|
|
3818d47e5d | |
|
|
2fadfe94a7 | |
|
|
f26fd154b3 | |
|
|
e74c58f952 | |
|
|
c818c034cd | |
|
|
add52157dd | |
|
|
e676f0e6b8 | |
|
|
05b7ffcca2 | |
|
|
8ef777c7e6 | |
|
|
a906d56678 | |
|
|
36d068664d | |
|
|
48d3f6a97a | |
|
|
c7327fd313 | |
|
|
a13ad35fe2 | |
|
|
2e3fdeec39 | |
|
|
7b878f86d5 | |
|
|
6f44181e08 | |
|
|
18bfdecdbe | |
|
|
e64482991c | |
|
|
7eb2060c65 | |
|
|
6846446ffa | |
|
|
4d2d5bf861 | |
|
|
29f3ad980d | |
|
|
6d0cc3e67d |
|
|
@ -0,0 +1,62 @@
|
|||
name: CI (lib)
|
||||
|
||||
# First-ever CI for go/lib (ADR-KV-014). lib is publicly mirrored on
|
||||
# code.tnxs.net, so every push and PR gets a build/vet/test job plus a
|
||||
# gitleaks secret-scan job. lib is a Go library — no Dockerfile, no deploy.
|
||||
#
|
||||
# push trigger is scoped to main + release tags (not every branch): with
|
||||
# `branches: ['**']` *and* `pull_request` both set, every PR ran CI twice —
|
||||
# once for the pull_request event, once for the push to the PR's source
|
||||
# branch. main+tags replaced branch-per-version (ADR-KV-014, DT-KV-004), so
|
||||
# there's no longer a fleet of long-lived version branches that need their
|
||||
# own push-triggered runs independent of a PR.
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
tags: ['v*']
|
||||
pull_request:
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
# Serialize per ref. PR runs cancel superseded validations; branch pushes never cancel.
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: [self-hosted, Linux]
|
||||
permissions: { contents: read }
|
||||
steps:
|
||||
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
||||
|
||||
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
|
||||
with:
|
||||
go-version: stable
|
||||
# DT-KV-018: remote actions-cache round-trip (~287MB) vs the
|
||||
# persistent runner-local GOMODCACHE — disable, don't fetch it.
|
||||
cache: false
|
||||
|
||||
- name: go build ./...
|
||||
run: go build ./...
|
||||
|
||||
- name: go vet ./...
|
||||
run: go vet ./...
|
||||
|
||||
- name: go test ./...
|
||||
run: go test ./...
|
||||
|
||||
gitleaks:
|
||||
runs-on: [self-hosted, Linux]
|
||||
permissions: { contents: read }
|
||||
steps:
|
||||
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: gitleaks detect (git history)
|
||||
run: |
|
||||
docker run --rm -v "$PWD:/repo" -w /repo zricethezav/gitleaks:latest \
|
||||
detect --source /repo --redact -v
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
title = "gitleaks config for code.tnxs.net/vernonkeenan/lib"
|
||||
|
||||
[extend]
|
||||
useDefault = true
|
||||
|
||||
# ADR-KV-014: first-ever CI gitleaks scan surfaced 6 findings, all in
|
||||
# swagger-codegen-generated Kazoo API client models and the vendored
|
||||
# Kazoo swagger spec. Each is an illustrative `// Example:` / `example:`
|
||||
# JWT hardcoded by the generator to document the shape of an auth_token
|
||||
# field — a placeholder from the vendor's public API docs, not a
|
||||
# credential issued to or used by this project. Scoped narrowly to the
|
||||
# four generated files that triggered, not repo-wide.
|
||||
[allowlist]
|
||||
description = "Generated Kazoo API client/swagger example JWTs (not real secrets)"
|
||||
paths = [
|
||||
'''api/kazoo/kazoo_models/get_account_descendent_response\.go''',
|
||||
'''api/kazoo/kazoo_models/get_account_callflow_response\.go''',
|
||||
'''api/kazoo/kazoo_models/get_account_response\.go''',
|
||||
'''swagger/kazoo-telnexus\.yaml''',
|
||||
]
|
||||
|
|
@ -0,0 +1,168 @@
|
|||
# Changelog
|
||||
|
||||
All notable changes to `go/lib` (`code.tnxs.net/vernonkeenan/lib`) are
|
||||
documented here. The format is based on
|
||||
[Keep a Changelog](https://keepachangelog.com/en/1.0.0/). Releases are
|
||||
`v*` git tags cut from `main` via `make release VERSION=vX.Y.Z`
|
||||
(main + PR flow, ADR-KV-014, which also governs KV-C6 lib
|
||||
distribution — see also ADR-KV-004/006 for the mesh-wide branching/release
|
||||
model). **Branch-per-version is retired** as of 2026-07-12: `main` was
|
||||
created from the `v0.7.4` tip and is now the only long-lived branch; the
|
||||
~70 legacy `vX.Y.Z` branches still present in the repo are historical
|
||||
artifacts of the old convention, not active release refs. Every section
|
||||
below corresponds to a real git tag in this repo's history (only `v0.7.5`,
|
||||
cut by the new `make release` script, is an annotated tag — the 71 tags
|
||||
before it are lightweight, a holdover from the old ritual); no tag, date,
|
||||
or PR number is invented.
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Removed
|
||||
- Removed `app.InitForce`, `app.TheForce`, and the `go-force` module from the
|
||||
shared package after Auth reached native-only. `sf-gate` remains pinned to
|
||||
its prior Lib pending retirement; deprecated Cache must not consume this
|
||||
breaking release.
|
||||
|
||||
### Added
|
||||
- Added a generated, read-only Stash PDF metadata client for bounded list and
|
||||
tenant-scoped get operations from Stash draft PR #16. A pinned consumer
|
||||
projection exposes only `ID`, `Filename`, `Title`, and `URI`, preserves
|
||||
compound native-principal plus `kvSession` authentication, and omits all
|
||||
create/render/update/delete operations and models.
|
||||
- Regenerated the Members Go client and synchronized Members Swagger copies
|
||||
for the governed shared-portal backend contract, including catalog, plan,
|
||||
subscription, entitlement, authorized-client, scope, and effective-
|
||||
entitlement operations and models (ADR-KV-017).
|
||||
- Added the compound-auth Members client surface for Estate Administrator,
|
||||
Owner, and Manager tenant-membership administration, including manageable-
|
||||
tenant discovery, optimistic updates, and soft revocation (ADR-KV-021).
|
||||
- Regenerated the Research Go client and synchronized Research Swagger copies
|
||||
for governed Industry read/create/update plus tenant-attributed
|
||||
IndustryCompany, IndustryProduct, and IndustryService read/create operations.
|
||||
Contract tests pin the generated HTTP methods and paths and prevent an
|
||||
unsupported `IndustryService.HTML` field from entering the shared model.
|
||||
- Regenerated the Research Go client from the deployed v0.7.16 contract for
|
||||
governed Topic, Factor, FinancialStatement, and Observation list/get/create/
|
||||
update workflows. Contract tests pin the source spec, generated operations,
|
||||
ID-filtered reads, optimistic-conflict responses, and the absence of invented
|
||||
Topic delete, bulk, Salesforce, or credential-literal behavior.
|
||||
- Synchronized the Research provider projection from draft PR #32 and generated
|
||||
compound-auth CompanyProduct and CompanyService list/detail/create clients
|
||||
plus CompanyService optimistic update. Contract tests preserve Product's
|
||||
proposal-only update boundary, remove both catalog deletes, pin negative
|
||||
mutation responses, and prevent Salesforce, Cache, or credential coupling.
|
||||
|
||||
## [v0.7.5] — 2026-07-12
|
||||
|
||||
First release cut with the new `make release` scripted ritual (ADR-KV-014),
|
||||
and the first release with CI behind it.
|
||||
|
||||
### Added
|
||||
- First-ever CI for `lib`: `go build/vet/test ./...` job plus a gitleaks
|
||||
secret-scan job on every push/PR, closing out the last un-covered repo in
|
||||
the 12-repo Go-mesh test-harness program (ci/first-ci-gitleaks, PR #1)
|
||||
- Table-driven unit tests for `app/service-helpers.go`'s pure helpers
|
||||
(test/app-service-helpers, PR #2)
|
||||
|
||||
### Changed
|
||||
- Replaced the manual three-web-UI-plus-CLI release ritual with
|
||||
`scripts/release.sh` / `make release` + `make release-dry-run`
|
||||
(feat/scripted-release, ADR-KV-014, PR #3)
|
||||
- Regenerated all sibling clients under `api/` with go-swagger v0.35.0
|
||||
(feat/regen-clients-processor-token, PR #5)
|
||||
|
||||
### Fixed
|
||||
- `PaymentMethod` swagger def updated for the `card_*` → `processor_token`
|
||||
migration (PR #4)
|
||||
|
||||
## [v0.7.4] — 2025-05-27
|
||||
|
||||
### Added
|
||||
- Generated session-management API client and models
|
||||
|
||||
## [v0.7.3] — 2025-05-01
|
||||
|
||||
### Changed
|
||||
- Refactored swagger defs (`Address`, `CompanyProduct`, `CompanyService`,
|
||||
`Factor`, `FinancialStatement`, `Industry`, `IndustryCompany`,
|
||||
`IndustryProduct`, `IndustryService`, `Observation`, `Topic`) to use
|
||||
external `$ref` component defs instead of inline definitions
|
||||
|
||||
## [v0.7.2] — 2025-04-30
|
||||
|
||||
### Changed
|
||||
- Replaced `AccountID` with `CompanyID` in `GetIndustryCompaniesParams` and
|
||||
the related swagger definitions
|
||||
|
||||
## [v0.7.1] — 2025-04-29
|
||||
|
||||
No code changes — retag of the same commit as `v0.7.0`/`v0.6.7`.
|
||||
|
||||
## [v0.7.0] — 2025-04-29
|
||||
|
||||
No code changes — retag of the same commit as `v0.6.7`.
|
||||
|
||||
## [v0.6.7] — 2025-04-29
|
||||
|
||||
### Added
|
||||
- Enrichment fields on `Account`, `CompanyProduct`, and `CompanyService`
|
||||
models
|
||||
|
||||
## [v0.6.6] — 2025-04-29
|
||||
|
||||
### Changed
|
||||
- General code-structure refactor for readability/maintainability
|
||||
|
||||
## [v0.6.5] — 2024-06-30
|
||||
|
||||
### Added
|
||||
- `Channels` field on `Account` and `Contact` models
|
||||
|
||||
## [v0.6.4] — 2024-06-29
|
||||
|
||||
### Added
|
||||
- `AppExchange` URL field on `CompanyProduct` model
|
||||
|
||||
## [v0.6.3] — 2024-06-28
|
||||
|
||||
### Added
|
||||
- `AppExchange` URL field on `CompanyProduct` model
|
||||
|
||||
## [v0.6.2] — 2024-06-28
|
||||
|
||||
### Added
|
||||
- `AppExchange` URL field on `Account` and `Company` models
|
||||
|
||||
## [v0.6.1] — 2024-06-27
|
||||
|
||||
### Added
|
||||
- `FullDescription` field on `Account` model
|
||||
|
||||
## [v0.6.0] — 2024-01-22
|
||||
|
||||
### Added
|
||||
- `FullDescription` field on `Industry` model
|
||||
|
||||
## Pre-v0.6.0 history (v0.0.1 – v0.5.15, 2021-07-30 – 2023-08-25)
|
||||
|
||||
58 tags predate `v0.6.0`, from `lib`'s original scaffolding through the
|
||||
last patch release before the year-and-a-half gap to `v0.6.0`. Coarse
|
||||
summary by theme (no PR numbers — this history predates the PR-merge
|
||||
convention):
|
||||
|
||||
- **2021 (v0.0.1–v0.1.9):** Initial `app` package scaffolding — config,
|
||||
logger, MySQL, and Salesforce (`go-force`) init helpers; first
|
||||
go-swagger client generation against the estate's early services
|
||||
(including a since-retired Telnexus/Kazoo-era client, still visible as
|
||||
vendored specs under `swagger/`); early devops endpoint moves and
|
||||
`/etc` config-path changes.
|
||||
- **2022 (v0.1.2–v0.4.9):** Buildout of `sf-gate` and `members` swagger
|
||||
clients; schema cleanups; `research` and `plex` microservices added to
|
||||
the platform; user/session/batch-endpoint additions across `sf-gate` and
|
||||
`members`.
|
||||
- **2023 H1 (v0.5.0–v0.5.8):** `members` feature buildout — prompts and
|
||||
prompt answers, favorites, documents, event categories, external
|
||||
accounts — plus a research-domain refactor.
|
||||
- **2023 H2 (v0.5.9–v0.5.15):** Steady patch releases stabilizing the
|
||||
prompts/members surface; `v0.5.15` (2023-08-25) is the last tag before
|
||||
the gap to `v0.6.0`.
|
||||
190
Makefile
190
Makefile
|
|
@ -1,157 +1,37 @@
|
|||
|
||||
.PHONY: swagger
|
||||
# Pinned go-swagger version for `make install-swagger` / `make regen`.
|
||||
# Bump deliberately, verify `swagger version` matches, and record the change
|
||||
# here and in README.md's Release Procedure. Chosen 2026-07-12: latest
|
||||
# stable go-swagger release at the time (ADR-KV-014).
|
||||
SWAGGER_VERSION := v0.35.0
|
||||
export SWAGGER_VERSION
|
||||
|
||||
swagger:
|
||||
cp ../auth/swagger/auth-vernonkeenan.yaml ./swagger
|
||||
cp ../auth/swagger/auth-vernonkeenan.yaml ./swagger/external
|
||||
cp ../crm/swagger/crm-vernonkeenan.yaml ./swagger
|
||||
cp ../crm/swagger/crm-vernonkeenan.yaml ./swagger/external
|
||||
cp ../stash/swagger/stash-vernonkeenan.yaml ./swagger
|
||||
cp ../stash/swagger/stash-vernonkeenan.yaml ./swagger/external
|
||||
cp ../sf-gate/swagger/sf-gate-vernonkeenan.yaml ./swagger
|
||||
cp ../sf-gate/swagger/sf-gate-vernonkeenan.yaml ./swagger/external
|
||||
cp ../research/swagger/research-vernonkeenan.yaml ./swagger
|
||||
cp ../research/swagger/research-vernonkeenan.yaml ./swagger/external
|
||||
cp ../members/swagger/members-vernonkeenan.yaml ./swagger
|
||||
cp ../members/swagger/members-vernonkeenan.yaml ./swagger/external
|
||||
cp ../plex/swagger/plex-vernonkeenan.yaml ./swagger
|
||||
cp ../plex/swagger/plex-vernonkeenan.yaml ./swagger/external
|
||||
#
|
||||
rm -rf api
|
||||
#
|
||||
# generate auth client
|
||||
#
|
||||
mkdir -p api/auth
|
||||
swagger generate client \
|
||||
--log-output=./swagger/logs/generate-auth-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=auth \
|
||||
--spec=./swagger/auth-vernonkeenan.yaml \
|
||||
--target=./api/auth \
|
||||
--client-package=auth-client \
|
||||
--model-package=auth-models \
|
||||
--principal=app.User
|
||||
#
|
||||
# update external auth client
|
||||
#
|
||||
sed -i 's|"http"|"https"|g' ./swagger/external/auth-vernonkeenan.yaml
|
||||
sed -i 's|auth.vernonkeenan.com:8080|gw.tnxs.net|g' ./swagger/external/auth-vernonkeenan.yaml
|
||||
sed -i 's|"/v1"|"/vk/auth/v1"|g' ./swagger/external/auth-vernonkeenan.yaml
|
||||
#
|
||||
# generate crm client
|
||||
#
|
||||
mkdir api/crm
|
||||
swagger generate client \
|
||||
--log-output=./swagger/logs/generate-crm-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=crm \
|
||||
--spec=./swagger/crm-vernonkeenan.yaml \
|
||||
--target=./api/crm \
|
||||
--client-package=crm-client \
|
||||
--model-package=crm-models \
|
||||
--principal=app.User
|
||||
#
|
||||
# update external crm client
|
||||
#
|
||||
sed -i 's|"http"|"https"|g' ./swagger/external/crm-vernonkeenan.yaml
|
||||
sed -i 's|crm.vernonkeenan.com:8080|gw.tnxs.net|g' ./swagger/external/crm-vernonkeenan.yaml
|
||||
sed -i 's|"/v1"|"/vk/crm/v1"|g' ./swagger/external/crm-vernonkeenan.yaml
|
||||
#
|
||||
# generate stash client
|
||||
#
|
||||
mkdir api/stash
|
||||
swagger generate client \
|
||||
--log-output=./swagger/logs/generate-stash-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=stash \
|
||||
--spec=./swagger/stash-vernonkeenan.yaml \
|
||||
--target=./api/stash \
|
||||
--client-package=stash-client \
|
||||
--model-package=stash-models \
|
||||
--principal=app.User
|
||||
#
|
||||
# update external stash client
|
||||
#
|
||||
sed -i 's|"http"|"https"|g' ./swagger/external/stash-vernonkeenan.yaml
|
||||
sed -i 's|stash.vernonkeenan.com:8080|gw.tnxs.net|g' ./swagger/external/stash-vernonkeenan.yaml
|
||||
sed -i 's|"/v1"|"/vk/stash/v1"|g' ./swagger/external/stash-vernonkeenan.yaml
|
||||
#
|
||||
# generate sfgate client
|
||||
#
|
||||
mkdir api/sfgate
|
||||
swagger generate client \
|
||||
--log-output=./swagger/logs/generate-sfgate-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=sfgate \
|
||||
--spec=./swagger/sf-gate-vernonkeenan.yaml \
|
||||
--target=./api/sfgate \
|
||||
--client-package=sfgate-client \
|
||||
--model-package=sfgate-models \
|
||||
--principal=app.User
|
||||
#
|
||||
# update external crm client
|
||||
#
|
||||
sed -i 's|"http"|"https"|g' ./swagger/external/sf-gate-vernonkeenan.yaml
|
||||
sed -i 's|sf-gate.vernonkeenan.com:8080|gw.tnxs.net|g' ./swagger/external/sf-gate-vernonkeenan.yaml
|
||||
sed -i 's|"/v1"|"/vk/sf-gate/v1"|g' ./swagger/external/sf-gate-vernonkeenan.yaml
|
||||
#
|
||||
# generate research client
|
||||
#
|
||||
mkdir api/research
|
||||
swagger generate client \
|
||||
--log-output=./swagger/logs/generate-research-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=research \
|
||||
--spec=./swagger/research-vernonkeenan.yaml \
|
||||
--target=./api/research \
|
||||
--client-package=research-client \
|
||||
--model-package=research-models \
|
||||
--principal=app.User
|
||||
#
|
||||
# update external research client
|
||||
#
|
||||
sed -i 's|"http"|"https"|g' ./swagger/external/research-vernonkeenan.yaml
|
||||
sed -i 's|research.vernonkeenan.com:8080|gw.tnxs.net|g' ./swagger/external/research-vernonkeenan.yaml
|
||||
sed -i 's|"/v1"|"/vk/research/v1"|g' ./swagger/external/research-vernonkeenan.yaml
|
||||
#
|
||||
# generate members client
|
||||
#
|
||||
mkdir api/members
|
||||
swagger generate client \
|
||||
--log-output=./swagger/logs/generate-members-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=members \
|
||||
--spec=./swagger/members-vernonkeenan.yaml \
|
||||
--target=./api/members \
|
||||
--client-package=members-client \
|
||||
--model-package=members-models \
|
||||
--principal=app.User
|
||||
#
|
||||
# update external members client
|
||||
#
|
||||
sed -i 's|"http"|"https"|g' ./swagger/external/members-vernonkeenan.yaml
|
||||
sed -i 's|members.vernonkeenan.com:8080|gw.tnxs.net|g' ./swagger/external/members-vernonkeenan.yaml
|
||||
sed -i 's|"/v1"|"/vk/members/v1"|g' ./swagger/external/members-vernonkeenan.yaml
|
||||
#
|
||||
# generate plex client
|
||||
#
|
||||
mkdir api/plex
|
||||
swagger generate client \
|
||||
--log-output=./swagger/logs/generate-plex-client.log \
|
||||
--copyright-file=./build/COPYRIGHT \
|
||||
--name=plex \
|
||||
--spec=./swagger/plex-vernonkeenan.yaml \
|
||||
--target=./api/plex \
|
||||
--client-package=plex-client \
|
||||
--model-package=plex-models \
|
||||
--principal=app.User
|
||||
#
|
||||
# update external plex client
|
||||
#
|
||||
sed -i 's|"http"|"https"|g' ./swagger/external/plex-vernonkeenan.yaml
|
||||
sed -i 's|plex.vernonkeenan.com:8080|gw.tnxs.net|g' ./swagger/external/plex-vernonkeenan.yaml
|
||||
sed -i 's|"/v1"|"/vk/plex/v1"|g' ./swagger/external/plex-vernonkeenan.yaml
|
||||
#
|
||||
# copy external swagger files
|
||||
#
|
||||
scp ./swagger/external/*.yaml root@whm.noc.tnxs.net:/home/taxassets/www/swagger/external
|
||||
.PHONY: install-swagger regen release release-dry-run swagger
|
||||
|
||||
# Install the pinned go-swagger CLI and verify its version.
|
||||
install-swagger:
|
||||
./scripts/release.sh install-swagger
|
||||
|
||||
# Regenerate api/ clients from the sibling service specs (../{auth,crm,stash,
|
||||
# sf-gate,research,members,plex}/swagger/*.yaml). Stash code is narrowed by
|
||||
# swagger/client/stash-pdf-metadata.yaml to its governed read-only consumer
|
||||
# surface. Requires the sibling repos to be cloned adjacently (same
|
||||
# prerequisite the old README ritual had). Review and commit the result as
|
||||
# its own PR before `make release`.
|
||||
regen: install-swagger
|
||||
./scripts/release.sh regen
|
||||
|
||||
# Cut a release: tag HEAD of main, push the tag, publish the GitHub release,
|
||||
# and trigger the Gitea mirror-sync. Requires a clean main checkout that
|
||||
# matches origin/main. Usage: make release VERSION=v0.7.5
|
||||
release:
|
||||
./scripts/release.sh release "$(VERSION)"
|
||||
|
||||
# Same as `release` but stops before tag/push/release/mirror-sync — prints
|
||||
# what would happen. Usage: make release-dry-run VERSION=v0.7.5
|
||||
release-dry-run:
|
||||
./scripts/release.sh release "$(VERSION)" --dry-run
|
||||
|
||||
# Deprecated alias for `regen`, kept because old muscle memory (and the
|
||||
# README ritual) called this `make swagger`.
|
||||
swagger: regen
|
||||
|
|
|
|||
187
README.md
187
README.md
|
|
@ -1,27 +1,180 @@
|
|||
# lib
|
||||
# go/lib — Shared Go library for the Keenan Vision service mesh
|
||||
|
||||
vernonkeenan Shared Libraries (go)
|
||||
`go/lib` (module `code.tnxs.net/vernonkeenan/lib`) is the shared toolchain
|
||||
every Go microservice in the Keenan Vision mesh pins in its `go.mod`. It is
|
||||
not a service — it ships no server, no Dockerfile, no compose entry — it is
|
||||
a library `app` package (`InitConfig`/`InitDB`, config
|
||||
accessors, zap logging, Prometheus/CORS middleware, generic marshal
|
||||
helpers) plus a set of go-swagger–generated typed HTTP clients (`api/`)
|
||||
against the sibling services' own swagger specs. Because every mesh service
|
||||
pins the same module, a `lib` bump is a constellation-wide rebuild (KV-C6a).
|
||||
|
||||
## Dependent Systems
|
||||
## Constellation context
|
||||
|
||||
The Gitea server <https://code.tnxs.net> must be up and running with admin access.
|
||||
- Toolchain member of the Keenan Vision Go mesh governed by `../../kv-meta/`
|
||||
(see `../../kv-meta/CONSTELLATION.md` §1.3, contract KV-C6). Not a
|
||||
deployed service: no swagger server, no port, no entry in the
|
||||
`docker/kvweb` compose on pluto.
|
||||
- KV-C6a: every mesh service (`auth`, `cache`, `crm`, `members`, `pdf`,
|
||||
`plex`, `render`, `research`, `sf-gate`, `stash`) pins an explicit
|
||||
`code.tnxs.net/vernonkeenan/lib` tag in its own `go.mod`; consumption is a
|
||||
per-consumer `go.mod` bump, never automatic.
|
||||
- Distribution is via the world-readable Gitea pull-mirror at
|
||||
`code.tnxs.net/vernonkeenan/lib`, enabling
|
||||
credential-free `go get code.tnxs.net/vernonkeenan/lib@vX.Y.Z` from
|
||||
Docker/CI/dev boxes even though the GitHub repo itself is private
|
||||
(ADR-KV-014). Everything committed here is treated as **published,
|
||||
permanently** — a gitleaks CI gate makes leaking a secret a build
|
||||
failure, not a review nit.
|
||||
- CI (self-hosted runner, `go build/vet/test ./...` + gitleaks on every
|
||||
push/PR) landed 2026-07-12 as `lib`'s first-ever pipeline (ADR-KV-014) —
|
||||
`lib` was the only one of the 12 Go-roster repos with no CI at all going
|
||||
into the 2026-07-12 test-harness audit, so this closes out that gap. The
|
||||
`test` job is `lib`'s instance of the mesh-wide unit-test-gate program
|
||||
(ADR-KV-009, amended by ADR-KV-013, which scopes `lib` as one of its 12
|
||||
governed repos); the `gitleaks` job is ADR-KV-014's public-mirror
|
||||
secret-scan gate, specific to `lib` because it's the one repo mirrored
|
||||
world-readable.
|
||||
- `api/` also acts as `lib`'s own internal client of the mesh: `app/auth.go`'s
|
||||
`CheckAPIUser` calls `auth`'s generated client to validate an API key, so
|
||||
`lib` is simultaneously a library *and* a consumer of one sibling service.
|
||||
|
||||
## Update Procedure
|
||||
## Package surface
|
||||
|
||||
Prerequisite: All the other repos are cloned locally in adjacent directories.
|
||||
| Path | What it is |
|
||||
|---|---|
|
||||
| `app/root.go` | `InitConfig(systemName, level)` — loads `/etc/vernonkeenan/<systemName>.yaml` via viper, one-time init guard |
|
||||
| `app/config.go` | `Configuration` struct + `Get*`/`Is*` accessors (DBMS, DSN, authentication mode, log level, metrics, service accounts, workers, email, chunk/cache sizing) |
|
||||
| `app/mysql.go` | `InitDB()` — opens `MyDB *sql.DB` against the configured MySQL DSN |
|
||||
| `app/auth.go` | `CheckAPIUser(token)` — validates a credential against `auth`; errors never log the raw value |
|
||||
| `app/prometheus.go` | `SetupPrometheusHandler` — CORS + request-count/duration middleware |
|
||||
| `app/service-helpers.go` | Pointer helpers (`String`/`Bool`/`Int64`/…), `GetFieldsAndValues` reflection helper (unit-tested) |
|
||||
| `app/user.go`, `user-helpers.go`, `tenantuser.go`, `userrole.go`, `address.go` | Compatibility principal/domain structs. ADR-KV-024 adds `PrincipalKey`, `PrincipalType`, exact `Scopes`, `HasScope`, and `IsServicePrincipal`; no native response carries its bearer secret. |
|
||||
| `app/logger/logger.go` | Thin `zap.SugaredLogger` wrapper (`New(level)`, level constants) |
|
||||
| `api/{auth,crm,members,plex,research,sfgate,stash}/` | go-swagger–generated typed clients + models, one directory per sibling service. Stash is intentionally generated from the read-only PDF metadata projection described below. Research CompanyProduct/CompanyService operations are pinned to provider PR #32 as documented in `docs/RESEARCH_COMPANY_CATALOG_CLIENT.md`. |
|
||||
| `swagger/*.yaml`, `swagger/defs/`, `swagger/external/` | Copies of each sibling service's spec (the KV-C6b spec-copy problem — no sync mechanism besides `make regen`), shared component defs, and host/path-rewritten copies for external doc publishing; also carries legacy vendored Kazoo/Clerk specs from `lib`'s pre-mesh history |
|
||||
|
||||
* Increment branch number in local repo
|
||||
|
||||
* Generate all OpenAPI libraries and then cleanup modules
|
||||
## Build, run, test
|
||||
|
||||
```bash
|
||||
make swagger
|
||||
go get -u -f ./...
|
||||
go mod tidy
|
||||
go build ./...
|
||||
go vet ./...
|
||||
go test ./... # table-driven unit tests today: app/service-helpers.go pure helpers
|
||||
make install-swagger # install the pinned go-swagger CLI (SWAGGER_VERSION in Makefile)
|
||||
make regen # aka `make swagger` — regenerate api/ from sibling specs
|
||||
make release VERSION=vX.Y.Z
|
||||
make release-dry-run VERSION=vX.Y.Z
|
||||
```
|
||||
|
||||
* Commit and push new branch to GitHub
|
||||
* On GitHub goto <https://github.com/vernonkeenan/lib/settings/branches> set the new branch to default.
|
||||
* On GitHub goto <https://github.com/vernonkeenan/lib/releases> and publish a new release for the new branch. Make the new tag the branch name.
|
||||
* On Gitea goto <https://code.tnxs.net/vernonkeenan/lib/settings> and click Synchronize Now.
|
||||
* Update the ``go.mod`` line with ``code.tnxs.net/vernonkeenan/lib`` in each project to match the latest version.
|
||||
`go test ./...` is CI-gating on every push and PR (ADR-KV-009/013), same as
|
||||
the rest of the mesh; `lib` is a library so there is nothing to "run."
|
||||
|
||||
`make regen` requires the sibling repos `auth`, `crm`, `stash`, `sf-gate`,
|
||||
`research`, `members`, `plex` cloned adjacently — it reads each one's
|
||||
`swagger/<service>-vernonkeenan.yaml`, copies it into `./swagger` and
|
||||
`./swagger/external`, and regenerates every client under `api/`, rewriting
|
||||
the external specs' scheme/host/path the same way the old `make swagger`
|
||||
ritual did. It fails fast, before touching anything, if any sibling spec is
|
||||
missing. Review `git status`/`git diff`, commit, open a PR, and merge it to
|
||||
`main` like any other change — client regen is never bundled into the
|
||||
release step; `make regen` runs a non-fatal `go build ./...` at the end as
|
||||
an early warning, but the real gate is CI on that PR.
|
||||
|
||||
Stash is the deliberate exception to full provider-spec client generation.
|
||||
The complete provider spec is still synchronized for documentation, while
|
||||
client code is generated from
|
||||
`swagger/client/stash-pdf-metadata.yaml`. That projection exposes only the
|
||||
tenant-scoped PDF metadata list/get operations and four sanitized response
|
||||
fields; it cannot generate the provider's deprecated, fail-closed create
|
||||
compatibility route. See `docs/STASH_PDF_METADATA_CLIENT.md` for the provider
|
||||
commit and release blockers.
|
||||
|
||||
The Research specification is synchronized from provider PR #32 at commit
|
||||
`ca6a2911ce79d053f9aa338e6d9bcfe3357b0c77`. Its generated company catalog
|
||||
surface exposes Product and Service list/detail/create plus Service CAS update.
|
||||
Product direct update remains proposal-only, and both catalog deletes are
|
||||
absent. See `docs/RESEARCH_COMPANY_CATALOG_CLIENT.md` for the pinned spec hash,
|
||||
exact scope requirements, database assumptions, and Research-before-Lib-before-
|
||||
Studio release gate.
|
||||
|
||||
**Known gap (resolved for the current spec set, but can recur):** if any
|
||||
sibling spec has an operation with no top-level `tags:`, go-swagger routes
|
||||
it into a fallback `operations` package whose import path in
|
||||
`<name>_client/<name>_client.go` doesn't respect `--client-package` —
|
||||
reproduced across go-swagger v0.33.2 through v0.35.0 while building this
|
||||
tooling. The one instance found, `sf-gate-vernonkeenan.yaml`'s `PUT
|
||||
/researchprojectservices` (no `tags:`), was fixed at the source (sf-gate
|
||||
#3 added the missing `tags:` entry) and regenerated clean in the v0.7.5
|
||||
`feat/regen-clients-processor-token` PR — `api/sfgate` has no fallback
|
||||
`operations` package today. If a future sibling spec change reintroduces an
|
||||
untagged operation, `make regen`'s non-fatal `go build ./...` step will
|
||||
fail with this same signature; fix it at the source (add a `tags:` entry in
|
||||
that service's spec) rather than hand-patching generated code, since the
|
||||
next regen would just reintroduce it.
|
||||
|
||||
## Configuration
|
||||
|
||||
`lib` reads no config file of its own. `app.InitConfig(systemName, level)`
|
||||
loads config **on behalf of the calling service**: viper reads
|
||||
`/etc/vernonkeenan/<systemName>.yaml` (YAML), with environment-variable
|
||||
overrides via prefix `VERNONKEENAN_` (`.` replaced by `_` in key names),
|
||||
unmarshalled into `app.Configuration` — `AppName`, `BackendID`,
|
||||
`DBMS`/`DBMSHost`/`DBMSName`/`DBMSUsername`/`DBMSPassword`, `DSN`,
|
||||
`Environment`, `LogLevel`, `GelfURI`, `Metrics` (address/enabled),
|
||||
`ServiceAccounts` (a map of external-system credentials, e.g. the `auth`
|
||||
service account `CheckAPIUser` reads its own API key from), `Workers`,
|
||||
`Email`, `CacheSizes`/`Chunks`. The concrete `/etc/vernonkeenan/<name>.yaml`
|
||||
file lives on each deploy host, not in this repo — see the calling
|
||||
service's own README for its file name and required keys.
|
||||
|
||||
## Versioning & pinning contract (KV-C6a)
|
||||
|
||||
- **Module:** `code.tnxs.net/vernonkeenan/lib`, fetched via the Gitea
|
||||
anonymous mirror (not GitHub directly — the GitHub repo is private).
|
||||
- **Pin, don't float:** every consumer pins an explicit `vX.Y.Z` tag in its
|
||||
`go.mod`. Bumping the pin is a normal PR in the consumer repo; there is no
|
||||
auto-bump mechanism.
|
||||
- **Release is one command:** `make release VERSION=vX.Y.Z`
|
||||
(`scripts/release.sh`) from a clean `main` checkout that matches
|
||||
`origin/main`:
|
||||
1. Validates `VERSION` is `vMAJOR.MINOR.PATCH` and strictly greater than
|
||||
the latest existing tag.
|
||||
2. Requires you're on `main`, the tree is clean, and local `main` matches
|
||||
`origin/main` (no local-only commits).
|
||||
3. Runs `go build ./...` and `go vet ./...` as a last sanity check.
|
||||
4. Creates an annotated tag at HEAD, pushes it, and runs `gh release
|
||||
create` with generated notes.
|
||||
5. POSTs an explicit zero-length body to the Gitea mirror-sync API for
|
||||
`vernonkeenan/lib` (skipped with a warning if `GITEA_TOKEN` is unset).
|
||||
|
||||
`make release-dry-run VERSION=vX.Y.Z` runs steps 1-3 and prints what
|
||||
steps 4-5 would do, without tagging, pushing, publishing, or syncing
|
||||
anything.
|
||||
- **A `lib` bump is constellation-wide:** any breaking change to
|
||||
`app.Configuration`, `InitConfig`/`InitDB`, or a generated
|
||||
client's shape ripples to every pinned service on its next `go.mod` bump.
|
||||
v0.7.10 deliberately removes the retired `InitForce` API and `go-force`
|
||||
dependency. `sf-gate` stays pinned to its prior Lib while awaiting
|
||||
retirement; deprecated Cache must not be rebuilt or upgraded.
|
||||
- **Branch-per-version is retired** (ADR-KV-014, 2026-07-12): `lib` moved
|
||||
to main + `v*` tags, replacing the old three-web-UI-plus-CLI manual
|
||||
release ritual. ~70 legacy `vX.Y.Z` branches (one per pre-migration
|
||||
release; `git branch --list 'v*'`) remain in the repo as historical
|
||||
artifacts of the old convention, not the active release mechanism.
|
||||
- **Prerequisites for a release:** the sibling repos (for `make regen`)
|
||||
cloned adjacently; [`gh`](https://cli.github.com/) authenticated with
|
||||
push access to `vernonkeenan/lib`; `GITEA_TOKEN` exported for the
|
||||
mirror-sync step (optional — see above).
|
||||
|
||||
## Release & deploy
|
||||
|
||||
`main` + PR flow: land changes on `main` via PR (CI runs build/vet/test +
|
||||
gitleaks on the PR and on push to `main`), then cut a release with `make
|
||||
release VERSION=vX.Y.Z`, which tags `main`, publishes a GitHub release, and
|
||||
triggers the Gitea mirror-sync. Unlike the deployed mesh services, `lib` has
|
||||
**no Dockerfile, no container image, and no deploy step** — it is never
|
||||
built into `hub.tnxs.net` and never rolled out via the `docker/kvweb`
|
||||
compose on pluto. "Release" means "a new tag other repos can pin," full
|
||||
stop; downstream rollout happens when each consumer bumps its own `go.mod`
|
||||
line for `code.tnxs.net/vernonkeenan/lib` to the new tag and goes through
|
||||
its own release/deploy path.
|
||||
|
|
|
|||
|
|
@ -6,30 +6,26 @@
|
|||
|
||||
package auth_client
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"maps"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/auth/auth_client/user"
|
||||
"github.com/go-openapi/runtime"
|
||||
httptransport "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/auth/auth_client/user"
|
||||
)
|
||||
|
||||
// Default auth HTTP client.
|
||||
var Default = NewHTTPClient(nil)
|
||||
|
||||
const (
|
||||
// DefaultHost is the default Host
|
||||
// found in Meta (info) section of spec file
|
||||
// DefaultHost is the default Host found in Meta (info) section of spec file.
|
||||
DefaultHost string = "auth.vernonkeenan.com:8080"
|
||||
// DefaultBasePath is the default BasePath
|
||||
// found in Meta (info) section of spec file
|
||||
// DefaultBasePath is the default BasePath found in Meta (info) section of spec file.
|
||||
DefaultBasePath string = "/v1"
|
||||
)
|
||||
|
||||
// DefaultSchemes are the default schemes found in Meta (info) section of spec file
|
||||
// DefaultSchemes are the default schemes found in Meta (info) section of spec file.
|
||||
var DefaultSchemes = []string{"http"}
|
||||
|
||||
// NewHTTPClient creates a new auth HTTP client.
|
||||
|
|
@ -45,13 +41,16 @@ func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Aut
|
|||
cfg = DefaultTransportConfig()
|
||||
}
|
||||
|
||||
// create transport and client
|
||||
// create transport and client.
|
||||
transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes)
|
||||
maps.Copy(transport.Producers, cfg.Producers)
|
||||
maps.Copy(transport.Consumers, cfg.Consumers)
|
||||
|
||||
return New(transport, formats)
|
||||
}
|
||||
|
||||
// New creates a new auth client
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) *Auth {
|
||||
// New creates a new auth client.
|
||||
func New(transport runtime.ContextualTransport, formats strfmt.Registry) *Auth {
|
||||
// ensure nullable parameters have default
|
||||
if formats == nil {
|
||||
formats = strfmt.Default
|
||||
|
|
@ -60,6 +59,7 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *Auth {
|
|||
cli := new(Auth)
|
||||
cli.Transport = transport
|
||||
cli.User = user.New(transport, formats)
|
||||
|
||||
return cli
|
||||
}
|
||||
|
||||
|
|
@ -76,9 +76,11 @@ func DefaultTransportConfig() *TransportConfig {
|
|||
// TransportConfig contains the transport related info,
|
||||
// found in the meta section of the spec file.
|
||||
type TransportConfig struct {
|
||||
Host string
|
||||
BasePath string
|
||||
Schemes []string
|
||||
Host string
|
||||
BasePath string
|
||||
Schemes []string
|
||||
Producers map[string]runtime.Producer
|
||||
Consumers map[string]runtime.Consumer
|
||||
}
|
||||
|
||||
// WithHost overrides the default host,
|
||||
|
|
@ -102,15 +104,27 @@ func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig {
|
|||
return cfg
|
||||
}
|
||||
|
||||
// Auth is a client for auth
|
||||
// WithProducers overrides the default producers registered by [httptransport.Runtime].
|
||||
func (cfg *TransportConfig) WithProducers(producers map[string]runtime.Producer) *TransportConfig {
|
||||
cfg.Producers = producers
|
||||
return cfg
|
||||
}
|
||||
|
||||
// WithConsumers overrides the default consumers registered by [httptransport.Runtime].
|
||||
func (cfg *TransportConfig) WithConsumers(consumers map[string]runtime.Consumer) *TransportConfig {
|
||||
cfg.Consumers = consumers
|
||||
return cfg
|
||||
}
|
||||
|
||||
// Auth is a client for auth.
|
||||
type Auth struct {
|
||||
User user.ClientService
|
||||
|
||||
Transport runtime.ClientTransport
|
||||
Transport runtime.ContextualTransport
|
||||
}
|
||||
|
||||
// SetTransport changes the transport on the client and all its subresources
|
||||
func (c *Auth) SetTransport(transport runtime.ClientTransport) {
|
||||
// SetTransport changes the transport on the client and all its subresources.
|
||||
func (c *Auth) SetTransport(transport runtime.ContextualTransport) {
|
||||
c.Transport = transport
|
||||
c.User.SetTransport(transport)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,9 +6,6 @@
|
|||
|
||||
package user
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
|
@ -27,24 +24,28 @@ import (
|
|||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewGetUsersParams() *GetUsersParams {
|
||||
return &GetUsersParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
return NewGetUsersParamsWithTimeout(cr.DefaultTimeout)
|
||||
}
|
||||
|
||||
// NewGetUsersParamsWithTimeout creates a new GetUsersParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetUsersParamsWithTimeout(timeout time.Duration) *GetUsersParams {
|
||||
return &GetUsersParams{
|
||||
timeout: timeout,
|
||||
inner: innerParams{
|
||||
timeout: timeout,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetUsersParamsWithContext creates a new GetUsersParams object
|
||||
// with the ability to set a context for a request.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [GetUsersParams].
|
||||
func NewGetUsersParamsWithContext(ctx context.Context) *GetUsersParams {
|
||||
return &GetUsersParams{
|
||||
Context: ctx,
|
||||
inner: innerParams{
|
||||
ctx: ctx,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -65,15 +66,14 @@ GetUsersParams contains all the parameters to send to the API endpoint
|
|||
*/
|
||||
type GetUsersParams struct {
|
||||
|
||||
/* Apikey.
|
||||
|
||||
Service account or developer API key
|
||||
*/
|
||||
// Apikey.
|
||||
//
|
||||
// Service account or developer API key
|
||||
Apikey *string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
|
||||
inner innerParams
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get users params (not the query body).
|
||||
|
|
@ -91,54 +91,57 @@ func (o *GetUsersParams) SetDefaults() {
|
|||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get users params
|
||||
// WithTimeout adds the timeout to the get users params.
|
||||
func (o *GetUsersParams) WithTimeout(timeout time.Duration) *GetUsersParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get users params
|
||||
// SetTimeout adds the timeout to the get users params.
|
||||
func (o *GetUsersParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
o.inner.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get users params
|
||||
// WithContext adds the context to the get users params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [GetUsersParams].
|
||||
func (o *GetUsersParams) WithContext(ctx context.Context) *GetUsersParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get users params
|
||||
// SetContext adds the context to the get users params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [GetUsersParams].
|
||||
func (o *GetUsersParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
o.inner.ctx = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get users params
|
||||
// WithHTTPClient adds the HTTPClient to the get users params.
|
||||
func (o *GetUsersParams) WithHTTPClient(client *http.Client) *GetUsersParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get users params
|
||||
// SetHTTPClient adds the HTTPClient to the get users params.
|
||||
func (o *GetUsersParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithApikey adds the apikey to the get users params
|
||||
// WithApikey adds the apikey to the get users params.
|
||||
func (o *GetUsersParams) WithApikey(apikey *string) *GetUsersParams {
|
||||
o.SetApikey(apikey)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetApikey adds the apikey to the get users params
|
||||
// SetApikey adds the apikey to the get users params.
|
||||
func (o *GetUsersParams) SetApikey(apikey *string) {
|
||||
o.Apikey = apikey
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
// WriteToRequest writes these params to a [runtime.ClientRequest].
|
||||
func (o *GetUsersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
if err := r.SetTimeout(o.inner.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
|
|
|||
|
|
@ -6,17 +6,15 @@
|
|||
|
||||
package user
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
stderrors "errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/auth/auth_models"
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/auth/auth_models"
|
||||
)
|
||||
|
||||
// GetUsersReader is a Reader for the GetUsers structure.
|
||||
|
|
@ -25,7 +23,7 @@ type GetUsersReader struct {
|
|||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetUsersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
func (o *GetUsersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetUsersOK()
|
||||
|
|
@ -64,7 +62,7 @@ func (o *GetUsersReader) ReadResponse(response runtime.ClientResponse, consumer
|
|||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
return nil, runtime.NewAPIError("[GET /users] getUsers", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -73,11 +71,9 @@ func NewGetUsersOK() *GetUsersOK {
|
|||
return &GetUsersOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetUsersOK describes a response with status code 200, with default header values.
|
||||
|
||||
Response with User objects
|
||||
*/
|
||||
// GetUsersOK describes a response with status code 200, with default header values.
|
||||
//
|
||||
// Response with User objects
|
||||
type GetUsersOK struct {
|
||||
Payload *auth_models.UserResponse
|
||||
}
|
||||
|
|
@ -113,11 +109,13 @@ func (o *GetUsersOK) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetUsersOK) Error() string {
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *GetUsersOK) String() string {
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *GetUsersOK) GetPayload() *auth_models.UserResponse {
|
||||
|
|
@ -129,7 +127,7 @@ func (o *GetUsersOK) readResponse(response runtime.ClientResponse, consumer runt
|
|||
o.Payload = new(auth_models.UserResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -141,11 +139,9 @@ func NewGetUsersUnauthorized() *GetUsersUnauthorized {
|
|||
return &GetUsersUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetUsersUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
// GetUsersUnauthorized describes a response with status code 401, with default header values.
|
||||
//
|
||||
// Access Unauthorized, invalid API-KEY was used
|
||||
type GetUsersUnauthorized struct {
|
||||
Payload *auth_models.Error
|
||||
}
|
||||
|
|
@ -181,11 +177,13 @@ func (o *GetUsersUnauthorized) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetUsersUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *GetUsersUnauthorized) String() string {
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *GetUsersUnauthorized) GetPayload() *auth_models.Error {
|
||||
|
|
@ -197,7 +195,7 @@ func (o *GetUsersUnauthorized) readResponse(response runtime.ClientResponse, con
|
|||
o.Payload = new(auth_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -209,11 +207,9 @@ func NewGetUsersForbidden() *GetUsersForbidden {
|
|||
return &GetUsersForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetUsersForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
// GetUsersForbidden describes a response with status code 403, with default header values.
|
||||
//
|
||||
// Access forbidden, account lacks access
|
||||
type GetUsersForbidden struct {
|
||||
Payload *auth_models.Error
|
||||
}
|
||||
|
|
@ -249,11 +245,13 @@ func (o *GetUsersForbidden) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetUsersForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *GetUsersForbidden) String() string {
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *GetUsersForbidden) GetPayload() *auth_models.Error {
|
||||
|
|
@ -265,7 +263,7 @@ func (o *GetUsersForbidden) readResponse(response runtime.ClientResponse, consum
|
|||
o.Payload = new(auth_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -277,11 +275,9 @@ func NewGetUsersNotFound() *GetUsersNotFound {
|
|||
return &GetUsersNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetUsersNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
// GetUsersNotFound describes a response with status code 404, with default header values.
|
||||
//
|
||||
// Resource was not found
|
||||
type GetUsersNotFound struct {
|
||||
Payload *auth_models.Error
|
||||
}
|
||||
|
|
@ -317,11 +313,13 @@ func (o *GetUsersNotFound) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetUsersNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *GetUsersNotFound) String() string {
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *GetUsersNotFound) GetPayload() *auth_models.Error {
|
||||
|
|
@ -333,7 +331,7 @@ func (o *GetUsersNotFound) readResponse(response runtime.ClientResponse, consume
|
|||
o.Payload = new(auth_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -345,11 +343,9 @@ func NewGetUsersUnprocessableEntity() *GetUsersUnprocessableEntity {
|
|||
return &GetUsersUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetUsersUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
// GetUsersUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
//
|
||||
// Unprocessable Entity, likely a bad parameter
|
||||
type GetUsersUnprocessableEntity struct {
|
||||
Payload *auth_models.Error
|
||||
}
|
||||
|
|
@ -385,11 +381,13 @@ func (o *GetUsersUnprocessableEntity) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetUsersUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *GetUsersUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *GetUsersUnprocessableEntity) GetPayload() *auth_models.Error {
|
||||
|
|
@ -401,7 +399,7 @@ func (o *GetUsersUnprocessableEntity) readResponse(response runtime.ClientRespon
|
|||
o.Payload = new(auth_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -413,11 +411,9 @@ func NewGetUsersInternalServerError() *GetUsersInternalServerError {
|
|||
return &GetUsersInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetUsersInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
// GetUsersInternalServerError describes a response with status code 500, with default header values.
|
||||
//
|
||||
// Server Internal Error
|
||||
type GetUsersInternalServerError struct {
|
||||
Payload *auth_models.Error
|
||||
}
|
||||
|
|
@ -453,11 +449,13 @@ func (o *GetUsersInternalServerError) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetUsersInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *GetUsersInternalServerError) String() string {
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /users][%d] getUsersInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *GetUsersInternalServerError) GetPayload() *auth_models.Error {
|
||||
|
|
@ -469,7 +467,7 @@ func (o *GetUsersInternalServerError) readResponse(response runtime.ClientRespon
|
|||
o.Payload = new(auth_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,49 +6,99 @@
|
|||
|
||||
package user
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
httptransport "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// New creates a new user API client.
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||
func New(transport runtime.ContextualTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
/*
|
||||
Client for user API
|
||||
*/
|
||||
// New creates a new user API client with basic auth credentials.
|
||||
//
|
||||
// It takes the following parameters:
|
||||
// - host: http host (github.com).
|
||||
// - basePath: any base path for the API client ("/v1", "/v3").
|
||||
// - scheme: http scheme ("http", "https").
|
||||
// - user: user for basic authentication header.
|
||||
// - password: password for basic authentication header.
|
||||
func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService {
|
||||
transport := httptransport.New(host, basePath, []string{scheme})
|
||||
transport.DefaultAuthentication = httptransport.BasicAuth(user, password)
|
||||
return &Client{transport: transport, formats: strfmt.Default}
|
||||
}
|
||||
|
||||
// New creates a new user API client with a bearer token for authentication.
|
||||
//
|
||||
// It takes the following parameters:
|
||||
// - host: http host (github.com).
|
||||
// - basePath: any base path for the API client ("/v1", "/v3").
|
||||
// - scheme: http scheme ("http", "https").
|
||||
// - bearerToken: bearer token for Bearer authentication header.
|
||||
func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService {
|
||||
transport := httptransport.New(host, basePath, []string{scheme})
|
||||
transport.DefaultAuthentication = httptransport.BearerToken(bearerToken)
|
||||
return &Client{transport: transport, formats: strfmt.Default}
|
||||
}
|
||||
|
||||
// Client for user API.
|
||||
type Client struct {
|
||||
transport runtime.ClientTransport
|
||||
transport runtime.ContextualTransport
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ClientOption is the option for Client methods
|
||||
// ClientOption may be used to customize the behavior of Client methods.
|
||||
type ClientOption func(*runtime.ClientOperation)
|
||||
|
||||
// ClientService is the interface for Client methods
|
||||
// ClientService is the interface for Client methods.
|
||||
type ClientService interface {
|
||||
|
||||
// GetUsers check API key.
|
||||
GetUsers(params *GetUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetUsersOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
// GetUsersContext check API key.
|
||||
GetUsersContext(ctx context.Context, params *GetUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetUsersOK, error)
|
||||
|
||||
SetTransport(transport runtime.ContextualTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
GetUsers checks API key
|
||||
|
||||
Checks for a valid API key, and returns full user record
|
||||
*/
|
||||
// GetUsers checks API key.
|
||||
//
|
||||
// Checks for a valid API key, and returns full user record.
|
||||
//
|
||||
// This method does not support injected context.
|
||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||
//
|
||||
// If you need to pass a specific context, use [Client.GetUsersContext] instead.
|
||||
func (a *Client) GetUsers(params *GetUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetUsersOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
var ctx context.Context
|
||||
if params.inner.ctx != nil {
|
||||
ctx = params.inner.ctx
|
||||
} else {
|
||||
ctx = context.Background()
|
||||
}
|
||||
|
||||
return a.GetUsersContext(ctx, params, authInfo, opts...)
|
||||
}
|
||||
|
||||
// GetUsersContext checks API key.
|
||||
//
|
||||
// Checks for a valid API key, and returns full user record.
|
||||
//
|
||||
// Do not use the deprecated [GetUsersParams.Context] with this method: it would be ignored.
|
||||
func (a *Client) GetUsersContext(ctx context.Context, params *GetUsersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetUsersOK, error) {
|
||||
// NOTE: parameters are not validated before sending
|
||||
if params == nil {
|
||||
params = NewGetUsersParams()
|
||||
}
|
||||
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getUsers",
|
||||
Method: "GET",
|
||||
|
|
@ -59,28 +109,42 @@ func (a *Client) GetUsers(params *GetUsersParams, authInfo runtime.ClientAuthInf
|
|||
Params: params,
|
||||
Reader: &GetUsersReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
result, err := a.transport.SubmitContext(ctx, op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// only one success response has to be checked
|
||||
success, ok := result.(*GetUsersOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
|
||||
// unexpected success response.
|
||||
|
||||
// no default response is defined.
|
||||
//
|
||||
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for getUsers: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
// SetTransport changes the transport on the client
|
||||
func (a *Client) SetTransport(transport runtime.ClientTransport) {
|
||||
func (a *Client) SetTransport(transport runtime.ContextualTransport) {
|
||||
a.transport = transport
|
||||
}
|
||||
|
||||
// innerParams captures internal fields so they don't conflict with user-supplied parameters.
|
||||
type innerParams struct {
|
||||
timeout time.Duration
|
||||
|
||||
// Deprecated: use the operation call with context to pass the context instead of [UserParams].
|
||||
ctx context.Context
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,14 +6,11 @@
|
|||
|
||||
package auth_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"
|
||||
"github.com/go-openapi/swag/jsonutils"
|
||||
)
|
||||
|
||||
// Address address
|
||||
|
|
@ -58,13 +55,13 @@ func (m *Address) MarshalBinary() ([]byte, error) {
|
|||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
return jsonutils.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *Address) UnmarshalBinary(b []byte) error {
|
||||
var res Address
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
|
|
|
|||
|
|
@ -6,14 +6,11 @@
|
|||
|
||||
package auth_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"
|
||||
"github.com/go-openapi/swag/jsonutils"
|
||||
)
|
||||
|
||||
// Error error
|
||||
|
|
@ -46,13 +43,13 @@ func (m *Error) MarshalBinary() ([]byte, error) {
|
|||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
return jsonutils.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *Error) UnmarshalBinary(b []byte) error {
|
||||
var res Error
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
|
|
|
|||
|
|
@ -6,14 +6,11 @@
|
|||
|
||||
package auth_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"
|
||||
"github.com/go-openapi/swag/jsonutils"
|
||||
)
|
||||
|
||||
// ResponseMeta response meta
|
||||
|
|
@ -70,13 +67,13 @@ func (m *ResponseMeta) MarshalBinary() ([]byte, error) {
|
|||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
return jsonutils.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *ResponseMeta) UnmarshalBinary(b []byte) error {
|
||||
var res ResponseMeta
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
|
|
|
|||
|
|
@ -6,14 +6,11 @@
|
|||
|
||||
package auth_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"
|
||||
"github.com/go-openapi/swag/jsonutils"
|
||||
)
|
||||
|
||||
// TenantUser Relationship object that connects users to a tenant
|
||||
|
|
@ -85,13 +82,13 @@ func (m *TenantUser) MarshalBinary() ([]byte, error) {
|
|||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
return jsonutils.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *TenantUser) UnmarshalBinary(b []byte) error {
|
||||
var res TenantUser
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
|
|
|
|||
|
|
@ -6,16 +6,15 @@
|
|||
|
||||
package auth_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"
|
||||
stderrors "errors"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/swag/jsonutils"
|
||||
"github.com/go-openapi/swag/typeutils"
|
||||
)
|
||||
|
||||
// User user
|
||||
|
|
@ -149,6 +148,12 @@ type User struct {
|
|||
// Portal Role Level
|
||||
PortalRole string `json:"PortalRole,omitempty"`
|
||||
|
||||
// Stable machine principal key; empty for legacy human principals
|
||||
PrincipalKey string `json:"PrincipalKey,omitempty"`
|
||||
|
||||
// Principal type, currently service or legacy_user
|
||||
PrincipalType string `json:"PrincipalType,omitempty"`
|
||||
|
||||
// Profile
|
||||
ProfileID string `json:"ProfileID,omitempty"`
|
||||
|
||||
|
|
@ -158,6 +163,9 @@ type User struct {
|
|||
// Admin Info Emails
|
||||
ReceivesAdminInfoEmails bool `json:"ReceivesAdminInfoEmails,omitempty"`
|
||||
|
||||
// Explicit mesh authorization scopes; never contains credentials
|
||||
Scopes []string `json:"Scopes"`
|
||||
|
||||
// Email Sender Address
|
||||
SenderEmail string `json:"SenderEmail,omitempty"`
|
||||
|
||||
|
|
@ -221,17 +229,21 @@ func (m *User) Validate(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *User) validateAddress(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Address) { // not required
|
||||
if typeutils.IsZero(m.Address) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.Address != nil {
|
||||
if err := m.Address.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Address")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Address")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -240,22 +252,26 @@ func (m *User) validateAddress(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *User) validateTenantUsers(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.TenantUsers) { // not required
|
||||
if typeutils.IsZero(m.TenantUsers) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.TenantUsers); i++ {
|
||||
if swag.IsZero(m.TenantUsers[i]) { // not required
|
||||
if typeutils.IsZero(m.TenantUsers[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.TenantUsers[i] != nil {
|
||||
if err := m.TenantUsers[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("TenantUsers" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("TenantUsers" + "." + strconv.Itoa(i))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -266,22 +282,26 @@ func (m *User) validateTenantUsers(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *User) validateUserRoles(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.UserRoles) { // not required
|
||||
if typeutils.IsZero(m.UserRoles) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.UserRoles); i++ {
|
||||
if swag.IsZero(m.UserRoles[i]) { // not required
|
||||
if typeutils.IsZero(m.UserRoles[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.UserRoles[i] != nil {
|
||||
if err := m.UserRoles[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("UserRoles" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("UserRoles" + "." + strconv.Itoa(i))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -316,12 +336,21 @@ func (m *User) ContextValidate(ctx context.Context, formats strfmt.Registry) err
|
|||
func (m *User) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Address != nil {
|
||||
|
||||
if typeutils.IsZero(m.Address) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Address.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Address")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Address")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -334,12 +363,21 @@ func (m *User) contextValidateTenantUsers(ctx context.Context, formats strfmt.Re
|
|||
for i := 0; i < len(m.TenantUsers); i++ {
|
||||
|
||||
if m.TenantUsers[i] != nil {
|
||||
|
||||
if typeutils.IsZero(m.TenantUsers[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.TenantUsers[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("TenantUsers" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("TenantUsers" + "." + strconv.Itoa(i))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -354,12 +392,21 @@ func (m *User) contextValidateUserRoles(ctx context.Context, formats strfmt.Regi
|
|||
for i := 0; i < len(m.UserRoles); i++ {
|
||||
|
||||
if m.UserRoles[i] != nil {
|
||||
|
||||
if typeutils.IsZero(m.UserRoles[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.UserRoles[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("UserRoles" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("UserRoles" + "." + strconv.Itoa(i))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -374,13 +421,13 @@ func (m *User) MarshalBinary() ([]byte, error) {
|
|||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
return jsonutils.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *User) UnmarshalBinary(b []byte) error {
|
||||
var res User
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
|
|
|
|||
|
|
@ -6,16 +6,15 @@
|
|||
|
||||
package auth_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"
|
||||
stderrors "errors"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/swag/jsonutils"
|
||||
"github.com/go-openapi/swag/typeutils"
|
||||
)
|
||||
|
||||
// UserResponse An array Taxnexus user objects
|
||||
|
|
@ -49,22 +48,26 @@ func (m *UserResponse) Validate(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *UserResponse) validateData(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Data) { // not required
|
||||
if typeutils.IsZero(m.Data) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Data); i++ {
|
||||
if swag.IsZero(m.Data[i]) { // not required
|
||||
if typeutils.IsZero(m.Data[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Data[i] != nil {
|
||||
if err := m.Data[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -75,17 +78,21 @@ func (m *UserResponse) validateData(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *UserResponse) validateMeta(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Meta) { // not required
|
||||
if typeutils.IsZero(m.Meta) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.Meta != nil {
|
||||
if err := m.Meta.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Meta")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Meta")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -116,12 +123,21 @@ func (m *UserResponse) contextValidateData(ctx context.Context, formats strfmt.R
|
|||
for i := 0; i < len(m.Data); i++ {
|
||||
|
||||
if m.Data[i] != nil {
|
||||
|
||||
if typeutils.IsZero(m.Data[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -134,12 +150,21 @@ func (m *UserResponse) contextValidateData(ctx context.Context, formats strfmt.R
|
|||
func (m *UserResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Meta != nil {
|
||||
|
||||
if typeutils.IsZero(m.Meta) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Meta.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Meta")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Meta")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -152,13 +177,13 @@ func (m *UserResponse) MarshalBinary() ([]byte, error) {
|
|||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
return jsonutils.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *UserResponse) UnmarshalBinary(b []byte) error {
|
||||
var res UserResponse
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
|
|
|
|||
|
|
@ -6,14 +6,11 @@
|
|||
|
||||
package auth_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"
|
||||
"github.com/go-openapi/swag/jsonutils"
|
||||
)
|
||||
|
||||
// UserRole Relationship object that connects user to a role
|
||||
|
|
@ -76,13 +73,13 @@ func (m *UserRole) MarshalBinary() ([]byte, error) {
|
|||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
return jsonutils.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *UserRole) UnmarshalBinary(b []byte) error {
|
||||
var res UserRole
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
|
|
|
|||
|
|
@ -6,55 +6,117 @@
|
|||
|
||||
package accounts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
httptransport "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// New creates a new accounts API client.
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||
func New(transport runtime.ContextualTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
/*
|
||||
Client for accounts API
|
||||
*/
|
||||
// New creates a new accounts API client with basic auth credentials.
|
||||
//
|
||||
// It takes the following parameters:
|
||||
// - host: http host (github.com).
|
||||
// - basePath: any base path for the API client ("/v1", "/v3").
|
||||
// - scheme: http scheme ("http", "https").
|
||||
// - user: user for basic authentication header.
|
||||
// - password: password for basic authentication header.
|
||||
func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService {
|
||||
transport := httptransport.New(host, basePath, []string{scheme})
|
||||
transport.DefaultAuthentication = httptransport.BasicAuth(user, password)
|
||||
return &Client{transport: transport, formats: strfmt.Default}
|
||||
}
|
||||
|
||||
// New creates a new accounts API client with a bearer token for authentication.
|
||||
//
|
||||
// It takes the following parameters:
|
||||
// - host: http host (github.com).
|
||||
// - basePath: any base path for the API client ("/v1", "/v3").
|
||||
// - scheme: http scheme ("http", "https").
|
||||
// - bearerToken: bearer token for Bearer authentication header.
|
||||
func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService {
|
||||
transport := httptransport.New(host, basePath, []string{scheme})
|
||||
transport.DefaultAuthentication = httptransport.BearerToken(bearerToken)
|
||||
return &Client{transport: transport, formats: strfmt.Default}
|
||||
}
|
||||
|
||||
// Client for accounts API.
|
||||
type Client struct {
|
||||
transport runtime.ClientTransport
|
||||
transport runtime.ContextualTransport
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ClientOption is the option for Client methods
|
||||
// ClientOption may be used to customize the behavior of Client methods.
|
||||
type ClientOption func(*runtime.ClientOperation)
|
||||
|
||||
// ClientService is the interface for Client methods
|
||||
// ClientService is the interface for Client methods.
|
||||
type ClientService interface {
|
||||
|
||||
// DeleteAccount delete an account.
|
||||
DeleteAccount(params *DeleteAccountParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAccountOK, error)
|
||||
|
||||
// DeleteAccountContext delete an account.
|
||||
DeleteAccountContext(ctx context.Context, params *DeleteAccountParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAccountOK, error)
|
||||
|
||||
// GetAccounts get a list of accounts.
|
||||
GetAccounts(params *GetAccountsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountsOK, error)
|
||||
|
||||
// GetAccountsContext get a list of accounts.
|
||||
GetAccountsContext(ctx context.Context, params *GetAccountsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountsOK, error)
|
||||
|
||||
// PostAccounts add a new account to salesforce devops net.
|
||||
PostAccounts(params *PostAccountsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAccountsOK, error)
|
||||
|
||||
// PostAccountsContext add a new account to salesforce devops net.
|
||||
PostAccountsContext(ctx context.Context, params *PostAccountsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAccountsOK, error)
|
||||
|
||||
// PutAccounts update a single account.
|
||||
PutAccounts(params *PutAccountsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutAccountsOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
// PutAccountsContext update a single account.
|
||||
PutAccountsContext(ctx context.Context, params *PutAccountsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutAccountsOK, error)
|
||||
|
||||
SetTransport(transport runtime.ContextualTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAccount deletes an account
|
||||
|
||||
Delete SalesforceDevops.net Account record
|
||||
*/
|
||||
// DeleteAccount deletes an account.
|
||||
//
|
||||
// Delete SalesforceDevops.net Account record.
|
||||
//
|
||||
// This method does not support injected context.
|
||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||
//
|
||||
// If you need to pass a specific context, use [Client.DeleteAccountContext] instead.
|
||||
func (a *Client) DeleteAccount(params *DeleteAccountParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAccountOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
var ctx context.Context
|
||||
if params.inner.ctx != nil {
|
||||
ctx = params.inner.ctx
|
||||
} else {
|
||||
ctx = context.Background()
|
||||
}
|
||||
|
||||
return a.DeleteAccountContext(ctx, params, authInfo, opts...)
|
||||
}
|
||||
|
||||
// DeleteAccountContext deletes an account.
|
||||
//
|
||||
// Delete SalesforceDevops.net Account record.
|
||||
//
|
||||
// Do not use the deprecated [DeleteAccountParams.Context] with this method: it would be ignored.
|
||||
func (a *Client) DeleteAccountContext(ctx context.Context, params *DeleteAccountParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAccountOK, error) {
|
||||
// NOTE: parameters are not validated before sending
|
||||
if params == nil {
|
||||
params = NewDeleteAccountParams()
|
||||
}
|
||||
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "deleteAccount",
|
||||
Method: "DELETE",
|
||||
|
|
@ -65,37 +127,63 @@ func (a *Client) DeleteAccount(params *DeleteAccountParams, authInfo runtime.Cli
|
|||
Params: params,
|
||||
Reader: &DeleteAccountReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
result, err := a.transport.SubmitContext(ctx, op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// only one success response has to be checked
|
||||
success, ok := result.(*DeleteAccountOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
|
||||
// unexpected success response.
|
||||
|
||||
// no default response is defined.
|
||||
//
|
||||
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for deleteAccount: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetAccounts gets a list of accounts
|
||||
|
||||
Return a list of all available Accounts
|
||||
*/
|
||||
// GetAccounts gets a list of accounts.
|
||||
//
|
||||
// Return a list of all available Accounts.
|
||||
//
|
||||
// This method does not support injected context.
|
||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||
//
|
||||
// If you need to pass a specific context, use [Client.GetAccountsContext] instead.
|
||||
func (a *Client) GetAccounts(params *GetAccountsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
var ctx context.Context
|
||||
if params.inner.ctx != nil {
|
||||
ctx = params.inner.ctx
|
||||
} else {
|
||||
ctx = context.Background()
|
||||
}
|
||||
|
||||
return a.GetAccountsContext(ctx, params, authInfo, opts...)
|
||||
}
|
||||
|
||||
// GetAccountsContext gets a list of accounts.
|
||||
//
|
||||
// Return a list of all available Accounts.
|
||||
//
|
||||
// Do not use the deprecated [GetAccountsParams.Context] with this method: it would be ignored.
|
||||
func (a *Client) GetAccountsContext(ctx context.Context, params *GetAccountsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAccountsOK, error) {
|
||||
// NOTE: parameters are not validated before sending
|
||||
if params == nil {
|
||||
params = NewGetAccountsParams()
|
||||
}
|
||||
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getAccounts",
|
||||
Method: "GET",
|
||||
|
|
@ -106,37 +194,63 @@ func (a *Client) GetAccounts(params *GetAccountsParams, authInfo runtime.ClientA
|
|||
Params: params,
|
||||
Reader: &GetAccountsReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
result, err := a.transport.SubmitContext(ctx, op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// only one success response has to be checked
|
||||
success, ok := result.(*GetAccountsOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
|
||||
// unexpected success response.
|
||||
|
||||
// no default response is defined.
|
||||
//
|
||||
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for getAccounts: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostAccounts adds a new account to salesforce devops net
|
||||
|
||||
Account record to be added
|
||||
*/
|
||||
// PostAccounts adds a new account to salesforce devops net.
|
||||
//
|
||||
// Account record to be added.
|
||||
//
|
||||
// This method does not support injected context.
|
||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||
//
|
||||
// If you need to pass a specific context, use [Client.PostAccountsContext] instead.
|
||||
func (a *Client) PostAccounts(params *PostAccountsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAccountsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
var ctx context.Context
|
||||
if params.inner.ctx != nil {
|
||||
ctx = params.inner.ctx
|
||||
} else {
|
||||
ctx = context.Background()
|
||||
}
|
||||
|
||||
return a.PostAccountsContext(ctx, params, authInfo, opts...)
|
||||
}
|
||||
|
||||
// PostAccountsContext adds a new account to salesforce devops net.
|
||||
//
|
||||
// Account record to be added.
|
||||
//
|
||||
// Do not use the deprecated [PostAccountsParams.Context] with this method: it would be ignored.
|
||||
func (a *Client) PostAccountsContext(ctx context.Context, params *PostAccountsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAccountsOK, error) {
|
||||
// NOTE: parameters are not validated before sending
|
||||
if params == nil {
|
||||
params = NewPostAccountsParams()
|
||||
}
|
||||
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "postAccounts",
|
||||
Method: "POST",
|
||||
|
|
@ -147,37 +261,63 @@ func (a *Client) PostAccounts(params *PostAccountsParams, authInfo runtime.Clien
|
|||
Params: params,
|
||||
Reader: &PostAccountsReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
result, err := a.transport.SubmitContext(ctx, op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// only one success response has to be checked
|
||||
success, ok := result.(*PostAccountsOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
|
||||
// unexpected success response.
|
||||
|
||||
// no default response is defined.
|
||||
//
|
||||
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for postAccounts: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PutAccounts updates a single account
|
||||
|
||||
Update one or more accounts
|
||||
*/
|
||||
// PutAccounts updates a single account.
|
||||
//
|
||||
// Update one or more accounts.
|
||||
//
|
||||
// This method does not support injected context.
|
||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||
//
|
||||
// If you need to pass a specific context, use [Client.PutAccountsContext] instead.
|
||||
func (a *Client) PutAccounts(params *PutAccountsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutAccountsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
var ctx context.Context
|
||||
if params.inner.ctx != nil {
|
||||
ctx = params.inner.ctx
|
||||
} else {
|
||||
ctx = context.Background()
|
||||
}
|
||||
|
||||
return a.PutAccountsContext(ctx, params, authInfo, opts...)
|
||||
}
|
||||
|
||||
// PutAccountsContext updates a single account.
|
||||
//
|
||||
// Update one or more accounts.
|
||||
//
|
||||
// Do not use the deprecated [PutAccountsParams.Context] with this method: it would be ignored.
|
||||
func (a *Client) PutAccountsContext(ctx context.Context, params *PutAccountsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutAccountsOK, error) {
|
||||
// NOTE: parameters are not validated before sending
|
||||
if params == nil {
|
||||
params = NewPutAccountsParams()
|
||||
}
|
||||
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "putAccounts",
|
||||
Method: "PUT",
|
||||
|
|
@ -188,28 +328,42 @@ func (a *Client) PutAccounts(params *PutAccountsParams, authInfo runtime.ClientA
|
|||
Params: params,
|
||||
Reader: &PutAccountsReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
result, err := a.transport.SubmitContext(ctx, op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// only one success response has to be checked
|
||||
success, ok := result.(*PutAccountsOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
|
||||
// unexpected success response.
|
||||
|
||||
// no default response is defined.
|
||||
//
|
||||
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for putAccounts: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
// SetTransport changes the transport on the client
|
||||
func (a *Client) SetTransport(transport runtime.ClientTransport) {
|
||||
func (a *Client) SetTransport(transport runtime.ContextualTransport) {
|
||||
a.transport = transport
|
||||
}
|
||||
|
||||
// innerParams captures internal fields so they don't conflict with user-supplied parameters.
|
||||
type innerParams struct {
|
||||
timeout time.Duration
|
||||
|
||||
// Deprecated: use the operation call with context to pass the context instead of [AccountsParams].
|
||||
ctx context.Context
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,9 +6,6 @@
|
|||
|
||||
package accounts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
|
@ -27,24 +24,28 @@ import (
|
|||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewDeleteAccountParams() *DeleteAccountParams {
|
||||
return &DeleteAccountParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
return NewDeleteAccountParamsWithTimeout(cr.DefaultTimeout)
|
||||
}
|
||||
|
||||
// NewDeleteAccountParamsWithTimeout creates a new DeleteAccountParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewDeleteAccountParamsWithTimeout(timeout time.Duration) *DeleteAccountParams {
|
||||
return &DeleteAccountParams{
|
||||
timeout: timeout,
|
||||
inner: innerParams{
|
||||
timeout: timeout,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAccountParamsWithContext creates a new DeleteAccountParams object
|
||||
// with the ability to set a context for a request.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [DeleteAccountParams].
|
||||
func NewDeleteAccountParamsWithContext(ctx context.Context) *DeleteAccountParams {
|
||||
return &DeleteAccountParams{
|
||||
Context: ctx,
|
||||
inner: innerParams{
|
||||
ctx: ctx,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -65,15 +66,14 @@ DeleteAccountParams contains all the parameters to send to the API endpoint
|
|||
*/
|
||||
type DeleteAccountParams struct {
|
||||
|
||||
/* AccountID.
|
||||
|
||||
Record Id of an Account
|
||||
*/
|
||||
// AccountID.
|
||||
//
|
||||
// Record Id of an Account
|
||||
AccountID *string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
|
||||
inner innerParams
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the delete account params (not the query body).
|
||||
|
|
@ -91,54 +91,57 @@ func (o *DeleteAccountParams) SetDefaults() {
|
|||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the delete account params
|
||||
// WithTimeout adds the timeout to the delete account params.
|
||||
func (o *DeleteAccountParams) WithTimeout(timeout time.Duration) *DeleteAccountParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the delete account params
|
||||
// SetTimeout adds the timeout to the delete account params.
|
||||
func (o *DeleteAccountParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
o.inner.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the delete account params
|
||||
// WithContext adds the context to the delete account params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [DeleteAccountParams].
|
||||
func (o *DeleteAccountParams) WithContext(ctx context.Context) *DeleteAccountParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the delete account params
|
||||
// SetContext adds the context to the delete account params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [DeleteAccountParams].
|
||||
func (o *DeleteAccountParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
o.inner.ctx = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the delete account params
|
||||
// WithHTTPClient adds the HTTPClient to the delete account params.
|
||||
func (o *DeleteAccountParams) WithHTTPClient(client *http.Client) *DeleteAccountParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the delete account params
|
||||
// SetHTTPClient adds the HTTPClient to the delete account params.
|
||||
func (o *DeleteAccountParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithAccountID adds the accountID to the delete account params
|
||||
// WithAccountID adds the accountID to the delete account params.
|
||||
func (o *DeleteAccountParams) WithAccountID(accountID *string) *DeleteAccountParams {
|
||||
o.SetAccountID(accountID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetAccountID adds the accountId to the delete account params
|
||||
// SetAccountID adds the accountId to the delete account params.
|
||||
func (o *DeleteAccountParams) SetAccountID(accountID *string) {
|
||||
o.AccountID = accountID
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
// WriteToRequest writes these params to a [runtime.ClientRequest].
|
||||
func (o *DeleteAccountParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
if err := r.SetTimeout(o.inner.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
|
|
|||
|
|
@ -6,17 +6,15 @@
|
|||
|
||||
package accounts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
stderrors "errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// DeleteAccountReader is a Reader for the DeleteAccount structure.
|
||||
|
|
@ -25,7 +23,7 @@ type DeleteAccountReader struct {
|
|||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *DeleteAccountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
func (o *DeleteAccountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewDeleteAccountOK()
|
||||
|
|
@ -64,7 +62,7 @@ func (o *DeleteAccountReader) ReadResponse(response runtime.ClientResponse, cons
|
|||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
return nil, runtime.NewAPIError("[DELETE /accounts] deleteAccount", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -73,11 +71,9 @@ func NewDeleteAccountOK() *DeleteAccountOK {
|
|||
return &DeleteAccountOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAccountOK describes a response with status code 200, with default header values.
|
||||
|
||||
Response with Message Objects with Delete Status
|
||||
*/
|
||||
// DeleteAccountOK describes a response with status code 200, with default header values.
|
||||
//
|
||||
// Response with Message Objects with Delete Status
|
||||
type DeleteAccountOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -115,11 +111,13 @@ func (o *DeleteAccountOK) Code() int {
|
|||
}
|
||||
|
||||
func (o *DeleteAccountOK) Error() string {
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAccountOK) String() string {
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAccountOK) GetPayload() *crm_models.DeleteResponse {
|
||||
|
|
@ -138,7 +136,7 @@ func (o *DeleteAccountOK) readResponse(response runtime.ClientResponse, consumer
|
|||
o.Payload = new(crm_models.DeleteResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -150,11 +148,9 @@ func NewDeleteAccountUnauthorized() *DeleteAccountUnauthorized {
|
|||
return &DeleteAccountUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAccountUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
// DeleteAccountUnauthorized describes a response with status code 401, with default header values.
|
||||
//
|
||||
// Access unauthorized, invalid API-KEY was used
|
||||
type DeleteAccountUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -192,11 +188,13 @@ func (o *DeleteAccountUnauthorized) Code() int {
|
|||
}
|
||||
|
||||
func (o *DeleteAccountUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAccountUnauthorized) String() string {
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAccountUnauthorized) GetPayload() *crm_models.Error {
|
||||
|
|
@ -215,7 +213,7 @@ func (o *DeleteAccountUnauthorized) readResponse(response runtime.ClientResponse
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -227,11 +225,9 @@ func NewDeleteAccountForbidden() *DeleteAccountForbidden {
|
|||
return &DeleteAccountForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAccountForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
// DeleteAccountForbidden describes a response with status code 403, with default header values.
|
||||
//
|
||||
// Access forbidden, account lacks access
|
||||
type DeleteAccountForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -269,11 +265,13 @@ func (o *DeleteAccountForbidden) Code() int {
|
|||
}
|
||||
|
||||
func (o *DeleteAccountForbidden) Error() string {
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAccountForbidden) String() string {
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAccountForbidden) GetPayload() *crm_models.Error {
|
||||
|
|
@ -292,7 +290,7 @@ func (o *DeleteAccountForbidden) readResponse(response runtime.ClientResponse, c
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -304,11 +302,9 @@ func NewDeleteAccountNotFound() *DeleteAccountNotFound {
|
|||
return &DeleteAccountNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAccountNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
// DeleteAccountNotFound describes a response with status code 404, with default header values.
|
||||
//
|
||||
// Resource was not found
|
||||
type DeleteAccountNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -346,11 +342,13 @@ func (o *DeleteAccountNotFound) Code() int {
|
|||
}
|
||||
|
||||
func (o *DeleteAccountNotFound) Error() string {
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAccountNotFound) String() string {
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAccountNotFound) GetPayload() *crm_models.Error {
|
||||
|
|
@ -369,7 +367,7 @@ func (o *DeleteAccountNotFound) readResponse(response runtime.ClientResponse, co
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -381,11 +379,9 @@ func NewDeleteAccountUnprocessableEntity() *DeleteAccountUnprocessableEntity {
|
|||
return &DeleteAccountUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAccountUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
// DeleteAccountUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
//
|
||||
// Unprocessable Entity, likely a bad parameter
|
||||
type DeleteAccountUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -423,11 +419,13 @@ func (o *DeleteAccountUnprocessableEntity) Code() int {
|
|||
}
|
||||
|
||||
func (o *DeleteAccountUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAccountUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAccountUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
|
|
@ -446,7 +444,7 @@ func (o *DeleteAccountUnprocessableEntity) readResponse(response runtime.ClientR
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -458,11 +456,9 @@ func NewDeleteAccountInternalServerError() *DeleteAccountInternalServerError {
|
|||
return &DeleteAccountInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAccountInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
// DeleteAccountInternalServerError describes a response with status code 500, with default header values.
|
||||
//
|
||||
// Server Internal Error
|
||||
type DeleteAccountInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -500,11 +496,13 @@ func (o *DeleteAccountInternalServerError) Code() int {
|
|||
}
|
||||
|
||||
func (o *DeleteAccountInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAccountInternalServerError) String() string {
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /accounts][%d] deleteAccountInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAccountInternalServerError) GetPayload() *crm_models.Error {
|
||||
|
|
@ -523,7 +521,7 @@ func (o *DeleteAccountInternalServerError) readResponse(response runtime.ClientR
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,9 +6,6 @@
|
|||
|
||||
package accounts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
|
@ -18,7 +15,7 @@ import (
|
|||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/swag/conv"
|
||||
)
|
||||
|
||||
// NewGetAccountsParams creates a new GetAccountsParams object,
|
||||
|
|
@ -28,24 +25,28 @@ import (
|
|||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewGetAccountsParams() *GetAccountsParams {
|
||||
return &GetAccountsParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
return NewGetAccountsParamsWithTimeout(cr.DefaultTimeout)
|
||||
}
|
||||
|
||||
// NewGetAccountsParamsWithTimeout creates a new GetAccountsParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetAccountsParamsWithTimeout(timeout time.Duration) *GetAccountsParams {
|
||||
return &GetAccountsParams{
|
||||
timeout: timeout,
|
||||
inner: innerParams{
|
||||
timeout: timeout,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAccountsParamsWithContext creates a new GetAccountsParams object
|
||||
// with the ability to set a context for a request.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [GetAccountsParams].
|
||||
func NewGetAccountsParamsWithContext(ctx context.Context) *GetAccountsParams {
|
||||
return &GetAccountsParams{
|
||||
Context: ctx,
|
||||
inner: innerParams{
|
||||
ctx: ctx,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -66,49 +67,43 @@ GetAccountsParams contains all the parameters to send to the API endpoint
|
|||
*/
|
||||
type GetAccountsParams struct {
|
||||
|
||||
/* AccountID.
|
||||
|
||||
Record Id of an Account
|
||||
*/
|
||||
// AccountID.
|
||||
//
|
||||
// Record Id of an Account
|
||||
AccountID *string
|
||||
|
||||
/* Active.
|
||||
|
||||
Only retrieve active records?
|
||||
*/
|
||||
// Active.
|
||||
//
|
||||
// Only retrieve active records?
|
||||
Active *bool
|
||||
|
||||
/* Limit.
|
||||
|
||||
How many objects to return at one time
|
||||
|
||||
Format: int64
|
||||
*/
|
||||
// Limit.
|
||||
//
|
||||
// How many objects to return at one time
|
||||
//
|
||||
// Format: int64
|
||||
Limit *int64
|
||||
|
||||
/* Name.
|
||||
|
||||
The Name of this Object
|
||||
*/
|
||||
// Name.
|
||||
//
|
||||
// The Name of this Object
|
||||
Name *string
|
||||
|
||||
/* Offset.
|
||||
|
||||
How many objects to skip?
|
||||
|
||||
Format: int64
|
||||
*/
|
||||
// Offset.
|
||||
//
|
||||
// How many objects to skip?
|
||||
//
|
||||
// Format: int64
|
||||
Offset *int64
|
||||
|
||||
/* Slug.
|
||||
|
||||
The Slug of this Object
|
||||
*/
|
||||
// Slug.
|
||||
//
|
||||
// The Slug of this Object
|
||||
Slug *string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
|
||||
inner innerParams
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get accounts params (not the query body).
|
||||
|
|
@ -126,109 +121,112 @@ func (o *GetAccountsParams) SetDefaults() {
|
|||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get accounts params
|
||||
// WithTimeout adds the timeout to the get accounts params.
|
||||
func (o *GetAccountsParams) WithTimeout(timeout time.Duration) *GetAccountsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get accounts params
|
||||
// SetTimeout adds the timeout to the get accounts params.
|
||||
func (o *GetAccountsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
o.inner.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get accounts params
|
||||
// WithContext adds the context to the get accounts params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [GetAccountsParams].
|
||||
func (o *GetAccountsParams) WithContext(ctx context.Context) *GetAccountsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get accounts params
|
||||
// SetContext adds the context to the get accounts params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [GetAccountsParams].
|
||||
func (o *GetAccountsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
o.inner.ctx = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get accounts params
|
||||
// WithHTTPClient adds the HTTPClient to the get accounts params.
|
||||
func (o *GetAccountsParams) WithHTTPClient(client *http.Client) *GetAccountsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get accounts params
|
||||
// SetHTTPClient adds the HTTPClient to the get accounts params.
|
||||
func (o *GetAccountsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithAccountID adds the accountID to the get accounts params
|
||||
// WithAccountID adds the accountID to the get accounts params.
|
||||
func (o *GetAccountsParams) WithAccountID(accountID *string) *GetAccountsParams {
|
||||
o.SetAccountID(accountID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetAccountID adds the accountId to the get accounts params
|
||||
// SetAccountID adds the accountId to the get accounts params.
|
||||
func (o *GetAccountsParams) SetAccountID(accountID *string) {
|
||||
o.AccountID = accountID
|
||||
}
|
||||
|
||||
// WithActive adds the active to the get accounts params
|
||||
// WithActive adds the active to the get accounts params.
|
||||
func (o *GetAccountsParams) WithActive(active *bool) *GetAccountsParams {
|
||||
o.SetActive(active)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetActive adds the active to the get accounts params
|
||||
// SetActive adds the active to the get accounts params.
|
||||
func (o *GetAccountsParams) SetActive(active *bool) {
|
||||
o.Active = active
|
||||
}
|
||||
|
||||
// WithLimit adds the limit to the get accounts params
|
||||
// WithLimit adds the limit to the get accounts params.
|
||||
func (o *GetAccountsParams) WithLimit(limit *int64) *GetAccountsParams {
|
||||
o.SetLimit(limit)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetLimit adds the limit to the get accounts params
|
||||
// SetLimit adds the limit to the get accounts params.
|
||||
func (o *GetAccountsParams) SetLimit(limit *int64) {
|
||||
o.Limit = limit
|
||||
}
|
||||
|
||||
// WithName adds the name to the get accounts params
|
||||
// WithName adds the name to the get accounts params.
|
||||
func (o *GetAccountsParams) WithName(name *string) *GetAccountsParams {
|
||||
o.SetName(name)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetName adds the name to the get accounts params
|
||||
// SetName adds the name to the get accounts params.
|
||||
func (o *GetAccountsParams) SetName(name *string) {
|
||||
o.Name = name
|
||||
}
|
||||
|
||||
// WithOffset adds the offset to the get accounts params
|
||||
// WithOffset adds the offset to the get accounts params.
|
||||
func (o *GetAccountsParams) WithOffset(offset *int64) *GetAccountsParams {
|
||||
o.SetOffset(offset)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetOffset adds the offset to the get accounts params
|
||||
// SetOffset adds the offset to the get accounts params.
|
||||
func (o *GetAccountsParams) SetOffset(offset *int64) {
|
||||
o.Offset = offset
|
||||
}
|
||||
|
||||
// WithSlug adds the slug to the get accounts params
|
||||
// WithSlug adds the slug to the get accounts params.
|
||||
func (o *GetAccountsParams) WithSlug(slug *string) *GetAccountsParams {
|
||||
o.SetSlug(slug)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetSlug adds the slug to the get accounts params
|
||||
// SetSlug adds the slug to the get accounts params.
|
||||
func (o *GetAccountsParams) SetSlug(slug *string) {
|
||||
o.Slug = slug
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
// WriteToRequest writes these params to a [runtime.ClientRequest].
|
||||
func (o *GetAccountsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
if err := r.SetTimeout(o.inner.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
|
@ -258,7 +256,7 @@ func (o *GetAccountsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R
|
|||
if o.Active != nil {
|
||||
qrActive = *o.Active
|
||||
}
|
||||
qActive := swag.FormatBool(qrActive)
|
||||
qActive := conv.FormatBool(qrActive)
|
||||
if qActive != "" {
|
||||
|
||||
if err := r.SetQueryParam("active", qActive); err != nil {
|
||||
|
|
@ -275,7 +273,7 @@ func (o *GetAccountsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R
|
|||
if o.Limit != nil {
|
||||
qrLimit = *o.Limit
|
||||
}
|
||||
qLimit := swag.FormatInt64(qrLimit)
|
||||
qLimit := conv.FormatInteger(qrLimit)
|
||||
if qLimit != "" {
|
||||
|
||||
if err := r.SetQueryParam("limit", qLimit); err != nil {
|
||||
|
|
@ -309,7 +307,7 @@ func (o *GetAccountsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R
|
|||
if o.Offset != nil {
|
||||
qrOffset = *o.Offset
|
||||
}
|
||||
qOffset := swag.FormatInt64(qrOffset)
|
||||
qOffset := conv.FormatInteger(qrOffset)
|
||||
if qOffset != "" {
|
||||
|
||||
if err := r.SetQueryParam("offset", qOffset); err != nil {
|
||||
|
|
|
|||
|
|
@ -6,17 +6,15 @@
|
|||
|
||||
package accounts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
stderrors "errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// GetAccountsReader is a Reader for the GetAccounts structure.
|
||||
|
|
@ -25,7 +23,7 @@ type GetAccountsReader struct {
|
|||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetAccountsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
func (o *GetAccountsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetAccountsOK()
|
||||
|
|
@ -64,7 +62,7 @@ func (o *GetAccountsReader) ReadResponse(response runtime.ClientResponse, consum
|
|||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
return nil, runtime.NewAPIError("[GET /accounts] getAccounts", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -73,11 +71,9 @@ func NewGetAccountsOK() *GetAccountsOK {
|
|||
return &GetAccountsOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAccountsOK describes a response with status code 200, with default header values.
|
||||
|
||||
Response with Account objects with Contacts
|
||||
*/
|
||||
// GetAccountsOK describes a response with status code 200, with default header values.
|
||||
//
|
||||
// Response with Account objects with Contacts
|
||||
type GetAccountsOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
CacheControl string
|
||||
|
|
@ -116,11 +112,13 @@ func (o *GetAccountsOK) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetAccountsOK) Error() string {
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsOK) String() string {
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsOK) GetPayload() *crm_models.AccountResponse {
|
||||
|
|
@ -146,7 +144,7 @@ func (o *GetAccountsOK) readResponse(response runtime.ClientResponse, consumer r
|
|||
o.Payload = new(crm_models.AccountResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -158,11 +156,9 @@ func NewGetAccountsUnauthorized() *GetAccountsUnauthorized {
|
|||
return &GetAccountsUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAccountsUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
// GetAccountsUnauthorized describes a response with status code 401, with default header values.
|
||||
//
|
||||
// Access unauthorized, invalid API-KEY was used
|
||||
type GetAccountsUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -200,11 +196,13 @@ func (o *GetAccountsUnauthorized) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetAccountsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsUnauthorized) String() string {
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsUnauthorized) GetPayload() *crm_models.Error {
|
||||
|
|
@ -223,7 +221,7 @@ func (o *GetAccountsUnauthorized) readResponse(response runtime.ClientResponse,
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -235,11 +233,9 @@ func NewGetAccountsForbidden() *GetAccountsForbidden {
|
|||
return &GetAccountsForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAccountsForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
// GetAccountsForbidden describes a response with status code 403, with default header values.
|
||||
//
|
||||
// Access forbidden, account lacks access
|
||||
type GetAccountsForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -277,11 +273,13 @@ func (o *GetAccountsForbidden) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetAccountsForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsForbidden) String() string {
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsForbidden) GetPayload() *crm_models.Error {
|
||||
|
|
@ -300,7 +298,7 @@ func (o *GetAccountsForbidden) readResponse(response runtime.ClientResponse, con
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -312,11 +310,9 @@ func NewGetAccountsNotFound() *GetAccountsNotFound {
|
|||
return &GetAccountsNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAccountsNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
// GetAccountsNotFound describes a response with status code 404, with default header values.
|
||||
//
|
||||
// Resource was not found
|
||||
type GetAccountsNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -354,11 +350,13 @@ func (o *GetAccountsNotFound) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetAccountsNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsNotFound) String() string {
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsNotFound) GetPayload() *crm_models.Error {
|
||||
|
|
@ -377,7 +375,7 @@ func (o *GetAccountsNotFound) readResponse(response runtime.ClientResponse, cons
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -389,11 +387,9 @@ func NewGetAccountsUnprocessableEntity() *GetAccountsUnprocessableEntity {
|
|||
return &GetAccountsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAccountsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
// GetAccountsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
//
|
||||
// Unprocessable Entity, likely a bad parameter
|
||||
type GetAccountsUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -431,11 +427,13 @@ func (o *GetAccountsUnprocessableEntity) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetAccountsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
|
|
@ -454,7 +452,7 @@ func (o *GetAccountsUnprocessableEntity) readResponse(response runtime.ClientRes
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -466,11 +464,9 @@ func NewGetAccountsInternalServerError() *GetAccountsInternalServerError {
|
|||
return &GetAccountsInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAccountsInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
// GetAccountsInternalServerError describes a response with status code 500, with default header values.
|
||||
//
|
||||
// Server Internal Error
|
||||
type GetAccountsInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -508,11 +504,13 @@ func (o *GetAccountsInternalServerError) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetAccountsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsInternalServerError) String() string {
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /accounts][%d] getAccountsInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *GetAccountsInternalServerError) GetPayload() *crm_models.Error {
|
||||
|
|
@ -531,7 +529,7 @@ func (o *GetAccountsInternalServerError) readResponse(response runtime.ClientRes
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,20 +6,16 @@
|
|||
|
||||
package accounts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// NewPostAccountsParams creates a new PostAccountsParams object,
|
||||
|
|
@ -29,24 +25,28 @@ import (
|
|||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewPostAccountsParams() *PostAccountsParams {
|
||||
return &PostAccountsParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
return NewPostAccountsParamsWithTimeout(cr.DefaultTimeout)
|
||||
}
|
||||
|
||||
// NewPostAccountsParamsWithTimeout creates a new PostAccountsParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostAccountsParamsWithTimeout(timeout time.Duration) *PostAccountsParams {
|
||||
return &PostAccountsParams{
|
||||
timeout: timeout,
|
||||
inner: innerParams{
|
||||
timeout: timeout,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAccountsParamsWithContext creates a new PostAccountsParams object
|
||||
// with the ability to set a context for a request.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PostAccountsParams].
|
||||
func NewPostAccountsParamsWithContext(ctx context.Context) *PostAccountsParams {
|
||||
return &PostAccountsParams{
|
||||
Context: ctx,
|
||||
inner: innerParams{
|
||||
ctx: ctx,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -67,15 +67,14 @@ PostAccountsParams contains all the parameters to send to the API endpoint
|
|||
*/
|
||||
type PostAccountsParams struct {
|
||||
|
||||
/* AccountRequest.
|
||||
|
||||
An array of new Account records
|
||||
*/
|
||||
// AccountRequest.
|
||||
//
|
||||
// An array of new Account records
|
||||
AccountRequest *crm_models.AccountRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
|
||||
inner innerParams
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the post accounts params (not the query body).
|
||||
|
|
@ -93,54 +92,57 @@ func (o *PostAccountsParams) SetDefaults() {
|
|||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post accounts params
|
||||
// WithTimeout adds the timeout to the post accounts params.
|
||||
func (o *PostAccountsParams) WithTimeout(timeout time.Duration) *PostAccountsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post accounts params
|
||||
// SetTimeout adds the timeout to the post accounts params.
|
||||
func (o *PostAccountsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
o.inner.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post accounts params
|
||||
// WithContext adds the context to the post accounts params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PostAccountsParams].
|
||||
func (o *PostAccountsParams) WithContext(ctx context.Context) *PostAccountsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post accounts params
|
||||
// SetContext adds the context to the post accounts params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PostAccountsParams].
|
||||
func (o *PostAccountsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
o.inner.ctx = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post accounts params
|
||||
// WithHTTPClient adds the HTTPClient to the post accounts params.
|
||||
func (o *PostAccountsParams) WithHTTPClient(client *http.Client) *PostAccountsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post accounts params
|
||||
// SetHTTPClient adds the HTTPClient to the post accounts params.
|
||||
func (o *PostAccountsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithAccountRequest adds the accountRequest to the post accounts params
|
||||
// WithAccountRequest adds the accountRequest to the post accounts params.
|
||||
func (o *PostAccountsParams) WithAccountRequest(accountRequest *crm_models.AccountRequest) *PostAccountsParams {
|
||||
o.SetAccountRequest(accountRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetAccountRequest adds the accountRequest to the post accounts params
|
||||
// SetAccountRequest adds the accountRequest to the post accounts params.
|
||||
func (o *PostAccountsParams) SetAccountRequest(accountRequest *crm_models.AccountRequest) {
|
||||
o.AccountRequest = accountRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
// WriteToRequest writes these params to a [runtime.ClientRequest].
|
||||
func (o *PostAccountsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
if err := r.SetTimeout(o.inner.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
|
|
|||
|
|
@ -6,17 +6,15 @@
|
|||
|
||||
package accounts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
stderrors "errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// PostAccountsReader is a Reader for the PostAccounts structure.
|
||||
|
|
@ -25,7 +23,7 @@ type PostAccountsReader struct {
|
|||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostAccountsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
func (o *PostAccountsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPostAccountsOK()
|
||||
|
|
@ -64,7 +62,7 @@ func (o *PostAccountsReader) ReadResponse(response runtime.ClientResponse, consu
|
|||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
return nil, runtime.NewAPIError("[POST /accounts] postAccounts", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -73,11 +71,9 @@ func NewPostAccountsOK() *PostAccountsOK {
|
|||
return &PostAccountsOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAccountsOK describes a response with status code 200, with default header values.
|
||||
|
||||
Response with Account objects with Contacts
|
||||
*/
|
||||
// PostAccountsOK describes a response with status code 200, with default header values.
|
||||
//
|
||||
// Response with Account objects with Contacts
|
||||
type PostAccountsOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
CacheControl string
|
||||
|
|
@ -116,11 +112,13 @@ func (o *PostAccountsOK) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostAccountsOK) Error() string {
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *PostAccountsOK) String() string {
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *PostAccountsOK) GetPayload() *crm_models.AccountResponse {
|
||||
|
|
@ -146,7 +144,7 @@ func (o *PostAccountsOK) readResponse(response runtime.ClientResponse, consumer
|
|||
o.Payload = new(crm_models.AccountResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -158,11 +156,9 @@ func NewPostAccountsUnauthorized() *PostAccountsUnauthorized {
|
|||
return &PostAccountsUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAccountsUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
// PostAccountsUnauthorized describes a response with status code 401, with default header values.
|
||||
//
|
||||
// Access unauthorized, invalid API-KEY was used
|
||||
type PostAccountsUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -200,11 +196,13 @@ func (o *PostAccountsUnauthorized) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostAccountsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *PostAccountsUnauthorized) String() string {
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *PostAccountsUnauthorized) GetPayload() *crm_models.Error {
|
||||
|
|
@ -223,7 +221,7 @@ func (o *PostAccountsUnauthorized) readResponse(response runtime.ClientResponse,
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -235,11 +233,9 @@ func NewPostAccountsForbidden() *PostAccountsForbidden {
|
|||
return &PostAccountsForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAccountsForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
// PostAccountsForbidden describes a response with status code 403, with default header values.
|
||||
//
|
||||
// Access forbidden, account lacks access
|
||||
type PostAccountsForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -277,11 +273,13 @@ func (o *PostAccountsForbidden) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostAccountsForbidden) Error() string {
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *PostAccountsForbidden) String() string {
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *PostAccountsForbidden) GetPayload() *crm_models.Error {
|
||||
|
|
@ -300,7 +298,7 @@ func (o *PostAccountsForbidden) readResponse(response runtime.ClientResponse, co
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -312,11 +310,9 @@ func NewPostAccountsNotFound() *PostAccountsNotFound {
|
|||
return &PostAccountsNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAccountsNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
// PostAccountsNotFound describes a response with status code 404, with default header values.
|
||||
//
|
||||
// Resource was not found
|
||||
type PostAccountsNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -354,11 +350,13 @@ func (o *PostAccountsNotFound) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostAccountsNotFound) Error() string {
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *PostAccountsNotFound) String() string {
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *PostAccountsNotFound) GetPayload() *crm_models.Error {
|
||||
|
|
@ -377,7 +375,7 @@ func (o *PostAccountsNotFound) readResponse(response runtime.ClientResponse, con
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -389,11 +387,9 @@ func NewPostAccountsUnprocessableEntity() *PostAccountsUnprocessableEntity {
|
|||
return &PostAccountsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAccountsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
// PostAccountsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
//
|
||||
// Unprocessable Entity, likely a bad parameter
|
||||
type PostAccountsUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -431,11 +427,13 @@ func (o *PostAccountsUnprocessableEntity) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostAccountsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *PostAccountsUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *PostAccountsUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
|
|
@ -454,7 +452,7 @@ func (o *PostAccountsUnprocessableEntity) readResponse(response runtime.ClientRe
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -466,11 +464,9 @@ func NewPostAccountsInternalServerError() *PostAccountsInternalServerError {
|
|||
return &PostAccountsInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAccountsInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
// PostAccountsInternalServerError describes a response with status code 500, with default header values.
|
||||
//
|
||||
// Server Internal Error
|
||||
type PostAccountsInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -508,11 +504,13 @@ func (o *PostAccountsInternalServerError) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostAccountsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *PostAccountsInternalServerError) String() string {
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /accounts][%d] postAccountsInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *PostAccountsInternalServerError) GetPayload() *crm_models.Error {
|
||||
|
|
@ -531,7 +529,7 @@ func (o *PostAccountsInternalServerError) readResponse(response runtime.ClientRe
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,20 +6,16 @@
|
|||
|
||||
package accounts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// NewPutAccountsParams creates a new PutAccountsParams object,
|
||||
|
|
@ -29,24 +25,28 @@ import (
|
|||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewPutAccountsParams() *PutAccountsParams {
|
||||
return &PutAccountsParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
return NewPutAccountsParamsWithTimeout(cr.DefaultTimeout)
|
||||
}
|
||||
|
||||
// NewPutAccountsParamsWithTimeout creates a new PutAccountsParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPutAccountsParamsWithTimeout(timeout time.Duration) *PutAccountsParams {
|
||||
return &PutAccountsParams{
|
||||
timeout: timeout,
|
||||
inner: innerParams{
|
||||
timeout: timeout,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutAccountsParamsWithContext creates a new PutAccountsParams object
|
||||
// with the ability to set a context for a request.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PutAccountsParams].
|
||||
func NewPutAccountsParamsWithContext(ctx context.Context) *PutAccountsParams {
|
||||
return &PutAccountsParams{
|
||||
Context: ctx,
|
||||
inner: innerParams{
|
||||
ctx: ctx,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -67,15 +67,14 @@ PutAccountsParams contains all the parameters to send to the API endpoint
|
|||
*/
|
||||
type PutAccountsParams struct {
|
||||
|
||||
/* AccountRequest.
|
||||
|
||||
An array of new Account records
|
||||
*/
|
||||
// AccountRequest.
|
||||
//
|
||||
// An array of new Account records
|
||||
AccountRequest *crm_models.AccountRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
|
||||
inner innerParams
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the put accounts params (not the query body).
|
||||
|
|
@ -93,54 +92,57 @@ func (o *PutAccountsParams) SetDefaults() {
|
|||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the put accounts params
|
||||
// WithTimeout adds the timeout to the put accounts params.
|
||||
func (o *PutAccountsParams) WithTimeout(timeout time.Duration) *PutAccountsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the put accounts params
|
||||
// SetTimeout adds the timeout to the put accounts params.
|
||||
func (o *PutAccountsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
o.inner.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the put accounts params
|
||||
// WithContext adds the context to the put accounts params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PutAccountsParams].
|
||||
func (o *PutAccountsParams) WithContext(ctx context.Context) *PutAccountsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the put accounts params
|
||||
// SetContext adds the context to the put accounts params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PutAccountsParams].
|
||||
func (o *PutAccountsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
o.inner.ctx = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the put accounts params
|
||||
// WithHTTPClient adds the HTTPClient to the put accounts params.
|
||||
func (o *PutAccountsParams) WithHTTPClient(client *http.Client) *PutAccountsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the put accounts params
|
||||
// SetHTTPClient adds the HTTPClient to the put accounts params.
|
||||
func (o *PutAccountsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithAccountRequest adds the accountRequest to the put accounts params
|
||||
// WithAccountRequest adds the accountRequest to the put accounts params.
|
||||
func (o *PutAccountsParams) WithAccountRequest(accountRequest *crm_models.AccountRequest) *PutAccountsParams {
|
||||
o.SetAccountRequest(accountRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetAccountRequest adds the accountRequest to the put accounts params
|
||||
// SetAccountRequest adds the accountRequest to the put accounts params.
|
||||
func (o *PutAccountsParams) SetAccountRequest(accountRequest *crm_models.AccountRequest) {
|
||||
o.AccountRequest = accountRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
// WriteToRequest writes these params to a [runtime.ClientRequest].
|
||||
func (o *PutAccountsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
if err := r.SetTimeout(o.inner.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
|
|
|||
|
|
@ -6,17 +6,15 @@
|
|||
|
||||
package accounts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
stderrors "errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// PutAccountsReader is a Reader for the PutAccounts structure.
|
||||
|
|
@ -25,7 +23,7 @@ type PutAccountsReader struct {
|
|||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PutAccountsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
func (o *PutAccountsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPutAccountsOK()
|
||||
|
|
@ -64,7 +62,7 @@ func (o *PutAccountsReader) ReadResponse(response runtime.ClientResponse, consum
|
|||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
return nil, runtime.NewAPIError("[PUT /accounts] putAccounts", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -73,11 +71,9 @@ func NewPutAccountsOK() *PutAccountsOK {
|
|||
return &PutAccountsOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutAccountsOK describes a response with status code 200, with default header values.
|
||||
|
||||
Response with Account objects with Contacts
|
||||
*/
|
||||
// PutAccountsOK describes a response with status code 200, with default header values.
|
||||
//
|
||||
// Response with Account objects with Contacts
|
||||
type PutAccountsOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
CacheControl string
|
||||
|
|
@ -116,11 +112,13 @@ func (o *PutAccountsOK) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutAccountsOK) Error() string {
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountsOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountsOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *PutAccountsOK) String() string {
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountsOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountsOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *PutAccountsOK) GetPayload() *crm_models.AccountResponse {
|
||||
|
|
@ -146,7 +144,7 @@ func (o *PutAccountsOK) readResponse(response runtime.ClientResponse, consumer r
|
|||
o.Payload = new(crm_models.AccountResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -158,11 +156,9 @@ func NewPutAccountsUnauthorized() *PutAccountsUnauthorized {
|
|||
return &PutAccountsUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutAccountsUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
// PutAccountsUnauthorized describes a response with status code 401, with default header values.
|
||||
//
|
||||
// Access unauthorized, invalid API-KEY was used
|
||||
type PutAccountsUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -200,11 +196,13 @@ func (o *PutAccountsUnauthorized) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutAccountsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountsUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountsUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *PutAccountsUnauthorized) String() string {
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountsUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountsUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *PutAccountsUnauthorized) GetPayload() *crm_models.Error {
|
||||
|
|
@ -223,7 +221,7 @@ func (o *PutAccountsUnauthorized) readResponse(response runtime.ClientResponse,
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -235,11 +233,9 @@ func NewPutAccountsForbidden() *PutAccountsForbidden {
|
|||
return &PutAccountsForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutAccountsForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
// PutAccountsForbidden describes a response with status code 403, with default header values.
|
||||
//
|
||||
// Access forbidden, account lacks access
|
||||
type PutAccountsForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -277,11 +273,13 @@ func (o *PutAccountsForbidden) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutAccountsForbidden) Error() string {
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountsForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountsForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *PutAccountsForbidden) String() string {
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountsForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountsForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *PutAccountsForbidden) GetPayload() *crm_models.Error {
|
||||
|
|
@ -300,7 +298,7 @@ func (o *PutAccountsForbidden) readResponse(response runtime.ClientResponse, con
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -312,11 +310,9 @@ func NewPutAccountsNotFound() *PutAccountsNotFound {
|
|||
return &PutAccountsNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutAccountsNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
// PutAccountsNotFound describes a response with status code 404, with default header values.
|
||||
//
|
||||
// Resource was not found
|
||||
type PutAccountsNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -354,11 +350,13 @@ func (o *PutAccountsNotFound) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutAccountsNotFound) Error() string {
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountsNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountsNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *PutAccountsNotFound) String() string {
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountsNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountsNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *PutAccountsNotFound) GetPayload() *crm_models.Error {
|
||||
|
|
@ -377,7 +375,7 @@ func (o *PutAccountsNotFound) readResponse(response runtime.ClientResponse, cons
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -389,11 +387,9 @@ func NewPutAccountsUnprocessableEntity() *PutAccountsUnprocessableEntity {
|
|||
return &PutAccountsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutAccountsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
// PutAccountsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
//
|
||||
// Unprocessable Entity, likely a bad parameter
|
||||
type PutAccountsUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -431,11 +427,13 @@ func (o *PutAccountsUnprocessableEntity) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutAccountsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountsUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountsUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *PutAccountsUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountsUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountsUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *PutAccountsUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
|
|
@ -454,7 +452,7 @@ func (o *PutAccountsUnprocessableEntity) readResponse(response runtime.ClientRes
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -466,11 +464,9 @@ func NewPutAccountsInternalServerError() *PutAccountsInternalServerError {
|
|||
return &PutAccountsInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutAccountsInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
// PutAccountsInternalServerError describes a response with status code 500, with default header values.
|
||||
//
|
||||
// Server Internal Error
|
||||
type PutAccountsInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -508,11 +504,13 @@ func (o *PutAccountsInternalServerError) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutAccountsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountsInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountsInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *PutAccountsInternalServerError) String() string {
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountsInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /accounts][%d] putAccountsInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *PutAccountsInternalServerError) GetPayload() *crm_models.Error {
|
||||
|
|
@ -531,7 +529,7 @@ func (o *PutAccountsInternalServerError) readResponse(response runtime.ClientRes
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,55 +6,117 @@
|
|||
|
||||
package assets
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
httptransport "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// New creates a new assets API client.
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||
func New(transport runtime.ContextualTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
/*
|
||||
Client for assets API
|
||||
*/
|
||||
// New creates a new assets API client with basic auth credentials.
|
||||
//
|
||||
// It takes the following parameters:
|
||||
// - host: http host (github.com).
|
||||
// - basePath: any base path for the API client ("/v1", "/v3").
|
||||
// - scheme: http scheme ("http", "https").
|
||||
// - user: user for basic authentication header.
|
||||
// - password: password for basic authentication header.
|
||||
func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService {
|
||||
transport := httptransport.New(host, basePath, []string{scheme})
|
||||
transport.DefaultAuthentication = httptransport.BasicAuth(user, password)
|
||||
return &Client{transport: transport, formats: strfmt.Default}
|
||||
}
|
||||
|
||||
// New creates a new assets API client with a bearer token for authentication.
|
||||
//
|
||||
// It takes the following parameters:
|
||||
// - host: http host (github.com).
|
||||
// - basePath: any base path for the API client ("/v1", "/v3").
|
||||
// - scheme: http scheme ("http", "https").
|
||||
// - bearerToken: bearer token for Bearer authentication header.
|
||||
func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService {
|
||||
transport := httptransport.New(host, basePath, []string{scheme})
|
||||
transport.DefaultAuthentication = httptransport.BearerToken(bearerToken)
|
||||
return &Client{transport: transport, formats: strfmt.Default}
|
||||
}
|
||||
|
||||
// Client for assets API.
|
||||
type Client struct {
|
||||
transport runtime.ClientTransport
|
||||
transport runtime.ContextualTransport
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ClientOption is the option for Client methods
|
||||
// ClientOption may be used to customize the behavior of Client methods.
|
||||
type ClientOption func(*runtime.ClientOperation)
|
||||
|
||||
// ClientService is the interface for Client methods
|
||||
// ClientService is the interface for Client methods.
|
||||
type ClientService interface {
|
||||
|
||||
// DeleteAsset delete an asset.
|
||||
DeleteAsset(params *DeleteAssetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAssetOK, error)
|
||||
|
||||
// DeleteAssetContext delete an asset.
|
||||
DeleteAssetContext(ctx context.Context, params *DeleteAssetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAssetOK, error)
|
||||
|
||||
// GetAssets get a list of assets.
|
||||
GetAssets(params *GetAssetsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAssetsOK, error)
|
||||
|
||||
// GetAssetsContext get a list of assets.
|
||||
GetAssetsContext(ctx context.Context, params *GetAssetsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAssetsOK, error)
|
||||
|
||||
// PostAssets add a new asset.
|
||||
PostAssets(params *PostAssetsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAssetsOK, error)
|
||||
|
||||
// PostAssetsContext add a new asset.
|
||||
PostAssetsContext(ctx context.Context, params *PostAssetsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAssetsOK, error)
|
||||
|
||||
// PutAsset update a single asset.
|
||||
PutAsset(params *PutAssetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutAssetOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
// PutAssetContext update a single asset.
|
||||
PutAssetContext(ctx context.Context, params *PutAssetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutAssetOK, error)
|
||||
|
||||
SetTransport(transport runtime.ContextualTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAsset deletes an asset
|
||||
|
||||
Delete SalesforceDevops.net Asset record
|
||||
*/
|
||||
// DeleteAsset deletes an asset.
|
||||
//
|
||||
// Delete SalesforceDevops.net Asset record.
|
||||
//
|
||||
// This method does not support injected context.
|
||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||
//
|
||||
// If you need to pass a specific context, use [Client.DeleteAssetContext] instead.
|
||||
func (a *Client) DeleteAsset(params *DeleteAssetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAssetOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
var ctx context.Context
|
||||
if params.inner.ctx != nil {
|
||||
ctx = params.inner.ctx
|
||||
} else {
|
||||
ctx = context.Background()
|
||||
}
|
||||
|
||||
return a.DeleteAssetContext(ctx, params, authInfo, opts...)
|
||||
}
|
||||
|
||||
// DeleteAssetContext deletes an asset.
|
||||
//
|
||||
// Delete SalesforceDevops.net Asset record.
|
||||
//
|
||||
// Do not use the deprecated [DeleteAssetParams.Context] with this method: it would be ignored.
|
||||
func (a *Client) DeleteAssetContext(ctx context.Context, params *DeleteAssetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAssetOK, error) {
|
||||
// NOTE: parameters are not validated before sending
|
||||
if params == nil {
|
||||
params = NewDeleteAssetParams()
|
||||
}
|
||||
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "deleteAsset",
|
||||
Method: "DELETE",
|
||||
|
|
@ -65,37 +127,63 @@ func (a *Client) DeleteAsset(params *DeleteAssetParams, authInfo runtime.ClientA
|
|||
Params: params,
|
||||
Reader: &DeleteAssetReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
result, err := a.transport.SubmitContext(ctx, op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// only one success response has to be checked
|
||||
success, ok := result.(*DeleteAssetOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
|
||||
// unexpected success response.
|
||||
|
||||
// no default response is defined.
|
||||
//
|
||||
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for deleteAsset: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetAssets gets a list of assets
|
||||
|
||||
Return a list of all available Assets
|
||||
*/
|
||||
// GetAssets gets a list of assets.
|
||||
//
|
||||
// Return tenant-bound Asset records. Requires the exact crm:asset:read scope..
|
||||
//
|
||||
// This method does not support injected context.
|
||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||
//
|
||||
// If you need to pass a specific context, use [Client.GetAssetsContext] instead.
|
||||
func (a *Client) GetAssets(params *GetAssetsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAssetsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
var ctx context.Context
|
||||
if params.inner.ctx != nil {
|
||||
ctx = params.inner.ctx
|
||||
} else {
|
||||
ctx = context.Background()
|
||||
}
|
||||
|
||||
return a.GetAssetsContext(ctx, params, authInfo, opts...)
|
||||
}
|
||||
|
||||
// GetAssetsContext gets a list of assets.
|
||||
//
|
||||
// Return tenant-bound Asset records. Requires the exact crm:asset:read scope..
|
||||
//
|
||||
// Do not use the deprecated [GetAssetsParams.Context] with this method: it would be ignored.
|
||||
func (a *Client) GetAssetsContext(ctx context.Context, params *GetAssetsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAssetsOK, error) {
|
||||
// NOTE: parameters are not validated before sending
|
||||
if params == nil {
|
||||
params = NewGetAssetsParams()
|
||||
}
|
||||
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getAssets",
|
||||
Method: "GET",
|
||||
|
|
@ -106,37 +194,63 @@ func (a *Client) GetAssets(params *GetAssetsParams, authInfo runtime.ClientAuthI
|
|||
Params: params,
|
||||
Reader: &GetAssetsReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
result, err := a.transport.SubmitContext(ctx, op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// only one success response has to be checked
|
||||
success, ok := result.(*GetAssetsOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
|
||||
// unexpected success response.
|
||||
|
||||
// no default response is defined.
|
||||
//
|
||||
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for getAssets: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostAssets adds a new asset to salesforce devops net
|
||||
|
||||
Asset record to be added
|
||||
*/
|
||||
// PostAssets adds a new asset.
|
||||
//
|
||||
// Create one tenant-bound Asset with server-owned identity and audit fields..
|
||||
//
|
||||
// This method does not support injected context.
|
||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||
//
|
||||
// If you need to pass a specific context, use [Client.PostAssetsContext] instead.
|
||||
func (a *Client) PostAssets(params *PostAssetsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAssetsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
var ctx context.Context
|
||||
if params.inner.ctx != nil {
|
||||
ctx = params.inner.ctx
|
||||
} else {
|
||||
ctx = context.Background()
|
||||
}
|
||||
|
||||
return a.PostAssetsContext(ctx, params, authInfo, opts...)
|
||||
}
|
||||
|
||||
// PostAssetsContext adds a new asset.
|
||||
//
|
||||
// Create one tenant-bound Asset with server-owned identity and audit fields..
|
||||
//
|
||||
// Do not use the deprecated [PostAssetsParams.Context] with this method: it would be ignored.
|
||||
func (a *Client) PostAssetsContext(ctx context.Context, params *PostAssetsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAssetsOK, error) {
|
||||
// NOTE: parameters are not validated before sending
|
||||
if params == nil {
|
||||
params = NewPostAssetsParams()
|
||||
}
|
||||
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "postAssets",
|
||||
Method: "POST",
|
||||
|
|
@ -147,37 +261,63 @@ func (a *Client) PostAssets(params *PostAssetsParams, authInfo runtime.ClientAut
|
|||
Params: params,
|
||||
Reader: &PostAssetsReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
result, err := a.transport.SubmitContext(ctx, op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// only one success response has to be checked
|
||||
success, ok := result.(*PostAssetsOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
|
||||
// unexpected success response.
|
||||
|
||||
// no default response is defined.
|
||||
//
|
||||
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for postAssets: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PutAsset updates a single asset
|
||||
|
||||
Update a single asset specified by assetId
|
||||
*/
|
||||
// PutAsset updates a single asset.
|
||||
//
|
||||
// Optimistically update one tenant-bound Asset's authoritative business fields..
|
||||
//
|
||||
// This method does not support injected context.
|
||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||
//
|
||||
// If you need to pass a specific context, use [Client.PutAssetContext] instead.
|
||||
func (a *Client) PutAsset(params *PutAssetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutAssetOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
var ctx context.Context
|
||||
if params.inner.ctx != nil {
|
||||
ctx = params.inner.ctx
|
||||
} else {
|
||||
ctx = context.Background()
|
||||
}
|
||||
|
||||
return a.PutAssetContext(ctx, params, authInfo, opts...)
|
||||
}
|
||||
|
||||
// PutAssetContext updates a single asset.
|
||||
//
|
||||
// Optimistically update one tenant-bound Asset's authoritative business fields..
|
||||
//
|
||||
// Do not use the deprecated [PutAssetParams.Context] with this method: it would be ignored.
|
||||
func (a *Client) PutAssetContext(ctx context.Context, params *PutAssetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutAssetOK, error) {
|
||||
// NOTE: parameters are not validated before sending
|
||||
if params == nil {
|
||||
params = NewPutAssetParams()
|
||||
}
|
||||
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "putAsset",
|
||||
Method: "PUT",
|
||||
|
|
@ -188,28 +328,42 @@ func (a *Client) PutAsset(params *PutAssetParams, authInfo runtime.ClientAuthInf
|
|||
Params: params,
|
||||
Reader: &PutAssetReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
result, err := a.transport.SubmitContext(ctx, op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// only one success response has to be checked
|
||||
success, ok := result.(*PutAssetOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
|
||||
// unexpected success response.
|
||||
|
||||
// no default response is defined.
|
||||
//
|
||||
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for putAsset: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
// SetTransport changes the transport on the client
|
||||
func (a *Client) SetTransport(transport runtime.ClientTransport) {
|
||||
func (a *Client) SetTransport(transport runtime.ContextualTransport) {
|
||||
a.transport = transport
|
||||
}
|
||||
|
||||
// innerParams captures internal fields so they don't conflict with user-supplied parameters.
|
||||
type innerParams struct {
|
||||
timeout time.Duration
|
||||
|
||||
// Deprecated: use the operation call with context to pass the context instead of [AssetsParams].
|
||||
ctx context.Context
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,9 +6,6 @@
|
|||
|
||||
package assets
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
|
@ -27,24 +24,28 @@ import (
|
|||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewDeleteAssetParams() *DeleteAssetParams {
|
||||
return &DeleteAssetParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
return NewDeleteAssetParamsWithTimeout(cr.DefaultTimeout)
|
||||
}
|
||||
|
||||
// NewDeleteAssetParamsWithTimeout creates a new DeleteAssetParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewDeleteAssetParamsWithTimeout(timeout time.Duration) *DeleteAssetParams {
|
||||
return &DeleteAssetParams{
|
||||
timeout: timeout,
|
||||
inner: innerParams{
|
||||
timeout: timeout,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAssetParamsWithContext creates a new DeleteAssetParams object
|
||||
// with the ability to set a context for a request.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [DeleteAssetParams].
|
||||
func NewDeleteAssetParamsWithContext(ctx context.Context) *DeleteAssetParams {
|
||||
return &DeleteAssetParams{
|
||||
Context: ctx,
|
||||
inner: innerParams{
|
||||
ctx: ctx,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -65,15 +66,14 @@ DeleteAssetParams contains all the parameters to send to the API endpoint
|
|||
*/
|
||||
type DeleteAssetParams struct {
|
||||
|
||||
/* AssetID.
|
||||
|
||||
Record Id of an Asset
|
||||
*/
|
||||
// AssetID.
|
||||
//
|
||||
// Record Id of an Asset
|
||||
AssetID *string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
|
||||
inner innerParams
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the delete asset params (not the query body).
|
||||
|
|
@ -91,54 +91,57 @@ func (o *DeleteAssetParams) SetDefaults() {
|
|||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the delete asset params
|
||||
// WithTimeout adds the timeout to the delete asset params.
|
||||
func (o *DeleteAssetParams) WithTimeout(timeout time.Duration) *DeleteAssetParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the delete asset params
|
||||
// SetTimeout adds the timeout to the delete asset params.
|
||||
func (o *DeleteAssetParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
o.inner.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the delete asset params
|
||||
// WithContext adds the context to the delete asset params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [DeleteAssetParams].
|
||||
func (o *DeleteAssetParams) WithContext(ctx context.Context) *DeleteAssetParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the delete asset params
|
||||
// SetContext adds the context to the delete asset params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [DeleteAssetParams].
|
||||
func (o *DeleteAssetParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
o.inner.ctx = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the delete asset params
|
||||
// WithHTTPClient adds the HTTPClient to the delete asset params.
|
||||
func (o *DeleteAssetParams) WithHTTPClient(client *http.Client) *DeleteAssetParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the delete asset params
|
||||
// SetHTTPClient adds the HTTPClient to the delete asset params.
|
||||
func (o *DeleteAssetParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithAssetID adds the assetID to the delete asset params
|
||||
// WithAssetID adds the assetID to the delete asset params.
|
||||
func (o *DeleteAssetParams) WithAssetID(assetID *string) *DeleteAssetParams {
|
||||
o.SetAssetID(assetID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetAssetID adds the assetId to the delete asset params
|
||||
// SetAssetID adds the assetId to the delete asset params.
|
||||
func (o *DeleteAssetParams) SetAssetID(assetID *string) {
|
||||
o.AssetID = assetID
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
// WriteToRequest writes these params to a [runtime.ClientRequest].
|
||||
func (o *DeleteAssetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
if err := r.SetTimeout(o.inner.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
|
|
|||
|
|
@ -6,17 +6,15 @@
|
|||
|
||||
package assets
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
stderrors "errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// DeleteAssetReader is a Reader for the DeleteAsset structure.
|
||||
|
|
@ -25,7 +23,7 @@ type DeleteAssetReader struct {
|
|||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *DeleteAssetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
func (o *DeleteAssetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewDeleteAssetOK()
|
||||
|
|
@ -64,7 +62,7 @@ func (o *DeleteAssetReader) ReadResponse(response runtime.ClientResponse, consum
|
|||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
return nil, runtime.NewAPIError("[DELETE /assets] deleteAsset", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -73,11 +71,9 @@ func NewDeleteAssetOK() *DeleteAssetOK {
|
|||
return &DeleteAssetOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAssetOK describes a response with status code 200, with default header values.
|
||||
|
||||
Response with Message Objects with Delete Status
|
||||
*/
|
||||
// DeleteAssetOK describes a response with status code 200, with default header values.
|
||||
//
|
||||
// Response with Message Objects with Delete Status
|
||||
type DeleteAssetOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -115,11 +111,13 @@ func (o *DeleteAssetOK) Code() int {
|
|||
}
|
||||
|
||||
func (o *DeleteAssetOK) Error() string {
|
||||
return fmt.Sprintf("[DELETE /assets][%d] deleteAssetOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /assets][%d] deleteAssetOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAssetOK) String() string {
|
||||
return fmt.Sprintf("[DELETE /assets][%d] deleteAssetOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /assets][%d] deleteAssetOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAssetOK) GetPayload() *crm_models.DeleteResponse {
|
||||
|
|
@ -138,7 +136,7 @@ func (o *DeleteAssetOK) readResponse(response runtime.ClientResponse, consumer r
|
|||
o.Payload = new(crm_models.DeleteResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -150,11 +148,9 @@ func NewDeleteAssetUnauthorized() *DeleteAssetUnauthorized {
|
|||
return &DeleteAssetUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAssetUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
// DeleteAssetUnauthorized describes a response with status code 401, with default header values.
|
||||
//
|
||||
// Access unauthorized, invalid API-KEY was used
|
||||
type DeleteAssetUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -192,11 +188,13 @@ func (o *DeleteAssetUnauthorized) Code() int {
|
|||
}
|
||||
|
||||
func (o *DeleteAssetUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[DELETE /assets][%d] deleteAssetUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /assets][%d] deleteAssetUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAssetUnauthorized) String() string {
|
||||
return fmt.Sprintf("[DELETE /assets][%d] deleteAssetUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /assets][%d] deleteAssetUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAssetUnauthorized) GetPayload() *crm_models.Error {
|
||||
|
|
@ -215,7 +213,7 @@ func (o *DeleteAssetUnauthorized) readResponse(response runtime.ClientResponse,
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -227,11 +225,9 @@ func NewDeleteAssetForbidden() *DeleteAssetForbidden {
|
|||
return &DeleteAssetForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAssetForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
// DeleteAssetForbidden describes a response with status code 403, with default header values.
|
||||
//
|
||||
// Access forbidden, account lacks access
|
||||
type DeleteAssetForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -269,11 +265,13 @@ func (o *DeleteAssetForbidden) Code() int {
|
|||
}
|
||||
|
||||
func (o *DeleteAssetForbidden) Error() string {
|
||||
return fmt.Sprintf("[DELETE /assets][%d] deleteAssetForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /assets][%d] deleteAssetForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAssetForbidden) String() string {
|
||||
return fmt.Sprintf("[DELETE /assets][%d] deleteAssetForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /assets][%d] deleteAssetForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAssetForbidden) GetPayload() *crm_models.Error {
|
||||
|
|
@ -292,7 +290,7 @@ func (o *DeleteAssetForbidden) readResponse(response runtime.ClientResponse, con
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -304,11 +302,9 @@ func NewDeleteAssetNotFound() *DeleteAssetNotFound {
|
|||
return &DeleteAssetNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAssetNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
// DeleteAssetNotFound describes a response with status code 404, with default header values.
|
||||
//
|
||||
// Resource was not found
|
||||
type DeleteAssetNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -346,11 +342,13 @@ func (o *DeleteAssetNotFound) Code() int {
|
|||
}
|
||||
|
||||
func (o *DeleteAssetNotFound) Error() string {
|
||||
return fmt.Sprintf("[DELETE /assets][%d] deleteAssetNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /assets][%d] deleteAssetNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAssetNotFound) String() string {
|
||||
return fmt.Sprintf("[DELETE /assets][%d] deleteAssetNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /assets][%d] deleteAssetNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAssetNotFound) GetPayload() *crm_models.Error {
|
||||
|
|
@ -369,7 +367,7 @@ func (o *DeleteAssetNotFound) readResponse(response runtime.ClientResponse, cons
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -381,11 +379,9 @@ func NewDeleteAssetUnprocessableEntity() *DeleteAssetUnprocessableEntity {
|
|||
return &DeleteAssetUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAssetUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
// DeleteAssetUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
//
|
||||
// Unprocessable Entity, likely a bad parameter
|
||||
type DeleteAssetUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -423,11 +419,13 @@ func (o *DeleteAssetUnprocessableEntity) Code() int {
|
|||
}
|
||||
|
||||
func (o *DeleteAssetUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[DELETE /assets][%d] deleteAssetUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /assets][%d] deleteAssetUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAssetUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[DELETE /assets][%d] deleteAssetUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /assets][%d] deleteAssetUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAssetUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
|
|
@ -446,7 +444,7 @@ func (o *DeleteAssetUnprocessableEntity) readResponse(response runtime.ClientRes
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -458,11 +456,9 @@ func NewDeleteAssetInternalServerError() *DeleteAssetInternalServerError {
|
|||
return &DeleteAssetInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAssetInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
// DeleteAssetInternalServerError describes a response with status code 500, with default header values.
|
||||
//
|
||||
// Server Internal Error
|
||||
type DeleteAssetInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -500,11 +496,13 @@ func (o *DeleteAssetInternalServerError) Code() int {
|
|||
}
|
||||
|
||||
func (o *DeleteAssetInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[DELETE /assets][%d] deleteAssetInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /assets][%d] deleteAssetInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAssetInternalServerError) String() string {
|
||||
return fmt.Sprintf("[DELETE /assets][%d] deleteAssetInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /assets][%d] deleteAssetInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteAssetInternalServerError) GetPayload() *crm_models.Error {
|
||||
|
|
@ -523,7 +521,7 @@ func (o *DeleteAssetInternalServerError) readResponse(response runtime.ClientRes
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,9 +6,6 @@
|
|||
|
||||
package assets
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
|
@ -18,7 +15,7 @@ import (
|
|||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/swag/conv"
|
||||
)
|
||||
|
||||
// NewGetAssetsParams creates a new GetAssetsParams object,
|
||||
|
|
@ -28,24 +25,28 @@ import (
|
|||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewGetAssetsParams() *GetAssetsParams {
|
||||
return &GetAssetsParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
return NewGetAssetsParamsWithTimeout(cr.DefaultTimeout)
|
||||
}
|
||||
|
||||
// NewGetAssetsParamsWithTimeout creates a new GetAssetsParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetAssetsParamsWithTimeout(timeout time.Duration) *GetAssetsParams {
|
||||
return &GetAssetsParams{
|
||||
timeout: timeout,
|
||||
inner: innerParams{
|
||||
timeout: timeout,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAssetsParamsWithContext creates a new GetAssetsParams object
|
||||
// with the ability to set a context for a request.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [GetAssetsParams].
|
||||
func NewGetAssetsParamsWithContext(ctx context.Context) *GetAssetsParams {
|
||||
return &GetAssetsParams{
|
||||
Context: ctx,
|
||||
inner: innerParams{
|
||||
ctx: ctx,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -66,37 +67,33 @@ GetAssetsParams contains all the parameters to send to the API endpoint
|
|||
*/
|
||||
type GetAssetsParams struct {
|
||||
|
||||
/* AccountID.
|
||||
|
||||
Record Id of an Account
|
||||
*/
|
||||
// AccountID.
|
||||
//
|
||||
// Record Id of an Account
|
||||
AccountID *string
|
||||
|
||||
/* AssetID.
|
||||
|
||||
Record Id of an Asset
|
||||
*/
|
||||
// AssetID.
|
||||
//
|
||||
// Record Id of an Asset
|
||||
AssetID *string
|
||||
|
||||
/* Limit.
|
||||
|
||||
How many objects to return at one time
|
||||
|
||||
Format: int64
|
||||
*/
|
||||
// Limit.
|
||||
//
|
||||
// How many objects to return at one time
|
||||
//
|
||||
// Format: int64
|
||||
Limit *int64
|
||||
|
||||
/* Offset.
|
||||
|
||||
How many objects to skip?
|
||||
|
||||
Format: int64
|
||||
*/
|
||||
// Offset.
|
||||
//
|
||||
// How many objects to skip?
|
||||
//
|
||||
// Format: int64
|
||||
Offset *int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
|
||||
inner innerParams
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get assets params (not the query body).
|
||||
|
|
@ -114,87 +111,90 @@ func (o *GetAssetsParams) SetDefaults() {
|
|||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get assets params
|
||||
// WithTimeout adds the timeout to the get assets params.
|
||||
func (o *GetAssetsParams) WithTimeout(timeout time.Duration) *GetAssetsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get assets params
|
||||
// SetTimeout adds the timeout to the get assets params.
|
||||
func (o *GetAssetsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
o.inner.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get assets params
|
||||
// WithContext adds the context to the get assets params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [GetAssetsParams].
|
||||
func (o *GetAssetsParams) WithContext(ctx context.Context) *GetAssetsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get assets params
|
||||
// SetContext adds the context to the get assets params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [GetAssetsParams].
|
||||
func (o *GetAssetsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
o.inner.ctx = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get assets params
|
||||
// WithHTTPClient adds the HTTPClient to the get assets params.
|
||||
func (o *GetAssetsParams) WithHTTPClient(client *http.Client) *GetAssetsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get assets params
|
||||
// SetHTTPClient adds the HTTPClient to the get assets params.
|
||||
func (o *GetAssetsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithAccountID adds the accountID to the get assets params
|
||||
// WithAccountID adds the accountID to the get assets params.
|
||||
func (o *GetAssetsParams) WithAccountID(accountID *string) *GetAssetsParams {
|
||||
o.SetAccountID(accountID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetAccountID adds the accountId to the get assets params
|
||||
// SetAccountID adds the accountId to the get assets params.
|
||||
func (o *GetAssetsParams) SetAccountID(accountID *string) {
|
||||
o.AccountID = accountID
|
||||
}
|
||||
|
||||
// WithAssetID adds the assetID to the get assets params
|
||||
// WithAssetID adds the assetID to the get assets params.
|
||||
func (o *GetAssetsParams) WithAssetID(assetID *string) *GetAssetsParams {
|
||||
o.SetAssetID(assetID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetAssetID adds the assetId to the get assets params
|
||||
// SetAssetID adds the assetId to the get assets params.
|
||||
func (o *GetAssetsParams) SetAssetID(assetID *string) {
|
||||
o.AssetID = assetID
|
||||
}
|
||||
|
||||
// WithLimit adds the limit to the get assets params
|
||||
// WithLimit adds the limit to the get assets params.
|
||||
func (o *GetAssetsParams) WithLimit(limit *int64) *GetAssetsParams {
|
||||
o.SetLimit(limit)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetLimit adds the limit to the get assets params
|
||||
// SetLimit adds the limit to the get assets params.
|
||||
func (o *GetAssetsParams) SetLimit(limit *int64) {
|
||||
o.Limit = limit
|
||||
}
|
||||
|
||||
// WithOffset adds the offset to the get assets params
|
||||
// WithOffset adds the offset to the get assets params.
|
||||
func (o *GetAssetsParams) WithOffset(offset *int64) *GetAssetsParams {
|
||||
o.SetOffset(offset)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetOffset adds the offset to the get assets params
|
||||
// SetOffset adds the offset to the get assets params.
|
||||
func (o *GetAssetsParams) SetOffset(offset *int64) {
|
||||
o.Offset = offset
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
// WriteToRequest writes these params to a [runtime.ClientRequest].
|
||||
func (o *GetAssetsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
if err := r.SetTimeout(o.inner.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
|
@ -241,7 +241,7 @@ func (o *GetAssetsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Reg
|
|||
if o.Limit != nil {
|
||||
qrLimit = *o.Limit
|
||||
}
|
||||
qLimit := swag.FormatInt64(qrLimit)
|
||||
qLimit := conv.FormatInteger(qrLimit)
|
||||
if qLimit != "" {
|
||||
|
||||
if err := r.SetQueryParam("limit", qLimit); err != nil {
|
||||
|
|
@ -258,7 +258,7 @@ func (o *GetAssetsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Reg
|
|||
if o.Offset != nil {
|
||||
qrOffset = *o.Offset
|
||||
}
|
||||
qOffset := swag.FormatInt64(qrOffset)
|
||||
qOffset := conv.FormatInteger(qrOffset)
|
||||
if qOffset != "" {
|
||||
|
||||
if err := r.SetQueryParam("offset", qOffset); err != nil {
|
||||
|
|
|
|||
|
|
@ -6,17 +6,15 @@
|
|||
|
||||
package assets
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
stderrors "errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// GetAssetsReader is a Reader for the GetAssets structure.
|
||||
|
|
@ -25,7 +23,7 @@ type GetAssetsReader struct {
|
|||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetAssetsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
func (o *GetAssetsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetAssetsOK()
|
||||
|
|
@ -64,7 +62,7 @@ func (o *GetAssetsReader) ReadResponse(response runtime.ClientResponse, consumer
|
|||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
return nil, runtime.NewAPIError("[GET /assets] getAssets", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -73,11 +71,9 @@ func NewGetAssetsOK() *GetAssetsOK {
|
|||
return &GetAssetsOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAssetsOK describes a response with status code 200, with default header values.
|
||||
|
||||
Response with Asset objects with Contacts
|
||||
*/
|
||||
// GetAssetsOK describes a response with status code 200, with default header values.
|
||||
//
|
||||
// Response with Asset objects with Contacts
|
||||
type GetAssetsOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
CacheControl string
|
||||
|
|
@ -116,11 +112,13 @@ func (o *GetAssetsOK) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetAssetsOK) Error() string {
|
||||
return fmt.Sprintf("[GET /assets][%d] getAssetsOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /assets][%d] getAssetsOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *GetAssetsOK) String() string {
|
||||
return fmt.Sprintf("[GET /assets][%d] getAssetsOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /assets][%d] getAssetsOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *GetAssetsOK) GetPayload() *crm_models.AssetResponse {
|
||||
|
|
@ -146,7 +144,7 @@ func (o *GetAssetsOK) readResponse(response runtime.ClientResponse, consumer run
|
|||
o.Payload = new(crm_models.AssetResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -158,11 +156,9 @@ func NewGetAssetsUnauthorized() *GetAssetsUnauthorized {
|
|||
return &GetAssetsUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAssetsUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
// GetAssetsUnauthorized describes a response with status code 401, with default header values.
|
||||
//
|
||||
// Access unauthorized, invalid API-KEY was used
|
||||
type GetAssetsUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -200,11 +196,13 @@ func (o *GetAssetsUnauthorized) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetAssetsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /assets][%d] getAssetsUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /assets][%d] getAssetsUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *GetAssetsUnauthorized) String() string {
|
||||
return fmt.Sprintf("[GET /assets][%d] getAssetsUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /assets][%d] getAssetsUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *GetAssetsUnauthorized) GetPayload() *crm_models.Error {
|
||||
|
|
@ -223,7 +221,7 @@ func (o *GetAssetsUnauthorized) readResponse(response runtime.ClientResponse, co
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -235,11 +233,9 @@ func NewGetAssetsForbidden() *GetAssetsForbidden {
|
|||
return &GetAssetsForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAssetsForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
// GetAssetsForbidden describes a response with status code 403, with default header values.
|
||||
//
|
||||
// Access forbidden, account lacks access
|
||||
type GetAssetsForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -277,11 +273,13 @@ func (o *GetAssetsForbidden) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetAssetsForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /assets][%d] getAssetsForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /assets][%d] getAssetsForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *GetAssetsForbidden) String() string {
|
||||
return fmt.Sprintf("[GET /assets][%d] getAssetsForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /assets][%d] getAssetsForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *GetAssetsForbidden) GetPayload() *crm_models.Error {
|
||||
|
|
@ -300,7 +298,7 @@ func (o *GetAssetsForbidden) readResponse(response runtime.ClientResponse, consu
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -312,11 +310,9 @@ func NewGetAssetsNotFound() *GetAssetsNotFound {
|
|||
return &GetAssetsNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAssetsNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
// GetAssetsNotFound describes a response with status code 404, with default header values.
|
||||
//
|
||||
// Resource was not found
|
||||
type GetAssetsNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -354,11 +350,13 @@ func (o *GetAssetsNotFound) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetAssetsNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /assets][%d] getAssetsNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /assets][%d] getAssetsNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *GetAssetsNotFound) String() string {
|
||||
return fmt.Sprintf("[GET /assets][%d] getAssetsNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /assets][%d] getAssetsNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *GetAssetsNotFound) GetPayload() *crm_models.Error {
|
||||
|
|
@ -377,7 +375,7 @@ func (o *GetAssetsNotFound) readResponse(response runtime.ClientResponse, consum
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -389,11 +387,9 @@ func NewGetAssetsUnprocessableEntity() *GetAssetsUnprocessableEntity {
|
|||
return &GetAssetsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAssetsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
// GetAssetsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
//
|
||||
// Unprocessable Entity, likely a bad parameter
|
||||
type GetAssetsUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -431,11 +427,13 @@ func (o *GetAssetsUnprocessableEntity) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetAssetsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /assets][%d] getAssetsUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /assets][%d] getAssetsUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *GetAssetsUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[GET /assets][%d] getAssetsUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /assets][%d] getAssetsUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *GetAssetsUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
|
|
@ -454,7 +452,7 @@ func (o *GetAssetsUnprocessableEntity) readResponse(response runtime.ClientRespo
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -466,11 +464,9 @@ func NewGetAssetsInternalServerError() *GetAssetsInternalServerError {
|
|||
return &GetAssetsInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAssetsInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
// GetAssetsInternalServerError describes a response with status code 500, with default header values.
|
||||
//
|
||||
// Server Internal Error
|
||||
type GetAssetsInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -508,11 +504,13 @@ func (o *GetAssetsInternalServerError) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetAssetsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /assets][%d] getAssetsInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /assets][%d] getAssetsInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *GetAssetsInternalServerError) String() string {
|
||||
return fmt.Sprintf("[GET /assets][%d] getAssetsInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /assets][%d] getAssetsInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *GetAssetsInternalServerError) GetPayload() *crm_models.Error {
|
||||
|
|
@ -531,7 +529,7 @@ func (o *GetAssetsInternalServerError) readResponse(response runtime.ClientRespo
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,20 +6,16 @@
|
|||
|
||||
package assets
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// NewPostAssetsParams creates a new PostAssetsParams object,
|
||||
|
|
@ -29,24 +25,28 @@ import (
|
|||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewPostAssetsParams() *PostAssetsParams {
|
||||
return &PostAssetsParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
return NewPostAssetsParamsWithTimeout(cr.DefaultTimeout)
|
||||
}
|
||||
|
||||
// NewPostAssetsParamsWithTimeout creates a new PostAssetsParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostAssetsParamsWithTimeout(timeout time.Duration) *PostAssetsParams {
|
||||
return &PostAssetsParams{
|
||||
timeout: timeout,
|
||||
inner: innerParams{
|
||||
timeout: timeout,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAssetsParamsWithContext creates a new PostAssetsParams object
|
||||
// with the ability to set a context for a request.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PostAssetsParams].
|
||||
func NewPostAssetsParamsWithContext(ctx context.Context) *PostAssetsParams {
|
||||
return &PostAssetsParams{
|
||||
Context: ctx,
|
||||
inner: innerParams{
|
||||
ctx: ctx,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -67,15 +67,14 @@ PostAssetsParams contains all the parameters to send to the API endpoint
|
|||
*/
|
||||
type PostAssetsParams struct {
|
||||
|
||||
/* AssetRequest.
|
||||
|
||||
An array of new Asset records
|
||||
*/
|
||||
// AssetRequest.
|
||||
//
|
||||
// An array of new Asset records
|
||||
AssetRequest *crm_models.AssetRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
|
||||
inner innerParams
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the post assets params (not the query body).
|
||||
|
|
@ -93,54 +92,57 @@ func (o *PostAssetsParams) SetDefaults() {
|
|||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post assets params
|
||||
// WithTimeout adds the timeout to the post assets params.
|
||||
func (o *PostAssetsParams) WithTimeout(timeout time.Duration) *PostAssetsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post assets params
|
||||
// SetTimeout adds the timeout to the post assets params.
|
||||
func (o *PostAssetsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
o.inner.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post assets params
|
||||
// WithContext adds the context to the post assets params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PostAssetsParams].
|
||||
func (o *PostAssetsParams) WithContext(ctx context.Context) *PostAssetsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post assets params
|
||||
// SetContext adds the context to the post assets params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PostAssetsParams].
|
||||
func (o *PostAssetsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
o.inner.ctx = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post assets params
|
||||
// WithHTTPClient adds the HTTPClient to the post assets params.
|
||||
func (o *PostAssetsParams) WithHTTPClient(client *http.Client) *PostAssetsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post assets params
|
||||
// SetHTTPClient adds the HTTPClient to the post assets params.
|
||||
func (o *PostAssetsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithAssetRequest adds the assetRequest to the post assets params
|
||||
// WithAssetRequest adds the assetRequest to the post assets params.
|
||||
func (o *PostAssetsParams) WithAssetRequest(assetRequest *crm_models.AssetRequest) *PostAssetsParams {
|
||||
o.SetAssetRequest(assetRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetAssetRequest adds the assetRequest to the post assets params
|
||||
// SetAssetRequest adds the assetRequest to the post assets params.
|
||||
func (o *PostAssetsParams) SetAssetRequest(assetRequest *crm_models.AssetRequest) {
|
||||
o.AssetRequest = assetRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
// WriteToRequest writes these params to a [runtime.ClientRequest].
|
||||
func (o *PostAssetsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
if err := r.SetTimeout(o.inner.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
|
|
|||
|
|
@ -6,17 +6,15 @@
|
|||
|
||||
package assets
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
stderrors "errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// PostAssetsReader is a Reader for the PostAssets structure.
|
||||
|
|
@ -25,7 +23,7 @@ type PostAssetsReader struct {
|
|||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostAssetsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
func (o *PostAssetsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPostAssetsOK()
|
||||
|
|
@ -64,7 +62,7 @@ func (o *PostAssetsReader) ReadResponse(response runtime.ClientResponse, consume
|
|||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
return nil, runtime.NewAPIError("[POST /assets] postAssets", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -73,11 +71,9 @@ func NewPostAssetsOK() *PostAssetsOK {
|
|||
return &PostAssetsOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAssetsOK describes a response with status code 200, with default header values.
|
||||
|
||||
Response with Asset objects with Contacts
|
||||
*/
|
||||
// PostAssetsOK describes a response with status code 200, with default header values.
|
||||
//
|
||||
// Response with Asset objects with Contacts
|
||||
type PostAssetsOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
CacheControl string
|
||||
|
|
@ -116,11 +112,13 @@ func (o *PostAssetsOK) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostAssetsOK) Error() string {
|
||||
return fmt.Sprintf("[POST /assets][%d] postAssetsOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /assets][%d] postAssetsOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *PostAssetsOK) String() string {
|
||||
return fmt.Sprintf("[POST /assets][%d] postAssetsOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /assets][%d] postAssetsOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *PostAssetsOK) GetPayload() *crm_models.AssetResponse {
|
||||
|
|
@ -146,7 +144,7 @@ func (o *PostAssetsOK) readResponse(response runtime.ClientResponse, consumer ru
|
|||
o.Payload = new(crm_models.AssetResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -158,11 +156,9 @@ func NewPostAssetsUnauthorized() *PostAssetsUnauthorized {
|
|||
return &PostAssetsUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAssetsUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
// PostAssetsUnauthorized describes a response with status code 401, with default header values.
|
||||
//
|
||||
// Access unauthorized, invalid API-KEY was used
|
||||
type PostAssetsUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -200,11 +196,13 @@ func (o *PostAssetsUnauthorized) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostAssetsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[POST /assets][%d] postAssetsUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /assets][%d] postAssetsUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *PostAssetsUnauthorized) String() string {
|
||||
return fmt.Sprintf("[POST /assets][%d] postAssetsUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /assets][%d] postAssetsUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *PostAssetsUnauthorized) GetPayload() *crm_models.Error {
|
||||
|
|
@ -223,7 +221,7 @@ func (o *PostAssetsUnauthorized) readResponse(response runtime.ClientResponse, c
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -235,11 +233,9 @@ func NewPostAssetsForbidden() *PostAssetsForbidden {
|
|||
return &PostAssetsForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAssetsForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
// PostAssetsForbidden describes a response with status code 403, with default header values.
|
||||
//
|
||||
// Access forbidden, account lacks access
|
||||
type PostAssetsForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -277,11 +273,13 @@ func (o *PostAssetsForbidden) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostAssetsForbidden) Error() string {
|
||||
return fmt.Sprintf("[POST /assets][%d] postAssetsForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /assets][%d] postAssetsForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *PostAssetsForbidden) String() string {
|
||||
return fmt.Sprintf("[POST /assets][%d] postAssetsForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /assets][%d] postAssetsForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *PostAssetsForbidden) GetPayload() *crm_models.Error {
|
||||
|
|
@ -300,7 +298,7 @@ func (o *PostAssetsForbidden) readResponse(response runtime.ClientResponse, cons
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -312,11 +310,9 @@ func NewPostAssetsNotFound() *PostAssetsNotFound {
|
|||
return &PostAssetsNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAssetsNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
// PostAssetsNotFound describes a response with status code 404, with default header values.
|
||||
//
|
||||
// Resource was not found
|
||||
type PostAssetsNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -354,11 +350,13 @@ func (o *PostAssetsNotFound) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostAssetsNotFound) Error() string {
|
||||
return fmt.Sprintf("[POST /assets][%d] postAssetsNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /assets][%d] postAssetsNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *PostAssetsNotFound) String() string {
|
||||
return fmt.Sprintf("[POST /assets][%d] postAssetsNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /assets][%d] postAssetsNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *PostAssetsNotFound) GetPayload() *crm_models.Error {
|
||||
|
|
@ -377,7 +375,7 @@ func (o *PostAssetsNotFound) readResponse(response runtime.ClientResponse, consu
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -389,11 +387,9 @@ func NewPostAssetsUnprocessableEntity() *PostAssetsUnprocessableEntity {
|
|||
return &PostAssetsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAssetsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
// PostAssetsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
//
|
||||
// Unprocessable Entity, likely a bad parameter
|
||||
type PostAssetsUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -431,11 +427,13 @@ func (o *PostAssetsUnprocessableEntity) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostAssetsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[POST /assets][%d] postAssetsUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /assets][%d] postAssetsUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *PostAssetsUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[POST /assets][%d] postAssetsUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /assets][%d] postAssetsUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *PostAssetsUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
|
|
@ -454,7 +452,7 @@ func (o *PostAssetsUnprocessableEntity) readResponse(response runtime.ClientResp
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -466,11 +464,9 @@ func NewPostAssetsInternalServerError() *PostAssetsInternalServerError {
|
|||
return &PostAssetsInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAssetsInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
// PostAssetsInternalServerError describes a response with status code 500, with default header values.
|
||||
//
|
||||
// Server Internal Error
|
||||
type PostAssetsInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -508,11 +504,13 @@ func (o *PostAssetsInternalServerError) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostAssetsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[POST /assets][%d] postAssetsInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /assets][%d] postAssetsInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *PostAssetsInternalServerError) String() string {
|
||||
return fmt.Sprintf("[POST /assets][%d] postAssetsInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /assets][%d] postAssetsInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *PostAssetsInternalServerError) GetPayload() *crm_models.Error {
|
||||
|
|
@ -531,7 +529,7 @@ func (o *PostAssetsInternalServerError) readResponse(response runtime.ClientResp
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,20 +6,16 @@
|
|||
|
||||
package assets
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// NewPutAssetParams creates a new PutAssetParams object,
|
||||
|
|
@ -29,24 +25,28 @@ import (
|
|||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewPutAssetParams() *PutAssetParams {
|
||||
return &PutAssetParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
return NewPutAssetParamsWithTimeout(cr.DefaultTimeout)
|
||||
}
|
||||
|
||||
// NewPutAssetParamsWithTimeout creates a new PutAssetParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPutAssetParamsWithTimeout(timeout time.Duration) *PutAssetParams {
|
||||
return &PutAssetParams{
|
||||
timeout: timeout,
|
||||
inner: innerParams{
|
||||
timeout: timeout,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutAssetParamsWithContext creates a new PutAssetParams object
|
||||
// with the ability to set a context for a request.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PutAssetParams].
|
||||
func NewPutAssetParamsWithContext(ctx context.Context) *PutAssetParams {
|
||||
return &PutAssetParams{
|
||||
Context: ctx,
|
||||
inner: innerParams{
|
||||
ctx: ctx,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -67,15 +67,14 @@ PutAssetParams contains all the parameters to send to the API endpoint
|
|||
*/
|
||||
type PutAssetParams struct {
|
||||
|
||||
/* AssetRequest.
|
||||
|
||||
An array of new Asset records
|
||||
*/
|
||||
// AssetRequest.
|
||||
//
|
||||
// An array of new Asset records
|
||||
AssetRequest *crm_models.AssetRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
|
||||
inner innerParams
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the put asset params (not the query body).
|
||||
|
|
@ -93,54 +92,57 @@ func (o *PutAssetParams) SetDefaults() {
|
|||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the put asset params
|
||||
// WithTimeout adds the timeout to the put asset params.
|
||||
func (o *PutAssetParams) WithTimeout(timeout time.Duration) *PutAssetParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the put asset params
|
||||
// SetTimeout adds the timeout to the put asset params.
|
||||
func (o *PutAssetParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
o.inner.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the put asset params
|
||||
// WithContext adds the context to the put asset params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PutAssetParams].
|
||||
func (o *PutAssetParams) WithContext(ctx context.Context) *PutAssetParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the put asset params
|
||||
// SetContext adds the context to the put asset params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PutAssetParams].
|
||||
func (o *PutAssetParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
o.inner.ctx = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the put asset params
|
||||
// WithHTTPClient adds the HTTPClient to the put asset params.
|
||||
func (o *PutAssetParams) WithHTTPClient(client *http.Client) *PutAssetParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the put asset params
|
||||
// SetHTTPClient adds the HTTPClient to the put asset params.
|
||||
func (o *PutAssetParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithAssetRequest adds the assetRequest to the put asset params
|
||||
// WithAssetRequest adds the assetRequest to the put asset params.
|
||||
func (o *PutAssetParams) WithAssetRequest(assetRequest *crm_models.AssetRequest) *PutAssetParams {
|
||||
o.SetAssetRequest(assetRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetAssetRequest adds the assetRequest to the put asset params
|
||||
// SetAssetRequest adds the assetRequest to the put asset params.
|
||||
func (o *PutAssetParams) SetAssetRequest(assetRequest *crm_models.AssetRequest) {
|
||||
o.AssetRequest = assetRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
// WriteToRequest writes these params to a [runtime.ClientRequest].
|
||||
func (o *PutAssetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
if err := r.SetTimeout(o.inner.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
|
|
|||
|
|
@ -6,17 +6,15 @@
|
|||
|
||||
package assets
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
stderrors "errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// PutAssetReader is a Reader for the PutAsset structure.
|
||||
|
|
@ -25,7 +23,7 @@ type PutAssetReader struct {
|
|||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PutAssetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
func (o *PutAssetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPutAssetOK()
|
||||
|
|
@ -51,6 +49,12 @@ func (o *PutAssetReader) ReadResponse(response runtime.ClientResponse, consumer
|
|||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 409:
|
||||
result := NewPutAssetConflict()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewPutAssetUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
|
|
@ -64,7 +68,7 @@ func (o *PutAssetReader) ReadResponse(response runtime.ClientResponse, consumer
|
|||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
return nil, runtime.NewAPIError("[PUT /assets] putAsset", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -73,11 +77,9 @@ func NewPutAssetOK() *PutAssetOK {
|
|||
return &PutAssetOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutAssetOK describes a response with status code 200, with default header values.
|
||||
|
||||
Response with Asset objects with Contacts
|
||||
*/
|
||||
// PutAssetOK describes a response with status code 200, with default header values.
|
||||
//
|
||||
// Response with Asset objects with Contacts
|
||||
type PutAssetOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
CacheControl string
|
||||
|
|
@ -116,11 +118,13 @@ func (o *PutAssetOK) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutAssetOK) Error() string {
|
||||
return fmt.Sprintf("[PUT /assets][%d] putAssetOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /assets][%d] putAssetOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *PutAssetOK) String() string {
|
||||
return fmt.Sprintf("[PUT /assets][%d] putAssetOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /assets][%d] putAssetOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *PutAssetOK) GetPayload() *crm_models.AssetResponse {
|
||||
|
|
@ -146,7 +150,7 @@ func (o *PutAssetOK) readResponse(response runtime.ClientResponse, consumer runt
|
|||
o.Payload = new(crm_models.AssetResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -158,11 +162,9 @@ func NewPutAssetUnauthorized() *PutAssetUnauthorized {
|
|||
return &PutAssetUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutAssetUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
// PutAssetUnauthorized describes a response with status code 401, with default header values.
|
||||
//
|
||||
// Access unauthorized, invalid API-KEY was used
|
||||
type PutAssetUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -200,11 +202,13 @@ func (o *PutAssetUnauthorized) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutAssetUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[PUT /assets][%d] putAssetUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /assets][%d] putAssetUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *PutAssetUnauthorized) String() string {
|
||||
return fmt.Sprintf("[PUT /assets][%d] putAssetUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /assets][%d] putAssetUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *PutAssetUnauthorized) GetPayload() *crm_models.Error {
|
||||
|
|
@ -223,7 +227,7 @@ func (o *PutAssetUnauthorized) readResponse(response runtime.ClientResponse, con
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -235,11 +239,9 @@ func NewPutAssetForbidden() *PutAssetForbidden {
|
|||
return &PutAssetForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutAssetForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
// PutAssetForbidden describes a response with status code 403, with default header values.
|
||||
//
|
||||
// Access forbidden, account lacks access
|
||||
type PutAssetForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -277,11 +279,13 @@ func (o *PutAssetForbidden) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutAssetForbidden) Error() string {
|
||||
return fmt.Sprintf("[PUT /assets][%d] putAssetForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /assets][%d] putAssetForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *PutAssetForbidden) String() string {
|
||||
return fmt.Sprintf("[PUT /assets][%d] putAssetForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /assets][%d] putAssetForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *PutAssetForbidden) GetPayload() *crm_models.Error {
|
||||
|
|
@ -300,7 +304,7 @@ func (o *PutAssetForbidden) readResponse(response runtime.ClientResponse, consum
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -312,11 +316,9 @@ func NewPutAssetNotFound() *PutAssetNotFound {
|
|||
return &PutAssetNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutAssetNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
// PutAssetNotFound describes a response with status code 404, with default header values.
|
||||
//
|
||||
// Resource was not found
|
||||
type PutAssetNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -354,11 +356,13 @@ func (o *PutAssetNotFound) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutAssetNotFound) Error() string {
|
||||
return fmt.Sprintf("[PUT /assets][%d] putAssetNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /assets][%d] putAssetNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *PutAssetNotFound) String() string {
|
||||
return fmt.Sprintf("[PUT /assets][%d] putAssetNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /assets][%d] putAssetNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *PutAssetNotFound) GetPayload() *crm_models.Error {
|
||||
|
|
@ -377,7 +381,84 @@ func (o *PutAssetNotFound) readResponse(response runtime.ClientResponse, consume
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPutAssetConflict creates a PutAssetConflict with default headers values
|
||||
func NewPutAssetConflict() *PutAssetConflict {
|
||||
return &PutAssetConflict{}
|
||||
}
|
||||
|
||||
// PutAssetConflict describes a response with status code 409, with default header values.
|
||||
//
|
||||
// Conflict
|
||||
type PutAssetConflict struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *crm_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this put asset conflict response has a 2xx status code
|
||||
func (o *PutAssetConflict) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this put asset conflict response has a 3xx status code
|
||||
func (o *PutAssetConflict) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this put asset conflict response has a 4xx status code
|
||||
func (o *PutAssetConflict) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this put asset conflict response has a 5xx status code
|
||||
func (o *PutAssetConflict) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this put asset conflict response a status code equal to that given
|
||||
func (o *PutAssetConflict) IsCode(code int) bool {
|
||||
return code == 409
|
||||
}
|
||||
|
||||
// Code gets the status code for the put asset conflict response
|
||||
func (o *PutAssetConflict) Code() int {
|
||||
return 409
|
||||
}
|
||||
|
||||
func (o *PutAssetConflict) Error() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /assets][%d] putAssetConflict %s", 409, payload)
|
||||
}
|
||||
|
||||
func (o *PutAssetConflict) String() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /assets][%d] putAssetConflict %s", 409, payload)
|
||||
}
|
||||
|
||||
func (o *PutAssetConflict) GetPayload() *crm_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutAssetConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// hydrates response header Access-Control-Allow-Origin
|
||||
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
if hdrAccessControlAllowOrigin != "" {
|
||||
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
|
||||
}
|
||||
|
||||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -389,11 +470,9 @@ func NewPutAssetUnprocessableEntity() *PutAssetUnprocessableEntity {
|
|||
return &PutAssetUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutAssetUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
// PutAssetUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
//
|
||||
// Unprocessable Entity, likely a bad parameter
|
||||
type PutAssetUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -431,11 +510,13 @@ func (o *PutAssetUnprocessableEntity) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutAssetUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[PUT /assets][%d] putAssetUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /assets][%d] putAssetUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *PutAssetUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[PUT /assets][%d] putAssetUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /assets][%d] putAssetUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *PutAssetUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
|
|
@ -454,7 +535,7 @@ func (o *PutAssetUnprocessableEntity) readResponse(response runtime.ClientRespon
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -466,11 +547,9 @@ func NewPutAssetInternalServerError() *PutAssetInternalServerError {
|
|||
return &PutAssetInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutAssetInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
// PutAssetInternalServerError describes a response with status code 500, with default header values.
|
||||
//
|
||||
// Server Internal Error
|
||||
type PutAssetInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -508,11 +587,13 @@ func (o *PutAssetInternalServerError) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutAssetInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[PUT /assets][%d] putAssetInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /assets][%d] putAssetInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *PutAssetInternalServerError) String() string {
|
||||
return fmt.Sprintf("[PUT /assets][%d] putAssetInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /assets][%d] putAssetInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *PutAssetInternalServerError) GetPayload() *crm_models.Error {
|
||||
|
|
@ -531,7 +612,7 @@ func (o *PutAssetInternalServerError) readResponse(response runtime.ClientRespon
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,55 +6,117 @@
|
|||
|
||||
package contacts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
httptransport "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// New creates a new contacts API client.
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||
func New(transport runtime.ContextualTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
/*
|
||||
Client for contacts API
|
||||
*/
|
||||
// New creates a new contacts API client with basic auth credentials.
|
||||
//
|
||||
// It takes the following parameters:
|
||||
// - host: http host (github.com).
|
||||
// - basePath: any base path for the API client ("/v1", "/v3").
|
||||
// - scheme: http scheme ("http", "https").
|
||||
// - user: user for basic authentication header.
|
||||
// - password: password for basic authentication header.
|
||||
func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService {
|
||||
transport := httptransport.New(host, basePath, []string{scheme})
|
||||
transport.DefaultAuthentication = httptransport.BasicAuth(user, password)
|
||||
return &Client{transport: transport, formats: strfmt.Default}
|
||||
}
|
||||
|
||||
// New creates a new contacts API client with a bearer token for authentication.
|
||||
//
|
||||
// It takes the following parameters:
|
||||
// - host: http host (github.com).
|
||||
// - basePath: any base path for the API client ("/v1", "/v3").
|
||||
// - scheme: http scheme ("http", "https").
|
||||
// - bearerToken: bearer token for Bearer authentication header.
|
||||
func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService {
|
||||
transport := httptransport.New(host, basePath, []string{scheme})
|
||||
transport.DefaultAuthentication = httptransport.BearerToken(bearerToken)
|
||||
return &Client{transport: transport, formats: strfmt.Default}
|
||||
}
|
||||
|
||||
// Client for contacts API.
|
||||
type Client struct {
|
||||
transport runtime.ClientTransport
|
||||
transport runtime.ContextualTransport
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ClientOption is the option for Client methods
|
||||
// ClientOption may be used to customize the behavior of Client methods.
|
||||
type ClientOption func(*runtime.ClientOperation)
|
||||
|
||||
// ClientService is the interface for Client methods
|
||||
// ClientService is the interface for Client methods.
|
||||
type ClientService interface {
|
||||
|
||||
// DeleteContact delete a contact.
|
||||
DeleteContact(params *DeleteContactParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteContactOK, error)
|
||||
|
||||
// DeleteContactContext delete a contact.
|
||||
DeleteContactContext(ctx context.Context, params *DeleteContactParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteContactOK, error)
|
||||
|
||||
// GetContacts get a list of contacts.
|
||||
GetContacts(params *GetContactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetContactsOK, error)
|
||||
|
||||
// GetContactsContext get a list of contacts.
|
||||
GetContactsContext(ctx context.Context, params *GetContactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetContactsOK, error)
|
||||
|
||||
// PostContacts add new contacts.
|
||||
PostContacts(params *PostContactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostContactsOK, error)
|
||||
|
||||
// PostContactsContext add new contacts.
|
||||
PostContactsContext(ctx context.Context, params *PostContactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostContactsOK, error)
|
||||
|
||||
// PutContacts update contact.
|
||||
PutContacts(params *PutContactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutContactsOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
// PutContactsContext update contact.
|
||||
PutContactsContext(ctx context.Context, params *PutContactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutContactsOK, error)
|
||||
|
||||
SetTransport(transport runtime.ContextualTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteContact deletes a contact
|
||||
|
||||
Delete SalesforceDevops.net Contact record
|
||||
*/
|
||||
// DeleteContact deletes a contact.
|
||||
//
|
||||
// Delete SalesforceDevops.net Contact record.
|
||||
//
|
||||
// This method does not support injected context.
|
||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||
//
|
||||
// If you need to pass a specific context, use [Client.DeleteContactContext] instead.
|
||||
func (a *Client) DeleteContact(params *DeleteContactParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteContactOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
var ctx context.Context
|
||||
if params.inner.ctx != nil {
|
||||
ctx = params.inner.ctx
|
||||
} else {
|
||||
ctx = context.Background()
|
||||
}
|
||||
|
||||
return a.DeleteContactContext(ctx, params, authInfo, opts...)
|
||||
}
|
||||
|
||||
// DeleteContactContext deletes a contact.
|
||||
//
|
||||
// Delete SalesforceDevops.net Contact record.
|
||||
//
|
||||
// Do not use the deprecated [DeleteContactParams.Context] with this method: it would be ignored.
|
||||
func (a *Client) DeleteContactContext(ctx context.Context, params *DeleteContactParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteContactOK, error) {
|
||||
// NOTE: parameters are not validated before sending
|
||||
if params == nil {
|
||||
params = NewDeleteContactParams()
|
||||
}
|
||||
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "deleteContact",
|
||||
Method: "DELETE",
|
||||
|
|
@ -65,37 +127,63 @@ func (a *Client) DeleteContact(params *DeleteContactParams, authInfo runtime.Cli
|
|||
Params: params,
|
||||
Reader: &DeleteContactReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
result, err := a.transport.SubmitContext(ctx, op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// only one success response has to be checked
|
||||
success, ok := result.(*DeleteContactOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
|
||||
// unexpected success response.
|
||||
|
||||
// no default response is defined.
|
||||
//
|
||||
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for deleteContact: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetContacts gets a list of contacts
|
||||
|
||||
Return a list of all available Contacts
|
||||
*/
|
||||
// GetContacts gets a list of contacts.
|
||||
//
|
||||
// Return a list of all available Contacts.
|
||||
//
|
||||
// This method does not support injected context.
|
||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||
//
|
||||
// If you need to pass a specific context, use [Client.GetContactsContext] instead.
|
||||
func (a *Client) GetContacts(params *GetContactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetContactsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
var ctx context.Context
|
||||
if params.inner.ctx != nil {
|
||||
ctx = params.inner.ctx
|
||||
} else {
|
||||
ctx = context.Background()
|
||||
}
|
||||
|
||||
return a.GetContactsContext(ctx, params, authInfo, opts...)
|
||||
}
|
||||
|
||||
// GetContactsContext gets a list of contacts.
|
||||
//
|
||||
// Return a list of all available Contacts.
|
||||
//
|
||||
// Do not use the deprecated [GetContactsParams.Context] with this method: it would be ignored.
|
||||
func (a *Client) GetContactsContext(ctx context.Context, params *GetContactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetContactsOK, error) {
|
||||
// NOTE: parameters are not validated before sending
|
||||
if params == nil {
|
||||
params = NewGetContactsParams()
|
||||
}
|
||||
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getContacts",
|
||||
Method: "GET",
|
||||
|
|
@ -106,37 +194,63 @@ func (a *Client) GetContacts(params *GetContactsParams, authInfo runtime.ClientA
|
|||
Params: params,
|
||||
Reader: &GetContactsReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
result, err := a.transport.SubmitContext(ctx, op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// only one success response has to be checked
|
||||
success, ok := result.(*GetContactsOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
|
||||
// unexpected success response.
|
||||
|
||||
// no default response is defined.
|
||||
//
|
||||
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for getContacts: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostContacts adds new contacts
|
||||
|
||||
Contact record to be added
|
||||
*/
|
||||
// PostContacts adds new contacts.
|
||||
//
|
||||
// Contact record to be added.
|
||||
//
|
||||
// This method does not support injected context.
|
||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||
//
|
||||
// If you need to pass a specific context, use [Client.PostContactsContext] instead.
|
||||
func (a *Client) PostContacts(params *PostContactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostContactsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
var ctx context.Context
|
||||
if params.inner.ctx != nil {
|
||||
ctx = params.inner.ctx
|
||||
} else {
|
||||
ctx = context.Background()
|
||||
}
|
||||
|
||||
return a.PostContactsContext(ctx, params, authInfo, opts...)
|
||||
}
|
||||
|
||||
// PostContactsContext adds new contacts.
|
||||
//
|
||||
// Contact record to be added.
|
||||
//
|
||||
// Do not use the deprecated [PostContactsParams.Context] with this method: it would be ignored.
|
||||
func (a *Client) PostContactsContext(ctx context.Context, params *PostContactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostContactsOK, error) {
|
||||
// NOTE: parameters are not validated before sending
|
||||
if params == nil {
|
||||
params = NewPostContactsParams()
|
||||
}
|
||||
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "postContacts",
|
||||
Method: "POST",
|
||||
|
|
@ -147,37 +261,63 @@ func (a *Client) PostContacts(params *PostContactsParams, authInfo runtime.Clien
|
|||
Params: params,
|
||||
Reader: &PostContactsReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
result, err := a.transport.SubmitContext(ctx, op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// only one success response has to be checked
|
||||
success, ok := result.(*PostContactsOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
|
||||
// unexpected success response.
|
||||
|
||||
// no default response is defined.
|
||||
//
|
||||
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for postContacts: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PutContacts updates contact
|
||||
|
||||
Update Contact records
|
||||
*/
|
||||
// PutContacts updates contact.
|
||||
//
|
||||
// Update Contact records.
|
||||
//
|
||||
// This method does not support injected context.
|
||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||
//
|
||||
// If you need to pass a specific context, use [Client.PutContactsContext] instead.
|
||||
func (a *Client) PutContacts(params *PutContactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutContactsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
var ctx context.Context
|
||||
if params.inner.ctx != nil {
|
||||
ctx = params.inner.ctx
|
||||
} else {
|
||||
ctx = context.Background()
|
||||
}
|
||||
|
||||
return a.PutContactsContext(ctx, params, authInfo, opts...)
|
||||
}
|
||||
|
||||
// PutContactsContext updates contact.
|
||||
//
|
||||
// Update Contact records.
|
||||
//
|
||||
// Do not use the deprecated [PutContactsParams.Context] with this method: it would be ignored.
|
||||
func (a *Client) PutContactsContext(ctx context.Context, params *PutContactsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutContactsOK, error) {
|
||||
// NOTE: parameters are not validated before sending
|
||||
if params == nil {
|
||||
params = NewPutContactsParams()
|
||||
}
|
||||
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "putContacts",
|
||||
Method: "PUT",
|
||||
|
|
@ -188,28 +328,42 @@ func (a *Client) PutContacts(params *PutContactsParams, authInfo runtime.ClientA
|
|||
Params: params,
|
||||
Reader: &PutContactsReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
result, err := a.transport.SubmitContext(ctx, op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// only one success response has to be checked
|
||||
success, ok := result.(*PutContactsOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
|
||||
// unexpected success response.
|
||||
|
||||
// no default response is defined.
|
||||
//
|
||||
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for putContacts: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
// SetTransport changes the transport on the client
|
||||
func (a *Client) SetTransport(transport runtime.ClientTransport) {
|
||||
func (a *Client) SetTransport(transport runtime.ContextualTransport) {
|
||||
a.transport = transport
|
||||
}
|
||||
|
||||
// innerParams captures internal fields so they don't conflict with user-supplied parameters.
|
||||
type innerParams struct {
|
||||
timeout time.Duration
|
||||
|
||||
// Deprecated: use the operation call with context to pass the context instead of [ContactsParams].
|
||||
ctx context.Context
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,9 +6,6 @@
|
|||
|
||||
package contacts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
|
@ -27,24 +24,28 @@ import (
|
|||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewDeleteContactParams() *DeleteContactParams {
|
||||
return &DeleteContactParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
return NewDeleteContactParamsWithTimeout(cr.DefaultTimeout)
|
||||
}
|
||||
|
||||
// NewDeleteContactParamsWithTimeout creates a new DeleteContactParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewDeleteContactParamsWithTimeout(timeout time.Duration) *DeleteContactParams {
|
||||
return &DeleteContactParams{
|
||||
timeout: timeout,
|
||||
inner: innerParams{
|
||||
timeout: timeout,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteContactParamsWithContext creates a new DeleteContactParams object
|
||||
// with the ability to set a context for a request.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [DeleteContactParams].
|
||||
func NewDeleteContactParamsWithContext(ctx context.Context) *DeleteContactParams {
|
||||
return &DeleteContactParams{
|
||||
Context: ctx,
|
||||
inner: innerParams{
|
||||
ctx: ctx,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -65,15 +66,14 @@ DeleteContactParams contains all the parameters to send to the API endpoint
|
|||
*/
|
||||
type DeleteContactParams struct {
|
||||
|
||||
/* ContactID.
|
||||
|
||||
Contact record ID
|
||||
*/
|
||||
// ContactID.
|
||||
//
|
||||
// Contact record ID
|
||||
ContactID *string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
|
||||
inner innerParams
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the delete contact params (not the query body).
|
||||
|
|
@ -91,54 +91,57 @@ func (o *DeleteContactParams) SetDefaults() {
|
|||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the delete contact params
|
||||
// WithTimeout adds the timeout to the delete contact params.
|
||||
func (o *DeleteContactParams) WithTimeout(timeout time.Duration) *DeleteContactParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the delete contact params
|
||||
// SetTimeout adds the timeout to the delete contact params.
|
||||
func (o *DeleteContactParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
o.inner.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the delete contact params
|
||||
// WithContext adds the context to the delete contact params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [DeleteContactParams].
|
||||
func (o *DeleteContactParams) WithContext(ctx context.Context) *DeleteContactParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the delete contact params
|
||||
// SetContext adds the context to the delete contact params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [DeleteContactParams].
|
||||
func (o *DeleteContactParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
o.inner.ctx = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the delete contact params
|
||||
// WithHTTPClient adds the HTTPClient to the delete contact params.
|
||||
func (o *DeleteContactParams) WithHTTPClient(client *http.Client) *DeleteContactParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the delete contact params
|
||||
// SetHTTPClient adds the HTTPClient to the delete contact params.
|
||||
func (o *DeleteContactParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithContactID adds the contactID to the delete contact params
|
||||
// WithContactID adds the contactID to the delete contact params.
|
||||
func (o *DeleteContactParams) WithContactID(contactID *string) *DeleteContactParams {
|
||||
o.SetContactID(contactID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContactID adds the contactId to the delete contact params
|
||||
// SetContactID adds the contactId to the delete contact params.
|
||||
func (o *DeleteContactParams) SetContactID(contactID *string) {
|
||||
o.ContactID = contactID
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
// WriteToRequest writes these params to a [runtime.ClientRequest].
|
||||
func (o *DeleteContactParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
if err := r.SetTimeout(o.inner.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
|
|
|||
|
|
@ -6,17 +6,15 @@
|
|||
|
||||
package contacts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
stderrors "errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// DeleteContactReader is a Reader for the DeleteContact structure.
|
||||
|
|
@ -25,7 +23,7 @@ type DeleteContactReader struct {
|
|||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *DeleteContactReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
func (o *DeleteContactReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewDeleteContactOK()
|
||||
|
|
@ -64,7 +62,7 @@ func (o *DeleteContactReader) ReadResponse(response runtime.ClientResponse, cons
|
|||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
return nil, runtime.NewAPIError("[DELETE /contacts] deleteContact", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -73,11 +71,9 @@ func NewDeleteContactOK() *DeleteContactOK {
|
|||
return &DeleteContactOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteContactOK describes a response with status code 200, with default header values.
|
||||
|
||||
Response with Message Objects with Delete Status
|
||||
*/
|
||||
// DeleteContactOK describes a response with status code 200, with default header values.
|
||||
//
|
||||
// Response with Message Objects with Delete Status
|
||||
type DeleteContactOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -115,11 +111,13 @@ func (o *DeleteContactOK) Code() int {
|
|||
}
|
||||
|
||||
func (o *DeleteContactOK) Error() string {
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContactOK) String() string {
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContactOK) GetPayload() *crm_models.DeleteResponse {
|
||||
|
|
@ -138,7 +136,7 @@ func (o *DeleteContactOK) readResponse(response runtime.ClientResponse, consumer
|
|||
o.Payload = new(crm_models.DeleteResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -150,11 +148,9 @@ func NewDeleteContactUnauthorized() *DeleteContactUnauthorized {
|
|||
return &DeleteContactUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteContactUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
// DeleteContactUnauthorized describes a response with status code 401, with default header values.
|
||||
//
|
||||
// Access unauthorized, invalid API-KEY was used
|
||||
type DeleteContactUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -192,11 +188,13 @@ func (o *DeleteContactUnauthorized) Code() int {
|
|||
}
|
||||
|
||||
func (o *DeleteContactUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContactUnauthorized) String() string {
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContactUnauthorized) GetPayload() *crm_models.Error {
|
||||
|
|
@ -215,7 +213,7 @@ func (o *DeleteContactUnauthorized) readResponse(response runtime.ClientResponse
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -227,11 +225,9 @@ func NewDeleteContactForbidden() *DeleteContactForbidden {
|
|||
return &DeleteContactForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteContactForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
// DeleteContactForbidden describes a response with status code 403, with default header values.
|
||||
//
|
||||
// Access forbidden, account lacks access
|
||||
type DeleteContactForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -269,11 +265,13 @@ func (o *DeleteContactForbidden) Code() int {
|
|||
}
|
||||
|
||||
func (o *DeleteContactForbidden) Error() string {
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContactForbidden) String() string {
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContactForbidden) GetPayload() *crm_models.Error {
|
||||
|
|
@ -292,7 +290,7 @@ func (o *DeleteContactForbidden) readResponse(response runtime.ClientResponse, c
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -304,11 +302,9 @@ func NewDeleteContactNotFound() *DeleteContactNotFound {
|
|||
return &DeleteContactNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteContactNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
// DeleteContactNotFound describes a response with status code 404, with default header values.
|
||||
//
|
||||
// Resource was not found
|
||||
type DeleteContactNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -346,11 +342,13 @@ func (o *DeleteContactNotFound) Code() int {
|
|||
}
|
||||
|
||||
func (o *DeleteContactNotFound) Error() string {
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContactNotFound) String() string {
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContactNotFound) GetPayload() *crm_models.Error {
|
||||
|
|
@ -369,7 +367,7 @@ func (o *DeleteContactNotFound) readResponse(response runtime.ClientResponse, co
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -381,11 +379,9 @@ func NewDeleteContactUnprocessableEntity() *DeleteContactUnprocessableEntity {
|
|||
return &DeleteContactUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteContactUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
// DeleteContactUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
//
|
||||
// Unprocessable Entity, likely a bad parameter
|
||||
type DeleteContactUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -423,11 +419,13 @@ func (o *DeleteContactUnprocessableEntity) Code() int {
|
|||
}
|
||||
|
||||
func (o *DeleteContactUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContactUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContactUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
|
|
@ -446,7 +444,7 @@ func (o *DeleteContactUnprocessableEntity) readResponse(response runtime.ClientR
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -458,11 +456,9 @@ func NewDeleteContactInternalServerError() *DeleteContactInternalServerError {
|
|||
return &DeleteContactInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteContactInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
// DeleteContactInternalServerError describes a response with status code 500, with default header values.
|
||||
//
|
||||
// Server Internal Error
|
||||
type DeleteContactInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -500,11 +496,13 @@ func (o *DeleteContactInternalServerError) Code() int {
|
|||
}
|
||||
|
||||
func (o *DeleteContactInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContactInternalServerError) String() string {
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /contacts][%d] deleteContactInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContactInternalServerError) GetPayload() *crm_models.Error {
|
||||
|
|
@ -523,7 +521,7 @@ func (o *DeleteContactInternalServerError) readResponse(response runtime.ClientR
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,9 +6,6 @@
|
|||
|
||||
package contacts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
|
@ -18,7 +15,7 @@ import (
|
|||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/swag/conv"
|
||||
)
|
||||
|
||||
// NewGetContactsParams creates a new GetContactsParams object,
|
||||
|
|
@ -28,24 +25,28 @@ import (
|
|||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewGetContactsParams() *GetContactsParams {
|
||||
return &GetContactsParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
return NewGetContactsParamsWithTimeout(cr.DefaultTimeout)
|
||||
}
|
||||
|
||||
// NewGetContactsParamsWithTimeout creates a new GetContactsParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetContactsParamsWithTimeout(timeout time.Duration) *GetContactsParams {
|
||||
return &GetContactsParams{
|
||||
timeout: timeout,
|
||||
inner: innerParams{
|
||||
timeout: timeout,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetContactsParamsWithContext creates a new GetContactsParams object
|
||||
// with the ability to set a context for a request.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [GetContactsParams].
|
||||
func NewGetContactsParamsWithContext(ctx context.Context) *GetContactsParams {
|
||||
return &GetContactsParams{
|
||||
Context: ctx,
|
||||
inner: innerParams{
|
||||
ctx: ctx,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -66,49 +67,43 @@ GetContactsParams contains all the parameters to send to the API endpoint
|
|||
*/
|
||||
type GetContactsParams struct {
|
||||
|
||||
/* Active.
|
||||
|
||||
Only retrieve active records?
|
||||
*/
|
||||
// Active.
|
||||
//
|
||||
// Only retrieve active records?
|
||||
Active *bool
|
||||
|
||||
/* ContactID.
|
||||
|
||||
Contact record ID
|
||||
*/
|
||||
// ContactID.
|
||||
//
|
||||
// Contact record ID
|
||||
ContactID *string
|
||||
|
||||
/* Email.
|
||||
|
||||
Email address used for identity lookup
|
||||
*/
|
||||
// Email.
|
||||
//
|
||||
// Email address used for identity lookup
|
||||
Email *string
|
||||
|
||||
/* Limit.
|
||||
|
||||
How many objects to return at one time
|
||||
|
||||
Format: int64
|
||||
*/
|
||||
// Limit.
|
||||
//
|
||||
// How many objects to return at one time
|
||||
//
|
||||
// Format: int64
|
||||
Limit *int64
|
||||
|
||||
/* Offset.
|
||||
|
||||
How many objects to skip?
|
||||
|
||||
Format: int64
|
||||
*/
|
||||
// Offset.
|
||||
//
|
||||
// How many objects to skip?
|
||||
//
|
||||
// Format: int64
|
||||
Offset *int64
|
||||
|
||||
/* Slug.
|
||||
|
||||
The Slug of this Object
|
||||
*/
|
||||
// Slug.
|
||||
//
|
||||
// The Slug of this Object
|
||||
Slug *string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
|
||||
inner innerParams
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get contacts params (not the query body).
|
||||
|
|
@ -126,109 +121,112 @@ func (o *GetContactsParams) SetDefaults() {
|
|||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get contacts params
|
||||
// WithTimeout adds the timeout to the get contacts params.
|
||||
func (o *GetContactsParams) WithTimeout(timeout time.Duration) *GetContactsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get contacts params
|
||||
// SetTimeout adds the timeout to the get contacts params.
|
||||
func (o *GetContactsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
o.inner.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get contacts params
|
||||
// WithContext adds the context to the get contacts params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [GetContactsParams].
|
||||
func (o *GetContactsParams) WithContext(ctx context.Context) *GetContactsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get contacts params
|
||||
// SetContext adds the context to the get contacts params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [GetContactsParams].
|
||||
func (o *GetContactsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
o.inner.ctx = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get contacts params
|
||||
// WithHTTPClient adds the HTTPClient to the get contacts params.
|
||||
func (o *GetContactsParams) WithHTTPClient(client *http.Client) *GetContactsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get contacts params
|
||||
// SetHTTPClient adds the HTTPClient to the get contacts params.
|
||||
func (o *GetContactsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithActive adds the active to the get contacts params
|
||||
// WithActive adds the active to the get contacts params.
|
||||
func (o *GetContactsParams) WithActive(active *bool) *GetContactsParams {
|
||||
o.SetActive(active)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetActive adds the active to the get contacts params
|
||||
// SetActive adds the active to the get contacts params.
|
||||
func (o *GetContactsParams) SetActive(active *bool) {
|
||||
o.Active = active
|
||||
}
|
||||
|
||||
// WithContactID adds the contactID to the get contacts params
|
||||
// WithContactID adds the contactID to the get contacts params.
|
||||
func (o *GetContactsParams) WithContactID(contactID *string) *GetContactsParams {
|
||||
o.SetContactID(contactID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContactID adds the contactId to the get contacts params
|
||||
// SetContactID adds the contactId to the get contacts params.
|
||||
func (o *GetContactsParams) SetContactID(contactID *string) {
|
||||
o.ContactID = contactID
|
||||
}
|
||||
|
||||
// WithEmail adds the email to the get contacts params
|
||||
// WithEmail adds the email to the get contacts params.
|
||||
func (o *GetContactsParams) WithEmail(email *string) *GetContactsParams {
|
||||
o.SetEmail(email)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetEmail adds the email to the get contacts params
|
||||
// SetEmail adds the email to the get contacts params.
|
||||
func (o *GetContactsParams) SetEmail(email *string) {
|
||||
o.Email = email
|
||||
}
|
||||
|
||||
// WithLimit adds the limit to the get contacts params
|
||||
// WithLimit adds the limit to the get contacts params.
|
||||
func (o *GetContactsParams) WithLimit(limit *int64) *GetContactsParams {
|
||||
o.SetLimit(limit)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetLimit adds the limit to the get contacts params
|
||||
// SetLimit adds the limit to the get contacts params.
|
||||
func (o *GetContactsParams) SetLimit(limit *int64) {
|
||||
o.Limit = limit
|
||||
}
|
||||
|
||||
// WithOffset adds the offset to the get contacts params
|
||||
// WithOffset adds the offset to the get contacts params.
|
||||
func (o *GetContactsParams) WithOffset(offset *int64) *GetContactsParams {
|
||||
o.SetOffset(offset)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetOffset adds the offset to the get contacts params
|
||||
// SetOffset adds the offset to the get contacts params.
|
||||
func (o *GetContactsParams) SetOffset(offset *int64) {
|
||||
o.Offset = offset
|
||||
}
|
||||
|
||||
// WithSlug adds the slug to the get contacts params
|
||||
// WithSlug adds the slug to the get contacts params.
|
||||
func (o *GetContactsParams) WithSlug(slug *string) *GetContactsParams {
|
||||
o.SetSlug(slug)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetSlug adds the slug to the get contacts params
|
||||
// SetSlug adds the slug to the get contacts params.
|
||||
func (o *GetContactsParams) SetSlug(slug *string) {
|
||||
o.Slug = slug
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
// WriteToRequest writes these params to a [runtime.ClientRequest].
|
||||
func (o *GetContactsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
if err := r.SetTimeout(o.inner.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
|
@ -241,7 +239,7 @@ func (o *GetContactsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R
|
|||
if o.Active != nil {
|
||||
qrActive = *o.Active
|
||||
}
|
||||
qActive := swag.FormatBool(qrActive)
|
||||
qActive := conv.FormatBool(qrActive)
|
||||
if qActive != "" {
|
||||
|
||||
if err := r.SetQueryParam("active", qActive); err != nil {
|
||||
|
|
@ -292,7 +290,7 @@ func (o *GetContactsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R
|
|||
if o.Limit != nil {
|
||||
qrLimit = *o.Limit
|
||||
}
|
||||
qLimit := swag.FormatInt64(qrLimit)
|
||||
qLimit := conv.FormatInteger(qrLimit)
|
||||
if qLimit != "" {
|
||||
|
||||
if err := r.SetQueryParam("limit", qLimit); err != nil {
|
||||
|
|
@ -309,7 +307,7 @@ func (o *GetContactsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R
|
|||
if o.Offset != nil {
|
||||
qrOffset = *o.Offset
|
||||
}
|
||||
qOffset := swag.FormatInt64(qrOffset)
|
||||
qOffset := conv.FormatInteger(qrOffset)
|
||||
if qOffset != "" {
|
||||
|
||||
if err := r.SetQueryParam("offset", qOffset); err != nil {
|
||||
|
|
|
|||
|
|
@ -6,17 +6,15 @@
|
|||
|
||||
package contacts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
stderrors "errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// GetContactsReader is a Reader for the GetContacts structure.
|
||||
|
|
@ -25,7 +23,7 @@ type GetContactsReader struct {
|
|||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetContactsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
func (o *GetContactsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetContactsOK()
|
||||
|
|
@ -64,7 +62,7 @@ func (o *GetContactsReader) ReadResponse(response runtime.ClientResponse, consum
|
|||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
return nil, runtime.NewAPIError("[GET /contacts] getContacts", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -73,11 +71,9 @@ func NewGetContactsOK() *GetContactsOK {
|
|||
return &GetContactsOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetContactsOK describes a response with status code 200, with default header values.
|
||||
|
||||
Response with an array of Contact objects
|
||||
*/
|
||||
// GetContactsOK describes a response with status code 200, with default header values.
|
||||
//
|
||||
// Response with an array of Contact objects
|
||||
type GetContactsOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
CacheControl string
|
||||
|
|
@ -116,11 +112,13 @@ func (o *GetContactsOK) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetContactsOK) Error() string {
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsOK) String() string {
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsOK) GetPayload() *crm_models.ContactResponse {
|
||||
|
|
@ -146,7 +144,7 @@ func (o *GetContactsOK) readResponse(response runtime.ClientResponse, consumer r
|
|||
o.Payload = new(crm_models.ContactResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -158,11 +156,9 @@ func NewGetContactsUnauthorized() *GetContactsUnauthorized {
|
|||
return &GetContactsUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetContactsUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
// GetContactsUnauthorized describes a response with status code 401, with default header values.
|
||||
//
|
||||
// Access unauthorized, invalid API-KEY was used
|
||||
type GetContactsUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -200,11 +196,13 @@ func (o *GetContactsUnauthorized) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetContactsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsUnauthorized) String() string {
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsUnauthorized) GetPayload() *crm_models.Error {
|
||||
|
|
@ -223,7 +221,7 @@ func (o *GetContactsUnauthorized) readResponse(response runtime.ClientResponse,
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -235,11 +233,9 @@ func NewGetContactsForbidden() *GetContactsForbidden {
|
|||
return &GetContactsForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetContactsForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
// GetContactsForbidden describes a response with status code 403, with default header values.
|
||||
//
|
||||
// Access forbidden, account lacks access
|
||||
type GetContactsForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -277,11 +273,13 @@ func (o *GetContactsForbidden) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetContactsForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsForbidden) String() string {
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsForbidden) GetPayload() *crm_models.Error {
|
||||
|
|
@ -300,7 +298,7 @@ func (o *GetContactsForbidden) readResponse(response runtime.ClientResponse, con
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -312,11 +310,9 @@ func NewGetContactsNotFound() *GetContactsNotFound {
|
|||
return &GetContactsNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetContactsNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
// GetContactsNotFound describes a response with status code 404, with default header values.
|
||||
//
|
||||
// Resource was not found
|
||||
type GetContactsNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -354,11 +350,13 @@ func (o *GetContactsNotFound) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetContactsNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsNotFound) String() string {
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsNotFound) GetPayload() *crm_models.Error {
|
||||
|
|
@ -377,7 +375,7 @@ func (o *GetContactsNotFound) readResponse(response runtime.ClientResponse, cons
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -389,11 +387,9 @@ func NewGetContactsUnprocessableEntity() *GetContactsUnprocessableEntity {
|
|||
return &GetContactsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetContactsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
// GetContactsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
//
|
||||
// Unprocessable Entity, likely a bad parameter
|
||||
type GetContactsUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -431,11 +427,13 @@ func (o *GetContactsUnprocessableEntity) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetContactsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
|
|
@ -454,7 +452,7 @@ func (o *GetContactsUnprocessableEntity) readResponse(response runtime.ClientRes
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -466,11 +464,9 @@ func NewGetContactsInternalServerError() *GetContactsInternalServerError {
|
|||
return &GetContactsInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetContactsInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
// GetContactsInternalServerError describes a response with status code 500, with default header values.
|
||||
//
|
||||
// Server Internal Error
|
||||
type GetContactsInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -508,11 +504,13 @@ func (o *GetContactsInternalServerError) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetContactsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsInternalServerError) String() string {
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /contacts][%d] getContactsInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *GetContactsInternalServerError) GetPayload() *crm_models.Error {
|
||||
|
|
@ -531,7 +529,7 @@ func (o *GetContactsInternalServerError) readResponse(response runtime.ClientRes
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,20 +6,16 @@
|
|||
|
||||
package contacts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// NewPostContactsParams creates a new PostContactsParams object,
|
||||
|
|
@ -29,24 +25,28 @@ import (
|
|||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewPostContactsParams() *PostContactsParams {
|
||||
return &PostContactsParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
return NewPostContactsParamsWithTimeout(cr.DefaultTimeout)
|
||||
}
|
||||
|
||||
// NewPostContactsParamsWithTimeout creates a new PostContactsParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostContactsParamsWithTimeout(timeout time.Duration) *PostContactsParams {
|
||||
return &PostContactsParams{
|
||||
timeout: timeout,
|
||||
inner: innerParams{
|
||||
timeout: timeout,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostContactsParamsWithContext creates a new PostContactsParams object
|
||||
// with the ability to set a context for a request.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PostContactsParams].
|
||||
func NewPostContactsParamsWithContext(ctx context.Context) *PostContactsParams {
|
||||
return &PostContactsParams{
|
||||
Context: ctx,
|
||||
inner: innerParams{
|
||||
ctx: ctx,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -67,15 +67,14 @@ PostContactsParams contains all the parameters to send to the API endpoint
|
|||
*/
|
||||
type PostContactsParams struct {
|
||||
|
||||
/* ContactsRequest.
|
||||
|
||||
An array of new Contact records
|
||||
*/
|
||||
// ContactsRequest.
|
||||
//
|
||||
// An array of new Contact records
|
||||
ContactsRequest *crm_models.ContactRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
|
||||
inner innerParams
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the post contacts params (not the query body).
|
||||
|
|
@ -93,54 +92,57 @@ func (o *PostContactsParams) SetDefaults() {
|
|||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post contacts params
|
||||
// WithTimeout adds the timeout to the post contacts params.
|
||||
func (o *PostContactsParams) WithTimeout(timeout time.Duration) *PostContactsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post contacts params
|
||||
// SetTimeout adds the timeout to the post contacts params.
|
||||
func (o *PostContactsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
o.inner.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post contacts params
|
||||
// WithContext adds the context to the post contacts params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PostContactsParams].
|
||||
func (o *PostContactsParams) WithContext(ctx context.Context) *PostContactsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post contacts params
|
||||
// SetContext adds the context to the post contacts params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PostContactsParams].
|
||||
func (o *PostContactsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
o.inner.ctx = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post contacts params
|
||||
// WithHTTPClient adds the HTTPClient to the post contacts params.
|
||||
func (o *PostContactsParams) WithHTTPClient(client *http.Client) *PostContactsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post contacts params
|
||||
// SetHTTPClient adds the HTTPClient to the post contacts params.
|
||||
func (o *PostContactsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithContactsRequest adds the contactsRequest to the post contacts params
|
||||
// WithContactsRequest adds the contactsRequest to the post contacts params.
|
||||
func (o *PostContactsParams) WithContactsRequest(contactsRequest *crm_models.ContactRequest) *PostContactsParams {
|
||||
o.SetContactsRequest(contactsRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContactsRequest adds the contactsRequest to the post contacts params
|
||||
// SetContactsRequest adds the contactsRequest to the post contacts params.
|
||||
func (o *PostContactsParams) SetContactsRequest(contactsRequest *crm_models.ContactRequest) {
|
||||
o.ContactsRequest = contactsRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
// WriteToRequest writes these params to a [runtime.ClientRequest].
|
||||
func (o *PostContactsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
if err := r.SetTimeout(o.inner.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
|
|
|||
|
|
@ -6,17 +6,15 @@
|
|||
|
||||
package contacts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
stderrors "errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// PostContactsReader is a Reader for the PostContacts structure.
|
||||
|
|
@ -25,7 +23,7 @@ type PostContactsReader struct {
|
|||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostContactsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
func (o *PostContactsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPostContactsOK()
|
||||
|
|
@ -64,7 +62,7 @@ func (o *PostContactsReader) ReadResponse(response runtime.ClientResponse, consu
|
|||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
return nil, runtime.NewAPIError("[POST /contacts] postContacts", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -73,11 +71,9 @@ func NewPostContactsOK() *PostContactsOK {
|
|||
return &PostContactsOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostContactsOK describes a response with status code 200, with default header values.
|
||||
|
||||
Response with an array of Contact objects
|
||||
*/
|
||||
// PostContactsOK describes a response with status code 200, with default header values.
|
||||
//
|
||||
// Response with an array of Contact objects
|
||||
type PostContactsOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
CacheControl string
|
||||
|
|
@ -116,11 +112,13 @@ func (o *PostContactsOK) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostContactsOK) Error() string {
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *PostContactsOK) String() string {
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *PostContactsOK) GetPayload() *crm_models.ContactResponse {
|
||||
|
|
@ -146,7 +144,7 @@ func (o *PostContactsOK) readResponse(response runtime.ClientResponse, consumer
|
|||
o.Payload = new(crm_models.ContactResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -158,11 +156,9 @@ func NewPostContactsUnauthorized() *PostContactsUnauthorized {
|
|||
return &PostContactsUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostContactsUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
// PostContactsUnauthorized describes a response with status code 401, with default header values.
|
||||
//
|
||||
// Access unauthorized, invalid API-KEY was used
|
||||
type PostContactsUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -200,11 +196,13 @@ func (o *PostContactsUnauthorized) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostContactsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *PostContactsUnauthorized) String() string {
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *PostContactsUnauthorized) GetPayload() *crm_models.Error {
|
||||
|
|
@ -223,7 +221,7 @@ func (o *PostContactsUnauthorized) readResponse(response runtime.ClientResponse,
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -235,11 +233,9 @@ func NewPostContactsForbidden() *PostContactsForbidden {
|
|||
return &PostContactsForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostContactsForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
// PostContactsForbidden describes a response with status code 403, with default header values.
|
||||
//
|
||||
// Access forbidden, account lacks access
|
||||
type PostContactsForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -277,11 +273,13 @@ func (o *PostContactsForbidden) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostContactsForbidden) Error() string {
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *PostContactsForbidden) String() string {
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *PostContactsForbidden) GetPayload() *crm_models.Error {
|
||||
|
|
@ -300,7 +298,7 @@ func (o *PostContactsForbidden) readResponse(response runtime.ClientResponse, co
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -312,11 +310,9 @@ func NewPostContactsNotFound() *PostContactsNotFound {
|
|||
return &PostContactsNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostContactsNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
// PostContactsNotFound describes a response with status code 404, with default header values.
|
||||
//
|
||||
// Resource was not found
|
||||
type PostContactsNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -354,11 +350,13 @@ func (o *PostContactsNotFound) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostContactsNotFound) Error() string {
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *PostContactsNotFound) String() string {
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *PostContactsNotFound) GetPayload() *crm_models.Error {
|
||||
|
|
@ -377,7 +375,7 @@ func (o *PostContactsNotFound) readResponse(response runtime.ClientResponse, con
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -389,11 +387,9 @@ func NewPostContactsUnprocessableEntity() *PostContactsUnprocessableEntity {
|
|||
return &PostContactsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostContactsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
// PostContactsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
//
|
||||
// Unprocessable Entity, likely a bad parameter
|
||||
type PostContactsUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -431,11 +427,13 @@ func (o *PostContactsUnprocessableEntity) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostContactsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *PostContactsUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *PostContactsUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
|
|
@ -454,7 +452,7 @@ func (o *PostContactsUnprocessableEntity) readResponse(response runtime.ClientRe
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -466,11 +464,9 @@ func NewPostContactsInternalServerError() *PostContactsInternalServerError {
|
|||
return &PostContactsInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostContactsInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
// PostContactsInternalServerError describes a response with status code 500, with default header values.
|
||||
//
|
||||
// Server Internal Error
|
||||
type PostContactsInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -508,11 +504,13 @@ func (o *PostContactsInternalServerError) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostContactsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *PostContactsInternalServerError) String() string {
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /contacts][%d] postContactsInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *PostContactsInternalServerError) GetPayload() *crm_models.Error {
|
||||
|
|
@ -531,7 +529,7 @@ func (o *PostContactsInternalServerError) readResponse(response runtime.ClientRe
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,20 +6,16 @@
|
|||
|
||||
package contacts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// NewPutContactsParams creates a new PutContactsParams object,
|
||||
|
|
@ -29,24 +25,28 @@ import (
|
|||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewPutContactsParams() *PutContactsParams {
|
||||
return &PutContactsParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
return NewPutContactsParamsWithTimeout(cr.DefaultTimeout)
|
||||
}
|
||||
|
||||
// NewPutContactsParamsWithTimeout creates a new PutContactsParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPutContactsParamsWithTimeout(timeout time.Duration) *PutContactsParams {
|
||||
return &PutContactsParams{
|
||||
timeout: timeout,
|
||||
inner: innerParams{
|
||||
timeout: timeout,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutContactsParamsWithContext creates a new PutContactsParams object
|
||||
// with the ability to set a context for a request.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PutContactsParams].
|
||||
func NewPutContactsParamsWithContext(ctx context.Context) *PutContactsParams {
|
||||
return &PutContactsParams{
|
||||
Context: ctx,
|
||||
inner: innerParams{
|
||||
ctx: ctx,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -67,15 +67,14 @@ PutContactsParams contains all the parameters to send to the API endpoint
|
|||
*/
|
||||
type PutContactsParams struct {
|
||||
|
||||
/* ContactsRequest.
|
||||
|
||||
An array of new Contact records
|
||||
*/
|
||||
// ContactsRequest.
|
||||
//
|
||||
// An array of new Contact records
|
||||
ContactsRequest *crm_models.ContactRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
|
||||
inner innerParams
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the put contacts params (not the query body).
|
||||
|
|
@ -93,54 +92,57 @@ func (o *PutContactsParams) SetDefaults() {
|
|||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the put contacts params
|
||||
// WithTimeout adds the timeout to the put contacts params.
|
||||
func (o *PutContactsParams) WithTimeout(timeout time.Duration) *PutContactsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the put contacts params
|
||||
// SetTimeout adds the timeout to the put contacts params.
|
||||
func (o *PutContactsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
o.inner.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the put contacts params
|
||||
// WithContext adds the context to the put contacts params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PutContactsParams].
|
||||
func (o *PutContactsParams) WithContext(ctx context.Context) *PutContactsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the put contacts params
|
||||
// SetContext adds the context to the put contacts params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PutContactsParams].
|
||||
func (o *PutContactsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
o.inner.ctx = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the put contacts params
|
||||
// WithHTTPClient adds the HTTPClient to the put contacts params.
|
||||
func (o *PutContactsParams) WithHTTPClient(client *http.Client) *PutContactsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the put contacts params
|
||||
// SetHTTPClient adds the HTTPClient to the put contacts params.
|
||||
func (o *PutContactsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithContactsRequest adds the contactsRequest to the put contacts params
|
||||
// WithContactsRequest adds the contactsRequest to the put contacts params.
|
||||
func (o *PutContactsParams) WithContactsRequest(contactsRequest *crm_models.ContactRequest) *PutContactsParams {
|
||||
o.SetContactsRequest(contactsRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContactsRequest adds the contactsRequest to the put contacts params
|
||||
// SetContactsRequest adds the contactsRequest to the put contacts params.
|
||||
func (o *PutContactsParams) SetContactsRequest(contactsRequest *crm_models.ContactRequest) {
|
||||
o.ContactsRequest = contactsRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
// WriteToRequest writes these params to a [runtime.ClientRequest].
|
||||
func (o *PutContactsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
if err := r.SetTimeout(o.inner.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
|
|
|||
|
|
@ -6,17 +6,15 @@
|
|||
|
||||
package contacts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
stderrors "errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// PutContactsReader is a Reader for the PutContacts structure.
|
||||
|
|
@ -25,7 +23,7 @@ type PutContactsReader struct {
|
|||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PutContactsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
func (o *PutContactsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPutContactsOK()
|
||||
|
|
@ -64,7 +62,7 @@ func (o *PutContactsReader) ReadResponse(response runtime.ClientResponse, consum
|
|||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
return nil, runtime.NewAPIError("[PUT /contacts] putContacts", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -73,11 +71,9 @@ func NewPutContactsOK() *PutContactsOK {
|
|||
return &PutContactsOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutContactsOK describes a response with status code 200, with default header values.
|
||||
|
||||
Response with an array of Contact objects
|
||||
*/
|
||||
// PutContactsOK describes a response with status code 200, with default header values.
|
||||
//
|
||||
// Response with an array of Contact objects
|
||||
type PutContactsOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
CacheControl string
|
||||
|
|
@ -116,11 +112,13 @@ func (o *PutContactsOK) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutContactsOK) Error() string {
|
||||
return fmt.Sprintf("[PUT /contacts][%d] putContactsOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /contacts][%d] putContactsOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *PutContactsOK) String() string {
|
||||
return fmt.Sprintf("[PUT /contacts][%d] putContactsOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /contacts][%d] putContactsOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *PutContactsOK) GetPayload() *crm_models.ContactResponse {
|
||||
|
|
@ -146,7 +144,7 @@ func (o *PutContactsOK) readResponse(response runtime.ClientResponse, consumer r
|
|||
o.Payload = new(crm_models.ContactResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -158,11 +156,9 @@ func NewPutContactsUnauthorized() *PutContactsUnauthorized {
|
|||
return &PutContactsUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutContactsUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
// PutContactsUnauthorized describes a response with status code 401, with default header values.
|
||||
//
|
||||
// Access unauthorized, invalid API-KEY was used
|
||||
type PutContactsUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -200,11 +196,13 @@ func (o *PutContactsUnauthorized) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutContactsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[PUT /contacts][%d] putContactsUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /contacts][%d] putContactsUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *PutContactsUnauthorized) String() string {
|
||||
return fmt.Sprintf("[PUT /contacts][%d] putContactsUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /contacts][%d] putContactsUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *PutContactsUnauthorized) GetPayload() *crm_models.Error {
|
||||
|
|
@ -223,7 +221,7 @@ func (o *PutContactsUnauthorized) readResponse(response runtime.ClientResponse,
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -235,11 +233,9 @@ func NewPutContactsForbidden() *PutContactsForbidden {
|
|||
return &PutContactsForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutContactsForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
// PutContactsForbidden describes a response with status code 403, with default header values.
|
||||
//
|
||||
// Access forbidden, account lacks access
|
||||
type PutContactsForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -277,11 +273,13 @@ func (o *PutContactsForbidden) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutContactsForbidden) Error() string {
|
||||
return fmt.Sprintf("[PUT /contacts][%d] putContactsForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /contacts][%d] putContactsForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *PutContactsForbidden) String() string {
|
||||
return fmt.Sprintf("[PUT /contacts][%d] putContactsForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /contacts][%d] putContactsForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *PutContactsForbidden) GetPayload() *crm_models.Error {
|
||||
|
|
@ -300,7 +298,7 @@ func (o *PutContactsForbidden) readResponse(response runtime.ClientResponse, con
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -312,11 +310,9 @@ func NewPutContactsNotFound() *PutContactsNotFound {
|
|||
return &PutContactsNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutContactsNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
// PutContactsNotFound describes a response with status code 404, with default header values.
|
||||
//
|
||||
// Resource was not found
|
||||
type PutContactsNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -354,11 +350,13 @@ func (o *PutContactsNotFound) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutContactsNotFound) Error() string {
|
||||
return fmt.Sprintf("[PUT /contacts][%d] putContactsNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /contacts][%d] putContactsNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *PutContactsNotFound) String() string {
|
||||
return fmt.Sprintf("[PUT /contacts][%d] putContactsNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /contacts][%d] putContactsNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *PutContactsNotFound) GetPayload() *crm_models.Error {
|
||||
|
|
@ -377,7 +375,7 @@ func (o *PutContactsNotFound) readResponse(response runtime.ClientResponse, cons
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -389,11 +387,9 @@ func NewPutContactsUnprocessableEntity() *PutContactsUnprocessableEntity {
|
|||
return &PutContactsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutContactsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
// PutContactsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
//
|
||||
// Unprocessable Entity, likely a bad parameter
|
||||
type PutContactsUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -431,11 +427,13 @@ func (o *PutContactsUnprocessableEntity) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutContactsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[PUT /contacts][%d] putContactsUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /contacts][%d] putContactsUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *PutContactsUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[PUT /contacts][%d] putContactsUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /contacts][%d] putContactsUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *PutContactsUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
|
|
@ -454,7 +452,7 @@ func (o *PutContactsUnprocessableEntity) readResponse(response runtime.ClientRes
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -466,11 +464,9 @@ func NewPutContactsInternalServerError() *PutContactsInternalServerError {
|
|||
return &PutContactsInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutContactsInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
// PutContactsInternalServerError describes a response with status code 500, with default header values.
|
||||
//
|
||||
// Server Internal Error
|
||||
type PutContactsInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -508,11 +504,13 @@ func (o *PutContactsInternalServerError) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutContactsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[PUT /contacts][%d] putContactsInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /contacts][%d] putContactsInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *PutContactsInternalServerError) String() string {
|
||||
return fmt.Sprintf("[PUT /contacts][%d] putContactsInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /contacts][%d] putContactsInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *PutContactsInternalServerError) GetPayload() *crm_models.Error {
|
||||
|
|
@ -531,7 +529,7 @@ func (o *PutContactsInternalServerError) readResponse(response runtime.ClientRes
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,55 +6,117 @@
|
|||
|
||||
package contracts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
httptransport "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// New creates a new contracts API client.
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||
func New(transport runtime.ContextualTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
/*
|
||||
Client for contracts API
|
||||
*/
|
||||
// New creates a new contracts API client with basic auth credentials.
|
||||
//
|
||||
// It takes the following parameters:
|
||||
// - host: http host (github.com).
|
||||
// - basePath: any base path for the API client ("/v1", "/v3").
|
||||
// - scheme: http scheme ("http", "https").
|
||||
// - user: user for basic authentication header.
|
||||
// - password: password for basic authentication header.
|
||||
func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService {
|
||||
transport := httptransport.New(host, basePath, []string{scheme})
|
||||
transport.DefaultAuthentication = httptransport.BasicAuth(user, password)
|
||||
return &Client{transport: transport, formats: strfmt.Default}
|
||||
}
|
||||
|
||||
// New creates a new contracts API client with a bearer token for authentication.
|
||||
//
|
||||
// It takes the following parameters:
|
||||
// - host: http host (github.com).
|
||||
// - basePath: any base path for the API client ("/v1", "/v3").
|
||||
// - scheme: http scheme ("http", "https").
|
||||
// - bearerToken: bearer token for Bearer authentication header.
|
||||
func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService {
|
||||
transport := httptransport.New(host, basePath, []string{scheme})
|
||||
transport.DefaultAuthentication = httptransport.BearerToken(bearerToken)
|
||||
return &Client{transport: transport, formats: strfmt.Default}
|
||||
}
|
||||
|
||||
// Client for contracts API.
|
||||
type Client struct {
|
||||
transport runtime.ClientTransport
|
||||
transport runtime.ContextualTransport
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ClientOption is the option for Client methods
|
||||
// ClientOption may be used to customize the behavior of Client methods.
|
||||
type ClientOption func(*runtime.ClientOperation)
|
||||
|
||||
// ClientService is the interface for Client methods
|
||||
// ClientService is the interface for Client methods.
|
||||
type ClientService interface {
|
||||
|
||||
// DeleteContract delete an contract.
|
||||
DeleteContract(params *DeleteContractParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteContractOK, error)
|
||||
|
||||
// DeleteContractContext delete an contract.
|
||||
DeleteContractContext(ctx context.Context, params *DeleteContractParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteContractOK, error)
|
||||
|
||||
// GetContracts get a list of contracts.
|
||||
GetContracts(params *GetContractsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetContractsOK, error)
|
||||
|
||||
// GetContractsContext get a list of contracts.
|
||||
GetContractsContext(ctx context.Context, params *GetContractsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetContractsOK, error)
|
||||
|
||||
// PostContracts add a new contract to salesforce devops net.
|
||||
PostContracts(params *PostContractsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostContractsOK, error)
|
||||
|
||||
// PostContractsContext add a new contract to salesforce devops net.
|
||||
PostContractsContext(ctx context.Context, params *PostContractsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostContractsOK, error)
|
||||
|
||||
// PutContract update a single contract.
|
||||
PutContract(params *PutContractParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutContractOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
// PutContractContext update a single contract.
|
||||
PutContractContext(ctx context.Context, params *PutContractParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutContractOK, error)
|
||||
|
||||
SetTransport(transport runtime.ContextualTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteContract deletes an contract
|
||||
|
||||
Delete SalesforceDevops.net Contract record
|
||||
*/
|
||||
// DeleteContract deletes an contract.
|
||||
//
|
||||
// Delete SalesforceDevops.net Contract record.
|
||||
//
|
||||
// This method does not support injected context.
|
||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||
//
|
||||
// If you need to pass a specific context, use [Client.DeleteContractContext] instead.
|
||||
func (a *Client) DeleteContract(params *DeleteContractParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteContractOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
var ctx context.Context
|
||||
if params.inner.ctx != nil {
|
||||
ctx = params.inner.ctx
|
||||
} else {
|
||||
ctx = context.Background()
|
||||
}
|
||||
|
||||
return a.DeleteContractContext(ctx, params, authInfo, opts...)
|
||||
}
|
||||
|
||||
// DeleteContractContext deletes an contract.
|
||||
//
|
||||
// Delete SalesforceDevops.net Contract record.
|
||||
//
|
||||
// Do not use the deprecated [DeleteContractParams.Context] with this method: it would be ignored.
|
||||
func (a *Client) DeleteContractContext(ctx context.Context, params *DeleteContractParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteContractOK, error) {
|
||||
// NOTE: parameters are not validated before sending
|
||||
if params == nil {
|
||||
params = NewDeleteContractParams()
|
||||
}
|
||||
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "deleteContract",
|
||||
Method: "DELETE",
|
||||
|
|
@ -65,37 +127,63 @@ func (a *Client) DeleteContract(params *DeleteContractParams, authInfo runtime.C
|
|||
Params: params,
|
||||
Reader: &DeleteContractReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
result, err := a.transport.SubmitContext(ctx, op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// only one success response has to be checked
|
||||
success, ok := result.(*DeleteContractOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
|
||||
// unexpected success response.
|
||||
|
||||
// no default response is defined.
|
||||
//
|
||||
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for deleteContract: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetContracts gets a list of contracts
|
||||
|
||||
Return a list of all available Contracts
|
||||
*/
|
||||
// GetContracts gets a list of contracts.
|
||||
//
|
||||
// Return a list of all available Contracts.
|
||||
//
|
||||
// This method does not support injected context.
|
||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||
//
|
||||
// If you need to pass a specific context, use [Client.GetContractsContext] instead.
|
||||
func (a *Client) GetContracts(params *GetContractsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetContractsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
var ctx context.Context
|
||||
if params.inner.ctx != nil {
|
||||
ctx = params.inner.ctx
|
||||
} else {
|
||||
ctx = context.Background()
|
||||
}
|
||||
|
||||
return a.GetContractsContext(ctx, params, authInfo, opts...)
|
||||
}
|
||||
|
||||
// GetContractsContext gets a list of contracts.
|
||||
//
|
||||
// Return a list of all available Contracts.
|
||||
//
|
||||
// Do not use the deprecated [GetContractsParams.Context] with this method: it would be ignored.
|
||||
func (a *Client) GetContractsContext(ctx context.Context, params *GetContractsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetContractsOK, error) {
|
||||
// NOTE: parameters are not validated before sending
|
||||
if params == nil {
|
||||
params = NewGetContractsParams()
|
||||
}
|
||||
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getContracts",
|
||||
Method: "GET",
|
||||
|
|
@ -106,37 +194,63 @@ func (a *Client) GetContracts(params *GetContractsParams, authInfo runtime.Clien
|
|||
Params: params,
|
||||
Reader: &GetContractsReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
result, err := a.transport.SubmitContext(ctx, op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// only one success response has to be checked
|
||||
success, ok := result.(*GetContractsOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
|
||||
// unexpected success response.
|
||||
|
||||
// no default response is defined.
|
||||
//
|
||||
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for getContracts: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostContracts adds a new contract to salesforce devops net
|
||||
|
||||
Contract record to be added
|
||||
*/
|
||||
// PostContracts adds a new contract to salesforce devops net.
|
||||
//
|
||||
// Contract record to be added.
|
||||
//
|
||||
// This method does not support injected context.
|
||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||
//
|
||||
// If you need to pass a specific context, use [Client.PostContractsContext] instead.
|
||||
func (a *Client) PostContracts(params *PostContractsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostContractsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
var ctx context.Context
|
||||
if params.inner.ctx != nil {
|
||||
ctx = params.inner.ctx
|
||||
} else {
|
||||
ctx = context.Background()
|
||||
}
|
||||
|
||||
return a.PostContractsContext(ctx, params, authInfo, opts...)
|
||||
}
|
||||
|
||||
// PostContractsContext adds a new contract to salesforce devops net.
|
||||
//
|
||||
// Contract record to be added.
|
||||
//
|
||||
// Do not use the deprecated [PostContractsParams.Context] with this method: it would be ignored.
|
||||
func (a *Client) PostContractsContext(ctx context.Context, params *PostContractsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostContractsOK, error) {
|
||||
// NOTE: parameters are not validated before sending
|
||||
if params == nil {
|
||||
params = NewPostContractsParams()
|
||||
}
|
||||
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "postContracts",
|
||||
Method: "POST",
|
||||
|
|
@ -147,37 +261,63 @@ func (a *Client) PostContracts(params *PostContractsParams, authInfo runtime.Cli
|
|||
Params: params,
|
||||
Reader: &PostContractsReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
result, err := a.transport.SubmitContext(ctx, op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// only one success response has to be checked
|
||||
success, ok := result.(*PostContractsOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
|
||||
// unexpected success response.
|
||||
|
||||
// no default response is defined.
|
||||
//
|
||||
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for postContracts: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PutContract updates a single contract
|
||||
|
||||
Update a single contract specified by contractId
|
||||
*/
|
||||
// PutContract updates a single contract.
|
||||
//
|
||||
// Update a single contract specified by contractId.
|
||||
//
|
||||
// This method does not support injected context.
|
||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||
//
|
||||
// If you need to pass a specific context, use [Client.PutContractContext] instead.
|
||||
func (a *Client) PutContract(params *PutContractParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutContractOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
var ctx context.Context
|
||||
if params.inner.ctx != nil {
|
||||
ctx = params.inner.ctx
|
||||
} else {
|
||||
ctx = context.Background()
|
||||
}
|
||||
|
||||
return a.PutContractContext(ctx, params, authInfo, opts...)
|
||||
}
|
||||
|
||||
// PutContractContext updates a single contract.
|
||||
//
|
||||
// Update a single contract specified by contractId.
|
||||
//
|
||||
// Do not use the deprecated [PutContractParams.Context] with this method: it would be ignored.
|
||||
func (a *Client) PutContractContext(ctx context.Context, params *PutContractParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutContractOK, error) {
|
||||
// NOTE: parameters are not validated before sending
|
||||
if params == nil {
|
||||
params = NewPutContractParams()
|
||||
}
|
||||
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "putContract",
|
||||
Method: "PUT",
|
||||
|
|
@ -188,28 +328,42 @@ func (a *Client) PutContract(params *PutContractParams, authInfo runtime.ClientA
|
|||
Params: params,
|
||||
Reader: &PutContractReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
result, err := a.transport.SubmitContext(ctx, op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// only one success response has to be checked
|
||||
success, ok := result.(*PutContractOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
|
||||
// unexpected success response.
|
||||
|
||||
// no default response is defined.
|
||||
//
|
||||
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for putContract: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
// SetTransport changes the transport on the client
|
||||
func (a *Client) SetTransport(transport runtime.ClientTransport) {
|
||||
func (a *Client) SetTransport(transport runtime.ContextualTransport) {
|
||||
a.transport = transport
|
||||
}
|
||||
|
||||
// innerParams captures internal fields so they don't conflict with user-supplied parameters.
|
||||
type innerParams struct {
|
||||
timeout time.Duration
|
||||
|
||||
// Deprecated: use the operation call with context to pass the context instead of [ContractsParams].
|
||||
ctx context.Context
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,9 +6,6 @@
|
|||
|
||||
package contracts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
|
@ -27,24 +24,28 @@ import (
|
|||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewDeleteContractParams() *DeleteContractParams {
|
||||
return &DeleteContractParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
return NewDeleteContractParamsWithTimeout(cr.DefaultTimeout)
|
||||
}
|
||||
|
||||
// NewDeleteContractParamsWithTimeout creates a new DeleteContractParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewDeleteContractParamsWithTimeout(timeout time.Duration) *DeleteContractParams {
|
||||
return &DeleteContractParams{
|
||||
timeout: timeout,
|
||||
inner: innerParams{
|
||||
timeout: timeout,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteContractParamsWithContext creates a new DeleteContractParams object
|
||||
// with the ability to set a context for a request.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [DeleteContractParams].
|
||||
func NewDeleteContractParamsWithContext(ctx context.Context) *DeleteContractParams {
|
||||
return &DeleteContractParams{
|
||||
Context: ctx,
|
||||
inner: innerParams{
|
||||
ctx: ctx,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -65,15 +66,14 @@ DeleteContractParams contains all the parameters to send to the API endpoint
|
|||
*/
|
||||
type DeleteContractParams struct {
|
||||
|
||||
/* ContractID.
|
||||
|
||||
Contact record ID
|
||||
*/
|
||||
// ContractID.
|
||||
//
|
||||
// Contact record ID
|
||||
ContractID *string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
|
||||
inner innerParams
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the delete contract params (not the query body).
|
||||
|
|
@ -91,54 +91,57 @@ func (o *DeleteContractParams) SetDefaults() {
|
|||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the delete contract params
|
||||
// WithTimeout adds the timeout to the delete contract params.
|
||||
func (o *DeleteContractParams) WithTimeout(timeout time.Duration) *DeleteContractParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the delete contract params
|
||||
// SetTimeout adds the timeout to the delete contract params.
|
||||
func (o *DeleteContractParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
o.inner.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the delete contract params
|
||||
// WithContext adds the context to the delete contract params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [DeleteContractParams].
|
||||
func (o *DeleteContractParams) WithContext(ctx context.Context) *DeleteContractParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the delete contract params
|
||||
// SetContext adds the context to the delete contract params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [DeleteContractParams].
|
||||
func (o *DeleteContractParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
o.inner.ctx = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the delete contract params
|
||||
// WithHTTPClient adds the HTTPClient to the delete contract params.
|
||||
func (o *DeleteContractParams) WithHTTPClient(client *http.Client) *DeleteContractParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the delete contract params
|
||||
// SetHTTPClient adds the HTTPClient to the delete contract params.
|
||||
func (o *DeleteContractParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithContractID adds the contractID to the delete contract params
|
||||
// WithContractID adds the contractID to the delete contract params.
|
||||
func (o *DeleteContractParams) WithContractID(contractID *string) *DeleteContractParams {
|
||||
o.SetContractID(contractID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContractID adds the contractId to the delete contract params
|
||||
// SetContractID adds the contractId to the delete contract params.
|
||||
func (o *DeleteContractParams) SetContractID(contractID *string) {
|
||||
o.ContractID = contractID
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
// WriteToRequest writes these params to a [runtime.ClientRequest].
|
||||
func (o *DeleteContractParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
if err := r.SetTimeout(o.inner.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
|
|
|||
|
|
@ -6,17 +6,15 @@
|
|||
|
||||
package contracts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
stderrors "errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// DeleteContractReader is a Reader for the DeleteContract structure.
|
||||
|
|
@ -25,7 +23,7 @@ type DeleteContractReader struct {
|
|||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *DeleteContractReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
func (o *DeleteContractReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewDeleteContractOK()
|
||||
|
|
@ -64,7 +62,7 @@ func (o *DeleteContractReader) ReadResponse(response runtime.ClientResponse, con
|
|||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
return nil, runtime.NewAPIError("[DELETE /contracts] deleteContract", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -73,11 +71,9 @@ func NewDeleteContractOK() *DeleteContractOK {
|
|||
return &DeleteContractOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteContractOK describes a response with status code 200, with default header values.
|
||||
|
||||
Response with Message Objects with Delete Status
|
||||
*/
|
||||
// DeleteContractOK describes a response with status code 200, with default header values.
|
||||
//
|
||||
// Response with Message Objects with Delete Status
|
||||
type DeleteContractOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -115,11 +111,13 @@ func (o *DeleteContractOK) Code() int {
|
|||
}
|
||||
|
||||
func (o *DeleteContractOK) Error() string {
|
||||
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContractOK) String() string {
|
||||
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContractOK) GetPayload() *crm_models.DeleteResponse {
|
||||
|
|
@ -138,7 +136,7 @@ func (o *DeleteContractOK) readResponse(response runtime.ClientResponse, consume
|
|||
o.Payload = new(crm_models.DeleteResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -150,11 +148,9 @@ func NewDeleteContractUnauthorized() *DeleteContractUnauthorized {
|
|||
return &DeleteContractUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteContractUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
// DeleteContractUnauthorized describes a response with status code 401, with default header values.
|
||||
//
|
||||
// Access unauthorized, invalid API-KEY was used
|
||||
type DeleteContractUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -192,11 +188,13 @@ func (o *DeleteContractUnauthorized) Code() int {
|
|||
}
|
||||
|
||||
func (o *DeleteContractUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContractUnauthorized) String() string {
|
||||
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContractUnauthorized) GetPayload() *crm_models.Error {
|
||||
|
|
@ -215,7 +213,7 @@ func (o *DeleteContractUnauthorized) readResponse(response runtime.ClientRespons
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -227,11 +225,9 @@ func NewDeleteContractForbidden() *DeleteContractForbidden {
|
|||
return &DeleteContractForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteContractForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
// DeleteContractForbidden describes a response with status code 403, with default header values.
|
||||
//
|
||||
// Access forbidden, account lacks access
|
||||
type DeleteContractForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -269,11 +265,13 @@ func (o *DeleteContractForbidden) Code() int {
|
|||
}
|
||||
|
||||
func (o *DeleteContractForbidden) Error() string {
|
||||
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContractForbidden) String() string {
|
||||
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContractForbidden) GetPayload() *crm_models.Error {
|
||||
|
|
@ -292,7 +290,7 @@ func (o *DeleteContractForbidden) readResponse(response runtime.ClientResponse,
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -304,11 +302,9 @@ func NewDeleteContractNotFound() *DeleteContractNotFound {
|
|||
return &DeleteContractNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteContractNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
// DeleteContractNotFound describes a response with status code 404, with default header values.
|
||||
//
|
||||
// Resource was not found
|
||||
type DeleteContractNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -346,11 +342,13 @@ func (o *DeleteContractNotFound) Code() int {
|
|||
}
|
||||
|
||||
func (o *DeleteContractNotFound) Error() string {
|
||||
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContractNotFound) String() string {
|
||||
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContractNotFound) GetPayload() *crm_models.Error {
|
||||
|
|
@ -369,7 +367,7 @@ func (o *DeleteContractNotFound) readResponse(response runtime.ClientResponse, c
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -381,11 +379,9 @@ func NewDeleteContractUnprocessableEntity() *DeleteContractUnprocessableEntity {
|
|||
return &DeleteContractUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteContractUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
// DeleteContractUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
//
|
||||
// Unprocessable Entity, likely a bad parameter
|
||||
type DeleteContractUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -423,11 +419,13 @@ func (o *DeleteContractUnprocessableEntity) Code() int {
|
|||
}
|
||||
|
||||
func (o *DeleteContractUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContractUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContractUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
|
|
@ -446,7 +444,7 @@ func (o *DeleteContractUnprocessableEntity) readResponse(response runtime.Client
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -458,11 +456,9 @@ func NewDeleteContractInternalServerError() *DeleteContractInternalServerError {
|
|||
return &DeleteContractInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteContractInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
// DeleteContractInternalServerError describes a response with status code 500, with default header values.
|
||||
//
|
||||
// Server Internal Error
|
||||
type DeleteContractInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -500,11 +496,13 @@ func (o *DeleteContractInternalServerError) Code() int {
|
|||
}
|
||||
|
||||
func (o *DeleteContractInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContractInternalServerError) String() string {
|
||||
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /contracts][%d] deleteContractInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteContractInternalServerError) GetPayload() *crm_models.Error {
|
||||
|
|
@ -523,7 +521,7 @@ func (o *DeleteContractInternalServerError) readResponse(response runtime.Client
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,9 +6,6 @@
|
|||
|
||||
package contracts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
|
@ -18,7 +15,7 @@ import (
|
|||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/swag/conv"
|
||||
)
|
||||
|
||||
// NewGetContractsParams creates a new GetContractsParams object,
|
||||
|
|
@ -28,24 +25,28 @@ import (
|
|||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewGetContractsParams() *GetContractsParams {
|
||||
return &GetContractsParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
return NewGetContractsParamsWithTimeout(cr.DefaultTimeout)
|
||||
}
|
||||
|
||||
// NewGetContractsParamsWithTimeout creates a new GetContractsParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetContractsParamsWithTimeout(timeout time.Duration) *GetContractsParams {
|
||||
return &GetContractsParams{
|
||||
timeout: timeout,
|
||||
inner: innerParams{
|
||||
timeout: timeout,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetContractsParamsWithContext creates a new GetContractsParams object
|
||||
// with the ability to set a context for a request.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [GetContractsParams].
|
||||
func NewGetContractsParamsWithContext(ctx context.Context) *GetContractsParams {
|
||||
return &GetContractsParams{
|
||||
Context: ctx,
|
||||
inner: innerParams{
|
||||
ctx: ctx,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -66,37 +67,33 @@ GetContractsParams contains all the parameters to send to the API endpoint
|
|||
*/
|
||||
type GetContractsParams struct {
|
||||
|
||||
/* Active.
|
||||
|
||||
Only retrieve active records?
|
||||
*/
|
||||
// Active.
|
||||
//
|
||||
// Only retrieve active records?
|
||||
Active *bool
|
||||
|
||||
/* ContractID.
|
||||
|
||||
Contact record ID
|
||||
*/
|
||||
// ContractID.
|
||||
//
|
||||
// Contact record ID
|
||||
ContractID *string
|
||||
|
||||
/* Limit.
|
||||
|
||||
How many objects to return at one time
|
||||
|
||||
Format: int64
|
||||
*/
|
||||
// Limit.
|
||||
//
|
||||
// How many objects to return at one time
|
||||
//
|
||||
// Format: int64
|
||||
Limit *int64
|
||||
|
||||
/* Offset.
|
||||
|
||||
How many objects to skip?
|
||||
|
||||
Format: int64
|
||||
*/
|
||||
// Offset.
|
||||
//
|
||||
// How many objects to skip?
|
||||
//
|
||||
// Format: int64
|
||||
Offset *int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
|
||||
inner innerParams
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get contracts params (not the query body).
|
||||
|
|
@ -114,87 +111,90 @@ func (o *GetContractsParams) SetDefaults() {
|
|||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get contracts params
|
||||
// WithTimeout adds the timeout to the get contracts params.
|
||||
func (o *GetContractsParams) WithTimeout(timeout time.Duration) *GetContractsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get contracts params
|
||||
// SetTimeout adds the timeout to the get contracts params.
|
||||
func (o *GetContractsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
o.inner.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get contracts params
|
||||
// WithContext adds the context to the get contracts params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [GetContractsParams].
|
||||
func (o *GetContractsParams) WithContext(ctx context.Context) *GetContractsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get contracts params
|
||||
// SetContext adds the context to the get contracts params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [GetContractsParams].
|
||||
func (o *GetContractsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
o.inner.ctx = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get contracts params
|
||||
// WithHTTPClient adds the HTTPClient to the get contracts params.
|
||||
func (o *GetContractsParams) WithHTTPClient(client *http.Client) *GetContractsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get contracts params
|
||||
// SetHTTPClient adds the HTTPClient to the get contracts params.
|
||||
func (o *GetContractsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithActive adds the active to the get contracts params
|
||||
// WithActive adds the active to the get contracts params.
|
||||
func (o *GetContractsParams) WithActive(active *bool) *GetContractsParams {
|
||||
o.SetActive(active)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetActive adds the active to the get contracts params
|
||||
// SetActive adds the active to the get contracts params.
|
||||
func (o *GetContractsParams) SetActive(active *bool) {
|
||||
o.Active = active
|
||||
}
|
||||
|
||||
// WithContractID adds the contractID to the get contracts params
|
||||
// WithContractID adds the contractID to the get contracts params.
|
||||
func (o *GetContractsParams) WithContractID(contractID *string) *GetContractsParams {
|
||||
o.SetContractID(contractID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContractID adds the contractId to the get contracts params
|
||||
// SetContractID adds the contractId to the get contracts params.
|
||||
func (o *GetContractsParams) SetContractID(contractID *string) {
|
||||
o.ContractID = contractID
|
||||
}
|
||||
|
||||
// WithLimit adds the limit to the get contracts params
|
||||
// WithLimit adds the limit to the get contracts params.
|
||||
func (o *GetContractsParams) WithLimit(limit *int64) *GetContractsParams {
|
||||
o.SetLimit(limit)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetLimit adds the limit to the get contracts params
|
||||
// SetLimit adds the limit to the get contracts params.
|
||||
func (o *GetContractsParams) SetLimit(limit *int64) {
|
||||
o.Limit = limit
|
||||
}
|
||||
|
||||
// WithOffset adds the offset to the get contracts params
|
||||
// WithOffset adds the offset to the get contracts params.
|
||||
func (o *GetContractsParams) WithOffset(offset *int64) *GetContractsParams {
|
||||
o.SetOffset(offset)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetOffset adds the offset to the get contracts params
|
||||
// SetOffset adds the offset to the get contracts params.
|
||||
func (o *GetContractsParams) SetOffset(offset *int64) {
|
||||
o.Offset = offset
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
// WriteToRequest writes these params to a [runtime.ClientRequest].
|
||||
func (o *GetContractsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
if err := r.SetTimeout(o.inner.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
|
@ -207,7 +207,7 @@ func (o *GetContractsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.
|
|||
if o.Active != nil {
|
||||
qrActive = *o.Active
|
||||
}
|
||||
qActive := swag.FormatBool(qrActive)
|
||||
qActive := conv.FormatBool(qrActive)
|
||||
if qActive != "" {
|
||||
|
||||
if err := r.SetQueryParam("active", qActive); err != nil {
|
||||
|
|
@ -241,7 +241,7 @@ func (o *GetContractsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.
|
|||
if o.Limit != nil {
|
||||
qrLimit = *o.Limit
|
||||
}
|
||||
qLimit := swag.FormatInt64(qrLimit)
|
||||
qLimit := conv.FormatInteger(qrLimit)
|
||||
if qLimit != "" {
|
||||
|
||||
if err := r.SetQueryParam("limit", qLimit); err != nil {
|
||||
|
|
@ -258,7 +258,7 @@ func (o *GetContractsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.
|
|||
if o.Offset != nil {
|
||||
qrOffset = *o.Offset
|
||||
}
|
||||
qOffset := swag.FormatInt64(qrOffset)
|
||||
qOffset := conv.FormatInteger(qrOffset)
|
||||
if qOffset != "" {
|
||||
|
||||
if err := r.SetQueryParam("offset", qOffset); err != nil {
|
||||
|
|
|
|||
|
|
@ -6,17 +6,15 @@
|
|||
|
||||
package contracts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
stderrors "errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// GetContractsReader is a Reader for the GetContracts structure.
|
||||
|
|
@ -25,7 +23,7 @@ type GetContractsReader struct {
|
|||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetContractsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
func (o *GetContractsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetContractsOK()
|
||||
|
|
@ -64,7 +62,7 @@ func (o *GetContractsReader) ReadResponse(response runtime.ClientResponse, consu
|
|||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
return nil, runtime.NewAPIError("[GET /contracts] getContracts", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -73,11 +71,9 @@ func NewGetContractsOK() *GetContractsOK {
|
|||
return &GetContractsOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetContractsOK describes a response with status code 200, with default header values.
|
||||
|
||||
Response with an array of Contract objects
|
||||
*/
|
||||
// GetContractsOK describes a response with status code 200, with default header values.
|
||||
//
|
||||
// Response with an array of Contract objects
|
||||
type GetContractsOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
CacheControl string
|
||||
|
|
@ -116,11 +112,13 @@ func (o *GetContractsOK) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetContractsOK) Error() string {
|
||||
return fmt.Sprintf("[GET /contracts][%d] getContractsOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /contracts][%d] getContractsOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *GetContractsOK) String() string {
|
||||
return fmt.Sprintf("[GET /contracts][%d] getContractsOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /contracts][%d] getContractsOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *GetContractsOK) GetPayload() *crm_models.ContractResponse {
|
||||
|
|
@ -146,7 +144,7 @@ func (o *GetContractsOK) readResponse(response runtime.ClientResponse, consumer
|
|||
o.Payload = new(crm_models.ContractResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -158,11 +156,9 @@ func NewGetContractsUnauthorized() *GetContractsUnauthorized {
|
|||
return &GetContractsUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetContractsUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
// GetContractsUnauthorized describes a response with status code 401, with default header values.
|
||||
//
|
||||
// Access unauthorized, invalid API-KEY was used
|
||||
type GetContractsUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -200,11 +196,13 @@ func (o *GetContractsUnauthorized) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetContractsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /contracts][%d] getContractsUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /contracts][%d] getContractsUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *GetContractsUnauthorized) String() string {
|
||||
return fmt.Sprintf("[GET /contracts][%d] getContractsUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /contracts][%d] getContractsUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *GetContractsUnauthorized) GetPayload() *crm_models.Error {
|
||||
|
|
@ -223,7 +221,7 @@ func (o *GetContractsUnauthorized) readResponse(response runtime.ClientResponse,
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -235,11 +233,9 @@ func NewGetContractsForbidden() *GetContractsForbidden {
|
|||
return &GetContractsForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetContractsForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
// GetContractsForbidden describes a response with status code 403, with default header values.
|
||||
//
|
||||
// Access forbidden, account lacks access
|
||||
type GetContractsForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -277,11 +273,13 @@ func (o *GetContractsForbidden) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetContractsForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /contracts][%d] getContractsForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /contracts][%d] getContractsForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *GetContractsForbidden) String() string {
|
||||
return fmt.Sprintf("[GET /contracts][%d] getContractsForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /contracts][%d] getContractsForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *GetContractsForbidden) GetPayload() *crm_models.Error {
|
||||
|
|
@ -300,7 +298,7 @@ func (o *GetContractsForbidden) readResponse(response runtime.ClientResponse, co
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -312,11 +310,9 @@ func NewGetContractsNotFound() *GetContractsNotFound {
|
|||
return &GetContractsNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetContractsNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
// GetContractsNotFound describes a response with status code 404, with default header values.
|
||||
//
|
||||
// Resource was not found
|
||||
type GetContractsNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -354,11 +350,13 @@ func (o *GetContractsNotFound) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetContractsNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /contracts][%d] getContractsNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /contracts][%d] getContractsNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *GetContractsNotFound) String() string {
|
||||
return fmt.Sprintf("[GET /contracts][%d] getContractsNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /contracts][%d] getContractsNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *GetContractsNotFound) GetPayload() *crm_models.Error {
|
||||
|
|
@ -377,7 +375,7 @@ func (o *GetContractsNotFound) readResponse(response runtime.ClientResponse, con
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -389,11 +387,9 @@ func NewGetContractsUnprocessableEntity() *GetContractsUnprocessableEntity {
|
|||
return &GetContractsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetContractsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
// GetContractsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
//
|
||||
// Unprocessable Entity, likely a bad parameter
|
||||
type GetContractsUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -431,11 +427,13 @@ func (o *GetContractsUnprocessableEntity) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetContractsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /contracts][%d] getContractsUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /contracts][%d] getContractsUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *GetContractsUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[GET /contracts][%d] getContractsUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /contracts][%d] getContractsUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *GetContractsUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
|
|
@ -454,7 +452,7 @@ func (o *GetContractsUnprocessableEntity) readResponse(response runtime.ClientRe
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -466,11 +464,9 @@ func NewGetContractsInternalServerError() *GetContractsInternalServerError {
|
|||
return &GetContractsInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetContractsInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
// GetContractsInternalServerError describes a response with status code 500, with default header values.
|
||||
//
|
||||
// Server Internal Error
|
||||
type GetContractsInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -508,11 +504,13 @@ func (o *GetContractsInternalServerError) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetContractsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /contracts][%d] getContractsInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /contracts][%d] getContractsInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *GetContractsInternalServerError) String() string {
|
||||
return fmt.Sprintf("[GET /contracts][%d] getContractsInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /contracts][%d] getContractsInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *GetContractsInternalServerError) GetPayload() *crm_models.Error {
|
||||
|
|
@ -531,7 +529,7 @@ func (o *GetContractsInternalServerError) readResponse(response runtime.ClientRe
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,20 +6,16 @@
|
|||
|
||||
package contracts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// NewPostContractsParams creates a new PostContractsParams object,
|
||||
|
|
@ -29,24 +25,28 @@ import (
|
|||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewPostContractsParams() *PostContractsParams {
|
||||
return &PostContractsParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
return NewPostContractsParamsWithTimeout(cr.DefaultTimeout)
|
||||
}
|
||||
|
||||
// NewPostContractsParamsWithTimeout creates a new PostContractsParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostContractsParamsWithTimeout(timeout time.Duration) *PostContractsParams {
|
||||
return &PostContractsParams{
|
||||
timeout: timeout,
|
||||
inner: innerParams{
|
||||
timeout: timeout,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostContractsParamsWithContext creates a new PostContractsParams object
|
||||
// with the ability to set a context for a request.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PostContractsParams].
|
||||
func NewPostContractsParamsWithContext(ctx context.Context) *PostContractsParams {
|
||||
return &PostContractsParams{
|
||||
Context: ctx,
|
||||
inner: innerParams{
|
||||
ctx: ctx,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -67,15 +67,14 @@ PostContractsParams contains all the parameters to send to the API endpoint
|
|||
*/
|
||||
type PostContractsParams struct {
|
||||
|
||||
/* ContractsRequest.
|
||||
|
||||
An array of new Contract records
|
||||
*/
|
||||
// ContractsRequest.
|
||||
//
|
||||
// An array of new Contract records
|
||||
ContractsRequest *crm_models.ContractRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
|
||||
inner innerParams
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the post contracts params (not the query body).
|
||||
|
|
@ -93,54 +92,57 @@ func (o *PostContractsParams) SetDefaults() {
|
|||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post contracts params
|
||||
// WithTimeout adds the timeout to the post contracts params.
|
||||
func (o *PostContractsParams) WithTimeout(timeout time.Duration) *PostContractsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post contracts params
|
||||
// SetTimeout adds the timeout to the post contracts params.
|
||||
func (o *PostContractsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
o.inner.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post contracts params
|
||||
// WithContext adds the context to the post contracts params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PostContractsParams].
|
||||
func (o *PostContractsParams) WithContext(ctx context.Context) *PostContractsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post contracts params
|
||||
// SetContext adds the context to the post contracts params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PostContractsParams].
|
||||
func (o *PostContractsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
o.inner.ctx = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post contracts params
|
||||
// WithHTTPClient adds the HTTPClient to the post contracts params.
|
||||
func (o *PostContractsParams) WithHTTPClient(client *http.Client) *PostContractsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post contracts params
|
||||
// SetHTTPClient adds the HTTPClient to the post contracts params.
|
||||
func (o *PostContractsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithContractsRequest adds the contractsRequest to the post contracts params
|
||||
// WithContractsRequest adds the contractsRequest to the post contracts params.
|
||||
func (o *PostContractsParams) WithContractsRequest(contractsRequest *crm_models.ContractRequest) *PostContractsParams {
|
||||
o.SetContractsRequest(contractsRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContractsRequest adds the contractsRequest to the post contracts params
|
||||
// SetContractsRequest adds the contractsRequest to the post contracts params.
|
||||
func (o *PostContractsParams) SetContractsRequest(contractsRequest *crm_models.ContractRequest) {
|
||||
o.ContractsRequest = contractsRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
// WriteToRequest writes these params to a [runtime.ClientRequest].
|
||||
func (o *PostContractsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
if err := r.SetTimeout(o.inner.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
|
|
|||
|
|
@ -6,17 +6,15 @@
|
|||
|
||||
package contracts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
stderrors "errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// PostContractsReader is a Reader for the PostContracts structure.
|
||||
|
|
@ -25,7 +23,7 @@ type PostContractsReader struct {
|
|||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostContractsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
func (o *PostContractsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPostContractsOK()
|
||||
|
|
@ -64,7 +62,7 @@ func (o *PostContractsReader) ReadResponse(response runtime.ClientResponse, cons
|
|||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
return nil, runtime.NewAPIError("[POST /contracts] postContracts", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -73,11 +71,9 @@ func NewPostContractsOK() *PostContractsOK {
|
|||
return &PostContractsOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostContractsOK describes a response with status code 200, with default header values.
|
||||
|
||||
Response with an array of Contract objects
|
||||
*/
|
||||
// PostContractsOK describes a response with status code 200, with default header values.
|
||||
//
|
||||
// Response with an array of Contract objects
|
||||
type PostContractsOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
CacheControl string
|
||||
|
|
@ -116,11 +112,13 @@ func (o *PostContractsOK) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostContractsOK) Error() string {
|
||||
return fmt.Sprintf("[POST /contracts][%d] postContractsOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /contracts][%d] postContractsOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *PostContractsOK) String() string {
|
||||
return fmt.Sprintf("[POST /contracts][%d] postContractsOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /contracts][%d] postContractsOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *PostContractsOK) GetPayload() *crm_models.ContractResponse {
|
||||
|
|
@ -146,7 +144,7 @@ func (o *PostContractsOK) readResponse(response runtime.ClientResponse, consumer
|
|||
o.Payload = new(crm_models.ContractResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -158,11 +156,9 @@ func NewPostContractsUnauthorized() *PostContractsUnauthorized {
|
|||
return &PostContractsUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostContractsUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
// PostContractsUnauthorized describes a response with status code 401, with default header values.
|
||||
//
|
||||
// Access unauthorized, invalid API-KEY was used
|
||||
type PostContractsUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -200,11 +196,13 @@ func (o *PostContractsUnauthorized) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostContractsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[POST /contracts][%d] postContractsUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /contracts][%d] postContractsUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *PostContractsUnauthorized) String() string {
|
||||
return fmt.Sprintf("[POST /contracts][%d] postContractsUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /contracts][%d] postContractsUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *PostContractsUnauthorized) GetPayload() *crm_models.Error {
|
||||
|
|
@ -223,7 +221,7 @@ func (o *PostContractsUnauthorized) readResponse(response runtime.ClientResponse
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -235,11 +233,9 @@ func NewPostContractsForbidden() *PostContractsForbidden {
|
|||
return &PostContractsForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostContractsForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
// PostContractsForbidden describes a response with status code 403, with default header values.
|
||||
//
|
||||
// Access forbidden, account lacks access
|
||||
type PostContractsForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -277,11 +273,13 @@ func (o *PostContractsForbidden) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostContractsForbidden) Error() string {
|
||||
return fmt.Sprintf("[POST /contracts][%d] postContractsForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /contracts][%d] postContractsForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *PostContractsForbidden) String() string {
|
||||
return fmt.Sprintf("[POST /contracts][%d] postContractsForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /contracts][%d] postContractsForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *PostContractsForbidden) GetPayload() *crm_models.Error {
|
||||
|
|
@ -300,7 +298,7 @@ func (o *PostContractsForbidden) readResponse(response runtime.ClientResponse, c
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -312,11 +310,9 @@ func NewPostContractsNotFound() *PostContractsNotFound {
|
|||
return &PostContractsNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostContractsNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
// PostContractsNotFound describes a response with status code 404, with default header values.
|
||||
//
|
||||
// Resource was not found
|
||||
type PostContractsNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -354,11 +350,13 @@ func (o *PostContractsNotFound) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostContractsNotFound) Error() string {
|
||||
return fmt.Sprintf("[POST /contracts][%d] postContractsNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /contracts][%d] postContractsNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *PostContractsNotFound) String() string {
|
||||
return fmt.Sprintf("[POST /contracts][%d] postContractsNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /contracts][%d] postContractsNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *PostContractsNotFound) GetPayload() *crm_models.Error {
|
||||
|
|
@ -377,7 +375,7 @@ func (o *PostContractsNotFound) readResponse(response runtime.ClientResponse, co
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -389,11 +387,9 @@ func NewPostContractsUnprocessableEntity() *PostContractsUnprocessableEntity {
|
|||
return &PostContractsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostContractsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
// PostContractsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
//
|
||||
// Unprocessable Entity, likely a bad parameter
|
||||
type PostContractsUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -431,11 +427,13 @@ func (o *PostContractsUnprocessableEntity) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostContractsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[POST /contracts][%d] postContractsUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /contracts][%d] postContractsUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *PostContractsUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[POST /contracts][%d] postContractsUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /contracts][%d] postContractsUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *PostContractsUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
|
|
@ -454,7 +452,7 @@ func (o *PostContractsUnprocessableEntity) readResponse(response runtime.ClientR
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -466,11 +464,9 @@ func NewPostContractsInternalServerError() *PostContractsInternalServerError {
|
|||
return &PostContractsInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostContractsInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
// PostContractsInternalServerError describes a response with status code 500, with default header values.
|
||||
//
|
||||
// Server Internal Error
|
||||
type PostContractsInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -508,11 +504,13 @@ func (o *PostContractsInternalServerError) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostContractsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[POST /contracts][%d] postContractsInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /contracts][%d] postContractsInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *PostContractsInternalServerError) String() string {
|
||||
return fmt.Sprintf("[POST /contracts][%d] postContractsInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /contracts][%d] postContractsInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *PostContractsInternalServerError) GetPayload() *crm_models.Error {
|
||||
|
|
@ -531,7 +529,7 @@ func (o *PostContractsInternalServerError) readResponse(response runtime.ClientR
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,20 +6,16 @@
|
|||
|
||||
package contracts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// NewPutContractParams creates a new PutContractParams object,
|
||||
|
|
@ -29,24 +25,28 @@ import (
|
|||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewPutContractParams() *PutContractParams {
|
||||
return &PutContractParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
return NewPutContractParamsWithTimeout(cr.DefaultTimeout)
|
||||
}
|
||||
|
||||
// NewPutContractParamsWithTimeout creates a new PutContractParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPutContractParamsWithTimeout(timeout time.Duration) *PutContractParams {
|
||||
return &PutContractParams{
|
||||
timeout: timeout,
|
||||
inner: innerParams{
|
||||
timeout: timeout,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutContractParamsWithContext creates a new PutContractParams object
|
||||
// with the ability to set a context for a request.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PutContractParams].
|
||||
func NewPutContractParamsWithContext(ctx context.Context) *PutContractParams {
|
||||
return &PutContractParams{
|
||||
Context: ctx,
|
||||
inner: innerParams{
|
||||
ctx: ctx,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -67,15 +67,14 @@ PutContractParams contains all the parameters to send to the API endpoint
|
|||
*/
|
||||
type PutContractParams struct {
|
||||
|
||||
/* ContractsRequest.
|
||||
|
||||
An array of new Contract records
|
||||
*/
|
||||
// ContractsRequest.
|
||||
//
|
||||
// An array of new Contract records
|
||||
ContractsRequest *crm_models.ContractRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
|
||||
inner innerParams
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the put contract params (not the query body).
|
||||
|
|
@ -93,54 +92,57 @@ func (o *PutContractParams) SetDefaults() {
|
|||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the put contract params
|
||||
// WithTimeout adds the timeout to the put contract params.
|
||||
func (o *PutContractParams) WithTimeout(timeout time.Duration) *PutContractParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the put contract params
|
||||
// SetTimeout adds the timeout to the put contract params.
|
||||
func (o *PutContractParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
o.inner.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the put contract params
|
||||
// WithContext adds the context to the put contract params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PutContractParams].
|
||||
func (o *PutContractParams) WithContext(ctx context.Context) *PutContractParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the put contract params
|
||||
// SetContext adds the context to the put contract params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PutContractParams].
|
||||
func (o *PutContractParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
o.inner.ctx = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the put contract params
|
||||
// WithHTTPClient adds the HTTPClient to the put contract params.
|
||||
func (o *PutContractParams) WithHTTPClient(client *http.Client) *PutContractParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the put contract params
|
||||
// SetHTTPClient adds the HTTPClient to the put contract params.
|
||||
func (o *PutContractParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithContractsRequest adds the contractsRequest to the put contract params
|
||||
// WithContractsRequest adds the contractsRequest to the put contract params.
|
||||
func (o *PutContractParams) WithContractsRequest(contractsRequest *crm_models.ContractRequest) *PutContractParams {
|
||||
o.SetContractsRequest(contractsRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContractsRequest adds the contractsRequest to the put contract params
|
||||
// SetContractsRequest adds the contractsRequest to the put contract params.
|
||||
func (o *PutContractParams) SetContractsRequest(contractsRequest *crm_models.ContractRequest) {
|
||||
o.ContractsRequest = contractsRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
// WriteToRequest writes these params to a [runtime.ClientRequest].
|
||||
func (o *PutContractParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
if err := r.SetTimeout(o.inner.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
|
|
|||
|
|
@ -6,17 +6,15 @@
|
|||
|
||||
package contracts
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
stderrors "errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// PutContractReader is a Reader for the PutContract structure.
|
||||
|
|
@ -25,7 +23,7 @@ type PutContractReader struct {
|
|||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PutContractReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
func (o *PutContractReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPutContractOK()
|
||||
|
|
@ -64,7 +62,7 @@ func (o *PutContractReader) ReadResponse(response runtime.ClientResponse, consum
|
|||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
return nil, runtime.NewAPIError("[PUT /contracts] putContract", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -73,11 +71,9 @@ func NewPutContractOK() *PutContractOK {
|
|||
return &PutContractOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutContractOK describes a response with status code 200, with default header values.
|
||||
|
||||
Response with an array of Contract objects
|
||||
*/
|
||||
// PutContractOK describes a response with status code 200, with default header values.
|
||||
//
|
||||
// Response with an array of Contract objects
|
||||
type PutContractOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
CacheControl string
|
||||
|
|
@ -116,11 +112,13 @@ func (o *PutContractOK) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutContractOK) Error() string {
|
||||
return fmt.Sprintf("[PUT /contracts][%d] putContractOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /contracts][%d] putContractOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *PutContractOK) String() string {
|
||||
return fmt.Sprintf("[PUT /contracts][%d] putContractOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /contracts][%d] putContractOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *PutContractOK) GetPayload() *crm_models.ContractResponse {
|
||||
|
|
@ -146,7 +144,7 @@ func (o *PutContractOK) readResponse(response runtime.ClientResponse, consumer r
|
|||
o.Payload = new(crm_models.ContractResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -158,11 +156,9 @@ func NewPutContractUnauthorized() *PutContractUnauthorized {
|
|||
return &PutContractUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutContractUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
// PutContractUnauthorized describes a response with status code 401, with default header values.
|
||||
//
|
||||
// Access unauthorized, invalid API-KEY was used
|
||||
type PutContractUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -200,11 +196,13 @@ func (o *PutContractUnauthorized) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutContractUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[PUT /contracts][%d] putContractUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /contracts][%d] putContractUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *PutContractUnauthorized) String() string {
|
||||
return fmt.Sprintf("[PUT /contracts][%d] putContractUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /contracts][%d] putContractUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *PutContractUnauthorized) GetPayload() *crm_models.Error {
|
||||
|
|
@ -223,7 +221,7 @@ func (o *PutContractUnauthorized) readResponse(response runtime.ClientResponse,
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -235,11 +233,9 @@ func NewPutContractForbidden() *PutContractForbidden {
|
|||
return &PutContractForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutContractForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
// PutContractForbidden describes a response with status code 403, with default header values.
|
||||
//
|
||||
// Access forbidden, account lacks access
|
||||
type PutContractForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -277,11 +273,13 @@ func (o *PutContractForbidden) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutContractForbidden) Error() string {
|
||||
return fmt.Sprintf("[PUT /contracts][%d] putContractForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /contracts][%d] putContractForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *PutContractForbidden) String() string {
|
||||
return fmt.Sprintf("[PUT /contracts][%d] putContractForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /contracts][%d] putContractForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *PutContractForbidden) GetPayload() *crm_models.Error {
|
||||
|
|
@ -300,7 +298,7 @@ func (o *PutContractForbidden) readResponse(response runtime.ClientResponse, con
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -312,11 +310,9 @@ func NewPutContractNotFound() *PutContractNotFound {
|
|||
return &PutContractNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutContractNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
// PutContractNotFound describes a response with status code 404, with default header values.
|
||||
//
|
||||
// Resource was not found
|
||||
type PutContractNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -354,11 +350,13 @@ func (o *PutContractNotFound) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutContractNotFound) Error() string {
|
||||
return fmt.Sprintf("[PUT /contracts][%d] putContractNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /contracts][%d] putContractNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *PutContractNotFound) String() string {
|
||||
return fmt.Sprintf("[PUT /contracts][%d] putContractNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /contracts][%d] putContractNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *PutContractNotFound) GetPayload() *crm_models.Error {
|
||||
|
|
@ -377,7 +375,7 @@ func (o *PutContractNotFound) readResponse(response runtime.ClientResponse, cons
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -389,11 +387,9 @@ func NewPutContractUnprocessableEntity() *PutContractUnprocessableEntity {
|
|||
return &PutContractUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutContractUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
// PutContractUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
//
|
||||
// Unprocessable Entity, likely a bad parameter
|
||||
type PutContractUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -431,11 +427,13 @@ func (o *PutContractUnprocessableEntity) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutContractUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[PUT /contracts][%d] putContractUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /contracts][%d] putContractUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *PutContractUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[PUT /contracts][%d] putContractUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /contracts][%d] putContractUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *PutContractUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
|
|
@ -454,7 +452,7 @@ func (o *PutContractUnprocessableEntity) readResponse(response runtime.ClientRes
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -466,11 +464,9 @@ func NewPutContractInternalServerError() *PutContractInternalServerError {
|
|||
return &PutContractInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutContractInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
// PutContractInternalServerError describes a response with status code 500, with default header values.
|
||||
//
|
||||
// Server Internal Error
|
||||
type PutContractInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -508,11 +504,13 @@ func (o *PutContractInternalServerError) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutContractInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[PUT /contracts][%d] putContractInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /contracts][%d] putContractInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *PutContractInternalServerError) String() string {
|
||||
return fmt.Sprintf("[PUT /contracts][%d] putContractInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /contracts][%d] putContractInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *PutContractInternalServerError) GetPayload() *crm_models.Error {
|
||||
|
|
@ -531,7 +529,7 @@ func (o *PutContractInternalServerError) readResponse(response runtime.ClientRes
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,34 +6,30 @@
|
|||
|
||||
package crm_client
|
||||
|
||||
// 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/runtime"
|
||||
httptransport "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"maps"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_client/accounts"
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_client/assets"
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_client/contacts"
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_client/contracts"
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_client/leads"
|
||||
"github.com/go-openapi/runtime"
|
||||
httptransport "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// Default crm HTTP client.
|
||||
var Default = NewHTTPClient(nil)
|
||||
|
||||
const (
|
||||
// DefaultHost is the default Host
|
||||
// found in Meta (info) section of spec file
|
||||
// DefaultHost is the default Host found in Meta (info) section of spec file.
|
||||
DefaultHost string = "crm.vernonkeenan.com:8080"
|
||||
// DefaultBasePath is the default BasePath
|
||||
// found in Meta (info) section of spec file
|
||||
// DefaultBasePath is the default BasePath found in Meta (info) section of spec file.
|
||||
DefaultBasePath string = "/v1"
|
||||
)
|
||||
|
||||
// DefaultSchemes are the default schemes found in Meta (info) section of spec file
|
||||
// DefaultSchemes are the default schemes found in Meta (info) section of spec file.
|
||||
var DefaultSchemes = []string{"http"}
|
||||
|
||||
// NewHTTPClient creates a new crm HTTP client.
|
||||
|
|
@ -49,13 +45,16 @@ func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Crm
|
|||
cfg = DefaultTransportConfig()
|
||||
}
|
||||
|
||||
// create transport and client
|
||||
// create transport and client.
|
||||
transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes)
|
||||
maps.Copy(transport.Producers, cfg.Producers)
|
||||
maps.Copy(transport.Consumers, cfg.Consumers)
|
||||
|
||||
return New(transport, formats)
|
||||
}
|
||||
|
||||
// New creates a new crm client
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) *Crm {
|
||||
// New creates a new crm client.
|
||||
func New(transport runtime.ContextualTransport, formats strfmt.Registry) *Crm {
|
||||
// ensure nullable parameters have default
|
||||
if formats == nil {
|
||||
formats = strfmt.Default
|
||||
|
|
@ -68,6 +67,7 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *Crm {
|
|||
cli.Contacts = contacts.New(transport, formats)
|
||||
cli.Contracts = contracts.New(transport, formats)
|
||||
cli.Leads = leads.New(transport, formats)
|
||||
|
||||
return cli
|
||||
}
|
||||
|
||||
|
|
@ -84,9 +84,11 @@ func DefaultTransportConfig() *TransportConfig {
|
|||
// TransportConfig contains the transport related info,
|
||||
// found in the meta section of the spec file.
|
||||
type TransportConfig struct {
|
||||
Host string
|
||||
BasePath string
|
||||
Schemes []string
|
||||
Host string
|
||||
BasePath string
|
||||
Schemes []string
|
||||
Producers map[string]runtime.Producer
|
||||
Consumers map[string]runtime.Consumer
|
||||
}
|
||||
|
||||
// WithHost overrides the default host,
|
||||
|
|
@ -110,7 +112,19 @@ func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig {
|
|||
return cfg
|
||||
}
|
||||
|
||||
// Crm is a client for crm
|
||||
// WithProducers overrides the default producers registered by [httptransport.Runtime].
|
||||
func (cfg *TransportConfig) WithProducers(producers map[string]runtime.Producer) *TransportConfig {
|
||||
cfg.Producers = producers
|
||||
return cfg
|
||||
}
|
||||
|
||||
// WithConsumers overrides the default consumers registered by [httptransport.Runtime].
|
||||
func (cfg *TransportConfig) WithConsumers(consumers map[string]runtime.Consumer) *TransportConfig {
|
||||
cfg.Consumers = consumers
|
||||
return cfg
|
||||
}
|
||||
|
||||
// Crm is a client for crm.
|
||||
type Crm struct {
|
||||
Accounts accounts.ClientService
|
||||
|
||||
|
|
@ -122,11 +136,11 @@ type Crm struct {
|
|||
|
||||
Leads leads.ClientService
|
||||
|
||||
Transport runtime.ClientTransport
|
||||
Transport runtime.ContextualTransport
|
||||
}
|
||||
|
||||
// SetTransport changes the transport on the client and all its subresources
|
||||
func (c *Crm) SetTransport(transport runtime.ClientTransport) {
|
||||
// SetTransport changes the transport on the client and all its subresources.
|
||||
func (c *Crm) SetTransport(transport runtime.ContextualTransport) {
|
||||
c.Transport = transport
|
||||
c.Accounts.SetTransport(transport)
|
||||
c.Assets.SetTransport(transport)
|
||||
|
|
|
|||
|
|
@ -6,9 +6,6 @@
|
|||
|
||||
package leads
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
|
@ -27,24 +24,28 @@ import (
|
|||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewDeleteLeadParams() *DeleteLeadParams {
|
||||
return &DeleteLeadParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
return NewDeleteLeadParamsWithTimeout(cr.DefaultTimeout)
|
||||
}
|
||||
|
||||
// NewDeleteLeadParamsWithTimeout creates a new DeleteLeadParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewDeleteLeadParamsWithTimeout(timeout time.Duration) *DeleteLeadParams {
|
||||
return &DeleteLeadParams{
|
||||
timeout: timeout,
|
||||
inner: innerParams{
|
||||
timeout: timeout,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteLeadParamsWithContext creates a new DeleteLeadParams object
|
||||
// with the ability to set a context for a request.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [DeleteLeadParams].
|
||||
func NewDeleteLeadParamsWithContext(ctx context.Context) *DeleteLeadParams {
|
||||
return &DeleteLeadParams{
|
||||
Context: ctx,
|
||||
inner: innerParams{
|
||||
ctx: ctx,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -65,15 +66,14 @@ DeleteLeadParams contains all the parameters to send to the API endpoint
|
|||
*/
|
||||
type DeleteLeadParams struct {
|
||||
|
||||
/* LeadID.
|
||||
|
||||
Lead record ID
|
||||
*/
|
||||
// LeadID.
|
||||
//
|
||||
// Lead record ID
|
||||
LeadID *string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
|
||||
inner innerParams
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the delete lead params (not the query body).
|
||||
|
|
@ -91,54 +91,57 @@ func (o *DeleteLeadParams) SetDefaults() {
|
|||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the delete lead params
|
||||
// WithTimeout adds the timeout to the delete lead params.
|
||||
func (o *DeleteLeadParams) WithTimeout(timeout time.Duration) *DeleteLeadParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the delete lead params
|
||||
// SetTimeout adds the timeout to the delete lead params.
|
||||
func (o *DeleteLeadParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
o.inner.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the delete lead params
|
||||
// WithContext adds the context to the delete lead params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [DeleteLeadParams].
|
||||
func (o *DeleteLeadParams) WithContext(ctx context.Context) *DeleteLeadParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the delete lead params
|
||||
// SetContext adds the context to the delete lead params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [DeleteLeadParams].
|
||||
func (o *DeleteLeadParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
o.inner.ctx = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the delete lead params
|
||||
// WithHTTPClient adds the HTTPClient to the delete lead params.
|
||||
func (o *DeleteLeadParams) WithHTTPClient(client *http.Client) *DeleteLeadParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the delete lead params
|
||||
// SetHTTPClient adds the HTTPClient to the delete lead params.
|
||||
func (o *DeleteLeadParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithLeadID adds the leadID to the delete lead params
|
||||
// WithLeadID adds the leadID to the delete lead params.
|
||||
func (o *DeleteLeadParams) WithLeadID(leadID *string) *DeleteLeadParams {
|
||||
o.SetLeadID(leadID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetLeadID adds the leadId to the delete lead params
|
||||
// SetLeadID adds the leadId to the delete lead params.
|
||||
func (o *DeleteLeadParams) SetLeadID(leadID *string) {
|
||||
o.LeadID = leadID
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
// WriteToRequest writes these params to a [runtime.ClientRequest].
|
||||
func (o *DeleteLeadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
if err := r.SetTimeout(o.inner.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
|
|
|||
|
|
@ -6,17 +6,15 @@
|
|||
|
||||
package leads
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
stderrors "errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// DeleteLeadReader is a Reader for the DeleteLead structure.
|
||||
|
|
@ -25,7 +23,7 @@ type DeleteLeadReader struct {
|
|||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *DeleteLeadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
func (o *DeleteLeadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewDeleteLeadOK()
|
||||
|
|
@ -64,7 +62,7 @@ func (o *DeleteLeadReader) ReadResponse(response runtime.ClientResponse, consume
|
|||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
return nil, runtime.NewAPIError("[DELETE /leads] deleteLead", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -73,11 +71,9 @@ func NewDeleteLeadOK() *DeleteLeadOK {
|
|||
return &DeleteLeadOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteLeadOK describes a response with status code 200, with default header values.
|
||||
|
||||
Response with Message Objects with Delete Status
|
||||
*/
|
||||
// DeleteLeadOK describes a response with status code 200, with default header values.
|
||||
//
|
||||
// Response with Message Objects with Delete Status
|
||||
type DeleteLeadOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -115,11 +111,13 @@ func (o *DeleteLeadOK) Code() int {
|
|||
}
|
||||
|
||||
func (o *DeleteLeadOK) Error() string {
|
||||
return fmt.Sprintf("[DELETE /leads][%d] deleteLeadOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /leads][%d] deleteLeadOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteLeadOK) String() string {
|
||||
return fmt.Sprintf("[DELETE /leads][%d] deleteLeadOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /leads][%d] deleteLeadOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteLeadOK) GetPayload() *crm_models.DeleteResponse {
|
||||
|
|
@ -138,7 +136,7 @@ func (o *DeleteLeadOK) readResponse(response runtime.ClientResponse, consumer ru
|
|||
o.Payload = new(crm_models.DeleteResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -150,11 +148,9 @@ func NewDeleteLeadUnauthorized() *DeleteLeadUnauthorized {
|
|||
return &DeleteLeadUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteLeadUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
// DeleteLeadUnauthorized describes a response with status code 401, with default header values.
|
||||
//
|
||||
// Access unauthorized, invalid API-KEY was used
|
||||
type DeleteLeadUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -192,11 +188,13 @@ func (o *DeleteLeadUnauthorized) Code() int {
|
|||
}
|
||||
|
||||
func (o *DeleteLeadUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[DELETE /leads][%d] deleteLeadUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /leads][%d] deleteLeadUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteLeadUnauthorized) String() string {
|
||||
return fmt.Sprintf("[DELETE /leads][%d] deleteLeadUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /leads][%d] deleteLeadUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteLeadUnauthorized) GetPayload() *crm_models.Error {
|
||||
|
|
@ -215,7 +213,7 @@ func (o *DeleteLeadUnauthorized) readResponse(response runtime.ClientResponse, c
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -227,11 +225,9 @@ func NewDeleteLeadForbidden() *DeleteLeadForbidden {
|
|||
return &DeleteLeadForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteLeadForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
// DeleteLeadForbidden describes a response with status code 403, with default header values.
|
||||
//
|
||||
// Access forbidden, account lacks access
|
||||
type DeleteLeadForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -269,11 +265,13 @@ func (o *DeleteLeadForbidden) Code() int {
|
|||
}
|
||||
|
||||
func (o *DeleteLeadForbidden) Error() string {
|
||||
return fmt.Sprintf("[DELETE /leads][%d] deleteLeadForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /leads][%d] deleteLeadForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteLeadForbidden) String() string {
|
||||
return fmt.Sprintf("[DELETE /leads][%d] deleteLeadForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /leads][%d] deleteLeadForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteLeadForbidden) GetPayload() *crm_models.Error {
|
||||
|
|
@ -292,7 +290,7 @@ func (o *DeleteLeadForbidden) readResponse(response runtime.ClientResponse, cons
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -304,11 +302,9 @@ func NewDeleteLeadNotFound() *DeleteLeadNotFound {
|
|||
return &DeleteLeadNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteLeadNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
// DeleteLeadNotFound describes a response with status code 404, with default header values.
|
||||
//
|
||||
// Resource was not found
|
||||
type DeleteLeadNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -346,11 +342,13 @@ func (o *DeleteLeadNotFound) Code() int {
|
|||
}
|
||||
|
||||
func (o *DeleteLeadNotFound) Error() string {
|
||||
return fmt.Sprintf("[DELETE /leads][%d] deleteLeadNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /leads][%d] deleteLeadNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteLeadNotFound) String() string {
|
||||
return fmt.Sprintf("[DELETE /leads][%d] deleteLeadNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /leads][%d] deleteLeadNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteLeadNotFound) GetPayload() *crm_models.Error {
|
||||
|
|
@ -369,7 +367,7 @@ func (o *DeleteLeadNotFound) readResponse(response runtime.ClientResponse, consu
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -381,11 +379,9 @@ func NewDeleteLeadUnprocessableEntity() *DeleteLeadUnprocessableEntity {
|
|||
return &DeleteLeadUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteLeadUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
// DeleteLeadUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
//
|
||||
// Unprocessable Entity, likely a bad parameter
|
||||
type DeleteLeadUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -423,11 +419,13 @@ func (o *DeleteLeadUnprocessableEntity) Code() int {
|
|||
}
|
||||
|
||||
func (o *DeleteLeadUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[DELETE /leads][%d] deleteLeadUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /leads][%d] deleteLeadUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteLeadUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[DELETE /leads][%d] deleteLeadUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /leads][%d] deleteLeadUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteLeadUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
|
|
@ -446,7 +444,7 @@ func (o *DeleteLeadUnprocessableEntity) readResponse(response runtime.ClientResp
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -458,11 +456,9 @@ func NewDeleteLeadInternalServerError() *DeleteLeadInternalServerError {
|
|||
return &DeleteLeadInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteLeadInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
// DeleteLeadInternalServerError describes a response with status code 500, with default header values.
|
||||
//
|
||||
// Server Internal Error
|
||||
type DeleteLeadInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -500,11 +496,13 @@ func (o *DeleteLeadInternalServerError) Code() int {
|
|||
}
|
||||
|
||||
func (o *DeleteLeadInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[DELETE /leads][%d] deleteLeadInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /leads][%d] deleteLeadInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteLeadInternalServerError) String() string {
|
||||
return fmt.Sprintf("[DELETE /leads][%d] deleteLeadInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[DELETE /leads][%d] deleteLeadInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *DeleteLeadInternalServerError) GetPayload() *crm_models.Error {
|
||||
|
|
@ -523,7 +521,7 @@ func (o *DeleteLeadInternalServerError) readResponse(response runtime.ClientResp
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,9 +6,6 @@
|
|||
|
||||
package leads
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
|
@ -18,7 +15,7 @@ import (
|
|||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/swag/conv"
|
||||
)
|
||||
|
||||
// NewGetLeadsParams creates a new GetLeadsParams object,
|
||||
|
|
@ -28,24 +25,28 @@ import (
|
|||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewGetLeadsParams() *GetLeadsParams {
|
||||
return &GetLeadsParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
return NewGetLeadsParamsWithTimeout(cr.DefaultTimeout)
|
||||
}
|
||||
|
||||
// NewGetLeadsParamsWithTimeout creates a new GetLeadsParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetLeadsParamsWithTimeout(timeout time.Duration) *GetLeadsParams {
|
||||
return &GetLeadsParams{
|
||||
timeout: timeout,
|
||||
inner: innerParams{
|
||||
timeout: timeout,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetLeadsParamsWithContext creates a new GetLeadsParams object
|
||||
// with the ability to set a context for a request.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [GetLeadsParams].
|
||||
func NewGetLeadsParamsWithContext(ctx context.Context) *GetLeadsParams {
|
||||
return &GetLeadsParams{
|
||||
Context: ctx,
|
||||
inner: innerParams{
|
||||
ctx: ctx,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -66,43 +67,38 @@ GetLeadsParams contains all the parameters to send to the API endpoint
|
|||
*/
|
||||
type GetLeadsParams struct {
|
||||
|
||||
/* Email.
|
||||
|
||||
Email address used for identity lookup
|
||||
*/
|
||||
// Email.
|
||||
//
|
||||
// Email address used for identity lookup
|
||||
Email *string
|
||||
|
||||
/* LeadID.
|
||||
|
||||
Lead record ID
|
||||
*/
|
||||
// LeadID.
|
||||
//
|
||||
// Lead record ID
|
||||
LeadID *string
|
||||
|
||||
/* Limit.
|
||||
|
||||
How many objects to return at one time
|
||||
|
||||
Format: int64
|
||||
*/
|
||||
// Limit.
|
||||
//
|
||||
// How many objects to return at one time
|
||||
//
|
||||
// Format: int64
|
||||
Limit *int64
|
||||
|
||||
/* Name.
|
||||
|
||||
The Name of this Object
|
||||
*/
|
||||
// Name.
|
||||
//
|
||||
// The Name of this Object
|
||||
Name *string
|
||||
|
||||
/* Offset.
|
||||
|
||||
How many objects to skip?
|
||||
|
||||
Format: int64
|
||||
*/
|
||||
// Offset.
|
||||
//
|
||||
// How many objects to skip?
|
||||
//
|
||||
// Format: int64
|
||||
Offset *int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
|
||||
inner innerParams
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get leads params (not the query body).
|
||||
|
|
@ -120,98 +116,101 @@ func (o *GetLeadsParams) SetDefaults() {
|
|||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get leads params
|
||||
// WithTimeout adds the timeout to the get leads params.
|
||||
func (o *GetLeadsParams) WithTimeout(timeout time.Duration) *GetLeadsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get leads params
|
||||
// SetTimeout adds the timeout to the get leads params.
|
||||
func (o *GetLeadsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
o.inner.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get leads params
|
||||
// WithContext adds the context to the get leads params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [GetLeadsParams].
|
||||
func (o *GetLeadsParams) WithContext(ctx context.Context) *GetLeadsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get leads params
|
||||
// SetContext adds the context to the get leads params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [GetLeadsParams].
|
||||
func (o *GetLeadsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
o.inner.ctx = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get leads params
|
||||
// WithHTTPClient adds the HTTPClient to the get leads params.
|
||||
func (o *GetLeadsParams) WithHTTPClient(client *http.Client) *GetLeadsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get leads params
|
||||
// SetHTTPClient adds the HTTPClient to the get leads params.
|
||||
func (o *GetLeadsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithEmail adds the email to the get leads params
|
||||
// WithEmail adds the email to the get leads params.
|
||||
func (o *GetLeadsParams) WithEmail(email *string) *GetLeadsParams {
|
||||
o.SetEmail(email)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetEmail adds the email to the get leads params
|
||||
// SetEmail adds the email to the get leads params.
|
||||
func (o *GetLeadsParams) SetEmail(email *string) {
|
||||
o.Email = email
|
||||
}
|
||||
|
||||
// WithLeadID adds the leadID to the get leads params
|
||||
// WithLeadID adds the leadID to the get leads params.
|
||||
func (o *GetLeadsParams) WithLeadID(leadID *string) *GetLeadsParams {
|
||||
o.SetLeadID(leadID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetLeadID adds the leadId to the get leads params
|
||||
// SetLeadID adds the leadId to the get leads params.
|
||||
func (o *GetLeadsParams) SetLeadID(leadID *string) {
|
||||
o.LeadID = leadID
|
||||
}
|
||||
|
||||
// WithLimit adds the limit to the get leads params
|
||||
// WithLimit adds the limit to the get leads params.
|
||||
func (o *GetLeadsParams) WithLimit(limit *int64) *GetLeadsParams {
|
||||
o.SetLimit(limit)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetLimit adds the limit to the get leads params
|
||||
// SetLimit adds the limit to the get leads params.
|
||||
func (o *GetLeadsParams) SetLimit(limit *int64) {
|
||||
o.Limit = limit
|
||||
}
|
||||
|
||||
// WithName adds the name to the get leads params
|
||||
// WithName adds the name to the get leads params.
|
||||
func (o *GetLeadsParams) WithName(name *string) *GetLeadsParams {
|
||||
o.SetName(name)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetName adds the name to the get leads params
|
||||
// SetName adds the name to the get leads params.
|
||||
func (o *GetLeadsParams) SetName(name *string) {
|
||||
o.Name = name
|
||||
}
|
||||
|
||||
// WithOffset adds the offset to the get leads params
|
||||
// WithOffset adds the offset to the get leads params.
|
||||
func (o *GetLeadsParams) WithOffset(offset *int64) *GetLeadsParams {
|
||||
o.SetOffset(offset)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetOffset adds the offset to the get leads params
|
||||
// SetOffset adds the offset to the get leads params.
|
||||
func (o *GetLeadsParams) SetOffset(offset *int64) {
|
||||
o.Offset = offset
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
// WriteToRequest writes these params to a [runtime.ClientRequest].
|
||||
func (o *GetLeadsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
if err := r.SetTimeout(o.inner.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
|
@ -258,7 +257,7 @@ func (o *GetLeadsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regi
|
|||
if o.Limit != nil {
|
||||
qrLimit = *o.Limit
|
||||
}
|
||||
qLimit := swag.FormatInt64(qrLimit)
|
||||
qLimit := conv.FormatInteger(qrLimit)
|
||||
if qLimit != "" {
|
||||
|
||||
if err := r.SetQueryParam("limit", qLimit); err != nil {
|
||||
|
|
@ -292,7 +291,7 @@ func (o *GetLeadsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regi
|
|||
if o.Offset != nil {
|
||||
qrOffset = *o.Offset
|
||||
}
|
||||
qOffset := swag.FormatInt64(qrOffset)
|
||||
qOffset := conv.FormatInteger(qrOffset)
|
||||
if qOffset != "" {
|
||||
|
||||
if err := r.SetQueryParam("offset", qOffset); err != nil {
|
||||
|
|
|
|||
|
|
@ -6,17 +6,15 @@
|
|||
|
||||
package leads
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
stderrors "errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// GetLeadsReader is a Reader for the GetLeads structure.
|
||||
|
|
@ -25,7 +23,7 @@ type GetLeadsReader struct {
|
|||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetLeadsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
func (o *GetLeadsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetLeadsOK()
|
||||
|
|
@ -64,7 +62,7 @@ func (o *GetLeadsReader) ReadResponse(response runtime.ClientResponse, consumer
|
|||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
return nil, runtime.NewAPIError("[GET /leads] getLeads", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -73,11 +71,9 @@ func NewGetLeadsOK() *GetLeadsOK {
|
|||
return &GetLeadsOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetLeadsOK describes a response with status code 200, with default header values.
|
||||
|
||||
Response with an array of Lead objects
|
||||
*/
|
||||
// GetLeadsOK describes a response with status code 200, with default header values.
|
||||
//
|
||||
// Response with an array of Lead objects
|
||||
type GetLeadsOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
CacheControl string
|
||||
|
|
@ -116,11 +112,13 @@ func (o *GetLeadsOK) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetLeadsOK) Error() string {
|
||||
return fmt.Sprintf("[GET /leads][%d] getLeadsOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /leads][%d] getLeadsOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *GetLeadsOK) String() string {
|
||||
return fmt.Sprintf("[GET /leads][%d] getLeadsOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /leads][%d] getLeadsOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *GetLeadsOK) GetPayload() *crm_models.LeadResponse {
|
||||
|
|
@ -146,7 +144,7 @@ func (o *GetLeadsOK) readResponse(response runtime.ClientResponse, consumer runt
|
|||
o.Payload = new(crm_models.LeadResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -158,11 +156,9 @@ func NewGetLeadsUnauthorized() *GetLeadsUnauthorized {
|
|||
return &GetLeadsUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetLeadsUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
// GetLeadsUnauthorized describes a response with status code 401, with default header values.
|
||||
//
|
||||
// Access unauthorized, invalid API-KEY was used
|
||||
type GetLeadsUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -200,11 +196,13 @@ func (o *GetLeadsUnauthorized) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetLeadsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /leads][%d] getLeadsUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /leads][%d] getLeadsUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *GetLeadsUnauthorized) String() string {
|
||||
return fmt.Sprintf("[GET /leads][%d] getLeadsUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /leads][%d] getLeadsUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *GetLeadsUnauthorized) GetPayload() *crm_models.Error {
|
||||
|
|
@ -223,7 +221,7 @@ func (o *GetLeadsUnauthorized) readResponse(response runtime.ClientResponse, con
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -235,11 +233,9 @@ func NewGetLeadsForbidden() *GetLeadsForbidden {
|
|||
return &GetLeadsForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetLeadsForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
// GetLeadsForbidden describes a response with status code 403, with default header values.
|
||||
//
|
||||
// Access forbidden, account lacks access
|
||||
type GetLeadsForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -277,11 +273,13 @@ func (o *GetLeadsForbidden) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetLeadsForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /leads][%d] getLeadsForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /leads][%d] getLeadsForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *GetLeadsForbidden) String() string {
|
||||
return fmt.Sprintf("[GET /leads][%d] getLeadsForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /leads][%d] getLeadsForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *GetLeadsForbidden) GetPayload() *crm_models.Error {
|
||||
|
|
@ -300,7 +298,7 @@ func (o *GetLeadsForbidden) readResponse(response runtime.ClientResponse, consum
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -312,11 +310,9 @@ func NewGetLeadsNotFound() *GetLeadsNotFound {
|
|||
return &GetLeadsNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetLeadsNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
// GetLeadsNotFound describes a response with status code 404, with default header values.
|
||||
//
|
||||
// Resource was not found
|
||||
type GetLeadsNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -354,11 +350,13 @@ func (o *GetLeadsNotFound) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetLeadsNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /leads][%d] getLeadsNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /leads][%d] getLeadsNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *GetLeadsNotFound) String() string {
|
||||
return fmt.Sprintf("[GET /leads][%d] getLeadsNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /leads][%d] getLeadsNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *GetLeadsNotFound) GetPayload() *crm_models.Error {
|
||||
|
|
@ -377,7 +375,7 @@ func (o *GetLeadsNotFound) readResponse(response runtime.ClientResponse, consume
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -389,11 +387,9 @@ func NewGetLeadsUnprocessableEntity() *GetLeadsUnprocessableEntity {
|
|||
return &GetLeadsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetLeadsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
// GetLeadsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
//
|
||||
// Unprocessable Entity, likely a bad parameter
|
||||
type GetLeadsUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -431,11 +427,13 @@ func (o *GetLeadsUnprocessableEntity) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetLeadsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /leads][%d] getLeadsUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /leads][%d] getLeadsUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *GetLeadsUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[GET /leads][%d] getLeadsUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /leads][%d] getLeadsUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *GetLeadsUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
|
|
@ -454,7 +452,7 @@ func (o *GetLeadsUnprocessableEntity) readResponse(response runtime.ClientRespon
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -466,11 +464,9 @@ func NewGetLeadsInternalServerError() *GetLeadsInternalServerError {
|
|||
return &GetLeadsInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetLeadsInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
// GetLeadsInternalServerError describes a response with status code 500, with default header values.
|
||||
//
|
||||
// Server Internal Error
|
||||
type GetLeadsInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -508,11 +504,13 @@ func (o *GetLeadsInternalServerError) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetLeadsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /leads][%d] getLeadsInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /leads][%d] getLeadsInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *GetLeadsInternalServerError) String() string {
|
||||
return fmt.Sprintf("[GET /leads][%d] getLeadsInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /leads][%d] getLeadsInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *GetLeadsInternalServerError) GetPayload() *crm_models.Error {
|
||||
|
|
@ -531,7 +529,7 @@ func (o *GetLeadsInternalServerError) readResponse(response runtime.ClientRespon
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,55 +6,117 @@
|
|||
|
||||
package leads
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
httptransport "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// New creates a new leads API client.
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||
func New(transport runtime.ContextualTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
/*
|
||||
Client for leads API
|
||||
*/
|
||||
// New creates a new leads API client with basic auth credentials.
|
||||
//
|
||||
// It takes the following parameters:
|
||||
// - host: http host (github.com).
|
||||
// - basePath: any base path for the API client ("/v1", "/v3").
|
||||
// - scheme: http scheme ("http", "https").
|
||||
// - user: user for basic authentication header.
|
||||
// - password: password for basic authentication header.
|
||||
func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService {
|
||||
transport := httptransport.New(host, basePath, []string{scheme})
|
||||
transport.DefaultAuthentication = httptransport.BasicAuth(user, password)
|
||||
return &Client{transport: transport, formats: strfmt.Default}
|
||||
}
|
||||
|
||||
// New creates a new leads API client with a bearer token for authentication.
|
||||
//
|
||||
// It takes the following parameters:
|
||||
// - host: http host (github.com).
|
||||
// - basePath: any base path for the API client ("/v1", "/v3").
|
||||
// - scheme: http scheme ("http", "https").
|
||||
// - bearerToken: bearer token for Bearer authentication header.
|
||||
func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService {
|
||||
transport := httptransport.New(host, basePath, []string{scheme})
|
||||
transport.DefaultAuthentication = httptransport.BearerToken(bearerToken)
|
||||
return &Client{transport: transport, formats: strfmt.Default}
|
||||
}
|
||||
|
||||
// Client for leads API.
|
||||
type Client struct {
|
||||
transport runtime.ClientTransport
|
||||
transport runtime.ContextualTransport
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ClientOption is the option for Client methods
|
||||
// ClientOption may be used to customize the behavior of Client methods.
|
||||
type ClientOption func(*runtime.ClientOperation)
|
||||
|
||||
// ClientService is the interface for Client methods
|
||||
// ClientService is the interface for Client methods.
|
||||
type ClientService interface {
|
||||
|
||||
// DeleteLead delete a contact.
|
||||
DeleteLead(params *DeleteLeadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteLeadOK, error)
|
||||
|
||||
// DeleteLeadContext delete a contact.
|
||||
DeleteLeadContext(ctx context.Context, params *DeleteLeadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteLeadOK, error)
|
||||
|
||||
// GetLeads get a list of contacts.
|
||||
GetLeads(params *GetLeadsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLeadsOK, error)
|
||||
|
||||
// GetLeadsContext get a list of contacts.
|
||||
GetLeadsContext(ctx context.Context, params *GetLeadsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLeadsOK, error)
|
||||
|
||||
// PostLeads add new leads.
|
||||
PostLeads(params *PostLeadsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostLeadsOK, error)
|
||||
|
||||
// PostLeadsContext add new leads.
|
||||
PostLeadsContext(ctx context.Context, params *PostLeadsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostLeadsOK, error)
|
||||
|
||||
// PutLeads update leads.
|
||||
PutLeads(params *PutLeadsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutLeadsOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
// PutLeadsContext update leads.
|
||||
PutLeadsContext(ctx context.Context, params *PutLeadsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutLeadsOK, error)
|
||||
|
||||
SetTransport(transport runtime.ContextualTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteLead deletes a contact
|
||||
|
||||
Delete SalesforceDevops.net Lead record
|
||||
*/
|
||||
// DeleteLead deletes a contact.
|
||||
//
|
||||
// Delete SalesforceDevops.net Lead record.
|
||||
//
|
||||
// This method does not support injected context.
|
||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||
//
|
||||
// If you need to pass a specific context, use [Client.DeleteLeadContext] instead.
|
||||
func (a *Client) DeleteLead(params *DeleteLeadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteLeadOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
var ctx context.Context
|
||||
if params.inner.ctx != nil {
|
||||
ctx = params.inner.ctx
|
||||
} else {
|
||||
ctx = context.Background()
|
||||
}
|
||||
|
||||
return a.DeleteLeadContext(ctx, params, authInfo, opts...)
|
||||
}
|
||||
|
||||
// DeleteLeadContext deletes a contact.
|
||||
//
|
||||
// Delete SalesforceDevops.net Lead record.
|
||||
//
|
||||
// Do not use the deprecated [DeleteLeadParams.Context] with this method: it would be ignored.
|
||||
func (a *Client) DeleteLeadContext(ctx context.Context, params *DeleteLeadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteLeadOK, error) {
|
||||
// NOTE: parameters are not validated before sending
|
||||
if params == nil {
|
||||
params = NewDeleteLeadParams()
|
||||
}
|
||||
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "deleteLead",
|
||||
Method: "DELETE",
|
||||
|
|
@ -65,37 +127,63 @@ func (a *Client) DeleteLead(params *DeleteLeadParams, authInfo runtime.ClientAut
|
|||
Params: params,
|
||||
Reader: &DeleteLeadReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
result, err := a.transport.SubmitContext(ctx, op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// only one success response has to be checked
|
||||
success, ok := result.(*DeleteLeadOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
|
||||
// unexpected success response.
|
||||
|
||||
// no default response is defined.
|
||||
//
|
||||
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for deleteLead: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetLeads gets a list of contacts
|
||||
|
||||
Return a list of all available Leads
|
||||
*/
|
||||
// GetLeads gets a list of contacts.
|
||||
//
|
||||
// Return a list of all available Leads.
|
||||
//
|
||||
// This method does not support injected context.
|
||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||
//
|
||||
// If you need to pass a specific context, use [Client.GetLeadsContext] instead.
|
||||
func (a *Client) GetLeads(params *GetLeadsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLeadsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
var ctx context.Context
|
||||
if params.inner.ctx != nil {
|
||||
ctx = params.inner.ctx
|
||||
} else {
|
||||
ctx = context.Background()
|
||||
}
|
||||
|
||||
return a.GetLeadsContext(ctx, params, authInfo, opts...)
|
||||
}
|
||||
|
||||
// GetLeadsContext gets a list of contacts.
|
||||
//
|
||||
// Return a list of all available Leads.
|
||||
//
|
||||
// Do not use the deprecated [GetLeadsParams.Context] with this method: it would be ignored.
|
||||
func (a *Client) GetLeadsContext(ctx context.Context, params *GetLeadsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetLeadsOK, error) {
|
||||
// NOTE: parameters are not validated before sending
|
||||
if params == nil {
|
||||
params = NewGetLeadsParams()
|
||||
}
|
||||
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getLeads",
|
||||
Method: "GET",
|
||||
|
|
@ -106,37 +194,63 @@ func (a *Client) GetLeads(params *GetLeadsParams, authInfo runtime.ClientAuthInf
|
|||
Params: params,
|
||||
Reader: &GetLeadsReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
result, err := a.transport.SubmitContext(ctx, op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// only one success response has to be checked
|
||||
success, ok := result.(*GetLeadsOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
|
||||
// unexpected success response.
|
||||
|
||||
// no default response is defined.
|
||||
//
|
||||
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for getLeads: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostLeads adds new leads
|
||||
|
||||
Lead records to be added
|
||||
*/
|
||||
// PostLeads adds new leads.
|
||||
//
|
||||
// Lead records to be added.
|
||||
//
|
||||
// This method does not support injected context.
|
||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||
//
|
||||
// If you need to pass a specific context, use [Client.PostLeadsContext] instead.
|
||||
func (a *Client) PostLeads(params *PostLeadsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostLeadsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
var ctx context.Context
|
||||
if params.inner.ctx != nil {
|
||||
ctx = params.inner.ctx
|
||||
} else {
|
||||
ctx = context.Background()
|
||||
}
|
||||
|
||||
return a.PostLeadsContext(ctx, params, authInfo, opts...)
|
||||
}
|
||||
|
||||
// PostLeadsContext adds new leads.
|
||||
//
|
||||
// Lead records to be added.
|
||||
//
|
||||
// Do not use the deprecated [PostLeadsParams.Context] with this method: it would be ignored.
|
||||
func (a *Client) PostLeadsContext(ctx context.Context, params *PostLeadsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostLeadsOK, error) {
|
||||
// NOTE: parameters are not validated before sending
|
||||
if params == nil {
|
||||
params = NewPostLeadsParams()
|
||||
}
|
||||
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "postLeads",
|
||||
Method: "POST",
|
||||
|
|
@ -147,37 +261,63 @@ func (a *Client) PostLeads(params *PostLeadsParams, authInfo runtime.ClientAuthI
|
|||
Params: params,
|
||||
Reader: &PostLeadsReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
result, err := a.transport.SubmitContext(ctx, op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// only one success response has to be checked
|
||||
success, ok := result.(*PostLeadsOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
|
||||
// unexpected success response.
|
||||
|
||||
// no default response is defined.
|
||||
//
|
||||
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for postLeads: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PutLeads updates leads
|
||||
|
||||
Update Lead records
|
||||
*/
|
||||
// PutLeads updates leads.
|
||||
//
|
||||
// Update Lead records.
|
||||
//
|
||||
// This method does not support injected context.
|
||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||
//
|
||||
// If you need to pass a specific context, use [Client.PutLeadsContext] instead.
|
||||
func (a *Client) PutLeads(params *PutLeadsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutLeadsOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
var ctx context.Context
|
||||
if params.inner.ctx != nil {
|
||||
ctx = params.inner.ctx
|
||||
} else {
|
||||
ctx = context.Background()
|
||||
}
|
||||
|
||||
return a.PutLeadsContext(ctx, params, authInfo, opts...)
|
||||
}
|
||||
|
||||
// PutLeadsContext updates leads.
|
||||
//
|
||||
// Update Lead records.
|
||||
//
|
||||
// Do not use the deprecated [PutLeadsParams.Context] with this method: it would be ignored.
|
||||
func (a *Client) PutLeadsContext(ctx context.Context, params *PutLeadsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutLeadsOK, error) {
|
||||
// NOTE: parameters are not validated before sending
|
||||
if params == nil {
|
||||
params = NewPutLeadsParams()
|
||||
}
|
||||
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "putLeads",
|
||||
Method: "PUT",
|
||||
|
|
@ -188,28 +328,42 @@ func (a *Client) PutLeads(params *PutLeadsParams, authInfo runtime.ClientAuthInf
|
|||
Params: params,
|
||||
Reader: &PutLeadsReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
result, err := a.transport.SubmitContext(ctx, op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// only one success response has to be checked
|
||||
success, ok := result.(*PutLeadsOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
|
||||
// unexpected success response.
|
||||
|
||||
// no default response is defined.
|
||||
//
|
||||
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for putLeads: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
// SetTransport changes the transport on the client
|
||||
func (a *Client) SetTransport(transport runtime.ClientTransport) {
|
||||
func (a *Client) SetTransport(transport runtime.ContextualTransport) {
|
||||
a.transport = transport
|
||||
}
|
||||
|
||||
// innerParams captures internal fields so they don't conflict with user-supplied parameters.
|
||||
type innerParams struct {
|
||||
timeout time.Duration
|
||||
|
||||
// Deprecated: use the operation call with context to pass the context instead of [LeadsParams].
|
||||
ctx context.Context
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,20 +6,16 @@
|
|||
|
||||
package leads
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// NewPostLeadsParams creates a new PostLeadsParams object,
|
||||
|
|
@ -29,24 +25,28 @@ import (
|
|||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewPostLeadsParams() *PostLeadsParams {
|
||||
return &PostLeadsParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
return NewPostLeadsParamsWithTimeout(cr.DefaultTimeout)
|
||||
}
|
||||
|
||||
// NewPostLeadsParamsWithTimeout creates a new PostLeadsParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostLeadsParamsWithTimeout(timeout time.Duration) *PostLeadsParams {
|
||||
return &PostLeadsParams{
|
||||
timeout: timeout,
|
||||
inner: innerParams{
|
||||
timeout: timeout,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostLeadsParamsWithContext creates a new PostLeadsParams object
|
||||
// with the ability to set a context for a request.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PostLeadsParams].
|
||||
func NewPostLeadsParamsWithContext(ctx context.Context) *PostLeadsParams {
|
||||
return &PostLeadsParams{
|
||||
Context: ctx,
|
||||
inner: innerParams{
|
||||
ctx: ctx,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -67,15 +67,14 @@ PostLeadsParams contains all the parameters to send to the API endpoint
|
|||
*/
|
||||
type PostLeadsParams struct {
|
||||
|
||||
/* LeadRequest.
|
||||
|
||||
An array of new Lead records
|
||||
*/
|
||||
// LeadRequest.
|
||||
//
|
||||
// An array of new Lead records
|
||||
LeadRequest *crm_models.LeadRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
|
||||
inner innerParams
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the post leads params (not the query body).
|
||||
|
|
@ -93,54 +92,57 @@ func (o *PostLeadsParams) SetDefaults() {
|
|||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post leads params
|
||||
// WithTimeout adds the timeout to the post leads params.
|
||||
func (o *PostLeadsParams) WithTimeout(timeout time.Duration) *PostLeadsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post leads params
|
||||
// SetTimeout adds the timeout to the post leads params.
|
||||
func (o *PostLeadsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
o.inner.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post leads params
|
||||
// WithContext adds the context to the post leads params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PostLeadsParams].
|
||||
func (o *PostLeadsParams) WithContext(ctx context.Context) *PostLeadsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post leads params
|
||||
// SetContext adds the context to the post leads params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PostLeadsParams].
|
||||
func (o *PostLeadsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
o.inner.ctx = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post leads params
|
||||
// WithHTTPClient adds the HTTPClient to the post leads params.
|
||||
func (o *PostLeadsParams) WithHTTPClient(client *http.Client) *PostLeadsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post leads params
|
||||
// SetHTTPClient adds the HTTPClient to the post leads params.
|
||||
func (o *PostLeadsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithLeadRequest adds the leadRequest to the post leads params
|
||||
// WithLeadRequest adds the leadRequest to the post leads params.
|
||||
func (o *PostLeadsParams) WithLeadRequest(leadRequest *crm_models.LeadRequest) *PostLeadsParams {
|
||||
o.SetLeadRequest(leadRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetLeadRequest adds the leadRequest to the post leads params
|
||||
// SetLeadRequest adds the leadRequest to the post leads params.
|
||||
func (o *PostLeadsParams) SetLeadRequest(leadRequest *crm_models.LeadRequest) {
|
||||
o.LeadRequest = leadRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
// WriteToRequest writes these params to a [runtime.ClientRequest].
|
||||
func (o *PostLeadsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
if err := r.SetTimeout(o.inner.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
|
|
|||
|
|
@ -6,17 +6,15 @@
|
|||
|
||||
package leads
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
stderrors "errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// PostLeadsReader is a Reader for the PostLeads structure.
|
||||
|
|
@ -25,7 +23,7 @@ type PostLeadsReader struct {
|
|||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostLeadsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
func (o *PostLeadsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPostLeadsOK()
|
||||
|
|
@ -64,7 +62,7 @@ func (o *PostLeadsReader) ReadResponse(response runtime.ClientResponse, consumer
|
|||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
return nil, runtime.NewAPIError("[POST /leads] postLeads", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -73,11 +71,9 @@ func NewPostLeadsOK() *PostLeadsOK {
|
|||
return &PostLeadsOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostLeadsOK describes a response with status code 200, with default header values.
|
||||
|
||||
Response with an array of Lead objects
|
||||
*/
|
||||
// PostLeadsOK describes a response with status code 200, with default header values.
|
||||
//
|
||||
// Response with an array of Lead objects
|
||||
type PostLeadsOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
CacheControl string
|
||||
|
|
@ -116,11 +112,13 @@ func (o *PostLeadsOK) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostLeadsOK) Error() string {
|
||||
return fmt.Sprintf("[POST /leads][%d] postLeadsOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /leads][%d] postLeadsOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *PostLeadsOK) String() string {
|
||||
return fmt.Sprintf("[POST /leads][%d] postLeadsOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /leads][%d] postLeadsOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *PostLeadsOK) GetPayload() *crm_models.LeadResponse {
|
||||
|
|
@ -146,7 +144,7 @@ func (o *PostLeadsOK) readResponse(response runtime.ClientResponse, consumer run
|
|||
o.Payload = new(crm_models.LeadResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -158,11 +156,9 @@ func NewPostLeadsUnauthorized() *PostLeadsUnauthorized {
|
|||
return &PostLeadsUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostLeadsUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
// PostLeadsUnauthorized describes a response with status code 401, with default header values.
|
||||
//
|
||||
// Access unauthorized, invalid API-KEY was used
|
||||
type PostLeadsUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -200,11 +196,13 @@ func (o *PostLeadsUnauthorized) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostLeadsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[POST /leads][%d] postLeadsUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /leads][%d] postLeadsUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *PostLeadsUnauthorized) String() string {
|
||||
return fmt.Sprintf("[POST /leads][%d] postLeadsUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /leads][%d] postLeadsUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *PostLeadsUnauthorized) GetPayload() *crm_models.Error {
|
||||
|
|
@ -223,7 +221,7 @@ func (o *PostLeadsUnauthorized) readResponse(response runtime.ClientResponse, co
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -235,11 +233,9 @@ func NewPostLeadsForbidden() *PostLeadsForbidden {
|
|||
return &PostLeadsForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostLeadsForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
// PostLeadsForbidden describes a response with status code 403, with default header values.
|
||||
//
|
||||
// Access forbidden, account lacks access
|
||||
type PostLeadsForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -277,11 +273,13 @@ func (o *PostLeadsForbidden) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostLeadsForbidden) Error() string {
|
||||
return fmt.Sprintf("[POST /leads][%d] postLeadsForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /leads][%d] postLeadsForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *PostLeadsForbidden) String() string {
|
||||
return fmt.Sprintf("[POST /leads][%d] postLeadsForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /leads][%d] postLeadsForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *PostLeadsForbidden) GetPayload() *crm_models.Error {
|
||||
|
|
@ -300,7 +298,7 @@ func (o *PostLeadsForbidden) readResponse(response runtime.ClientResponse, consu
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -312,11 +310,9 @@ func NewPostLeadsNotFound() *PostLeadsNotFound {
|
|||
return &PostLeadsNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostLeadsNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
// PostLeadsNotFound describes a response with status code 404, with default header values.
|
||||
//
|
||||
// Resource was not found
|
||||
type PostLeadsNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -354,11 +350,13 @@ func (o *PostLeadsNotFound) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostLeadsNotFound) Error() string {
|
||||
return fmt.Sprintf("[POST /leads][%d] postLeadsNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /leads][%d] postLeadsNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *PostLeadsNotFound) String() string {
|
||||
return fmt.Sprintf("[POST /leads][%d] postLeadsNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /leads][%d] postLeadsNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *PostLeadsNotFound) GetPayload() *crm_models.Error {
|
||||
|
|
@ -377,7 +375,7 @@ func (o *PostLeadsNotFound) readResponse(response runtime.ClientResponse, consum
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -389,11 +387,9 @@ func NewPostLeadsUnprocessableEntity() *PostLeadsUnprocessableEntity {
|
|||
return &PostLeadsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostLeadsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
// PostLeadsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
//
|
||||
// Unprocessable Entity, likely a bad parameter
|
||||
type PostLeadsUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -431,11 +427,13 @@ func (o *PostLeadsUnprocessableEntity) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostLeadsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[POST /leads][%d] postLeadsUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /leads][%d] postLeadsUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *PostLeadsUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[POST /leads][%d] postLeadsUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /leads][%d] postLeadsUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *PostLeadsUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
|
|
@ -454,7 +452,7 @@ func (o *PostLeadsUnprocessableEntity) readResponse(response runtime.ClientRespo
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -466,11 +464,9 @@ func NewPostLeadsInternalServerError() *PostLeadsInternalServerError {
|
|||
return &PostLeadsInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostLeadsInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
// PostLeadsInternalServerError describes a response with status code 500, with default header values.
|
||||
//
|
||||
// Server Internal Error
|
||||
type PostLeadsInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -508,11 +504,13 @@ func (o *PostLeadsInternalServerError) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostLeadsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[POST /leads][%d] postLeadsInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /leads][%d] postLeadsInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *PostLeadsInternalServerError) String() string {
|
||||
return fmt.Sprintf("[POST /leads][%d] postLeadsInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /leads][%d] postLeadsInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *PostLeadsInternalServerError) GetPayload() *crm_models.Error {
|
||||
|
|
@ -531,7 +529,7 @@ func (o *PostLeadsInternalServerError) readResponse(response runtime.ClientRespo
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,20 +6,16 @@
|
|||
|
||||
package leads
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// NewPutLeadsParams creates a new PutLeadsParams object,
|
||||
|
|
@ -29,24 +25,28 @@ import (
|
|||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewPutLeadsParams() *PutLeadsParams {
|
||||
return &PutLeadsParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
return NewPutLeadsParamsWithTimeout(cr.DefaultTimeout)
|
||||
}
|
||||
|
||||
// NewPutLeadsParamsWithTimeout creates a new PutLeadsParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPutLeadsParamsWithTimeout(timeout time.Duration) *PutLeadsParams {
|
||||
return &PutLeadsParams{
|
||||
timeout: timeout,
|
||||
inner: innerParams{
|
||||
timeout: timeout,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutLeadsParamsWithContext creates a new PutLeadsParams object
|
||||
// with the ability to set a context for a request.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PutLeadsParams].
|
||||
func NewPutLeadsParamsWithContext(ctx context.Context) *PutLeadsParams {
|
||||
return &PutLeadsParams{
|
||||
Context: ctx,
|
||||
inner: innerParams{
|
||||
ctx: ctx,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -67,15 +67,14 @@ PutLeadsParams contains all the parameters to send to the API endpoint
|
|||
*/
|
||||
type PutLeadsParams struct {
|
||||
|
||||
/* LeadRequest.
|
||||
|
||||
An array of new Lead records
|
||||
*/
|
||||
// LeadRequest.
|
||||
//
|
||||
// An array of new Lead records
|
||||
LeadRequest *crm_models.LeadRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
|
||||
inner innerParams
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the put leads params (not the query body).
|
||||
|
|
@ -93,54 +92,57 @@ func (o *PutLeadsParams) SetDefaults() {
|
|||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the put leads params
|
||||
// WithTimeout adds the timeout to the put leads params.
|
||||
func (o *PutLeadsParams) WithTimeout(timeout time.Duration) *PutLeadsParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the put leads params
|
||||
// SetTimeout adds the timeout to the put leads params.
|
||||
func (o *PutLeadsParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
o.inner.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the put leads params
|
||||
// WithContext adds the context to the put leads params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PutLeadsParams].
|
||||
func (o *PutLeadsParams) WithContext(ctx context.Context) *PutLeadsParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the put leads params
|
||||
// SetContext adds the context to the put leads params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PutLeadsParams].
|
||||
func (o *PutLeadsParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
o.inner.ctx = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the put leads params
|
||||
// WithHTTPClient adds the HTTPClient to the put leads params.
|
||||
func (o *PutLeadsParams) WithHTTPClient(client *http.Client) *PutLeadsParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the put leads params
|
||||
// SetHTTPClient adds the HTTPClient to the put leads params.
|
||||
func (o *PutLeadsParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithLeadRequest adds the leadRequest to the put leads params
|
||||
// WithLeadRequest adds the leadRequest to the put leads params.
|
||||
func (o *PutLeadsParams) WithLeadRequest(leadRequest *crm_models.LeadRequest) *PutLeadsParams {
|
||||
o.SetLeadRequest(leadRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetLeadRequest adds the leadRequest to the put leads params
|
||||
// SetLeadRequest adds the leadRequest to the put leads params.
|
||||
func (o *PutLeadsParams) SetLeadRequest(leadRequest *crm_models.LeadRequest) {
|
||||
o.LeadRequest = leadRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
// WriteToRequest writes these params to a [runtime.ClientRequest].
|
||||
func (o *PutLeadsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
if err := r.SetTimeout(o.inner.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
|
|
|||
|
|
@ -6,17 +6,15 @@
|
|||
|
||||
package leads
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
stderrors "errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/crm/crm_models"
|
||||
)
|
||||
|
||||
// PutLeadsReader is a Reader for the PutLeads structure.
|
||||
|
|
@ -25,7 +23,7 @@ type PutLeadsReader struct {
|
|||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PutLeadsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
func (o *PutLeadsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPutLeadsOK()
|
||||
|
|
@ -64,7 +62,7 @@ func (o *PutLeadsReader) ReadResponse(response runtime.ClientResponse, consumer
|
|||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
return nil, runtime.NewAPIError("[PUT /leads] putLeads", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -73,11 +71,9 @@ func NewPutLeadsOK() *PutLeadsOK {
|
|||
return &PutLeadsOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutLeadsOK describes a response with status code 200, with default header values.
|
||||
|
||||
Response with an array of Lead objects
|
||||
*/
|
||||
// PutLeadsOK describes a response with status code 200, with default header values.
|
||||
//
|
||||
// Response with an array of Lead objects
|
||||
type PutLeadsOK struct {
|
||||
AccessControlAllowOrigin string
|
||||
CacheControl string
|
||||
|
|
@ -116,11 +112,13 @@ func (o *PutLeadsOK) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutLeadsOK) Error() string {
|
||||
return fmt.Sprintf("[PUT /leads][%d] putLeadsOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /leads][%d] putLeadsOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *PutLeadsOK) String() string {
|
||||
return fmt.Sprintf("[PUT /leads][%d] putLeadsOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /leads][%d] putLeadsOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *PutLeadsOK) GetPayload() *crm_models.LeadResponse {
|
||||
|
|
@ -146,7 +144,7 @@ func (o *PutLeadsOK) readResponse(response runtime.ClientResponse, consumer runt
|
|||
o.Payload = new(crm_models.LeadResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -158,11 +156,9 @@ func NewPutLeadsUnauthorized() *PutLeadsUnauthorized {
|
|||
return &PutLeadsUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutLeadsUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
// PutLeadsUnauthorized describes a response with status code 401, with default header values.
|
||||
//
|
||||
// Access unauthorized, invalid API-KEY was used
|
||||
type PutLeadsUnauthorized struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -200,11 +196,13 @@ func (o *PutLeadsUnauthorized) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutLeadsUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[PUT /leads][%d] putLeadsUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /leads][%d] putLeadsUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *PutLeadsUnauthorized) String() string {
|
||||
return fmt.Sprintf("[PUT /leads][%d] putLeadsUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /leads][%d] putLeadsUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *PutLeadsUnauthorized) GetPayload() *crm_models.Error {
|
||||
|
|
@ -223,7 +221,7 @@ func (o *PutLeadsUnauthorized) readResponse(response runtime.ClientResponse, con
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -235,11 +233,9 @@ func NewPutLeadsForbidden() *PutLeadsForbidden {
|
|||
return &PutLeadsForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutLeadsForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
// PutLeadsForbidden describes a response with status code 403, with default header values.
|
||||
//
|
||||
// Access forbidden, account lacks access
|
||||
type PutLeadsForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -277,11 +273,13 @@ func (o *PutLeadsForbidden) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutLeadsForbidden) Error() string {
|
||||
return fmt.Sprintf("[PUT /leads][%d] putLeadsForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /leads][%d] putLeadsForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *PutLeadsForbidden) String() string {
|
||||
return fmt.Sprintf("[PUT /leads][%d] putLeadsForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /leads][%d] putLeadsForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *PutLeadsForbidden) GetPayload() *crm_models.Error {
|
||||
|
|
@ -300,7 +298,7 @@ func (o *PutLeadsForbidden) readResponse(response runtime.ClientResponse, consum
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -312,11 +310,9 @@ func NewPutLeadsNotFound() *PutLeadsNotFound {
|
|||
return &PutLeadsNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutLeadsNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
// PutLeadsNotFound describes a response with status code 404, with default header values.
|
||||
//
|
||||
// Resource was not found
|
||||
type PutLeadsNotFound struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -354,11 +350,13 @@ func (o *PutLeadsNotFound) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutLeadsNotFound) Error() string {
|
||||
return fmt.Sprintf("[PUT /leads][%d] putLeadsNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /leads][%d] putLeadsNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *PutLeadsNotFound) String() string {
|
||||
return fmt.Sprintf("[PUT /leads][%d] putLeadsNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /leads][%d] putLeadsNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *PutLeadsNotFound) GetPayload() *crm_models.Error {
|
||||
|
|
@ -377,7 +375,7 @@ func (o *PutLeadsNotFound) readResponse(response runtime.ClientResponse, consume
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -389,11 +387,9 @@ func NewPutLeadsUnprocessableEntity() *PutLeadsUnprocessableEntity {
|
|||
return &PutLeadsUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutLeadsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
// PutLeadsUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
//
|
||||
// Unprocessable Entity, likely a bad parameter
|
||||
type PutLeadsUnprocessableEntity struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -431,11 +427,13 @@ func (o *PutLeadsUnprocessableEntity) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutLeadsUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[PUT /leads][%d] putLeadsUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /leads][%d] putLeadsUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *PutLeadsUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[PUT /leads][%d] putLeadsUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /leads][%d] putLeadsUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *PutLeadsUnprocessableEntity) GetPayload() *crm_models.Error {
|
||||
|
|
@ -454,7 +452,7 @@ func (o *PutLeadsUnprocessableEntity) readResponse(response runtime.ClientRespon
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -466,11 +464,9 @@ func NewPutLeadsInternalServerError() *PutLeadsInternalServerError {
|
|||
return &PutLeadsInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutLeadsInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
// PutLeadsInternalServerError describes a response with status code 500, with default header values.
|
||||
//
|
||||
// Server Internal Error
|
||||
type PutLeadsInternalServerError struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -508,11 +504,13 @@ func (o *PutLeadsInternalServerError) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutLeadsInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[PUT /leads][%d] putLeadsInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /leads][%d] putLeadsInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *PutLeadsInternalServerError) String() string {
|
||||
return fmt.Sprintf("[PUT /leads][%d] putLeadsInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /leads][%d] putLeadsInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *PutLeadsInternalServerError) GetPayload() *crm_models.Error {
|
||||
|
|
@ -531,7 +529,7 @@ func (o *PutLeadsInternalServerError) readResponse(response runtime.ClientRespon
|
|||
o.Payload = new(crm_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,15 +6,14 @@
|
|||
|
||||
package crm_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"
|
||||
stderrors "errors"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/swag/jsonutils"
|
||||
"github.com/go-openapi/swag/typeutils"
|
||||
)
|
||||
|
||||
// Account account
|
||||
|
|
@ -43,6 +42,9 @@ type Account struct {
|
|||
// Contact ID
|
||||
BillingContactID *string `json:"BillingContactID,omitempty"`
|
||||
|
||||
// Channels
|
||||
Channels *string `json:"Channels,omitempty"`
|
||||
|
||||
// Closed Date
|
||||
ClosedDate *string `json:"ClosedDate,omitempty"`
|
||||
|
||||
|
|
@ -76,6 +78,9 @@ type Account struct {
|
|||
// Main Account Email
|
||||
Email *string `json:"Email,omitempty"`
|
||||
|
||||
// Enrichment Status
|
||||
EnrichmentStatus *string `json:"EnrichmentStatus,omitempty"`
|
||||
|
||||
// The amount of equity EquityFunding
|
||||
EquityFunding *float64 `json:"EquityFunding,omitempty"`
|
||||
|
||||
|
|
@ -88,6 +93,9 @@ type Account struct {
|
|||
// Date company founded
|
||||
FoundedDate *string `json:"FoundedDate,omitempty"`
|
||||
|
||||
// Full Description
|
||||
FullDescription *string `json:"FullDescription,omitempty"`
|
||||
|
||||
// Account Id
|
||||
ID string `json:"ID,omitempty"`
|
||||
|
||||
|
|
@ -106,6 +114,12 @@ type Account struct {
|
|||
// Industry
|
||||
Industry *string `json:"Industry,omitempty"`
|
||||
|
||||
// Last Enriched By User ID
|
||||
LastEnrichedByID *string `json:"LastEnrichedByID,omitempty"`
|
||||
|
||||
// Last Enrichment Date
|
||||
LastEnrichmentDate *string `json:"LastEnrichmentDate,omitempty"`
|
||||
|
||||
// Last Modified By User ID
|
||||
LastModifiedByID *string `json:"LastModifiedByID,omitempty"`
|
||||
|
||||
|
|
@ -210,17 +224,21 @@ func (m *Account) Validate(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *Account) validateBillingAddress(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.BillingAddress) { // not required
|
||||
if typeutils.IsZero(m.BillingAddress) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.BillingAddress != nil {
|
||||
if err := m.BillingAddress.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("BillingAddress")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("BillingAddress")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -229,17 +247,21 @@ func (m *Account) validateBillingAddress(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *Account) validateShippingAddress(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.ShippingAddress) { // not required
|
||||
if typeutils.IsZero(m.ShippingAddress) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.ShippingAddress != nil {
|
||||
if err := m.ShippingAddress.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("ShippingAddress")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("ShippingAddress")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -268,12 +290,21 @@ func (m *Account) ContextValidate(ctx context.Context, formats strfmt.Registry)
|
|||
func (m *Account) contextValidateBillingAddress(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.BillingAddress != nil {
|
||||
|
||||
if typeutils.IsZero(m.BillingAddress) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.BillingAddress.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("BillingAddress")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("BillingAddress")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -284,12 +315,21 @@ func (m *Account) contextValidateBillingAddress(ctx context.Context, formats str
|
|||
func (m *Account) contextValidateShippingAddress(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.ShippingAddress != nil {
|
||||
|
||||
if typeutils.IsZero(m.ShippingAddress) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.ShippingAddress.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("ShippingAddress")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("ShippingAddress")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -302,13 +342,13 @@ func (m *Account) MarshalBinary() ([]byte, error) {
|
|||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
return jsonutils.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *Account) UnmarshalBinary(b []byte) error {
|
||||
var res Account
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
|
|
|
|||
|
|
@ -6,16 +6,15 @@
|
|||
|
||||
package crm_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"
|
||||
stderrors "errors"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/swag/jsonutils"
|
||||
"github.com/go-openapi/swag/typeutils"
|
||||
)
|
||||
|
||||
// AccountRequest An array of Account objects with Contacts
|
||||
|
|
@ -42,22 +41,26 @@ func (m *AccountRequest) Validate(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *AccountRequest) validateData(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Data) { // not required
|
||||
if typeutils.IsZero(m.Data) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Data); i++ {
|
||||
if swag.IsZero(m.Data[i]) { // not required
|
||||
if typeutils.IsZero(m.Data[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Data[i] != nil {
|
||||
if err := m.Data[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -86,12 +89,21 @@ func (m *AccountRequest) contextValidateData(ctx context.Context, formats strfmt
|
|||
for i := 0; i < len(m.Data); i++ {
|
||||
|
||||
if m.Data[i] != nil {
|
||||
|
||||
if typeutils.IsZero(m.Data[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -106,13 +118,13 @@ func (m *AccountRequest) MarshalBinary() ([]byte, error) {
|
|||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
return jsonutils.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *AccountRequest) UnmarshalBinary(b []byte) error {
|
||||
var res AccountRequest
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
|
|
|
|||
|
|
@ -6,16 +6,15 @@
|
|||
|
||||
package crm_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"
|
||||
stderrors "errors"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/swag/jsonutils"
|
||||
"github.com/go-openapi/swag/typeutils"
|
||||
)
|
||||
|
||||
// AccountResponse An array of Account objects with Contacts
|
||||
|
|
@ -49,22 +48,26 @@ func (m *AccountResponse) Validate(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *AccountResponse) validateData(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Data) { // not required
|
||||
if typeutils.IsZero(m.Data) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Data); i++ {
|
||||
if swag.IsZero(m.Data[i]) { // not required
|
||||
if typeutils.IsZero(m.Data[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Data[i] != nil {
|
||||
if err := m.Data[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -75,17 +78,21 @@ func (m *AccountResponse) validateData(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *AccountResponse) validateMeta(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Meta) { // not required
|
||||
if typeutils.IsZero(m.Meta) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.Meta != nil {
|
||||
if err := m.Meta.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Meta")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Meta")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -116,12 +123,21 @@ func (m *AccountResponse) contextValidateData(ctx context.Context, formats strfm
|
|||
for i := 0; i < len(m.Data); i++ {
|
||||
|
||||
if m.Data[i] != nil {
|
||||
|
||||
if typeutils.IsZero(m.Data[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -134,12 +150,21 @@ func (m *AccountResponse) contextValidateData(ctx context.Context, formats strfm
|
|||
func (m *AccountResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Meta != nil {
|
||||
|
||||
if typeutils.IsZero(m.Meta) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Meta.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Meta")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Meta")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -152,13 +177,13 @@ func (m *AccountResponse) MarshalBinary() ([]byte, error) {
|
|||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
return jsonutils.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *AccountResponse) UnmarshalBinary(b []byte) error {
|
||||
var res AccountResponse
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
|
|
|
|||
|
|
@ -6,14 +6,11 @@
|
|||
|
||||
package crm_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"
|
||||
"github.com/go-openapi/swag/jsonutils"
|
||||
)
|
||||
|
||||
// Address address
|
||||
|
|
@ -58,13 +55,13 @@ func (m *Address) MarshalBinary() ([]byte, error) {
|
|||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
return jsonutils.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *Address) UnmarshalBinary(b []byte) error {
|
||||
var res Address
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
|
|
|
|||
|
|
@ -6,15 +6,14 @@
|
|||
|
||||
package crm_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"
|
||||
stderrors "errors"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/swag/jsonutils"
|
||||
"github.com/go-openapi/swag/typeutils"
|
||||
)
|
||||
|
||||
// Asset asset
|
||||
|
|
@ -58,6 +57,9 @@ type Asset struct {
|
|||
// Current Lifecycle End Date
|
||||
CurrentLifecycleEndDate *string `json:"CurrentLifecycleEndDate,omitempty"`
|
||||
|
||||
// Current Lifecycle Start Date
|
||||
CurrentLifecycleStartDate *string `json:"CurrentLifecycleStartDate,omitempty"`
|
||||
|
||||
// Current Monthly Recurring Revenue
|
||||
CurrentMrr *float64 `json:"CurrentMrr,omitempty"`
|
||||
|
||||
|
|
@ -136,7 +138,7 @@ type Asset struct {
|
|||
// Serial Number
|
||||
SerialNumber *string `json:"SerialNumber,omitempty"`
|
||||
|
||||
// Status
|
||||
// Compatibility-only legacy field. The authoritative CRM Asset table does not persist Status; native CRM mutations reject non-null values.
|
||||
Status *string `json:"Status,omitempty"`
|
||||
|
||||
// Status Reason
|
||||
|
|
@ -176,17 +178,21 @@ func (m *Asset) Validate(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *Asset) validateAddress(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Address) { // not required
|
||||
if typeutils.IsZero(m.Address) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.Address != nil {
|
||||
if err := m.Address.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Address")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Address")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -211,12 +217,21 @@ func (m *Asset) ContextValidate(ctx context.Context, formats strfmt.Registry) er
|
|||
func (m *Asset) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Address != nil {
|
||||
|
||||
if typeutils.IsZero(m.Address) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Address.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Address")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Address")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -229,13 +244,13 @@ func (m *Asset) MarshalBinary() ([]byte, error) {
|
|||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
return jsonutils.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *Asset) UnmarshalBinary(b []byte) error {
|
||||
var res Asset
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
package crm_models
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestAssetLifecycleStartDateIsInGeneratedJSONContract(t *testing.T) {
|
||||
start := "2026-07-24T03:00:00Z"
|
||||
body, err := json.Marshal(&Asset{CurrentLifecycleStartDate: &start})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
const want = `{"CurrentLifecycleStartDate":"2026-07-24T03:00:00Z"}`
|
||||
if string(body) != want {
|
||||
t.Fatalf("got %s, want %s", body, want)
|
||||
}
|
||||
}
|
||||
|
|
@ -6,16 +6,15 @@
|
|||
|
||||
package crm_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"
|
||||
stderrors "errors"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/swag/jsonutils"
|
||||
"github.com/go-openapi/swag/typeutils"
|
||||
)
|
||||
|
||||
// AssetRequest An array of Asset objects with Contacts
|
||||
|
|
@ -42,22 +41,26 @@ func (m *AssetRequest) Validate(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *AssetRequest) validateData(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Data) { // not required
|
||||
if typeutils.IsZero(m.Data) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Data); i++ {
|
||||
if swag.IsZero(m.Data[i]) { // not required
|
||||
if typeutils.IsZero(m.Data[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Data[i] != nil {
|
||||
if err := m.Data[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -86,12 +89,21 @@ func (m *AssetRequest) contextValidateData(ctx context.Context, formats strfmt.R
|
|||
for i := 0; i < len(m.Data); i++ {
|
||||
|
||||
if m.Data[i] != nil {
|
||||
|
||||
if typeutils.IsZero(m.Data[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -106,13 +118,13 @@ func (m *AssetRequest) MarshalBinary() ([]byte, error) {
|
|||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
return jsonutils.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *AssetRequest) UnmarshalBinary(b []byte) error {
|
||||
var res AssetRequest
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
|
|
|
|||
|
|
@ -6,16 +6,15 @@
|
|||
|
||||
package crm_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"
|
||||
stderrors "errors"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/swag/jsonutils"
|
||||
"github.com/go-openapi/swag/typeutils"
|
||||
)
|
||||
|
||||
// AssetResponse An array of Asset objects with Contacts
|
||||
|
|
@ -49,22 +48,26 @@ func (m *AssetResponse) Validate(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *AssetResponse) validateData(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Data) { // not required
|
||||
if typeutils.IsZero(m.Data) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Data); i++ {
|
||||
if swag.IsZero(m.Data[i]) { // not required
|
||||
if typeutils.IsZero(m.Data[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Data[i] != nil {
|
||||
if err := m.Data[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -75,17 +78,21 @@ func (m *AssetResponse) validateData(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *AssetResponse) validateMeta(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Meta) { // not required
|
||||
if typeutils.IsZero(m.Meta) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.Meta != nil {
|
||||
if err := m.Meta.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Meta")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Meta")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -116,12 +123,21 @@ func (m *AssetResponse) contextValidateData(ctx context.Context, formats strfmt.
|
|||
for i := 0; i < len(m.Data); i++ {
|
||||
|
||||
if m.Data[i] != nil {
|
||||
|
||||
if typeutils.IsZero(m.Data[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -134,12 +150,21 @@ func (m *AssetResponse) contextValidateData(ctx context.Context, formats strfmt.
|
|||
func (m *AssetResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Meta != nil {
|
||||
|
||||
if typeutils.IsZero(m.Meta) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Meta.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Meta")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Meta")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -152,13 +177,13 @@ func (m *AssetResponse) MarshalBinary() ([]byte, error) {
|
|||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
return jsonutils.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *AssetResponse) UnmarshalBinary(b []byte) error {
|
||||
var res AssetResponse
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
|
|
|
|||
|
|
@ -6,15 +6,14 @@
|
|||
|
||||
package crm_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"
|
||||
stderrors "errors"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/swag/jsonutils"
|
||||
"github.com/go-openapi/swag/typeutils"
|
||||
)
|
||||
|
||||
// Contact contact
|
||||
|
|
@ -34,6 +33,9 @@ type Contact struct {
|
|||
// Birthdate
|
||||
BirthDate *string `json:"BirthDate,omitempty"`
|
||||
|
||||
// Channels
|
||||
Channels *string `json:"Channels,omitempty"`
|
||||
|
||||
// Created By User ID
|
||||
CreatedByID *string `json:"CreatedByID,omitempty"`
|
||||
|
||||
|
|
@ -168,17 +170,21 @@ func (m *Contact) Validate(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *Contact) validateMailingAddress(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.MailingAddress) { // not required
|
||||
if typeutils.IsZero(m.MailingAddress) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.MailingAddress != nil {
|
||||
if err := m.MailingAddress.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("MailingAddress")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("MailingAddress")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -187,17 +193,21 @@ func (m *Contact) validateMailingAddress(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *Contact) validateOtherAddress(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.OtherAddress) { // not required
|
||||
if typeutils.IsZero(m.OtherAddress) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.OtherAddress != nil {
|
||||
if err := m.OtherAddress.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("OtherAddress")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("OtherAddress")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -226,12 +236,21 @@ func (m *Contact) ContextValidate(ctx context.Context, formats strfmt.Registry)
|
|||
func (m *Contact) contextValidateMailingAddress(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.MailingAddress != nil {
|
||||
|
||||
if typeutils.IsZero(m.MailingAddress) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.MailingAddress.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("MailingAddress")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("MailingAddress")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -242,12 +261,21 @@ func (m *Contact) contextValidateMailingAddress(ctx context.Context, formats str
|
|||
func (m *Contact) contextValidateOtherAddress(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.OtherAddress != nil {
|
||||
|
||||
if typeutils.IsZero(m.OtherAddress) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.OtherAddress.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("OtherAddress")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("OtherAddress")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -260,13 +288,13 @@ func (m *Contact) MarshalBinary() ([]byte, error) {
|
|||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
return jsonutils.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *Contact) UnmarshalBinary(b []byte) error {
|
||||
var res Contact
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
|
|
|
|||
|
|
@ -6,16 +6,15 @@
|
|||
|
||||
package crm_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"
|
||||
stderrors "errors"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/swag/jsonutils"
|
||||
"github.com/go-openapi/swag/typeutils"
|
||||
)
|
||||
|
||||
// ContactRequest contact request
|
||||
|
|
@ -42,22 +41,26 @@ func (m *ContactRequest) Validate(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *ContactRequest) validateData(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Data) { // not required
|
||||
if typeutils.IsZero(m.Data) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Data); i++ {
|
||||
if swag.IsZero(m.Data[i]) { // not required
|
||||
if typeutils.IsZero(m.Data[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Data[i] != nil {
|
||||
if err := m.Data[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -86,12 +89,21 @@ func (m *ContactRequest) contextValidateData(ctx context.Context, formats strfmt
|
|||
for i := 0; i < len(m.Data); i++ {
|
||||
|
||||
if m.Data[i] != nil {
|
||||
|
||||
if typeutils.IsZero(m.Data[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -106,13 +118,13 @@ func (m *ContactRequest) MarshalBinary() ([]byte, error) {
|
|||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
return jsonutils.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *ContactRequest) UnmarshalBinary(b []byte) error {
|
||||
var res ContactRequest
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
|
|
|
|||
|
|
@ -6,16 +6,15 @@
|
|||
|
||||
package crm_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"
|
||||
stderrors "errors"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/swag/jsonutils"
|
||||
"github.com/go-openapi/swag/typeutils"
|
||||
)
|
||||
|
||||
// ContactResponse contact response
|
||||
|
|
@ -49,22 +48,26 @@ func (m *ContactResponse) Validate(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *ContactResponse) validateData(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Data) { // not required
|
||||
if typeutils.IsZero(m.Data) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Data); i++ {
|
||||
if swag.IsZero(m.Data[i]) { // not required
|
||||
if typeutils.IsZero(m.Data[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Data[i] != nil {
|
||||
if err := m.Data[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -75,17 +78,21 @@ func (m *ContactResponse) validateData(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *ContactResponse) validateMeta(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Meta) { // not required
|
||||
if typeutils.IsZero(m.Meta) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.Meta != nil {
|
||||
if err := m.Meta.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Meta")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Meta")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -116,12 +123,21 @@ func (m *ContactResponse) contextValidateData(ctx context.Context, formats strfm
|
|||
for i := 0; i < len(m.Data); i++ {
|
||||
|
||||
if m.Data[i] != nil {
|
||||
|
||||
if typeutils.IsZero(m.Data[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -134,12 +150,21 @@ func (m *ContactResponse) contextValidateData(ctx context.Context, formats strfm
|
|||
func (m *ContactResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Meta != nil {
|
||||
|
||||
if typeutils.IsZero(m.Meta) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Meta.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Meta")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Meta")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -152,13 +177,13 @@ func (m *ContactResponse) MarshalBinary() ([]byte, error) {
|
|||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
return jsonutils.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *ContactResponse) UnmarshalBinary(b []byte) error {
|
||||
var res ContactResponse
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
|
|
|
|||
|
|
@ -6,15 +6,14 @@
|
|||
|
||||
package crm_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"
|
||||
stderrors "errors"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/swag/jsonutils"
|
||||
"github.com/go-openapi/swag/typeutils"
|
||||
)
|
||||
|
||||
// Contract contract
|
||||
|
|
@ -135,17 +134,21 @@ func (m *Contract) Validate(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *Contract) validateBillingAddress(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.BillingAddress) { // not required
|
||||
if typeutils.IsZero(m.BillingAddress) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.BillingAddress != nil {
|
||||
if err := m.BillingAddress.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("BillingAddress")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("BillingAddress")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -154,17 +157,21 @@ func (m *Contract) validateBillingAddress(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *Contract) validateShippingAddress(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.ShippingAddress) { // not required
|
||||
if typeutils.IsZero(m.ShippingAddress) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.ShippingAddress != nil {
|
||||
if err := m.ShippingAddress.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("ShippingAddress")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("ShippingAddress")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -193,12 +200,21 @@ func (m *Contract) ContextValidate(ctx context.Context, formats strfmt.Registry)
|
|||
func (m *Contract) contextValidateBillingAddress(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.BillingAddress != nil {
|
||||
|
||||
if typeutils.IsZero(m.BillingAddress) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.BillingAddress.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("BillingAddress")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("BillingAddress")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -209,12 +225,21 @@ func (m *Contract) contextValidateBillingAddress(ctx context.Context, formats st
|
|||
func (m *Contract) contextValidateShippingAddress(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.ShippingAddress != nil {
|
||||
|
||||
if typeutils.IsZero(m.ShippingAddress) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.ShippingAddress.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("ShippingAddress")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("ShippingAddress")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -227,13 +252,13 @@ func (m *Contract) MarshalBinary() ([]byte, error) {
|
|||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
return jsonutils.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *Contract) UnmarshalBinary(b []byte) error {
|
||||
var res Contract
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
|
|
|
|||
|
|
@ -6,16 +6,15 @@
|
|||
|
||||
package crm_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"
|
||||
stderrors "errors"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/swag/jsonutils"
|
||||
"github.com/go-openapi/swag/typeutils"
|
||||
)
|
||||
|
||||
// ContractRequest contract request
|
||||
|
|
@ -42,22 +41,26 @@ func (m *ContractRequest) Validate(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *ContractRequest) validateData(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Data) { // not required
|
||||
if typeutils.IsZero(m.Data) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Data); i++ {
|
||||
if swag.IsZero(m.Data[i]) { // not required
|
||||
if typeutils.IsZero(m.Data[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Data[i] != nil {
|
||||
if err := m.Data[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -86,12 +89,21 @@ func (m *ContractRequest) contextValidateData(ctx context.Context, formats strfm
|
|||
for i := 0; i < len(m.Data); i++ {
|
||||
|
||||
if m.Data[i] != nil {
|
||||
|
||||
if typeutils.IsZero(m.Data[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -106,13 +118,13 @@ func (m *ContractRequest) MarshalBinary() ([]byte, error) {
|
|||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
return jsonutils.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *ContractRequest) UnmarshalBinary(b []byte) error {
|
||||
var res ContractRequest
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
|
|
|
|||
|
|
@ -6,16 +6,15 @@
|
|||
|
||||
package crm_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"
|
||||
stderrors "errors"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/swag/jsonutils"
|
||||
"github.com/go-openapi/swag/typeutils"
|
||||
)
|
||||
|
||||
// ContractResponse contract response
|
||||
|
|
@ -49,22 +48,26 @@ func (m *ContractResponse) Validate(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *ContractResponse) validateData(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Data) { // not required
|
||||
if typeutils.IsZero(m.Data) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Data); i++ {
|
||||
if swag.IsZero(m.Data[i]) { // not required
|
||||
if typeutils.IsZero(m.Data[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Data[i] != nil {
|
||||
if err := m.Data[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -75,17 +78,21 @@ func (m *ContractResponse) validateData(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *ContractResponse) validateMeta(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Meta) { // not required
|
||||
if typeutils.IsZero(m.Meta) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.Meta != nil {
|
||||
if err := m.Meta.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Meta")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Meta")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -116,12 +123,21 @@ func (m *ContractResponse) contextValidateData(ctx context.Context, formats strf
|
|||
for i := 0; i < len(m.Data); i++ {
|
||||
|
||||
if m.Data[i] != nil {
|
||||
|
||||
if typeutils.IsZero(m.Data[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -134,12 +150,21 @@ func (m *ContractResponse) contextValidateData(ctx context.Context, formats strf
|
|||
func (m *ContractResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Meta != nil {
|
||||
|
||||
if typeutils.IsZero(m.Meta) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Meta.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Meta")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Meta")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -152,13 +177,13 @@ func (m *ContractResponse) MarshalBinary() ([]byte, error) {
|
|||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
return jsonutils.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *ContractResponse) UnmarshalBinary(b []byte) error {
|
||||
var res ContractResponse
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
|
|
|
|||
|
|
@ -6,16 +6,15 @@
|
|||
|
||||
package crm_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"
|
||||
stderrors "errors"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/swag/jsonutils"
|
||||
"github.com/go-openapi/swag/typeutils"
|
||||
)
|
||||
|
||||
// DeleteResponse delete response
|
||||
|
|
@ -49,22 +48,26 @@ func (m *DeleteResponse) Validate(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *DeleteResponse) validateData(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Data) { // not required
|
||||
if typeutils.IsZero(m.Data) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Data); i++ {
|
||||
if swag.IsZero(m.Data[i]) { // not required
|
||||
if typeutils.IsZero(m.Data[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Data[i] != nil {
|
||||
if err := m.Data[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -75,17 +78,21 @@ func (m *DeleteResponse) validateData(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *DeleteResponse) validateMeta(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Meta) { // not required
|
||||
if typeutils.IsZero(m.Meta) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.Meta != nil {
|
||||
if err := m.Meta.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Meta")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Meta")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -116,12 +123,21 @@ func (m *DeleteResponse) contextValidateData(ctx context.Context, formats strfmt
|
|||
for i := 0; i < len(m.Data); i++ {
|
||||
|
||||
if m.Data[i] != nil {
|
||||
|
||||
if typeutils.IsZero(m.Data[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -134,12 +150,21 @@ func (m *DeleteResponse) contextValidateData(ctx context.Context, formats strfmt
|
|||
func (m *DeleteResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Meta != nil {
|
||||
|
||||
if typeutils.IsZero(m.Meta) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Meta.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Meta")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Meta")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -152,13 +177,13 @@ func (m *DeleteResponse) MarshalBinary() ([]byte, error) {
|
|||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
return jsonutils.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *DeleteResponse) UnmarshalBinary(b []byte) error {
|
||||
var res DeleteResponse
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
|
|
|
|||
|
|
@ -6,14 +6,11 @@
|
|||
|
||||
package crm_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"
|
||||
"github.com/go-openapi/swag/jsonutils"
|
||||
)
|
||||
|
||||
// Error error
|
||||
|
|
@ -46,13 +43,13 @@ func (m *Error) MarshalBinary() ([]byte, error) {
|
|||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
return jsonutils.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *Error) UnmarshalBinary(b []byte) error {
|
||||
var res Error
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
|
|
|
|||
|
|
@ -6,15 +6,12 @@
|
|||
|
||||
package crm_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/swag/jsonutils"
|
||||
)
|
||||
|
||||
// InvalidError invalid error
|
||||
|
|
@ -31,7 +28,7 @@ type InvalidError struct {
|
|||
func (m *InvalidError) UnmarshalJSON(raw []byte) error {
|
||||
// AO0
|
||||
var aO0 Error
|
||||
if err := swag.ReadJSON(raw, &aO0); err != nil {
|
||||
if err := jsonutils.ReadJSON(raw, &aO0); err != nil {
|
||||
return err
|
||||
}
|
||||
m.Error = aO0
|
||||
|
|
@ -40,7 +37,7 @@ func (m *InvalidError) UnmarshalJSON(raw []byte) error {
|
|||
var dataAO1 struct {
|
||||
Details []string `json:"details"`
|
||||
}
|
||||
if err := swag.ReadJSON(raw, &dataAO1); err != nil {
|
||||
if err := jsonutils.ReadJSON(raw, &dataAO1); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -53,7 +50,7 @@ func (m *InvalidError) UnmarshalJSON(raw []byte) error {
|
|||
func (m InvalidError) MarshalJSON() ([]byte, error) {
|
||||
_parts := make([][]byte, 0, 2)
|
||||
|
||||
aO0, err := swag.WriteJSON(m.Error)
|
||||
aO0, err := jsonutils.WriteJSON(m.Error)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -64,12 +61,12 @@ func (m InvalidError) MarshalJSON() ([]byte, error) {
|
|||
|
||||
dataAO1.Details = m.Details
|
||||
|
||||
jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1)
|
||||
jsonDataAO1, errAO1 := jsonutils.WriteJSON(dataAO1)
|
||||
if errAO1 != nil {
|
||||
return nil, errAO1
|
||||
}
|
||||
_parts = append(_parts, jsonDataAO1)
|
||||
return swag.ConcatJSON(_parts...), nil
|
||||
return jsonutils.ConcatJSON(_parts...), nil
|
||||
}
|
||||
|
||||
// Validate validates this invalid error
|
||||
|
|
@ -107,13 +104,13 @@ func (m *InvalidError) MarshalBinary() ([]byte, error) {
|
|||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
return jsonutils.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *InvalidError) UnmarshalBinary(b []byte) error {
|
||||
var res InvalidError
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
|
|
|
|||
|
|
@ -6,15 +6,14 @@
|
|||
|
||||
package crm_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"
|
||||
stderrors "errors"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/swag/jsonutils"
|
||||
"github.com/go-openapi/swag/typeutils"
|
||||
)
|
||||
|
||||
// Lead lead
|
||||
|
|
@ -122,17 +121,21 @@ func (m *Lead) Validate(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *Lead) validateAddress(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Address) { // not required
|
||||
if typeutils.IsZero(m.Address) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.Address != nil {
|
||||
if err := m.Address.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Address")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Address")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -157,12 +160,21 @@ func (m *Lead) ContextValidate(ctx context.Context, formats strfmt.Registry) err
|
|||
func (m *Lead) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Address != nil {
|
||||
|
||||
if typeutils.IsZero(m.Address) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Address.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Address")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Address")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -175,13 +187,13 @@ func (m *Lead) MarshalBinary() ([]byte, error) {
|
|||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
return jsonutils.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *Lead) UnmarshalBinary(b []byte) error {
|
||||
var res Lead
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
|
|
|
|||
|
|
@ -6,16 +6,15 @@
|
|||
|
||||
package crm_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"
|
||||
stderrors "errors"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/swag/jsonutils"
|
||||
"github.com/go-openapi/swag/typeutils"
|
||||
)
|
||||
|
||||
// LeadRequest lead request
|
||||
|
|
@ -42,22 +41,26 @@ func (m *LeadRequest) Validate(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *LeadRequest) validateData(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Data) { // not required
|
||||
if typeutils.IsZero(m.Data) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Data); i++ {
|
||||
if swag.IsZero(m.Data[i]) { // not required
|
||||
if typeutils.IsZero(m.Data[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Data[i] != nil {
|
||||
if err := m.Data[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -86,12 +89,21 @@ func (m *LeadRequest) contextValidateData(ctx context.Context, formats strfmt.Re
|
|||
for i := 0; i < len(m.Data); i++ {
|
||||
|
||||
if m.Data[i] != nil {
|
||||
|
||||
if typeutils.IsZero(m.Data[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -106,13 +118,13 @@ func (m *LeadRequest) MarshalBinary() ([]byte, error) {
|
|||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
return jsonutils.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *LeadRequest) UnmarshalBinary(b []byte) error {
|
||||
var res LeadRequest
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
|
|
|
|||
|
|
@ -6,16 +6,15 @@
|
|||
|
||||
package crm_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"
|
||||
stderrors "errors"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/swag/jsonutils"
|
||||
"github.com/go-openapi/swag/typeutils"
|
||||
)
|
||||
|
||||
// LeadResponse lead response
|
||||
|
|
@ -49,22 +48,26 @@ func (m *LeadResponse) Validate(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *LeadResponse) validateData(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Data) { // not required
|
||||
if typeutils.IsZero(m.Data) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Data); i++ {
|
||||
if swag.IsZero(m.Data[i]) { // not required
|
||||
if typeutils.IsZero(m.Data[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Data[i] != nil {
|
||||
if err := m.Data[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -75,17 +78,21 @@ func (m *LeadResponse) validateData(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *LeadResponse) validateMeta(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Meta) { // not required
|
||||
if typeutils.IsZero(m.Meta) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.Meta != nil {
|
||||
if err := m.Meta.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Meta")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Meta")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -116,12 +123,21 @@ func (m *LeadResponse) contextValidateData(ctx context.Context, formats strfmt.R
|
|||
for i := 0; i < len(m.Data); i++ {
|
||||
|
||||
if m.Data[i] != nil {
|
||||
|
||||
if typeutils.IsZero(m.Data[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Data[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Data" + "." + strconv.Itoa(i))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -134,12 +150,21 @@ func (m *LeadResponse) contextValidateData(ctx context.Context, formats strfmt.R
|
|||
func (m *LeadResponse) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Meta != nil {
|
||||
|
||||
if typeutils.IsZero(m.Meta) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Meta.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Meta")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Meta")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -152,13 +177,13 @@ func (m *LeadResponse) MarshalBinary() ([]byte, error) {
|
|||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
return jsonutils.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *LeadResponse) UnmarshalBinary(b []byte) error {
|
||||
var res LeadResponse
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
|
|
|
|||
|
|
@ -6,14 +6,11 @@
|
|||
|
||||
package crm_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"
|
||||
"github.com/go-openapi/swag/jsonutils"
|
||||
)
|
||||
|
||||
// Message message
|
||||
|
|
@ -46,13 +43,13 @@ func (m *Message) MarshalBinary() ([]byte, error) {
|
|||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
return jsonutils.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *Message) UnmarshalBinary(b []byte) error {
|
||||
var res Message
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
|
|
|
|||
|
|
@ -6,14 +6,11 @@
|
|||
|
||||
package crm_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"
|
||||
"github.com/go-openapi/swag/jsonutils"
|
||||
)
|
||||
|
||||
// Pagination pagination
|
||||
|
|
@ -49,13 +46,13 @@ func (m *Pagination) MarshalBinary() ([]byte, error) {
|
|||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
return jsonutils.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *Pagination) UnmarshalBinary(b []byte) error {
|
||||
var res Pagination
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
|
|
|
|||
|
|
@ -6,15 +6,12 @@
|
|||
|
||||
package crm_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/swag/jsonutils"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
|
|
@ -61,13 +58,13 @@ func (m *RequestMeta) MarshalBinary() ([]byte, error) {
|
|||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
return jsonutils.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *RequestMeta) UnmarshalBinary(b []byte) error {
|
||||
var res RequestMeta
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
|
|
|
|||
|
|
@ -6,15 +6,14 @@
|
|||
|
||||
package crm_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"
|
||||
stderrors "errors"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/swag/jsonutils"
|
||||
"github.com/go-openapi/swag/typeutils"
|
||||
)
|
||||
|
||||
// ResponseMeta response meta
|
||||
|
|
@ -74,17 +73,21 @@ func (m *ResponseMeta) Validate(formats strfmt.Registry) error {
|
|||
}
|
||||
|
||||
func (m *ResponseMeta) validatePagination(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Pagination) { // not required
|
||||
if typeutils.IsZero(m.Pagination) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.Pagination != nil {
|
||||
if err := m.Pagination.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Pagination")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Pagination")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -109,12 +112,21 @@ func (m *ResponseMeta) ContextValidate(ctx context.Context, formats strfmt.Regis
|
|||
func (m *ResponseMeta) contextValidatePagination(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Pagination != nil {
|
||||
|
||||
if typeutils.IsZero(m.Pagination) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Pagination.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
ve := new(errors.Validation)
|
||||
if stderrors.As(err, &ve) {
|
||||
return ve.ValidateName("Pagination")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
}
|
||||
ce := new(errors.CompositeError)
|
||||
if stderrors.As(err, &ce) {
|
||||
return ce.ValidateName("Pagination")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -127,13 +139,13 @@ func (m *ResponseMeta) MarshalBinary() ([]byte, error) {
|
|||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
return jsonutils.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *ResponseMeta) UnmarshalBinary(b []byte) error {
|
||||
var res ResponseMeta
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
if err := jsonutils.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
|
|
|
|||
|
|
@ -6,53 +6,111 @@
|
|||
|
||||
package attendees
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
httptransport "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// New creates a new attendees API client.
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||
func New(transport runtime.ContextualTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
/*
|
||||
Client for attendees API
|
||||
*/
|
||||
// New creates a new attendees API client with basic auth credentials.
|
||||
//
|
||||
// It takes the following parameters:
|
||||
// - host: http host (github.com).
|
||||
// - basePath: any base path for the API client ("/v1", "/v3").
|
||||
// - scheme: http scheme ("http", "https").
|
||||
// - user: user for basic authentication header.
|
||||
// - password: password for basic authentication header.
|
||||
func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService {
|
||||
transport := httptransport.New(host, basePath, []string{scheme})
|
||||
transport.DefaultAuthentication = httptransport.BasicAuth(user, password)
|
||||
return &Client{transport: transport, formats: strfmt.Default}
|
||||
}
|
||||
|
||||
// New creates a new attendees API client with a bearer token for authentication.
|
||||
//
|
||||
// It takes the following parameters:
|
||||
// - host: http host (github.com).
|
||||
// - basePath: any base path for the API client ("/v1", "/v3").
|
||||
// - scheme: http scheme ("http", "https").
|
||||
// - bearerToken: bearer token for Bearer authentication header.
|
||||
func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService {
|
||||
transport := httptransport.New(host, basePath, []string{scheme})
|
||||
transport.DefaultAuthentication = httptransport.BearerToken(bearerToken)
|
||||
return &Client{transport: transport, formats: strfmt.Default}
|
||||
}
|
||||
|
||||
// Client for attendees API.
|
||||
type Client struct {
|
||||
transport runtime.ClientTransport
|
||||
transport runtime.ContextualTransport
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ClientOption is the option for Client methods
|
||||
// ClientOption may be used to customize the behavior of Client methods.
|
||||
type ClientOption func(*runtime.ClientOperation)
|
||||
|
||||
// ClientService is the interface for Client methods
|
||||
// ClientService is the interface for Client methods.
|
||||
type ClientService interface {
|
||||
|
||||
// GetAttendees get a list attendees.
|
||||
GetAttendees(params *GetAttendeesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAttendeesOK, error)
|
||||
|
||||
// GetAttendeesContext get a list attendees.
|
||||
GetAttendeesContext(ctx context.Context, params *GetAttendeesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAttendeesOK, error)
|
||||
|
||||
// PostAttendees create new attendees.
|
||||
PostAttendees(params *PostAttendeesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAttendeesOK, error)
|
||||
|
||||
// PostAttendeesContext create new attendees.
|
||||
PostAttendeesContext(ctx context.Context, params *PostAttendeesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAttendeesOK, error)
|
||||
|
||||
// PutAttendees update attendee.
|
||||
PutAttendees(params *PutAttendeesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutAttendeesOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
// PutAttendeesContext update attendee.
|
||||
PutAttendeesContext(ctx context.Context, params *PutAttendeesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutAttendeesOK, error)
|
||||
|
||||
SetTransport(transport runtime.ContextualTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
GetAttendees gets a list attendees
|
||||
|
||||
Return a list of Attendee records from the datastore
|
||||
*/
|
||||
// GetAttendees gets a list attendees.
|
||||
//
|
||||
// List or get attendees associated with events managed by the configured Keenan Vision tenant. Requires members:attendee:read and compound machine plus native-user authentication. Owners and Managers can read tenant-bounded attendees; Contributors can read only their own attendance..
|
||||
//
|
||||
// This method does not support injected context.
|
||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||
//
|
||||
// If you need to pass a specific context, use [Client.GetAttendeesContext] instead.
|
||||
func (a *Client) GetAttendees(params *GetAttendeesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAttendeesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
var ctx context.Context
|
||||
if params.inner.ctx != nil {
|
||||
ctx = params.inner.ctx
|
||||
} else {
|
||||
ctx = context.Background()
|
||||
}
|
||||
|
||||
return a.GetAttendeesContext(ctx, params, authInfo, opts...)
|
||||
}
|
||||
|
||||
// GetAttendeesContext gets a list attendees.
|
||||
//
|
||||
// List or get attendees associated with events managed by the configured Keenan Vision tenant. Requires members:attendee:read and compound machine plus native-user authentication. Owners and Managers can read tenant-bounded attendees; Contributors can read only their own attendance..
|
||||
//
|
||||
// Do not use the deprecated [GetAttendeesParams.Context] with this method: it would be ignored.
|
||||
func (a *Client) GetAttendeesContext(ctx context.Context, params *GetAttendeesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAttendeesOK, error) {
|
||||
// NOTE: parameters are not validated before sending
|
||||
if params == nil {
|
||||
params = NewGetAttendeesParams()
|
||||
}
|
||||
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getAttendees",
|
||||
Method: "GET",
|
||||
|
|
@ -63,37 +121,63 @@ func (a *Client) GetAttendees(params *GetAttendeesParams, authInfo runtime.Clien
|
|||
Params: params,
|
||||
Reader: &GetAttendeesReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
result, err := a.transport.SubmitContext(ctx, op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// only one success response has to be checked
|
||||
success, ok := result.(*GetAttendeesOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
|
||||
// unexpected success response.
|
||||
|
||||
// no default response is defined.
|
||||
//
|
||||
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for getAttendees: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostAttendees creates new attendees
|
||||
|
||||
Create Attendees
|
||||
*/
|
||||
// PostAttendees creates new attendees.
|
||||
//
|
||||
// Create one attendee for an event managed by the configured Keenan Vision tenant. Requires members:attendee:create and Keenan Vision Owner or Manager access. ID and timestamps are server-owned; event, user, and optional ticket relationships are validated..
|
||||
//
|
||||
// This method does not support injected context.
|
||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||
//
|
||||
// If you need to pass a specific context, use [Client.PostAttendeesContext] instead.
|
||||
func (a *Client) PostAttendees(params *PostAttendeesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAttendeesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
var ctx context.Context
|
||||
if params.inner.ctx != nil {
|
||||
ctx = params.inner.ctx
|
||||
} else {
|
||||
ctx = context.Background()
|
||||
}
|
||||
|
||||
return a.PostAttendeesContext(ctx, params, authInfo, opts...)
|
||||
}
|
||||
|
||||
// PostAttendeesContext creates new attendees.
|
||||
//
|
||||
// Create one attendee for an event managed by the configured Keenan Vision tenant. Requires members:attendee:create and Keenan Vision Owner or Manager access. ID and timestamps are server-owned; event, user, and optional ticket relationships are validated..
|
||||
//
|
||||
// Do not use the deprecated [PostAttendeesParams.Context] with this method: it would be ignored.
|
||||
func (a *Client) PostAttendeesContext(ctx context.Context, params *PostAttendeesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAttendeesOK, error) {
|
||||
// NOTE: parameters are not validated before sending
|
||||
if params == nil {
|
||||
params = NewPostAttendeesParams()
|
||||
}
|
||||
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "postAttendees",
|
||||
Method: "POST",
|
||||
|
|
@ -104,37 +188,63 @@ func (a *Client) PostAttendees(params *PostAttendeesParams, authInfo runtime.Cli
|
|||
Params: params,
|
||||
Reader: &PostAttendeesReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
result, err := a.transport.SubmitContext(ctx, op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// only one success response has to be checked
|
||||
success, ok := result.(*PostAttendeesOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
|
||||
// unexpected success response.
|
||||
|
||||
// no default response is defined.
|
||||
//
|
||||
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for postAttendees: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PutAttendees updates attendee
|
||||
|
||||
Update Attendee
|
||||
*/
|
||||
// PutAttendees updates attendee.
|
||||
//
|
||||
// CAS-update one attendee check-in status. Requires members:attendee:update and Keenan Vision Owner or Manager access. EventID, TicketID, and UserID are immutable; delete is unavailable..
|
||||
//
|
||||
// This method does not support injected context.
|
||||
// However, timeout and opentracing contexts are honored whenever enabled.
|
||||
//
|
||||
// If you need to pass a specific context, use [Client.PutAttendeesContext] instead.
|
||||
func (a *Client) PutAttendees(params *PutAttendeesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutAttendeesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
var ctx context.Context
|
||||
if params.inner.ctx != nil {
|
||||
ctx = params.inner.ctx
|
||||
} else {
|
||||
ctx = context.Background()
|
||||
}
|
||||
|
||||
return a.PutAttendeesContext(ctx, params, authInfo, opts...)
|
||||
}
|
||||
|
||||
// PutAttendeesContext updates attendee.
|
||||
//
|
||||
// CAS-update one attendee check-in status. Requires members:attendee:update and Keenan Vision Owner or Manager access. EventID, TicketID, and UserID are immutable; delete is unavailable..
|
||||
//
|
||||
// Do not use the deprecated [PutAttendeesParams.Context] with this method: it would be ignored.
|
||||
func (a *Client) PutAttendeesContext(ctx context.Context, params *PutAttendeesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutAttendeesOK, error) {
|
||||
// NOTE: parameters are not validated before sending
|
||||
if params == nil {
|
||||
params = NewPutAttendeesParams()
|
||||
}
|
||||
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "putAttendees",
|
||||
Method: "PUT",
|
||||
|
|
@ -145,28 +255,42 @@ func (a *Client) PutAttendees(params *PutAttendeesParams, authInfo runtime.Clien
|
|||
Params: params,
|
||||
Reader: &PutAttendeesReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
result, err := a.transport.SubmitContext(ctx, op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// only one success response has to be checked
|
||||
success, ok := result.(*PutAttendeesOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
|
||||
// unexpected success response.
|
||||
|
||||
// no default response is defined.
|
||||
//
|
||||
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for putAttendees: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
// SetTransport changes the transport on the client
|
||||
func (a *Client) SetTransport(transport runtime.ClientTransport) {
|
||||
func (a *Client) SetTransport(transport runtime.ContextualTransport) {
|
||||
a.transport = transport
|
||||
}
|
||||
|
||||
// innerParams captures internal fields so they don't conflict with user-supplied parameters.
|
||||
type innerParams struct {
|
||||
timeout time.Duration
|
||||
|
||||
// Deprecated: use the operation call with context to pass the context instead of [AttendeesParams].
|
||||
ctx context.Context
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,9 +6,6 @@
|
|||
|
||||
package attendees
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
|
@ -18,7 +15,7 @@ import (
|
|||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/swag/conv"
|
||||
)
|
||||
|
||||
// NewGetAttendeesParams creates a new GetAttendeesParams object,
|
||||
|
|
@ -28,24 +25,28 @@ import (
|
|||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewGetAttendeesParams() *GetAttendeesParams {
|
||||
return &GetAttendeesParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
return NewGetAttendeesParamsWithTimeout(cr.DefaultTimeout)
|
||||
}
|
||||
|
||||
// NewGetAttendeesParamsWithTimeout creates a new GetAttendeesParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetAttendeesParamsWithTimeout(timeout time.Duration) *GetAttendeesParams {
|
||||
return &GetAttendeesParams{
|
||||
timeout: timeout,
|
||||
inner: innerParams{
|
||||
timeout: timeout,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAttendeesParamsWithContext creates a new GetAttendeesParams object
|
||||
// with the ability to set a context for a request.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [GetAttendeesParams].
|
||||
func NewGetAttendeesParamsWithContext(ctx context.Context) *GetAttendeesParams {
|
||||
return &GetAttendeesParams{
|
||||
Context: ctx,
|
||||
inner: innerParams{
|
||||
ctx: ctx,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -66,31 +67,28 @@ GetAttendeesParams contains all the parameters to send to the API endpoint
|
|||
*/
|
||||
type GetAttendeesParams struct {
|
||||
|
||||
/* ID.
|
||||
|
||||
Unique Record ID
|
||||
*/
|
||||
// ID.
|
||||
//
|
||||
// Unique Record ID
|
||||
ID *string
|
||||
|
||||
/* Limit.
|
||||
|
||||
How many objects to return at one time
|
||||
|
||||
Format: int64
|
||||
*/
|
||||
// Limit.
|
||||
//
|
||||
// How many objects to return at one time
|
||||
//
|
||||
// Format: int64
|
||||
Limit *int64
|
||||
|
||||
/* Offset.
|
||||
|
||||
How many objects to skip?
|
||||
|
||||
Format: int64
|
||||
*/
|
||||
// Offset.
|
||||
//
|
||||
// How many objects to skip?
|
||||
//
|
||||
// Format: int64
|
||||
Offset *int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
|
||||
inner innerParams
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get attendees params (not the query body).
|
||||
|
|
@ -108,76 +106,79 @@ func (o *GetAttendeesParams) SetDefaults() {
|
|||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get attendees params
|
||||
// WithTimeout adds the timeout to the get attendees params.
|
||||
func (o *GetAttendeesParams) WithTimeout(timeout time.Duration) *GetAttendeesParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get attendees params
|
||||
// SetTimeout adds the timeout to the get attendees params.
|
||||
func (o *GetAttendeesParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
o.inner.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get attendees params
|
||||
// WithContext adds the context to the get attendees params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [GetAttendeesParams].
|
||||
func (o *GetAttendeesParams) WithContext(ctx context.Context) *GetAttendeesParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get attendees params
|
||||
// SetContext adds the context to the get attendees params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [GetAttendeesParams].
|
||||
func (o *GetAttendeesParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
o.inner.ctx = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get attendees params
|
||||
// WithHTTPClient adds the HTTPClient to the get attendees params.
|
||||
func (o *GetAttendeesParams) WithHTTPClient(client *http.Client) *GetAttendeesParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get attendees params
|
||||
// SetHTTPClient adds the HTTPClient to the get attendees params.
|
||||
func (o *GetAttendeesParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the get attendees params
|
||||
// WithID adds the id to the get attendees params.
|
||||
func (o *GetAttendeesParams) WithID(id *string) *GetAttendeesParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the get attendees params
|
||||
// SetID adds the id to the get attendees params.
|
||||
func (o *GetAttendeesParams) SetID(id *string) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WithLimit adds the limit to the get attendees params
|
||||
// WithLimit adds the limit to the get attendees params.
|
||||
func (o *GetAttendeesParams) WithLimit(limit *int64) *GetAttendeesParams {
|
||||
o.SetLimit(limit)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetLimit adds the limit to the get attendees params
|
||||
// SetLimit adds the limit to the get attendees params.
|
||||
func (o *GetAttendeesParams) SetLimit(limit *int64) {
|
||||
o.Limit = limit
|
||||
}
|
||||
|
||||
// WithOffset adds the offset to the get attendees params
|
||||
// WithOffset adds the offset to the get attendees params.
|
||||
func (o *GetAttendeesParams) WithOffset(offset *int64) *GetAttendeesParams {
|
||||
o.SetOffset(offset)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetOffset adds the offset to the get attendees params
|
||||
// SetOffset adds the offset to the get attendees params.
|
||||
func (o *GetAttendeesParams) SetOffset(offset *int64) {
|
||||
o.Offset = offset
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
// WriteToRequest writes these params to a [runtime.ClientRequest].
|
||||
func (o *GetAttendeesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
if err := r.SetTimeout(o.inner.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
|
@ -207,7 +208,7 @@ func (o *GetAttendeesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.
|
|||
if o.Limit != nil {
|
||||
qrLimit = *o.Limit
|
||||
}
|
||||
qLimit := swag.FormatInt64(qrLimit)
|
||||
qLimit := conv.FormatInteger(qrLimit)
|
||||
if qLimit != "" {
|
||||
|
||||
if err := r.SetQueryParam("limit", qLimit); err != nil {
|
||||
|
|
@ -224,7 +225,7 @@ func (o *GetAttendeesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.
|
|||
if o.Offset != nil {
|
||||
qrOffset = *o.Offset
|
||||
}
|
||||
qOffset := swag.FormatInt64(qrOffset)
|
||||
qOffset := conv.FormatInteger(qrOffset)
|
||||
if qOffset != "" {
|
||||
|
||||
if err := r.SetQueryParam("offset", qOffset); err != nil {
|
||||
|
|
|
|||
|
|
@ -6,17 +6,15 @@
|
|||
|
||||
package attendees
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
stderrors "errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
||||
)
|
||||
|
||||
// GetAttendeesReader is a Reader for the GetAttendees structure.
|
||||
|
|
@ -25,7 +23,7 @@ type GetAttendeesReader struct {
|
|||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetAttendeesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
func (o *GetAttendeesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetAttendeesOK()
|
||||
|
|
@ -64,7 +62,7 @@ func (o *GetAttendeesReader) ReadResponse(response runtime.ClientResponse, consu
|
|||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
return nil, runtime.NewAPIError("[GET /attendees] getAttendees", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -73,11 +71,9 @@ func NewGetAttendeesOK() *GetAttendeesOK {
|
|||
return &GetAttendeesOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAttendeesOK describes a response with status code 200, with default header values.
|
||||
|
||||
Attendee Response Object
|
||||
*/
|
||||
// GetAttendeesOK describes a response with status code 200, with default header values.
|
||||
//
|
||||
// Attendee Response Object
|
||||
type GetAttendeesOK struct {
|
||||
Payload *members_models.AttendeeResponse
|
||||
}
|
||||
|
|
@ -113,11 +109,13 @@ func (o *GetAttendeesOK) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetAttendeesOK) Error() string {
|
||||
return fmt.Sprintf("[GET /attendees][%d] getAttendeesOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /attendees][%d] getAttendeesOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *GetAttendeesOK) String() string {
|
||||
return fmt.Sprintf("[GET /attendees][%d] getAttendeesOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /attendees][%d] getAttendeesOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *GetAttendeesOK) GetPayload() *members_models.AttendeeResponse {
|
||||
|
|
@ -129,7 +127,7 @@ func (o *GetAttendeesOK) readResponse(response runtime.ClientResponse, consumer
|
|||
o.Payload = new(members_models.AttendeeResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -141,11 +139,9 @@ func NewGetAttendeesUnauthorized() *GetAttendeesUnauthorized {
|
|||
return &GetAttendeesUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAttendeesUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
// GetAttendeesUnauthorized describes a response with status code 401, with default header values.
|
||||
//
|
||||
// Access Unauthorized, invalid API-KEY was used
|
||||
type GetAttendeesUnauthorized struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
|
@ -181,11 +177,13 @@ func (o *GetAttendeesUnauthorized) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetAttendeesUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /attendees][%d] getAttendeesUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /attendees][%d] getAttendeesUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *GetAttendeesUnauthorized) String() string {
|
||||
return fmt.Sprintf("[GET /attendees][%d] getAttendeesUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /attendees][%d] getAttendeesUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *GetAttendeesUnauthorized) GetPayload() *members_models.Error {
|
||||
|
|
@ -197,7 +195,7 @@ func (o *GetAttendeesUnauthorized) readResponse(response runtime.ClientResponse,
|
|||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -209,11 +207,9 @@ func NewGetAttendeesForbidden() *GetAttendeesForbidden {
|
|||
return &GetAttendeesForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAttendeesForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
// GetAttendeesForbidden describes a response with status code 403, with default header values.
|
||||
//
|
||||
// Access forbidden, account lacks access
|
||||
type GetAttendeesForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -251,11 +247,13 @@ func (o *GetAttendeesForbidden) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetAttendeesForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /attendees][%d] getAttendeesForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /attendees][%d] getAttendeesForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *GetAttendeesForbidden) String() string {
|
||||
return fmt.Sprintf("[GET /attendees][%d] getAttendeesForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /attendees][%d] getAttendeesForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *GetAttendeesForbidden) GetPayload() *members_models.Error {
|
||||
|
|
@ -274,7 +272,7 @@ func (o *GetAttendeesForbidden) readResponse(response runtime.ClientResponse, co
|
|||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -286,11 +284,9 @@ func NewGetAttendeesNotFound() *GetAttendeesNotFound {
|
|||
return &GetAttendeesNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAttendeesNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
// GetAttendeesNotFound describes a response with status code 404, with default header values.
|
||||
//
|
||||
// Resource was not found
|
||||
type GetAttendeesNotFound struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
|
@ -326,11 +322,13 @@ func (o *GetAttendeesNotFound) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetAttendeesNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /attendees][%d] getAttendeesNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /attendees][%d] getAttendeesNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *GetAttendeesNotFound) String() string {
|
||||
return fmt.Sprintf("[GET /attendees][%d] getAttendeesNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /attendees][%d] getAttendeesNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *GetAttendeesNotFound) GetPayload() *members_models.Error {
|
||||
|
|
@ -342,7 +340,7 @@ func (o *GetAttendeesNotFound) readResponse(response runtime.ClientResponse, con
|
|||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -354,11 +352,9 @@ func NewGetAttendeesUnprocessableEntity() *GetAttendeesUnprocessableEntity {
|
|||
return &GetAttendeesUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAttendeesUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
// GetAttendeesUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
//
|
||||
// Unprocessable Entity, likely a bad parameter
|
||||
type GetAttendeesUnprocessableEntity struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
|
@ -394,11 +390,13 @@ func (o *GetAttendeesUnprocessableEntity) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetAttendeesUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /attendees][%d] getAttendeesUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /attendees][%d] getAttendeesUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *GetAttendeesUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[GET /attendees][%d] getAttendeesUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /attendees][%d] getAttendeesUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *GetAttendeesUnprocessableEntity) GetPayload() *members_models.Error {
|
||||
|
|
@ -410,7 +408,7 @@ func (o *GetAttendeesUnprocessableEntity) readResponse(response runtime.ClientRe
|
|||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -422,11 +420,9 @@ func NewGetAttendeesInternalServerError() *GetAttendeesInternalServerError {
|
|||
return &GetAttendeesInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAttendeesInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
// GetAttendeesInternalServerError describes a response with status code 500, with default header values.
|
||||
//
|
||||
// Server Internal Error
|
||||
type GetAttendeesInternalServerError struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
|
@ -462,11 +458,13 @@ func (o *GetAttendeesInternalServerError) Code() int {
|
|||
}
|
||||
|
||||
func (o *GetAttendeesInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /attendees][%d] getAttendeesInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /attendees][%d] getAttendeesInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *GetAttendeesInternalServerError) String() string {
|
||||
return fmt.Sprintf("[GET /attendees][%d] getAttendeesInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[GET /attendees][%d] getAttendeesInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *GetAttendeesInternalServerError) GetPayload() *members_models.Error {
|
||||
|
|
@ -478,7 +476,7 @@ func (o *GetAttendeesInternalServerError) readResponse(response runtime.ClientRe
|
|||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,20 +6,16 @@
|
|||
|
||||
package attendees
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
||||
)
|
||||
|
||||
// NewPostAttendeesParams creates a new PostAttendeesParams object,
|
||||
|
|
@ -29,24 +25,28 @@ import (
|
|||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewPostAttendeesParams() *PostAttendeesParams {
|
||||
return &PostAttendeesParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
return NewPostAttendeesParamsWithTimeout(cr.DefaultTimeout)
|
||||
}
|
||||
|
||||
// NewPostAttendeesParamsWithTimeout creates a new PostAttendeesParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostAttendeesParamsWithTimeout(timeout time.Duration) *PostAttendeesParams {
|
||||
return &PostAttendeesParams{
|
||||
timeout: timeout,
|
||||
inner: innerParams{
|
||||
timeout: timeout,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAttendeesParamsWithContext creates a new PostAttendeesParams object
|
||||
// with the ability to set a context for a request.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PostAttendeesParams].
|
||||
func NewPostAttendeesParamsWithContext(ctx context.Context) *PostAttendeesParams {
|
||||
return &PostAttendeesParams{
|
||||
Context: ctx,
|
||||
inner: innerParams{
|
||||
ctx: ctx,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -67,15 +67,14 @@ PostAttendeesParams contains all the parameters to send to the API endpoint
|
|||
*/
|
||||
type PostAttendeesParams struct {
|
||||
|
||||
/* AttendeeRequest.
|
||||
|
||||
An array of new Attendee records
|
||||
*/
|
||||
// AttendeeRequest.
|
||||
//
|
||||
// An array of new Attendee records
|
||||
AttendeeRequest *members_models.AttendeeRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
|
||||
inner innerParams
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the post attendees params (not the query body).
|
||||
|
|
@ -93,54 +92,57 @@ func (o *PostAttendeesParams) SetDefaults() {
|
|||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post attendees params
|
||||
// WithTimeout adds the timeout to the post attendees params.
|
||||
func (o *PostAttendeesParams) WithTimeout(timeout time.Duration) *PostAttendeesParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post attendees params
|
||||
// SetTimeout adds the timeout to the post attendees params.
|
||||
func (o *PostAttendeesParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
o.inner.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post attendees params
|
||||
// WithContext adds the context to the post attendees params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PostAttendeesParams].
|
||||
func (o *PostAttendeesParams) WithContext(ctx context.Context) *PostAttendeesParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post attendees params
|
||||
// SetContext adds the context to the post attendees params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PostAttendeesParams].
|
||||
func (o *PostAttendeesParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
o.inner.ctx = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post attendees params
|
||||
// WithHTTPClient adds the HTTPClient to the post attendees params.
|
||||
func (o *PostAttendeesParams) WithHTTPClient(client *http.Client) *PostAttendeesParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post attendees params
|
||||
// SetHTTPClient adds the HTTPClient to the post attendees params.
|
||||
func (o *PostAttendeesParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithAttendeeRequest adds the attendeeRequest to the post attendees params
|
||||
// WithAttendeeRequest adds the attendeeRequest to the post attendees params.
|
||||
func (o *PostAttendeesParams) WithAttendeeRequest(attendeeRequest *members_models.AttendeeRequest) *PostAttendeesParams {
|
||||
o.SetAttendeeRequest(attendeeRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetAttendeeRequest adds the attendeeRequest to the post attendees params
|
||||
// SetAttendeeRequest adds the attendeeRequest to the post attendees params.
|
||||
func (o *PostAttendeesParams) SetAttendeeRequest(attendeeRequest *members_models.AttendeeRequest) {
|
||||
o.AttendeeRequest = attendeeRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
// WriteToRequest writes these params to a [runtime.ClientRequest].
|
||||
func (o *PostAttendeesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
if err := r.SetTimeout(o.inner.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
|
|
|||
|
|
@ -6,17 +6,15 @@
|
|||
|
||||
package attendees
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
stderrors "errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
||||
)
|
||||
|
||||
// PostAttendeesReader is a Reader for the PostAttendees structure.
|
||||
|
|
@ -25,7 +23,7 @@ type PostAttendeesReader struct {
|
|||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostAttendeesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
func (o *PostAttendeesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPostAttendeesOK()
|
||||
|
|
@ -64,7 +62,7 @@ func (o *PostAttendeesReader) ReadResponse(response runtime.ClientResponse, cons
|
|||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
return nil, runtime.NewAPIError("[POST /attendees] postAttendees", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -73,11 +71,9 @@ func NewPostAttendeesOK() *PostAttendeesOK {
|
|||
return &PostAttendeesOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAttendeesOK describes a response with status code 200, with default header values.
|
||||
|
||||
Attendee Response Object
|
||||
*/
|
||||
// PostAttendeesOK describes a response with status code 200, with default header values.
|
||||
//
|
||||
// Attendee Response Object
|
||||
type PostAttendeesOK struct {
|
||||
Payload *members_models.AttendeeResponse
|
||||
}
|
||||
|
|
@ -113,11 +109,13 @@ func (o *PostAttendeesOK) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostAttendeesOK) Error() string {
|
||||
return fmt.Sprintf("[POST /attendees][%d] postAttendeesOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /attendees][%d] postAttendeesOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *PostAttendeesOK) String() string {
|
||||
return fmt.Sprintf("[POST /attendees][%d] postAttendeesOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /attendees][%d] postAttendeesOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *PostAttendeesOK) GetPayload() *members_models.AttendeeResponse {
|
||||
|
|
@ -129,7 +127,7 @@ func (o *PostAttendeesOK) readResponse(response runtime.ClientResponse, consumer
|
|||
o.Payload = new(members_models.AttendeeResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -141,11 +139,9 @@ func NewPostAttendeesUnauthorized() *PostAttendeesUnauthorized {
|
|||
return &PostAttendeesUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAttendeesUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
// PostAttendeesUnauthorized describes a response with status code 401, with default header values.
|
||||
//
|
||||
// Access Unauthorized, invalid API-KEY was used
|
||||
type PostAttendeesUnauthorized struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
|
@ -181,11 +177,13 @@ func (o *PostAttendeesUnauthorized) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostAttendeesUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[POST /attendees][%d] postAttendeesUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /attendees][%d] postAttendeesUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *PostAttendeesUnauthorized) String() string {
|
||||
return fmt.Sprintf("[POST /attendees][%d] postAttendeesUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /attendees][%d] postAttendeesUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *PostAttendeesUnauthorized) GetPayload() *members_models.Error {
|
||||
|
|
@ -197,7 +195,7 @@ func (o *PostAttendeesUnauthorized) readResponse(response runtime.ClientResponse
|
|||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -209,11 +207,9 @@ func NewPostAttendeesForbidden() *PostAttendeesForbidden {
|
|||
return &PostAttendeesForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAttendeesForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
// PostAttendeesForbidden describes a response with status code 403, with default header values.
|
||||
//
|
||||
// Access forbidden, account lacks access
|
||||
type PostAttendeesForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -251,11 +247,13 @@ func (o *PostAttendeesForbidden) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostAttendeesForbidden) Error() string {
|
||||
return fmt.Sprintf("[POST /attendees][%d] postAttendeesForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /attendees][%d] postAttendeesForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *PostAttendeesForbidden) String() string {
|
||||
return fmt.Sprintf("[POST /attendees][%d] postAttendeesForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /attendees][%d] postAttendeesForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *PostAttendeesForbidden) GetPayload() *members_models.Error {
|
||||
|
|
@ -274,7 +272,7 @@ func (o *PostAttendeesForbidden) readResponse(response runtime.ClientResponse, c
|
|||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -286,11 +284,9 @@ func NewPostAttendeesNotFound() *PostAttendeesNotFound {
|
|||
return &PostAttendeesNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAttendeesNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
// PostAttendeesNotFound describes a response with status code 404, with default header values.
|
||||
//
|
||||
// Resource was not found
|
||||
type PostAttendeesNotFound struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
|
@ -326,11 +322,13 @@ func (o *PostAttendeesNotFound) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostAttendeesNotFound) Error() string {
|
||||
return fmt.Sprintf("[POST /attendees][%d] postAttendeesNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /attendees][%d] postAttendeesNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *PostAttendeesNotFound) String() string {
|
||||
return fmt.Sprintf("[POST /attendees][%d] postAttendeesNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /attendees][%d] postAttendeesNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *PostAttendeesNotFound) GetPayload() *members_models.Error {
|
||||
|
|
@ -342,7 +340,7 @@ func (o *PostAttendeesNotFound) readResponse(response runtime.ClientResponse, co
|
|||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -354,11 +352,9 @@ func NewPostAttendeesUnprocessableEntity() *PostAttendeesUnprocessableEntity {
|
|||
return &PostAttendeesUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAttendeesUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
// PostAttendeesUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
//
|
||||
// Unprocessable Entity, likely a bad parameter
|
||||
type PostAttendeesUnprocessableEntity struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
|
@ -394,11 +390,13 @@ func (o *PostAttendeesUnprocessableEntity) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostAttendeesUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[POST /attendees][%d] postAttendeesUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /attendees][%d] postAttendeesUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *PostAttendeesUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[POST /attendees][%d] postAttendeesUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /attendees][%d] postAttendeesUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *PostAttendeesUnprocessableEntity) GetPayload() *members_models.Error {
|
||||
|
|
@ -410,7 +408,7 @@ func (o *PostAttendeesUnprocessableEntity) readResponse(response runtime.ClientR
|
|||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -422,11 +420,9 @@ func NewPostAttendeesInternalServerError() *PostAttendeesInternalServerError {
|
|||
return &PostAttendeesInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAttendeesInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
// PostAttendeesInternalServerError describes a response with status code 500, with default header values.
|
||||
//
|
||||
// Server Internal Error
|
||||
type PostAttendeesInternalServerError struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
|
@ -462,11 +458,13 @@ func (o *PostAttendeesInternalServerError) Code() int {
|
|||
}
|
||||
|
||||
func (o *PostAttendeesInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[POST /attendees][%d] postAttendeesInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /attendees][%d] postAttendeesInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *PostAttendeesInternalServerError) String() string {
|
||||
return fmt.Sprintf("[POST /attendees][%d] postAttendeesInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[POST /attendees][%d] postAttendeesInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *PostAttendeesInternalServerError) GetPayload() *members_models.Error {
|
||||
|
|
@ -478,7 +476,7 @@ func (o *PostAttendeesInternalServerError) readResponse(response runtime.ClientR
|
|||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,20 +6,16 @@
|
|||
|
||||
package attendees
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
||||
)
|
||||
|
||||
// NewPutAttendeesParams creates a new PutAttendeesParams object,
|
||||
|
|
@ -29,24 +25,28 @@ import (
|
|||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewPutAttendeesParams() *PutAttendeesParams {
|
||||
return &PutAttendeesParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
return NewPutAttendeesParamsWithTimeout(cr.DefaultTimeout)
|
||||
}
|
||||
|
||||
// NewPutAttendeesParamsWithTimeout creates a new PutAttendeesParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPutAttendeesParamsWithTimeout(timeout time.Duration) *PutAttendeesParams {
|
||||
return &PutAttendeesParams{
|
||||
timeout: timeout,
|
||||
inner: innerParams{
|
||||
timeout: timeout,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutAttendeesParamsWithContext creates a new PutAttendeesParams object
|
||||
// with the ability to set a context for a request.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PutAttendeesParams].
|
||||
func NewPutAttendeesParamsWithContext(ctx context.Context) *PutAttendeesParams {
|
||||
return &PutAttendeesParams{
|
||||
Context: ctx,
|
||||
inner: innerParams{
|
||||
ctx: ctx,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -67,15 +67,14 @@ PutAttendeesParams contains all the parameters to send to the API endpoint
|
|||
*/
|
||||
type PutAttendeesParams struct {
|
||||
|
||||
/* AttendeeRequest.
|
||||
|
||||
An array of new Attendee records
|
||||
*/
|
||||
// AttendeeRequest.
|
||||
//
|
||||
// An array of new Attendee records
|
||||
AttendeeRequest *members_models.AttendeeRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
|
||||
inner innerParams
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the put attendees params (not the query body).
|
||||
|
|
@ -93,54 +92,57 @@ func (o *PutAttendeesParams) SetDefaults() {
|
|||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the put attendees params
|
||||
// WithTimeout adds the timeout to the put attendees params.
|
||||
func (o *PutAttendeesParams) WithTimeout(timeout time.Duration) *PutAttendeesParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the put attendees params
|
||||
// SetTimeout adds the timeout to the put attendees params.
|
||||
func (o *PutAttendeesParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
o.inner.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the put attendees params
|
||||
// WithContext adds the context to the put attendees params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PutAttendeesParams].
|
||||
func (o *PutAttendeesParams) WithContext(ctx context.Context) *PutAttendeesParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the put attendees params
|
||||
// SetContext adds the context to the put attendees params.
|
||||
//
|
||||
// Deprecated: use the operation call with context to pass the context instead of [PutAttendeesParams].
|
||||
func (o *PutAttendeesParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
o.inner.ctx = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the put attendees params
|
||||
// WithHTTPClient adds the HTTPClient to the put attendees params.
|
||||
func (o *PutAttendeesParams) WithHTTPClient(client *http.Client) *PutAttendeesParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the put attendees params
|
||||
// SetHTTPClient adds the HTTPClient to the put attendees params.
|
||||
func (o *PutAttendeesParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithAttendeeRequest adds the attendeeRequest to the put attendees params
|
||||
// WithAttendeeRequest adds the attendeeRequest to the put attendees params.
|
||||
func (o *PutAttendeesParams) WithAttendeeRequest(attendeeRequest *members_models.AttendeeRequest) *PutAttendeesParams {
|
||||
o.SetAttendeeRequest(attendeeRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetAttendeeRequest adds the attendeeRequest to the put attendees params
|
||||
// SetAttendeeRequest adds the attendeeRequest to the put attendees params.
|
||||
func (o *PutAttendeesParams) SetAttendeeRequest(attendeeRequest *members_models.AttendeeRequest) {
|
||||
o.AttendeeRequest = attendeeRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
// WriteToRequest writes these params to a [runtime.ClientRequest].
|
||||
func (o *PutAttendeesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
if err := r.SetTimeout(o.inner.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
|
|
|||
|
|
@ -6,17 +6,15 @@
|
|||
|
||||
package attendees
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
stderrors "errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
||||
)
|
||||
|
||||
// PutAttendeesReader is a Reader for the PutAttendees structure.
|
||||
|
|
@ -25,7 +23,7 @@ type PutAttendeesReader struct {
|
|||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PutAttendeesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
func (o *PutAttendeesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPutAttendeesOK()
|
||||
|
|
@ -51,6 +49,12 @@ func (o *PutAttendeesReader) ReadResponse(response runtime.ClientResponse, consu
|
|||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 409:
|
||||
result := NewPutAttendeesConflict()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewPutAttendeesUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
|
|
@ -64,7 +68,7 @@ func (o *PutAttendeesReader) ReadResponse(response runtime.ClientResponse, consu
|
|||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
return nil, runtime.NewAPIError("[PUT /attendees] putAttendees", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -73,11 +77,9 @@ func NewPutAttendeesOK() *PutAttendeesOK {
|
|||
return &PutAttendeesOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutAttendeesOK describes a response with status code 200, with default header values.
|
||||
|
||||
Attendee Response Object
|
||||
*/
|
||||
// PutAttendeesOK describes a response with status code 200, with default header values.
|
||||
//
|
||||
// Attendee Response Object
|
||||
type PutAttendeesOK struct {
|
||||
Payload *members_models.AttendeeResponse
|
||||
}
|
||||
|
|
@ -113,11 +115,13 @@ func (o *PutAttendeesOK) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutAttendeesOK) Error() string {
|
||||
return fmt.Sprintf("[PUT /attendees][%d] putAttendeesOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /attendees][%d] putAttendeesOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *PutAttendeesOK) String() string {
|
||||
return fmt.Sprintf("[PUT /attendees][%d] putAttendeesOK %+v", 200, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /attendees][%d] putAttendeesOK %s", 200, payload)
|
||||
}
|
||||
|
||||
func (o *PutAttendeesOK) GetPayload() *members_models.AttendeeResponse {
|
||||
|
|
@ -129,7 +133,7 @@ func (o *PutAttendeesOK) readResponse(response runtime.ClientResponse, consumer
|
|||
o.Payload = new(members_models.AttendeeResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -141,11 +145,9 @@ func NewPutAttendeesUnauthorized() *PutAttendeesUnauthorized {
|
|||
return &PutAttendeesUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutAttendeesUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
// PutAttendeesUnauthorized describes a response with status code 401, with default header values.
|
||||
//
|
||||
// Access Unauthorized, invalid API-KEY was used
|
||||
type PutAttendeesUnauthorized struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
|
@ -181,11 +183,13 @@ func (o *PutAttendeesUnauthorized) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutAttendeesUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[PUT /attendees][%d] putAttendeesUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /attendees][%d] putAttendeesUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *PutAttendeesUnauthorized) String() string {
|
||||
return fmt.Sprintf("[PUT /attendees][%d] putAttendeesUnauthorized %+v", 401, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /attendees][%d] putAttendeesUnauthorized %s", 401, payload)
|
||||
}
|
||||
|
||||
func (o *PutAttendeesUnauthorized) GetPayload() *members_models.Error {
|
||||
|
|
@ -197,7 +201,7 @@ func (o *PutAttendeesUnauthorized) readResponse(response runtime.ClientResponse,
|
|||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -209,11 +213,9 @@ func NewPutAttendeesForbidden() *PutAttendeesForbidden {
|
|||
return &PutAttendeesForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutAttendeesForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
// PutAttendeesForbidden describes a response with status code 403, with default header values.
|
||||
//
|
||||
// Access forbidden, account lacks access
|
||||
type PutAttendeesForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
|
|
@ -251,11 +253,13 @@ func (o *PutAttendeesForbidden) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutAttendeesForbidden) Error() string {
|
||||
return fmt.Sprintf("[PUT /attendees][%d] putAttendeesForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /attendees][%d] putAttendeesForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *PutAttendeesForbidden) String() string {
|
||||
return fmt.Sprintf("[PUT /attendees][%d] putAttendeesForbidden %+v", 403, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /attendees][%d] putAttendeesForbidden %s", 403, payload)
|
||||
}
|
||||
|
||||
func (o *PutAttendeesForbidden) GetPayload() *members_models.Error {
|
||||
|
|
@ -274,7 +278,7 @@ func (o *PutAttendeesForbidden) readResponse(response runtime.ClientResponse, co
|
|||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -286,11 +290,9 @@ func NewPutAttendeesNotFound() *PutAttendeesNotFound {
|
|||
return &PutAttendeesNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutAttendeesNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
// PutAttendeesNotFound describes a response with status code 404, with default header values.
|
||||
//
|
||||
// Resource was not found
|
||||
type PutAttendeesNotFound struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
|
@ -326,11 +328,13 @@ func (o *PutAttendeesNotFound) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutAttendeesNotFound) Error() string {
|
||||
return fmt.Sprintf("[PUT /attendees][%d] putAttendeesNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /attendees][%d] putAttendeesNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *PutAttendeesNotFound) String() string {
|
||||
return fmt.Sprintf("[PUT /attendees][%d] putAttendeesNotFound %+v", 404, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /attendees][%d] putAttendeesNotFound %s", 404, payload)
|
||||
}
|
||||
|
||||
func (o *PutAttendeesNotFound) GetPayload() *members_models.Error {
|
||||
|
|
@ -342,7 +346,75 @@ func (o *PutAttendeesNotFound) readResponse(response runtime.ClientResponse, con
|
|||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPutAttendeesConflict creates a PutAttendeesConflict with default headers values
|
||||
func NewPutAttendeesConflict() *PutAttendeesConflict {
|
||||
return &PutAttendeesConflict{}
|
||||
}
|
||||
|
||||
// PutAttendeesConflict describes a response with status code 409, with default header values.
|
||||
//
|
||||
// The supplied LastModifiedDate is stale; reload the record before retrying.
|
||||
type PutAttendeesConflict struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this put attendees conflict response has a 2xx status code
|
||||
func (o *PutAttendeesConflict) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this put attendees conflict response has a 3xx status code
|
||||
func (o *PutAttendeesConflict) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this put attendees conflict response has a 4xx status code
|
||||
func (o *PutAttendeesConflict) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this put attendees conflict response has a 5xx status code
|
||||
func (o *PutAttendeesConflict) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this put attendees conflict response a status code equal to that given
|
||||
func (o *PutAttendeesConflict) IsCode(code int) bool {
|
||||
return code == 409
|
||||
}
|
||||
|
||||
// Code gets the status code for the put attendees conflict response
|
||||
func (o *PutAttendeesConflict) Code() int {
|
||||
return 409
|
||||
}
|
||||
|
||||
func (o *PutAttendeesConflict) Error() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /attendees][%d] putAttendeesConflict %s", 409, payload)
|
||||
}
|
||||
|
||||
func (o *PutAttendeesConflict) String() string {
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /attendees][%d] putAttendeesConflict %s", 409, payload)
|
||||
}
|
||||
|
||||
func (o *PutAttendeesConflict) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutAttendeesConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -354,11 +426,9 @@ func NewPutAttendeesUnprocessableEntity() *PutAttendeesUnprocessableEntity {
|
|||
return &PutAttendeesUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutAttendeesUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
// PutAttendeesUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
//
|
||||
// Unprocessable Entity, likely a bad parameter
|
||||
type PutAttendeesUnprocessableEntity struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
|
@ -394,11 +464,13 @@ func (o *PutAttendeesUnprocessableEntity) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutAttendeesUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[PUT /attendees][%d] putAttendeesUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /attendees][%d] putAttendeesUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *PutAttendeesUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[PUT /attendees][%d] putAttendeesUnprocessableEntity %+v", 422, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /attendees][%d] putAttendeesUnprocessableEntity %s", 422, payload)
|
||||
}
|
||||
|
||||
func (o *PutAttendeesUnprocessableEntity) GetPayload() *members_models.Error {
|
||||
|
|
@ -410,7 +482,7 @@ func (o *PutAttendeesUnprocessableEntity) readResponse(response runtime.ClientRe
|
|||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -422,11 +494,9 @@ func NewPutAttendeesInternalServerError() *PutAttendeesInternalServerError {
|
|||
return &PutAttendeesInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutAttendeesInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
// PutAttendeesInternalServerError describes a response with status code 500, with default header values.
|
||||
//
|
||||
// Server Internal Error
|
||||
type PutAttendeesInternalServerError struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
|
@ -462,11 +532,13 @@ func (o *PutAttendeesInternalServerError) Code() int {
|
|||
}
|
||||
|
||||
func (o *PutAttendeesInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[PUT /attendees][%d] putAttendeesInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /attendees][%d] putAttendeesInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *PutAttendeesInternalServerError) String() string {
|
||||
return fmt.Sprintf("[PUT /attendees][%d] putAttendeesInternalServerError %+v", 500, o.Payload)
|
||||
payload, _ := json.Marshal(o.Payload)
|
||||
return fmt.Sprintf("[PUT /attendees][%d] putAttendeesInternalServerError %s", 500, payload)
|
||||
}
|
||||
|
||||
func (o *PutAttendeesInternalServerError) GetPayload() *members_models.Error {
|
||||
|
|
@ -478,7 +550,7 @@ func (o *PutAttendeesInternalServerError) readResponse(response runtime.ClientRe
|
|||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,172 +0,0 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// (c) 2012-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package certificates
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// New creates a new certificates API client.
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
/*
|
||||
Client for certificates API
|
||||
*/
|
||||
type Client struct {
|
||||
transport runtime.ClientTransport
|
||||
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 {
|
||||
GetCertificates(params *GetCertificatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCertificatesOK, error)
|
||||
|
||||
PostCertificates(params *PostCertificatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostCertificatesOK, error)
|
||||
|
||||
PutCertificates(params *PutCertificatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutCertificatesOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
GetCertificates gets a list certificates
|
||||
|
||||
Return a list of Certificate records from the datastore
|
||||
*/
|
||||
func (a *Client) GetCertificates(params *GetCertificatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCertificatesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetCertificatesParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "getCertificates",
|
||||
Method: "GET",
|
||||
PathPattern: "/certificates",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetCertificatesReader{formats: a.formats},
|
||||
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
|
||||
}
|
||||
success, ok := result.(*GetCertificatesOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for getCertificates: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostCertificates creates new certificates
|
||||
|
||||
Create Certificates
|
||||
*/
|
||||
func (a *Client) PostCertificates(params *PostCertificatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostCertificatesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostCertificatesParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "postCertificates",
|
||||
Method: "POST",
|
||||
PathPattern: "/certificates",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PostCertificatesReader{formats: a.formats},
|
||||
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
|
||||
}
|
||||
success, ok := result.(*PostCertificatesOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for postCertificates: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PutCertificates updates certificate
|
||||
|
||||
Update Certificate
|
||||
*/
|
||||
func (a *Client) PutCertificates(params *PutCertificatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PutCertificatesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPutCertificatesParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "putCertificates",
|
||||
Method: "PUT",
|
||||
PathPattern: "/certificates",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PutCertificatesReader{formats: a.formats},
|
||||
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
|
||||
}
|
||||
success, ok := result.(*PutCertificatesOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for putCertificates: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
// SetTransport changes the transport on the client
|
||||
func (a *Client) SetTransport(transport runtime.ClientTransport) {
|
||||
a.transport = transport
|
||||
}
|
||||
|
|
@ -1,240 +0,0 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// (c) 2012-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package certificates
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// NewGetCertificatesParams creates a new GetCertificatesParams 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 NewGetCertificatesParams() *GetCertificatesParams {
|
||||
return &GetCertificatesParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetCertificatesParamsWithTimeout creates a new GetCertificatesParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetCertificatesParamsWithTimeout(timeout time.Duration) *GetCertificatesParams {
|
||||
return &GetCertificatesParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetCertificatesParamsWithContext creates a new GetCertificatesParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetCertificatesParamsWithContext(ctx context.Context) *GetCertificatesParams {
|
||||
return &GetCertificatesParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetCertificatesParamsWithHTTPClient creates a new GetCertificatesParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetCertificatesParamsWithHTTPClient(client *http.Client) *GetCertificatesParams {
|
||||
return &GetCertificatesParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
GetCertificatesParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the get certificates operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetCertificatesParams struct {
|
||||
|
||||
/* ID.
|
||||
|
||||
Unique Record ID
|
||||
*/
|
||||
ID *string
|
||||
|
||||
/* Limit.
|
||||
|
||||
How many objects to return at one time
|
||||
|
||||
Format: int64
|
||||
*/
|
||||
Limit *int64
|
||||
|
||||
/* Offset.
|
||||
|
||||
How many objects to skip?
|
||||
|
||||
Format: int64
|
||||
*/
|
||||
Offset *int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get certificates params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetCertificatesParams) WithDefaults() *GetCertificatesParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get certificates params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetCertificatesParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get certificates params
|
||||
func (o *GetCertificatesParams) WithTimeout(timeout time.Duration) *GetCertificatesParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get certificates params
|
||||
func (o *GetCertificatesParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get certificates params
|
||||
func (o *GetCertificatesParams) WithContext(ctx context.Context) *GetCertificatesParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get certificates params
|
||||
func (o *GetCertificatesParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get certificates params
|
||||
func (o *GetCertificatesParams) WithHTTPClient(client *http.Client) *GetCertificatesParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get certificates params
|
||||
func (o *GetCertificatesParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the get certificates params
|
||||
func (o *GetCertificatesParams) WithID(id *string) *GetCertificatesParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the get certificates params
|
||||
func (o *GetCertificatesParams) SetID(id *string) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WithLimit adds the limit to the get certificates params
|
||||
func (o *GetCertificatesParams) WithLimit(limit *int64) *GetCertificatesParams {
|
||||
o.SetLimit(limit)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetLimit adds the limit to the get certificates params
|
||||
func (o *GetCertificatesParams) SetLimit(limit *int64) {
|
||||
o.Limit = limit
|
||||
}
|
||||
|
||||
// WithOffset adds the offset to the get certificates params
|
||||
func (o *GetCertificatesParams) WithOffset(offset *int64) *GetCertificatesParams {
|
||||
o.SetOffset(offset)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetOffset adds the offset to the get certificates params
|
||||
func (o *GetCertificatesParams) SetOffset(offset *int64) {
|
||||
o.Offset = offset
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetCertificatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.ID != nil {
|
||||
|
||||
// query param id
|
||||
var qrID string
|
||||
|
||||
if o.ID != nil {
|
||||
qrID = *o.ID
|
||||
}
|
||||
qID := qrID
|
||||
if qID != "" {
|
||||
|
||||
if err := r.SetQueryParam("id", qID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if o.Limit != nil {
|
||||
|
||||
// query param limit
|
||||
var qrLimit int64
|
||||
|
||||
if o.Limit != nil {
|
||||
qrLimit = *o.Limit
|
||||
}
|
||||
qLimit := swag.FormatInt64(qrLimit)
|
||||
if qLimit != "" {
|
||||
|
||||
if err := r.SetQueryParam("limit", qLimit); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if o.Offset != nil {
|
||||
|
||||
// query param offset
|
||||
var qrOffset int64
|
||||
|
||||
if o.Offset != nil {
|
||||
qrOffset = *o.Offset
|
||||
}
|
||||
qOffset := swag.FormatInt64(qrOffset)
|
||||
if qOffset != "" {
|
||||
|
||||
if err := r.SetQueryParam("offset", qOffset); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,486 +0,0 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// (c) 2012-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package certificates
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
||||
)
|
||||
|
||||
// GetCertificatesReader is a Reader for the GetCertificates structure.
|
||||
type GetCertificatesReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetCertificatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetCertificatesOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewGetCertificatesUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewGetCertificatesForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewGetCertificatesNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewGetCertificatesUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewGetCertificatesInternalServerError()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetCertificatesOK creates a GetCertificatesOK with default headers values
|
||||
func NewGetCertificatesOK() *GetCertificatesOK {
|
||||
return &GetCertificatesOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetCertificatesOK describes a response with status code 200, with default header values.
|
||||
|
||||
Certificate Response Object
|
||||
*/
|
||||
type GetCertificatesOK struct {
|
||||
Payload *members_models.CertificateResponse
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get certificates o k response has a 2xx status code
|
||||
func (o *GetCertificatesOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get certificates o k response has a 3xx status code
|
||||
func (o *GetCertificatesOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get certificates o k response has a 4xx status code
|
||||
func (o *GetCertificatesOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get certificates o k response has a 5xx status code
|
||||
func (o *GetCertificatesOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get certificates o k response a status code equal to that given
|
||||
func (o *GetCertificatesOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the get certificates o k response
|
||||
func (o *GetCertificatesOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *GetCertificatesOK) Error() string {
|
||||
return fmt.Sprintf("[GET /certificates][%d] getCertificatesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCertificatesOK) String() string {
|
||||
return fmt.Sprintf("[GET /certificates][%d] getCertificatesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCertificatesOK) GetPayload() *members_models.CertificateResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCertificatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.CertificateResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetCertificatesUnauthorized creates a GetCertificatesUnauthorized with default headers values
|
||||
func NewGetCertificatesUnauthorized() *GetCertificatesUnauthorized {
|
||||
return &GetCertificatesUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetCertificatesUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type GetCertificatesUnauthorized struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get certificates unauthorized response has a 2xx status code
|
||||
func (o *GetCertificatesUnauthorized) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get certificates unauthorized response has a 3xx status code
|
||||
func (o *GetCertificatesUnauthorized) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get certificates unauthorized response has a 4xx status code
|
||||
func (o *GetCertificatesUnauthorized) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get certificates unauthorized response has a 5xx status code
|
||||
func (o *GetCertificatesUnauthorized) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get certificates unauthorized response a status code equal to that given
|
||||
func (o *GetCertificatesUnauthorized) IsCode(code int) bool {
|
||||
return code == 401
|
||||
}
|
||||
|
||||
// Code gets the status code for the get certificates unauthorized response
|
||||
func (o *GetCertificatesUnauthorized) Code() int {
|
||||
return 401
|
||||
}
|
||||
|
||||
func (o *GetCertificatesUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[GET /certificates][%d] getCertificatesUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCertificatesUnauthorized) String() string {
|
||||
return fmt.Sprintf("[GET /certificates][%d] getCertificatesUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCertificatesUnauthorized) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCertificatesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetCertificatesForbidden creates a GetCertificatesForbidden with default headers values
|
||||
func NewGetCertificatesForbidden() *GetCertificatesForbidden {
|
||||
return &GetCertificatesForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetCertificatesForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type GetCertificatesForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get certificates forbidden response has a 2xx status code
|
||||
func (o *GetCertificatesForbidden) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get certificates forbidden response has a 3xx status code
|
||||
func (o *GetCertificatesForbidden) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get certificates forbidden response has a 4xx status code
|
||||
func (o *GetCertificatesForbidden) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get certificates forbidden response has a 5xx status code
|
||||
func (o *GetCertificatesForbidden) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get certificates forbidden response a status code equal to that given
|
||||
func (o *GetCertificatesForbidden) IsCode(code int) bool {
|
||||
return code == 403
|
||||
}
|
||||
|
||||
// Code gets the status code for the get certificates forbidden response
|
||||
func (o *GetCertificatesForbidden) Code() int {
|
||||
return 403
|
||||
}
|
||||
|
||||
func (o *GetCertificatesForbidden) Error() string {
|
||||
return fmt.Sprintf("[GET /certificates][%d] getCertificatesForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCertificatesForbidden) String() string {
|
||||
return fmt.Sprintf("[GET /certificates][%d] getCertificatesForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCertificatesForbidden) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCertificatesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// hydrates response header Access-Control-Allow-Origin
|
||||
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
if hdrAccessControlAllowOrigin != "" {
|
||||
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
|
||||
}
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetCertificatesNotFound creates a GetCertificatesNotFound with default headers values
|
||||
func NewGetCertificatesNotFound() *GetCertificatesNotFound {
|
||||
return &GetCertificatesNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetCertificatesNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type GetCertificatesNotFound struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get certificates not found response has a 2xx status code
|
||||
func (o *GetCertificatesNotFound) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get certificates not found response has a 3xx status code
|
||||
func (o *GetCertificatesNotFound) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get certificates not found response has a 4xx status code
|
||||
func (o *GetCertificatesNotFound) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get certificates not found response has a 5xx status code
|
||||
func (o *GetCertificatesNotFound) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get certificates not found response a status code equal to that given
|
||||
func (o *GetCertificatesNotFound) IsCode(code int) bool {
|
||||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the get certificates not found response
|
||||
func (o *GetCertificatesNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *GetCertificatesNotFound) Error() string {
|
||||
return fmt.Sprintf("[GET /certificates][%d] getCertificatesNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCertificatesNotFound) String() string {
|
||||
return fmt.Sprintf("[GET /certificates][%d] getCertificatesNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCertificatesNotFound) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCertificatesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetCertificatesUnprocessableEntity creates a GetCertificatesUnprocessableEntity with default headers values
|
||||
func NewGetCertificatesUnprocessableEntity() *GetCertificatesUnprocessableEntity {
|
||||
return &GetCertificatesUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetCertificatesUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type GetCertificatesUnprocessableEntity struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get certificates unprocessable entity response has a 2xx status code
|
||||
func (o *GetCertificatesUnprocessableEntity) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get certificates unprocessable entity response has a 3xx status code
|
||||
func (o *GetCertificatesUnprocessableEntity) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get certificates unprocessable entity response has a 4xx status code
|
||||
func (o *GetCertificatesUnprocessableEntity) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get certificates unprocessable entity response has a 5xx status code
|
||||
func (o *GetCertificatesUnprocessableEntity) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get certificates unprocessable entity response a status code equal to that given
|
||||
func (o *GetCertificatesUnprocessableEntity) IsCode(code int) bool {
|
||||
return code == 422
|
||||
}
|
||||
|
||||
// Code gets the status code for the get certificates unprocessable entity response
|
||||
func (o *GetCertificatesUnprocessableEntity) Code() int {
|
||||
return 422
|
||||
}
|
||||
|
||||
func (o *GetCertificatesUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[GET /certificates][%d] getCertificatesUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCertificatesUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[GET /certificates][%d] getCertificatesUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCertificatesUnprocessableEntity) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCertificatesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewGetCertificatesInternalServerError creates a GetCertificatesInternalServerError with default headers values
|
||||
func NewGetCertificatesInternalServerError() *GetCertificatesInternalServerError {
|
||||
return &GetCertificatesInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetCertificatesInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type GetCertificatesInternalServerError struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get certificates internal server error response has a 2xx status code
|
||||
func (o *GetCertificatesInternalServerError) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get certificates internal server error response has a 3xx status code
|
||||
func (o *GetCertificatesInternalServerError) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get certificates internal server error response has a 4xx status code
|
||||
func (o *GetCertificatesInternalServerError) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get certificates internal server error response has a 5xx status code
|
||||
func (o *GetCertificatesInternalServerError) IsServerError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsCode returns true when this get certificates internal server error response a status code equal to that given
|
||||
func (o *GetCertificatesInternalServerError) IsCode(code int) bool {
|
||||
return code == 500
|
||||
}
|
||||
|
||||
// Code gets the status code for the get certificates internal server error response
|
||||
func (o *GetCertificatesInternalServerError) Code() int {
|
||||
return 500
|
||||
}
|
||||
|
||||
func (o *GetCertificatesInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[GET /certificates][%d] getCertificatesInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCertificatesInternalServerError) String() string {
|
||||
return fmt.Sprintf("[GET /certificates][%d] getCertificatesInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetCertificatesInternalServerError) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetCertificatesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,157 +0,0 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// (c) 2012-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package certificates
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
||||
)
|
||||
|
||||
// NewPostCertificatesParams creates a new PostCertificatesParams 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 NewPostCertificatesParams() *PostCertificatesParams {
|
||||
return &PostCertificatesParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostCertificatesParamsWithTimeout creates a new PostCertificatesParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostCertificatesParamsWithTimeout(timeout time.Duration) *PostCertificatesParams {
|
||||
return &PostCertificatesParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostCertificatesParamsWithContext creates a new PostCertificatesParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPostCertificatesParamsWithContext(ctx context.Context) *PostCertificatesParams {
|
||||
return &PostCertificatesParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostCertificatesParamsWithHTTPClient creates a new PostCertificatesParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPostCertificatesParamsWithHTTPClient(client *http.Client) *PostCertificatesParams {
|
||||
return &PostCertificatesParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PostCertificatesParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the post certificates operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PostCertificatesParams struct {
|
||||
|
||||
/* CertificateRequest.
|
||||
|
||||
An array of new Certificate records
|
||||
*/
|
||||
CertificateRequest *members_models.CertificateRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the post certificates params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostCertificatesParams) WithDefaults() *PostCertificatesParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the post certificates params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostCertificatesParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post certificates params
|
||||
func (o *PostCertificatesParams) WithTimeout(timeout time.Duration) *PostCertificatesParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post certificates params
|
||||
func (o *PostCertificatesParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post certificates params
|
||||
func (o *PostCertificatesParams) WithContext(ctx context.Context) *PostCertificatesParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post certificates params
|
||||
func (o *PostCertificatesParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post certificates params
|
||||
func (o *PostCertificatesParams) WithHTTPClient(client *http.Client) *PostCertificatesParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post certificates params
|
||||
func (o *PostCertificatesParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithCertificateRequest adds the certificateRequest to the post certificates params
|
||||
func (o *PostCertificatesParams) WithCertificateRequest(certificateRequest *members_models.CertificateRequest) *PostCertificatesParams {
|
||||
o.SetCertificateRequest(certificateRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetCertificateRequest adds the certificateRequest to the post certificates params
|
||||
func (o *PostCertificatesParams) SetCertificateRequest(certificateRequest *members_models.CertificateRequest) {
|
||||
o.CertificateRequest = certificateRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PostCertificatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.CertificateRequest != nil {
|
||||
if err := r.SetBodyParam(o.CertificateRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,486 +0,0 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// (c) 2012-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package certificates
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
||||
)
|
||||
|
||||
// PostCertificatesReader is a Reader for the PostCertificates structure.
|
||||
type PostCertificatesReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostCertificatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPostCertificatesOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewPostCertificatesUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewPostCertificatesForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewPostCertificatesNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewPostCertificatesUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewPostCertificatesInternalServerError()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostCertificatesOK creates a PostCertificatesOK with default headers values
|
||||
func NewPostCertificatesOK() *PostCertificatesOK {
|
||||
return &PostCertificatesOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostCertificatesOK describes a response with status code 200, with default header values.
|
||||
|
||||
Certificate Response Object
|
||||
*/
|
||||
type PostCertificatesOK struct {
|
||||
Payload *members_models.CertificateResponse
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post certificates o k response has a 2xx status code
|
||||
func (o *PostCertificatesOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post certificates o k response has a 3xx status code
|
||||
func (o *PostCertificatesOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post certificates o k response has a 4xx status code
|
||||
func (o *PostCertificatesOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post certificates o k response has a 5xx status code
|
||||
func (o *PostCertificatesOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post certificates o k response a status code equal to that given
|
||||
func (o *PostCertificatesOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the post certificates o k response
|
||||
func (o *PostCertificatesOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *PostCertificatesOK) Error() string {
|
||||
return fmt.Sprintf("[POST /certificates][%d] postCertificatesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCertificatesOK) String() string {
|
||||
return fmt.Sprintf("[POST /certificates][%d] postCertificatesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCertificatesOK) GetPayload() *members_models.CertificateResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCertificatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.CertificateResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostCertificatesUnauthorized creates a PostCertificatesUnauthorized with default headers values
|
||||
func NewPostCertificatesUnauthorized() *PostCertificatesUnauthorized {
|
||||
return &PostCertificatesUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostCertificatesUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type PostCertificatesUnauthorized struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post certificates unauthorized response has a 2xx status code
|
||||
func (o *PostCertificatesUnauthorized) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post certificates unauthorized response has a 3xx status code
|
||||
func (o *PostCertificatesUnauthorized) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post certificates unauthorized response has a 4xx status code
|
||||
func (o *PostCertificatesUnauthorized) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post certificates unauthorized response has a 5xx status code
|
||||
func (o *PostCertificatesUnauthorized) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post certificates unauthorized response a status code equal to that given
|
||||
func (o *PostCertificatesUnauthorized) IsCode(code int) bool {
|
||||
return code == 401
|
||||
}
|
||||
|
||||
// Code gets the status code for the post certificates unauthorized response
|
||||
func (o *PostCertificatesUnauthorized) Code() int {
|
||||
return 401
|
||||
}
|
||||
|
||||
func (o *PostCertificatesUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[POST /certificates][%d] postCertificatesUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCertificatesUnauthorized) String() string {
|
||||
return fmt.Sprintf("[POST /certificates][%d] postCertificatesUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCertificatesUnauthorized) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCertificatesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostCertificatesForbidden creates a PostCertificatesForbidden with default headers values
|
||||
func NewPostCertificatesForbidden() *PostCertificatesForbidden {
|
||||
return &PostCertificatesForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostCertificatesForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type PostCertificatesForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post certificates forbidden response has a 2xx status code
|
||||
func (o *PostCertificatesForbidden) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post certificates forbidden response has a 3xx status code
|
||||
func (o *PostCertificatesForbidden) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post certificates forbidden response has a 4xx status code
|
||||
func (o *PostCertificatesForbidden) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post certificates forbidden response has a 5xx status code
|
||||
func (o *PostCertificatesForbidden) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post certificates forbidden response a status code equal to that given
|
||||
func (o *PostCertificatesForbidden) IsCode(code int) bool {
|
||||
return code == 403
|
||||
}
|
||||
|
||||
// Code gets the status code for the post certificates forbidden response
|
||||
func (o *PostCertificatesForbidden) Code() int {
|
||||
return 403
|
||||
}
|
||||
|
||||
func (o *PostCertificatesForbidden) Error() string {
|
||||
return fmt.Sprintf("[POST /certificates][%d] postCertificatesForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCertificatesForbidden) String() string {
|
||||
return fmt.Sprintf("[POST /certificates][%d] postCertificatesForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCertificatesForbidden) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCertificatesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// hydrates response header Access-Control-Allow-Origin
|
||||
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
if hdrAccessControlAllowOrigin != "" {
|
||||
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
|
||||
}
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostCertificatesNotFound creates a PostCertificatesNotFound with default headers values
|
||||
func NewPostCertificatesNotFound() *PostCertificatesNotFound {
|
||||
return &PostCertificatesNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostCertificatesNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type PostCertificatesNotFound struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post certificates not found response has a 2xx status code
|
||||
func (o *PostCertificatesNotFound) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post certificates not found response has a 3xx status code
|
||||
func (o *PostCertificatesNotFound) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post certificates not found response has a 4xx status code
|
||||
func (o *PostCertificatesNotFound) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post certificates not found response has a 5xx status code
|
||||
func (o *PostCertificatesNotFound) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post certificates not found response a status code equal to that given
|
||||
func (o *PostCertificatesNotFound) IsCode(code int) bool {
|
||||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the post certificates not found response
|
||||
func (o *PostCertificatesNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *PostCertificatesNotFound) Error() string {
|
||||
return fmt.Sprintf("[POST /certificates][%d] postCertificatesNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCertificatesNotFound) String() string {
|
||||
return fmt.Sprintf("[POST /certificates][%d] postCertificatesNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCertificatesNotFound) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCertificatesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostCertificatesUnprocessableEntity creates a PostCertificatesUnprocessableEntity with default headers values
|
||||
func NewPostCertificatesUnprocessableEntity() *PostCertificatesUnprocessableEntity {
|
||||
return &PostCertificatesUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostCertificatesUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type PostCertificatesUnprocessableEntity struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post certificates unprocessable entity response has a 2xx status code
|
||||
func (o *PostCertificatesUnprocessableEntity) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post certificates unprocessable entity response has a 3xx status code
|
||||
func (o *PostCertificatesUnprocessableEntity) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post certificates unprocessable entity response has a 4xx status code
|
||||
func (o *PostCertificatesUnprocessableEntity) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post certificates unprocessable entity response has a 5xx status code
|
||||
func (o *PostCertificatesUnprocessableEntity) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post certificates unprocessable entity response a status code equal to that given
|
||||
func (o *PostCertificatesUnprocessableEntity) IsCode(code int) bool {
|
||||
return code == 422
|
||||
}
|
||||
|
||||
// Code gets the status code for the post certificates unprocessable entity response
|
||||
func (o *PostCertificatesUnprocessableEntity) Code() int {
|
||||
return 422
|
||||
}
|
||||
|
||||
func (o *PostCertificatesUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[POST /certificates][%d] postCertificatesUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCertificatesUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[POST /certificates][%d] postCertificatesUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCertificatesUnprocessableEntity) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCertificatesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPostCertificatesInternalServerError creates a PostCertificatesInternalServerError with default headers values
|
||||
func NewPostCertificatesInternalServerError() *PostCertificatesInternalServerError {
|
||||
return &PostCertificatesInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostCertificatesInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type PostCertificatesInternalServerError struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post certificates internal server error response has a 2xx status code
|
||||
func (o *PostCertificatesInternalServerError) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post certificates internal server error response has a 3xx status code
|
||||
func (o *PostCertificatesInternalServerError) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post certificates internal server error response has a 4xx status code
|
||||
func (o *PostCertificatesInternalServerError) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post certificates internal server error response has a 5xx status code
|
||||
func (o *PostCertificatesInternalServerError) IsServerError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsCode returns true when this post certificates internal server error response a status code equal to that given
|
||||
func (o *PostCertificatesInternalServerError) IsCode(code int) bool {
|
||||
return code == 500
|
||||
}
|
||||
|
||||
// Code gets the status code for the post certificates internal server error response
|
||||
func (o *PostCertificatesInternalServerError) Code() int {
|
||||
return 500
|
||||
}
|
||||
|
||||
func (o *PostCertificatesInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[POST /certificates][%d] postCertificatesInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCertificatesInternalServerError) String() string {
|
||||
return fmt.Sprintf("[POST /certificates][%d] postCertificatesInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostCertificatesInternalServerError) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostCertificatesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,157 +0,0 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// (c) 2012-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package certificates
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
||||
)
|
||||
|
||||
// NewPutCertificatesParams creates a new PutCertificatesParams 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 NewPutCertificatesParams() *PutCertificatesParams {
|
||||
return &PutCertificatesParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutCertificatesParamsWithTimeout creates a new PutCertificatesParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPutCertificatesParamsWithTimeout(timeout time.Duration) *PutCertificatesParams {
|
||||
return &PutCertificatesParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutCertificatesParamsWithContext creates a new PutCertificatesParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPutCertificatesParamsWithContext(ctx context.Context) *PutCertificatesParams {
|
||||
return &PutCertificatesParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutCertificatesParamsWithHTTPClient creates a new PutCertificatesParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPutCertificatesParamsWithHTTPClient(client *http.Client) *PutCertificatesParams {
|
||||
return &PutCertificatesParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PutCertificatesParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the put certificates operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PutCertificatesParams struct {
|
||||
|
||||
/* CertificateRequest.
|
||||
|
||||
An array of new Certificate records
|
||||
*/
|
||||
CertificateRequest *members_models.CertificateRequest
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the put certificates params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PutCertificatesParams) WithDefaults() *PutCertificatesParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the put certificates params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PutCertificatesParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the put certificates params
|
||||
func (o *PutCertificatesParams) WithTimeout(timeout time.Duration) *PutCertificatesParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the put certificates params
|
||||
func (o *PutCertificatesParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the put certificates params
|
||||
func (o *PutCertificatesParams) WithContext(ctx context.Context) *PutCertificatesParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the put certificates params
|
||||
func (o *PutCertificatesParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the put certificates params
|
||||
func (o *PutCertificatesParams) WithHTTPClient(client *http.Client) *PutCertificatesParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the put certificates params
|
||||
func (o *PutCertificatesParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithCertificateRequest adds the certificateRequest to the put certificates params
|
||||
func (o *PutCertificatesParams) WithCertificateRequest(certificateRequest *members_models.CertificateRequest) *PutCertificatesParams {
|
||||
o.SetCertificateRequest(certificateRequest)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetCertificateRequest adds the certificateRequest to the put certificates params
|
||||
func (o *PutCertificatesParams) SetCertificateRequest(certificateRequest *members_models.CertificateRequest) {
|
||||
o.CertificateRequest = certificateRequest
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PutCertificatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.CertificateRequest != nil {
|
||||
if err := r.SetBodyParam(o.CertificateRequest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1,486 +0,0 @@
|
|||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// (c) 2012-2020 by Taxnexus, Inc.
|
||||
// All rights reserved worldwide.
|
||||
// Proprietary product; unlicensed use is not allowed
|
||||
|
||||
package certificates
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"code.tnxs.net/vernonkeenan/lib/api/members/members_models"
|
||||
)
|
||||
|
||||
// PutCertificatesReader is a Reader for the PutCertificates structure.
|
||||
type PutCertificatesReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PutCertificatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPutCertificatesOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
case 401:
|
||||
result := NewPutCertificatesUnauthorized()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 403:
|
||||
result := NewPutCertificatesForbidden()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 404:
|
||||
result := NewPutCertificatesNotFound()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 422:
|
||||
result := NewPutCertificatesUnprocessableEntity()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
case 500:
|
||||
result := NewPutCertificatesInternalServerError()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, result
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPutCertificatesOK creates a PutCertificatesOK with default headers values
|
||||
func NewPutCertificatesOK() *PutCertificatesOK {
|
||||
return &PutCertificatesOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutCertificatesOK describes a response with status code 200, with default header values.
|
||||
|
||||
Certificate Response Object
|
||||
*/
|
||||
type PutCertificatesOK struct {
|
||||
Payload *members_models.CertificateResponse
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this put certificates o k response has a 2xx status code
|
||||
func (o *PutCertificatesOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this put certificates o k response has a 3xx status code
|
||||
func (o *PutCertificatesOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this put certificates o k response has a 4xx status code
|
||||
func (o *PutCertificatesOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this put certificates o k response has a 5xx status code
|
||||
func (o *PutCertificatesOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this put certificates o k response a status code equal to that given
|
||||
func (o *PutCertificatesOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
// Code gets the status code for the put certificates o k response
|
||||
func (o *PutCertificatesOK) Code() int {
|
||||
return 200
|
||||
}
|
||||
|
||||
func (o *PutCertificatesOK) Error() string {
|
||||
return fmt.Sprintf("[PUT /certificates][%d] putCertificatesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutCertificatesOK) String() string {
|
||||
return fmt.Sprintf("[PUT /certificates][%d] putCertificatesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutCertificatesOK) GetPayload() *members_models.CertificateResponse {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutCertificatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.CertificateResponse)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPutCertificatesUnauthorized creates a PutCertificatesUnauthorized with default headers values
|
||||
func NewPutCertificatesUnauthorized() *PutCertificatesUnauthorized {
|
||||
return &PutCertificatesUnauthorized{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutCertificatesUnauthorized describes a response with status code 401, with default header values.
|
||||
|
||||
Access Unauthorized, invalid API-KEY was used
|
||||
*/
|
||||
type PutCertificatesUnauthorized struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this put certificates unauthorized response has a 2xx status code
|
||||
func (o *PutCertificatesUnauthorized) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this put certificates unauthorized response has a 3xx status code
|
||||
func (o *PutCertificatesUnauthorized) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this put certificates unauthorized response has a 4xx status code
|
||||
func (o *PutCertificatesUnauthorized) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this put certificates unauthorized response has a 5xx status code
|
||||
func (o *PutCertificatesUnauthorized) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this put certificates unauthorized response a status code equal to that given
|
||||
func (o *PutCertificatesUnauthorized) IsCode(code int) bool {
|
||||
return code == 401
|
||||
}
|
||||
|
||||
// Code gets the status code for the put certificates unauthorized response
|
||||
func (o *PutCertificatesUnauthorized) Code() int {
|
||||
return 401
|
||||
}
|
||||
|
||||
func (o *PutCertificatesUnauthorized) Error() string {
|
||||
return fmt.Sprintf("[PUT /certificates][%d] putCertificatesUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutCertificatesUnauthorized) String() string {
|
||||
return fmt.Sprintf("[PUT /certificates][%d] putCertificatesUnauthorized %+v", 401, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutCertificatesUnauthorized) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutCertificatesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPutCertificatesForbidden creates a PutCertificatesForbidden with default headers values
|
||||
func NewPutCertificatesForbidden() *PutCertificatesForbidden {
|
||||
return &PutCertificatesForbidden{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutCertificatesForbidden describes a response with status code 403, with default header values.
|
||||
|
||||
Access forbidden, account lacks access
|
||||
*/
|
||||
type PutCertificatesForbidden struct {
|
||||
AccessControlAllowOrigin string
|
||||
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this put certificates forbidden response has a 2xx status code
|
||||
func (o *PutCertificatesForbidden) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this put certificates forbidden response has a 3xx status code
|
||||
func (o *PutCertificatesForbidden) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this put certificates forbidden response has a 4xx status code
|
||||
func (o *PutCertificatesForbidden) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this put certificates forbidden response has a 5xx status code
|
||||
func (o *PutCertificatesForbidden) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this put certificates forbidden response a status code equal to that given
|
||||
func (o *PutCertificatesForbidden) IsCode(code int) bool {
|
||||
return code == 403
|
||||
}
|
||||
|
||||
// Code gets the status code for the put certificates forbidden response
|
||||
func (o *PutCertificatesForbidden) Code() int {
|
||||
return 403
|
||||
}
|
||||
|
||||
func (o *PutCertificatesForbidden) Error() string {
|
||||
return fmt.Sprintf("[PUT /certificates][%d] putCertificatesForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutCertificatesForbidden) String() string {
|
||||
return fmt.Sprintf("[PUT /certificates][%d] putCertificatesForbidden %+v", 403, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutCertificatesForbidden) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutCertificatesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// hydrates response header Access-Control-Allow-Origin
|
||||
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
|
||||
|
||||
if hdrAccessControlAllowOrigin != "" {
|
||||
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
|
||||
}
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPutCertificatesNotFound creates a PutCertificatesNotFound with default headers values
|
||||
func NewPutCertificatesNotFound() *PutCertificatesNotFound {
|
||||
return &PutCertificatesNotFound{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutCertificatesNotFound describes a response with status code 404, with default header values.
|
||||
|
||||
Resource was not found
|
||||
*/
|
||||
type PutCertificatesNotFound struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this put certificates not found response has a 2xx status code
|
||||
func (o *PutCertificatesNotFound) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this put certificates not found response has a 3xx status code
|
||||
func (o *PutCertificatesNotFound) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this put certificates not found response has a 4xx status code
|
||||
func (o *PutCertificatesNotFound) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this put certificates not found response has a 5xx status code
|
||||
func (o *PutCertificatesNotFound) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this put certificates not found response a status code equal to that given
|
||||
func (o *PutCertificatesNotFound) IsCode(code int) bool {
|
||||
return code == 404
|
||||
}
|
||||
|
||||
// Code gets the status code for the put certificates not found response
|
||||
func (o *PutCertificatesNotFound) Code() int {
|
||||
return 404
|
||||
}
|
||||
|
||||
func (o *PutCertificatesNotFound) Error() string {
|
||||
return fmt.Sprintf("[PUT /certificates][%d] putCertificatesNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutCertificatesNotFound) String() string {
|
||||
return fmt.Sprintf("[PUT /certificates][%d] putCertificatesNotFound %+v", 404, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutCertificatesNotFound) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutCertificatesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPutCertificatesUnprocessableEntity creates a PutCertificatesUnprocessableEntity with default headers values
|
||||
func NewPutCertificatesUnprocessableEntity() *PutCertificatesUnprocessableEntity {
|
||||
return &PutCertificatesUnprocessableEntity{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutCertificatesUnprocessableEntity describes a response with status code 422, with default header values.
|
||||
|
||||
Unprocessable Entity, likely a bad parameter
|
||||
*/
|
||||
type PutCertificatesUnprocessableEntity struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this put certificates unprocessable entity response has a 2xx status code
|
||||
func (o *PutCertificatesUnprocessableEntity) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this put certificates unprocessable entity response has a 3xx status code
|
||||
func (o *PutCertificatesUnprocessableEntity) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this put certificates unprocessable entity response has a 4xx status code
|
||||
func (o *PutCertificatesUnprocessableEntity) IsClientError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsServerError returns true when this put certificates unprocessable entity response has a 5xx status code
|
||||
func (o *PutCertificatesUnprocessableEntity) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this put certificates unprocessable entity response a status code equal to that given
|
||||
func (o *PutCertificatesUnprocessableEntity) IsCode(code int) bool {
|
||||
return code == 422
|
||||
}
|
||||
|
||||
// Code gets the status code for the put certificates unprocessable entity response
|
||||
func (o *PutCertificatesUnprocessableEntity) Code() int {
|
||||
return 422
|
||||
}
|
||||
|
||||
func (o *PutCertificatesUnprocessableEntity) Error() string {
|
||||
return fmt.Sprintf("[PUT /certificates][%d] putCertificatesUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutCertificatesUnprocessableEntity) String() string {
|
||||
return fmt.Sprintf("[PUT /certificates][%d] putCertificatesUnprocessableEntity %+v", 422, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutCertificatesUnprocessableEntity) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutCertificatesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPutCertificatesInternalServerError creates a PutCertificatesInternalServerError with default headers values
|
||||
func NewPutCertificatesInternalServerError() *PutCertificatesInternalServerError {
|
||||
return &PutCertificatesInternalServerError{}
|
||||
}
|
||||
|
||||
/*
|
||||
PutCertificatesInternalServerError describes a response with status code 500, with default header values.
|
||||
|
||||
Server Internal Error
|
||||
*/
|
||||
type PutCertificatesInternalServerError struct {
|
||||
Payload *members_models.Error
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this put certificates internal server error response has a 2xx status code
|
||||
func (o *PutCertificatesInternalServerError) IsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this put certificates internal server error response has a 3xx status code
|
||||
func (o *PutCertificatesInternalServerError) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this put certificates internal server error response has a 4xx status code
|
||||
func (o *PutCertificatesInternalServerError) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this put certificates internal server error response has a 5xx status code
|
||||
func (o *PutCertificatesInternalServerError) IsServerError() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsCode returns true when this put certificates internal server error response a status code equal to that given
|
||||
func (o *PutCertificatesInternalServerError) IsCode(code int) bool {
|
||||
return code == 500
|
||||
}
|
||||
|
||||
// Code gets the status code for the put certificates internal server error response
|
||||
func (o *PutCertificatesInternalServerError) Code() int {
|
||||
return 500
|
||||
}
|
||||
|
||||
func (o *PutCertificatesInternalServerError) Error() string {
|
||||
return fmt.Sprintf("[PUT /certificates][%d] putCertificatesInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutCertificatesInternalServerError) String() string {
|
||||
return fmt.Sprintf("[PUT /certificates][%d] putCertificatesInternalServerError %+v", 500, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PutCertificatesInternalServerError) GetPayload() *members_models.Error {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PutCertificatesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(members_models.Error)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue